/* Layout: "night desk" - a dark ink masthead and hero where the old-to-new law switch plays, then a cool paper work surface
   where the answer (left) and the sections it was written from (right) sit side by side. Brass marks what to look at. */
@font-face { font-family: "Plex Sans"; src: url("plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("plex-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("plex-mono-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  /* ink: masthead + hero, the same in both themes */
  --ink: #0b1430; --ink-2: #13204a; --ink-3: #213268; --on-ink: #e9edf8; --on-ink-2: #a8b3d1;
  --brass: #e2a93f; --brass-hi: #ffd47c; --brass-lo: #9c6b16;
  /* work surface */
  --paper: #eef1f7; --card: #ffffff; --text: #121a30; --text-2: #45516c; --muted: #6b7690; --line: #dbe1ec; --chip: #edf1f8;
  --sec: #8a5b0c;
  /* meaning: classification pills, warnings */
  --red: #b8322a; --red-bg: #fde8e6; --green: #157347; --green-bg: #e2f3e9; --blue: #2b56c8; --blue-bg: #e6edfc;
  --amber: #875800; --amber-bg: #fff3d9; --violet: #6b45c2; --violet-bg: #efe9fb;
  --shadow: 0 1px 2px rgba(11, 20, 48, .06), 0 8px 24px -8px rgba(11, 20, 48, .18);
  --shadow-lift: 0 2px 4px rgba(11, 20, 48, .08), 0 18px 40px -12px rgba(11, 20, 48, .32);
  --font: "Plex Sans", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: "Plex Mono", "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --r: 14px; --wrap: 1360px;
  --gut-l: max(16px, env(safe-area-inset-left, 0px)); --gut-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
  font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b1124; --card: #121a32; --text: #e6eaf5; --text-2: #b2bcd6; --muted: #8590ad; --line: #243051; --chip: #19223f;
    --sec: #f0c060;
    --red: #ff8a80; --red-bg: #3a1716; --green: #6fdca4; --green-bg: #0f2e21; --blue: #8fb0ff; --blue-bg: #17244a;
    --amber: #ffc970; --amber-bg: #33260b; --violet: #c3a8ff; --violet-bg: #251b44;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 18px 40px -12px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0b1124; --card: #121a32; --text: #e6eaf5; --text-2: #b2bcd6; --muted: #8590ad; --line: #243051; --chip: #19223f;
  --sec: #f0c060;
  --red: #ff8a80; --red-bg: #3a1716; --green: #6fdca4; --green-bg: #0f2e21; --blue: #8fb0ff; --blue-bg: #17244a;
  --amber: #ffc970; --amber-bg: #33260b; --violet: #c3a8ff; --violet-bg: #251b44;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .6);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .5), 0 18px 40px -12px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* the views set their own display, which would otherwise win over hidden */
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--text); background: var(--paper); line-height: 1.6; min-height: 100vh;
  display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--ink); }
