/* Outcrop — implementation of the Claude Design prototype (design/Outcrop.dc.html).
   Tokens and pixel values are copied from the design verbatim. */

:root {
  --bg: #0A0E11;
  --panel: #0C1114;
  --panel-2: #0E1317;
  --panel-3: #0A0F12;
  --line: #1B2429;
  --line-2: #212B32;
  --line-3: #232E35;
  --line-4: #2B363E;
  --line-5: #37444C;
  --text: #E6ECF0;
  --text-2: #B6C2CA;
  --text-3: #8C9AA4;
  --muted: #5F6E78;
  --muted-2: #6E7D87;
  --faint: #4A575F;
  --faint-2: #41505A;
  --amber: #E8A33D;
  --amber-hi: #F7CE8C;
  --teal: #2FC2B0;
  --focus: #3E7F8C;
  --danger: #E0664B;
  --danger-bd: #6A3A2C;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); }
body {
  color: var(--text);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  display: flex; flex-direction: column;
}
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hi); }
::selection { background: rgba(232,163,61,.28); }
.maplibregl-canvas { outline: none; }
button { font-family: inherit; }
.mono { font-family: 'IBM Plex Mono', monospace; }

@keyframes pf-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(47,194,176,.45); } 50% { box-shadow: 0 0 0 6px rgba(47,194,176,0); } }
@keyframes pf-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pf-sweep { from { transform: translateX(-100%); } to { transform: translateX(320%); } }
@keyframes pf-blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- header ---------- */
.app-header {
  height: 46px; flex: 0 0 46px; display: flex; align-items: center; gap: 14px;
  padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 60;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; letter-spacing: .2em; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.spacer { flex: 1; }
.feed-status {
  display: flex; align-items: center; gap: 7px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--muted-2); letter-spacing: .06em;
}
.feed-status .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }

/* ---------- main layout ---------- */
.app-main { flex: 1; display: flex; flex-direction: row; min-height: 0; position: relative; }
.app-main.narrow { flex-direction: column; }

/* ---------- sidebar ---------- */
.sidebar {
  flex: 0 0 250px; width: 250px; display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line); z-index: 20;
}
.app-main.narrow .sidebar { display: none; }
.side-search { padding: 14px 14px 10px; }
.side-search input, .narrowbar input {
  width: 100%; height: 32px; padding: 0 9px; background: var(--bg);
  border: 1px solid var(--line-2); border-radius: 4px; color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; outline: none;
}
.side-search input:focus, .narrowbar input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(62,127,140,.16); }
.side-label {
  padding: 6px 14px 8px; font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px; letter-spacing: .14em; color: var(--muted);
}
.examples { display: flex; flex-direction: column; gap: 6px; padding: 0 10px; }
.example {
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2);
  cursor: pointer; transition: border-color .12s, background .12s;
}
.example:hover { border-color: var(--focus); background: #111A20; }
.example:active { background: #0C1216; }
.example-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.example-name { font-size: 12.5px; color: var(--text); }
.example-sym { font-family: 'IBM Plex Mono', monospace; font-size: 10px; padding: 1px 5px; border-radius: 2px; }
.example-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--muted); margin-top: 4px; }

