/* ═══════════════════════════════════════════════════════════
   Liquid Glass theme — dark and light
   Every surface is driven by variables so the two themes stay
   in sync; only the token block below changes between them.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* ── dark (default) ── */
  --ink: #f6f8ff;
  --muted: #b3bcd8;
  --dim: #8b95b6;

  --low:   #4defd0;
  --mid:   #6cc4ff;
  --high:  #b9a3ff;
  --ultra: #ff8ec9;

  --page:
    radial-gradient(1200px 700px at 15% -8%, #2b3763 0%, transparent 58%),
    radial-gradient(1000px 620px at 95% 8%, #3a2a63 0%, transparent 56%),
    linear-gradient(168deg, #1d2540 0%, #141a2c 62%, #101625 100%);

  --blob-1: #5b8cff;
  --blob-2: #c07cff;
  --blob-3: #35d6c4;
  --blob-op: .6;

  --glass-a: rgba(255,255,255,.17);
  --glass-b: rgba(255,255,255,.07);
  --glass-c: rgba(255,255,255,.11);
  --glass-brd: rgba(255,255,255,.22);
  --spec-top: rgba(255,255,255,.55);
  --spec-bot: rgba(255,255,255,.16);
  --bloom: rgba(255,255,255,.07);
  --sheen-1: rgba(255,255,255,.3);
  --sheen-2: rgba(255,255,255,.14);
  --shadow: 0 20px 54px rgba(6,10,26,.42), 0 2px 10px rgba(6,10,26,.24);

  --surface: rgba(10,16,34,.34);
  --surface-brd: rgba(255,255,255,.17);
  --surface-inset: rgba(0,0,0,.22);

  --fill-1: rgba(255,255,255,.1);
  --fill-2: rgba(255,255,255,.17);
  --fill-3: rgba(255,255,255,.2);
  --brd-1: rgba(255,255,255,.16);
  --brd-2: rgba(255,255,255,.28);

  --btn-a: rgba(255,255,255,.2);
  --btn-b: rgba(255,255,255,.08);
  --btn-brd: rgba(255,255,255,.24);
  --btn-spec: rgba(255,255,255,.45);
  --primary: linear-gradient(150deg, #6d9bff, #a476ff);
  --primary-glow: rgba(109,155,255,.42);

  --edge: rgba(255,255,255,.2);
  --node-fill: rgba(255,255,255,.055);
  --n-label: rgba(255,255,255,.97);
  --n-sub: rgba(255,255,255,.62);
  --cap: rgba(255,255,255,.42);

  --pop-bg: linear-gradient(158deg, #262f52 0%, #1b2340 60%, #202949 100%);
  --pop-brd: rgba(255,255,255,.3);
  --pop-ink: #d7def4;
  --code-bg: rgba(8,14,30,.6);
  --code-ink: #b6e5ff;
  --code-brd: rgba(255,255,255,.12);

  --why-bg: rgba(108,196,255,.16);
  --why-brd: rgba(108,196,255,.34);
  --why-ink: #cbd8f2;
  --answer-ink: #dfe5f6;
  --metric-bg: rgba(255,255,255,.09);

  --ok: #4defd0;
  --no: #ff6b81;

  --r: 26px;
}

:root[data-theme="light"] {
  --ink: #182036;
  --muted: #55618a;
  --dim: #7e89ab;

  /* deepened so the ramp keeps its contrast against white glass */
  --low:   #00a98f;
  --mid:   #1f7fe0;
  --high:  #7a52e1;
  --ultra: #d94b93;

  --page:
    radial-gradient(1200px 700px at 12% -10%, #cfe0ff 0%, transparent 60%),
    radial-gradient(1000px 640px at 96% 4%, #e6d5ff 0%, transparent 58%),
    radial-gradient(900px 600px at 45% 108%, #cdf5ee 0%, transparent 60%),
    linear-gradient(168deg, #f4f7ff 0%, #eaf0fc 58%, #e3eaf8 100%);

  --blob-1: #8fb4ff;
  --blob-2: #d5b0ff;
  --blob-3: #7fe6d6;
  --blob-op: .5;

  --glass-a: rgba(255,255,255,.78);
  --glass-b: rgba(255,255,255,.42);
  --glass-c: rgba(255,255,255,.6);
  --glass-brd: rgba(255,255,255,.9);
  --spec-top: rgba(255,255,255,1);
  --spec-bot: rgba(255,255,255,.6);
  --bloom: rgba(255,255,255,.5);
  --sheen-1: rgba(255,255,255,.75);
  --sheen-2: rgba(255,255,255,.4);
  --shadow: 0 18px 44px rgba(72,96,158,.16), 0 2px 10px rgba(72,96,158,.1);

  --surface: rgba(255,255,255,.72);
  --surface-brd: rgba(120,140,190,.28);
  --surface-inset: rgba(90,110,160,.12);

  --fill-1: rgba(255,255,255,.6);
  --fill-2: rgba(255,255,255,.85);
  --fill-3: rgba(255,255,255,.7);
  --brd-1: rgba(120,140,190,.26);
  --brd-2: rgba(120,140,190,.42);

  --btn-a: rgba(255,255,255,.9);
  --btn-b: rgba(255,255,255,.55);
  --btn-brd: rgba(120,140,190,.3);
  --btn-spec: rgba(255,255,255,1);
  --primary: linear-gradient(150deg, #3f7dee, #8250e8);
  --primary-glow: rgba(63,125,238,.3);

  --edge: rgba(60,80,130,.24);
  --node-fill: rgba(255,255,255,.82);
  --n-label: #1b2340;
  --n-sub: rgba(40,55,95,.62);
  --cap: rgba(40,55,95,.45);

  --pop-bg: linear-gradient(158deg, #ffffff 0%, #f4f7ff 60%, #eef3ff 100%);
  --pop-brd: rgba(120,140,190,.36);
  --pop-ink: #2f3a58;
  --code-bg: rgba(232,239,252,.9);
  --code-ink: #14548f;
  --code-brd: rgba(120,140,190,.26);

  --why-bg: rgba(31,127,224,.09);
  --why-brd: rgba(31,127,224,.26);
  --why-ink: #2c4570;
  --answer-ink: #26304a;
  --metric-bg: rgba(255,255,255,.62);

  --ok: #00a17f;
  --no: #e0384f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--page);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: color .3s;
}

/* ── ambient light behind the glass ─────────────────────── */
.aurora { position: fixed; inset: -28%; z-index: 0; filter: blur(120px); opacity: var(--blob-op); pointer-events: none; }
.blob { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: drift 30s ease-in-out infinite; }
:root[data-theme="light"] .blob { mix-blend-mode: multiply; }
.b1 { width: 46vmax; height: 46vmax; top: -4%; left: 0;    background: radial-gradient(circle at 35% 35%, var(--blob-1), transparent 66%); }
.b2 { width: 40vmax; height: 40vmax; top: 24%; right: -4%; background: radial-gradient(circle at 65% 40%, var(--blob-2), transparent 66%); animation-duration: 37s; animation-direction: reverse; }
.b3 { width: 36vmax; height: 36vmax; bottom: -6%; left: 36%; background: radial-gradient(circle at 50% 60%, var(--blob-3), transparent 66%); animation-duration: 44s; animation-delay: -9s; }
@keyframes drift {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(5vw,-3vh) scale(1.1); }
  66%      { transform: translate(-4vw,4vh) scale(.92); }
}

/* ── the glass primitive ────────────────────────────────── */
.lg {
  position: relative;
  border-radius: var(--r);
  background: linear-gradient(158deg, var(--glass-a) 0%, var(--glass-b) 46%, var(--glass-c) 100%);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border: 1px solid var(--glass-brd);
  box-shadow:
    var(--shadow),
    inset 0 1px 1px var(--spec-top),
    inset 0 -1px 1px var(--spec-bot),
    inset 0 0 60px var(--bloom);
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.lg::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(120% 80% at 12% -10%, var(--sheen-1), transparent 55%),
    radial-gradient(90% 60% at 100% 108%, var(--sheen-2), transparent 60%);
}

/* ── header ─────────────────────────────────────────────── */
.topbar {
  position: relative; z-index: 3;
  margin: 20px 22px 0; padding: 17px 26px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.logo { width: 42px; height: 42px; flex-shrink: 0; display: block; }
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.topbar p { font-size: 12px; color: var(--muted); }

.head-right { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; position: relative; z-index: 1; }
.stats { display: flex; gap: 24px; }
.stat { text-align: right; }
.stat span { display: block; font-family: "JetBrains Mono", monospace; font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.stat label { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.stat.accent span { color: var(--low); }

/* theme switch */
.theme-btn {
  width: 38px; height: 38px; flex-shrink: 0; cursor: pointer;
  display: grid; place-items: center; border-radius: 13px;
  background: var(--fill-1); border: 1px solid var(--brd-1);
  box-shadow: inset 0 1px 1px var(--spec-top);
  color: var(--ink); transition: all .18s;
}
.theme-btn:hover { background: var(--fill-2); transform: translateY(-1px); }
.theme-btn svg { width: 17px; height: 17px; }
.theme-btn .sun { display: none; }
:root[data-theme="light"] .theme-btn .sun { display: block; }
:root[data-theme="light"] .theme-btn .moon { display: none; }

/* ── free-quota gauge ───────────────────────────────────── */
.quota {
  position: relative; z-index: 1;
  min-width: 208px; padding: 9px 13px 10px; border-radius: 16px;
  background: var(--fill-1); border: 1px solid var(--brd-1);
  box-shadow: inset 0 1px 1px var(--spec-top);
}
.quota-top, .quota-bot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.quota-title { font-size: 9.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.quota-pct { font-family: "JetBrains Mono", monospace; font-size: 15px; font-weight: 500; color: var(--low); }
.gauge {
  height: 7px; margin: 6px 0 5px; border-radius: 999px; overflow: hidden;
  background: var(--surface-inset); box-shadow: inset 0 1px 2px rgba(0,0,0,.2);
}
.gauge-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--low), var(--mid));
  transition: width .7s cubic-bezier(.22,1,.36,1), background .5s;
}
.gauge-fill.warn { background: linear-gradient(90deg, #f5b301, #ff9838); }
.gauge-fill.crit { background: linear-gradient(90deg, #ff8fae, var(--ultra)); }
.quota-bot { font-family: "JetBrains Mono", monospace; font-size: 9.5px; color: var(--dim); }
.quota-reset { white-space: nowrap; }
.quota.est .quota-title::after { content: " · est"; color: #e0a106; }

/* ── layout ─────────────────────────────────────────────── */
main {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 360px minmax(0,1fr);
  gap: 18px; padding: 18px 22px 26px; align-items: start;
}
.col-left, .col-right { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.panel { padding: 19px 21px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; position: relative; z-index: 1; }
.panel-head h2 { font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.hint { font-size: 11px; color: var(--dim); font-family: "JetBrains Mono", monospace; }

/* ── input ──────────────────────────────────────────────── */
textarea {
  position: relative; z-index: 1;
  width: 100%; padding: 13px 15px; min-height: 108px; resize: vertical;
  font: inherit; line-height: 1.6; color: var(--ink);
  background: var(--surface); border: 1px solid var(--surface-brd); border-radius: 15px;
  outline: none; transition: border-color .2s, box-shadow .2s, background .3s;
  box-shadow: inset 0 1px 2px var(--surface-inset);
}
textarea::placeholder { color: var(--dim); }
textarea:focus {
  border-color: var(--mid);
  box-shadow: inset 0 1px 2px var(--surface-inset), 0 0 0 3px color-mix(in srgb, var(--mid) 22%, transparent);
}

.row { display: flex; gap: 9px; margin-top: 11px; position: relative; z-index: 1; }
.btn {
  flex: 1; padding: 11px 16px; font: inherit; font-weight: 600; font-size: 13px;
  border-radius: 14px; cursor: pointer; text-align: center; color: var(--ink);
  background: linear-gradient(160deg, var(--btn-a), var(--btn-b));
  border: 1px solid var(--btn-brd);
  box-shadow: inset 0 1px 1px var(--btn-spec);
  transition: all .18s;
}
.btn.ghost { flex: 0 0 auto; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); filter: brightness(1.06); transform: translateY(-1px); }
.btn.primary {
  background: var(--primary); border-color: transparent; color: #fff;
  box-shadow: 0 8px 26px var(--primary-glow), inset 0 1px 1px rgba(255,255,255,.5);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn.primary:disabled { opacity: .55; cursor: default; box-shadow: none; }
.btn.primary.busy .btn-label::after {
  content: ""; display: inline-block; width: 11px; height: 11px; margin-left: 8px; vertical-align: -1px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.samples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; position: relative; z-index: 1; }
.samples button {
  padding: 5px 12px; font: inherit; font-size: 11.5px; color: var(--muted); cursor: pointer;
  background: var(--fill-1); border: 1px solid var(--brd-1);
  border-radius: 999px; transition: all .16s;
}
.samples button:hover { color: var(--mid); border-color: var(--mid); background: var(--fill-2); }

.img-preview { position: relative; margin-top: 11px; z-index: 1; }
.img-preview img { width: 100%; max-height: 150px; object-fit: cover; border-radius: 14px; border: 1px solid var(--brd-1); }
.img-preview button {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; cursor: pointer;
  background: rgba(0,0,0,.62); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 9px; font-size: 12px; backdrop-filter: blur(8px);
}

/* ── history ────────────────────────────────────────────── */
.mini { font: inherit; font-size: 11px; color: var(--dim); background: none; border: none; cursor: pointer; padding: 3px 8px; border-radius: 7px; }
.mini:hover { color: var(--ultra); background: var(--fill-1); }

.history { list-style: none; display: flex; flex-direction: column; gap: 7px; max-height: 330px; overflow-y: auto; position: relative; z-index: 1; }
.history::-webkit-scrollbar, .answer::-webkit-scrollbar { width: 5px; }
.history::-webkit-scrollbar-thumb, .answer::-webkit-scrollbar-thumb { background: var(--brd-2); border-radius: 3px; }

.history li {
  padding: 9px 12px; border-radius: 14px; cursor: pointer; display: flex; gap: 10px; align-items: stretch;
  background: var(--fill-1); border: 1px solid var(--brd-1); transition: all .17s;
}
.history li:hover { background: var(--fill-2); border-color: var(--brd-2); transform: translateX(2px); }
.history li.on { border-color: currentColor; background: var(--fill-3); box-shadow: inset 0 1px 1px var(--spec-top); }
.history .bar { width: 3px; border-radius: 2px; background: currentColor; flex-shrink: 0; }
.history .txt { flex: 1; min-width: 0; }
.history .q { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history .meta { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--dim); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { font-size: 12px; color: var(--dim); text-align: center; padding: 26px 0; line-height: 1.7; }

/* ── graph ──────────────────────────────────────────────── */
.viz-panel { padding-bottom: 11px; }
.legend { display: flex; gap: 11px; flex-wrap: wrap; }
.lg-dot { font-size: 10px; font-weight: 600; letter-spacing: .07em; display: flex; align-items: center; gap: 5px; color: var(--dim); }
.lg-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lg-dot.low { color: var(--low); } .lg-dot.mid { color: var(--mid); }
.lg-dot.high { color: var(--high); } .lg-dot.ultra { color: var(--ultra); }

/* overflow-y must stay visible or node tooltips get clipped;
   the tooltip itself is position:fixed on <body> for the same reason */
.viz-wrap { position: relative; width: 100%; overflow-x: auto; overflow-y: visible; z-index: 1; }
.viz-wrap::-webkit-scrollbar { height: 5px; }
.viz-wrap::-webkit-scrollbar-thumb { background: var(--brd-2); border-radius: 3px; }
#graph { width: 100%; min-width: 780px; height: auto; display: block; }

.tooltip {
  position: fixed; z-index: 60; pointer-events: none; max-width: 270px;
  padding: 9px 12px; font-size: 11.5px; line-height: 1.55; color: var(--ink);
  background: var(--pop-bg); border: 1px solid var(--pop-brd); border-radius: 13px;
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow: var(--shadow), inset 0 1px 1px var(--spec-top);
  transform: translate(-50%, -100%);
}
.tooltip.below { transform: translate(-50%, 0); }
.tooltip b { color: var(--ink); }
.tooltip .k { color: var(--dim); font-family: "JetBrains Mono", monospace; font-size: 10.5px; }
.tooltip .blocked-note { color: var(--no); display: block; margin-bottom: 4px; }

/* ── stage help ─────────────────────────────────────────── */
.help-ring { fill: var(--fill-1); stroke: var(--brd-2); stroke-width: .9; pointer-events: none; transition: fill .18s, stroke .18s; }
.help-q { font-size: 8.5px; font-weight: 700; fill: var(--muted); pointer-events: none; }
.cap-group:hover .help-ring { fill: color-mix(in srgb, var(--mid) 34%, transparent); stroke: var(--mid); }
.cap-group:hover .help-q { fill: var(--mid); }

.help-pop {
  position: absolute; z-index: 30; width: min(430px, calc(100% - 16px));
  padding: 15px 17px 16px; border-radius: 18px;
  background: var(--pop-bg); border: 1px solid var(--pop-brd);
  backdrop-filter: blur(40px) saturate(200%);
  box-shadow: var(--shadow), 0 0 0 1px rgba(0,0,0,.08), inset 0 1px 1px var(--spec-top);
  animation: popIn .18s cubic-bezier(.22,1,.36,1);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.help-pop h3 { font-size: 13px; font-weight: 700; margin-bottom: 8px; padding-right: 22px; letter-spacing: -.01em; }
.help-body { font-size: 12px; line-height: 1.68; color: var(--pop-ink); }
.help-body b { display: block; margin-top: 8px; color: var(--ink); font-weight: 600; font-size: 11.5px; }
.help-body code {
  display: block; margin: 5px 0; padding: 6px 9px;
  font-family: "JetBrains Mono", monospace; font-size: 10.5px; line-height: 1.5;
  color: var(--code-ink); background: var(--code-bg);
  border: 1px solid var(--code-brd); border-radius: 9px;
  white-space: pre-wrap; word-break: break-word;
}
.help-body .o { color: var(--ok); font-weight: 700; }
.help-body .x { color: var(--no); font-weight: 700; }
.help-close {
  position: absolute; top: 11px; right: 12px; width: 22px; height: 22px; cursor: pointer;
  font-size: 11px; color: var(--muted); background: var(--fill-1);
  border: 1px solid var(--brd-1); border-radius: 7px; line-height: 1;
}
.help-close:hover { color: var(--ink); background: var(--fill-2); }

/* availability marks */
.avail { font-size: 9px; font-weight: 700; }
.avail.o { fill: var(--ok); }
.avail.x { fill: var(--no); }
.node.blocked { opacity: .48; }
.node.blocked:hover { opacity: .9; }

.replay-tag {
  position: absolute; top: 4px; right: 6px; z-index: 5;
  padding: 4px 12px; font-size: 10.5px; font-weight: 600; letter-spacing: .05em;
  color: #d98a00; background: rgba(240,180,60,.16);
  border: 1px solid rgba(240,180,60,.4); border-radius: 999px; backdrop-filter: blur(10px);
}

.edge { fill: none; stroke: var(--edge); stroke-width: 1; transition: stroke .35s, stroke-width .35s, opacity .35s; }
.edge.on { stroke-width: 1.9; }
.edge.off { opacity: .2; }
.pulse { fill: none; stroke-linecap: round; opacity: 0; }
.pulse.run { animation: flow 1.05s cubic-bezier(.4,0,.5,1) forwards; }
@keyframes flow {
  0%   { opacity: 0; stroke-dashoffset: var(--len); }
  18%  { opacity: 1; }
  100% { opacity: 0; stroke-dashoffset: 0; }
}

.node-body { fill: var(--node-fill); transition: fill .3s, stroke .3s, stroke-width .18s, opacity .35s; }
.node { cursor: pointer; }
.node.off { opacity: .24; }
.node.on .node-body { filter: url(#glow); }
.node text { font-family: "Inter", sans-serif; pointer-events: none; user-select: none; }
.n-label { font-size: 10px; font-weight: 600; fill: var(--n-label); transition: fill .18s; }
.n-sub { font-family: "JetBrains Mono", monospace; font-size: 8px; fill: var(--n-sub); }
.layer-cap { font-size: 8.5px; font-weight: 700; letter-spacing: .15em; fill: var(--cap); text-transform: uppercase; }

/* hover feedback — the node group carries its tier colour as `color` */
.node:hover .node-body {
  stroke-width: 2.4;
  filter: drop-shadow(0 0 7px currentColor);
}
.node:hover .n-label { fill: currentColor; }

/* ── result ─────────────────────────────────────────────── */
.verdict { display: flex; align-items: center; gap: 9px; }
.tier-chip {
  padding: 3px 11px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  border: 1px solid currentColor; background: var(--fill-1);
}
.verdict code {
  font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--ink);
  background: var(--surface); padding: 3px 10px; border-radius: 9px; border: 1px solid var(--brd-1);
}

.metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(86px,1fr));
  gap: 1px; margin-bottom: 14px; position: relative; z-index: 1;
  background: var(--brd-1); border: 1px solid var(--brd-1);
  border-radius: 16px; overflow: hidden;
}
.m { padding: 10px 12px; background: var(--metric-bg); cursor: help; }
.m label { display: block; font-size: 9.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.m label em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--low); opacity: .9; }
.m span { font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 500; }
.m.saved span { color: var(--low); }

.why {
  position: relative; z-index: 1;
  margin-bottom: 13px; padding: 11px 14px; border-radius: 15px; font-size: 12px; color: var(--why-ink);
  background: var(--why-bg); border: 1px solid var(--why-brd);
}
.why b { color: var(--ink); font-weight: 600; }
.why ul { margin: 6px 0 0; padding-left: 18px; }
.why li { margin-top: 2px; }

.answer {
  position: relative; z-index: 1;
  font-size: 13.5px; line-height: 1.75; color: var(--answer-ink); white-space: pre-wrap; word-break: break-word;
  max-height: 300px; overflow-y: auto; padding-right: 4px;
}
.answer.placeholder { color: var(--dim); font-size: 12.5px; }

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 1080px) {
  main { grid-template-columns: 1fr; }
  .col-left { order: 2; }
  .col-right { order: 1; }
  .history { max-height: 250px; }
}
@media (max-width: 620px) {
  :root { --r: 22px; }
  .topbar { margin: 12px 12px 0; padding: 14px 17px; }
  main { padding: 12px; gap: 12px; }
  .panel { padding: 16px 17px; }
  .stats { gap: 16px; }
  .stat { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
  .pulse.run { animation-duration: .01s; }
}
