/* Shortlist — the panes, the list, briefs, the editor, sheets, the palette, Compare and the phone layout.
   Tokens, the desktop, menu bar, window frame and dock are in base.css. */

/* ---- shared controls ---------------------------------------------------------------------------- */
.tool {
  display: inline-grid; place-items: center; flex: none; width: 30px; height: 28px; border-radius: 6px; color: var(--ink-2);
}
.tool:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--hover); }
.tool:active:not(:disabled) { background: var(--press); }
.tool:disabled, .tool[aria-disabled="true"] { color: var(--ink-4); }
.tool .icon { width: 18px; height: 18px; }
.tool--label { display: inline-flex; gap: 5px; width: auto; height: 28px; padding: 0 9px; font-size: 12.5px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.tool--label .icon { width: 15px; height: 15px; }
.tool--label[aria-pressed="true"] { color: var(--ink); background: var(--hover); }
.tool--menu .icon:last-child { width: 12px; height: 12px; margin-left: -1px; color: var(--ink-3); }
.tool-sep { width: 1px; height: 18px; margin: 0 5px; background: var(--line-2); flex: none; }
.spacer { flex: 1; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 7px;
  font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--ink);
  background: var(--window); box-shadow: 0 0 0 .5px var(--line-2), 0 1px 1.5px rgba(0, 0, 0, .07);
}
.button:hover { background: color-mix(in srgb, var(--window) 92%, var(--ink)); }
.button .icon { width: 15px; height: 15px; color: var(--ink-3); }
.button--primary { background: var(--accent-fill); color: #1d1d1f; font-weight: 600; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12); }
.button--primary:hover { background: color-mix(in srgb, var(--accent-fill) 88%, #000); }
.button--danger { background: var(--bad); color: #fff; box-shadow: none; }
.button--danger:hover { background: color-mix(in srgb, var(--bad) 88%, #000); }
.button--quiet { background: transparent; box-shadow: none; color: var(--ink-2); padding: 0 9px; }
.button--quiet:hover { background: var(--hover); }

kbd { font: 600 11.5px/1 var(--ui); }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }

.state-glyph { width: 12px; height: 12px; }
.state--committed, .glyph-committed, .funnel--committed { color: var(--accent); }
:root[data-theme="dark"] .state--committed, :root[data-theme="dark"] .glyph-committed, :root[data-theme="dark"] .funnel--committed { color: var(--accent-ink); }

/* Theme tints: only on sidebar dots and theme chips */
.t-ai-models { --tint: var(--t-ai-models); } .t-ai-infrastructure { --tint: var(--t-ai-infrastructure); }
.t-developer-tools { --tint: var(--t-developer-tools); } .t-work-and-enterprise { --tint: var(--t-work-and-enterprise); }
.t-government-and-defense { --tint: var(--t-government-and-defense); } .t-industry-and-robotics { --tint: var(--t-industry-and-robotics); }
.t-energy-and-climate { --tint: var(--t-energy-and-climate); } .t-space { --tint: var(--t-space); } .t-finance { --tint: var(--t-finance); }
.t-health-and-bio { --tint: var(--t-health-and-bio); } .t-consumer-and-education { --tint: var(--t-consumer-and-education); }
.theme-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--tint, var(--ink-4)); flex: none; }

/* ---- menu bar additions ------------------------------------------------------------------------- */
.menubar-brand .brand-mark { color: var(--menubar-ink); }
.menubar-app { font-weight: 700; }
.funnel { gap: 9px; padding: 0 10px; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.funnel-part { display: inline-flex; align-items: center; gap: 3px; }
.menubar-clock { padding: 0 8px 0 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.menubar-item .icon { width: 16px; height: 16px; }

/* ---- dock additions ----------------------------------------------------------------------------- */
.dock-glyph--compare { background: linear-gradient(180deg, #4f7be3, #2f56c4); }
.dock-glyph--compare .icon { width: 26px; height: 26px; stroke-width: 1.6; }
.dock-glyph--trash { background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(228, 228, 234, .78)); color: #55555a; }
:root[data-theme="dark"] .dock-glyph--trash { background: linear-gradient(180deg, rgba(90, 90, 96, .9), rgba(60, 60, 66, .9)); color: #d5d5da; }
.dock-mini { width: 54px; }
.mini-window { display: flex; flex-direction: column; width: 50px; height: 38px; border-radius: 6px; overflow: hidden; background: var(--editor); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .25), 0 3px 8px rgba(0, 0, 0, .18); }
.mini-bar { display: flex; gap: 2px; align-items: center; height: 9px; padding: 0 4px; background: var(--sidebar-solid); }
.mini-bar i { width: 3px; height: 3px; border-radius: 50%; background: #ff5f57; }
.mini-bar i + i { background: #febc2e; } .mini-bar i + i + i { background: #28c840; }
.mini-lines { flex: 1; margin: 5px 6px; background: repeating-linear-gradient(180deg, var(--line-2) 0 1.5px, transparent 1.5px 5px); }
.mini-window--compare .mini-lines { background: linear-gradient(90deg, transparent 32%, var(--line-2) 32% 34%, transparent 34% 66%, var(--line-2) 66% 68%, transparent 68%), repeating-linear-gradient(180deg, var(--line-2) 0 1.5px, transparent 1.5px 5px); }

/* ---- the Notes window ----------------------------------------------------------------------------- */
.window-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.notes {
  position: relative; flex: 1; min-height: 0; display: grid;
  grid-template-columns: var(--sw, 220px) 1px var(--lw, 300px) 1px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
}
.notes.no-sidebar { grid-template-columns: 0 0 var(--lw, 300px) 1px minmax(0, 1fr); }
.notes.no-sidebar .sidebar, .notes.no-sidebar [data-divider="sidebar"] { display: none; }
.mbar { display: none; }
/* Fixed columns, so hiding the sidebar never shifts the list into its empty track. */
.notes > .sidebar { grid-column: 1; grid-row: 1; }
.notes > [data-divider="sidebar"] { grid-column: 2; grid-row: 1; }
.notes > .list-pane { grid-column: 3; grid-row: 1; }
.notes > [data-divider="list"] { grid-column: 4; grid-row: 1; }
.notes > .content-pane { grid-column: 5; grid-row: 1; }
.pane-top { flex: none; display: flex; align-items: center; gap: 4px; height: var(--toolbar-h); padding: 0 10px; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; min-width: 0; background: var(--sidebar); -webkit-backdrop-filter: saturate(1.6) blur(30px); backdrop-filter: saturate(1.6) blur(30px); }
.sidebar-top { justify-content: flex-end; padding-right: 8px; }
.sidebar-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; padding: 0 10px 12px; overscroll-behavior: contain; }
.side-tree { outline: none; }
.side-section + .side-section { margin-top: 14px; }
.side-head { padding: 0 8px 3px; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.side-item { display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 8px; border-radius: 6px; white-space: nowrap; }
.side-item[aria-level="2"] { padding-left: 30px; }
.side-item:focus-visible { outline-offset: -2px; }
.side-item.is-selected { background: var(--select-quiet); }
.side-tree:focus-within .side-item.is-selected { background: var(--select); }
.side-icon { display: grid; place-items: center; width: 18px; height: 18px; flex: none; color: var(--accent); }
:root[data-theme="dark"] .side-icon { color: var(--accent-ink); }
.side-icon .icon { width: 17px; height: 17px; }
.side-item[data-folder="exploring"] .side-icon, .side-item[data-folder="testing"] .side-icon, .side-item[data-folder="passed"] .side-icon { color: var(--ink-2); }
.side-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side-count { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.side-unread { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.side-disclosure { display: grid; place-items: center; width: 12px; margin-left: -6px; margin-right: -4px; color: var(--ink-3); }
.side-disclosure .icon { width: 12px; height: 12px; stroke-width: 2; }
.side-item[aria-expanded="true"] .side-disclosure .icon { transform: rotate(90deg); }
.sidebar-foot { flex: none; padding: 6px 10px 10px; }
.side-new { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: 6px; color: var(--ink-2); font-size: 13px; }
.side-new:hover { background: var(--hover); }
.side-new .icon { width: 17px; height: 17px; color: var(--ink-3); }

/* Dividers */
.divider { position: relative; z-index: 4; background: var(--line); cursor: col-resize; }
.divider::before { content: ""; position: absolute; inset: 0 -4px; }
.divider:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.divider.is-dragging { background: var(--focus); }

/* List */
.list-pane { display: flex; flex-direction: column; min-width: 0; background: var(--list); }
.list-top { gap: 4px; padding: 0 8px 0 16px; }
.list-head { flex: 1; min-width: 0; line-height: 1.2; }
.list-title { overflow: hidden; font-size: 13px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.list-count { font-size: 11.5px; color: var(--ink-3); }
.show-sidebar { display: none; }
.notes.no-sidebar .show-sidebar { display: inline-grid; }
.notes.no-sidebar .list-top { padding-left: 82px; }
.list-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; padding: 0 8px 18px; overscroll-behavior: contain; }
.note-list { outline: none; }
.list-group-label { position: sticky; top: 0; z-index: 2; padding: 12px 10px 6px; background: var(--list); font-size: 13px; font-weight: 700; }
.list-group + .list-group { margin-top: 4px; }
.list-empty { padding: 48px 20px; color: var(--ink-3); text-align: center; line-height: 1.5; }

.row { position: relative; padding: 9px 10px 10px 20px; border-radius: 8px; outline: none; }
.row::before { content: ""; position: absolute; top: 0; left: 20px; right: 10px; height: 1px; background: var(--line); }
.list-group-label + .row::before, .list-group > .row:first-child::before, .row.is-selected::before, .row.is-selected + .row::before { display: none; }
.row.is-selected { background: var(--select-quiet); }
.note-list:focus-within .row.is-selected { background: var(--select); }
.row:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.row-top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.row-title { flex: 1; min-width: 0; overflow: hidden; font-size: 13px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.row-flag { color: var(--ink-3); flex: none; }
.row-flag .icon { width: 13px; height: 13px; }
.unread-dot { position: absolute; left: 7px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.row-meta { display: flex; align-items: center; gap: 0 4px; margin-top: 2px; overflow: hidden; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.row-state { display: inline-flex; align-items: center; gap: 3px; }
.row-text { margin-top: 2px; overflow: hidden; color: var(--ink-2); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.row-strip { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.row-strip .spark { flex: none; }
.row-bar { width: 48px; height: 4px; flex: none; }
.row-notes { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; padding: 1px 7px 1px 3px; border-radius: 9px; background: var(--hover); color: var(--ink-2); font-weight: 600; cursor: pointer; }
.row-notes:hover { background: var(--press); }
.row-chev .icon { width: 12px; height: 12px; stroke-width: 2; }
.row-chev.is-open .icon { transform: rotate(90deg); }
.row.is-passed .row-title { color: var(--ink-2); font-weight: 600; }
.row--child { margin-left: 14px; padding-left: 22px; }
.row--child::after { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; border-radius: 1px; background: var(--line-2); }
.row--child .row-title { font-weight: 600; }
.row-sub { display: flex; gap: 6px; margin-top: 2px; font-size: 12px; white-space: nowrap; }
.row-date { color: var(--ink); font-weight: 500; flex: none; }
.row-preview { min-width: 0; overflow: hidden; color: var(--ink-3); text-overflow: ellipsis; }
.row-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 5px; color: var(--ink-3); font-size: 11.5px; }
.row-chip { overflow: hidden; max-width: 100%; padding: 1px 7px; border-radius: 9px; background: var(--hover); color: var(--ink-2); white-space: nowrap; text-overflow: ellipsis; }
.row-tasks, .row-folder { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.row-tasks .icon, .row-folder .icon { width: 12px; height: 12px; }
.row-tasks.is-done { color: var(--good-ink); }
.task-head { display: flex; justify-content: space-between; gap: 8px; }
.task-head span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-count { flex: none; color: var(--ink-3); font-size: 12px; font-weight: 500; }
.row--task { display: flex; align-items: center; gap: 10px; padding-left: 12px; }
.row--task .row-title { font-weight: 400; white-space: normal; line-height: 1.35; }
.task-box { width: 17px; height: 17px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-4); cursor: pointer; }
.task-box:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }

/* Content pane and its toolbar */
.content-pane { display: flex; flex-direction: column; min-width: 0; background: var(--editor); }
.content-top { gap: 2px; padding: 0 12px 0 10px; }
.search { display: flex; align-items: center; gap: 5px; width: 190px; height: 28px; margin-left: 6px; padding: 0 8px; border-radius: 7px; background: var(--hover); color: var(--ink-3); flex: none; }
.search:focus-within { box-shadow: 0 0 0 1px var(--focus), 0 0 0 4px color-mix(in srgb, var(--focus) 25%, transparent); }
.search .icon { width: 14px; height: 14px; flex: none; }
.search-field { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; font-size: 13px; outline: none; }
.search-field:focus-visible { outline: none; }
/* Each scroll pane is the containing block for what it holds, so visually hidden text (.sr) scrolls with it
   instead of stretching the window, which scrollIntoView would then scroll. */
.content-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; user-select: text; -webkit-user-select: text; }
.content-empty { display: grid; place-content: center; justify-items: center; gap: 6px; height: 100%; padding: 40px; color: var(--ink-3); text-align: center; user-select: none; }
.content-empty-mark .icon { width: 46px; height: 46px; color: var(--ink-4); stroke-width: 1.2; }
.content-empty-title { color: var(--ink-2); font-size: 17px; font-weight: 600; }

/* ---- documents: the brief and the note share one column ------------------------------------------- */
.brief, .note-wrap { max-width: 776px; margin: 0 auto; padding: 10px 48px 96px; }
.doc-date { margin: 2px 0 20px; color: var(--ink-3); font-size: 12px; text-align: center; }

/* The brief borrows a chat widget's vocabulary: cards with a hairline border, list rows with an icon tile,
   soft pill badges and pill buttons. The tokens below are that vocabulary; the window around it stays Mac. */
.brief {
  --ck-surface: #ffffff;
  --ck-border: rgba(0, 0, 0, .09);
  --ck-soft: rgba(0, 0, 0, .03);
  --ck-soft-2: rgba(0, 0, 0, .055);
  --ck-hover: rgba(0, 0, 0, .035);
  --ck-shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 4px 18px rgba(0, 0, 0, .04);
  --ck-radius: 20px;
  --ck-radius-md: 14px;
  --ck-primary: #0d0d0d; --ck-on-primary: #ffffff;
  --ck-info-soft: rgba(47, 111, 221, .1); --ck-info-ink: #1d56b8;
  --ck-discovery: #7357e8; --ck-discovery-soft: rgba(122, 90, 245, .12); --ck-discovery-ink: #5a3fd0;
}
:root[data-theme="dark"] .brief {
  --ck-surface: #262628;
  --ck-border: rgba(255, 255, 255, .1);
  --ck-soft: rgba(255, 255, 255, .04);
  --ck-soft-2: rgba(255, 255, 255, .085);
  --ck-hover: rgba(255, 255, 255, .045);
  --ck-shadow: none;
  --ck-primary: #f2f2f4; --ck-on-primary: #141414;
  --ck-info-soft: rgba(110, 160, 255, .14); --ck-info-ink: #a9c8ff;
  --ck-discovery: #a68cff; --ck-discovery-soft: rgba(166, 140, 255, .18); --ck-discovery-ink: #cdbfff;
}

/* Widget primitives: icon tile, avatar, badge, button, actions row, status line */
.ck-tile { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--ck-soft-2); color: var(--ink-2); }
.ck-tile .icon { width: 18px; height: 18px; }
.ck-avatar { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ck-soft-2); color: var(--ink-2); font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1; }
.ck-badge { display: inline-flex; align-items: center; gap: 4px; flex: none; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--ck-soft-2); color: var(--ink-2); font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; }
.ck-badge .icon { width: 13px; height: 13px; }
.ck-badge--success { background: var(--good-soft); color: var(--good-ink); }
.ck-badge--warning { background: var(--warn-soft); color: var(--warn-ink); }
.ck-badge--danger { background: var(--bad-soft); color: var(--bad-ink); }
.ck-badge--info { background: var(--ck-info-soft); color: var(--ck-info-ink); }
.ck-badge--discovery { background: var(--ck-discovery-soft); color: var(--ck-discovery-ink); }
.ck-badge--outline { background: none; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-3); }
.ck-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 15px; border-radius: 999px; font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none; transition: background-color .12s; }
.ck-btn .icon { flex: none; width: 16px; height: 16px; }
.ck-btn--primary { background: var(--ck-primary); color: var(--ck-on-primary); }
.ck-btn--primary:hover { background: color-mix(in srgb, var(--ck-primary) 82%, var(--ck-surface)); }
.ck-btn--soft { background: var(--ck-soft-2); color: var(--ink); }
.ck-btn--soft:hover { background: var(--press); }
.ck-btn--soft .icon { color: var(--ink-2); }
.ck-btn--outline { box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); }
.ck-btn--outline:hover { background: var(--ck-soft); }
.ck-btn--outline .icon { width: 14px; height: 14px; color: var(--ink-3); }
.ck-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ck-status { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); font-size: 12.5px; }
.ck-status .icon { width: 14px; height: 14px; color: var(--good); stroke-width: 2; }

/* Brief header */
.brief-title { font: 700 30px/1.12 var(--display); letter-spacing: -.012em; outline: none; text-wrap: balance; }
.brief-sub { margin-top: 4px; color: var(--ink-2); font-size: 15px; }
.brief-by { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; color: var(--ink-3); font-size: 13px; }
.theme-chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 7px; border-radius: 999px; background: color-mix(in srgb, var(--tint) 13%, transparent); color: var(--ink-2); font-size: 12px; font-weight: 500; }
.theme-chip .theme-dot { width: 8px; height: 8px; }
.brief-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--ck-soft-2); }
.seg { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px; border-radius: 999px; color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.seg:hover { color: var(--ink); }
.seg[aria-checked="true"] { background: var(--ck-surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .06); }
:root[data-theme="dark"] .seg[aria-checked="true"] { background: #4a4a4e; }
.seg--committed[aria-checked="true"] { color: var(--accent-ink); }
.seg:focus-visible { outline-offset: 0; }
.brief-controls .tool--label { height: 32px; padding: 0 12px; border-radius: 999px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line-2); }
.brief-controls .tool--label:hover:not([aria-disabled="true"]) { background: var(--ck-soft); }
.brief-controls .tool--label[aria-pressed="true"] { background: var(--ck-soft-2); box-shadow: none; }
.brief-passed { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--ink-3); font-size: 13px; }
.brief-state:empty { display: none; }

/* Cards: In short, your notes, and each section */
.gist, .brief-notes, .fold { border: 1px solid var(--ck-border); border-radius: var(--ck-radius); background: var(--ck-surface); box-shadow: var(--ck-shadow); }

/* In short */
.gist { margin-top: 22px; padding: 18px 20px 20px; }
.gist-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.gist-label { color: var(--ink-3); font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.gist-figure { position: relative; margin-top: 10px; padding-right: 40px; }
.gist-figure > .clip-btn:not(.is-done) { top: 0; right: 0; }
.gist-value { font: 700 40px/1.04 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.gist-value--long { font-size: 32px; }
.gist-cap { max-width: 56ch; margin-top: 4px; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.gist-summary { margin-top: 14px; font-size: 16px; line-height: 1.5; text-wrap: pretty; }
.gist-rows { display: grid; gap: 2px; margin: 14px -8px 0; }
.gist-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border-radius: 12px; text-align: left; }
.gist-link:hover { background: var(--ck-hover); }
.gist-link-text { display: grid; flex: 1; gap: 1px; min-width: 0; }
.gist-link-label { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.gist-link-title { font-size: 14px; font-weight: 500; line-height: 1.4; }
.gist-link-chev { display: grid; place-items: center; color: var(--ink-4); }
.gist-link-chev .icon { width: 14px; height: 14px; stroke-width: 2; }
.gist-link:hover .gist-link-chev { color: var(--ink-2); }
.readings { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 8px; margin-top: 12px; }
.reading { display: grid; align-content: start; gap: 6px; padding: 12px 14px 13px; border-radius: var(--ck-radius-md); background: var(--ck-soft); color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.reading-label { color: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.reading-visual { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.reading-num { color: var(--ink); font: 700 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.reading-glyph { display: grid; color: var(--ink-3); }
.reading-glyph .icon { width: 18px; height: 18px; }
.reading-arrow { font-weight: 700; color: var(--ink); }
.claims-bar { width: 96px; height: 6px; }

/* Your notes on this */
.brief-notes { margin-top: 12px; padding: 16px 20px 18px; }
.strip-head { display: flex; align-items: center; gap: 12px; }
.strip-heading { min-width: 0; }
.strip-title { font-size: 15px; font-weight: 600; }
.strip-count { color: var(--ink-3); font-weight: 500; }
.strip-cap { margin-top: 1px; color: var(--ink-3); font-size: 12.5px; }
.strip-row { display: grid; gap: 2px; margin: 12px -8px 0; }
.note-chip { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 8px 0 10px; border-radius: 12px; font-size: 13.5px; text-align: left; }
.note-chip:hover { background: var(--ck-hover); }
.note-chip > .icon { flex: none; width: 16px; height: 16px; color: var(--ink-3); }
.note-chip-title { flex: 1; min-width: 0; overflow: hidden; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.note-chip-date { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.note-chip-chev { display: grid; color: var(--ink-4); }
.note-chip-chev .icon { width: 13px; height: 13px; stroke-width: 2; }
.strip-more { margin-top: 6px; color: var(--ink-3); font-size: 12.5px; }
.brief-notes .ck-actions { margin-top: 12px; }

/* Section cards */
.folds { display: grid; gap: 10px; margin-top: 12px; }
.fold > summary {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; column-gap: 12px; align-items: center; min-height: 64px;
  padding: 12px 14px; list-style: none; cursor: default; border-radius: calc(var(--ck-radius) - 1px);
}
.fold > summary:hover { background: var(--ck-hover); }
.fold > summary:focus-visible { outline-offset: -2px; }
.fold[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.fold > summary::-webkit-details-marker, .item > summary::-webkit-details-marker { display: none; }
.fold-icon { grid-column: 1; grid-row: 1 / span 2; }
.fold-title { grid-column: 2; grid-row: 1; align-self: end; font-size: 15.5px; font-weight: 600; line-height: 1.25; }
.fold-meta { grid-column: 2; grid-row: 2; align-self: start; margin-top: 2px; color: var(--ink-3); font-size: 12.5px; line-height: 1.3; }
.fold-hits { grid-column: 3; grid-row: 1 / span 2; display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--mark); font-size: 12px; font-weight: 600; white-space: nowrap; }
.fold-chev { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--ink-3); }
.fold > summary > .fold-chev { grid-column: 4; grid-row: 1 / span 2; }
.fold-chev .icon { width: 14px; height: 14px; stroke-width: 2; transition: transform .15s; }
details[open] > summary > .fold-chev .icon { transform: rotate(90deg); }
.fold-body { margin: 0 20px; padding: 16px 0 20px; border-top: 1px solid var(--line); }

/* Fact blocks and the clip button: a round icon button in the block's top corner, shown on hover or focus */
[data-clip] { position: relative; border-radius: 12px; }
[data-clip]:focus-visible { outline-offset: 2px; }
.clip-btn {
  position: absolute; z-index: 3; top: 6px; right: 6px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ck-surface); color: var(--ink-2); box-shadow: 0 0 0 1px var(--ck-border), 0 1px 3px rgba(0, 0, 0, .08); opacity: 0;
}
.clip-btn .icon { width: 16px; height: 16px; }
[data-clip]:hover .clip-btn, [data-clip]:focus-within .clip-btn, .clip-btn:focus-visible { opacity: 1; }
.clip-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--ck-surface) 92%, var(--ink)); }
.clip-btn.is-done {
  position: static; display: inline-flex; align-items: center; gap: 4px; width: auto; height: 24px; margin: 8px 0 2px; padding: 0 10px 0 8px;
  border-radius: 999px; background: var(--good-soft); color: var(--good-ink); box-shadow: none; font-size: 12px; font-weight: 500; opacity: 1;
}
.clip-btn.is-done .icon { width: 14px; height: 14px; stroke-width: 2; }
.clip-btn.is-done:hover { background: color-mix(in srgb, var(--good) 22%, transparent); }

.sub { margin: 20px 0 8px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.prose { font-size: 15px; line-height: 1.6; text-wrap: pretty; }
.note-line { margin-top: 12px; color: var(--ink-3); font-size: 12.5px; line-height: 1.45; }
.source-line { margin-top: 16px; }

/* The request: a quote box, numbered asks */
.quote { padding: 16px 52px 14px 18px; border-radius: var(--ck-radius-md); background: var(--ck-soft); }
.quote blockquote { font-size: 16.5px; line-height: 1.5; text-wrap: pretty; }
.quote figcaption { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.quote .ck-avatar { width: 24px; height: 24px; background: var(--ck-surface); box-shadow: 0 0 0 1px var(--ck-border); font-size: 9.5px; }
.quote > .clip-btn:not(.is-done) { top: 10px; right: 10px; }
.asks { display: grid; gap: 2px; margin: 0 -8px; counter-reset: ask; }
.asks li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding: 9px 44px 9px 8px; border-radius: 12px; font-size: 15px; line-height: 1.5; counter-increment: ask; }
.asks li:hover { background: var(--ck-hover); }
.asks li::before { content: counter(ask); display: grid; place-items: center; width: 24px; height: 24px; margin-top: -1px; border-radius: 50%; background: var(--ck-soft-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.asks li .clip-btn.is-done { grid-column: 2; justify-self: start; }

/* Where to start: field rows, then the month's test as a tinted card with one primary action */
.start { display: grid; gap: 2px; margin: 0 -8px; }
.start-row { padding: 10px 44px 10px 56px; }
.start-row:hover { background: var(--ck-hover); }
.start-row dt { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.start-row dt .ck-tile { position: absolute; top: 10px; left: 8px; }
.start-row dd { margin-top: 1px; font-size: 15px; line-height: 1.55; }
.test-card { margin-top: 14px; padding: 16px 52px 16px 18px; border-radius: var(--ck-radius-md); background: var(--ck-info-soft); font-size: 15px; line-height: 1.55; }
.test-card > .clip-btn:not(.is-done) { top: 12px; right: 12px; }
.test-label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14.5px; font-weight: 600; }
.test-card .ck-badge--info { background: var(--ck-surface); }
.test-card .ck-actions { margin-top: 12px; }

/* Expandable list rows: hard parts, drivers, claims */
.items { display: grid; gap: 2px; margin: 0 -8px; }
.item[open] { background: var(--ck-soft); }
.item > summary { display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px; list-style: none; font-size: 15px; font-weight: 500; line-height: 1.4; cursor: default; border-radius: 12px; }
.item > summary:hover { background: var(--ck-hover); }
.item-lead { display: grid; place-items: center; flex: none; width: 24px; height: 24px; margin-top: -1px; border-radius: 50%; background: var(--ck-soft-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.item-title { flex: 1; min-width: 0; }
.item > summary .fold-chev { width: 22px; height: 22px; margin-top: -1px; }
.item > p { padding: 0 44px 14px; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }
.item--claim > p { padding-left: 8px; }
.item > .clip-btn:not(.is-done) { top: auto; bottom: 10px; right: 8px; }
.item > .clip-btn.is-done { margin: -6px 0 12px 44px; }
.item--claim > .clip-btn.is-done { margin-left: 8px; }
.item > summary .verdict { margin-top: -1px; }

.verdict { display: inline-flex; align-items: center; gap: 4px; flex: none; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1; }
.verdict--supported { background: var(--good-soft); color: var(--good-ink); }
.verdict--partly { background: var(--warn-soft); color: var(--warn-ink); }
.verdict--unverified { background: var(--hover); color: var(--ink-2); }
.verdict--disputed { background: var(--bad-soft); color: var(--bad-ink); }

/* Who's building: a table of list rows with avatars and amount badges */
.orgs { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.orgs th { padding: 0 12px 10px 0; color: var(--ink-3); font-size: 12px; font-weight: 500; text-align: left; }
.sort { display: inline-flex; align-items: center; gap: 4px; height: 26px; margin-left: -2px; padding: 0 10px; border-radius: 999px; color: var(--ink-3); font-weight: 500; cursor: pointer; }
.sort:hover { background: var(--ck-soft-2); color: var(--ink); }
th[aria-sort="ascending"] .sort, th[aria-sort="descending"] .sort { background: var(--ck-soft-2); color: var(--ink); font-weight: 600; }
.sort-mark:empty { display: none; }
.orgs td { padding: 12px 12px 12px 0; border-top: 1px solid var(--line); vertical-align: top; }
.org-name { width: 34%; }
.org-name .ck-avatar { float: left; margin: 1px 10px 0 0; }
.org-id { display: block; overflow: hidden; }
.org-name a { font-weight: 600; text-decoration: none; }
.org-name a:hover { text-decoration: underline; }
.org-kind { display: block; margin-top: 2px; color: var(--ink-3); font-size: 12px; }
.org-raised { width: 132px; }
.raised { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--good-soft); color: var(--good-ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.raised-asof { margin-left: 3px; font-weight: 500; opacity: .75; }
.raised--none { background: none; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-3); font-weight: 500; }
.meter { display: block; width: 96px; height: 4px; margin-top: 8px; }
.meter-track { fill: var(--ck-soft-2, var(--line)); }
.meter-fill { fill: var(--good); }
.meter-hollow { fill: none; stroke: var(--ink-4); stroke-width: 1; }
.orgs .meter--none { display: none; } /* the outline badge already says so */
.orgs .org-what { position: relative; padding-right: 40px; color: var(--ink-2); line-height: 1.5; }
.org-what > .clip-btn:not(.is-done) { top: 8px; right: 0; }

/* Why now: the timeline */
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; top: 14px; bottom: 14px; left: 108.5px; width: 1px; background: var(--line-2); }
.timeline li { display: grid; grid-template-columns: 96px 14px minmax(0, 1fr); gap: 6px; align-items: baseline; padding: 6px 40px 6px 0; }
.tl-date { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.tl-dot { position: relative; z-index: 1; justify-self: center; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-2); box-shadow: 0 0 0 3px var(--ck-surface); }
.tl-label { font-size: 14px; line-height: 1.45; }
.tl-badge { height: 19px; margin-right: 2px; padding: 0 7px; font-size: 11px; vertical-align: 1px; }
.is-future .tl-dot { background: var(--ck-surface); box-shadow: inset 0 0 0 1.5px var(--ink-3), 0 0 0 3px var(--ck-surface); }
.is-future .tl-label { color: var(--ink-2); }
.tl-today .tl-dot { width: 11px; height: 11px; background: var(--ck-discovery); }
.tl-today .tl-date { color: var(--ink); font-weight: 600; }
.timeline .clip-btn:not(.is-done) { top: 2px; right: 0; }
.timeline .clip-btn.is-done { grid-column: 3; justify-self: start; }

/* Numbers: stat cards */
.numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.number { padding: 14px 16px 15px; border-radius: var(--ck-radius-md); background: var(--ck-soft); }
.number-value { padding-right: 34px; font: 700 24px/1.15 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.number-label { margin-top: 6px; font-size: 13.5px; line-height: 1.45; }
.number-note { margin-top: 6px; color: var(--ink-3); font-size: 12px; line-height: 1.4; }
.number > .clip-btn:not(.is-done) { top: 10px; right: 10px; }

/* Attention: chart cards */
.signals { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.signal { padding: 14px 16px; border-radius: var(--ck-radius-md); background: var(--ck-soft); }
.signal-title { margin-bottom: 8px; color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-bar { fill: var(--ink-4); }
.chart-bar--latest { fill: var(--ink-2); }
.chart-bar--partial { fill: none; stroke: var(--ink-2); stroke-width: 1.3; stroke-dasharray: 3 2; }
.chart-line { fill: none; stroke: var(--ink-2); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-area { fill: var(--hover); }
.chart-dot { fill: var(--ink); }
.chart-value { fill: var(--ink-2); font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tick { fill: var(--ink-3); font-size: 10px; }
.chart-axis { stroke: var(--line-2); }
.signal figcaption { margin-top: 8px; color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.signal figcaption a { color: var(--ink-3); }

.spark-bar { fill: var(--ink-4); }
.spark-bar--latest { fill: var(--ink-2); }
.spark-bar--partial { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.spark-line { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.spark-area { fill: var(--hover); }
.spark-dot { fill: var(--ink); }
.v-supported { fill: var(--good); } .v-partly { fill: var(--warn); } .v-unverified { fill: var(--ink-4); } .v-disputed { fill: var(--bad); }

/* Discussions: list rows that open the thread */
.threads { display: grid; gap: 2px; margin: 0 -8px; }
.thread { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 12px; }
.thread:hover { background: var(--ck-hover); }
.thread-body { flex: 1; min-width: 0; }
.thread a { font-size: 14px; font-weight: 500; text-decoration: none; }
.thread a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.thread-meta { display: block; margin-top: 2px; color: var(--ink-3); font-size: 12px; }
.thread-stats { display: flex; gap: 4px; }
.thread-stats .ck-badge { font-variant-numeric: tabular-nums; }
.thread-out { display: grid; color: var(--ink-4); }
.thread-out .icon { width: 15px; height: 15px; }
.thread:hover .thread-out { color: var(--ink-2); }

/* Sources: numbered rows */
.refs { display: grid; gap: 2px; margin: 0 -8px; }
.refs li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding: 8px; border-radius: 12px; font-size: 13px; scroll-margin: 80px; outline: none; }
.refs li:hover { background: var(--ck-hover); }
.ref-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ck-soft-2); color: var(--ink-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ref-body { padding-top: 2px; }
.ref-body a { font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.ref-body a:hover { text-decoration: underline; }
.ref-meta { display: block; margin-top: 1px; color: var(--ink-3); font-size: 12px; overflow-wrap: anywhere; }
.refs li.is-target, .refs li:focus-visible { background: var(--mark); }
.brief-end { margin-top: 28px; color: var(--ink-3); font-size: 12.5px; text-align: center; line-height: 1.5; }
.brief-end a { color: inherit; }

/* Citation pills and their popover */
.cite {
  display: inline-grid; place-items: center; min-width: 17px; height: 15px; margin-left: 3px; padding: 0 4px; border-radius: 8px;
  vertical-align: 2px; background: var(--accent-soft); color: var(--accent-ink); font-size: 10px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; cursor: pointer; user-select: none;
}
.cite:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.cite.is-lit, .cite[aria-expanded="true"] { box-shadow: 0 0 0 1.5px var(--accent); }
.cite:focus-visible { outline-offset: 1px; }
.popover {
  position: fixed; z-index: 1100; width: 320px; padding: 14px 16px; border-radius: 12px; background: var(--popover); color: var(--ink);
  box-shadow: var(--shadow-pop); -webkit-backdrop-filter: saturate(1.6) blur(24px); backdrop-filter: saturate(1.6) blur(24px); user-select: text;
}
.pop-kicker { color: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.pop-title { margin-top: 4px; font-size: 14px; font-weight: 600; line-height: 1.35; }
.pop-meta { margin-top: 4px; color: var(--ink-2); font-size: 13px; }
.pop-host { color: var(--ink-3); font-size: 12px; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pop-actions .button { height: 26px; padding: 0 10px; font-size: 12.5px; }
.pop-count { margin-top: 10px; color: var(--ink-2); font-size: 12px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.pop-count[aria-pressed="true"] { color: var(--ink); font-weight: 600; }

/* ---- the note editor -------------------------------------------------------------------------------- */
.note-context { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: -12px 0 18px; color: var(--ink-3); font-size: 12.5px; }
.ctx-chip { height: 22px; padding: 0 10px; border-radius: 11px; background: var(--hover); color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ctx-chip:hover { background: var(--press); }
.ctx-state { display: inline-flex; align-items: center; gap: 4px; }
.ctx-link { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; cursor: pointer; }
.ctx-link .icon { width: 14px; height: 14px; }
.ctx-hint { color: var(--ink-3); }
.trash-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 10px 14px; border-radius: 10px; background: var(--hover); color: var(--ink-2); font-size: 13px; }

.note-editor {
  min-height: 55vh; padding-bottom: 32px; color: var(--ink); font-size: 15px; line-height: 1.5; caret-color: var(--accent);
  overflow-wrap: anywhere; outline: none; user-select: text; -webkit-user-select: text; cursor: text;
}
.note-editor:focus-visible { outline: none; }
/* Tabs and runs of spaces stay as typed. Without this Chrome wraps them in style spans, which the CSP blocks. */
.note-editor :is(p, li, h1, h2, h3, blockquote):not(.clip *) { white-space: pre-wrap; tab-size: 4; }
.note-editor[aria-readonly="true"] { color: var(--ink-2); cursor: default; }
.note-editor p, .note-editor li, .note-editor h1, .note-editor h2, .note-editor h3, .note-editor blockquote { white-space: pre-wrap; tab-size: 4; }
.note-editor > :first-child { margin-bottom: 6px; font-size: 26px; font-weight: 700; line-height: 1.25; }
.note-editor h1 { margin: 6px 0; font-size: 26px; font-weight: 700; line-height: 1.25; }
.note-editor h2 { margin: 18px 0 4px; font-size: 19px; font-weight: 700; line-height: 1.3; }
.note-editor h3 { margin: 14px 0 2px; font-size: 16px; font-weight: 600; }
.note-editor ul, .note-editor ol { margin: 2px 0; padding-left: 26px; }
.note-editor ul { list-style: disc; }
.note-editor ul ul { list-style: circle; }
.note-editor ol { list-style: decimal; }
.note-editor li { padding: 1px 0; }
.note-editor ul.checklist { padding-left: 0; list-style: none; }
.note-editor ul.checklist > li { position: relative; min-height: 26px; padding: 2px 0 2px 28px; }
.note-editor ul.checklist > li::before {
  content: ""; position: absolute; left: 1px; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--ink-4); cursor: pointer;
}
.note-editor ul.checklist > li[data-done="true"] { color: var(--ink-3); }
.note-editor ul.checklist > li[data-done="true"]::before {
  box-shadow: none; background: var(--accent-fill) no-repeat center / 12px 12px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 6.2 2.3 2.3 4.7-5' fill='none' stroke='%231d1d1f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.note-editor blockquote { margin: 6px 0; padding-left: 14px; border-left: 3px solid var(--line-2); color: var(--ink-2); }
.note-editor pre { margin: 6px 0; padding: 8px 12px; border-radius: 8px; background: var(--hover); font: 13.5px/1.5 var(--mono); white-space: pre-wrap; }
.note-editor a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.note-editor b { font-weight: 700; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px 0 6px; border-radius: 6px; vertical-align: 1px;
  background: var(--hover); box-shadow: inset 0 0 0 .5px var(--line-2); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.chip::before { content: "↳"; color: var(--ink-3); font-weight: 400; }
.chip:hover { background: var(--press); }
.note-editor figure.clip { margin: 10px 0; padding: 10px 14px; border-radius: 10px; background: var(--clip-bg); box-shadow: inset 3px 0 0 var(--line-2), inset 0 0 0 .5px var(--line); }
.clip > p { font-size: 14.5px; line-height: 1.5; }
.clip > p + p { margin-top: 3px; color: var(--ink-2); font-size: 13px; }
.clip .verdict { margin-left: 4px; vertical-align: 1px; }
.clip figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-top: 6px; color: var(--ink-3); font-size: 12px; }
.clip-from { margin-right: 2px; }
.note-sources { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.sources-title { margin-bottom: 4px; font-size: 13px; font-weight: 700; }

/* ---- sheets ------------------------------------------------------------------------------------------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-start; justify-content: center; padding: 11vh 16px 16px; background: rgba(0, 0, 0, .16); }
.sheet {
  width: min(420px, 100%); max-height: 80vh; display: flex; flex-direction: column; padding: 20px 20px 16px; border-radius: 14px; background: var(--popover);
  box-shadow: var(--shadow-window); -webkit-backdrop-filter: saturate(1.6) blur(30px); backdrop-filter: saturate(1.6) blur(30px); user-select: text;
}
.sheet:has(.sheet-scroll) { width: min(560px, 100%); }
.sheet-mark { flex: none; width: 40px; height: 40px; margin-bottom: 12px; border-radius: 10px; background: linear-gradient(180deg, #ff8a3d, #f05a1a 30%, #fffdf6 30%); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .15), 0 2px 6px rgba(0, 0, 0, .12); }
.sheet h2 { font-size: 15px; font-weight: 700; line-height: 1.3; }
.sheet p { margin-top: 6px; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.sheet-field { width: 100%; height: 30px; margin-top: 12px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--window); font-size: 13px; outline: none; user-select: text; }
.sheet-field:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
textarea.sheet-field { height: auto; padding: 6px 9px; resize: vertical; }
.sheet .sheet-error { min-height: 16px; margin-top: 4px; color: var(--bad-ink); font-size: 12px; }
.sheet-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.sheet-scroll { min-height: 0; margin-top: 6px; padding-right: 6px; overflow: auto; }
.keys-title { margin: 14px 0 4px; color: var(--ink-3); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.keys > div, .verdict-key > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; align-items: center; padding: 4px 0; font-size: 13px; }
.keys kbd { display: inline-block; padding: 3px 6px; border-radius: 5px; background: var(--hover); box-shadow: inset 0 -1px 0 var(--line-2); }
.about p + p { margin-top: 10px; }
.about a { color: var(--link); }
.sheet .about-meta { color: var(--ink-3); font-size: 12px; }
.verdict-key { margin-top: 10px; }

/* ---- palette ------------------------------------------------------------------------------------------- */
.palette-backdrop { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-start; justify-content: center; padding: 20vh 12px 12px; background: rgba(0, 0, 0, .12); }
.palette { width: min(560px, 100%); overflow: hidden; border-radius: 14px; background: var(--popover); box-shadow: var(--shadow-window); -webkit-backdrop-filter: saturate(1.6) blur(30px); backdrop-filter: saturate(1.6) blur(30px); }
.palette-field { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-field .icon { width: 20px; height: 20px; color: var(--ink-3); }
.palette-input { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; font-size: 18px; outline: none; }
.palette-input:focus-visible { outline: none; }
.palette-list { max-height: min(360px, 50vh); overflow: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; cursor: default; }
.pal-item.is-active { background: var(--focus); color: #fff; }
.pal-item.is-active .pal-sub, .pal-item.is-active .pal-kbd, .pal-item.is-active .pal-glyph { color: rgba(255, 255, 255, .85); }
.pal-glyph { display: grid; place-items: center; width: 18px; flex: none; color: var(--ink-3); }
.pal-glyph .icon { width: 16px; height: 16px; }
.pal-label { flex: none; max-width: 62%; overflow: hidden; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.pal-sub { flex: 1; min-width: 0; overflow: hidden; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.pal-kbd { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.pal-empty { padding: 18px; color: var(--ink-3); text-align: center; }
.palette-foot { padding: 7px 14px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 11.5px; }
.palette-foot kbd { padding: 1px 4px; border-radius: 4px; background: var(--hover); font-size: 10.5px; }

/* ---- Compare ------------------------------------------------------------------------------------------- */
.compare-body { background: var(--editor); }
.compare-top { gap: 8px; padding-left: 84px; border-bottom: 1px solid var(--line); }
.compare-title { font-size: 13px; font-weight: 700; }
.compare-count { color: var(--ink-3); font-size: 12px; }
.compare-done { display: none; }
.compare-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; user-select: text; }
.compare { min-width: 100%; width: max-content; }
.compare[data-cols="2"] { --cols: 2; } .compare[data-cols="3"] { --cols: 3; }
.cmp-row { display: grid; grid-template-columns: 132px repeat(var(--cols), minmax(240px, 1fr)); border-bottom: 1px solid var(--line); }
.cmp-label { position: sticky; left: 0; z-index: 1; padding: 12px 14px; background: var(--editor); color: var(--ink-3); font-size: 12px; font-weight: 600; }
.cmp-cell { min-width: 0; padding: 12px 16px; border-left: 1px solid var(--line); font-size: 13px; line-height: 1.45; }
.cmp-head { position: sticky; top: 0; z-index: 2; background: var(--editor); }
.cmp-head .cmp-label { z-index: 3; }
.cmp-colhead h3 { font: 700 15px/1.25 var(--display); }
.cmp-actions { display: flex; align-items: center; gap: 4px; margin: 8px 0 0 -9px; }
.cmp-figure { font: 700 22px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.cmp-small { margin-top: 4px; color: var(--ink-3); font-size: 12px; line-height: 1.4; }
.cmp-spark { display: flex; align-items: center; gap: 6px; }
.cmp-list { margin-top: 4px; padding-left: 16px; list-style: disc; color: var(--ink-2); font-size: 12.5px; }
.cmp-list li + li { margin-top: 2px; }
.cmp-clamp { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.cmp-state { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; background: var(--hover); font-weight: 600; }
.cmp-note { text-align: left; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; cursor: pointer; }
.compare-empty { display: grid; justify-items: center; align-content: center; gap: 8px; flex: 1; max-width: 460px; margin: 0 auto; padding: 30px; color: var(--ink-2); text-align: center; line-height: 1.5; }
.compare-empty > .icon { width: 42px; height: 42px; color: var(--ink-4); stroke-width: 1.2; }
.compare-empty-title { color: var(--ink); font-size: 17px; font-weight: 600; }
.compare-empty .button { margin-top: 6px; }

/* ---- 700–1100 px: the window fills the screen and the sidebar becomes an overlay -------------------- */
.notes.is-compact, .notes.is-compact.has-overlay { grid-template-columns: 0 0 var(--lw, 300px) 1px minmax(0, 1fr); }
.notes.is-compact [data-divider="sidebar"] { display: none; }
.notes.is-compact .sidebar { display: none; }
.notes.is-compact.has-overlay .sidebar {
  position: absolute; z-index: 40; top: 0; bottom: 0; left: 0; display: flex; width: 250px;
  background: var(--sidebar-solid); box-shadow: 0 0 0 .5px var(--line-2), 12px 0 32px rgba(0, 0, 0, .16);
}
.notes.is-compact .show-sidebar { display: inline-grid; }
.notes.is-compact .list-top { padding-left: 82px; }
@media (max-width: 1099px) {
  .brief, .note-wrap { padding-left: 40px; padding-right: 40px; }
  .search { width: 150px; }
}

/* ---- below 700 px: a full-screen drill-down ------------------------------------------------------------- */
@media (max-width: 699px) {
  .menubar, .dock-wrap, .traffic, .resize { display: none; }
  .desktop { background: var(--editor); }
  .desktop::after { display: none; }
  .window { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; box-shadow: none; }
  .win-compare:not(.is-closed) { z-index: 50 !important; }
  .notes, .notes.no-sidebar, .notes.is-compact, .notes.is-compact.has-overlay { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .mbar {
    display: flex; align-items: center; gap: 4px; height: calc(48px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 6px 0;
    background: var(--toolbar); border-bottom: 1px solid var(--line);
  }
  .mbar-back { display: inline-flex; align-items: center; gap: 2px; max-width: 40%; height: 36px; padding: 0 8px 0 2px; color: var(--accent-ink); font-size: 15px; }
  .mbar-back[hidden] { display: inline-flex !important; visibility: hidden; }
  .mbar-back .icon { width: 22px; height: 22px; }
  .mbar-back-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .mbar-title { flex: 1; min-width: 0; overflow: hidden; font-size: 16px; font-weight: 700; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
  .mbar .tool { width: 40px; height: 40px; }
  .mbar .tool .icon { width: 20px; height: 20px; }
  .notes .sidebar, .notes .list-pane, .notes .content-pane, .notes .divider { display: none; grid-row: 2; grid-column: 1; }
  .notes[data-view="folders"] .sidebar { display: flex; position: static; width: auto; box-shadow: none; }
  .notes[data-view="list"] .list-pane { display: flex; }
  .notes[data-view="note"] .content-pane { display: flex; }
  .sidebar { background: var(--list); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sidebar-top, .list-top { display: none; }
  .sidebar-scroll { padding-top: 10px; }
  .side-item { height: 42px; font-size: 15px; }
  .side-head { padding-top: 6px; font-size: 13px; }
  .list-pane > .search { width: auto; height: 34px; margin: 10px 12px 4px; }
  .notes:not(.show-search) .list-pane > .search { display: none; }
  .row { padding: 12px 12px 12px 22px; }
  .row-title { font-size: 15px; }
  .row-meta, .row-text, .row-sub { font-size: 13px; }
  .content-top { gap: 4px; height: 44px; padding: 0 8px; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .content-top [data-act="new-note"], .content-top .tool-sep, .content-top [data-act="compare"] { display: none; }
  .brief, .note-wrap { padding: 12px 18px 72px; }
  .brief-title { font-size: 26px; }
  .gist, .brief-notes { padding: 16px; }
  .gist-value { font-size: 34px; }
  .gist-value--long { font-size: 28px; }
  .readings { grid-template-columns: 1fr; }
  .segmented { max-width: 100%; overflow-x: auto; }
  .seg { padding: 0 9px; }
  .fold > summary { min-height: 58px; padding: 10px 12px; column-gap: 10px; }
  .fold-body { margin: 0 14px; padding-bottom: 16px; }
  .clip-btn { opacity: 1; } /* no hover on touch: the clip button is always there, as a quiet ghost icon */
  .clip-btn:not(.is-done) { background: transparent; box-shadow: none; color: var(--ink-3); }
  .numbers { grid-template-columns: 1fr; }
  .orgs thead tr { display: flex; gap: 6px; }
  .orgs thead th:last-child { display: none; }
  .orgs, .orgs tbody, .orgs tr, .orgs td { display: block; width: auto; }
  .orgs tr { padding: 12px 0; border-top: 1px solid var(--line); }
  .orgs td { padding: 2px 0 2px 40px; border: 0; }
  .orgs td.org-name { padding-left: 0; }
  .thread > .ck-tile, .thread-out { display: none; }
  .timeline li { grid-template-columns: 78px 14px minmax(0, 1fr); }
  .timeline::before { left: 90.5px; }
  .popover { width: min(320px, calc(100vw - 16px)); }
  .sheet-backdrop, .palette-backdrop { padding-top: 8vh; }
  .compare-top { padding-left: 14px; }
  .compare-done { display: inline-flex; }
  .compare-scroll { scroll-snap-type: x mandatory; }
  .cmp-row { grid-template-columns: 104px repeat(var(--cols), calc(100vw - 148px)); } /* the next column peeks in */
  .cmp-cell { scroll-snap-align: end; }
  .cmp-label { padding: 12px 10px; }
}

/* ---- preferences ---------------------------------------------------------------------------------------- */
@media (prefers-reduced-transparency: reduce) {
  .menubar { background: var(--menubar-solid); }
  .sidebar { background: var(--sidebar-solid); }
  .menu, .popover, .sheet, .palette { background: var(--popover-solid); }
  .dock { background: var(--sidebar-solid); }
  .menubar, .sidebar, .menu, .popover, .sheet, .palette, .dock { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  .window, .menu, .popover, .sheet, .palette, .gist, .number, .test-card, .clip, .chip, .cite, .verdict, .button, .seg, .segmented, .search, .row-notes,
  .fold, .brief-notes, .reading, .signal, .quote, .ck-btn, .ck-badge, .ck-tile, .raised, .clip-btn { border: 1px solid CanvasText; }
  .row.is-selected, .side-item.is-selected, .pal-item.is-active, .seg[aria-checked="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .divider { background: CanvasText; }
  .traffic button { border: 1px solid ButtonText; }
  .note-editor ul.checklist > li::before { border: 1px solid CanvasText; }
}
@media print {
  .menubar, .dock-wrap, .sidebar, .list-pane, .divider, .content-top, .traffic { display: none !important; }
  .window { position: static; box-shadow: none; }
  .content-scroll { overflow: visible; }
}