.side-rule { margin: 16px 14px 8px; border-top: 1px solid var(--line); }
.layers { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.layer-row { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: 3px; cursor: pointer; }
.layer-row:hover { background: #111A20; }
.swatch { width: 11px; height: 11px; border: 1px solid var(--line-5); background: transparent; }
.swatch.sq { border-radius: 2px; }
.swatch.rd { border-radius: 50%; }
.layer-row.on .swatch.sq { background: #26708A; border-color: #3597B4; }
.layer-row.on .swatch.rd { background: #D8CE63; border-color: var(--amber); }
.layer-name { flex: 1; font-size: 12px; color: var(--muted); }
.layer-row.on .layer-name { color: #C8D2D9; }
.layer-count { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--muted); }
.side-flex { flex: 1; }
.side-proto { padding: 12px 14px; border-top: 1px solid var(--line); }
.proto-btns { display: flex; gap: 6px; }
.proto-btns button {
  font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .06em; color: var(--text-3);
  background: #101619; border: 1px solid var(--line-3); border-radius: 2px; padding: 4px 6px; cursor: pointer;
}
.proto-btns button:hover { color: var(--text); border-color: var(--line-5); }
.proto-btns button.danger:hover { color: var(--danger); border-color: var(--danger-bd); }

/* ---------- narrow bar ---------- */
.narrowbar {
  display: none; flex: 0 0 auto; flex-direction: column; gap: 7px; padding: 10px 12px;
  background: var(--panel); border-bottom: 1px solid var(--line); z-index: 20;
}
.app-main.narrow .narrowbar { display: flex; }
.narrow-examples { display: flex; gap: 6px; overflow: auto; }
.narrow-example {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); cursor: pointer;
}
.narrow-example:hover { border-color: var(--focus); }

/* ---------- map stage ---------- */
.map-stage { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; background: var(--bg); }
#map { position: absolute; inset: 0; }
.map-ui {
  position: absolute; inset: 0; z-index: 12; padding: 12px;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.map-ui-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.filters-card {
  pointer-events: auto; flex: 0 1 330px; min-width: 0;
  background: rgba(12,17,20,.92); backdrop-filter: blur(8px);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 9px 10px;
}
.commodity-chips { display: flex; gap: 3px; flex-wrap: wrap; }
.commodity-chips button {
  flex: 1 1 52px; padding: 5px 2px; border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .06em; cursor: pointer;
  transition: all .12s; color: var(--text-3); background: #101619; border: 1px solid var(--line-3);
}
.commodity-chips button:hover { border-color: var(--focus); }
.commodity-chips button.on { color: var(--bg); background: var(--text-2); border-color: var(--text-2); }
.era-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 12px 0 7px; }
.era-range { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.era-track { position: relative; height: 22px; margin: 0 7px; cursor: pointer; }
.era-rail { position: absolute; top: 10px; left: 0; right: 0; height: 2px; background: #1E272D; border-radius: 2px; }
.era-fill { position: absolute; top: 10px; height: 2px; background: var(--focus); border-radius: 2px; }
.era-handle {
  position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  background: var(--panel); border: 1.5px solid #6FA8B4; cursor: grab;
}
.era-handle:hover { border-color: #9FD2DC; }

.tool-stack { pointer-events: auto; flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
.tool-group {
  display: flex; flex-direction: column; background: rgba(12,17,20,.92); backdrop-filter: blur(8px);
  border: 1px solid var(--line-2); border-radius: 5px; overflow: hidden;
}
.tool-group button {
  width: 34px; height: 32px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; border-bottom: 1px solid var(--line); background: transparent; color: var(--text-3);
}
.tool-group button:last-child { border-bottom: none; }
.tool-group button:hover { color: var(--text); }
.tool-group button.on { background: #1A2429; color: var(--amber); }
.tool-group button.zoom { height: 30px; font-family: 'IBM Plex Mono', monospace; font-size: 14px; }
.tool-group button.wa { height: 30px; font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .04em; }
.tool-group button.zoom:hover, .tool-group button.wa:hover { background: #131C21; }

.map-ui-mid { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.hint-card {
  background: rgba(12,17,20,.94); backdrop-filter: blur(10px); border: 1px solid var(--line-3);
  border-radius: 6px; padding: 18px 22px; max-width: 392px; box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.hint-kicker {
  display: flex; align-items: center; gap: 8px; font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px; letter-spacing: .14em; color: var(--muted); margin-bottom: 9px;
}
.hint-title { font-size: 14px; line-height: 1.5; color: var(--text); text-wrap: pretty; }
.hint-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--muted); margin-top: 10px; line-height: 1.7; }

.selcard-row { display: flex; justify-content: center; flex: 0 0 auto; }
.selcard {
  pointer-events: auto; max-width: 100%;
  background: rgba(12,17,20,.96); backdrop-filter: blur(10px);
  border: 1px solid var(--line-4); border-radius: 6px; padding: 12px 14px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px;
  box-shadow: 0 18px 46px rgba(0,0,0,.6); animation: pf-rise .22s ease-out;
}
.selcard-info { min-width: 0; }
.selcard-title-row { display: flex; align-items: center; gap: 8px; }
.selcard-title { font-size: 13.5px; color: var(--text); white-space: nowrap; }
.selcard-tag {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; padding: 1px 5px; border-radius: 2px;
  color: var(--text-2); background: #1A242A; white-space: nowrap;
}
.selcard-stats {
  font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--text-3); margin-top: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.selcard-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ghost-btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .06em; color: var(--text-3);
  background: transparent; border: 1px solid var(--line-4); border-radius: 3px; padding: 8px 10px;
  cursor: pointer; white-space: nowrap;
}
.ghost-btn:hover { color: var(--text); border-color: var(--line-5); }
.primary-btn {
  font-size: 12.5px; font-weight: 500; color: var(--bg); background: var(--amber);
  border: 1px solid var(--amber); border-radius: 3px; padding: 9px 14px; cursor: pointer;
  transition: background .12s; white-space: nowrap;
}
.primary-btn:hover { background: #F2B75C; }
.primary-btn:active { background: #D89330; }

.map-ui-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex: 0 0 auto; }
.credit {
  flex: 1 1 auto; min-width: 0; font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; color: var(--faint-2); letter-spacing: .03em; line-height: 1.5;
}
.legend {
  pointer-events: auto; flex: 0 0 auto; width: 186px;
  background: rgba(12,17,20,.92); backdrop-filter: blur(8px);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 9px 11px;
}
.legend-name { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.legend-bar { height: 6px; border-radius: 2px; }
.legend-bar.grade { background: linear-gradient(90deg,#3E5A73,#4E8CA0,#7FBF9B,#D8CE63,#F0A03A); }
.legend-bar.reports { background: linear-gradient(90deg,#16303D,#1D4A5E,#26708A,#3597B4); }
.legend-ends { display: flex; justify-content: space-between; font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; color: var(--muted); margin-top: 3px; }

.map-tip {
  position: absolute; z-index: 30; pointer-events: none;
  background: rgba(10,14,17,.96); border: 1px solid var(--line-4); border-radius: 4px;
  padding: 7px 9px; box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.tip-title { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text); }
.tip-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-3); margin-top: 3px; }

/* ---------- right panel ---------- */
.panel {
  position: relative; flex: 0 0 auto; width: 0; height: 100%;
  background: var(--panel); border-left: none; overflow: hidden;
  z-index: 30; display: flex; flex-direction: column;
}
/* Transitions arm only after first paint — an initial layout must never animate
   (and in a background tab the animation clock is frozen, which would otherwise
   weld the panel mid-transition). */
.panel.animate {
  transition: width .4s cubic-bezier(.22,.9,.24,1), height .4s cubic-bezier(.22,.9,.24,1);
}
.panel.open { border-left: 1px solid var(--line-2); }
.app-main.narrow .panel { width: 100% !important; height: 0; border-left: none; border-top: 1px solid var(--line-2); }
.app-main.narrow .panel.open { height: 58%; }
.panel-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.panel-view[hidden], .drawer[hidden], .selcard-row[hidden], .hint-card[hidden], .map-tip[hidden], .toast[hidden], .legend[hidden] { display: none !important; }

/* trace */
#trace { padding: 20px 22px; overflow: auto; display: block; }
.trace-kicker { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .14em; color: var(--muted); }
.trace-title { font-size: 17px; font-weight: 500; margin: 7px 0 3px; letter-spacing: -.01em; }
.trace-sub { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted-2); }
.trace-steps { display: flex; flex-direction: column; gap: 2px; margin-top: 22px; }
.step { display: flex; gap: 11px; align-items: flex-start; padding: 11px 10px; border-radius: 4px; transition: opacity .3s, background .3s; }
.step.pending { opacity: .45; }
.step.active { background: #0F1618; }
.step-dot {
  flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  color: var(--muted); border: 1px solid var(--line-4); background: #0F1519;
}
.step.active .step-dot { color: var(--teal); border-color: var(--teal); background: rgba(47,194,176,.14); animation: pf-pulse 1.6s infinite; }
.step.done .step-dot { color: var(--teal); border-color: rgba(47,194,176,.5); background: rgba(47,194,176,.10); }
.step-body { flex: 1; min-width: 0; }
.step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.step-label { font-size: 12.5px; color: var(--text-3); }
.step.active .step-label { color: var(--text); }
.step.done .step-label { color: var(--text-2); }
.step-tool { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--faint); }
.step-detail { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--faint); margin-top: 4px; }
.step.active .step-detail { color: var(--teal); }
.step.done .step-detail { color: var(--muted-2); }
.step-bar { height: 2px; background: #16201F; margin-top: 9px; overflow: hidden; border-radius: 2px; }
.step-bar > div { width: 28%; height: 100%; background: var(--teal); animation: pf-sweep 1.15s infinite linear; }
.trace-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid #161F24;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--faint); line-height: 1.7;
}

/* nodata / error */
#nodata, #error { justify-content: center; padding: 24px 26px; }
.state-icon { width: 30px; height: 30px; border-radius: 2px; margin-bottom: 16px; }
.state-icon.dashed { border: 1px dashed var(--line-5); }
.state-icon.err {
  border: 1px solid var(--danger-bd); display: flex; align-items: center; justify-content: center;
  color: var(--danger); font-family: 'IBM Plex Mono', monospace; font-size: 15px;
}
.state-title { font-size: 15px; color: var(--text); margin-bottom: 7px; text-wrap: pretty; }
.state-body { font-size: 12.5px; color: var(--text-3); line-height: 1.6; margin-bottom: 18px; text-wrap: pretty; }
.state-detail { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--faint); margin: -10px 0 18px; }
.state-actions { display: flex; gap: 8px; }
.solid-btn {
  font-size: 12.5px; color: var(--bg); background: var(--text-2); border: none; border-radius: 3px;
  padding: 9px 13px; cursor: pointer;
}
.solid-btn:hover { background: var(--text); }
.outline-btn {
  font-size: 12.5px; color: var(--text-2); background: transparent; border: 1px solid var(--line-4);
  border-radius: 3px; padding: 9px 13px; cursor: pointer;
}
.outline-btn:hover { color: var(--text); border-color: var(--line-5); }

/* doc */
.doc-head { flex: 0 0 auto; padding: 16px 22px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.doc-head-row { display: flex; align-items: flex-start; gap: 12px; }
.doc-head-info { flex: 1; min-width: 0; }
.doc-kicker { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .14em; color: var(--muted); }
.doc-title { font-size: 19px; font-weight: 500; letter-spacing: -.015em; margin: 6px 0; text-wrap: pretty; }
.doc-corpus { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text-3); }
.doc-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--faint); margin-top: 4px; }
.doc-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); background: #101619; border: 1px solid var(--line-3); border-radius: 3px; cursor: pointer;
}
.icon-btn.plain { background: transparent; }
.icon-btn:hover { color: var(--text); border-color: var(--line-5); }
.export-btn {
  font-size: 12px; color: var(--text-2); background: #101619; border: 1px solid var(--line-4);
  border-radius: 3px; padding: 7px 11px; cursor: pointer;
}
.export-btn:hover { color: var(--text); border-color: var(--line-5); }
.doc-scroll { flex: 1; overflow: auto; min-height: 0; }
.doc-inner { padding: 20px 22px 26px; max-width: 760px; }

.sec-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 12px; }
.sec-head.rule { margin: 24px 0 12px; padding-top: 18px; border-top: 1px solid #161F24; }
.sec-no { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .13em; color: var(--muted); }
.sec-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.sec-note { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--faint); }

.chip {
  display: inline-flex; align-items: center; height: 19px; padding: 0 5px; border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--amber);
  background: rgba(232,163,61,.10); border: 1px solid rgba(232,163,61,.30);
  cursor: pointer; transition: all .12s; white-space: nowrap;
}
.chip:hover { color: var(--amber-hi); background: rgba(232,163,61,.20); border-color: rgba(232,163,61,.75); }
.chip.open, .chip:active { color: #12171A; background: var(--amber); border-color: var(--amber); }

.tl-row { display: flex; gap: 12px; align-items: stretch; }
.tl-year { flex: 0 0 42px; font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--text-2); padding-top: 1px; }
.tl-rail { flex: 0 0 1px; background: #1E272D; position: relative; }
.tl-rail::before {
  content: ""; position: absolute; left: -2.5px; top: 5px; width: 6px; height: 6px;
  border-radius: 50%; background: #3E5A66; border: 1px solid var(--panel);
}
.tl-body { flex: 1; padding: 0 0 15px 2px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tl-company { font-size: 12.5px; color: var(--text); }
.tl-work { font-size: 12.5px; color: var(--text-3); }

.itable { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.itable-head, .itable-row { display: grid; grid-template-columns: var(--icols); gap: 8px; padding: 7px 11px; }
.itable-head {
  background: var(--panel-3); font-family: 'IBM Plex Mono', monospace; font-size: 9.5px;
  letter-spacing: .11em; color: var(--muted); border-bottom: 1px solid var(--line);
}
.itable-row { padding: 8px 11px; align-items: center; border-bottom: 1px solid #131B20; transition: background .12s; }
.itable-row:last-child { border-bottom: none; }
.itable-row:hover { background: #131B21; }
.itable-row.open { background: #16202A; box-shadow: inset 2px 0 0 var(--amber); }
.i-hole { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--text-2); }
.i-grade {
  font-family: 'IBM Plex Mono', monospace; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--ifont, 12px);
}
.i-year { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--text-3); }
.i-company { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel[data-tier="1"] .i-year, .panel[data-tier="1"] .i-company, .panel[data-tier="1"] .itable .h-year, .panel[data-tier="1"] .itable .h-company { display: none; }
.panel[data-tier="2"] .i-company, .panel[data-tier="2"] .itable .h-company { display: none; }

.quote { border-left: 1px solid var(--line-4); padding: 1px 0 1px 13px; }
.quote + .quote { margin-top: 12px; }
.quote-text { font-size: 13px; line-height: 1.55; color: #C8D2D9; text-wrap: pretty; }
.quote-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.quote-src { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--muted-2); }
.body-text { font-size: 13px; line-height: 1.6; color: #C8D2D9; text-wrap: pretty; }
.cite-row { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }

.blind {
  background: #15120C; border: 1px solid #3A2E18; border-radius: 5px; padding: 18px 18px 16px;
}
.blind-kicker {
  display: flex; align-items: center; gap: 8px; font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px; letter-spacing: .14em; color: #C08B3C; margin-bottom: 11px;
}
.blind-headline { font-size: 17px; line-height: 1.4; font-weight: 500; color: #F2C57C; letter-spacing: -.01em; text-wrap: pretty; }
.blind-stats {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: #31281A;
  border: 1px solid #31281A; border-radius: 4px; margin: 15px 0 14px; overflow: hidden;
}
.blind-stat { background: #191509; padding: 10px 11px; }
.blind-val { font-family: 'IBM Plex Mono', monospace; font-size: 15px; font-weight: 600; color: #F2C57C; }
.blind-lab { font-size: 10.5px; color: #9C8555; margin-top: 3px; line-height: 1.4; }
.blind-detail { font-size: 12.5px; line-height: 1.6; color: #B9A57F; text-wrap: pretty; }
.blind .chip { background: rgba(232,163,61,.12); border-color: rgba(232,163,61,.40); }
.blind .chip:hover { color: #FFE0B0; background: rgba(232,163,61,.24); border-color: rgba(232,163,61,.85); }

.gaps { display: flex; gap: 16px; align-items: flex-start; }
.gaps-grid-wrap { flex: 0 0 132px; }
.gaps-grid {
  display: grid; grid-template-columns: repeat(6,1fr); gap: 2px; padding: 6px;
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 4px;
}
.gaps-cell { height: 16px; border-radius: 1px; }
.gaps-cell.f { background: #1D4A5E; border: 1px solid #26708A; }
.gaps-cell.e { background: var(--panel); border: 1px solid var(--line); background-image: repeating-linear-gradient(45deg,#161F24 0 2px,transparent 2px 5px); }
.gaps-note { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--faint); margin-top: 5px; line-height: 1.5; }

.fu-block { margin-top: 26px; padding-top: 18px; border-top: 1px solid #161F24; animation: pf-rise .3s ease-out; }
.fu-q { font-size: 12.5px; color: var(--text-3); margin: 10px 0 9px; }
.disclaimer {
  margin-top: 26px; padding-top: 14px; border-top: 1px solid #161F24;
  font-size: 10.5px; line-height: 1.65; color: var(--faint); text-wrap: pretty;
}

.fu-bar { flex: 0 0 auto; padding: 10px 22px 12px; border-top: 1px solid var(--line); background: var(--panel-3); }
.fu-input-row {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 4px 0 11px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 4px;
  transition: border-color .15s, box-shadow .15s;
}
.fu-input-row.focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(62,127,140,.16); }
.fu-input-row input {
  flex: 1; min-width: 0; height: 34px; background: transparent; border: none; outline: none;
  color: var(--text); font-family: 'IBM Plex Sans', sans-serif; font-size: 12.5px;
}
.fu-loading { display: flex; align-items: center; gap: 7px; flex: 1; }
.fu-loading span:first-child { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--teal); }
.fu-dots { display: flex; gap: 3px; }
.fu-dots i { width: 3px; height: 3px; border-radius: 50%; background: var(--teal); animation: pf-blink 1.1s infinite; }
.fu-dots i:nth-child(2) { animation-delay: .16s; }
.fu-dots i:nth-child(3) { animation-delay: .32s; }
.fu-ask {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .08em;
  color: var(--text-3); background: #101619; border: 1px solid var(--line-3); border-radius: 3px;
  padding: 6px 9px; cursor: pointer;
}
.fu-ask.ready { color: var(--bg); background: var(--text-2); border-color: var(--text-2); }
.fu-ask:hover { color: var(--text); border-color: var(--focus); }
.fu-hint { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; color: var(--faint-2); margin-top: 7px; }

/* drawer */
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 380px;
  background: var(--panel-3); border-left: 1px solid var(--line-4);
  box-shadow: -24px 0 60px rgba(0,0,0,.6); z-index: 40;
  display: flex; flex-direction: column; animation: pf-rise .22s ease-out;
}
.app-main.narrow .drawer { width: 100%; }
.drawer-head { flex: 0 0 auto; padding: 14px 18px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 10px; }
.drawer-head-info { flex: 1; min-width: 0; }
.drawer-kicker-row { display: flex; align-items: center; gap: 8px; }
.drawer-kicker { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .14em; color: var(--muted); }
.drawer-badge {
  display: inline-flex; align-items: center; height: 19px; padding: 0 6px; border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: #12171A; background: var(--amber);
}
.drawer-title { font-size: 13.5px; line-height: 1.45; color: var(--text); margin-top: 9px; text-wrap: pretty; }
.drawer-body { flex: 1; overflow: auto; padding: 16px 18px 20px; }
.drawer-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 11.5px; margin-bottom: 18px; }
.drawer-grid .k { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.drawer-grid .v { color: #C8D2D9; }
.drawer-grid .v.mono { font-family: 'IBM Plex Mono', monospace; }
.drawer-sec { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .13em; color: var(--muted); margin-bottom: 9px; }
.passage {
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 14px;
  font-size: 12.5px; line-height: 1.7; color: var(--text-3); text-wrap: pretty;
}
.passage .hit {
  color: #F2E4CB; background: rgba(232,163,61,.18);
  box-shadow: inset 0 -1px 0 rgba(232,163,61,.5); padding: 1px 2px;
}
.drawer-link {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; font-size: 12.5px;
  color: var(--text-2); background: #101619; border: 1px solid var(--line-4); border-radius: 3px; padding: 9px 12px;
}
.drawer-link:hover { color: var(--text); border-color: var(--line-5); }
.drawer-note { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; color: var(--faint-2); margin-top: 14px; line-height: 1.6; }

/* ---------- onboarding / search-first hint ---------- */
.hint-card.onboard { max-width: 460px; padding: 22px 24px; pointer-events: auto; }
.hint-search { position: relative; margin: 14px 0 12px; }
.hint-search input {
  width: 100%; box-sizing: border-box; height: 42px; padding: 0 12px;
  background: var(--bg); border: 1px solid var(--line-4); border-radius: 5px;
  color: var(--text); font-family: 'IBM Plex Sans', sans-serif; font-size: 13.5px; outline: none;
}
.hint-search input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(62,127,140,.16); }
.suggest {
  position: absolute; left: 0; right: 0; top: 44px; z-index: 20;
  background: #10161A; border: 1px solid var(--line-4); border-radius: 5px; overflow: hidden;
  box-shadow: 0 14px 40px rgba(0,0,0,.55);
}
.suggest-item { display: flex; align-items: center; gap: 9px; padding: 9px 12px; cursor: pointer; }
.suggest-item:hover, .suggest-item.sel { background: #17222A; }
.suggest-item .s-name { font-size: 12.5px; color: var(--text); }
.suggest-item .s-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--muted); margin-left: auto; }
.hint-examples { display: flex; flex-direction: column; gap: 6px; }
.hint-examples .example { background: #10161A; }
.kbd {
  display: inline-block; padding: 0 5px; border: 1px solid var(--line-4); border-bottom-width: 2px;
  border-radius: 3px; font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-3);
}

/* suggested follow-up chips */
.sq { margin-top: 22px; padding-top: 16px; border-top: 1px solid #161F24; }
.sq-label { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .13em; color: var(--muted); margin-bottom: 9px; }
.sq-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.sq-chip {
  font-size: 12px; color: var(--text-2); background: #101619; border: 1px solid var(--line-4);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; transition: all .12s;
}
.sq-chip:hover { color: var(--text); border-color: var(--focus); background: #111A20; }

/* cache badge + regenerate */
.cache-badge {
  display: inline-flex; align-items: center; gap: 5px; height: 18px; padding: 0 7px;
  border-radius: 999px; font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .06em;
  color: var(--teal); background: rgba(47,194,176,.10); border: 1px solid rgba(47,194,176,.35);
}
.regen-btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; letter-spacing: .04em;
  color: var(--muted-2); background: transparent; border: none; cursor: pointer; padding: 0 2px;
}
.regen-btn:hover { color: var(--text); text-decoration: underline; }

/* ---------- print: Export PDF = window.print() ---------- */
@media print {
  .app-header, .sidebar, .narrowbar, .map-stage, .fu-bar, .doc-actions, .drawer, .toast, .sq { display: none !important; }
  body { overflow: visible; background: #fff; color: #111; display: block; }
  .app-main { display: block; }
  .panel { position: static; width: 100% !important; height: auto !important; border: none !important; background: #fff; overflow: visible; display: block; }
  .panel-view.doc { display: block !important; }
  .doc-head { background: #fff; border-color: #ddd; }
  .doc-scroll { overflow: visible; }
  .doc-inner { max-width: none; }
  .doc-title, .sec-title, .tl-company, .i-grade, .state-title, .quote-text, .body-text,
  .blind-headline, .blind-detail, .i-hole, .tl-year { color: #111 !important; }
  .doc-corpus, .doc-meta, .sec-no, .sec-note, .tl-work, .i-year, .i-company, .quote-src,
  .gaps-note, .disclaimer, .blind-lab { color: #444 !important; }
  .chip { color: #8a5200 !important; background: #fff7e8 !important; border-color: #d9b26a !important; }
  .itable, .itable-head, .itable-row, .blind, .blind-stat, .gaps-grid { background: #fff !important; border-color: #ddd !important; }
  .blind { border-color: #d9b26a !important; }
  .blind-val { color: #8a5200 !important; }
  .sec-head.rule, .quote { border-color: #ddd !important; }
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90;
  background: #141B20; border: 1px solid var(--line-4); border-radius: 4px; padding: 10px 14px;
  font-size: 12.5px; color: #C8D2D9; box-shadow: 0 14px 40px rgba(0,0,0,.6); animation: pf-rise .2s ease-out;
}

/* ---- sign-in overlay (auth.js; only when a deployed runtime is the backend) ---- */
.auth-overlay{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;background:rgba(10,14,17,.72);backdrop-filter:blur(3px)}
.auth-card{width:min(360px,90vw);padding:22px 22px 18px;background:#14191E;border:1px solid #2A343C;border-radius:8px;display:flex;flex-direction:column;gap:10px}
.auth-title{font-size:13px;line-height:1.5;color:#B8C4CC;margin-bottom:4px}
.auth-card input{width:100%;box-sizing:border-box;padding:9px 11px;background:#0E1216;border:1px solid #2A343C;border-radius:5px;color:#E6ECEF;font:inherit;font-size:13px}
.auth-card input:focus{outline:none;border-color:#5FC0D8}
.auth-err{font-size:12px;color:#F0A03A}
