/* ThinkBlue pilot — a quiet desktop review tool. Sidebar · list · canvas, status bar below. One accent: Approve.
   Structure carries the hierarchy: no cards, no chips, no gradients, nothing floating over the work. */
:root {
  --bg: #ffffff; --side: #f5f5f3; --sel: #e9e9e6; --row: #f3f3f0; --frame: #fafaf8;
  --line: #e7e7e3; --line-2: #d9d9d5; --ink: #1a1a19; --ink-2: #5d5d58; --faint: #72726c;
  --approve: #1d6a46; --approve-h: #175a3b; --warn: #8a5a12; --bad: #a03a2c; --warn-bg: #fbf7ef; --bad-bg: #fbf3f1;
  --side-w: 196px; --list-w: 288px; --radius: 5px;
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; accent-color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: #fff; padding: 6px 10px; border: 1px solid var(--line); }
.skip:focus { left: 8px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--faint); }
.fine { font-size: 12.5px; color: var(--faint); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 28px; height: 100vh; height: 100dvh; }
.side { grid-row: 1; background: var(--side); display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.view { grid-row: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.statusbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 0 14px; border-top: 1px solid var(--line); background: var(--side); font-size: 12px; color: var(--faint); min-width: 0; }
.statusbar .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #b9b9b3; margin-right: 6px; vertical-align: 1px; }
.dot.on { background: var(--ink); animation: pulse 1.6s ease-in-out infinite; }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot.on { animation: none; } }

