/* Remora v1 frontend mockup — tokens mirror the Figma "remora tokens" collection (Clay preset). */
:root {
  --canvas: #F0EEE6; --surface: #FAF9F5; --surface-2: #F5F4ED; --line: #E3DFD3;
  --text: #141413; --muted: #7A776E; --primary: #C96442; --on-primary: #FFFFFF;
  --secondary: #6A8FB8; --accent: #C96442;
  --up: #4F7A3A; --up-soft: #E5ECDA; --down: #B5473A; --down-soft: #F4E0DA;
  --warn: #A8761E; --warn-soft: #F2E7CF; --tooltip: #141413; --on-tooltip: #FAF9F5; --dock-active: #3D3C38;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  color-scheme: light;
}
[data-theme="dark"] {
  --canvas: #1F1E1D; --surface: #262624; --surface-2: #30302E; --line: #3B3A37;
  --text: #F5F4ED; --muted: #A39F95; --primary: #D97757; --on-primary: #1F1E1D;
  --secondary: #8FB0D6; --accent: #E08C6C;
  --up: #8DB46A; --up-soft: #2A3322; --down: #E07A6A; --down-soft: #3D2620;
  --warn: #E0A84E; --warn-soft: #3A3020; --tooltip: #F5F4ED; --on-tooltip: #1F1E1D; --dock-active: #D9D6CC;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--canvas); color: var(--text); font: 13px/1.45 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
.serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.up { color: var(--up); } .down { color: var(--down); } .warn { color: var(--warn); }
.num { font-variant-numeric: tabular-nums; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .left, .topbar .right { display: flex; align-items: center; gap: 14px; }
.topbar .right { gap: 18px; }
.brand { display: flex; align-items: center; gap: 8px; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: var(--on-primary); display: grid; place-items: center; font: 500 16px/1 var(--serif); }
[data-theme="dark"] .mark { color: #1F1E1D; }
.wordmark { font: 500 20px/1 var(--serif); letter-spacing: -0.01em; }
.vdiv { width: 1px; height: 20px; background: var(--line); }
.page-title { font-weight: 600; font-size: 14px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); display: inline-block; }
.searchbox { width: 280px; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 8px; background: var(--surface-2); color: var(--muted); border: 0; text-align: left; }
.searchbox span { flex: 1; }
.kbd { font-size: 11px; font-weight: 500; color: var(--muted); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); }
.avatars { display: flex; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 12px; border: 2px solid var(--surface); }
.avatars .avatar + .avatar { margin-left: -8px; }

/* ---------- layout ---------- */
.content { padding: 24px 28px 128px; display: flex; flex-direction: column; gap: 16px; max-width: 1440px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 0 0 4px; font: 500 28px/1.15 var(--serif); letter-spacing: -0.01em; }
.row { display: flex; gap: 16px; align-items: stretch; }
.row > .grow { flex: 1; min-width: 0; }
.side { width: 400px; flex: none; }
.side-380 { width: 380px; flex: none; }
.actions { display: flex; gap: 8px; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.flush { padding: 0; gap: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card.flush > .card-head { padding: 14px 16px; }
.card-title { font-weight: 600; font-size: 15px; }
.card-sub { font-size: 12px; color: var(--muted); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { filter: brightness(0.96); }
.btn.ghost { border-color: transparent; background: transparent; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 4px 11px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(20, 19, 15, .08); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 500; color: var(--muted); }
.chip.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .count { opacity: .7; font-weight: 400; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.plain::before { display: none; }
.tag.up { background: var(--up-soft); color: var(--up); }
.tag.down { background: var(--down-soft); color: var(--down); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.info { background: var(--surface-2); color: var(--accent); }
.tag.neutral { background: var(--surface-2); color: var(--muted); }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; gap: 0; }
.kpi { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi .label { font-size: 12px; font-weight: 500; color: var(--muted); }
.kpi .value { font: 500 30px/1.1 var(--serif); letter-spacing: -0.01em; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
.stock { display: flex; align-items: center; gap: 10px; }
.logo { width: 28px; height: 28px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: 10px; flex: none; }
.stock b { display: block; font-weight: 600; }
.stock small { color: var(--muted); font-size: 11px; }
.meter { display: inline-flex; align-items: center; gap: 8px; }
.meter i { display: block; width: 60px; height: 6px; border-radius: 3px; background: var(--surface-2); position: relative; overflow: hidden; }
.meter i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--v); background: var(--text); border-radius: 3px; }
.meter.soft i::after { background: var(--muted); }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.card.flush > .note { margin: 0; border-radius: 0 0 var(--radius) var(--radius); background: transparent; border-top: 1px solid var(--line); padding: 12px 16px; }

/* ---------- lists ---------- */
.list-row { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.list-row:first-child { border-top: 0; }
.list-row .time { width: 44px; flex: none; color: var(--muted); font-weight: 500; }
.dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--text); }
.dot.warn { background: var(--warn); } .dot.up { background: var(--up); } .dot.down { background: var(--down); } .dot.muted { background: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 500; text-align: right; }
.steps { display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; gap: 12px; }
.step .n { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; }

/* ---------- dock ---------- */
.dock { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; gap: 10px; z-index: 30; }
.dock nav, .dock .search { background: #141413; box-shadow: 0 8px 24px rgba(20, 19, 15, .22); }
[data-theme="dark"] .dock nav, [data-theme="dark"] .dock .search { background: #0F0F0E; border: 1px solid var(--line); }
.dock nav { display: flex; gap: 4px; padding: 8px; border-radius: 999px; }
.dock a, .dock .search { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #FAF9F5; opacity: .55; position: relative; border: 0; }
.dock a.on { opacity: 1; background: #3D3C38; }
.dock a:hover { opacity: 1; }
.dock .search { width: 60px; height: 60px; opacity: 1; }
.dock .icon { width: 20px; height: 20px; }
.dock a[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: 54px; left: 50%; transform: translateX(-50%); background: var(--tooltip); color: var(--on-tooltip); font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }

/* ---------- charts ---------- */
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.tooltip { position: absolute; pointer-events: none; background: var(--tooltip); color: var(--on-tooltip); border-radius: 10px; padding: 10px 12px; font-size: 12px; min-width: 190px; display: none; }
.tooltip .t-head { opacity: .7; margin-bottom: 4px; font-size: 11px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; }
.tooltip .t-row i { width: 3px; height: 12px; border-radius: 1px; }
.tooltip .t-row b { margin-left: auto; font-weight: 600; }
.legend { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }

/* ---------- stock header + tabs ---------- */
.stock-head { display: flex; align-items: flex-end; justify-content: space-between; }
.stock-head .who { display: flex; align-items: center; gap: 14px; }
.stock-head .logo { width: 48px; height: 48px; border-radius: 12px; font-size: 16px; }
.stock-head h1 { margin: 0; font: 500 30px/1.1 var(--serif); }
.price { font: 500 30px/1.1 var(--serif); }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 4px 0 10px; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); font-weight: 600; border-color: var(--text); }

/* ---------- timeline ---------- */
.day { padding: 10px 20px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.event { display: flex; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); cursor: pointer; border-left: 3px solid transparent; }
.event:hover { background: var(--surface-2); }
.event.on { background: var(--surface-2); border-left-color: var(--accent); }
.event .time { width: 44px; flex: none; color: var(--muted); font-weight: 500; }
.event .body { flex: 1; }
.event .body b { display: block; font-weight: 500; font-size: 14px; }

/* ---------- lab ---------- */
.hyp { padding: 12px; border-radius: 10px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; border: 1px solid transparent; }
.hyp:hover { background: var(--surface-2); }
.hyp.on { background: var(--surface-2); border-color: var(--line); }
.hyp .h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.hyp p { margin: 0; font-size: 14px; font-weight: 500; }
.crit { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.splits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.splits div { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.splits div.done { background: var(--text); color: var(--surface); border-color: var(--text); }
.splits b { display: block; font-size: 12px; }
.splits span { font-size: 12px; opacity: .75; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; }

/* ---------- settings ---------- */
.settings-nav { width: 220px; flex: none; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; border: 1px solid transparent; }
.settings-nav a.on { background: var(--surface); border-color: var(--line); color: var(--text); font-weight: 600; }
.cols { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.cols > div { display: flex; flex-direction: column; gap: 16px; }
.member { display: flex; align-items: center; gap: 10px; }
.member .avatar { width: 28px; height: 28px; border: 0; }

/* ---------- sign in ---------- */
.signin { display: grid; grid-template-columns: 620px 1fr; min-height: 100vh; }
.signin .context { background: var(--surface); border-right: 1px solid var(--line); padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.signin h2 { font: 500 34px/1.15 var(--serif); letter-spacing: -0.01em; margin: 0 0 10px; }
.fact { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.fact .ib { width: 36px; height: 36px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; }
.signin .form-area { display: grid; place-items: center; align-content: center; gap: 20px; }
.form { width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.form h3 { margin: 0; font: 500 26px/1.1 var(--serif); }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 12px; }
.input { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.input input { border: 0; outline: 0; background: transparent; flex: 1; font-size: 14px; color: var(--text); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check i { width: 16px; height: 16px; border-radius: 4px; background: var(--primary); display: grid; place-items: center; color: var(--on-primary); }

/* ---------- command palette ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20, 19, 19, .36); z-index: 40; display: none; }
.scrim.open { display: block; }
.palette { position: fixed; left: 50%; top: 120px; transform: translateX(-50%); width: 620px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(20, 19, 15, .22); z-index: 50; overflow: hidden; display: none; }
.palette.open { display: block; }
.palette .p-input { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.palette .p-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; caret-color: var(--accent); }
.palette .group { padding: 8px; }
.palette .g-title { padding: 6px 10px; font-size: 11px; font-weight: 600; color: var(--muted); }
.palette .item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.palette .item.on { background: var(--surface-2); }
.palette .item .ib { width: 28px; height: 28px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; }
.palette .item .label { font-size: 14px; font-weight: 500; }
.palette .item .grow { flex: 1; display: flex; gap: 8px; align-items: baseline; }
.palette .p-foot { display: flex; justify-content: space-between; padding: 10px 18px; background: var(--surface-2); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.palette .p-foot span { display: inline-flex; gap: 6px; align-items: center; margin-right: 12px; }

/* ---------- extensions (Remora v1 mockup) ---------- */
.brand-link { color: inherit; text-decoration: none; cursor: pointer; }
.topbar .meta-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; }
.searchbox { width: 292px; font-size: 12.5px; }
.searchbox span:first-of-type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-scroll { width: 100%; overflow-x: auto; }
.compact-table th, .compact-table td { padding: 8px 8px; font-size: 12px; }
.compact-table th:first-child, .compact-table td:first-child { padding-left: 14px; }
.compact-table th:last-child, .compact-table td:last-child { padding-right: 14px; }
.side-380 .compact-table th:first-child, .side-380 .compact-table td:first-child { padding-left: 0; }
.side-380 .compact-table th:last-child, .side-380 .compact-table td:last-child { padding-right: 0; }
.card.flush > .card-head.bordered { border-bottom: 1px solid var(--line); }

/* Sortable headers */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sortable.sorted { color: var(--text); font-weight: 600; }
.sort-ind { display: inline-flex; align-items: center; gap: 4px; }
.sort-arrow { font-size: 10px; opacity: 0.85; }

/* Interactive button & link refinements */
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.icon-only { width: 32px; height: 32px; padding: 0; justify-content: center; }
.btn.active-toggle { background: var(--surface-2); border-color: var(--accent); color: var(--accent); }
.seg-icon { padding: 4px 8px !important; }

/* Checkbox & input focus */
.input:focus-within { border-color: var(--accent); }
.check-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; font-size: 13px; text-align: left; }
.check-box { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--on-primary); flex: none; }
.check-box.checked { background: var(--primary); border-color: var(--primary); }
.eye-btn { border: 0; background: transparent; color: var(--muted); padding: 4px; display: grid; place-items: center; border-radius: 6px; }
.eye-btn:hover { color: var(--text); background: var(--surface-2); }

/* Sparklines & meters */
.spark { display: block; width: 76px; height: 22px; overflow: visible; }
.meter.clay i::after { background: var(--accent); }
.meter.up i::after { background: var(--up); }

/* Budget & label bars */
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-head { display: flex; justify-content: space-between; font-size: 12px; }
.bar-track { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--text); }
.bar-fill.clay { background: var(--accent); }
.bar-fill.muted { background: var(--muted); }

/* Microscope & chart helpers */
.chart-box { position: relative; width: 100%; }
.chart-box svg { display: block; width: 100%; height: auto; }
.crosshair-overlay { cursor: crosshair; }
.legend-dash { display: inline-block; width: 12px; height: 0; border-top: 2px dashed var(--accent); margin-right: 6px; vertical-align: middle; }
.legend-zone { display: inline-block; width: 12px; height: 8px; border-radius: 2px; background: var(--up-soft); border: 1px solid var(--up); margin-right: 6px; vertical-align: middle; opacity: 0.75; }
.placeholder-panel { padding: 36px 24px; align-items: center; text-align: center; gap: 10px; }
.placeholder-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); margin-bottom: 4px; }

/* Timeline detail panel */
.side-420 { width: 420px; flex: none; }
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; }
.hash-inline { display: inline-flex; align-items: center; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.copy-btn { border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; width: 24px; height: 24px; display: inline-grid; place-items: center; color: var(--muted); }
.copy-btn:hover { color: var(--text); }

/* Lab calibration & stack legend */
.stack-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.stack-legend span { display: inline-flex; align-items: center; gap: 6px; }
.stack-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* Watchlist settings rows */
.wl-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wl-row:last-child { border-bottom: 0; }
.grip { color: var(--muted); display: inline-flex; cursor: grab; }

/* Palette scrolling & empty state */
.palette-body { max-height: 430px; overflow-y: auto; }
.palette-empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.palette .item .meta { font-size: 12px; color: var(--muted); }

/* Modal & toast */
.modal-scrim { position: fixed; inset: 0; background: rgba(20, 19, 19, .38); z-index: 60; display: grid; place-items: center; padding: 24px; }
.modal-card { width: min(640px, 100%); max-height: 82vh; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(20, 19, 15, .24); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; justify-content: flex-end; gap: 8px; }
.code-block { margin: 0; padding: 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5; overflow-x: auto; white-space: pre; }
.toast-wrap { position: fixed; right: 24px; bottom: 96px; z-index: 70; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--tooltip); color: var(--on-tooltip); padding: 10px 14px; border-radius: 10px; font-size: 12.5px; font-weight: 500; box-shadow: 0 10px 24px rgba(20, 19, 15, .18); }

/* Responsive guardrails for 1280x800 and narrower viewports */
@media (max-width: 1360px) {
  .topbar { padding: 0 20px; }
  .topbar .right { gap: 12px; }
  .searchbox { width: 230px; }
  .content { padding: 20px 20px 124px; }
  th, td { padding: 10px 12px; }
  .side { width: 370px; }
  .side-380 { width: 356px; }
  .side-420 { width: 380px; }
}
@media (max-width: 1120px) {
  .row { flex-direction: column; }
  .side, .side-380, .side-420 { width: 100%; }
  .cols { grid-template-columns: 1fr; }
  .signin { grid-template-columns: 1fr; }
  .signin .context { border-right: 0; border-bottom: 1px solid var(--line); padding: 32px; }
  .signin .form-area { padding: 32px 16px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .kpi:nth-child(4) { border-top: 1px solid var(--line); }
}

/* fixes after review */
.searchbox .kbd { flex: none; }
.form-error { padding: 10px 12px; border-radius: 9px; background: var(--down-soft); color: var(--down); font-size: 12.5px; font-weight: 500; }

/* ---------- Remora v2 extensions (Microscope, Lab, Data Manager, War Room) ---------- */
.splits { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }

.ticker-strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.overlay-menu-wrap { position: relative; display: inline-block; }
.overlay-dropdown { position: absolute; top: calc(100% + 6px); right: 0; min-width: 224px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: 0 12px 32px rgba(20, 19, 15, .14); z-index: 25; display: flex; flex-direction: column; gap: 4px; }
.overlay-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border-radius: 8px; border: 0; background: transparent; width: 100%; text-align: left; font-size: 12.5px; }
.overlay-item:hover { background: var(--surface-2); }
.overlay-item-left { display: flex; align-items: center; gap: 8px; }
.vol-strip-wrap { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.vol-strip-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.vol-strip-wrap svg { display: block; width: 100%; height: auto; }

.rules-list { display: flex; flex-direction: column; gap: 8px; }
.rule-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; }
.rule-num { width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; }

.dm-dropzone { border: 1.5px dashed var(--line); border-radius: 12px; padding: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, background .15s; }
.dm-dropzone.dragover { border-color: var(--accent); background: var(--surface); }
.dm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dm-stat { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.dm-stat span { font-size: 11px; color: var(--muted); }
.dm-stat b { font-size: 16px; }

.wr-shell { display: flex; gap: 16px; align-items: stretch; }
.wr-rail { width: 300px; flex: none; display: flex; flex-direction: column; gap: 12px; }
.wr-canvas { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 560px; padding: 0; gap: 0; }
.wr-messages { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 18px; overflow-y: auto; max-height: 540px; }
.wr-empty { margin: auto; text-align: center; max-width: 400px; display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 28px 16px; }
.wr-msg { display: flex; flex-direction: column; gap: 6px; max-width: 84%; }
.wr-msg.user { align-self: flex-end; align-items: flex-end; }
.wr-msg.participant { align-self: flex-start; align-items: flex-start; }
.wr-msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.wr-avatar { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #FFFFFF; flex: none; }
.wr-bubble { padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; line-height: 1.5; }
.wr-msg.user .wr-bubble { background: var(--text); color: var(--surface); border-color: var(--text); }
.wr-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.wr-bullets { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.wr-composer { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.wr-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wr-input-row { display: flex; gap: 8px; align-items: flex-end; }
.wr-textarea { flex: 1; min-height: 42px; max-height: 110px; resize: vertical; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font: inherit; color: var(--text); outline: none; }
.wr-textarea:focus { border-color: var(--accent); background: var(--surface); }
.wr-composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.wr-participant-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); width: 100%; text-align: left; }
.wr-participant-btn.on { border-color: var(--accent); background: var(--surface); }
.wr-session-row { display: flex; align-items: center; gap: 6px; }
.wr-session-btn { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; border-radius: 8px; border: 1px solid transparent; background: transparent; text-align: left; }
.wr-session-btn:hover, .wr-session-btn.on { background: var(--surface-2); border-color: var(--line); }
.wr-session-title { font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-cost-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.wr-matrix-card { gap: 8px; }
.wr-matrix-list { display: flex; flex-direction: column; }
.wr-matrix-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.wr-matrix-row:last-child { border-bottom: 0; padding-bottom: 0; }
.wr-matrix-label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-matrix-pill .tag { font-size: 10.5px; padding: 2px 7px; }
.wr-obs-tag { border: 1px solid var(--warn); font-weight: 600; letter-spacing: 0.02em; }

@media (max-width: 1120px) {
  .wr-shell { flex-direction: column; }
  .wr-rail { width: 100%; }
  .dm-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- print view (Ringkasan pagi -> Save as PDF) ---------- */
.print-root { display: none; }

@media print {
  @page {
    size: A4 portrait;
    margin: 14mm 14mm 18mm 14mm;
  }

  html,
  body,
  [data-theme="dark"] {
    background: #FFFFFF !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    font: 10.5px/1.4 var(--sans) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .topbar,
  .dock,
  .actions,
  .btn,
  .seg,
  .searchbox,
  .palette,
  .scrim,
  .modal-scrim,
  .toast-wrap,
  #modal-root,
  #toast-root {
    display: none !important;
  }

  body.has-print-view #app {
    display: none !important;
  }

  body.has-print-view #print-root {
    display: block !important;
  }

  .print-doc {
    background: #FFFFFF;
    color: #000000;
    width: 100%;
  }

  .print-section {
    padding-bottom: 14mm;
  }

  .print-section + .print-section {
    break-before: page;
    page-break-before: always;
  }

  .print-head {
    border-bottom: 2px solid #000000;
    padding-bottom: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
  }

  .print-eyebrow {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #000000;
    margin-bottom: 2px;
  }

  .print-head h1 {
    margin: 0 0 2px;
    font: 600 20px/1.15 var(--serif);
    color: #000000;
  }

  .print-sub {
    font-size: 10px;
    color: #000000;
  }

  .print-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }

  .print-meta-box {
    border: 1px solid #000000;
    padding: 6px 8px;
    background: #FFFFFF;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-meta-label {
    font-size: 8.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #000000;
    margin-bottom: 2px;
  }

  .print-meta-value {
    font-size: 11px;
    font-weight: 600;
    color: #000000;
  }

  .print-block {
    margin-bottom: 12px;
  }

  .print-block-title {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
    color: #000000;
    border-bottom: 1px solid #000000;
    padding-bottom: 3px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
  }

  .print-block-sub {
    font-size: 9.5px;
    font-weight: 400;
    color: #000000;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
    margin-bottom: 6px;
  }

  .print-table thead {
    display: table-header-group;
  }

  .print-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #999999;
    padding: 4px 6px;
    font-size: 9.5px;
    line-height: 1.3;
    color: #000000;
    background: #FFFFFF;
    vertical-align: top;
  }

  .print-table th {
    font-weight: 700;
    border-bottom: 1.5px solid #000000;
    white-space: nowrap;
  }

  .print-table th.r,
  .print-table td.r {
    text-align: right;
  }

  .print-badge {
    display: inline-block;
    border: 1px solid #000000;
    padding: 1px 4px;
    font-size: 8.5px;
    font-weight: 600;
    color: #000000;
    background: #FFFFFF;
    white-space: nowrap;
  }

  .print-steps {
    margin: 4px 0 8px;
    padding-left: 18px;
  }

  .print-steps li {
    margin-bottom: 3px;
    color: #000000;
    font-size: 9.5px;
  }

  .print-list {
    list-style: none;
    margin: 4px 0;
    padding: 0;
  }

  .print-list li {
    padding: 4px 0;
    border-bottom: 1px solid #CCCCCC;
    font-size: 9.5px;
    color: #000000;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-list li:last-child {
    border-bottom: 0;
  }

  .print-note {
    border: 1px solid #000000;
    padding: 6px 8px;
    font-size: 9.5px;
    color: #000000;
    background: #FFFFFF;
    margin-top: 6px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-kv-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 14px;
    margin-top: 4px;
  }

  .print-kv {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #CCCCCC;
    padding: 3px 0;
    font-size: 9.5px;
    color: #000000;
  }

  .print-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid #000000;
    padding-top: 4px;
    background: #FFFFFF;
    color: #000000;
    font-size: 9px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
}
