/* v0.16.0 layout (Harry 20 Oct 2026): left sidebar of areas, clickable rows, shift page. Loaded after styles.css. */
:root { --side-w: 232px; --top-h: 58px; --side-bg: #111418; --side-fg: #c9d1d9; --side-active: #1f6f4a; --row-hover: #f2f7f4; }
body { padding-left: var(--side-w); }
header#top { position: sticky; top: 0; z-index: 30; }
#nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 22px; padding: 4px 10px; cursor: pointer; }
nav#nav { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); overflow-y: auto; background: var(--side-bg); color: var(--side-fg);
  padding: calc(var(--top-h) + 8px) 10px 24px; z-index: 25; display: block; box-sizing: border-box; }
nav#nav .side-group { margin-bottom: 6px; }
nav#nav .side-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: #fff; font: 600 14px/1.2 inherit;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
nav#nav .side-head:hover { background: rgba(255,255,255,.06); }
nav#nav .side-group.has-active > .side-head { color: #7ee2a8; }
nav#nav .side-list { display: flex; flex-direction: column; padding: 2px 0 4px 30px; }
nav#nav .side-group.collapsed > .side-list { display: none; }
nav#nav .side-list a { color: var(--side-fg); text-decoration: none; padding: 7px 10px; border-radius: 6px; font-size: 14px; }
nav#nav .side-list a:hover { background: rgba(255,255,255,.06); color: #fff; }
nav#nav .side-list a.active { background: var(--side-active); color: #fff; font-weight: 600; }
#nav-scrim { display: none; }
main#main { max-width: 1200px; margin: 0 auto; padding: 16px 20px 40px; }

/* Clickable rows */
table.rows-link tbody tr.row-link { cursor: pointer; }
table.rows-link tbody tr.row-link:hover, table.rows-link tbody tr.row-link:focus { background: var(--row-hover); outline: none; }
table.rows-link tbody tr.row-link:focus-visible { outline: 2px solid var(--side-active); outline-offset: -2px; }
table.rows-link tbody tr.row-link td:first-child { font-weight: 600; }

