/* Folio — app styles on top of the kit design system (core.css).
   Tokens only; the brand mark is slate. */

:root { --mark-bg: var(--slate); }

/* ── library workspace (tabs, toolbar and body come from kit) ── */
.ws-side .ws-item .icon { width: 15px; height: 15px; margin-top: 2px; }

/* documents */
.doc-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.pg-cell { position: relative; display: grid; gap: 3px; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 11.5px; color: var(--ink-3); cursor: pointer; }
.pg-cell b { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pg-cell.done { border-color: var(--moss-line); background: var(--moss-soft); }
.pg-cell.error { border-color: var(--rust); background: var(--rust-soft); }
.pg-cell.working, .pg-cell.queued { border-style: dashed; }
.pg-cell[aria-pressed="true"] { outline: 2px solid var(--slate); }

/* ── reader ── */
.reader { max-width: 860px; margin-inline: auto; }
.rl { position: relative; padding-inline-start: 44px; min-height: 1.9em; border-radius: 4px; }
.rl:hover { background: var(--surface-2); }
.rl::before { content: attr(data-l); position: absolute; inset-inline-start: 0; width: 34px; text-align: end; font: 400 11px/1.9 var(--font-mono); color: var(--ink-3); opacity: 0; user-select: none; }
.reader:hover .rl::before { opacity: 0.85; }
.rl.hl { background: var(--ochre-soft); box-shadow: -30px 0 0 var(--ochre-soft); }
.rl .md, .rl .p { display: inline; }
.rl h1, .rl h2, .rl h3 { font-size: 1em; font-weight: 650; display: inline; }
.rl.blank { min-height: 0.7em; }
.page-mark { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--ink-3); font-size: 11.5px; letter-spacing: 0.06em; }
.page-mark::before, .page-mark::after { content: ""; flex: 1; border-top: 1px dashed var(--line-2); }
.sel-tools { position: absolute; z-index: 30; display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-md); }
.sel-tools button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; color: inherit; font-size: 12.5px; }
.sel-tools button:hover { background: color-mix(in srgb, currentColor 16%, transparent); }
.sel-tools .icon { width: 14px; height: 14px; }
.reader-img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); margin: 4px 0; }

/* citation chips: [D12:L40-L55] */
.cite { display: inline-flex; align-items: center; padding: 0 7px; margin: 0 2px; border-radius: 7px; border: 1px solid var(--slate-line); background: var(--slate-soft); color: var(--ink-2); font: 500 max(11px, 0.82em) var(--font-mono); cursor: pointer; vertical-align: 1px; white-space: nowrap; }
.cite:hover { border-color: var(--slate); color: var(--ink); }
.cite.bad { text-decoration: line-through; opacity: 0.6; cursor: default; }

/* ── ask: evidence drawer ── */
.ev-list { display: grid; gap: 12px; }
.ev-card { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 6px; }
.ev-card .cite { align-self: start; }
.ev-title { font-size: 13px; font-weight: 600; line-height: 1.4; }
.ev-text { font-size: 12.5px; line-height: 1.65; color: var(--ink-2); max-height: 180px; overflow: auto; white-space: pre-wrap; }
.ev-signals { display: flex; flex-wrap: wrap; gap: 4px; }
.ev-signals .tag { font-size: 10.5px; font-variant-numeric: tabular-nums; }

/* ── ideas ── */
.idea-card { gap: 8px; }
.idea-card .pcard-title { font-size: 17px; }
.idea-card.kept { border-color: var(--moss-line); }
.idea-ev { font-size: 13px; color: var(--ink-3); border-inline-start: 2px solid var(--line-2); padding-inline-start: 10px; }

/* ── drafts ── */
.draft-wrap { max-width: 860px; margin-inline: auto; display: grid; gap: 12px; }
.draft-ta { min-height: 420px; font-size: 15.5px; line-height: 1.8; }
.draft-foot { display: flex; align-items: center; gap: 8px; }

/* ── graph ── */
.graph-wrap { position: relative; flex: 1; min-height: 0; }
.graph-cv { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.graph-cv.dragging { cursor: grabbing; }
.graph-hud { position: absolute; top: 12px; inset-inline-end: 12px; display: grid; gap: 6px; justify-items: end; }
.graph-hud .tag { background: var(--surface); box-shadow: var(--shadow-sm); }
.graph-detail { position: absolute; bottom: 12px; inset-inline-start: 12px; width: min(320px, calc(100% - 24px)); padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md); display: grid; gap: 8px; }
.graph-detail h4 { font-size: 15px; }
.graph-edges { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.graph-edges .cite { font-size: 10px; }
.graph-path { position: absolute; top: 12px; inset-inline-start: 12px; display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 12.5px; }

/* notes */

@media (max-width: 720px) {
  .rl { padding-inline-start: 30px; }
  .rl::before { width: 22px; }
  .rl.hl { box-shadow: -16px 0 0 var(--ochre-soft); }
  .graph-detail { position: static; width: auto; box-shadow: none; }
}

.reader-holder { position: relative; }