button { font: inherit; cursor: pointer; color: inherit; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.18em; }
.ico.big { width: 34px; height: 34px; stroke-width: 1.4; color: var(--brass-lo); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); margin: 0 0 14px; }
.display { font-weight: 700; font-size: clamp(2.1rem, 4.4vw, 3.5rem); line-height: 1.04; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
.display.small { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.hl {
  background: linear-gradient(100deg, var(--brass-lo) 0%, var(--brass) 25%, var(--brass-hi) 45%, var(--brass) 65%, var(--brass-lo) 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 6s var(--ease) 1.2s infinite;
}
@keyframes sheen { 0% { background-position: 100% 0; } 55%, 100% { background-position: 0 0; } }

/* ---------- masthead ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(11, 20, 48, .92); color: var(--on-ink);
  backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); }
.topIn { display: flex; align-items: center; gap: 24px; max-width: var(--wrap); margin: 0 auto; padding-block: 10px;
  padding-left: var(--gut-l); padding-right: var(--gut-r); }
.topGlow { height: 1px; background: linear-gradient(90deg, transparent, var(--brass) 30%, var(--brass-hi) 50%, var(--brass) 70%, transparent);
  background-size: 200% 100%; animation: glide 5s linear infinite; opacity: .75; }
@keyframes glide { to { background-position: -200% 0; } }
.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 40px; height: 40px; flex: none; }
.markShield { fill: rgba(226, 169, 63, .12); stroke: var(--brass); stroke-width: 2.2; stroke-linejoin: round;
  stroke-dasharray: 130; stroke-dashoffset: 130; animation: draw 1.4s var(--ease) .2s forwards; }
.markSec { fill: var(--brass-hi); font: 700 22px var(--font); opacity: 0; animation: pop .6s var(--spring) 1.1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.4); transform-origin: 24px 24px; } to { opacity: 1; transform: none; } }
.name { font-weight: 700; font-size: 1.06rem; letter-spacing: .005em; }
.sub { font-size: .8rem; color: var(--on-ink-2); }
.tabs { display: flex; gap: 4px; margin-left: 8px; padding: 4px; background: rgba(255, 255, 255, .05); border-radius: 12px; }
.tab { background: transparent; color: var(--on-ink-2); border: 0; padding: 7px 16px; border-radius: 9px; transition: background .2s, color .2s; }
.tab:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.tab.on { background: var(--brass); color: var(--ink); font-weight: 700; box-shadow: 0 4px 16px -4px rgba(226, 169, 63, .6); }
.who { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: .88rem; color: var(--on-ink-2); }
.whoDot { width: 8px; height: 8px; border-radius: 50%; background: #4cd38a; box-shadow: 0 0 0 0 rgba(76, 211, 138, .6); animation: ping 2.4s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(76, 211, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(76, 211, 138, 0); } }
.link { background: none; border: 0; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.who .link { color: #fff; }
main { flex: 1; width: 100%; }
.primary {
  display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(180deg, var(--brass-hi), var(--brass)); color: var(--ink);
  border: 0; border-radius: 10px; padding: 10px 20px; font-weight: 700; box-shadow: 0 6px 18px -6px rgba(226, 169, 63, .75);
  transition: transform .18s var(--spring), box-shadow .2s, filter .2s;
}
.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(226, 169, 63, .9); }
.primary:active { transform: translateY(1px) scale(.98); }
.primary:disabled { opacity: .55; cursor: default; transform: none; }
.primary .ico { transition: transform .25s var(--spring); }
.primary:hover .ico { transform: translateX(3px); }
.err { color: var(--red); min-height: 1.4em; margin: 0; }

/* ---------- ink stage: shared by sign-in and the hero ---------- */
.loginStage, .hero {
  position: relative; overflow: hidden; color: var(--on-ink); isolation: isolate;
  background:
    radial-gradient(60% 90% at 85% 10%, rgba(226, 169, 63, .20), transparent 60%),
    radial-gradient(50% 80% at 5% 100%, rgba(60, 98, 220, .28), transparent 60%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 34px),
    linear-gradient(160deg, var(--ink-2), var(--ink) 55%);
}
.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .2) 0%, rgba(0, 0, 0, .3) 40%, #000 75%); mask-image: linear-gradient(90deg, rgba(0, 0, 0, .2) 0%, rgba(0, 0, 0, .3) 40%, #000 75%); }
.lede { color: var(--on-ink-2); font-size: 1.06rem; max-width: 46ch; margin: 18px 0 0; }

/* old -> new ticker */
.ticker {
  position: relative; padding: 18px 22px 16px; border-radius: 16px; min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  border: 1px solid rgba(226, 169, 63, .28); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 20px 50px -20px rgba(0, 0, 0, .6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tkLabel { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); }
.tkLabel .muted { color: var(--on-ink-2); text-transform: none; letter-spacing: 0; }
.tkRow { display: flex; align-items: center; gap: 14px; margin: 10px 0 6px; font-family: var(--mono); font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem); white-space: nowrap; }
.tkOld { position: relative; color: var(--on-ink-2); }
.tkOld::after { content: ""; position: absolute; left: -2px; right: -2px; top: 54%; height: 2px; background: #ff7a6e; border-radius: 2px;
  transform-origin: left; transform: scaleX(1); transition: transform .45s var(--ease); }
.ticker.flip .tkOld::after { transform: scaleX(0); transition: none; }
.tkArrow { width: 1em; height: 1em; fill: none; stroke: var(--brass); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ticker.go .tkArrow { animation: nudge .6s var(--spring); }
@keyframes nudge { 40% { transform: translateX(6px); } }
.tkNew { color: var(--brass-hi); text-shadow: 0 0 22px rgba(255, 212, 124, .45); }
.tkWhat { color: var(--on-ink); font-size: .95rem; min-height: 1.5em; transition: opacity .3s; }
.ticker.flip .tkWhat { opacity: 0; }

/* ---------- sign in ---------- */
.login { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); min-height: calc(100vh - 62px); }
.loginStage { display: flex; align-items: center; padding-block: 56px; padding-left: max(var(--gut-l), 6vw); padding-right: var(--gut-r); }
.loginPitch { display: flex; flex-direction: column; gap: 0; max-width: 640px; animation: rise .8s var(--ease) both; }
.loginPitch .ticker { margin-top: 32px; max-width: 520px; }
.loginCard { align-self: center; justify-self: center; width: min(400px, calc(100% - 32px)); margin-block: 40px; padding: 30px;
  display: flex; flex-direction: column; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lift); animation: rise .8s var(--ease) .15s both; }
.loginCard h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.01em; }
.loginCard p { margin: 0; }
.loginCard label { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; color: var(--text-2); }
.loginCard input { font: inherit; color: var(--text); background: var(--paper); padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .2s, box-shadow .2s; }
.loginCard input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px rgba(226, 169, 63, .2); }
.loginCard .primary { justify-content: center; margin-top: 4px; padding-block: 12px; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- hero (ask view) ---------- */
.heroIn { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: end; max-width: var(--wrap);
  margin: 0 auto; width: 100%; padding-top: 48px; padding-bottom: 28px; padding-left: var(--gut-l); padding-right: var(--gut-r); }
.heroCopy { animation: rise .8s var(--ease) both; }
.hero .ticker { animation: rise .8s var(--ease) .15s both; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; max-width: var(--wrap); width: 100%;
  margin-inline: auto; padding-left: var(--gut-l); padding-right: var(--gut-r); padding-bottom: 76px; }
.stats > div { padding: 14px 18px 4px 0; border-top: 1px solid rgba(255, 255, 255, .12); animation: rise .8s var(--ease) both; }
.stats > div:nth-child(2) { animation-delay: .08s; } .stats > div:nth-child(3) { animation-delay: .16s; } .stats > div:nth-child(4) { animation-delay: .24s; }
.stats dt { font-family: var(--mono); font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2.2rem); color: var(--brass-hi); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats dd { margin: 4px 0 0; font-size: .84rem; color: var(--on-ink-2); }
.hero.compact .heroIn, .hero.compact .stats { display: none; }
.hero.compact { padding-block: 0 56px; }

/* ---------- work surface ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 22px; align-items: start; max-width: var(--wrap); margin: -52px auto 0;
  padding-left: var(--gut-l); padding-right: var(--gut-r); padding-bottom: 28px; position: relative; z-index: 2; }
.askCol { min-width: 0; }
.askBox { position: relative; padding: 14px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lift); }
.askBox::before { content: ""; position: absolute; inset: -1.5px; border-radius: 19.5px; z-index: -1; padding: 1.5px;
  background: conic-gradient(from var(--a), rgba(226, 169, 63, .15), var(--brass-hi), var(--brass), rgba(60, 98, 220, .5), rgba(226, 169, 63, .15));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .55; animation: spin 8s linear infinite; transition: opacity .3s; }
.askBox:focus-within::before { opacity: 1; animation-duration: 3s; }
@keyframes spin { to { --a: 360deg; } }
textarea {
  display: block; width: 100%; font: inherit; font-size: 1.06rem; color: var(--text); background: transparent; border: 0; padding: 8px 10px;
  resize: vertical; min-height: 84px; line-height: 1.55;
}
textarea:focus { outline: none; }
textarea::placeholder { color: var(--muted); }
.askBar { display: flex; align-items: center; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--chip); border-radius: 10px; padding: 3px; }
.segBtn { position: relative; z-index: 1; background: transparent; border: 0; padding: 6px 16px; color: var(--text-2); border-radius: 8px; transition: color .25s; }
.segBtn.on { color: var(--ink); font-weight: 700; }
.segPill { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 8px;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass)); box-shadow: 0 4px 12px -4px rgba(226, 169, 63, .8);
  transform: translateX(100%); transition: transform .35s var(--spring); }
.seg:has([data-style="brief"].on) .segPill { transform: translateX(0); }
.count { margin-left: auto; font-family: var(--mono); font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* example questions: a full grid of 4 x 2 */
.examples { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 4px; }
.ex {
  position: relative; display: flex; flex-direction: column; gap: 8px; text-align: left; min-width: 0; padding: 14px 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); font-size: .9rem; line-height: 1.45;
  box-shadow: var(--shadow); transition: transform .3s var(--spring), box-shadow .3s, border-color .3s;
  animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + .2s);
}
.ex:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--brass); }
.exCat { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: .68rem; letter-spacing: .07em; text-transform: uppercase; color: var(--c, var(--brass-lo)); }
.exCat .ico { width: 18px; height: 18px; padding: 3px; border-radius: 6px; background: var(--cb, var(--amber-bg)); box-sizing: content-box; }
.exGo { position: absolute; right: 12px; bottom: 12px; width: 16px; height: 16px; color: var(--brass-lo); opacity: 0; transform: translateX(-6px);
  transition: opacity .25s, transform .3s var(--spring); }