/* Board tabs and filters */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #dfe3e8; margin: 4px 0 12px; }
.tabs a { padding: 8px 14px; text-decoration: none; color: #555; border-bottom: 3px solid transparent; font-weight: 600; }
.tabs a.active { color: #111; border-bottom-color: var(--side-active); }
.filters .clear-link { margin-left: 6px; align-self: center; }

/* Shift page */
.crumbs { margin: 0 0 4px; font-size: 14px; }
.subtitle { margin: -4px 0 14px; color: #555; }
dl.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 24px; margin: 0; }
dl.facts .kv dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; margin: 0; }
dl.facts .kv dd { margin: 2px 0 0; font-size: 15px; }

/* iPad and phone: sidebar slides in from the left */
@media (max-width: 1024px) {
  body { padding-left: 0; }
  #nav-toggle { display: inline-block; }
  nav#nav { transform: translateX(-100%); transition: transform .2s ease; padding-top: 16px; z-index: 40; }
  body.nav-open nav#nav { transform: translateX(0); }
  body.nav-open #nav-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  main#main { padding: 12px 12px 32px; }
}
nav#nav { flex-wrap: nowrap; margin: 0; gap: 0; }
nav#nav .side-list a { min-height: 0; border-bottom: 0; white-space: normal; display: block; }
/* Page-level search (v0.16.0): sits at the top of the list it searches. */
.page-search { width: 100%; max-width: 560px; font-size: 16px; padding: 10px 12px; border: 1px solid #cfd6de; border-radius: 8px; margin: 0 0 10px; box-sizing: border-box; }
#alarms > section { margin-top: 18px; }
#alarms > section h2 { font-size: 1.15rem; }

/* ---- v0.16.0 milestone 2: Today, compliance, timeline, bulk ---- */
:root { --green: #1f7a4d; --green-bg: #e7f5ed; --amber: #9a6200; --amber-bg: #fff4dc; --red: #b42318; --red-bg: #fdeceb; --line: #e3e7ec; --ink-2: #5b6573; }
/* Figures strip */
.figures { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 6px 0 22px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.tile-value { font: 600 28px/1.1 Poppins, system-ui, sans-serif; letter-spacing: -.01em; }
.tile-label { font-weight: 600; margin-top: 4px; }
.tile-sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.tile.good .tile-value { color: var(--green); }
.tile.bad .tile-value { color: var(--red); }
/* Work list */
ol.worklist { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.wl-item + .wl-item { border-top: 1px solid var(--line); }
.wl-item a { display: grid; grid-template-columns: 92px 1fr; gap: 2px 12px; padding: 12px 16px; color: inherit; text-decoration: none; }
.wl-item a:hover, .wl-item a:focus { background: var(--row-hover); }
.wl-band { grid-row: span 2; align-self: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 4px 8px; border-radius: 999px; text-align: center; background: #eef1f4; color: var(--ink-2); }
.wl-u0 .wl-band, .wl-u1 .wl-band { background: var(--red-bg); color: var(--red); }
.wl-u2 .wl-band, .wl-u3 .wl-band { background: var(--amber-bg); color: var(--amber); }
.wl-title { font-weight: 600; }
.wl-detail { color: var(--ink-2); font-size: 14px; }
/* Red / amber / green */
.rag-box { margin: 6px 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.rag { display: inline-block; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.rag-green { color: var(--green); background: var(--green-bg); }
.rag-amber { color: var(--amber); background: var(--amber-bg); }
.rag-red { color: var(--red); background: var(--red-bg); }
.rag-summary { color: var(--ink-2); }
.rag-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; padding: 0; background: none; }
.rag-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
/* Timeline */
ol.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
ol.timeline li { display: grid; grid-template-columns: 96px 150px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tl-kind { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
ol.timeline time { color: var(--ink-2); font-size: 14px; }
/* Bulk bar and shift actions */
.bulk-bar { position: sticky; top: calc(var(--top-h) + 4px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #111418; color: #fff; padding: 10px 14px; border-radius: 10px; margin: 0 0 10px; }
.bulk-bar button { margin: 0; }
button.warn, .bulk-bar button.warn { background: var(--amber-bg); color: var(--amber); border-color: #f0d49a; }
.shift-actions { margin: 4px 0 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.notice.warn { background: var(--amber-bg); border-color: #f0d49a; color: #5c3b00; }
.notice { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: #f6f8fa; margin: 0 0 10px; }
input[data-pick] { width: 18px; height: 18px; }
#worker-page .tabs { margin-top: 12px; }
@media (max-width: 1024px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  ol.timeline li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 640px) {
  .who-name, .who-role { display: none; }
  .brand .by { display: none; }
  .hdr-tools { gap: 4px; }
}

/* PloughBot conversations (v0.16.0) */
.pb3 .pb-top p { max-width: 70ch; margin-top: 0; }
.pb-grid3 { display: grid; grid-template-columns: 240px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.pb-grid3 .panel { margin: 0 0 16px; }
.pb-lefthead, .pb-midhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pb-lefthead h3, .pb-midhead h3 { margin: 0; }
.pb-lefthead .primary { padding: 6px 10px; font-size: 13px; }
.pb-threads { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; max-height: 70vh; overflow: auto; }
.pb-trow { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.pb-trow:hover { background: rgba(0,0,0,.04); }
.pb-trow.active { background: rgba(37,99,235,.08); border-color: rgba(37,99,235,.3); }
.pb-ttitle { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-mid { display: flex; flex-direction: column; min-height: 70vh; }
.pb-chat { flex: 1; overflow: auto; max-height: 62vh; padding: 12px 2px; display: flex; flex-direction: column; gap: 10px; }
.pb-msg { display: flex; }
.pb-msg.me { justify-content: flex-end; }
.pb-bubble { max-width: 82%; padding: 10px 12px; border-radius: 12px; background: #f3f4f6; white-space: pre-wrap; word-wrap: break-word; }
.pb-msg.me .pb-bubble { background: #2563eb; color: #fff; }
.pb-msg.me .pb-meta { color: rgba(255,255,255,.8); }
.pb-bubble.failed { border: 1px solid #fca5a5; }
.pb-meta { margin-bottom: 4px; }
.pb-typing { font-style: italic; }
.pb-steps { margin-top: 8px; font-size: 13px; white-space: normal; }
.pb-steps summary { cursor: pointer; color: #6b7280; }
.pb-hello { margin: auto; text-align: center; max-width: 44ch; }
.pb-form { border-top: 1px solid #e5e7eb; padding-top: 10px; }
.pb-form textarea { width: 100%; box-sizing: border-box; }
.pb-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.pb-spacer { flex: 1; }
.pb-team { display: flex; flex-direction: column; gap: 2px; }
.pb-member { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; text-align: left; padding: 7px 8px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; }
.pb-member:hover { background: rgba(0,0,0,.04); }
.pb-member.active { border-color: rgba(37,99,235,.35); background: rgba(37,99,235,.06); }
.pb-member.sub { margin-left: 16px; }
.pb-member.code { grid-template-columns: 1fr auto; margin-top: 8px; border-top: 1px solid #e5e7eb; border-radius: 0; }
.pb-mname { font-weight: 600; }
.pb-dot { width: 9px; height: 9px; border-radius: 50%; background: #d1d5db; display: inline-block; }
.pb-dot.on { background: #16a34a; }
.small { font-size: 12px; }
.pb-fold summary { cursor: pointer; font-weight: 600; }
.pb-screen:empty { display: none; }
@media (max-width: 1100px) { .pb-grid3 { grid-template-columns: 200px minmax(0, 1fr); } .pb-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; } }
@media (max-width: 720px) { .pb-grid3 { grid-template-columns: 1fr; } .pb-threads { max-height: 30vh; } .pb-bubble { max-width: 92%; } .pb-mid { min-height: 0; } }
@media (prefers-color-scheme: dark) { .pb-bubble { background: #1f2937; } .pb-trow:hover, .pb-member:hover { background: rgba(255,255,255,.06); } .pb-form, .pb-member.code { border-color: #374151; } }
.pb-trow .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-member.code { grid-template-columns: 1fr; }
.pb-grid3 { grid-template-columns: 250px minmax(0, 1fr) 280px; }
@media (max-width: 1100px) { .pb-grid3 { grid-template-columns: 220px minmax(0, 1fr); } }
@media (max-width: 720px) { .pb-grid3 { grid-template-columns: 1fr; } .pb-right { grid-template-columns: 1fr; } .pb-chat { max-height: 55vh; } }
/* Propose panel and playbooks (v0.16.0) */
.propose-panel { border-left: 4px solid #2563eb; }
.propose-panel input[type=text] { width: 100%; box-sizing: border-box; margin-top: 8px; }
.propose-panel .check { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-weight: 600; }
button.small { padding: 4px 10px; font-size: 13px; }
.playbook label { display: block; margin-top: 10px; font-weight: 600; font-size: 13px; }
.playbook input, .playbook textarea, #pb-model { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; font-weight: 400; }
.playbook h3 .pill { margin-left: 6px; vertical-align: middle; }
/* Polish (v0.16.0): tab rows scroll on their own on small screens instead of widening the page */
.tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap; white-space: nowrap; }
.tabs::-webkit-scrollbar { display: none; }

/* v0.16.1: keep mobile forms clear; the header phone button opens the same panel. */
@media (max-width: 720px) {
  #phone-fab { display: none; }
  #proposal-history input, #proposal-history textarea, #proposal-history select { width: 100%; box-sizing: border-box; margin: 6px 0; }
  .propose-panel { scroll-margin-top: 80px; }
}
.playbook[data-dirty="true"] { border-left: 4px solid #b45309; }
/* v0.16.3: [hidden] must beat the layout rules (Chief of Staff replaces the conversations, it doesn't sit under them). */
.pb-grid3[hidden], #pb-chief[hidden], .pb-grid[hidden] { display: none !important; }
