/* LR-AI web. Colors and type follow the Claude Design file (LR-AI.html) and the exported spreadsheet. */
:root {
  --bg: #F6F7F9; --surface: #fff; --ink: #1d2733; --muted: #5d6b7a; --line: #dde2e9;
  --primary: #3C5A82; --onprimary: #fff; --group: #DFE8F3; --group2: #eef3f9; --hdr: #263238; --err: #FFF2CC;
  --core: #D8EFD3; --coreT: #1C5E21; --skim: #FFF2CC; --skimT: #7A5405;
  --hi: #F4C7C3; --hiT: #6b1f19; --med: #FCE8B2; --medT: #5c4306; --low: #E8EAED; --lowT: #3c4350;
  --danger: #b3261e; --ok: #2e7d32;
  --primary-h: #33507a; --ring: rgba(60, 90, 130, .35); --accent: #14b8a6;
  --top-bg: rgba(255, 255, 255, .78); --top-ink: #1d2733; --top-mute: rgba(29, 39, 51, .66); --top-hover: rgba(29, 39, 51, .06);
  --top-on: rgba(60, 90, 130, .12); --top-line: rgba(29, 39, 51, .14);
  --net-node: #7f9fd0; --net-line: #9db5da; --net-halo: .16; --net-line-a: .55; --net-dot-a: .75;
  --net-wash: radial-gradient(70% 55% at 50% 0%, rgba(127, 163, 209, .28), transparent 70%),
    radial-gradient(45% 45% at 100% 85%, rgba(20, 184, 166, .12), transparent 70%),
    radial-gradient(40% 40% at 0% 70%, rgba(127, 163, 209, .14), transparent 70%);
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .08);
  /* spacing scale: 4 8 12 16 24 32 48 64 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12171c; --surface: #1b2229; --ink: #e6ebf0; --muted: #9aa8b6; --line: #2f3a45;
    --primary: #7fa3d1; --onprimary: #10202f; --group: #25364d; --group2: #1f2c3d; --hdr: #0d1216; --err: #3d3413;
    --core: #1f3d22; --coreT: #a9dda3; --skim: #4a3d12; --skimT: #f2d27a;
    --hi: #5a2b28; --hiT: #f6c9c5; --med: #51401a; --medT: #f5dc9d; --low: #2f353d; --lowT: #c3cad3;
    --danger: #f2b8b5; --ok: #81c784;
    --primary-h: #93b3db; --ring: rgba(127, 163, 209, .4); --accent: #5eead4;
    --net-node: #7fa3d1; --net-line: #7fa3d1; --net-halo: .12; --net-line-a: .35; --net-dot-a: 1;
    --top-bg: rgba(13, 18, 22, .82); --top-ink: #fff; --top-mute: rgba(255, 255, 255, .78); --top-hover: rgba(255, 255, 255, .08);
    --top-on: rgba(255, 255, 255, .14); --top-line: rgba(255, 255, 255, .18);
    --net-wash: radial-gradient(60% 50% at 50% 35%, rgba(127, 163, 209, .16), transparent 70%), radial-gradient(40% 40% at 85% 80%, rgba(94, 234, 212, .08), transparent 70%);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12171c; --surface: #1b2229; --ink: #e6ebf0; --muted: #9aa8b6; --line: #2f3a45;
  --primary: #7fa3d1; --onprimary: #10202f; --group: #25364d; --group2: #1f2c3d; --hdr: #0d1216; --err: #3d3413;
  --core: #1f3d22; --coreT: #a9dda3; --skim: #4a3d12; --skimT: #f2d27a;
  --hi: #5a2b28; --hiT: #f6c9c5; --med: #51401a; --medT: #f5dc9d; --low: #2f353d; --lowT: #c3cad3;
  --danger: #f2b8b5; --ok: #81c784;
  --primary-h: #93b3db; --ring: rgba(127, 163, 209, .4); --accent: #5eead4;
  --net-node: #7fa3d1; --net-line: #7fa3d1; --net-halo: .12; --net-line-a: .35; --net-dot-a: 1;
  --top-bg: rgba(13, 18, 22, .82); --top-ink: #fff; --top-mute: rgba(255, 255, 255, .78); --top-hover: rgba(255, 255, 255, .08);
  --top-on: rgba(255, 255, 255, .14); --top-line: rgba(255, 255, 255, .18);
  --net-wash: radial-gradient(60% 50% at 50% 35%, rgba(127, 163, 209, .16), transparent 70%), radial-gradient(40% 40% at 85% 80%, rgba(94, 234, 212, .08), transparent 70%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* also on elements a class gives a display */
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); min-height: 100vh;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.5;
}
a { color: var(--primary); }
a:hover { text-decoration: none; }
.serif, h1, h2 { font-family: 'Source Serif 4', Georgia, serif; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
#app:focus { outline: none; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { font-size: 12.5px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: var(--top-bg); color: var(--top-ink); border-bottom: 1px solid var(--top-line);
  -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px); padding: 10px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--top-ink); text-decoration: none; font-weight: 600; font-size: 18px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.nav a { color: var(--top-mute); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: 14px; transition: background .15s, color .15s; }
