/* why: CODE-NOTES app.css #1 */

:root {
  --bg: #07080B;
  --surface: #0E1015;
  --surface-2: #151821;
  --surface-3: #1C2030;
  --glass: rgba(14, 16, 21, 0.78);
  --border: #232838;
  --border-strong: #5E6886;
  --text: #ECEEF4;
  --text-2: #A9B0C2;
  --text-3: #8089A0;
  --accent: #9D8CFF;
  --accent-hover: #ADA0FF;
  --accent-text: #B9ADFF;
  --on-accent: #0B0A14;
  --accent-soft: rgba(157, 140, 255, 0.14);
  --glow: rgba(157, 140, 255, 0.38);
  --dots: rgba(175, 165, 255, 0.14);
  --halo: rgba(124, 108, 255, 0.16);
  --danger: #FF7B7B;
  --danger-soft: rgba(255, 123, 123, 0.12);
  --success: #5FE09A;
  --held: #F5B94D;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
  /* why: CODE-NOTES app.css #2 */
  --g-person: #3987e5; --g-org: #d95926; --g-topic: #199e70; --g-company: #c98500; --g-deal: #d55181;
  --g-project: #008300; --g-function: #9085e9; --g-document: #e66767; --g-page: #ECEEF4; --g-other: #8089A0;
  /* kinds v2 (lib/kinds.js): a new kind takes its family's colour (light steps follow); shape and word tell it apart */
  --g-facility: var(--g-org); --g-payer: var(--g-org); --g-product: var(--g-company); --g-software: var(--g-company);
  --g-place: var(--g-topic); --g-event: var(--g-document); --g-named_document: var(--g-document); --g-work: var(--g-function);
  --g-regulation: var(--g-function);
  --g-edge: rgba(157, 140, 255, 0.16); --g-edge-sparse: rgba(157, 140, 255, 0.45); --g-edge-hi: rgba(185, 173, 255, 0.75);

  --d1: 90ms; --d2: 160ms; --d3: 240ms; --d4: 360ms; --d5: 520ms;
  --e-std: cubic-bezier(.2, 0, 0, 1);
  --e-in: cubic-bezier(.05, .7, .1, 1);
  --e-out: cubic-bezier(.3, 0, .8, .15);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --target: 40px;
  --rail: 232px;
  --bar: 64px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F6F6FA;
  --surface: #FFFFFF;
  --surface-2: #EEEEF5;
  --surface-3: #E4E4EE;
  --glass: rgba(255, 255, 255, 0.82);
  --border: #DCDCE6;
  --border-strong: #7C8196;
  --text: #12131A;
  --text-2: #454A5C;
  --text-3: #5E6378;
  --accent: #5B47E0;
  --accent-hover: #4B38C9;
  --accent-text: #4B38C9;
  --on-accent: #FFFFFF;
  --accent-soft: rgba(91, 71, 224, 0.1);
  --glow: rgba(91, 71, 224, 0.25);
  --dots: rgba(91, 71, 224, 0.09);
  --halo: rgba(91, 71, 224, 0.07);
  --danger: #B42323;
  --danger-soft: rgba(180, 35, 35, 0.08);
  --success: #167239;
  --held: #9A4A06;
  --shadow: 0 24px 60px -28px rgba(18, 19, 26, 0.35);
  /* why: CODE-NOTES app.css #3 */
  --g-person: #2a78d6; --g-org: #eb6834; --g-topic: #1baf7a; --g-company: #eda100; --g-deal: #e87ba4;
  --g-project: #008300; --g-function: #6250d6; --g-document: #e34948; --g-page: #12131A; --g-other: #5E6378;
  --g-edge: rgba(91, 71, 224, 0.18); --g-edge-sparse: rgba(91, 71, 224, 0.5); --g-edge-hi: rgba(75, 56, 201, 0.8);
  color-scheme: light;
}

@media (pointer: coarse) { :root { --target: 44px; } }

