/* Quotient design system — tokens, primitives, app shell, chat, overlays. */
:root {
  --bg: #F6F6F3;
  --surface: #FFFFFF;
  --surface-2: #FAFAF8;
  --sunken: #F0F0EC;
  --line: #E7E6E1;
  --line-2: #D9D8D2;
  --ink: #15181A;
  --ink-2: #464B50;
  --muted: #6B7075;          /* readable on white (5:1); was #80858A */
  --faint: #A9ADB1;

  --brand: #0B4F35;          /* Huntington deep green */
  --brand-ink: #0A3D2A;
  --brand-2: #1E7048;
  --brand-tint: #E9F2EC;
  --brand-tint-2: #D5E8DB;
  --accent: #5BB749;         /* Huntington bright green, used sparingly */
  --edge-lit: #B9D5C3;       /* card border on hover */

  /* Fund lifecycle — ordinal one-hue ramp (validated ≥2:1 on white at the light end) */
  --lc-spent: #0E3F2C;
  --lc-committed: #1E7048;
  --lc-allocated: #45A06A;
  --lc-available: #7DBF8E;
  --lc-revenue: #15181A;

  /* Evidence tiers */
  --ev-committed: #0E3F2C;
  --ev-documented: #1E7048;
  --ev-estimated: #7DBF8E;
  --ev-placeholder: #E0A43A;

  /* Status (reserved) */
  --red: #C23B2E;   --red-tint: #FBEDEA;
  --amber: #B7791F; --amber-tint: #FBF3E3;
  --green: #2D7D4B; --green-tint: #E8F3EC;
  --blue: #2F5FB3;  --blue-tint: #EAF0FA;

  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --shadow-1: 0 1px 2px rgba(16, 24, 20, .05);
  --shadow-2: 0 2px 6px rgba(16, 24, 20, .05), 0 12px 32px rgba(16, 24, 20, .08);
  --shadow-3: 0 24px 64px rgba(16, 24, 20, .18);
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --rail-w: 64px;
  --chat-w: 384px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 14px/1.45 var(--font); letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; font-feature-settings: 'ss01', 'cv11';
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.label { font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.gap4 { gap: 4px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; } .gap24 { gap: 24px; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: #D6D5CF transparent; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 9px; font-weight: 500; font-size: 13.5px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #C9C8C1; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.danger { color: var(--red); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 14.5px; border-radius: 11px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn .ico { width: 16px; height: 16px; }
.link { color: var(--brand-2); font-weight: 500; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.input, .select, .textarea {
  height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface);
  outline: none; transition: border-color .12s, box-shadow .12s; width: 100%;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(30, 112, 72, .14); }
.input.sm, .select.sm { height: 30px; font-size: 13px; padding: 0 9px; border-radius: 7px; }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { accent-color: var(--brand); width: 15px; height: 15px; }
.seg { display: inline-flex; padding: 2px; background: var(--sunken); border-radius: 9px; gap: 2px; }
.seg button { height: 28px; padding: 0 12px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.err { color: var(--red); font-size: 12.5px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .15s, box-shadow .15s; }
.card.hv:hover { border-color: var(--edge-lit); box-shadow: 0 6px 20px rgba(16, 24, 20, .05); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head h3 { font-size: 14px; }
.divider { height: 1px; background: var(--line); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; background: var(--sunken); color: var(--ink-2); white-space: nowrap;
}
.pill.red { background: var(--red-tint); color: var(--red); }
.pill.amber { background: var(--amber-tint); color: var(--amber); }
.pill.green { background: var(--green-tint); color: var(--green); }
.pill.blue { background: var(--blue-tint); color: var(--blue); }
.pill.brand { background: var(--brand-tint); color: var(--brand); }
.pill.outline { background: transparent; border: 1px solid var(--line-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.red { background: var(--red); } .dot.amber, .dot.yellow { background: var(--amber); } .dot.green { background: var(--green); }
.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; }
.sev.red { color: var(--red); } .sev.yellow { color: var(--amber); } .sev.green { color: var(--green); }
.kbd { font: 500 11px var(--mono); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
}
.tier-committed { background: #E3EEE7; color: var(--ev-committed); }
.tier-documented { background: #E6F1EA; color: var(--ev-documented); }
.tier-estimated { background: #EEF5F0; color: #3B7A51; }
.tier-placeholder { background: #FBF0DC; color: #946016; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* ---------- table ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { font-size: 11.5px; font-weight: 500; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 1; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table tbody tr:hover td { background: var(--surface-2); }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) var(--chat-w) 1fr; height: 100vh; overflow: hidden; }
.app.no-chat { grid-template-columns: var(--rail-w) 0 1fr; }
.rail {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0;
  background: var(--brand); color: rgba(255, 255, 255, .55);
}
.rail .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 14px; background: rgba(255,255,255,.08); }
.rail a {
  position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; cursor: pointer;
  transition: background .12s, color .12s; text-decoration: none;
}
.rail a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.rail a.on { background: rgba(255, 255, 255, .12); color: #fff; }
.rail a.on::before { content: ''; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--accent); }
.rail a .ico { width: 19px; height: 19px; transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
.rail a:hover .ico { transform: translateY(-2px); }
.rail a .badge {
  position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: rgba(255, 255, 255, .2); color: #fff; font-size: 10px; font-weight: 600; display: grid; place-items: center;
}
.rail a .badge.red { background: var(--red); }
/* the page name floats out on hover, in a light bubble */
.rail .tip {
  position: absolute; left: 52px; top: 50%; transform: translateY(-50%); background: #fff; color: var(--ink); font-size: 12px; font-weight: 500;
  padding: 5px 9px; border-radius: 7px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 50;
}
.rail .tip::before { content: ''; position: absolute; left: -4px; top: 50%; margin-top: -4px; width: 8px; height: 8px; background: #fff; transform: rotate(45deg); }
.rail a:hover .tip, .rail .avatar:hover .tip { opacity: 1; }
.rail .avatar { position: relative; }
.rail .spacer { flex: 1; }
.rail .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--brand-ink); font-weight: 600; font-size: 12px; display: grid; place-items: center; cursor: pointer; }
[data-tip] { position: relative; }


.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.topbar {
  display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px; flex: none;
  border-bottom: 1px solid var(--line); background: rgba(246, 246, 243, .85); backdrop-filter: blur(8px);
}
.topbar h1 { font-size: 17px; letter-spacing: -0.015em; }
.topbar .crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.topbar .crumbs a { cursor: pointer; text-decoration: none; }
.topbar .crumbs a:hover { color: var(--ink); }
.page { flex: 1; overflow: auto; padding: 24px 28px 64px; scrollbar-width: thin; }
.page-inner { max-width: 1240px; margin: 0 auto; }

/* ---------- chat panel ---------- */
.chat { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--surface); border-right: 1px solid var(--line); }
.chat-head { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 16px 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.chat-head .who { font-weight: 600; font-size: 14px; }
.chat-head .sub { font-size: 11.5px; color: var(--muted); }
.qmark { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; flex: none; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; }
.msg { display: flex; flex-direction: column; gap: 6px; max-width: 100%; animation: msgIn .18s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(4px); } }
.msg.user { align-items: flex-end; }
.msg .bubble { font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.msg.user .bubble { background: var(--sunken); padding: 9px 12px; border-radius: 14px 14px 4px 14px; max-width: 88%; }
.msg.assistant .bubble { padding: 0 2px; }
.msg .bubble p + p { margin-top: 8px; }
.msg .bubble ul { margin: 6px 0 0; padding-left: 18px; }
.msg .bubble li + li { margin-top: 3px; }
.msg .bubble strong { font-weight: 600; }
.msg .refs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.msg .actions { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.action-card {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); font-size: 12.5px;
}
.action-card .what { flex: 1; min-width: 0; }
.action-card.done { background: var(--green-tint); border-color: transparent; color: var(--green); }
.action-card.dismissed { opacity: .5; }
.typing { display: inline-flex; gap: 4px; padding: 6px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.composer { padding: 10px 12px 14px; flex: none; }
.composer-box {
  border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); transition: border-color .12s, box-shadow .12s;
  display: flex; flex-direction: column;
}
.composer-box:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(30, 112, 72, .12); }
.composer-box.drag { border-color: var(--brand-2); background: var(--brand-tint); }
.composer .chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 8px 0; }
.composer textarea { border: 0; outline: none; resize: none; padding: 10px 12px 4px; min-height: 40px; max-height: 160px; background: transparent; font-size: 13.5px; line-height: 1.45; }
.composer .bar { display: flex; align-items: center; gap: 4px; padding: 4px 6px 6px; }
.composer .hint { font-size: 11px; color: var(--faint); padding: 6px 4px 0; text-align: center; }
.send { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.send:disabled { background: var(--line-2); }
.ref-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 4px 0 8px; border-radius: 7px;
  background: var(--brand-tint); color: var(--brand); font-size: 12px; font-weight: 500; max-width: 100%;
  border: 1px solid var(--brand-tint-2);
}
.ref-chip .k { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.ref-chip button { width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; opacity: .6; }
.ref-chip button:hover { opacity: 1; background: rgba(11, 79, 53, .1); }
.ref-chip.static { padding-right: 8px; }

/* referenceable items: hover highlights, click tags into chat */
[data-ref] { cursor: pointer; transition: box-shadow .12s, background .12s; }
.ref-hover { box-shadow: inset 0 0 0 1.5px var(--brand-2) !important; background-color: rgba(233, 242, 236, .55) !important; border-radius: 6px; }
.ref-tagged { box-shadow: inset 0 0 0 1.5px var(--brand) !important; background-color: rgba(213, 232, 219, .6) !important; }
.ref-flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: inset 0 0 0 2px var(--accent); background: rgba(91, 183, 73, .12); } 100% { box-shadow: none; } }

/* ---------- overlays ---------- */
.scrim { position: fixed; inset: 0; background: rgba(21, 24, 26, .32); backdrop-filter: blur(2px); z-index: 80; display: grid; place-items: center; padding: 24px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); width: min(560px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; overflow: hidden; animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { width: min(820px, 100%); }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
.modal-head { padding: 20px 24px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { flex: 1; font-size: 18px; }
.modal-body { padding: 16px 24px; overflow: auto; }
.modal-foot { padding: 14px 24px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); box-shadow: var(--shadow-3); z-index: 85; display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-2); display: flex; gap: 10px; align-items: center; animation: pop .18s; }
.toast .link { color: var(--accent); }
.popover { position: fixed; z-index: 90; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px; min-width: 200px; animation: pop .12s; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 7px; font-size: 13px; text-align: left; }
.menu-item:hover { background: var(--sunken); }

/* coach marks */
.coach { position: fixed; z-index: 95; width: 300px; background: var(--ink); color: #fff; border-radius: 14px; padding: 16px 16px 12px; box-shadow: var(--shadow-3); animation: pop .2s; }
.coach h4 { font-size: 14px; margin-bottom: 4px; }
.coach p { font-size: 13px; color: rgba(255, 255, 255, .78); line-height: 1.5; }
.coach .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.coach .btn { height: 28px; font-size: 12.5px; }
.coach-ring { position: fixed; z-index: 94; border-radius: 16px; box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px rgba(21, 24, 26, .38); pointer-events: none; transition: all .25s ease; }

/* doc review */
.doc-review .facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.doc-review .fact { background: var(--surface); padding: 10px 12px; }
.doc-review .fact .v { font-weight: 500; margin-top: 2px; font-size: 13px; }
.change-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.issue { border: 1px solid #F0DDB5; background: #FFFBF3; border-radius: 12px; padding: 12px 14px; }
.issue.resolved { border-color: var(--line); background: var(--surface-2); }
.issue .opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.opt { height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 500; }
.opt:hover { border-color: var(--brand-2); }
.opt.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--brand-ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-form { display: grid; place-items: center; padding: 48px 24px; }
.auth-form form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* expandable chat column */
.app, .bld { transition: grid-template-columns .22s ease; }
.chat-wide-btn .when-wide { display: none; }
body.chat-wide .chat-wide-btn .when-wide { display: block; }
body.chat-wide .chat-wide-btn .when-narrow { display: none; }
body.chat-wide .app { grid-template-columns: var(--rail-w) min(720px, 52vw) 1fr; }
body.chat-wide .bld { grid-template-columns: min(760px, 56vw) 1fr; }
body.chat-wide .msg.user .bubble { max-width: 75%; }

/* suggested prompts for tagged items */
.sugg-wrap:empty { display: none; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 8px; animation: msgIn .18s ease-out; }
.sugg-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--brand-tint-2); background: var(--surface); color: var(--brand); font-size: 12.5px; font-weight: 500;
  transition: background .12s, border-color .12s;
}
.sugg-chip:hover { background: var(--brand-tint); border-color: var(--brand-2); }
.sugg-chip.fill { border-style: dashed; }
.sugg-chip .ico { opacity: .6; }
.sugg-hint { display: flex; align-items: center; gap: 6px; padding: 0 4px 8px; font-size: 12px; color: var(--muted); }
.bb-row[data-ref] { cursor: pointer; }

/* icons default to text size unless a size is given */
svg.ico:not([width]) { width: 16px; height: 16px; flex: none; }
.menu-item svg.ico { width: 16px; height: 16px; color: var(--ink-2); }

/* unit affixes inside inputs: <span class="input-affix"><input …><i>%</i></span> */
.input-affix { position: relative; display: inline-flex; align-items: center; }
.input-affix > i { position: absolute; right: 10px; font-style: normal; font-size: 13px; color: var(--muted); pointer-events: none; }
.input-affix > .input { padding-right: 26px; }
.input-affix.pre > i { right: auto; left: 10px; }
.input-affix.pre > .input { padding-right: 9px; padding-left: 22px; }

/* active task pinned in the chat */
.task-slot:not(.on) { display: none; }
.task-slot { padding: 12px 12px 0; flex: none; }
.tp { border: 1px solid var(--brand-tint-2); background: linear-gradient(180deg, var(--brand-tint), var(--surface) 70%); border-radius: 14px; padding: 12px 14px; animation: msgIn .2s ease-out; }
.task-slot.complete .tp { border-color: #BFE0CB; background: var(--green-tint); }
.tp-head { display: flex; align-items: center; gap: 8px; }
.tp-head .eyebrow { color: var(--brand); flex: 1; }
.tp-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tp-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; margin: 4px 0 8px; line-height: 1.35; }
.tp-bar { height: 4px; border-radius: 2px; background: rgba(11, 79, 53, .1); overflow: hidden; }
.tp-bar span { display: block; height: 100%; background: var(--brand-2); border-radius: 2px; transition: width .4s ease; }
.tp-steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tp-steps li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.4; color: var(--ink); }
.tp-steps li.done > .grow { color: var(--muted); text-decoration: line-through; }
.tp-check { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--line-2); background: var(--surface); flex: none; margin-top: 1px; display: grid; place-items: center; color: #fff; }
.tp-check:not(:disabled):hover { border-color: var(--brand-2); }
.tp-check:disabled { cursor: default; border-style: dashed; }
.tp-steps li.done .tp-check { background: var(--brand-2); border: 1.5px solid var(--brand-2); }
.tp-auto { margin-left: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tp-actions { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.task-slot.collapsed .tp-bar { margin-bottom: 2px; }
.input-affix.pre > .input { padding-right: 10px; padding-left: 22px; }
/* document review: edit form and impact */
.rev-edit { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) minmax(120px, 1fr) auto; gap: 10px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--brand-2); border-radius: 10px; background: var(--brand-tint); }
.rev-edit .field > span { font-size: 11.5px; }
.rev-edit .input-affix, .rev-edit .input-affix .input, .rev-edit .select { width: 100%; }
@media (max-width: 720px) { .rev-edit { grid-template-columns: 1fr 1fr; } }
.imp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.imp-tile { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.imp-tile .label { font-size: 11.5px; color: var(--muted); }
.imp-tile .v { font-size: 15px; font-weight: 600; margin: 3px 0 2px; font-variant-numeric: tabular-nums; }
.imp-tile .up { color: var(--brand); }
.imp-tile .down { color: var(--amber); }
.imp-tile.neutral .up, .imp-tile.neutral .down, .imp-table .up, .imp-table .down { color: var(--ink); }
.imp-table { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.imp-table .table td, .imp-table .table th { padding: 8px 12px; }

/* Session recording */
.rec-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; }
.rec-dot.idle { background: none; border: 1.5px solid var(--muted); }
.rec-pill { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 120; display: flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12.5px; box-shadow: var(--shadow-2); }
.rec-pill .rec-dot { animation: rec-pulse 1.6s ease-in-out infinite; }
.rec-pill .rec-time { color: rgba(255,255,255,.7); min-width: 34px; }
.rec-stop { border: 0; border-radius: 999px; padding: 4px 10px; background: rgba(255,255,255,.14); color: #fff; font: inherit; cursor: pointer; }
.rec-stop:hover { background: rgba(255,255,255,.26); }
@keyframes rec-pulse { 50% { opacity: .35; } }
.rec-consent ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.menu-item .rec-dot { margin: 0 3px; }

/* Privacy & data handling */
.legal { min-height: 100vh; background: var(--bg, #F6F6F3); padding: 0 16px 64px; }
.legal-head { max-width: 760px; margin: 0 auto; padding: 20px 0; display: flex; align-items: center; justify-content: space-between; }
.legal-body { max-width: 760px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(24px, 5vw, 48px); line-height: 1.6; }
.legal-body h1 { font-size: 30px; letter-spacing: -0.02em; margin: 4px 0 6px; }
.legal-body h2 { font-size: 16px; margin: 28px 0 8px; }
.legal-body p, .legal-body li { color: var(--ink-2); font-size: 14.5px; }
.legal-body p + p { margin-top: 10px; }
.legal-body ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.legal-head a { text-decoration: none; }

/* Suggested task card in chat */
.task-card { border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.task-card .eyebrow { font-size: 10.5px; }
.tc-head { display: flex; gap: 10px; align-items: flex-start; }
.tc-ico { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); }
.tc-title { font-weight: 600; font-size: 13px; line-height: 1.35; }
.tc-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.tc-detail { color: var(--ink-2); line-height: 1.45; margin: 0; }
.tc-foot { display: flex; align-items: center; gap: 6px; }
.task-card.done { background: var(--green-tint); border-color: transparent; }
.task-card.done .tc-foot > span { color: var(--green); }
.task-card.dismissed { opacity: .55; }
.task-row.just-added { background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--brand); animation: just-added 2.4s ease-out; }
@keyframes just-added { 0%, 30% { background: var(--brand-tint-2); } 100% { background: var(--brand-tint); } }
.task-row.just-added .pill.brand { background: var(--surface); }

/* ---------- chat sessions ---------- */
.chat-head .btn.icon.on { background: var(--sunken); color: var(--ink); }
.chat-head .btn.icon:disabled { opacity: .35; cursor: default; }
.chat-home { display: flex; flex-direction: column; gap: 12px; padding: 6px 2px; font-size: 13.5px; line-height: 1.55; }
.ch-hello { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.ch-starters { display: flex; flex-direction: column; gap: 6px; }
.ch-starter {
  display: flex; align-items: flex-start; gap: 9px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; line-height: 1.4; cursor: pointer;
}
.ch-starter .ico { flex: none; margin-top: 2px; color: var(--brand-2); }
.ch-starter:hover { background: var(--sunken); }
.ch-recent { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.chat-home button.link { background: none; border: 0; padding: 0; font: inherit; }
.chat-history { display: flex; flex-direction: column; gap: 16px; }
.th-group { display: flex; flex-direction: column; gap: 6px; }
.th-list { display: flex; flex-direction: column; }
.th-item { position: relative; padding: 8px 30px 8px 14px; border-radius: 8px; cursor: pointer; outline: none; }
.th-item::before { content: ''; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--line-2); }
.th-item.current::before { background: var(--brand-2); }
.th-item:hover, .th-item:focus-visible { background: var(--sunken); }
.th-top { display: flex; align-items: baseline; gap: 8px; }
.th-title { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-time { flex: none; font-size: 11.5px; color: var(--muted); }
.th-prev { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.th-del { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: none; padding: 4px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.th-item:hover .th-del, .th-item:focus-within .th-del { display: grid; }
.th-del:hover { color: var(--red); background: var(--surface); }

/* ---------- design pass, Nov 16: quiet by default, detail on demand ---------- */
/* ⓘ: explanations live here, not in sub-lines */
.info { display: inline-flex; align-items: center; color: #8A8F94; position: relative; cursor: help; vertical-align: middle; outline: none; flex: none; }
.info:hover, .info:focus-visible { color: var(--ink-2); }
.info .ipop {
  position: absolute; left: 50%; top: 22px; transform: translateX(-50%); width: 250px; background: var(--ink); color: #F2F2EE;
  font-size: 12px; line-height: 1.45; font-weight: 400; padding: 9px 11px; border-radius: 9px; opacity: 0; pointer-events: none;
  transition: opacity .15s; z-index: 60; text-transform: none; letter-spacing: 0; text-align: left; white-space: normal; box-shadow: var(--shadow-2);
}
.info.up .ipop { top: auto; bottom: 22px; }
.info.end .ipop { left: auto; right: -8px; transform: none; }
.info.start .ipop { left: -8px; transform: none; }
.info:hover .ipop, .info:focus .ipop { opacity: 1; }
.info .ipop b { color: #fff; font-weight: 600; }
.topbar h1 + .info { margin-left: -4px; }
.status-line { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-left: 6px; }
.status-line .dot { width: 7px; height: 7px; }
.status-line .dot + span + .dot { margin-left: 6px; }

/* one compact review list: tasks, needs attention, confidence actions, transactions */
.rlist { overflow: visible; }
.rl-head { display: flex; align-items: center; gap: 8px; padding: 13px 16px; }
.rl-head h3 { font-size: 15px; letter-spacing: -0.15px; }
.rl-head .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rl-group { display: flex; align-items: center; gap: 8px; padding: 12px 16px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-top: 1px solid #EFEEE9; }
.rl-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid #EFEEE9; transition: background .15s; min-height: 44px; }
.rl-row:hover { background: var(--surface-2); }
.rl-row .dot { width: 7px; height: 7px; }
.rl-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.rl-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.rl-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 0; }
.rl-due { width: 76px; text-align: right; flex: none; font-size: 12px; color: var(--muted); }
.rl-due.late { color: var(--red); }
.rl-child { padding-left: 52px; background: #FCFCFA; }
.rl-child:hover { background: #F7F7F4; }
.rl-more { padding: 10px 16px 12px; border-top: 1px solid #EFEEE9; }
.rl-chev { width: 18px; height: 18px; display: grid; place-items: center; color: var(--muted); border-radius: 5px; flex: none; transition: transform .15s; }
.rl-chev.open { transform: rotate(90deg); }
.rl-check { width: 16px; height: 16px; flex: none; border: 1.5px solid #C9C8C2; border-radius: 5px; background: var(--surface); opacity: 0; transition: opacity .15s; display: grid; place-items: center; color: #fff; }
.rl-row:hover .rl-check, .rl-check:focus-visible { opacity: 1; }
/* actions wait for the row: one bordered tray, opacity only so nothing jumps */
.tray { display: flex; gap: 2px; padding: 2px; border: 1px solid #E1E0DA; border-radius: 9px; background: var(--surface); opacity: 0; transition: opacity .15s; flex: none; }
.rl-row:hover .tray, .tray:focus-within, .rl-row.pinned .tray { opacity: 1; }
.tb { height: 26px; min-width: 26px; padding: 0 8px; border: 0; border-radius: 7px; background: none; font-size: 12px; font-weight: 500; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.tb:hover { background: var(--sunken); }
.tb.primary { color: var(--brand); }
/* rest on a row to see its reason: the sub-line swaps after 250 ms */
.dwell { position: relative; display: block; height: 18px; min-width: 0; }
.dwell > span { position: absolute; inset: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .2s; }
.dwell .why { opacity: 0; color: var(--brand-2); }
.rl-row:hover .dwell .memo { opacity: 0; transition-delay: .25s; }
.rl-row:hover .dwell .why { opacity: 1; transition-delay: .25s; }
/* empty state: a dashed slot with one action */
.slot { border: 1.5px dashed #DAD9D3; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.slot .t { font-weight: 500; }
/* navigable cards: an arrow that wakes up on hover */
.go-arrow { position: absolute; right: 16px; bottom: 14px; color: var(--ink); opacity: .35; transition: opacity .15s, transform .15s; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; }
.card:hover .go-arrow { opacity: 1; transform: translateX(2px); }
.go-arrow:hover { background: var(--sunken); }
/* chat: header actions appear when you're in the panel */
.chat-head .acts { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.chat:hover .chat-head .acts, .chat-head .acts:focus-within { opacity: 1; }
.chat-head .who-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.info:hover .ipop, .info:focus-within .ipop { opacity: 1; pointer-events: auto; }
.info .ipop::after { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.info.up .ipop::after { top: auto; bottom: -12px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid #E1E0DA; border-radius: 8px; background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--ink); }
.fchip:hover { background: var(--surface-2); }
.fchip.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.fchip .dot { width: 7px; height: 7px; }
.rl-row .rl-chev { margin: 0 -6px 0 -4px; }
.rl-child { padding-left: 46px; }
.rl-acts { width: 128px; flex: none; display: flex; justify-content: flex-end; }

/* ---------- chat column: open beside the page, or collapsed to a thin strip (same on every page) ---------- */
.app > .rail { grid-column: 1; grid-row: 1; }
.app > .chat, .app > .chat-strip { grid-column: 2; grid-row: 1; }
.app > .main { grid-column: 3; grid-row: 1; }
.chat-strip { display: none; flex-direction: column; align-items: center; gap: 6px; padding: 11px 0 14px; background: var(--surface); border-right: 1px solid var(--line); min-width: 0; z-index: 3; }
.app.dock-strip, body.chat-wide .app.dock-strip { grid-template-columns: var(--rail-w) 56px 1fr; }
.app.dock-strip > .chat-strip { display: flex; }
.app.dock-strip > .chat { display: none; }
.strip-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 0; background: none; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; transition: background .12s, color .12s; }
.strip-btn:hover { background: var(--sunken); color: var(--ink); }
.strip-btn .tip { position: absolute; left: 48px; top: 50%; transform: translateY(-50%); background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 7px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 20; }
.strip-btn:hover .tip { opacity: 1; }
.strip-btn .tip kbd { font: inherit; font-size: 11px; padding: 0 5px; margin-left: 4px; border-radius: 4px; background: rgba(255,255,255,.16); }
.chat-head .head-toggle { margin-left: -9px; flex: none; color: var(--ink); }
.composer .bar .dictate.on { color: #fff; background: var(--red); animation: micpulse 1.4s infinite; }
@media (prefers-reduced-motion: reduce) { .composer .bar .dictate.on { animation: none; } }
.strip-n { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 600; display: grid; place-items: center; }
/* header buttons: the collapse button shows on every page while the chat is open */
.chat-head .dock-acts { display: none; gap: 2px; }
.app.dock-overlay .chat-head .dock-acts { display: flex; }
.app.dock-overlay .chat-head .acts .when-docked, .chat-head .when-strippable { display: none; }
.app.can-strip:not(.dock-strip) .chat-head .when-strippable { display: inline-flex; }