.ex:hover .exGo { opacity: 1; transform: none; }
.ex[data-cat="offence"] { --c: var(--red); --cb: var(--red-bg); }
.ex[data-cat="classification"] { --c: var(--amber); --cb: var(--amber-bg); }
.ex[data-cat="procedure"] { --c: var(--blue); --cb: var(--blue-bg); }
.ex[data-cat="evidence"] { --c: var(--violet); --cb: var(--violet-bg); }
.ex[data-cat="cyber"] { --c: var(--green); --cb: var(--green-bg); }
.ex[data-cat="old"] { --c: var(--text-2); --cb: var(--chip); }
.ex[data-cat="intl"] { --c: var(--blue); --cb: var(--blue-bg); }

/* conversation */
.thread { display: flex; flex-direction: column-reverse; gap: 18px; margin-top: 18px; }
.turn { position: relative; padding: 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  animation: rise .5s var(--ease) both; min-width: 0; }
.qline { display: flex; gap: 10px; align-items: baseline; font-weight: 700; font-size: 1.08rem; line-height: 1.4; margin-bottom: 10px; cursor: pointer; }
.qline::before { content: "Q"; flex: none; font-family: var(--mono); font-size: .72rem; color: var(--ink); background: var(--brass); border-radius: 6px; padding: 1px 7px; transform: translateY(-2px); }
.meta { font-family: var(--mono); font-size: .72rem; color: var(--muted); margin-bottom: 10px; display: flex; gap: 10px; flex-wrap: wrap; cursor: pointer; }
.meta:empty { display: none; }

