:root {
  color-scheme: light;
  --paper: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --ink: #1b2140;
  --text: #1b2140;
  --muted: #5a6178;
  --faint: #8a90a3;
  --line: #dfe2ea;
  --line-strong: #c7ccd9;
  --honey: #d99a06;
  --honey-deep: #a06f00;
  --honey-soft: #fcf0cc;
  --nav: #1b2140;
  --nav-text: #c9cde0;
  --nav-dim: #8389a8;
  --good: #0c7a3f;
  --good-soft: #e3f4ea;
  --warn: #9a6200;
  --warn-soft: #fdf1d6;
  --bad: #c23b3b;
  --bad-soft: #fbe6e6;
  --link: #2a5fc7;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --other: #a3a8b8;
  --radius: 10px;
  --radius-sm: 6px;
  --f-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #11131d; --surface: #191c29; --surface-2: #1e2232; --text: #e7e9f2; --ink: #e7e9f2;
    --muted: #a5abc2; --faint: #7a809a; --line: #2b3044; --line-strong: #3b4160;
    --honey: #f0b429; --honey-deep: #f0b429; --honey-soft: #3a2f12; --nav: #0c0e17; --nav-text: #c9cde0;
    --good: #4cc584; --good-soft: #123323; --warn: #f0b429; --warn-soft: #3a2f12; --bad: #ef7070; --bad-soft: #3a1a1c;
    --link: #79a6ff;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --other: #5d6378;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #11131d; --surface: #191c29; --surface-2: #1e2232; --text: #e7e9f2; --ink: #e7e9f2;
  --muted: #a5abc2; --faint: #7a809a; --line: #2b3044; --line-strong: #3b4160;
  --honey: #f0b429; --honey-deep: #f0b429; --honey-soft: #3a2f12; --nav: #0c0e17; --nav-text: #c9cde0;
  --good: #4cc584; --good-soft: #123323; --warn: #f0b429; --warn-soft: #3a2f12; --bad: #ef7070; --bad-soft: #3a1a1c;
  --link: #79a6ff;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --other: #5d6378;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--text);
  font: 16px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 650; letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 0.8em; }
code, .mono { font-family: var(--f-mono); font-size: 0.86em; }
:focus-visible { outline: 2px solid var(--honey); outline-offset: 2px; border-radius: 4px; }
#screen:focus, #screen:focus-visible, .page:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- shell: labelled sidebar + workspace ---- */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.nav {
  background: var(--nav); color: var(--nav-text); padding: 14px 0 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0 16px 6px; text-decoration: none; color: #fff; }
