/* VentureLens — restrained neutral design system (Geist / Linear inspired) */

:root {
  --bg: #0a0a0a;
  --bg-2: #0e0e0e;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --hover: #1a1a1a;

  --border: #222222;
  --border-2: #2e2e2e;
  --border-3: #3d3d3d;

  --text: #ededed;
  --text-2: #a1a1a1;
  --text-3: #6f6f6f;
  --text-4: #4a4a4a;
  --white: #fafafa;

  --green: #3ecf8e;
  --amber: #f0b429;
  --red: #ff6369;
  --blue: #7db8ff;

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --topbar-h: 52px;
  --panel-w: 340px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(125, 184, 255, 0.3); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }

/* ---------- Scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: #2a2a2a transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
}

.topbar-left { display: flex; align-items: center; gap: 18px; min-width: 0; }

.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; color: var(--white); white-space: nowrap; }
.logo-mark { width: 18px; height: 18px; border-radius: 5px; background: var(--white); position: relative; flex-shrink: 0; }
.logo-mark::after { content: ""; position: absolute; left: 5px; top: 5px; width: 8px; height: 8px; border-radius: 2px; background: var(--bg); transform: rotate(45deg); }
.crumb-sep { color: var(--text-4); font-size: 16px; font-weight: 300; }
.crumb { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

.tabs { display: flex; align-items: center; gap: 2px; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--hover); }
.tab.active { color: var(--white); background: var(--surface-2); }
.tab-meta { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.tab.active .tab-meta { color: var(--text-2); }

.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.engine {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.engine:hover { border-color: var(--border-3); color: var(--text); }

/* ---------- Primitives ---------- */
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-4); flex-shrink: 0; }
.dot.green { background: var(--green); box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.12); }
.dot.amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.12); }
.dot.red { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 99, 105, 0.12); }

.seg { display: inline-flex; padding: 2px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--bg); }
.seg-btn { height: 24px; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--text-3); font-size: 12px; cursor: pointer; white-space: nowrap; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface-2); color: var(--white); }
.seg-lg .seg-btn { height: 28px; padding: 0 14px; font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover:not(:disabled) { background: var(--hover); border-color: var(--border-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--white); border-color: var(--white); color: #0a0a0a; }
.btn-primary:hover:not(:disabled) { background: #d6d6d6; border-color: #d6d6d6; }
.btn-ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); border-color: transparent; color: var(--text); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }

.link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.link:hover { color: var(--white); }

.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-3);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .12s, border-color .12s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-3); }
.icon-btn.copied { color: var(--green); border-color: rgba(62, 207, 142, 0.4); }
.icon-btn svg { width: 14px; height: 14px; }

.label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border: 1px solid var(--border-2); border-radius: 999px; font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: var(--panel-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }

.panel {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg-2);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.panel-title { font-size: 13px; font-weight: 600; color: var(--white); }
.panel-body { flex: 1; overflow-y: auto; padding: 0 16px 8px; }
.panel-foot { padding: 12px 16px; border-top: 1px solid var(--border); }

.group { padding: 16px 0 6px; border-bottom: 1px solid var(--border); }
.group:last-child { border-bottom: 0; }
.group > .label { display: block; margin-bottom: 12px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 11px; min-width: 0; }
.field > label { font-size: 12px; color: var(--text-2); }
.field-hint { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); line-height: 1.4; }
.field-hint:empty { display: none; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.input, .select, .textarea {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--bg);
  font-size: 13px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-3); }
.input:focus, .select:focus, .textarea:focus { border-color: #5a5a5a; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06); }
.input.is-fail { border-color: rgba(255, 99, 105, 0.45); }
.input.is-warn { border-color: rgba(240, 180, 41, 0.4); }
.select {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f6f6f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
}
.select option { background: #141414; }
.select-sm { height: 28px; font-size: 12.5px; width: auto; min-width: 150px; }
.textarea { height: auto; min-height: 168px; padding: 9px 10px; resize: vertical; font-size: 12.5px; line-height: 1.6; }

.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 14px; height: 14px; margin: 0; accent-color: #ededed; }

.dropzone {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px dashed var(--border-3);
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--text-3); background: var(--surface); }
.dropzone svg { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.dropzone-sub { display: block; font-size: 11.5px; color: var(--text-3); }
.upload-status { display: none; margin-top: 8px; font-size: 11.5px; color: var(--text-2); }
.upload-status.show { display: flex; align-items: center; gap: 6px; }

/* ---------- Main views ---------- */
.main { min-width: 0; }
.view { display: none; max-width: 1080px; margin: 0 auto; padding: 36px 40px 96px; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin-bottom: 8px; }
.h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.022em; color: var(--white); }
.lede { margin: 8px 0 0; max-width: 620px; font-size: 14px; color: var(--text-2); }
.h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--white); }