/* base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/22px var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent-text); }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: 12px; z-index: 50; padding: 10px 14px; border-radius: 10px; background: var(--surface); color: var(--text); transform: translateY(-80px); transition: transform var(--d2) var(--e-std); }
.skip-link:focus { transform: none; }
.muted { color: var(--text-2); }
.small { font-size: 13px; line-height: 18px; }
.eyebrow { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.lead { font-size: 16px; line-height: 24px; color: var(--text); }
.noscript { padding: 24px; }

/* the ambient field and the boot dot */
.ambient { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0; transition: opacity var(--d4) var(--e-std); pointer-events: none; }
.ambient.on { opacity: 1; }
:root[data-theme="light"] .ambient.on { opacity: 0.55; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 24px var(--glow); animation: breathe 1.4s var(--e-std) infinite alternate; }
@keyframes breathe { from { opacity: .35; transform: scale(.8); } to { opacity: 1; transform: scale(1.1); } }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--target); padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font-size: 15px; font-weight: 650; text-decoration: none; cursor: pointer; transition: background var(--d2) var(--e-std), box-shadow var(--d2) var(--e-std), transform var(--d1) var(--e-std), border-color var(--d2) var(--e-std); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 10px 30px -10px var(--glow); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-quiet { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-quiet:hover { border-color: var(--accent); }
.btn-wide { width: 100%; min-height: 48px; }
.link { appearance: none; background: none; border: 0; padding: 8px 0; color: var(--accent-text); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.icon-btn { appearance: none; width: var(--target); height: var(--target); border-radius: 999px; border: 0; background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 16px; transition: border-color var(--d2) var(--e-std), box-shadow var(--d2) var(--e-std); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 22px -6px var(--glow); }
.input.code { font-family: var(--mono); font-size: 22px; letter-spacing: .45em; text-align: center; padding-left: .45em; }
.msg { min-height: 20px; font-size: 14px; line-height: 20px; color: var(--text-2); }
.msg.err { color: var(--danger); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14.5px; line-height: 21px; }
.note .ic { flex: none; margin-top: 1px; }
.card { background: var(--glass); border: 1px solid var(--border); border-radius: 18px; padding: 18px; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.seg-opt { position: relative; display: inline-flex; }
.seg-input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: inline-flex; align-items: center; min-height: calc(var(--target) - 8px); padding: 0 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--text-2); transition: background var(--d2) var(--e-std), color var(--d2) var(--e-std); }
.held-row .seg-opt span { min-height: 44px; }
.seg-input:checked + span { background: var(--accent-soft); color: var(--text); box-shadow: 0 0 14px -4px var(--glow); }
.seg-input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 1px; }
/* why: CODE-NOTES app.css #10 */
.src-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.src-pick .seg-opt > span { gap: 6px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; }
.src-pick .seg-opt:hover > span { border-color: var(--accent-text); }
.src-pick .seg-input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: none; }
.src-pick .src-mark, .src-pick .src-chosen { display: none; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; font-size: inherit; }
.src-pick .seg-input:checked + span .src-mark, .src-pick .seg-input:checked + span .src-chosen { display: inline-flex; align-items: center; }
.src-pick .src-chosen { font-weight: 500; }
.src-pick .src-chosen::before { content: '\00B7'; margin-right: 6px; }
.choice { border: 0; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* the sign-in */
.signin { position: relative; z-index: 2; min-height: 100%; display: flex; align-items: center; justify-content: center; padding: max(48px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom)); }
.signin-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; padding: 32px; border-radius: 22px; background: var(--glass); border: 1px solid var(--border); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow); animation: rise var(--d4) var(--e-in) backwards; }
.signin-brand { display: flex; align-items: center; gap: 10px; color: var(--accent-text); }
.brand-word { font-size: 14px; font-weight: 700; letter-spacing: .24em; color: var(--text); }
.signin-title { font-size: 28px; line-height: 34px; font-weight: 650; letter-spacing: -0.015em; margin-bottom: 6px; }
.signin-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; }
@media (max-width: 599px) {
  .signin { align-items: stretch; padding-left: 16px; padding-right: 16px; }
  .signin-card { max-width: none; background: transparent; border: 0; box-shadow: none; padding: 16px 4px; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .signin-actions { margin-top: auto; }
}

/* the shell: phone first */
.shell { position: relative; z-index: 1; min-height: 100%; }
.shell.behind { visibility: hidden; }
.main { min-height: 100vh; padding: max(20px, env(safe-area-inset-top)) 16px calc(var(--bar) + 24px + env(safe-area-inset-bottom)); outline: none; }
/* Glow (David's pick B): the intro's dot field and halo behind every page; decoration only, static */
.main { background: radial-gradient(1100px 520px at 55% -180px, var(--halo), transparent 70%), radial-gradient(circle, var(--dots) 1px, transparent 1.8px) 0 0 / 20px 20px; }
.title::before, .display::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 22px; vertical-align: .3em; border-radius: 50%; background: var(--accent-text); box-shadow: 8px -6px 0 var(--accent-text), 16px 1px 0 var(--accent-text), 0 0 8px var(--glow); }
.pulled-what .kind-dot { margin-right: 8px; filter: drop-shadow(0 0 4px var(--glow)); }
.health { margin: 0; font-size: 15px; }
.health::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }
.health.warn::before { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.held-group p b::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 0 8px var(--glow); }
.rail { display: none; }
.bar { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; display: flex; padding: 4px 6px env(safe-area-inset-bottom); background: var(--bg); background: color-mix(in srgb, var(--bg) 86%, transparent); border-top: 1px solid var(--border); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.bar-item { appearance: none; flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; border-radius: 12px; color: var(--text-3); font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer; transition: color var(--d2) var(--e-std); }
.bar-item[aria-current="page"] { color: var(--accent-text); }
.bar-item[aria-current="page"] .ic { filter: drop-shadow(0 0 6px var(--glow)); }
.bar-item { position: relative; }
.badge { position: absolute; top: 4px; left: calc(50% + 4px); min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.badge.stale { background: var(--bg); color: var(--accent-text); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* tablet: a narrow rail from 600 px */
@media (min-width: 600px) {
  .bar { display: none; }
  .rail { position: fixed; z-index: 5; top: 0; bottom: 0; left: 0; width: 84px; display: flex; flex-direction: column; gap: 6px; padding: 18px 10px; background: var(--bg); background: color-mix(in srgb, var(--bg) 90%, transparent); border-right: 1px solid var(--border); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .main { margin-left: 84px; padding: 40px 32px 48px; }
  .rail-brand { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; margin-bottom: 14px; color: var(--accent-text); }
  .rail-items { display: flex; flex-direction: column; gap: 4px; }
  .rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
  .nav-item { appearance: none; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 56px; padding: 6px; border: 0; border-radius: 12px; background: none; color: var(--text-3); font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background var(--d2) var(--e-std), color var(--d2) var(--e-std); }
  .nav-item:hover { background: var(--surface-3); color: var(--text); }
  .nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: 0 0 18px -6px var(--glow); }
  .rail .brand-word { display: none; }
  .rail-toggle { display: none; }
}

/* desktop: a wide rail with names, unless chosen narrow */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .rail { width: var(--rail); padding: 20px 14px; }
  .main { margin-left: var(--rail); padding: 56px 56px 56px; }
  .rail-brand { justify-content: flex-start; padding: 0 12px; }
  .rail .brand-word { display: inline; }
  .nav-item { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 42px; padding: 0 12px; font-size: 14px; font-weight: 550; }
  .rail-toggle { display: flex; }
  .nav-item .badge { position: static; margin-left: auto; }
  :root.rail-narrow .nav-item .badge { position: absolute; }
  :root.rail-narrow { --rail: 76px; }
  :root.rail-narrow .nav-label { display: none; }
  :root.rail-narrow .rail-brand, :root.rail-narrow .nav-item { justify-content: center; padding: 0; }
}

/* the screens */
.view { max-width: 980px; margin: 0 auto; }
.screen-body { display: flex; flex-direction: column; gap: 24px; }
.screen-ask { align-items: center; text-align: center; padding-top: 6vh; }
.screen-ask .soon { text-align: left; max-width: 720px; width: 100%; }
.hero { display: flex; flex-direction: column; gap: 10px; }
.display { font-size: clamp(30px, 4.6vw, 44px); line-height: 1.12; font-weight: 650; letter-spacing: -0.022em; outline: none; }
.title { font-size: 30px; line-height: 36px; font-weight: 650; letter-spacing: -0.015em; outline: none; }
.soon { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.settings { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* the More list and the sheet */
.more-list { display: flex; flex-direction: column; gap: 4px; }
.more-item { appearance: none; display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 12px; border: 0; border-radius: 12px; background: none; color: var(--text); font-size: 16px; text-decoration: none; text-align: left; cursor: pointer; }
.more-item:hover { background: var(--surface-3); }
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(4, 5, 8, .55); opacity: 0; transition: opacity var(--d3) var(--e-std); }
.sheet-backdrop.open { opacity: 1; }
/* why: CODE-NOTES app.css #4 */
.sheet { width: 100%; max-height: 86vh; overflow: auto; padding: 8px 20px max(24px, env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transform: translateY(100%); transition: transform calc(var(--d4) * .7) var(--e-out); outline: none; }
.sheet-backdrop.open .sheet { transform: none; transition: transform var(--d4) var(--e-sheet, var(--e-in)); }
@supports (transition-timing-function: linear(0, 1)) {
  :root { --e-sheet: linear(0, .22 6%, .56 14%, .82 24%, .95 36%, 1.006 50%, 1.01 62%, 1.003 80%, 1); }
}
.grabber { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet-title { font-size: 20px; line-height: 26px; font-weight: 650; }
.form { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 600px) {
  .sheet-backdrop { align-items: center; }
  .sheet { width: 440px; border-radius: 20px; padding: 20px 24px 24px; transform: translateY(12px) scale(.98); opacity: 0; transition: transform calc(var(--d3) * .7) var(--e-out), opacity calc(var(--d3) * .7) var(--e-out); }
  .sheet-backdrop.open .sheet { opacity: 1; transition: transform var(--d3) var(--e-in), opacity var(--d3) var(--e-std); }
  .sheet:has(.palette) { width: min(600px, 92vw); }
  .grabber { display: none; }
}

/* toast and veil */
.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(var(--bar) + 20px + env(safe-area-inset-bottom)); padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity var(--d2) var(--e-out), transform var(--d2) var(--e-out); }
.toast.on { opacity: 1; transform: translate(-50%, 0); transition: opacity var(--d3) var(--e-in), transform var(--d3) var(--e-in); }
@media (min-width: 600px) { .toast { bottom: 28px; } }
.veil { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: none; }
:root.veiled .veil { display: block; }

/* the intro */
.intro { position: fixed; inset: 0; z-index: 40; background: var(--bg); cursor: pointer; }
.intro.out { opacity: 0; transition: opacity 320ms var(--e-std); pointer-events: none; }
.intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.wordmark { position: absolute; left: 0; right: 0; top: calc(50% + clamp(84px, 13vmin, 150px)); text-align: center; font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: .62em; padding-left: .62em; color: var(--text); opacity: 0; text-shadow: 0 0 28px var(--glow); transition: opacity var(--d5) var(--e-in), letter-spacing 700ms var(--e-in), padding-left 700ms var(--e-in); }
.wordmark.on { opacity: 1; letter-spacing: .24em; padding-left: .24em; }
.intro-skip { position: absolute; left: 50%; bottom: max(36px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-3); font-size: 13px; cursor: pointer; opacity: 0; animation: hint 600ms 500ms var(--e-in) forwards; }
@keyframes hint { to { opacity: 1; } }

/* entrances */
/* why: CODE-NOTES app.css #5 */
.app-in > * { animation: appin 420ms var(--e-in) backwards; }
@keyframes appin { from { opacity: 0; transform: scale(.985) translateY(8px); } to { opacity: 1; transform: none; } }
.view-in { animation: viewin var(--d3) var(--e-in) backwards; }
@keyframes viewin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 520ms var(--e-in) backwards; }
.d1 { animation-delay: 60ms; } .d2 { animation-delay: 120ms; } .d3 { animation-delay: 180ms; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
/* why: CODE-NOTES app.css #6 */
.stagger > * { animation: rowin var(--d3) var(--e-in) backwards; animation-delay: calc(var(--row, 0) * 30ms); }
.stagger > :nth-child(2) { --row: 1; } .stagger > :nth-child(3) { --row: 2; } .stagger > :nth-child(4) { --row: 3; }
.stagger > :nth-child(5) { --row: 4; } .stagger > :nth-child(n+6) { --row: 5; }
@keyframes rowin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* a passage opened in the context pane crossfades in (each opening puts new elements in the pane) */
.context-pane > * { animation: viewin var(--d3) var(--e-in) backwards; }
/* why: CODE-NOTES app.css #7 */
.vt-title { view-transition-name: brain-title; }
::view-transition-group(brain-title) { animation-duration: var(--d3); animation-timing-function: var(--e-std); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--d3); }

/* reduced motion: every move becomes a 120 ms fade */
/* why: CODE-NOTES app.css #8 */
:root.reduce-motion .app-in > *, :root.reduce-motion .view-in, :root.reduce-motion .signin-card, :root.reduce-motion .rise, :root.reduce-motion .stagger > *, :root.reduce-motion .context-pane > * { animation: fade 120ms linear backwards; }
:root.reduce-motion .boot-dot, :root.reduce-motion .status.busy::before { animation: none; }
:root.reduce-motion .sheet, :root.reduce-motion .sheet-backdrop.open .sheet, :root.reduce-motion .toast, :root.reduce-motion .toast.on { transition: opacity 120ms linear; }
:root.reduce-motion .sheet, :root.reduce-motion .sheet-backdrop.open .sheet { transform: none; }
:root.reduce-motion .sheet-backdrop .sheet { opacity: 0; }
:root.reduce-motion .sheet-backdrop.open .sheet { opacity: 1; }
:root.reduce-motion .toast, :root.reduce-motion .toast.on { transform: translateX(-50%); }
:root.reduce-motion .skip-link { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .app-in > *, .view-in, .signin-card, .rise, .stagger > *, .context-pane > * { animation: fade 120ms linear backwards; }
  .boot-dot, .status.busy::before { animation: none; }
  .sheet, .sheet-backdrop.open .sheet, .toast, .toast.on { transition: opacity 120ms linear; }
  .sheet, .sheet-backdrop.open .sheet { transform: none; }
  .sheet-backdrop .sheet { opacity: 0; }
  .sheet-backdrop.open .sheet { opacity: 1; }
  .toast, .toast.on { transform: translateX(-50%); }
  .skip-link { transition: none; }
}

/* the Connections graph */
.graph-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.graph-canvas:active { cursor: grabbing; }
.graph-canvas.on-node { cursor: pointer; }
.graph-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* slice 2: shared pieces */
.view-wide { max-width: 1280px; }
.screen-loading { padding: 24px 0; }
.num { font-variant-numeric: tabular-nums; }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.status { min-height: 20px; font-size: 14px; line-height: 20px; color: var(--text-2); }
.status.busy::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--glow); animation: pulse 1.2s var(--e-std) infinite; }
.status.error { color: var(--danger); }
.screen-body > .status:empty { min-height: 0; margin-bottom: -24px; }
.empty { color: var(--text-2); padding: 8px 0; }
.empty.error { color: var(--danger); }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; background: var(--surface-3); color: var(--text-2); }
.pill.t2 { color: var(--accent-text); }
.desk-cards { display: flex; flex-direction: column; gap: 12px; }
.desk-card { display: flex; flex-direction: column; gap: 8px; }
.desk-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.desk-title { margin: 0; font-size: 17px; }
.desk-how { margin: 0; padding: 8px 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.desk-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.desk-person { display: flex; flex-direction: column; gap: 2px; }
.desk-rec, .desk-done, .desk-sheet, .desk-why { display: flex; flex-direction: column; gap: 8px; }
.desk-why { align-items: flex-start; }
.desk-why-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.desk-passage:empty { display: none; }
.desk-done { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--text-2); }
.desk-more { margin-top: 4px; }
.desk-said { margin: 0; padding-left: 10px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.wp { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.wp::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--g-company); }
.wp-personal::before { background: var(--g-topic); }
.wp-both::before { background: linear-gradient(90deg, var(--g-company) 50%, var(--g-topic) 50%); }
.date-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); max-width: 100%; }
.tabs > .tab { flex: none; white-space: nowrap; }
.tab { appearance: none; border: 0; background: none; min-height: calc(var(--target) - 8px); padding: 0 14px; border-radius: 9px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background var(--d2) var(--e-std), color var(--d2) var(--e-std); }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--text); box-shadow: 0 0 14px -4px var(--glow); }
.tab:focus-visible, .fact-row:focus-visible, .hit:focus-visible, .cite-chip:focus-visible, .neighbour:focus-visible, .panel:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.seg-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.block { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--border); }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* Ask */
.screen-ask .ask-box-wrap { width: 100%; max-width: 760px; }
.askbox { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.ask-field { display: flex; align-items: flex-end; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--border-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow); transition: border-color var(--d2) var(--e-std), box-shadow var(--d2) var(--e-std); }
.ask-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 34px -8px var(--glow); }
.ask-glyph { flex: none; align-self: center; color: var(--accent-text); }
.ask-input { flex: 1; min-width: 0; min-height: 28px; max-height: 40vh; resize: none; field-sizing: content; border: 0; outline: none; background: none; color: var(--text); font: inherit; font-size: 17px; line-height: 26px; padding: 4px 0; }
::placeholder { color: var(--text-3); }
.ask-go { flex: none; }
.ask-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.ask-empty { width: 100%; max-width: 760px; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.screen-ask .status { width: 100%; max-width: 760px; text-align: left; }
.tiles.today { width: 100%; max-width: 760px; grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: left; }
.today .tile { padding: 12px 14px; }
.today .tile-value { font-size: 24px; line-height: 30px; }
@media (max-width: 599px) { .tiles.today { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.screen-ask.has-results { align-items: stretch; text-align: left; padding-top: 0; gap: 18px; }
.screen-ask.has-results .hero .eyebrow { display: none; }
.screen-ask.has-results .display { font-size: 24px; line-height: 30px; }
.screen-ask.has-results .ask-box-wrap { max-width: none; }
.ask-results { display: flex; flex-direction: column; gap: 14px; }
.ask-results > .tabs { align-self: flex-start; }
.ask-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.ask-list { min-width: 0; }
.panel { display: flex; flex-direction: column; gap: 14px; outline: none; }
.panel-head, .panel-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.context-pane { display: none; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fact { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; border-radius: 14px; transition: background var(--d2) var(--e-std); }
.fact:hover { background: var(--surface); }
.fact-row { appearance: none; display: flex; gap: 12px; align-items: flex-start; width: 100%; min-height: var(--target); padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 15.5px; line-height: 23px; text-align: left; cursor: pointer; border-radius: 10px; }
.cite { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; transition: background var(--d2) var(--e-std), color var(--d2) var(--e-std), box-shadow var(--d2) var(--e-std); }
.fact-row:hover .cite, .fact-row.on .cite { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 16px -4px var(--glow); }
.fact-line { padding-top: 1px; }
.fact-typed, .fact-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-left: 38px; font-size: 13px; color: var(--text-2); }
.typed-tags { color: var(--text-2); }
.typed-note { color: var(--held); font-weight: 600; }
.cite-chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cite-chip { appearance: none; min-width: 32px; height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--accent-text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.cite-chip:hover { border-color: var(--accent); }
.meta-title { color: var(--text); font-weight: 600; }
.conflicts li, .unknowns li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-2); }
.hit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hit { appearance: none; display: flex; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 14px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background var(--d2) var(--e-std); }
.hit:hover { background: var(--surface); }
.hit-rank { flex: none; width: 26px; padding-top: 1px; color: var(--text-3); font-weight: 700; text-align: center; }
.hit-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hit-body .fact-meta { padding-left: 0; }
.hit-title { font-weight: 650; font-size: 15.5px; }
.hit-summary { color: var(--text-2); font-size: 14.5px; line-height: 21px; }
.hit-score { width: 120px; height: 4px; }
.hit-score .track { fill: var(--surface-3); }
.hit-score .fill { fill: var(--accent); }
.reader { display: flex; flex-direction: column; gap: 12px; }
.reader-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.reader > .link { align-self: flex-start; padding-top: 0; }
.reader-title { font-size: 19px; line-height: 25px; font-weight: 650; }
.reader .fact-meta { padding-left: 0; }
.excerpt { margin: 0; padding: 14px 16px; border-radius: 14px; border-left: 3px solid var(--accent); background: var(--surface-2); font-size: 15.5px; line-height: 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
.excerpt.focus { box-shadow: 0 0 30px -14px var(--glow); }
.excerpt.cut::after { content: " …"; color: var(--text-3); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.neighbours { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.neighbours li { display: flex; gap: 10px; color: var(--text-2); font-size: 14px; line-height: 20px; }
.neighbour { appearance: none; display: flex; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font: inherit; font-size: 14px; line-height: 20px; text-align: left; cursor: pointer; }
.neighbour:hover { background: var(--surface-2); color: var(--text); }
.neighbour .num { flex: none; min-width: 72px; }
.looked { margin: 0 0 4px; }
.looked-head { color: var(--text-2); font-weight: 600; }
.via { font-size: 12.5px; color: var(--accent-text); }
.conn-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pane-idle { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 12px; text-align: center; color: var(--text-3); }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .ask-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
  .context-pane { display: block; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; padding: 18px; border-radius: 18px; background: var(--glass); border: 1px solid var(--border); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow); }
}
@media (max-width: 599px) {
  .ask-field { padding-left: 12px; }
  .ask-glyph { display: none; }
  .fact { padding: 10px 4px 12px; }
  .fact-typed, .fact-meta { padding-left: 38px; }
}

/* Library */
.page-head { display: flex; flex-direction: column; gap: 6px; }
.lib-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.conv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.conv-row, .passage-row { appearance: none; display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 12px 14px; border: 0; border-radius: 14px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background var(--d2) var(--e-std); }
.conv-row:hover, .passage-row:hover { background: var(--surface); }
.conv-row:focus-visible, .passage-row:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.conv-row .fact-meta, .passage-row .fact-meta { padding-left: 0; }
.conv-title { font-size: 16px; line-height: 22px; font-weight: 650; }
.conv-head { display: flex; flex-direction: column; gap: 8px; }
.conv-head .fact-meta { padding-left: 0; }
.conv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 600px) {
  .passage-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 4px 16px; }
  .passage-row > :not(.fact-meta) { grid-column: 2; }
  .passage-row .fact-meta { grid-row: span 2; align-self: start; }
  .passage-line { font-size: 16px; line-height: 26px; max-width: 70ch; }
}
.conv-name { font-size: 24px; line-height: 30px; font-weight: 650; letter-spacing: -0.01em; outline: none; }
.link.back { align-self: flex-start; padding: 4px 0; text-decoration: none; }
.link.back:hover { text-decoration: underline; }
.lib-card { display: flex; flex-direction: column; gap: 14px; }
/* Library step 1, the explorer (screens/library.js): folders, the list, a conversation. A phone shows the folders or the list. */
.lib-x { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.lib-x.at-folders .lib-main, .lib-x.at-files .lib-tree, .lib-x.no-tree .lib-tree { display: none; }
.lib-tree { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lib-tree .eyebrow { margin: 14px 12px 2px; }
.lib-tree > .small { margin: 12px 12px 0; }
.lib-sub { margin: 8px 12px 0; font-weight: 600; }
.lib-folders { display: flex; flex-direction: column; gap: 2px; }
.lib-folder { appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--target); padding: 0 12px; border: 0; border-radius: 12px; background: none; color: var(--text-2); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.lib-folder.d1 { padding-left: 30px; }
.lib-folder:hover { background: var(--surface); color: var(--text); }
.lib-folder.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.lib-folder.on .num { color: var(--accent-text); }
.lib-folder .num { margin-left: auto; }
.lib-folder-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-where { margin: 0; font-size: 20px; line-height: 26px; font-weight: 650; outline: none; }
.lib-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lib-filter, .lib-sort { height: var(--target); min-width: 0; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; }
.lib-filter { flex: 1 1 220px; }
.lib-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lib-table th { padding: 0 6px 4px; border-bottom: 1px solid var(--border); text-align: left; }
.lib-table th.num, .lib-table td.num { text-align: right; }
.th-sort { appearance: none; padding: 6px; border: 0; border-radius: 8px; background: none; color: var(--text-3); font: inherit; font-size: 12px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; }
th[aria-sort] .th-sort, .th-sort:hover { color: var(--text); }
.lib-table td { padding: 9px 12px; border-bottom: 1px solid var(--surface-3); white-space: nowrap; }
.lib-table tbody tr { cursor: pointer; }
.lib-table tbody tr:hover td { background: var(--surface); }
.lib-name { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }
.conv-open:not(.conv-row) { appearance: none; display: block; width: 100%; padding: 2px 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.lib-filter:focus-visible, .lib-sort:focus-visible, .lib-folder:focus-visible, .th-sort:focus-visible, .conv-open:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .lib-x { grid-template-columns: 240px minmax(0, 1fr); }
  .lib-x.reading { grid-template-columns: 220px minmax(0, 1fr) minmax(320px, 380px); }
  .lib-x.no-tree { grid-template-columns: minmax(0, 1fr); }
  .lib-x.no-tree.reading { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
  .lib-x:not(.reading) .context-pane { display: none; }
  .lib-tree { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; }
}
.card-title { font-size: 17px; line-height: 23px; font-weight: 650; }
.pulled { display: flex; flex-direction: column; gap: 8px; }
.pulled-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.pulled-item:last-child { border-bottom: 0; }
.pulled-what { min-width: 0; overflow-wrap: anywhere; }
.passage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.passage-line { font-size: 15px; line-height: 22px; }

/* Review */
.screen-review > .tabs { align-self: flex-start; }
.review-body { display: flex; flex-direction: column; gap: 14px; }
.review-total { display: flex; align-items: baseline; gap: 10px; }
.review-total .big { font-size: 34px; line-height: 40px; font-weight: 700; letter-spacing: -0.02em; }
.fq-list { margin: 0; padding: 0 0 0 4px; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.fq { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.fq:last-child { border-bottom: 0; padding-bottom: 0; }
.fq-q { font-size: 15.5px; line-height: 23px; font-weight: 600; }
.card-title .muted { font-weight: 500; }
/* the "Needs your eye" prototype (screens/proto/needs-eye.js; lib/flags.js findingsQueue, OFF) */
.mono { font-family: var(--mono); font-size: 12.5px; }
.eye-proto { display: flex; align-items: center; gap: 8px; color: var(--held); }
.eye-list { display: flex; flex-direction: column; gap: 10px; }
/* Review → Merges (the prototype; lib/flags.js mergeReview): the batch merge review */
.merge-head { display: flex; flex-direction: column; gap: 8px; }
.merge-paste-card summary { cursor: pointer; color: var(--accent-text); font-size: 14px; line-height: 44px; }
.merge-paste-card label { display: block; margin: 4px 0; }
.merge-paste { box-sizing: border-box; width: 100%; min-height: 8rem; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.merge-verdict { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-weight: 600; }
.merge-verdict svg { flex: none; margin-top: 2px; }
.merge-verdict.go { color: var(--success); }
.merge-verdict.no_go, .merge-verdict.stop { color: var(--danger); }
.merge-verdict.not_yet { color: var(--text-2); }
.merge-verdict span { color: var(--text); }
.merge-copy { display: flex; flex-direction: column; gap: 8px; }
.merge-bus { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.merge-list { list-style: none; margin: 0; padding: 0; }
.merge-card.marked { border-color: var(--border-strong); }
.merge-card .desk-person .pill { align-self: flex-start; margin-top: 2px; }
.merge-flag { gap: 4px; height: auto; min-height: 20px; padding: 2px 7px; color: var(--held); letter-spacing: 0; font-weight: 650; white-space: normal; }
.merge-wrong .seg-input:checked + span { background: var(--danger-soft); }
@media (max-width: 420px) { .merge-card .desk-pair { grid-template-columns: 1fr; } }
.eye-item { appearance: none; width: 100%; text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.eye-item:hover, .eye-item.on { border-color: var(--border-strong); background: var(--surface-2); }
.eye-item.on { box-shadow: inset 3px 0 0 var(--accent); }
.eye-title { font-size: 15.5px; line-height: 21px; font-weight: 600; }
.eye-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.eye-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.eye-chip.sens { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.eye-grid { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.eye-card { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 20px 24px; }
.eye-card .fact-meta { padding-left: 0; }
.eye-sec { display: flex; flex-direction: column; gap: 6px; }
.eye-why-row, .eye-checks li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text-2); }
.eye-why-row svg { color: var(--held); flex: none; margin-top: 2px; }
.eye-cite { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); }
.cite-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 700; }
.eye-cite-what, .eye-quote { display: block; font-size: 14px; }
.eye-quote { font-style: italic; }
.eye-found, .eye-notfound { font-size: 12.5px; color: var(--success); }
.eye-notfound { color: var(--danger); }
.eye-checks { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.eye-checks svg { flex: none; margin-top: 2px; color: var(--success); }
.eye-bad svg { color: var(--danger); }
.eye-checks b { color: var(--text); font-weight: 600; }
.eye-decide, .eye-reasons { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
/* the "Add to BRAIN" prototype (screens/add.js; lib/flags.js addToBrain, OFF) */
.add-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.add-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.add-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding: 20px 24px; border: 1.5px dashed var(--border-strong); border-radius: 16px; background: var(--accent-soft); }
.add-drop svg { color: var(--accent-text); flex: none; }
.add-drop .btn[disabled] { cursor: not-allowed; }
.add-drop-words { flex: 1 1 220px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.add-drop-words label.lead { line-height: 44px; }
.add-file { box-sizing: border-box; max-width: 100%; min-height: 44px; }
.add-realm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.add-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.add-note svg { color: var(--accent-text); flex: none; margin-top: 2px; }
.add-note b { color: var(--text); }
.add-list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px 8px; }
.add-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(120px, 210px); gap: 14px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--border); }
.add-badge { display: inline-flex; align-items: center; justify-content: center; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text-2); }
.add-what, .add-state { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.add-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-name.hidden { color: var(--text-2); font-style: italic; }
.add-steps { display: flex; gap: 3px; margin-top: 6px; }
.add-steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--border); }
.add-steps i.done { background: var(--accent); }
.add-steps i.now { background: repeating-linear-gradient(90deg, var(--accent) 0 6px, var(--accent-soft) 6px 10px); }
.add-steps i.held { background: var(--held); }
.add-steps i.bad { background: var(--danger); }
.add-state { text-align: right; }
.add-state.ok b { color: var(--success); }
.add-state.held b { color: var(--held); }
.add-state.bad b { color: var(--danger); }
.add-formats { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; }
.add-fmt-full .eyebrow { color: var(--success); }
.add-fmt-part .eyebrow { color: var(--held); }
@media (min-width: 1024px) { .add-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 599px) {
  .eye-cite { grid-template-columns: 28px minmax(0, 1fr); }
  .eye-found, .eye-notfound { grid-column: 2; }
  .add-row { grid-template-columns: 44px minmax(0, 1fr); }
  .add-state { grid-column: 2; text-align: left; }
}

/* Connections */
.conn-search { display: flex; gap: 10px; width: 100%; max-width: 640px; }
.conn-search .input { flex: 1; min-width: 0; }
.conn-pick-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { appearance: none; display: inline-flex; align-items: center; gap: 6px; min-height: calc(var(--target) - 4px); padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
/* why: CODE-NOTES app.css #9 */
@media (pointer: coarse) {
  .seg-opt span, .tab, .chip-btn { min-height: var(--target); }
  .link, .skip-link { display: inline-flex; align-items: center; min-height: var(--target); }
  .cite-chip { min-width: var(--target); height: var(--target); }
}
.chip-btn:hover, .chip-btn.on { border-color: var(--accent); box-shadow: 0 0 14px -6px var(--glow); }
.chip-btn:focus-visible, .conn-link:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.kind-dot { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--g-other); }
.kind-person { background: var(--g-person); } .kind-company { background: var(--g-company); } .kind-org { background: var(--g-org); }
.kind-deal { background: var(--g-deal); } .kind-project { background: var(--g-project); } .kind-topic { background: var(--g-topic); }
.kind-function { background: var(--g-function); } .kind-document { background: var(--g-document); } .kind-page { background: var(--g-page); }
.kind-facility { background: var(--g-facility); } .kind-payer { background: var(--g-payer); } .kind-product { background: var(--g-product); }
.kind-software { background: var(--g-software); } .kind-place { background: var(--g-place); } .kind-event { background: var(--g-event); }
.kind-named_document { background: var(--g-named_document); } .kind-work { background: var(--g-work); } .kind-regulation { background: var(--g-regulation); }
.conn-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.conn-trail:empty, .conn-picks:empty { display: none; }
.conn-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.conn-stage { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; overflow: hidden; }
.conn-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.conn-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.conn-buttons { display: flex; gap: 6px; }
.conn-tool { font-size: 18px; font-weight: 600; }
.conn-canvas-wrap { position: relative; height: 54vh; min-height: 300px; border-radius: 14px; overflow: hidden; background: var(--bg); }
/* the 3D map (lib/space-view.js, behind FLAGS.space3d): the labels' canvas over the WebGL one; each kind's shape */
.space-labels { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.kind-dot.shape-1 { border-radius: 3px; } .kind-dot.shape-2 { border-radius: 1px; transform: rotate(45deg) scale(0.85); }
.kind-dot.shape-3 { border-radius: 0; clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%); } .kind-dot.shape-4 { border-radius: 0; }
.conn-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; text-align: center; color: var(--text-2); }
.conn-empty .icon { color: var(--accent-text); }
.conn-note { padding: 0 4px; }
.conn-panel { gap: 12px; }
.conn-evidence { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.conn-evidence .neighbour { flex-direction: column; gap: 2px; }
.conn-links { gap: 2px; }
.conn-link { appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--target); padding: 6px 8px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.conn-link:hover { background: var(--surface-2); }
.conn-link-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .conn-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); }
  .conn-canvas-wrap { height: calc(100vh - 300px); min-height: 420px; }
  .conn-side { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; }
}

/* Timeline */
.tl-options { display: flex; flex-wrap: wrap; gap: 10px; }
.tl-body { display: flex; flex-direction: column; gap: 14px; }
.tl { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; display: flex; flex-direction: column; gap: 22px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: linear-gradient(var(--accent), var(--border)); }
.tl-month { position: relative; display: flex; flex-direction: column; gap: 8px; }
.tl-month::before { content: ""; position: absolute; left: -21px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 12px -2px var(--glow); }
.tl-label { font-size: 17px; line-height: 24px; font-weight: 650; }
.tl-items { gap: 4px; }
.tl-item { appearance: none; display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background var(--d2) var(--e-std); }
.tl-item:hover { background: var(--surface); }
.tl-item:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.tl-item .fact-meta { padding-left: 0; }
.tl-text { font-size: 15px; line-height: 22px; }

/* Status */
.page-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.status-body { display: flex; flex-direction: column; gap: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.tile-link { transition: border-color var(--d2) var(--e-std), box-shadow var(--d2) var(--e-std); }
.tile-link:hover { border-color: var(--accent); box-shadow: 0 0 22px -10px var(--glow); }
.tile-link:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.tile-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.tile-value { font-size: 30px; line-height: 36px; font-weight: 650; letter-spacing: -0.015em; text-shadow: 0 0 18px var(--glow); }
.cols { display: block; width: 100%; height: auto; max-height: 220px; }
.cols .col-axis { stroke: var(--border); stroke-width: 1; }
.cols .col-tick { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.cols .col-hit { fill: transparent; }
.cols .col-bar { fill: var(--accent); transition: fill var(--d1) var(--e-std); }
.cols .col:hover .col-bar { fill: var(--accent-hover); }
.numbers summary { cursor: pointer; color: var(--accent-text); font-size: 14px; line-height: 44px; }
.num-table { margin-top: 10px; border-collapse: collapse; font-size: 14px; }
.num-table th, .num-table td { padding: 4px 14px 4px 0; text-align: left; border-bottom: 1px solid var(--border); }
.num-table th { color: var(--text-2); font-weight: 600; }
.run-bad { color: var(--danger); font-weight: 600; }

/* the palette */
/* the sheet widens for it on a desktop (.sheet:has(.palette)); the palette itself never sets a width the sheet must scroll for */
.palette { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pal-list { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.pal-opt { display: flex; align-items: center; gap: 10px; min-height: var(--target); padding: 6px 10px; border-radius: 10px; color: var(--text); cursor: pointer; }
.pal-opt.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.pal-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pal-hint { flex: none; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border-strong); font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.rail-search .pal-hint { margin-left: auto; }
.shortcuts td { vertical-align: top; }
/* the full-read run board (Lead 1415 item 9; lib/flags.js runBoard, OFF): state glyph + word, KPI tiles, meters with their numbers in words,
   batch receipts in a table that scrolls inside its own region, never the page */
.rb-slot:empty { display: none; }
.rb-slot { width: 100%; }
.rb-show { min-height: 44px; padding: 0 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-strong); }
.rb-show-label { display: flex; align-items: center; min-height: 44px; }
.rb-body { display: flex; flex-direction: column; gap: 14px; }
.rb-state { margin: 0; font-size: 15px; }
.rb-glyph { display: inline-block; min-width: 1.4em; font-weight: 700; }
.rb-state.tone-good .rb-glyph { color: var(--success); }
.rb-state.tone-warn .rb-glyph { color: var(--held); }
.rb-state.tone-bad .rb-glyph { color: var(--danger); }
.rb-state.tone-idle .rb-glyph, .rb-state.tone-unknown .rb-glyph { color: var(--text-3); }
.rb-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rb-tiles .tile { padding: 12px 14px; }
.rb-tiles .tile-value { font-size: 24px; line-height: 30px; }
@media (max-width: 599px) { .rb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rb-gauge { display: flex; flex-direction: column; gap: 6px; }
.rb-gauge-label { margin: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; }
.rb-num { color: var(--text-2); font-variant-numeric: tabular-nums; }
.rb-bar { appearance: none; -webkit-appearance: none; width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.rb-bar::-webkit-meter-bar, .rb-bar::-webkit-progress-bar { background: var(--accent-soft); border: 0; border-radius: 4px; height: 8px; }
.rb-bar::-webkit-meter-optimum-value, .rb-bar::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
.rb-bar::-webkit-meter-suboptimum-value { background: var(--held); border-radius: 4px; }
.rb-bar::-webkit-meter-even-less-good-value { background: var(--danger); border-radius: 4px; }
.rb-bar::-moz-meter-bar, .rb-bar::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
.rb-bar:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--held); }
.rb-bar:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--danger); }
.rb-wave { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.rb-wave-title { margin: 0; font-size: 15px; font-weight: 650; }
.rb-wave-state { font-weight: 500; color: var(--text-2); }
.rb-scroll { max-width: 100%; overflow-x: auto; border-radius: 10px; }
.rb-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rb-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rb-table th, .rb-table td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
.rb-table thead th { color: var(--text-2); font-weight: 600; }
.rb-table th:nth-child(2), .rb-table td:nth-child(2), .rb-table th:nth-child(3), .rb-table td:nth-child(3), .rb-table td:last-child, .rb-table th:last-child { text-align: left; }
.rb-check-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rb-state.tone-warn .rb-glyph, .rb-check .tone-warn .rb-glyph { color: var(--held); }

/* Conversations (screens/catalogue.js; catalogueList OFF) */
.cat-row{display:flex;flex-direction:column;gap:6px}
.cat-row p{margin:0;overflow-wrap:anywhere}
.cat-top{display:flex;align-items:flex-start;gap:10px}
.cat-main{flex:1;min-width:0}
.cat-badge{padding:2px 10px;border-radius:999px;border:1px solid var(--border-strong);font-size:13px}
.cat-badge.allow{color:var(--accent-text)}
.cat-badge.never{color:var(--danger)}
.cat-out{outline:2px solid var(--danger)}
.cat-notice{border-left:2px solid var(--held);padding-left:8px}