.brand svg { display: block; }
.brand b { font: 600 17px/1 var(--f-head); letter-spacing: -.01em; }
.nav-group {
  font-size: 10px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700;
  color: var(--nav-dim); padding: 16px 16px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 10px; margin: 0 8px; padding: 8px 10px;
  border-radius: 8px; color: var(--nav-text); text-decoration: none;
  font-size: 13.5px; font-weight: 500; position: relative;
}
.nav a .ic { font-size: 14px; width: 18px; text-align: center; filter: saturate(.8); }
.nav a .lb { flex: 1; }
.nav a .ct {
  background: var(--honey); color: #1b2140; font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 17px; border-radius: 9px; display: grid; place-items: center;
  padding: 0 5px;
}
.nav a .ct:empty { display: none; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.on { background: rgba(240, 180, 41, .15); color: #fff; }
.nav a.on::before {
  content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: #f0b429;
}
.nav-foot {
  margin-top: auto; padding: 14px 16px 0; border-top: 1px solid rgba(255, 255, 255, .08);
  display: grid; gap: 2px; font-size: 12.5px; color: var(--nav-text);
}
.nav-foot .tiny { color: var(--nav-dim); }
.nav-foot .btn.link { color: var(--nav-dim); padding: 4px 0; text-align: left; justify-content: flex-start; margin-top: 4px; }
.nav-foot .btn.link:hover { color: #fff; }


main { min-width: 0; display: flex; flex-direction: column; }

/* section header bar with sub-tabs */
.secbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); padding: 0 28px; }
.secbar .row1 { display: flex; align-items: center; gap: 12px; padding: 14px 0 10px; }
.secbar .secicon { width: 34px; height: 34px; border-radius: 9px; background: var(--honey-soft); color: var(--honey-deep); display: grid; place-items: center; flex: none; }
.secbar .secicon svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.secbar h1 { font-size: 1.18rem; }
.secbar .secsub { color: var(--muted); font-size: 0.86rem; }
.secbar .spacer { flex: 1; }
.subtabs { display: flex; gap: 2px; overflow-x: auto; }
.subtabs a { padding: 8px 14px 11px; font-size: 0.9rem; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.subtabs a:hover { color: var(--text); }
.subtabs a.on { color: var(--text); border-bottom-color: var(--honey); }

.page { max-width: 1240px; width: 100%; padding: 22px 28px 72px; }
.page-head { margin-bottom: 18px; max-width: 820px; }
.page-head h1 { margin-bottom: 5px; }
.page-head p { color: var(--muted); margin: 0; font-size: 0.96rem; }
.stage-tag { display: none; }
.page-lede { color: var(--muted); font-size: 0.94rem; max-width: 80ch; margin: 0 0 18px; }

.topbar { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .nav {
    position: fixed; inset: auto 0 0 0; top: auto; flex-direction: row; height: 60px;
    width: 100%; padding: 4px; justify-content: space-around; gap: 0;
    border-top: 1px solid rgba(255, 255, 255, .08); z-index: 50; overflow-x: auto;
  }
  .brand, .nav-foot, .nav-group, #credit { display: none; }
  .nav a {
    flex-direction: column; gap: 2px; margin: 0; padding: 6px 4px; flex: 1 0 56px;
    font-size: 10px; text-align: center;
  }
  .nav a .lb { flex: none; }
  .nav a .ic { font-size: 17px; }
  .nav a .ct { position: absolute; top: 2px; right: 8px; }
  .nav a.on { background: none; color: #f0b429; }
  .nav a.on::before { display: none; }
  main { padding-bottom: 60px; }
  .secbar { padding: 0 16px; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40; background: var(--nav); color: #fff; padding: 9px 16px; }
  .topbar b { font-family: var(--f-head); font-size: 1.1rem; }
  .page { padding: 16px 16px 40px; }
}

/* ---- primitives ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel + .panel, .stack > * + * { margin-top: 16px; }
.panel h2, .panel h3 { margin-bottom: 10px; }
.panel.flush { padding: 0; overflow: hidden; }
.sub { color: var(--muted); font-size: 0.92rem; }
.tiny { font-size: 0.8rem; color: var(--faint); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1050px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 220px; min-width: 0; }

/* Every text-like control, by exclusion rather than by listing types — the previous
   list omitted email and password, so exactly those two rendered unstyled. */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]),
textarea, select {
  width: 100%; font: 400 0.95rem var(--f-body); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; appearance: none;
  transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover:not(:focus), textarea:hover:not(:focus), select:hover:not(:focus) {
  border-color: var(--faint);
}
select {
  /* The native arrow disappears with appearance:none, so draw one. */
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(1em + 1px), calc(100% - 12px) calc(1em + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
  cursor: pointer;
}
/* Chrome paints autofilled fields with its own background, overriding everything
   above. An inset shadow is the only way to win it back. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
  box-shadow: 0 0 0 1000px var(--surface-2) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--honey);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--honey) 22%, transparent);
}
input:focus:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset,
                      0 0 0 3px color-mix(in srgb, var(--honey) 22%, transparent);
}
input:invalid:not(:placeholder-shown) { border-color: var(--bad); }
label.field { display: block; font-size: 0.86rem; color: var(--muted); margin-bottom: 10px; }
label.field > span { display: block; margin-bottom: 4px; font-weight: 700; color: var(--text); }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 0.9rem; cursor: pointer; }

.btn {
  font: 700 0.92rem var(--f-body); border-radius: var(--radius-sm); padding: 9px 16px; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper); white-space: nowrap;
}
:root[data-theme="dark"] .btn, .btn { }
.btn:hover { filter: brightness(1.12); }
.btn.honey { background: var(--honey); border-color: var(--honey); color: #1b2140; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.sm { padding: 5px 10px; font-size: 0.82rem; }
.btn.link { background: none; border: 0; color: var(--link); padding: 0; font-weight: 700; }
.btn:disabled { opacity: 0.55; cursor: wait; }

.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 0.78rem; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.chip.honey { background: var(--honey-soft); border-color: transparent; color: var(--honey-deep); }
.chip.good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.chip.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.chip.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
button.chip { cursor: pointer; font: inherit; font-size: 0.8rem; }
button.chip[aria-pressed=true] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { font: 700 0.92rem var(--f-body); background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--text); border-bottom-color: var(--honey); }

.note { border-left: 3px solid var(--honey); background: var(--honey-soft); padding: 10px 14px; border-radius: 0 6px 6px 0; font-size: 0.9rem; }
.note.plain { border-left-color: var(--line-strong); background: var(--surface-2); color: var(--muted); }
.error { border-left: 3px solid var(--bad); background: var(--bad-soft); padding: 10px 14px; border-radius: 0 6px 6px 0; font-size: 0.92rem; }
.empty { text-align: left; padding: 22px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty b { color: var(--text); display: block; margin-bottom: 4px; }

.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 16px 2px; }
.loading .hexspin { width: 18px; height: 18px; background: var(--honey); clip-path: polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%); animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- papers ---- */
.paper { padding: 14px 0; border-top: 1px solid var(--line); }
.paper:first-child { border-top: 0; }
.paper h3 { font-family: var(--f-body); font-size: 1.02rem; font-weight: 700; line-height: 1.35; margin-bottom: 4px; }
.paper h3 a { color: var(--text); text-decoration: none; }
.paper h3 a:hover { text-decoration: underline; }
.paper .meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.paper .reason { font-size: 0.9rem; margin: 6px 0; }
.paper .reason::before { content: "Why: "; font-weight: 700; color: var(--honey-deep); }
.paper .abs { font-size: 0.9rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.paper .abs.open { -webkit-line-clamp: unset; }
.paper .actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ---- tables ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tbl th { text-align: left; font-weight: 700; color: var(--muted); font-size: 0.8rem; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

/* ---- stats ---- */
.stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat b { display: block; font-family: var(--f-head); font-size: 1.7rem; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.85rem; color: var(--muted); }

/* ---- home / dashboard ---- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.dash-head h1 { font-size: 1.6rem; }
.dash-head .sub { margin-top: 2px; }
.cmd { display: flex; gap: 8px; margin-bottom: 8px; }
.cmd input { font-size: 1rem; padding: 12px 14px; background: var(--surface); }
.cmd .btn { padding: 12px 18px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 26px; }

.dash-cols { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 22px; align-items: start; }
@media (max-width: 1000px) { .dash-cols { grid-template-columns: 1fr; } }
.dash-sec-label { font-family: var(--f-head); font-size: 0.82rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }

.launch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .launch { grid-template-columns: repeat(2, 1fr); } }
.launch a { position: relative; display: block; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow: hidden; transition: border-color .15s, transform .12s; }
.launch a:hover { border-color: var(--honey); transform: translateY(-1px); }
.launch a .hx { position: absolute; right: -14px; top: -14px; width: 54px; height: 60px; opacity: .14; }
.launch a .hx svg { width: 100%; height: 100%; }
.launch a .num { font-family: var(--f-body); font-weight: 700; font-size: 0.72rem; color: var(--honey-deep); }
.launch a h3 { margin: 6px 0 3px; font-size: 1.04rem; }
.launch a p { margin: 0; font-size: 0.82rem; color: var(--muted); line-height: 1.35; }
/* fixed dark navy in BOTH themes (do not use --ink, which flips in dark mode) */
.launch a.feature { grid-column: span 3; background: #1b2140; color: #e7e9f2; border-color: #1b2140; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
@media (max-width: 560px) { .launch a.feature { grid-column: span 2; } }
.launch a.feature:hover { border-color: var(--honey); }
.launch a.feature .fhex { width: 46px; height: 52px; color: #f0b429; }
.launch a.feature h3 { color: #ffffff; margin: 0 0 3px; }
.launch a.feature p { color: #c9cde0; }

.resume { display: grid; gap: 8px; }
.resume a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.resume a:hover { border-color: var(--line-strong); background: var(--surface-2); }
.resume a .ric { width: 30px; height: 30px; flex: none; border-radius: 7px; background: var(--honey-soft); color: var(--honey-deep); display: grid; place-items: center; font-weight: 700; font-size: 0.8rem; }
.resume a b { font-size: 0.88rem; font-weight: 600; display: block; line-height: 1.2; }
.resume a span { font-size: 0.76rem; color: var(--faint); }
.mini-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.mini-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.mini-stats b { font-family: var(--f-head); font-size: 1.35rem; font-weight: 650; display: block; line-height: 1.1; }
.mini-stats span { font-size: 0.74rem; color: var(--muted); }

.tile { display: block; text-decoration: none; color: inherit; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tile:hover { border-color: var(--honey); }
.tile h3 { margin-bottom: 4px; }
.tile p { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ---- graph ---- */
.graph-wrap { position: relative; height: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.graph-wrap svg { width: 100%; height: 100%; display: block; cursor: grab; }
.graph-wrap .link { stroke: var(--line-strong); stroke-opacity: 0.8; }
.graph-wrap .link.cites { stroke: var(--muted); stroke-opacity: 0.55; }
.graph-wrap .node circle { stroke: var(--surface); stroke-width: 2px; cursor: pointer; }
.graph-wrap .node.india circle { stroke: var(--honey); stroke-width: 2.5px; }
.graph-wrap .node.dim { opacity: 0.18; }
.graph-wrap .node text { font-size: 10px; fill: var(--text); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font-size: 0.82rem; max-width: 300px; box-shadow: 0 6px 20px rgba(15,18,35,0.14); z-index: 5; display: none; }
.tip b { display: block; margin-bottom: 2px; }
.gap { padding: 12px 0; border-top: 1px solid var(--line); }
.gap:first-child { border-top: 0; padding-top: 0; }
.gap h4 { font-family: var(--f-body); font-weight: 700; font-size: 0.98rem; margin: 4px 0; }
.gap p { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ---- charts ---- */
.chart { width: 100%; display: block; }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .axis line, .chart .axis path { stroke: var(--line); }
.chart .grid line { stroke: var(--line); stroke-dasharray: 2 3; }
.chart .bar { fill: var(--s1); }
.chart .bar:hover { fill: var(--honey); }
.chart .line { fill: none; stroke: var(--s1); stroke-width: 2px; }
.chart .dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2px; }
.chart-box { position: relative; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: 0.86rem; padding: 3px 0; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.hbar.india .fill { background: var(--honey); }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .v { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- slides ---- */
.slide { background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: 36px 40px; min-height: 340px; display: flex; flex-direction: column; justify-content: center; position: relative; }
:root[data-theme="dark"] .slide { background: #232842; color: #e7e9f2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .slide { background: #232842; color: #e7e9f2; } }
.slide h2 { font-size: 1.8rem; margin-bottom: 16px; color: inherit; }
.slide ul { margin: 0; padding-left: 1.1em; font-size: 1.12rem; line-height: 1.55; max-width: 62ch; }
.slide li + li { margin-top: 8px; }
.slide .pg { position: absolute; top: 16px; right: 20px; font-size: 0.85rem; opacity: 0.6; }
.slide .bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--honey); border-radius: 0 0 0 var(--radius); transition: width .3s; }

/* ---- writing ---- */
.editor textarea { min-height: 150px; font-size: 0.98rem; }
.check-row { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.9rem; }
.check-row:first-child { border-top: 0; }
.mark { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 0.75rem; font-weight: 700; }
.mark.ok { background: var(--good-soft); color: var(--good); }
.mark.warn { background: var(--warn-soft); color: var(--warn); }
.mark.fail { background: var(--bad-soft); color: var(--bad); }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--good); }

/* ---- chem ---- */
.mol { background: var(--surface-2); border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.mol svg { max-width: 100%; height: auto; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mol svg { filter: invert(0.88) hue-rotate(180deg); } }
:root[data-theme="dark"] .mol svg { filter: invert(0.88) hue-rotate(180deg); }
.mol3d { position: relative; width: 100%; height: 300px; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.mol3d canvas { border-radius: 8px; }
.cmpd { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 10px; font-size: 0.84rem; }
.cmpd .mol { height: 150px; margin-bottom: 8px; }
.cmpd b { display: block; }
.steps { display: flex; gap: 0; margin-bottom: 18px; overflow-x: auto; }
.steps button { flex: 1 0 auto; font: 700 0.86rem var(--f-body); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-left-width: 0; padding: 10px 14px; cursor: pointer; text-align: left; }
.steps button:first-child { border-left-width: 1px; border-radius: var(--radius) 0 0 var(--radius); }
.steps button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.steps button small { display: block; font-weight: 400; color: var(--faint); }
.steps button[aria-current=step] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.steps button[aria-current=step] small { color: var(--nav-text); }
.steps button:disabled { cursor: not-allowed; opacity: 0.6; }
.score-pill { font-variant-numeric: tabular-nums; font-weight: 700; }
.ev { display: inline-block; height: 6px; border-radius: 3px; background: var(--s1); vertical-align: middle; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; font-size: 0.92rem; z-index: 100; box-shadow: 0 8px 28px rgba(0,0,0,0.25); }
.modal-back { position: fixed; inset: 0; background: rgba(10,12,24,0.5); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 22px; width: min(640px, 100%); max-height: 86vh; overflow: auto; }
.prose { max-width: 72ch; }
.prose p { white-space: pre-wrap; }
.answer { white-space: pre-wrap; line-height: 1.6; }
.answer sup, .cite { color: var(--honey-deep); font-weight: 700; }
.kbd { font-family: var(--f-mono); font-size: 0.82rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; word-break: break-all; }
details summary { cursor: pointer; font-weight: 700; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 7px 0; border-top: 1px solid var(--line); }
.list-plain li:first-child { border-top: 0; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ====================================================================================
   Hive alpha additions: authentication, account, design lab, jobs
   ==================================================================================== */

/* ---- auth screens -------------------------------------------------------------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(1100px 520px at 12% -8%, color-mix(in srgb, var(--honey) 11%, transparent), transparent 62%),
    radial-gradient(900px 480px at 92% 108%, color-mix(in srgb, var(--link) 12%, transparent), transparent 60%),
    var(--paper);
}
.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 68px;
  align-items: center;
  width: 100%;
  max-width: 1040px;
}
.auth-pitch { max-width: 420px; }
.auth-pitch .mark { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-pitch .mark b { font: 650 27px/1 var(--f-head); letter-spacing: -.02em; color: var(--text); }
.auth-pitch h2 {
  font: 650 29px/1.22 var(--f-head);
  letter-spacing: -.022em;
  margin: 0 0 14px;
  color: var(--text);
}
.auth-pitch > p { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 28px; }
.auth-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 15px; }
.auth-pitch li { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; }
.auth-pitch li .ic {
  flex: none; width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--honey) 16%, transparent); font-size: 13px;
}
.auth-pitch li b { display: block; color: var(--text); font-weight: 650; margin-bottom: 2px; }
.auth-pitch li span.d { color: var(--muted); line-height: 1.5; }

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 30px 28px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 18px 48px rgba(10, 12, 24, .16);
}
.auth-card .brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-card .brand-row b { font: 650 18px/1 var(--f-head); letter-spacing: -.015em; }
.auth-split .auth-card .brand-row { display: none; }   /* the pitch already shows it */
.auth-card h1 {
  font: 650 23px/1.22 var(--f-head);
  letter-spacing: -.02em;
  margin: 0 0 7px;
}
.auth-card .sub { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 22px; }
.auth-card label.field { display: block; margin-bottom: 15px; }
.auth-card label.field > span {
  font-size: 12.5px; font-weight: 650; letter-spacing: .005em; margin-bottom: 6px;
}
.auth-card input, .auth-card select { padding: 11px 13px; font-size: 14.5px; }
.auth-card .btn.primary {
  width: 100%; justify-content: center; margin-top: 8px; padding: 12px 18px; font-size: 14.5px;
}
.auth-alt {
  margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.auth-alt a { color: var(--link); text-decoration: none; font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }
.auth-note {
  background: color-mix(in srgb, var(--honey) 9%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--honey) 24%, transparent);
  border-radius: 9px; padding: 13px 15px; font-size: 12.5px; color: var(--muted);
  line-height: 1.55; margin-bottom: 20px;
}
.auth-note b { color: var(--text); }
.pw-hint { font-size: 11.5px; color: var(--faint); margin: -10px 0 15px; line-height: 1.5; }

@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; gap: 0; max-width: 440px; }
  .auth-pitch { display: none; }
  .auth-split .auth-card .brand-row { display: flex; }
}

/* ---- credit meter in the nav --------------------------------------------------- */
.credit {
  margin: 10px 12px 4px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .09);
}
.credit .amt { font: 600 18px/1 var(--f-head); color: #fff; }
.credit .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--nav-dim); margin-bottom: 4px; }
.credit .tier { font-size: 11.5px; color: var(--nav-text); margin-top: 5px; }
.credit .track { height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .13); margin-top: 8px; overflow: hidden; }
.credit .fill { height: 100%; background: var(--honey); }
.credit.low .amt { color: var(--honey); }
.credit.out .amt { color: #ef7070; }

/* ---- tier and usage ------------------------------------------------------------ */
.tier-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.tier-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface); }
.tier-card.current { border-color: var(--honey); box-shadow: 0 0 0 1px var(--honey) inset; }
.tier-card h4 { margin: 0 0 4px; font: 650 15px/1.2 var(--f-head); }
.tier-card .blurb { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.tier-card ul { margin: 0; padding-left: 17px; font-size: 12.5px; color: var(--muted); }
.tier-card li { margin-bottom: 3px; }
.tier-card .badge { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--honey-deep); font-weight: 700; }

.usage-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.usage-row:last-child { border-bottom: none; }
.usage-row .who { color: var(--text); }
.usage-row .what { color: var(--faint); font-size: 12px; }
.usage-row .amt { font-family: var(--f-mono); font-size: 12.5px; white-space: nowrap; }
.amt.neg { color: var(--bad); }
.amt.pos { color: var(--good); }

/* ---- jobs ---------------------------------------------------------------------- */
.job {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 10px;
  background: var(--surface);
}
.job .head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.job .head b { font: 600 14px/1.3 var(--f-head); }
.job .track { height: 5px; border-radius: 3px; background: var(--line); margin: 10px 0 7px; overflow: hidden; }
.job .fill { height: 100%; background: var(--honey); transition: width .4s ease; }
.job .msg { font-size: 12px; color: var(--muted); font-family: var(--f-mono); word-break: break-word; }
.st { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 20px; }
.st.queued { background: var(--line); color: var(--muted); }
.st.running { background: var(--honey-soft); color: var(--honey-deep); }
.st.succeeded { background: var(--good-soft); color: var(--good); }
.st.failed { background: var(--bad-soft); color: var(--bad); }
.st.cancelled { background: var(--line); color: var(--faint); }

/* ---- generated molecules ------------------------------------------------------- */
.mol-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.mol-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.mol-card .pic { background: var(--surface-2); display: grid; place-items: center; min-height: 150px; padding: 6px; }
.mol-card .pic svg { max-width: 100%; height: auto; }
.mol-card .body { padding: 10px 11px 11px; }
.mol-card .smi { font-family: var(--f-mono); font-size: 10.5px; color: var(--muted); word-break: break-all; line-height: 1.45; max-height: 44px; overflow: hidden; }
.mol-card .props { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.mol-card .sc { float: right; font: 600 12px/1 var(--f-mono); color: var(--honey-deep); }

/* ---- scoring builder ----------------------------------------------------------- */
.score-build { display: grid; gap: 9px; }
.score-item {
  display: grid;
  grid-template-columns: 22px 1fr 78px 78px 78px;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.score-item input[type=number] { width: 100%; }
.score-item .nm { font-weight: 600; }
.score-item .hint { grid-column: 2 / -1; font-size: 11.5px; color: var(--faint); margin-top: -3px; }

/* ---- misc ---------------------------------------------------------------------- */
.banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 13px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
}
.banner.info { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.banner.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 28%, transparent); }
.banner b { display: block; margin-bottom: 2px; color: inherit; }
.inline-code { font-family: var(--f-mono); font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }
.cost { font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); }
.spin-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--honey); animation: pulse 1.1s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

/* ---- primitives the alpha views rely on ---------------------------------------- */
.btn.primary {
  background: var(--honey); border-color: var(--honey); color: #1b2140; font-weight: 700;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:focus-visible {
  outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--honey) 35%, transparent);
}
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.danger:hover { background: var(--bad-soft); filter: none; }
.chip.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.chip.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.nav-group:first-of-type { padding-top: 10px; }
.stat-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; background: var(--surface); }
.stat-box .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; }
.stat-box .v { font: 650 21px/1.15 var(--f-head); margin-top: 4px; }
.stat-box .v.sm { font-size: 15px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form label.field { margin-bottom: 0; flex: 1 1 180px; }
.hitlist { display: grid; gap: 2px; }
.hit {
  display: flex; gap: 10px; align-items: baseline; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit;
}
.hit:hover { border-color: var(--honey); background: var(--surface-2); }
.hit b { font-weight: 650; }
.hit .d { color: var(--muted); font-size: 12.5px; flex: 1; }
.prose { max-width: 78ch; }
.prose h4 { font: 650 14px/1.3 var(--f-head); margin: 18px 0 6px; }
.prose p { margin: 0 0 11px; }
.prose ul { margin: 0 0 11px; padding-left: 20px; }
.cite { font-family: var(--f-mono); font-size: .85em; color: var(--link); background: var(--surface-2); padding: 0 3px; border-radius: 3px; }
.src { border-left: 2px solid var(--line-strong); padding: 8px 0 8px 12px; margin-bottom: 10px; }
.src .n { font-family: var(--f-mono); font-size: 11.5px; color: var(--link); font-weight: 600; }
.src .t { font-size: 13px; font-weight: 600; }
.src .p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