.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-desc { margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; }

/* Metrics */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.metric { padding: 18px 20px 20px; border-left: 1px solid var(--border); min-width: 0; }
.metric:first-child { border-left: 0; }
.metric-label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.metric-value { margin-top: 12px; font-size: 28px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; color: var(--white); font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-value small { margin-left: 3px; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--text-3); }
.metric-sub { margin-top: 10px; font-size: 11.5px; line-height: 1.5; color: var(--text-3); }

/* List */
.list { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.list-item { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
.list-item > .dot { margin-top: 7px; }
.list-item.clickable { cursor: pointer; transition: background .12s; }
.list-item.clickable:hover { background: var(--surface); }
.li-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.li-desc { margin-top: 3px; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }
.li-aside { font-size: 12px; color: var(--text-3); white-space: nowrap; padding-top: 1px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 4px 0 0; }
.tl-item { position: relative; padding: 0 0 20px 22px; }
.tl-item::before { content: ""; position: absolute; left: 3px; top: 12px; bottom: -4px; width: 1px; background: var(--border-2); }
.tl-item:last-child::before { display: none; }
.tl-item::after { content: ""; position: absolute; left: 0; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); border: 1px solid var(--text-3); }
.tl-phase { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.tl-title { margin-top: 3px; font-size: 13.5px; font-weight: 500; color: var(--text); }
.tl-desc { margin-top: 4px; font-size: 12.5px; line-height: 1.6; color: var(--text-3); }
.note { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-2); font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.note strong { color: var(--text); font-weight: 500; }

/* Gate strip */
.gates { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.gate { min-width: 0; padding: 14px 16px 16px; border-left: 1px solid var(--border); }
.gate:first-child { border-left: 0; }
.gate-status { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-3); }
.gate-title { margin-top: 9px; font-size: 13px; line-height: 1.45; color: var(--text); }
.gate-fix { margin-top: 5px; font-size: 11.5px; line-height: 1.5; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Sub tabs */
.subtabs { display: flex; gap: 22px; margin: 32px 0 20px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.subtab { position: relative; height: 38px; padding: 0; border: 0; background: none; color: var(--text-3); font-size: 13px; cursor: pointer; white-space: nowrap; }
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--white); }
.subtab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--white); }
.subpanel { display: none; }
.subpanel.active { display: block; }

.panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.panel-toolbar-text { font-size: 12.5px; color: var(--text-3); }
.panel-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Code block */
.codeblock { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.codeblock-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 42px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--border); }
.codeblock-file { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.codeblock-file svg { width: 14px; height: 14px; color: var(--text-3); }
.codeblock pre { margin: 0; padding: 20px 22px; max-height: 560px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.8; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.tok-h { color: var(--white); font-weight: 600; }
.tok-strong { color: var(--text); }
.tok-code { color: var(--blue); }

/* Browser frame */
.browser { border: 1px solid var(--border-2); border-radius: var(--r-lg); background: #000; overflow: hidden; }
.browser-bar { display: grid; grid-template-columns: 60px 1fr 60px; align-items: center; height: 38px; padding: 0 12px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.browser-dots { display: flex; gap: 6px; }
.browser-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-3); }
.browser-url { justify-self: center; display: flex; align-items: center; gap: 6px; width: min(420px, 100%); height: 24px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font-family: var(--mono); font-size: 11.5px; color: var(--text-3); justify-content: center; }
.browser-url svg { width: 11px; height: 11px; }
.browser iframe { display: block; width: 100%; height: 600px; border: 0; background: #000; }

/* Portal key-value tables */
.portal { margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.portal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.portal-name { font-size: 14px; font-weight: 600; color: var(--white); }
.portal-meta { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.portal-meta .amt { color: var(--green); }
.kv { display: grid; grid-template-columns: 210px minmax(0, 1fr) 28px; gap: 18px; align-items: start; padding: 13px 16px; border-top: 1px solid var(--border); }
.kv:first-of-type { border-top: 0; }
.kv-key { font-size: 12.5px; color: var(--text); }
.kv-key small { display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.45; color: var(--text-3); }
.kv-val { font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.step { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 14px; padding: 16px; border-top: 1px solid var(--border); }
.step:first-child { border-top: 0; }
.step-num { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-3); border-radius: 50%; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.step-aside { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); white-space: nowrap; padding-top: 3px; }

/* Programs table */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 1px solid var(--border-2); border-radius: 999px; background: none; color: var(--text-3); font-size: 12px; cursor: pointer; transition: all .12s; }
.toggle:hover { color: var(--text); border-color: var(--border-3); }
.toggle.on { color: var(--white); border-color: var(--text-3); background: var(--surface-2); }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { width: 240px; height: 28px; padding-left: 30px; font-size: 12.5px; }

.table { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.thead, .trow { display: grid; grid-template-columns: 56px minmax(0, 1.5fr) minmax(0, 1.2fr) 108px 150px 16px; gap: 16px; align-items: center; padding: 0 16px; }
.thead { height: 36px; border-bottom: 1px solid var(--border); }
.thead > div { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.prog + .prog { border-top: 1px solid var(--border); }
.trow { min-height: 58px; padding-top: 10px; padding-bottom: 10px; cursor: pointer; transition: background .12s; }
.trow:hover, .prog.open .trow { background: var(--surface); }
.fit-num { font-family: var(--mono); font-size: 13px; color: var(--text); }
.fit-bar { margin-top: 5px; width: 32px; height: 2px; border-radius: 2px; background: var(--border-2); overflow: hidden; }
.fit-bar i { display: block; height: 100%; background: var(--text-2); }
.p-name { font-size: 13.5px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-sub { margin-top: 2px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-amount { font-size: 12.5px; line-height: 1.5; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-equity { font-size: 12px; color: var(--text-3); }
.p-equity.zero { color: var(--green); }
.p-status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); min-width: 0; }
.p-status span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { width: 14px; height: 14px; color: var(--text-3); transition: transform .15s; }
.prog.open .chev { transform: rotate(90deg); }
.prog-detail { display: none; padding: 4px 16px 20px 88px; background: var(--surface); }
.prog.open .prog-detail { display: block; }
.prog-summary { margin: 0 0 16px; max-width: 720px; font-size: 13px; line-height: 1.65; color: var(--text-2); }
.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.detail-cols .label { display: block; margin-bottom: 8px; }
.reason { display: flex; gap: 8px; margin-bottom: 6px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.reason svg { width: 13px; height: 13px; margin-top: 3px; flex-shrink: 0; }
.reason.ok svg { color: var(--green); }
.reason.warn svg { color: var(--amber); }
.tip { font-size: 12.5px; line-height: 1.65; color: var(--text-2); }
.detail-actions { display: flex; gap: 8px; margin-top: 18px; }
.empty { padding: 48px 16px; text-align: center; font-size: 13px; color: var(--text-3); }

/* ---------- Pitch review ---------- */
.score-panel { display: grid; grid-template-columns: minmax(0, 1fr) 400px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.score-left { padding: 24px 26px; border-right: 1px solid var(--border); }
.score-right { display: flex; align-items: center; justify-content: center; padding: 12px; }
.score-big { display: flex; align-items: baseline; gap: 6px; }
.score-num { font-size: 56px; font-weight: 600; line-height: 1; letter-spacing: -0.045em; color: var(--white); font-variant-numeric: tabular-nums; }
.score-of { font-size: 15px; color: var(--text-3); }
.tier { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 12.5px; color: var(--text-2); }
.tldr { margin: 10px 0 0; max-width: 540px; font-size: 14px; line-height: 1.65; color: var(--text); }
.bars { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; margin-top: 26px; }
.bar-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-size: 12px; color: var(--text-2); }
.bar-head span:last-child { font-family: var(--mono); color: var(--text-3); }
.bar { height: 3px; border-radius: 2px; background: var(--border-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 2px; }

.card-plain { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.flag, .rewrite, .qa { border-top: 1px solid var(--border); }
.flag:first-child, .rewrite:first-child, .qa:first-child { border-top: 0; }
.flag, .rewrite { padding: 20px 22px; }
.flag-head { display: flex; align-items: center; gap: 10px; }
.sev { padding: 2px 6px; border: 1px solid var(--border-3); border-radius: 4px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--text-2); }
.sev-CRITICAL { color: var(--red); border-color: rgba(255, 99, 105, 0.35); }
.sev-HIGH { color: var(--amber); border-color: rgba(240, 180, 41, 0.35); }
.flag-title { font-size: 14px; font-weight: 500; color: var(--white); }
.quote { margin: 12px 0 0; padding-left: 12px; border-left: 2px solid var(--border-3); font-size: 13px; line-height: 1.6; color: var(--text-2); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 16px; }
.two-col .label { display: block; margin-bottom: 6px; }
.two-col p { margin: 0; font-size: 13px; line-height: 1.65; color: var(--text-2); }
.two-col .after p { color: var(--white); }
.rewrite-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rw-why { margin-top: 14px; font-size: 12.5px; line-height: 1.6; color: var(--text-3); }

.qa summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 22px; list-style: none; cursor: pointer; font-size: 13.5px; color: var(--text); transition: background .12s; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { background: var(--surface); }
.qa[open] summary { background: var(--surface); }
.qa[open] .chev { transform: rotate(90deg); }
.qa-body { padding: 4px 22px 20px; background: var(--surface); }
.qa-why { font-size: 12.5px; color: var(--text-3); }
.qa-body .two-col { margin-top: 12px; }

.risk { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; padding: 22px; border-bottom: 1px solid var(--border); }
.risk-num { margin-top: 8px; font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -0.04em; color: var(--white); }
.risk-num small { font-size: 14px; color: var(--text-3); letter-spacing: 0; }
.risk-text { font-size: 13px; line-height: 1.7; color: var(--text-2); }
.risk-block { padding: 20px 22px; border-bottom: 1px solid var(--border); }
.risk-block:last-child { border-bottom: 0; }
.risk-block .label { display: block; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.moats { margin: 0; padding: 0; list-style: none; counter-reset: m; }
.moats li { counter-increment: m; display: grid; grid-template-columns: 26px 1fr; gap: 10px; margin-bottom: 12px; font-size: 13px; line-height: 1.65; color: var(--text-2); }
.moats li::before { content: counter(m, decimal-leading-zero); font-family: var(--mono); font-size: 11.5px; color: var(--text-3); padding-top: 2px; }

/* Interview */
.personas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.persona { padding: 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); text-align: left; cursor: pointer; transition: border-color .12s, background .12s; }
.persona:hover { border-color: var(--border-2); }
.persona.selected { border-color: var(--text-3); background: var(--surface); }
.persona-top { display: flex; align-items: center; gap: 10px; }
.avatar { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-2); border-radius: 50%; background: var(--surface-2); font-size: 10.5px; font-weight: 600; color: var(--white); flex-shrink: 0; }
.persona-name { font-size: 13px; font-weight: 500; color: var(--text); }
.persona-firm { font-size: 11.5px; color: var(--text-3); }
.persona-style { margin-top: 12px; font-size: 12.5px; color: var(--text); }
.persona-desc { margin-top: 4px; font-size: 12px; line-height: 1.55; color: var(--text-3); }
.interview-actions { display: flex; gap: 8px; margin-top: 16px; }

.chat { margin-top: 20px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-title { font-size: 13px; font-weight: 500; color: var(--text); }
.chat-sub { margin-top: 1px; font-size: 11.5px; color: var(--text-3); }
.chat-body { display: flex; flex-direction: column; gap: 22px; min-height: 240px; max-height: 520px; padding: 22px 20px; overflow-y: auto; }
.msg { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.msg-name { margin-bottom: 3px; font-size: 12px; color: var(--text-3); }
.msg-text { font-size: 13.5px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }
.msg.founder .avatar { background: var(--white); color: #0a0a0a; border-color: var(--white); }
.eval { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.eval-score { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.eval.strong .eval-score { color: var(--green); }
.eval.mixed .eval-score { color: var(--amber); }
.eval.weak .eval-score { color: var(--red); }
.composer { border-top: 1px solid var(--border); padding: 12px 14px; }
.composer textarea { width: 100%; min-height: 72px; padding: 4px 2px; border: 0; background: none; outline: none; resize: vertical; font-size: 13.5px; line-height: 1.6; }
.composer textarea::placeholder { color: var(--text-4); }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.kbd { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

.memo { margin-top: 20px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-2); overflow: hidden; }
.memo-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.memo-decision { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--white); }
.memo-score { text-align: right; }
.memo-score b { display: block; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; color: var(--white); }
.memo-score span { font-size: 12px; color: var(--text-3); }
.memo-body { padding: 20px 22px; }
.memo-headline { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text); }
.memo ul { margin: 0; padding-left: 16px; }
.memo li { margin-bottom: 6px; font-size: 12.5px; line-height: 1.6; color: var(--text-2); }

/* ---------- Drawer & modal ---------- */
.backdrop { position: fixed; inset: 0; z-index: 60; display: none; background: rgba(0, 0, 0, 0.6); }
.backdrop.open { display: block; animation: fade .15s ease; }
.drawer { position: fixed; top: 0; right: 0; z-index: 70; width: min(680px, 94vw); height: 100vh; display: flex; flex-direction: column; border-left: 1px solid var(--border-2); background: var(--bg-2); transform: translateX(100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.drawer.open { transform: none; box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-title { margin-top: 6px; font-size: 16px; font-weight: 600; color: var(--white); }
.drawer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }
.drawer-body pre { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.75; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }

.prose { font-size: 13.5px; line-height: 1.75; color: var(--text-2); }
.prose h1 { margin: 0 0 14px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--white); }
.prose h2 { margin: 26px 0 10px; font-size: 14px; font-weight: 600; color: var(--white); }
.prose h3 { margin: 20px 0 8px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.prose p { margin: 8px 0 12px; }
.prose strong { color: var(--text); font-weight: 500; }
.prose ul { margin: 8px 0 12px; padding-left: 18px; }
.prose li { margin-bottom: 4px; }
.prose blockquote { margin: 10px 0 14px; padding: 2px 0 2px 12px; border-left: 2px solid var(--border-3); font-size: 12.5px; color: var(--text-3); }
.prose code { padding: 1px 5px; border-radius: 4px; background: var(--surface-2); font-family: var(--mono); font-size: 12px; color: var(--text); }
.prose table { width: 100%; margin: 12px 0 16px; border-collapse: collapse; font-size: 12.5px; }
.prose th, .prose td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { color: var(--text); font-weight: 500; background: var(--surface); }
.prose hr { margin: 22px 0; border: 0; border-top: 1px solid var(--border); }

.modal { position: fixed; top: 50%; left: 50%; z-index: 80; display: none; width: min(480px, 92vw); border: 1px solid var(--border-2); border-radius: var(--r-lg); background: var(--bg-2); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); transform: translate(-50%, -50%); overflow: hidden; }
.modal.open { display: block; animation: fade .15s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px 6px; }
.modal-desc { margin: 0 0 16px; font-size: 12.5px; line-height: 1.6; color: var(--text-3); }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
.test-result { min-height: 18px; margin-bottom: 10px; font-size: 12px; color: var(--text-3); }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  :root { --panel-w: 300px; }
  .view { padding: 32px 28px 80px; }
  .score-panel { grid-template-columns: 1fr; }
  .score-left { border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 1040px) {
  .crumb, .crumb-sep { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--border); }
  .grid-2, .personas, .detail-cols { grid-template-columns: 1fr; }
  .gates { grid-template-columns: 1fr; }
  .gate { border-left: 0; border-top: 1px solid var(--border); }
  .gate:first-child { border-top: 0; }
  .thead, .trow { grid-template-columns: 48px minmax(0, 1fr) 130px 16px; }
  .thead > :nth-child(3), .thead > :nth-child(4), .trow > :nth-child(3), .trow > :nth-child(4) { display: none; }
  .prog-detail { padding-left: 16px; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .panel { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .tabs { overflow-x: auto; }
  .two-col, .kv, .risk { grid-template-columns: 1fr; gap: 10px; }
}