/* ---------- sidebar ---------- */
.ws { padding: 16px 12px 14px 16px; border-bottom: 1px solid var(--line); }
.ws-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.ws-role { font-size: 12px; color: var(--faint); margin-top: 3px; }
.ws select { width: 100%; margin-top: 8px; font-size: 12.5px; padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 4px; background: #fff; }
.nav { padding: 10px 6px; display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; justify-content: space-between; align-items: center; height: 30px; padding: 0 10px; border-radius: var(--radius); text-decoration: none; font-size: 13.5px; }
.nav a:hover { background: rgba(0, 0, 0, .04); }
.nav a[aria-current="page"] { background: var(--sel); }
.nav .count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; padding: 10px 6px 12px; border-top: 1px solid var(--line); }
.side-foot .who { padding: 6px 10px 2px; font-size: 12px; color: var(--faint); overflow-wrap: anywhere; }
.linkbtn { border: 0; background: none; padding: 4px 10px; color: var(--ink-2); font-size: 12.5px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* ---------- headers, buttons, forms ---------- */
.head { height: 58px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--line); }
.head h1 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -.005em; }
.head .actions { display: flex; gap: 6px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--frame); border-color: #bdbdb7; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #33332f; }
.btn.approve { background: var(--approve); border-color: var(--approve); color: #fff; }
.btn.approve:hover { background: var(--approve-h); }
.btn.quiet { border-color: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: rgba(0, 0, 0, .04); }
.btn.danger { color: var(--bad); }
label.field { display: block; font-size: 12.5px; color: var(--ink-2); margin: 0 0 14px; }
label.field > span { display: block; margin-bottom: 5px; }
.field input:not([type=checkbox]):not([type=file]), .field textarea, .field select { display: block; width: 100%; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 4px; background: #fff; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--ink); }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; margin: 6px 0; }
.check input { margin-top: 3px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 18px; }
.hint { font-size: 12px; color: var(--faint); margin: -8px 0 14px; }

/* ---------- notices (in layout, never floating) ---------- */
.notice { padding: 10px 28px; font-size: 13px; border-bottom: 1px solid var(--line); background: var(--frame); }
.notice.warn { background: var(--warn-bg); color: #5f430f; }
.notice.bad { background: var(--bad-bg); color: #7c2a1f; }
.notice.ok { background: #f2f7f3; color: #1f4f35; }
.notice .linkbtn { padding: 0 0 0 8px; }
.inline-note { font-size: 12.5px; color: var(--ink-2); padding: 10px 12px; border-left: 2px solid var(--line-2); margin: 12px 0; background: var(--frame); }
.inline-note.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.inline-note.bad { border-left-color: var(--bad); background: var(--bad-bg); }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; padding: 6px 8px; background: #fff; border: 1px solid var(--line-2); border-radius: 4px; user-select: all; overflow-wrap: anywhere; display: block; margin: 6px 0; }

/* ---------- three-pane review ---------- */
.split { display: grid; grid-template-columns: var(--list-w) minmax(0, 1fr); flex: 1; min-height: 0; }
.list { border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 8px 20px; }
.list-label { font-size: 11.5px; color: var(--faint); padding: 12px 10px 6px; display: flex; justify-content: space-between; }
.list-label:first-child { padding-top: 2px; }
.item { display: block; width: 100%; text-align: left; border: 0; background: none; border-radius: var(--radius); padding: 11px 10px; cursor: pointer; text-decoration: none; }
.item:hover { background: var(--row); }
.item[aria-current="true"] { background: var(--sel); }
.item strong { display: block; font-size: 13px; font-weight: 560; line-height: 1.35; }
.item span { display: block; font-size: 12px; color: var(--ink-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item small { display: block; font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.canvas { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; }
.pad { padding: 26px 32px 40px; }
.narrow { max-width: 820px; }
.eyebrow { font-size: 11.5px; color: var(--faint); margin-bottom: 6px; }
.title { font-size: 24px; font-weight: 560; letter-spacing: -.02em; line-height: 1.25; margin: 0 0 8px; }
.lede { color: var(--ink-2); max-width: 680px; margin: 0 0 18px; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 18px 0 22px; }
.tabs button { border: 0; background: none; padding: 0 0 10px; font-size: 13px; color: var(--faint); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.compare.no-images .photo { aspect-ratio: auto; height: 64px; min-height: 0; }
.page { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; min-width: 0; }
.page-label { display: flex; justify-content: space-between; padding: 9px 14px; font-size: 12px; color: var(--ink-2); border-bottom: 1px solid var(--line); background: var(--frame); }
.page.proposed .page-label { color: var(--ink); font-weight: 560; }
.photo { aspect-ratio: 4 / 3; background: var(--frame); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: contain; }
.photo .none { font-size: 12.5px; color: var(--faint); }
.copy { padding: 18px 20px 22px; }
.copy p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.7; overflow-wrap: anywhere; }
.copy h4 { font-size: 12px; font-weight: 600; margin: 14px 0 6px; }
.copy ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.copy .cap { font-size: 12px; color: var(--faint); }
.changed { background: #eef5ef; }
.decision { flex: none; border-top: 1px solid var(--line); padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #fff; flex-wrap: wrap; }
.decision .checks { display: flex; flex-direction: column; gap: 2px; }
.decision .buttons { display: flex; gap: 6px; }
.facts { display: grid; grid-template-columns: 150px 1fr; gap: 6px 18px; font-size: 13px; margin: 0; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.status-present { color: var(--ink); } .status-missing { color: var(--warn); } .status-unknown { color: var(--faint); font-style: italic; }
blockquote.ev { margin: 0 0 14px; padding: 2px 0 2px 14px; border-left: 2px solid var(--line-2); font-size: 14px; line-height: 1.6; }
blockquote.ev footer { font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.bars { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 14px 0 26px; }
.bar label { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.bar div { height: 6px; background: var(--row); margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--ink-2); }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.steps .mark { width: 16px; color: var(--faint); flex: none; }
.steps .mark.done { color: var(--approve); } .steps .mark.failed { color: var(--bad); }
section.block { margin: 0 0 32px; }
section.block > h2 { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font-weight: 500; color: var(--faint); font-size: 12px; padding: 0 12px 8px 0; border-bottom: 1px solid var(--line); }
table.grid td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover td { background: var(--frame); }
.thumb { width: 44px; height: 44px; object-fit: contain; background: var(--frame); border: 1px solid var(--line); border-radius: 3px; display: block; }
.thumb.empty { display: grid; place-items: center; font-size: 10px; color: var(--faint); }
.empty-state { max-width: 520px; padding: 64px 32px; }
.empty-state h2 { font-size: 22px; font-weight: 560; letter-spacing: -.02em; margin: 0 0 10px; }
.empty-state p { color: var(--ink-2); margin: 0 0 16px; }
.empty-state ol { color: var(--ink-2); padding-left: 18px; margin: 0 0 18px; }
.gallery { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery figure { margin: 0; width: 150px; }
.gallery img { width: 150px; height: 112px; object-fit: contain; background: var(--frame); border: 1px solid var(--line); border-radius: 3px; }
.gallery figcaption { font-size: 11.5px; color: var(--faint); }

/* ---------- team lead ---------- */
.thread { max-width: 760px; margin: 0 auto; padding: 22px 28px 30px; }
.msg { margin: 18px 0; }
.msg .meta { font-size: 11.5px; color: var(--faint); margin-bottom: 4px; }
.msg.user { display: flex; flex-direction: column; align-items: flex-end; }
.msg.user .body { background: var(--row); padding: 8px 12px; border-radius: 6px; max-width: 82%; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.msg .started { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); border-left: 2px solid var(--line-2); padding-left: 10px; }
.composer { flex: none; width: calc(100% - 56px); max-width: 760px; margin: 0 auto 18px; border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 8px 6px 12px; background: #fff; }
.composer textarea { width: 100%; border: 0; outline: 0; resize: none; min-height: 44px; max-height: 30vh; font-size: 14px; line-height: 1.5; background: transparent; }
.composer .bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------- sign-in ---------- */
.gate { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.gate-box { width: 100%; max-width: 420px; }
.gate-box h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 8px; }
.gate-box p { color: var(--ink-2); margin: 0 0 18px; }

/* ---------- dialog (in-app; replaces every native prompt/confirm) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(26, 26, 25, .28); display: grid; place-items: center; padding: 20px; z-index: 40; }
.dialog { width: 100%; max-width: 460px; max-height: calc(100vh - 40px); overflow-y: auto; background: #fff; border-radius: 6px; border: 1px solid var(--line-2); padding: 20px 22px 18px; box-shadow: 0 12px 40px rgba(26, 26, 25, .16); }
.dialog h2 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.dialog > p { color: var(--ink-2); font-size: 13px; margin: 0 0 16px; }
.dialog .buttons { display: flex; justify-content: flex-end; gap: 6px; margin-top: 18px; }
.dialog .choices { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }

/* ---------- small utilities (no inline styles anywhere: CSP style-src 'self') ---------- */
.px { padding: 0 10px; } .mt { margin-top: 14px; } .mt-lg { margin-top: 24px; } .mb { margin-bottom: 12px; }
.inline-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.push { margin-left: auto; white-space: nowrap; }
.empty-inline { padding: 24px 0; }
.block-sep { border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.ref-photo { max-width: 360px; margin-top: 10px; border: 1px solid var(--line); display: block; }
.badge { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 3px; background: var(--sel); color: var(--ink); margin-right: 4px; }
.gallery figure.is-ref img { border-color: var(--ink); }
.h-sub { font-size: 13px; margin: 20px 0 10px; }
.bar i { width: 0; }

@media (max-width: 1100px) { :root { --list-w: 248px; } .compare { gap: 16px; } .pad { padding: 22px 22px 32px; } .head { padding: 0 20px; } .decision { padding: 12px 20px; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) 28px; }
  .side { grid-row: 1; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 0; padding: 0 6px 6px; border-top: 0; }
  .side-foot .who { display: none; } .side-foot .nav { padding: 0; }
  .view { grid-row: 2; } .split { grid-template-columns: 1fr; } .list { max-height: 34vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .compare { grid-template-columns: 1fr; } .bars { grid-template-columns: 1fr; }
  .scrim { place-items: end center; padding: 0; } .dialog { max-width: none; border-radius: 6px 6px 0 0; }
  .head { height: auto; min-height: 58px; flex-wrap: wrap; padding: 10px 16px; } .head .actions { flex-wrap: wrap; }
  .decision { padding: 12px 16px; } .pad { padding: 18px 16px 28px; } .composer { width: calc(100% - 24px); }
}