/* the three real stages of an answer */
.pipe { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; }
.pipe .st { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--muted); padding: 5px 11px; border-radius: 999px;
  background: var(--chip); transition: background .3s, color .3s; }
.pipe .st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .5; }
.pipe .st.on { color: var(--ink); background: var(--brass-hi); }
.pipe .st.on::before { opacity: 1; animation: beat 1s infinite; }
.pipe .st.ok { color: var(--green); background: var(--green-bg); }
.pipe .st.ok::before { opacity: 1; }
@keyframes beat { 50% { transform: scale(1.6); opacity: .4; } }
.pipe.done { animation: fold .5s var(--ease) .6s forwards; overflow: hidden; }
@keyframes fold { to { opacity: 0; max-height: 0; margin: 0; } }
.scan { height: 3px; border-radius: 3px; margin: 0 0 14px; background: linear-gradient(90deg, transparent, var(--brass), var(--brass-hi), transparent);
  background-size: 40% 100%; background-repeat: no-repeat; animation: scan 1.3s var(--ease) infinite; }
@keyframes scan { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.skel { display: grid; gap: 9px; }
.skel i { display: block; height: 11px; border-radius: 6px; background: linear-gradient(90deg, var(--chip) 25%, var(--line) 50%, var(--chip) 75%);
  background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.skel i:nth-child(2) { width: 92%; } .skel i:nth-child(3) { width: 78%; } .skel i:nth-child(4) { width: 60%; }
@keyframes shimmer { to { background-position: -150% 0; } }

.answer { max-width: 76ch; font-size: 1rem; line-height: 1.68; }
.answer p { margin: 0 0 .75em; }
.answer ul, .answer ol { margin: 0 0 .8em 1.2em; padding: 0; }
.answer li { margin: .25em 0; }
.answer li::marker { color: var(--brass-lo); }
.answer strong { font-weight: 700; }
.answer.streaming > :last-child::after { content: ""; display: inline-block; width: .5em; height: 1.05em; margin-left: 2px; vertical-align: -.15em;
  background: var(--brass); border-radius: 2px; animation: caret .9s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.sec { font-family: var(--mono); font-size: .92em; font-weight: 700; color: var(--sec); white-space: nowrap; }
.tag { display: inline-block; font-size: .78em; font-weight: 700; padding: 0 .55em; border-radius: 999px; line-height: 1.6; vertical-align: .05em; white-space: nowrap; }
.tag.cog, .tag.nbail { color: var(--red); background: var(--red-bg); }
.tag.ncog { color: var(--blue); background: var(--blue-bg); }
.tag.bail { color: var(--green); background: var(--green-bg); }
.cite {
  display: inline-grid; place-items: center; min-width: 1.65em; height: 1.65em; padding: 0 .35em; margin: 0 2px; border-radius: 7px;
  background: var(--ink); color: var(--brass-hi); border: 0; font-family: var(--mono); font-size: .74em; font-weight: 700; line-height: 1; vertical-align: .12em;
  transition: transform .2s var(--spring), background .2s, color .2s;
}
.cite:hover { transform: translateY(-2px) scale(1.08); background: var(--brass); color: var(--ink); }
.cite.pop { animation: citepop .5s var(--spring) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes citepop { from { transform: scale(.3); opacity: 0; } }
.notice { font-size: .82rem; color: var(--amber); background: var(--amber-bg); border-radius: 10px; padding: 8px 12px; margin-top: 12px; }
.errBox { color: var(--red); }

/* ---------- sources panel ---------- */
.srcCol { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 78px); max-height: calc(100vh - 100px); display: flex; flex-direction: column; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lift); overflow: hidden; }
.srcHead { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--chip), transparent); }
.srcHead h2 { margin: 0; font-size: .82rem; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.srcBody { padding: 12px 16px 18px; overflow: auto; }
.srcEmpty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 28px 12px; color: var(--muted); font-size: .9rem; }
.srcEmpty p { margin: 0; max-width: 30ch; }
.srcIntro { margin: 2px 0 10px; font-size: .84rem; color: var(--muted); }
.srcList { display: flex; flex-direction: column; gap: 8px; }
.src {
  text-align: left; background: var(--paper); border: 1px solid transparent; border-radius: 12px; padding: 10px 12px; display: flex; gap: 12px; align-items: flex-start;
  transition: border-color .2s, transform .25s var(--spring), background .2s; animation: slidein .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms);
}
.src:hover { border-color: var(--brass); transform: translateX(-3px); background: var(--card); }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } }
.src .n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: var(--brass-hi);
  font-family: var(--mono); font-weight: 700; font-size: .8rem; }