.nav a:hover { color: var(--top-ink); background: var(--top-hover); }
.nav a.on { color: var(--top-ink); background: var(--top-on); }
.theme-btn { background: transparent; border: 1px solid var(--top-line); color: var(--top-ink); border-radius: 6px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.account { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.account:empty { display: none; }
.nav[hidden] + .account { margin-left: auto; } /* signed out: no menu, so push Sign in to the right */
.account .who { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.acct-btn { display: inline-flex; align-items: center; height: 34px; background: var(--top-hover); border: 1px solid var(--top-line); color: var(--top-ink); border-radius: 8px; padding: 0 14px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background .15s; }
.acct-btn:hover { background: var(--top-on); }
/* Google's sign-in button: white with the four-colour G, in both themes */
.gbtn { display: inline-flex; align-items: center; gap: 12px; padding: 12px 22px; border-radius: 10px; transition: background .15s; border: 1px solid #747775; background: #fff; color: #1f1f1f; font: inherit; font-size: 17px; font-weight: 500; text-decoration: none; }
.gbtn:hover { background: #f2f4f7; }
.gbtn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* pages */
.page { margin: 0 auto; padding: 40px 20px 64px; }
.w760 { max-width: 760px; } .w860 { max-width: 860px; } .w960 { max-width: 960px; } .w1280 { max-width: 1280px; }
.page.has-bar { padding-bottom: 150px; }
h1.title { font-size: 32px; margin: 0 0 6px; font-weight: 600; }
.lead { color: var(--muted); margin: 0 0 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: var(--s5); }
.card + .card, .card + .notice, .notice + .card { margin-top: 16px; }
.card h3 { margin: 0 0 4px; font-size: 17px; }
.card .desc { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.empty { text-align: center; padding: 40px 22px; }
.empty h2 { margin: 0 0 6px; font-size: 24px; }

/* buttons: one shape (rounded), three sizes. .btn is the main action, .btn-ghost the secondary one,
   .btn-danger deletes, .btn-link is text only. A waiting button gets .busy (a spinner). */
.btn, .btn-ghost, .btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: 44px; padding: 0 20px;
  border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 15px; font-weight: 600; line-height: 1; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s; }
.btn { background: var(--primary); color: var(--onprimary); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.btn:hover { background: var(--primary-h); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-ghost.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--hi); }
.btn:active, .btn-ghost:active, .btn-danger:active { transform: scale(.98); }
.btn:focus-visible, .btn-ghost:focus-visible, .btn-danger:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn:disabled, .btn-ghost:disabled, .btn-danger:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.lg { height: 52px; padding: 0 28px; font-size: 16px; border-radius: 12px; }
.btn.md { height: 48px; padding: 0 24px; font-size: 16px; }
.btn.sm, .btn-ghost.sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.busy::before { content: ""; width: 15px; height: 15px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.busy, .btn-ghost.busy { opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-link { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-underline-offset: 3px; }
.btn-link:hover { text-decoration: underline; }
.pill { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 20px; padding: 5px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.pill.on { background: var(--primary); color: var(--onprimary); border-color: var(--primary); }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; min-width: 36px; height: 36px; cursor: pointer; font: inherit; transition: color .15s, border-color .15s; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }

/* forms */
.form { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; align-content: start; }
.field > .label { font-weight: 600; }
.field.sub-label > .label { font-weight: 500; }
.opt { font-weight: 400; color: var(--muted); }
.req { color: var(--primary); }
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
textarea.input { resize: vertical; }
.input.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 16px; }
.years { display: flex; gap: 8px; align-items: center; }
.checks { display: flex; flex-wrap: wrap; gap: 12px; font-size: 14px; }
.checks label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.toggle-box { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; background: var(--group2); padding: 12px 14px; border-radius: 8px; cursor: pointer; }
.toggle-box input { margin-top: 4px; }
.adv { border-top: 1px solid var(--line); padding-top: 14px; }
.help { border-bottom: 1px dotted var(--muted); cursor: help; color: var(--muted); }
.status-line { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.status-line.good { color: var(--coreT); }
.status-line.bad { color: var(--danger); }

/* connect */
.models { display: grid; gap: 10px; }
.model { cursor: pointer; display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--line); border-radius: 8px; padding: 12px 14px; background: transparent; text-align: left; width: 100%; font: inherit; color: inherit; }
.model.on { border-color: var(--primary); background: var(--group2); }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--primary); margin-top: 3px; display: grid; place-items: center; flex: none; }
.radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.model.on .radio::after { background: var(--primary); }
.model .body { flex: 1; min-width: 0; }
.model .name { font-weight: 600; }
.model .tier { font-weight: 400; color: var(--muted); font-size: 13px; }
.model .tier.free { color: var(--coreT); font-weight: 600; }
.trial-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.free-head { margin-top: 10px; }
.free-head h4 { margin: 0 0 4px; font-size: 15px; }
.free-head p { margin: 0; }
.model .note { color: var(--muted); font-size: 14px; }
.model .custom { margin-top: 8px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* sticky estimate bar */
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(16, 24, 40, .08); padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: center; z-index: 5; }
.bar .stats { display: flex; gap: 24px; flex-wrap: wrap; }
.bar .k { font-size: 12px; color: var(--muted); }
.bar .v { font-weight: 600; font-size: 18px; }
.bar .s { font-size: 12px; color: var(--muted); }
.bar .err { flex-basis: 100%; text-align: center; color: var(--danger); font-size: 14px; }

/* notices */
.notice { background: var(--err); color: var(--skimT); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.notice.error { background: var(--hi); color: var(--hiT); }
.notice.info { background: var(--group2); color: var(--ink); }
.notice.good { background: var(--core); color: var(--coreT); }

/* progress */
.run-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.run-head .kicker { font-size: 13px; color: var(--muted); }
.run-head h1 { font-size: 26px; margin: 2px 0 4px; max-width: 560px; font-weight: 600; }
.run-head .meta { font-size: 14px; color: var(--muted); }
.steps { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 20px; }
.step { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; border: 2px solid var(--line); color: var(--muted); flex: none; }
.step.done .mark { background: var(--primary); color: var(--onprimary); border-color: var(--primary); }
.step.active .mark, .step.waiting .mark { background: var(--group); color: var(--primary); border-color: var(--primary); }
.step.stopped .mark { border-color: var(--danger); color: var(--danger); }
.step.skipped .mark { border-style: dashed; }
.step .body { flex: 1; min-width: 0; }
.step .top-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; }
.step .name { font-weight: 600; }
.step.pending .name { color: var(--muted); }
.step .state { font-size: 13px; color: var(--muted); }
.step .line { font-size: 14px; color: var(--muted); }
.meter { height: 5px; background: var(--line); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--primary); transition: width .4s; }
.meter.indet > div { width: 30%; animation: indet 1.4s infinite ease-in-out; }
@keyframes indet { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .meter.indet > div { animation: none; width: 100%; opacity: .5; } .meter > div { transition: none; } }
.approval { margin-top: 12px; border: 2px solid var(--primary); border-radius: 10px; padding: 16px; background: var(--group2); }
.approval .head { font-weight: 600; margin-bottom: 2px; }
.approval .intro { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.approval .input { background: var(--surface); }
.approval .section { font-size: 12.5px; font-weight: 600; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.approval .section:first-of-type { margin-top: 0; }
.approval details { margin-top: 12px; }
.approval summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 14px; }
.list-edit { display: grid; gap: 8px; }
.edit-row { display: flex; gap: 6px; align-items: center; }
.edit-row .input { flex: 1; }
.unsure { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.unsure .what { flex: 1 1 220px; min-width: 0; }
.unsure .t { font-size: 14px; font-weight: 500; }
.unsure .r { font-size: 13px; color: var(--muted); }
.unsure select { width: auto; padding: 6px 8px; }
.cat-edit { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; }
.cat-edit > .input { font-weight: 600; }
.cat-edit .kids { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-edit .kids .input { width: auto; flex: 1 1 160px; padding: 6px 10px; font-size: 14px; }
.approval .go { margin-top: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.log { margin-top: 16px; background: var(--hdr); color: #cfd8dc; border-radius: 10px; padding: 14px 16px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.7; max-height: 280px; overflow-y: auto; }
.log .h { color: #90a4ae; margin-bottom: 4px; font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; }
.log .ts { color: #90a4ae; margin-right: 10px; }
.cost-line { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.cost-line b { color: var(--ink); }

/* results */
.res-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.res-head h1 { font-size: 28px; margin: 2px 0 4px; max-width: 720px; font-weight: 600; }
.prisma-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 20px; }
.prisma-card .t { font-weight: 600; margin-bottom: 10px; }
.prisma { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.prisma .cell { display: flex; align-items: center; gap: 8px; flex: 1 1 150px; }
.prisma .box { flex: 1; border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: 6px; padding: 8px 12px; background: var(--bg); align-self: stretch; }
.prisma .box.final { border-top-color: var(--ok); }
.prisma .n { font-size: 24px; font-weight: 600; font-family: 'Source Serif 4', serif; }
.prisma .l { font-size: 13px; font-weight: 500; }
.prisma .s { font-size: 12px; color: var(--muted); }
.prisma .arrow { color: var(--muted); font-size: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-items: center; }
.filters .search { flex: 1 1 240px; background: var(--surface); }
.filters select { width: auto; background: var(--surface); padding: 8px 10px; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.table { min-width: 1080px; font-size: 14px; }
.tr { display: grid; grid-template-columns: minmax(260px, 2.2fr) 230px 84px 56px 130px 80px minmax(220px, 2fr); }
.thead { background: var(--hdr); color: #fff; font-weight: 600; font-size: 13px; }
.thead > div, .trow > div { padding: 9px 12px; }
.trow { border-top: 1px solid var(--line); cursor: pointer; width: 100%; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; font: inherit; color: inherit; }
.trow:hover, .trow.sel { background: var(--group2); }
.trow .t { padding-left: 28px !important; font-weight: 500; }
.trow .a { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.trow .r { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.trow .v { color: var(--muted); }
.trow .sm { color: var(--muted); font-size: 13.5px; }
.cat { background: var(--group); padding: 8px 12px; font-weight: 600; border-top: 1px solid var(--line); }
.cat .c { font-weight: 400; color: var(--muted); font-size: 13px; }
.subcat { background: var(--group2); padding: 6px 12px 6px 28px; font-weight: 500; font-size: 13.5px; border-top: 1px solid var(--line); }
.no-rows { padding: 32px; text-align: center; color: var(--muted); }
.badge { border-radius: 4px; padding: 1px 8px; font-size: 12.5px; display: inline-block; }
.badge.core { background: var(--core); color: var(--coreT); font-weight: 600; }
.badge.skim { background: var(--skim); color: var(--skimT); font-weight: 600; }
.badge.exclude { background: var(--hi); color: var(--hiT); font-weight: 600; }
.badge.high { background: var(--hi); color: var(--hiT); }
.badge.medium { background: var(--med); color: var(--medT); }
.badge.low { background: var(--low); color: var(--lowT); }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface); border-left: 1px solid var(--line); z-index: 21; overflow-y: auto; padding: 22px; box-shadow: -8px 0 24px rgba(0,0,0,.2); }
.panel h2 { font-size: 22px; line-height: 1.25; margin: 12px 0 6px; font-weight: 600; }
.panel h4 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.panel p { margin: 0 0 16px; }
.panel .why { background: var(--group2); padding: 10px 12px; border-radius: 8px; }
.panel .links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.close { background: none; border: 0; color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px; margin: -10px -10px 0 0; }

/* my reviews */
.reviews { display: grid; gap: 10px; }
.review-row { display: flex; gap: 8px; align-items: stretch; }
.review-row .open { flex: 1; text-decoration: none; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; align-items: center; text-align: left; font: inherit; color: inherit; }
.review-row .open { transition: border-color .15s, box-shadow .15s, transform .15s; }
.review-row .open:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.review-row .topic { grid-column: span 2; min-width: 0; }
.review-row .topic b { display: block; }
.status-pill { border-radius: 20px; padding: 2px 12px; font-size: 13px; font-weight: 500; display: inline-block; }
.st-complete { background: var(--core); color: var(--coreT); }
.st-waiting { background: var(--skim); color: var(--skimT); }
.st-running, .st-queued { background: var(--group); color: var(--primary); }
.st-cancelled, .st-expired { background: var(--low); color: var(--lowT); }
.st-failed, .st-stopped { background: var(--hi); color: var(--hiT); }

/* home */
.hero { position: relative; max-width: 980px; margin: 0 auto; min-height: calc(100vh - 140px); padding: var(--s8) 20px var(--s7); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.hero h1 { font-weight: 600; font-size: clamp(36px, 6.2vw, 68px); line-height: 1.06; margin: 0 0 22px; letter-spacing: -.015em;
  background: linear-gradient(120deg, var(--ink) 30%, var(--primary) 70%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { max-width: 640px; margin: 0 auto 32px; color: var(--muted); font-size: 19px; }
.hero .actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s3); margin: 0; }
.hero .trust { justify-content: center; }
.hero .hero-media { width: 100%; max-width: 860px; aspect-ratio: 16 / 9; margin-top: var(--s7); }
/* the landing page's background: a citation network on a canvas behind everything */
.net-bg { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 42% 34% at 50% 36%, rgba(0, 0, 0, .4), #000 100%);
  mask-image: radial-gradient(ellipse 42% 34% at 50% 36%, rgba(0, 0, 0, .4), #000 100%); }
.net-glow { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--net-wash); }
.home { position: relative; z-index: 1; }
.home .how .card, .home .table-wrap { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); }
.motion-btn { position: fixed; right: 16px; bottom: 16px; z-index: 5; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--muted); font-size: 11px; cursor: pointer; backdrop-filter: blur(6px); transition: color .15s, border-color .15s; }
.motion-btn:hover { color: var(--ink); border-color: var(--primary); }
.motion-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.trust { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--muted); }
.trust li::before { content: "✓ "; color: var(--primary); font-weight: 700; }
.trust a { color: inherit; }
/* the short video, once there is one */
.hero-media { position: relative; aspect-ratio: 16 / 11; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.hero-media video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
@media (max-width: 700px) {
  .hero { min-height: 0; padding-top: var(--s7); }
  .hero .sub { font-size: 17px; }
}
/* signing in */
.login .notice { max-width: 400px; margin: 0 auto 16px; }
.signin { max-width: 400px; margin: 0 auto; padding: 24px; display: grid; gap: 14px; }
.signin h2, .signin-page h2 { margin: 0; font-size: 22px; font-weight: 600; }
.signin p { margin: 0; }
.signin .gbtn { justify-content: center; font-size: 16px; padding: 11px 18px; }
.signin .btn { width: 100%; }
.signin .links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 14px; }
.signin .links .btn-link { font-weight: 500; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.form-tight { display: grid; gap: 10px; }
.form-tight .status-line { margin: 0; }
.form-tight .status-line:empty { display: none; }
.signin-page { max-width: 440px; margin: 0 auto; }
.login .note { max-width: 400px; margin: 14px auto 0; text-align: center; }
.check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.how { max-width: 1120px; margin: 0 auto; padding: 24px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.how .card { padding: 20px; margin: 0; }
.how .num { width: 30px; height: 30px; border-radius: 50%; background: var(--group); color: var(--primary); display: grid; place-items: center; font-weight: 600; margin-bottom: 12px; }
.how h3 { margin: 0 0 6px; font-size: 17px; }
.how p { margin: 0; color: var(--muted); font-size: 14.5px; }
.sample { max-width: 1120px; margin: 0 auto; padding: 32px 20px 64px; }
.sample h2 { font-size: 26px; margin: 0 0 6px; }
.sample .table { min-width: 720px; font-size: 13.5px; }
.sample .tr5 { display: grid; grid-template-columns: 2.2fr 1.3fr 80px 60px 1.6fr; }
.sample .tr5 > div { padding: 8px 12px; }
.sample .tr5 + .tr5 { border-top: 1px solid var(--line); }
.foot { max-width: 1000px; margin: 0 auto; padding: 0 20px 40px; font-size: 13px; color: var(--muted); text-align: center; }

@media (max-width: 700px) {
  .top { padding: 10px 16px; gap: 8px 12px; }
  .theme-btn { margin-left: auto; }
  .account { margin-left: auto; }
  .account:not(:empty) + .theme-btn { margin-left: 0; }
  .account .who { display: none; } /* the home page shows who is signed in */
  .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nav a { white-space: nowrap; padding: 6px 10px; }
  .page, .hero, .how, .sample { padding-left: 16px; padding-right: 16px; }
  .page { padding-top: 28px; }
  h1.title { font-size: 28px; }
  .bar { padding: 10px 16px; gap: 8px 16px; }
  .bar .stats { gap: 16px; }
  .bar .stats > :nth-child(3), .bar .s { display: none; }
  .bar .v { font-size: 16px; }
  .bar .btn.md { height: 44px; padding: 0 16px; font-size: 15px; }
  .btn.sm, .btn-ghost.sm, .icon-btn { min-height: 44px; height: auto; }
  .nav a { padding: 10px 12px; }
  .avatar, .theme-btn { width: 40px; height: 40px; }
  .acct-btn { height: 40px; }
  .review-row .topic { grid-column: auto; }
  .prisma .cell { flex: 1 1 100%; flex-direction: column; align-items: stretch; gap: 4px; }
  .prisma .arrow { transform: rotate(90deg); align-self: center; }
}

/* account menu, review menus, toasts, dialogs */
.account { position: relative; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #7fa3d1; color: #10202f; font: inherit; font-weight: 600; cursor: pointer; }
.avatar:hover { box-shadow: 0 0 0 3px var(--top-line); }
.acct-menu, .row-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 6px; z-index: 30; text-align: left; }
.acct-menu .who { display: grid; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; word-break: break-all; }
.acct-menu a, .acct-menu button, .row-menu a, .row-menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover, .row-menu a:hover, .row-menu button:hover { background: var(--group2); }
.acct-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.row-menu .danger { color: var(--danger); }
.more { position: relative; display: flex; align-items: stretch; }
.kebab { font-size: 20px; line-height: 1; height: auto; min-height: 36px; }
.theme-btn { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 16px; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(520px, calc(100% - 32px)); }
.toast { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--hdr); color: #fff; border-radius: 10px; padding: 10px 12px 10px 16px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.toast.error { background: var(--danger); color: #fff; }
.toast.good { border-left: 4px solid #81c784; }
.toast-x { background: none; border: 0; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .8; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); color: var(--ink); border-radius: 12px; padding: 24px; width: min(460px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal p { margin: 0 0 12px; }
.modal .actions { margin-top: 16px; }
.btn.btn-danger-solid { background: var(--danger); color: #fff; }
/* signed-in home */
.start-panel { display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; align-items: center; background: var(--group2); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.start-panel h2 { margin: 0 0 4px; font-size: 24px; }
.start-panel p { margin: 0; }
.start-panel .small { margin-top: 8px; }
.tries-badge { background: var(--core); color: var(--coreT); border-radius: 20px; padding: 4px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.recent { margin-top: 32px; }
.recent h3 { margin: 0; font-size: 18px; }
.recent .reviews { margin-top: 12px; }
/* account page */
.fields { display: grid; }
.field-row { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.field-row:first-child { border-top: 0; padding-top: 0; }
.field-row:last-child { padding-bottom: 0; }
.danger-zone { border: 1px solid var(--danger); border-radius: 10px; padding: 22px; margin-top: 24px; }
.danger-zone h3 { margin: 0 0 4px; color: var(--danger); font-size: 17px; }
.danger-zone p { margin: 0 0 14px; }
/* footer and the privacy and terms pages */
.site-foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 20px 16px 32px; color: var(--muted); font-size: 13px; }
.site-foot a { color: var(--muted); }
.legal h3 { margin: 24px 0 6px; font-size: 17px; }
.legal p { margin: 0 0 10px; color: var(--ink); }
@media (max-width: 700px) {
  .start-panel { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .acct-menu { right: -8px; }
}
.icon-btn.kebab:hover, .icon-btn.kebab[aria-expanded="true"] { color: var(--primary); border-color: var(--primary); }
.hint.good { color: var(--coreT); }
.hint.warn { color: var(--skimT); }
.hint.bad { color: var(--danger); }

/* plans */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 20px 0 12px; }
.plan { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.plan h3 { margin: 0; font-size: 18px; }
.plan .price { font-family: 'Source Serif 4', Georgia, serif; font-size: 34px; font-weight: 600; line-height: 1.1; }
.plan .per { font-family: 'IBM Plex Sans', system-ui, sans-serif; font-size: 14px; font-weight: 400; color: var(--muted); }
.plan p { margin: 0; }
.plan ul { margin: 0; padding-left: 18px; flex: 1; }
.plan li { margin: 4px 0; }
.plan.featured { border: 2px solid var(--primary); }
.plan { transition: box-shadow .15s, transform .15s; }
.plan:hover { box-shadow: var(--shadow); }
.plan .btn, .plan .btn-ghost, .plan .plan-state { align-self: flex-start; }
.plan-state { font-weight: 600; color: var(--ok); }
@media (max-width: 1000px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .plans { grid-template-columns: 1fr; } }

.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 20px 0 16px; }
.standing { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-top: 12px; font-size: 14px; }
.page > .standing { margin: 0 0 8px; }
.out-box { border: 1px solid var(--line); border-left: 4px solid var(--primary); background: var(--surface); border-radius: 10px; padding: 18px 20px; margin: 0 0 16px; }
.out-box h3 { margin: 0 0 4px; font-size: 18px; }
.out-box p { margin: 0 0 12px; }
.out-box .row { flex-wrap: wrap; gap: 10px; }

/* moving between pages: a short fade and rise; grey placeholder rows while a list loads */
.page-in { animation: pagein .22s ease-out; }
@keyframes pagein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.skel { height: 62px; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(90deg, var(--surface) 25%, var(--group2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.toast { animation: pagein .2s ease-out; }
.modal { animation: pagein .18s ease-out; }
/* "reduce motion" (Windows: Animation effects off): fades stay, movement goes */
@keyframes fadein { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .page-in, .toast, .modal { animation: fadein .2s ease-out; }
  .skel { animation: none; background: var(--group2); }
  .btn:active, .btn-ghost:active, .btn-danger:active, .review-row .open:hover { transform: none; }
}

/* the landing page's text types itself out as it comes into view; blocks fade in one after another */
.tw { position: relative; }
.tw-ghost { opacity: 0; }
.tw-live { position: absolute; inset: 0; }
.tw.waiting .tw-live { opacity: 0; }
.tw.typing .tw-live::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -.12em; background: var(--accent); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease-out, transform .5s ease-out; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { transform: none; } }

/* plans: AI included or your own key */
.seg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 4px 0 0; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; height: 36px; padding: 0 16px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--primary); color: var(--onprimary); }
.seg button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.seg-note { margin: 0; font-size: 14px; flex: 1 1 280px; }
.price-aside { font-size: 13px; color: var(--muted); margin-top: -6px; }
.plans > .plan, .ways > .plan { margin: 0; } /* side by side, not stacked */

/* legal pages, help, the footer and notes */
.legal ul { margin: 0 0 10px; padding-left: 20px; }
.legal li { margin: 6px 0; }
.legal li i { color: var(--muted); font-style: normal; }
.help .qa { border-top: 1px solid var(--line); padding: 14px 0; }
.help .qa:last-child { border-bottom: 1px solid var(--line); }
.help .qa summary { cursor: pointer; font-weight: 600; font-size: 16px; }
.help .qa p { margin: 10px 0 0; color: var(--ink); }
.site-foot { flex-direction: column; align-items: center; gap: 6px; }
.site-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.site-foot .credits { margin: 0; max-width: 680px; text-align: center; font-size: 12px; }
.ai-note { margin: -8px 0 16px; font-size: 13px; color: var(--muted); }
.ai-note::before { content: "AI · "; font-weight: 600; color: var(--accent); }
.login .agree { margin-top: 14px; }
.terms-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40; width: min(640px, calc(100% - 32px));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; }
.fields > .row.between + .row.between { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