.src .t { font-size: .87rem; color: var(--text); line-height: 1.4; }
.src .k { font-family: var(--mono); font-size: .7rem; color: var(--muted); margin-top: 3px; word-break: break-all; }
.kind { display: inline-block; font-family: var(--mono); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; padding: 1px 7px;
  border-radius: 999px; margin: 0 0 4px; color: var(--text-2); background: var(--chip); }
.kind.law { color: var(--blue); background: var(--blue-bg); }
.kind.cls { color: var(--amber); background: var(--amber-bg); }
.kind.old { color: var(--muted); background: var(--chip); }
.kind.note { color: var(--violet); background: var(--violet-bg); }
.kind.intl { color: var(--green); background: var(--green-bg); }
.docView { animation: rise .4s var(--ease) both; }
.docHead { font-weight: 700; margin: 6px 0 4px; line-height: 1.4; }
.docMeta { font-size: .76rem; color: var(--muted); margin-bottom: 12px; }
.docMeta a { color: var(--blue); }
.docText { white-space: pre-wrap; font-size: .9rem; line-height: 1.65; border-top: 1px solid var(--line); padding-top: 12px; }
.thinking { color: var(--muted); font-style: italic; }
.thinking::after { content: " …"; animation: caret 1.2s infinite; }

/* ---------- library ---------- */
.libraryView { max-width: var(--wrap); margin: 0 auto; width: 100%; padding-top: 36px; padding-bottom: 28px; padding-left: var(--gut-l); padding-right: var(--gut-r); }
.libHead { animation: rise .7s var(--ease) both; }
.libHead .eyebrow { color: var(--brass-lo); }
.stats.light { padding: 22px 0 8px; margin: 0; }
.stats.light > div { border-top-color: var(--line); }
.stats.light dt { color: var(--text); }
.stats.light dt::after { content: ""; display: block; width: 28px; height: 3px; border-radius: 2px; background: var(--brass); margin-top: 8px; }
.stats.light dd { color: var(--text-2); }
.libCard { margin-top: 18px; padding: 22px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.libCard h3 { margin: 24px 0 8px; }
.tableWrap { overflow-x: auto; }
table.lib { border-collapse: collapse; width: 100%; font-size: .88rem; }
table.lib th, table.lib td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.lib th { font-family: var(--mono); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--text-2); font-weight: 400; }
table.lib th.num, table.lib td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.lib td.num { font-family: var(--mono); font-weight: 700; }
table.lib a { color: var(--blue); word-break: break-word; }
table.lib tbody tr { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
table.lib tbody tr:not(.group):hover td { background: var(--chip); }
tr.group td { padding-top: 22px; font-family: var(--mono); font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--brass-lo); border-bottom-color: var(--brass); }
.gaps { color: var(--text-2); font-size: .9rem; padding-left: 1.2em; }
.gaps li { margin: .25em 0; }
.foot { text-align: center; font-size: .76rem; color: var(--muted); padding-block: 16px 24px; padding-left: var(--gut-l); padding-right: var(--gut-r); }

/* ---------- narrow screens ---------- */
@media (max-width: 1100px) {
  .examples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .work { grid-template-columns: 1fr; }
  .srcCol { position: static; max-height: none; }
  .heroIn { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login { grid-template-columns: 1fr; min-height: 0; }
  .loginStage { padding-block: 36px; }
  .topIn { flex-wrap: wrap; gap: 10px 16px; }
  .sub { display: none; }
}
@media (max-width: 560px) {
  .examples { grid-template-columns: 1fr; }
  .who { margin-left: 0; }
  .askBar { flex-wrap: wrap; }
  .tkRow { font-size: 1.3rem; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .markShield { stroke-dashoffset: 0; }
  .markSec { opacity: 1; }
}
