/* DroitPedia: design system and layout */

[hidden] { display: none !important; }

:root {
  /* paper and ink: warm neutral surfaces, near-black text, one deep blue for links and focus, brass for the brand mark */
  --bg: #f7f6f3;
  --bg-2: #efede8;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --ink: #161a21;
  --ink-2: #363c47;
  --muted: #5e6573;
  --faint: #8a909b;
  --line: #e4e1da;
  --line-2: #d3cfc6;
  --accent: #1f4b8e;
  --accent-ink: #ffffff;
  --accent-weak: #ebf0f7;
  --accent-line: #c5d3e8;
  --primary: #13213a;
  --primary-hover: #1f3256;
  --primary-ink: #ffffff;
  --brass: #b8893b;
  --brass-weak: #f5ecdb;
  --logo-tile: #13213a;
  --logo-ink: #fbfaf7;
  --focus: #1f4b8e;
  --mark: #fbeeb6;
  --ok: #1b7348;      --ok-weak: #e4f2e9;
  --warn: #93590a;    --warn-weak: #f8efdc;
  --bad: #ad2f25;     --bad-weak: #f9e8e5;
  --info: #1f5c9e;    --info-weak: #e6eff8;
  --fam-loi: #1f4b8e;      --fam-loi-weak: #ebf0f7;
  --fam-juri: #8a2d3b;     --fam-juri-weak: #f6e9eb;
  --fam-autorite: #0f6a63; --fam-autorite-weak: #e2f0ee;
  --fam-doctrine: #84570f; --fam-doctrine-weak: #f5ecdb;
  --fam-ue: #1b6593;       --fam-ue-weak: #e3eff6;
  --chart-1: #1f4b8e; --chart-2: #b8893b;
  --fam-inter: #4a5361;    --fam-inter-weak: #eceef1;
  --shadow-1: 0 1px 2px rgba(22, 26, 33, .05);
  --shadow-2: 0 4px 16px -6px rgba(22, 26, 33, .12), 0 1px 3px rgba(22, 26, 33, .05);
  --shadow-3: 0 18px 48px -14px rgba(22, 26, 33, .22);
  --r-1: 6px; --r-2: 8px; --r-3: 12px; --r-4: 16px;
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  --serif: "Noto Serif", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
  --rail: 232px;
  --top: 60px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1114;
  --bg-2: #15181d;
  --surface: #181b21;
  --surface-2: #1c2026;
  --ink: #eceef2;
  --ink-2: #c9ced7;
  --muted: #99a0ad;
  --faint: #6e7582;
  --line: #272b33;
  --line-2: #353a44;
  --accent: #8fb0e6;
  --accent-ink: #0f1114;
  --accent-weak: #1a2436;
  --accent-line: #2e4264;
  --primary: #e6eaf1;
  --primary-hover: #ffffff;
  --primary-ink: #0f1114;
  --brass: #d3a95f;
  --brass-weak: #2a2214;
  --logo-tile: #e6eaf1;
  --logo-ink: #13213a;
  --focus: #8fb0e6;
  --mark: #5a4a10;
  --ok: #5cc192;      --ok-weak: #13281e;
  --warn: #e0a54e;    --warn-weak: #2b2213;
  --bad: #ee7d71;     --bad-weak: #2d1816;
  --info: #79aee8;    --info-weak: #14233a;
  --fam-loi: #8fb0e6;      --fam-loi-weak: #1a2436;
  --fam-juri: #e3a0aa;     --fam-juri-weak: #2c1a1e;
  --fam-autorite: #62c3b6; --fam-autorite-weak: #10282a;
  --fam-doctrine: #ddb067; --fam-doctrine-weak: #2a2214;
  --fam-ue: #73b6de;       --fam-ue-weak: #13253a;
  --chart-1: #6f95d8; --chart-2: #c99a4e;
  --fam-inter: #a9b1c0;    --fam-inter-weak: #20242c;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 6px 22px -10px rgba(0, 0, 0, .7);
  --shadow-3: 0 22px 60px -16px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 3px; }
code, kbd { font-family: var(--mono); font-size: .86em; }
kbd {
  display: inline-block; min-width: 20px; padding: 1px 5px; border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--muted);
  font-size: 11px; line-height: 16px; text-align: center;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.01em; margin: 0 0 .5em; }
::selection { background: var(--accent-weak); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- shell */

.app { min-height: 100vh; display: grid; grid-template-columns: var(--rail) 1fr; grid-template-rows: var(--top) 1fr; }
.topbar {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px;
  height: var(--top); padding: 0 20px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; width: calc(var(--rail) - 36px); color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; flex: none; display: block; }
.brand .name { display: flex; align-items: center; }
.brand .wordmark { height: 20px; width: auto; display: block; }
/* the logo's colours follow the theme: ink tile and paper N in light mode, the reverse in dark mode, brass full stop */
.mark .tile { fill: var(--logo-tile); }
.mark .glyph { fill: var(--logo-ink); }
.wordmark .glyph { fill: currentColor; }
.mark .dot, .wordmark .dot { fill: var(--brass); }
.top-search { flex: 1; max-width: 680px; position: relative; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.rail {
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 16px 12px;
  border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px;
}
.rail a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-2);
  color: var(--ink-2); font-weight: 500; font-size: 14.5px;
}
.rail a:hover { background: var(--bg-2); text-decoration: none; color: var(--ink); }
.rail a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.rail a.on .icon { color: var(--accent); }
.rail .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.rail .rail-note { margin-top: auto; padding: 12px; border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.rail .rail-note b { color: var(--ink-2); }
main#view { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 80px; }
.page { max-width: 1240px; margin: 0 auto; }
.page.narrow { max-width: 880px; }
.page.wide { max-width: 1480px; }
.bottombar { display: none; }

@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .brand { width: auto; }
  .bottombar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; height: 62px;
    padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .bottombar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
  .bottombar a.on { color: var(--accent); }
  .bottombar a:hover { text-decoration: none; }
  main#view { padding: 20px 16px 96px; }
}
@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand span.name { display: none; }
  .top-actions .btn-label { display: none; }
}

/* ---------------------------------------------------------------- controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: var(--r-2); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 550; font-size: 14px; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn.icon-only { width: 38px; padding: 0; }
.btn.sm.icon-only { width: 30px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.danger { color: var(--bad); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-2); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; color: var(--ink-2); user-select: none; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 20px; background: var(--line-2); position: relative; transition: background .15s; margin: 0; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(14px); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 550; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  border: 0; background: none; padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button .count { font-size: 11.5px; padding: 0 6px; border-radius: 10px; background: var(--bg-2); color: var(--muted); }

/* ---------------------------------------------------------------- search box */

.searchbox { position: relative; display: flex; align-items: center; }
.searchbox .icon.lead { position: absolute; left: 14px; color: var(--faint); pointer-events: none; }
.searchbox input {
  width: 100%; height: 42px; padding: 0 84px 0 42px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); transition: border-color .12s, box-shadow .12s;
}
.searchbox input::placeholder { color: var(--faint); }
.searchbox input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-weak); }
.searchbox .hint { position: absolute; right: 10px; display: flex; gap: 4px; pointer-events: none; }
.searchbox.big input { height: 60px; font-size: 17px; border-radius: 16px; padding-left: 52px; padding-right: 150px; box-shadow: var(--shadow-2); }
.searchbox.big .icon.lead { left: 18px; width: 22px; height: 22px; }
.searchbox.big .go { position: absolute; right: 8px; height: 44px; border-radius: 12px; }
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-3); padding: 6px; display: none; max-height: 70vh; overflow: auto;
}
.suggest.open { display: block; }
.suggest .grp { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.suggest a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink); font-size: 14px; }
.suggest a .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest a.sel, .suggest a:hover { background: var(--accent-weak); text-decoration: none; }
.suggest a .icon { color: var(--faint); }

/* ---------------------------------------------------------------- badges & chips */

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg-2); color: var(--ink-2); border: 1px solid transparent;
}
.badge.fam-loi { background: var(--fam-loi-weak); color: var(--fam-loi); }
.badge.fam-juri { background: var(--fam-juri-weak); color: var(--fam-juri); }
.badge.fam-autorite { background: var(--fam-autorite-weak); color: var(--fam-autorite); }
.badge.fam-doctrine { background: var(--fam-doctrine-weak); color: var(--fam-doctrine); }
.badge.fam-ue { background: var(--fam-ue-weak); color: var(--fam-ue); }
.badge.fam-inter { background: var(--fam-inter-weak); color: var(--fam-inter); }
.badge.outline { background: transparent; border-color: var(--line-2); color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--ok); } .status.bad { color: var(--bad); } .status.warn { color: var(--warn); } .status.info { color: var(--info); } .status.mute { color: var(--faint); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.pill:hover { border-color: var(--accent-line); background: var(--accent-weak); color: var(--accent); text-decoration: none; }
.cite {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 0 7px; margin: 0 1px; border-radius: 6px;
  background: var(--accent-weak); color: var(--accent); font: 600 12.5px/20px var(--sans); vertical-align: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid var(--accent-line);
}
.cite:hover { text-decoration: none; background: var(--accent); color: var(--accent-ink); }
.cite.fam-juri { background: var(--fam-juri-weak); color: var(--fam-juri); border-color: color-mix(in srgb, var(--fam-juri) 30%, transparent); }
.cite.fam-juri:hover { background: var(--fam-juri); color: #fff; }

/* ---------------------------------------------------------------- cards & panels */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-1); }
.card.pad { padding: 20px; }
.panel-title { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 14px; }
.notice .icon { margin-top: 2px; }
.notice.warn { background: var(--warn-weak); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.warn .icon { color: var(--warn); }
.notice.info { background: var(--info-weak); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.notice.info .icon { color: var(--info); }
.notice.bad { background: var(--bad-weak); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.notice.bad .icon { color: var(--bad); }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty > .icon { width: 40px; height: 40px; color: var(--faint); stroke-width: 1.4; margin-bottom: 12px; }
.empty h3 { color: var(--ink); font-size: 17px; }
.skel { background: linear-gradient(90deg, var(--bg-2) 25%, var(--surface-2) 37%, var(--bg-2) 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: 6px; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skel.line { height: 12px; margin: 8px 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; z-index: 100; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-3); transition: opacity .18s, transform .18s; display: flex; gap: 8px; align-items: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 1023px) { .toast { bottom: 84px; } }

/* ---------------------------------------------------------------- home */

.hero { text-align: center; padding: clamp(24px, 6vh, 72px) 0 28px; }
.hero .eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); font-weight: 500; box-shadow: var(--shadow-1); }
.hero .eyebrow b { color: var(--ok); font-weight: 600; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 5.2vw, 56px); letter-spacing: -.025em; margin: 22px auto 14px; max-width: 900px; line-height: 1.08; }
.hero h1 em { font-style: italic; color: var(--ink-2); }
.hero p.lead { font-size: clamp(15px, 1.6vw, 18px); color: var(--muted); max-width: 680px; margin: 0 auto 30px; }
.hero .searchbox { max-width: 760px; margin: 0 auto; }
.hero .modes { margin: 14px auto 0; display: flex; justify-content: center; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 22px auto 0; max-width: 820px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 44px; }
.tool-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; overflow: hidden; }
.tool-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.tool-card .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.tool-card .ic .icon { width: 22px; height: 22px; }
.tool-card h3 { font-size: 16.5px; margin: 4px 0 0; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14px; }
.tool-card .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--accent); padding-top: 8px; }
.ic.c1 { background: var(--fam-loi-weak); color: var(--fam-loi); }
.ic.c2 { background: var(--fam-juri-weak); color: var(--fam-juri); }
.ic.c3 { background: var(--fam-autorite-weak); color: var(--fam-autorite); }
.ic.c4 { background: var(--fam-doctrine-weak); color: var(--fam-doctrine); }
.ic.c5 { background: var(--fam-ue-weak); color: var(--fam-ue); }
.ic.c6 { background: var(--ok-weak); color: var(--ok); }
.stats-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; margin-top: 44px; }
.stats-band > div { background: var(--surface); padding: 18px 20px; }
.stats-band .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats-band .l { font-size: 13px; color: var(--muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 48px 0 16px; }
.section-head h2 { font-size: 20px; margin: 0; }

/* ---------------------------------------------------------------- search results */

.search-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; }
.search-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.search-head .searchbox input { height: 50px; font-size: 16px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters .select { width: auto; height: 34px; font-size: 13.5px; padding: 0 30px 0 10px; }
.filters .input { width: 92px; height: 34px; font-size: 13.5px; }
.facets { position: sticky; top: calc(var(--top) + 20px); max-height: calc(100vh - var(--top) - 40px); overflow: auto; padding-right: 4px; }
.facet { margin-bottom: 22px; }
.facet h4 { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin: 0 0 8px; }
.facet label { display: flex; align-items: center; gap: 8px; padding: 4px 6px; margin: 0 -6px; border-radius: 6px; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.facet label:hover { background: var(--bg-2); }
.facet label .c { margin-left: auto; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.facet input[type=checkbox] { accent-color: var(--accent); margin: 0; }
.facet .more { font-size: 13px; padding: 4px 0; background: none; border: 0; color: var(--accent); }
.years { display: flex; align-items: flex-end; gap: 2px; height: 54px; margin-top: 4px; }
.years i { flex: 1; background: var(--accent-line); border-radius: 2px 2px 0 0; min-height: 2px; cursor: pointer; }
.years i:hover { background: var(--accent); }
.result-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 13.5px; margin-bottom: 12px; flex-wrap: wrap; }
.results { display: flex; flex-direction: column; gap: 10px; }
.result { padding: 16px 18px; border-radius: var(--r-3); border: 1px solid var(--line); background: var(--surface); transition: border-color .12s, box-shadow .12s; position: relative; }
.result:hover, .result.sel { border-color: var(--accent-line); box-shadow: var(--shadow-2); }
.result .top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 7px; }
.result .top .date { margin-left: auto; color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.result h3 { font-size: 16px; font-weight: 650; margin: 0 0 3px; line-height: 1.35; }
.result h3 a { color: var(--ink); }
.result h3 a::after { content: ""; position: absolute; inset: 0; }
.result h3 a:hover { text-decoration: none; color: var(--accent); }
.result .crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .snip { font-family: var(--serif); font-size: 15px; color: var(--ink-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.result .acts { position: absolute; right: 12px; bottom: 10px; display: none; gap: 4px; z-index: 2; }
.result:hover .acts { display: flex; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 28px 0 0; flex-wrap: wrap; }
.pager button { min-width: 38px; }
.pager button.on { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.ai-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-3); margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); }
.ai-banner .icon { color: var(--accent); }
.ai-banner p { margin: 0; flex: 1; font-size: 14px; color: var(--ink-2); }
.facet-toggle { display: none; }
@media (max-width: 1023px) {
  .search-layout { grid-template-columns: minmax(0, 1fr); }
  .facets { position: static; max-height: none; display: none; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); }
  .facets.open { display: block; }
  .facet-toggle { display: inline-flex; }
  .result .acts { display: none !important; }
}

/* ---------------------------------------------------------------- document reader */

.doc-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.doc-layout.no-toc { grid-template-columns: minmax(0, 1fr) 320px; }
.doc-toc, .doc-side { position: sticky; top: calc(var(--top) + 20px); max-height: calc(100vh - var(--top) - 40px); overflow: auto; }
.doc-toc { font-size: 13.5px; padding-right: 6px; }
.toc-tree ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--line); }
.toc-tree > ul { padding-left: 0; border-left: 0; }
.toc-tree li { margin: 1px 0; }
.toc-tree .node { display: flex; align-items: flex-start; gap: 4px; }
.toc-tree .tw { width: 18px; height: 22px; display: grid; place-items: center; border: 0; background: none; color: var(--faint); padding: 0; flex: none; }
.toc-tree .tw .icon { width: 13px; height: 13px; transition: transform .12s; }
.toc-tree li.open > .node .tw .icon { transform: rotate(90deg); }
.toc-tree li:not(.open) > ul { display: none; }
.toc-tree a { display: block; padding: 2px 6px; border-radius: 5px; color: var(--ink-2); line-height: 1.4; }
.toc-tree a:hover { background: var(--bg-2); text-decoration: none; }
.toc-tree a.cur { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.doc-head { margin-bottom: 24px; }
.doc-head .crumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.doc-head .crumbs a { color: var(--muted); }
.doc-head .crumbs a:hover { color: var(--accent); }
.doc-head .crumbs .icon { width: 12px; height: 12px; color: var(--faint); }
.doc-head .tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.doc-head h1 { font-family: var(--serif); font-size: clamp(26px, 3.4vw, 38px); font-weight: 600; letter-spacing: -.02em; margin: 0 0 8px; }
.doc-head h1.long { font-size: clamp(21px, 2.4vw, 28px); line-height: 1.3; }
.doc-head .sub { color: var(--muted); font-size: 15px; margin: 0; }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.prose { font-family: var(--serif); font-size: 18px; line-height: 1.75; color: var(--ink); }
.prose p { margin: 0 0 .85em; }
.prose .tw { overflow-x: auto; margin: 1em 0; }
.prose table { border-collapse: collapse; font: 14px/1.5 var(--sans); min-width: 60%; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose mark { background: var(--mark); }
.prose.compact { font-size: 16.5px; line-height: 1.7; }
.decision-text p { text-indent: 0; }
.nota { margin: 22px 0; padding: 14px 18px; border-left: 3px solid var(--warn); background: var(--warn-weak); border-radius: 0 var(--r-2) var(--r-2) 0; font-size: 15px; }
.nota b { display: block; font-family: var(--sans); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--warn); margin-bottom: 4px; }
.summary-box { margin: 0 0 26px; padding: 18px 20px; border-radius: var(--r-3); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--fam-juri); }
.summary-box h4 { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--fam-juri); margin: 0 0 6px; }
.art-block { padding: 22px 0; border-top: 1px solid var(--line); }
.art-block:first-child { border-top: 0; padding-top: 0; }
.art-block h3 { font: 700 15px/1.3 var(--sans); margin: 0 0 10px; display: flex; gap: 10px; align-items: center; }
.art-block h3 a { color: var(--ink); }
.sec-title { font: 700 13px/1.4 var(--sans); letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin: 28px 0 6px; }
.side-card { padding: 16px; margin-bottom: 14px; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13.5px; margin: 0; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: 1px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.timeline li.cur::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.timeline li.ok::before { border-color: var(--ok); }
.timeline .when { font-weight: 600; color: var(--ink); }
.timeline .by { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.timeline .by a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-2); }
.timeline .vacts { margin-top: 4px; display: flex; gap: 8px; }
.timeline .vacts a, .timeline .vacts button { font-size: 12.5px; background: none; border: 0; padding: 0; color: var(--accent); }
.link-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.link-list li { padding: 7px 0; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; }
.link-list li:first-child { border-top: 0; }
.link-list .badge { flex: none; height: 19px; font-size: 10.5px; padding: 0 6px; }
.ask-box { display: flex; flex-direction: column; gap: 8px; }
.ask-box .btn { justify-content: flex-start; height: auto; min-height: 34px; padding: 9px 12px; text-align: left; white-space: normal; font-weight: 500; line-height: 1.35; }
.ask-box .btn .icon { color: var(--accent); flex: none; }
.diff { font-family: var(--serif); font-size: 17px; line-height: 1.75; white-space: pre-wrap; }
.diff ins { background: var(--ok-weak); color: var(--ok); text-decoration: none; border-radius: 3px; padding: 0 1px; box-shadow: inset 0 -1px 0 var(--ok); }
.diff del { background: var(--bad-weak); color: var(--bad); border-radius: 3px; padding: 0 1px; }
.diff-stats { display: flex; gap: 16px; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.diff-stats b.ins { color: var(--ok); } .diff-stats b.del { color: var(--bad); }
.date-at { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.date-at input { height: 30px; width: auto; font-size: 13px; padding: 0 8px; }
@media (max-width: 1279px) {
  .doc-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .doc-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
  .doc-side { grid-column: 1 / -1; position: static; max-height: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
  .doc-layout:not(.no-toc) .doc-side { grid-column: 2; }
  .doc-side .side-card { margin: 0; }
}
@media (max-width: 1023px) {
  .doc-layout, .doc-layout.no-toc { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .doc-toc { position: static; max-height: 320px; border: 1px solid var(--line); border-radius: var(--r-3); padding: 12px; background: var(--surface); }
  .doc-layout:not(.no-toc) .doc-side { grid-column: 1; }
  .doc-layout > article { order: -1; }  /* stacked: the text first, then the plan, then the side cards */
  .doc-layout:has(.codes-grid) .doc-toc { display: none; }  /* a code hub's "Sommaire" already is the plan */
  .prose { font-size: 17px; }
}

/* ---------------------------------------------------------------- codes */

.codes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.code-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; color: var(--ink); transition: border-color .12s, box-shadow .12s, transform .12s; }
.code-card:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.code-card .spine { width: 4px; align-self: stretch; border-radius: 2px; background: var(--accent); flex: none; opacity: .7; }
.code-card h3 { font-family: var(--serif); font-size: 16.5px; font-weight: 600; margin: 0 0 4px; }
.code-card .m { font-size: 12.5px; color: var(--muted); }
.code-card.abroge .spine { background: var(--line-2); }
.code-card.abroge h3 { color: var(--muted); }
.alpha { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0 22px; }
.alpha a { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); }
.alpha a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------- assistant */

.chat-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 300px; gap: 0; height: calc(100vh - var(--top)); margin: -28px clamp(-40px, -3vw, -16px) -80px; }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.chat-list .head { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-list .items { overflow: auto; padding: 0 10px 16px; flex: 1; }
.chat-list .grp { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 14px 8px 6px; }
.chat-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); font-size: 13.5px; }
.chat-item .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item:hover { background: var(--bg-2); text-decoration: none; }
.chat-item.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.chat-item .del { opacity: 0; border: 0; background: none; color: var(--faint); padding: 2px; display: grid; }
.chat-item:hover .del { opacity: 1; }
.chat-item .del:hover { color: var(--bad); }
.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface-2); }
.chat-scroll { flex: 1; overflow: auto; padding: 28px clamp(16px, 4vw, 56px) 20px; scroll-behavior: smooth; }
.chat-thread { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.msg-user { align-self: flex-end; max-width: 85%; background: var(--bg-2); color: var(--ink); padding: 11px 16px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); }
.msg-user .ctx { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.msg-user .ctx a { color: var(--accent); font-size: 12.5px; }
.msg-ai { display: flex; gap: 14px; align-items: flex-start; }
.msg-ai .avatar { width: 28px; height: 28px; flex: none; display: block; margin-top: 1px; }
.msg-ai .avatar svg { width: 100%; height: 100%; display: block; }
.msg-ai .body { flex: 1; min-width: 0; }
.steps { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.step { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-size: 13.5px; overflow: hidden; }
.step > summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 8px 12px; cursor: pointer; color: var(--ink-2); }
.step > summary::-webkit-details-marker { display: none; }
.step > summary .icon { color: var(--faint); }
.step > summary .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step > summary .sum { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.step.run > summary .lbl { color: var(--ink); }
.step.err > summary .icon { color: var(--bad); }
.step .docs { padding: 4px 12px 10px 38px; display: flex; flex-direction: column; gap: 3px; max-height: 260px; overflow: auto; }
.step .docs a { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .docs a:hover { color: var(--accent); }
.step.think > summary .icon { color: var(--fam-juri); }
.step .think-text { padding: 2px 14px 12px 38px; color: var(--muted); font-size: 13.5px; white-space: pre-wrap; max-height: 320px; overflow: auto; }
.md { font-size: 15.5px; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.3em 0 .5em; }
.md h1 { font-size: 22px; } .md h2 { font-size: 19px; } .md h3 { font-size: 16.5px; } .md h4 { font-size: 15px; }
.md p { margin: 0 0 .85em; }
.md ul, .md ol { margin: 0 0 .9em; padding-left: 1.4em; }
.md li { margin: .25em 0; }
.md li::marker { color: var(--faint); }
.md blockquote { margin: 0 0 1em; padding: 6px 16px; border-left: 3px solid var(--accent-line); color: var(--ink-2); background: var(--surface); border-radius: 0 8px 8px 0; font-family: var(--serif); }
.md code { background: var(--bg-2); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--bg-2); padding: 12px 14px; border-radius: 10px; overflow: auto; font-size: 13px; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; margin: 0 0 1em; font-size: 14px; display: block; overflow-x: auto; }
/* break-word (unlike the answer's `anywhere`) keeps whole words in a cell's minimum width: a narrow table scrolls instead of
   splitting "28/10" into one character per line */
.md th, .md td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; overflow-wrap: break-word; min-width: 4.5em; }
.md th { background: var(--surface); }
.md hr { margin: 1.4em 0; }
.md .caret { display: inline-block; width: 8px; height: 17px; background: var(--accent); vertical-align: -3px; margin-left: 2px; border-radius: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.msg-foot { display: flex; gap: 4px; margin-top: 8px; color: var(--faint); font-size: 12px; align-items: center; flex-wrap: wrap; }
.msg-err { color: var(--bad); font-size: 14px; display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.msg-check { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.msg-check.ok svg { color: var(--ok); flex: none; margin-top: 1px; }
.msg-check.warn { color: var(--bad); }
.msg-check.warn svg { flex: none; margin-top: 1px; }
.queue-note { padding: 8px 12px; border-radius: var(--r-2); background: var(--surface-2); border: 1px dashed var(--line-2); }
.cite.bad { background: transparent; color: var(--bad); border: 1px dashed var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.cite.bad:hover { background: var(--bad); color: #fff; text-decoration: none; }
.composer-wrap { padding: 12px clamp(16px, 4vw, 56px) 18px; background: linear-gradient(transparent, var(--surface-2) 30%); }
.composer { max-width: 820px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-2); padding: 10px; transition: border-color .12s, box-shadow .12s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.composer textarea { width: 100%; border: 0; outline: 0; background: transparent; resize: none; padding: 6px 8px; max-height: 260px; min-height: 26px; line-height: 1.55; font-size: 15px; }
.composer .bar { display: flex; align-items: center; gap: 8px; padding-top: 6px; flex-wrap: wrap; }
.composer .bar .seg button { padding: 5px 10px; font-size: 12.5px; }
.composer .send { margin-left: auto; width: 38px; height: 38px; border-radius: 12px; padding: 0; }
.composer .ctx-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 4px 6px; }
.composer .ctx-chips .badge button { border: 0; background: none; padding: 0; color: inherit; display: grid; }
.disclaimer { max-width: 820px; margin: 8px auto 0; text-align: center; font-size: 12px; color: var(--faint); }
.chat-sources { border-left: 1px solid var(--line); padding: 18px 16px; overflow: auto; background: var(--bg); }
.chat-sources a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2); border: 1px solid transparent; }
.chat-sources a:hover { background: var(--surface); border-color: var(--line); text-decoration: none; }
.chat-sources a .id { display: block; font-size: 11px; color: var(--faint); font-family: var(--mono); }
.welcome { max-width: 760px; margin: 6vh auto 0; text-align: center; }
.welcome .avatar { width: 48px; height: 48px; margin: 0 auto 18px; }
.welcome h2 { font-family: var(--serif); font-size: 30px; font-weight: 600; }
.welcome p { color: var(--muted); }
.prompts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 24px; text-align: left; }
.prompts button { text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; transition: border-color .12s, transform .12s; }
.prompts button:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.prompts button b { font-size: 11.5px; color: var(--faint); letter-spacing: .06em; font-weight: 650; }
.chat-mobile-bar { display: none; }
@media (max-width: 1279px) {
  .chat-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .chat-sources { display: none; }
}
@media (max-width: 1023px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--top) - 62px); margin: -20px -16px -96px; }
  .chat-list { display: none; position: fixed; inset: var(--top) 0 62px 0; z-index: 30; }
  .chat-list.open { display: flex; }
  .chat-mobile-bar { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .composer-wrap { padding: 10px 12px 12px; }
  .msg-user { max-width: 92%; }
}

/* ---------------------------------------------------------------- analysis */

.page-head { margin-bottom: 26px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(28px, 3.6vw, 38px); font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; }
.page-head p { color: var(--muted); margin: 0; font-size: 15.5px; max-width: 760px; }
.tool-switch { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 26px; }
.tool-switch a { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-3); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.tool-switch a:hover { text-decoration: none; border-color: var(--line-2); }
.tool-switch a.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); color: var(--ink); }
.tool-switch a .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ref-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 0 0 18px; }
.ref-summary .card { padding: 12px 14px; }
.ref-summary .n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.annotated { font-family: var(--serif); font-size: 16.5px; line-height: 1.8; white-space: pre-wrap; padding: 22px; max-height: 70vh; overflow: auto; }
.annotated .ref { border-radius: 4px; padding: 1px 2px; cursor: pointer; }
.annotated .ref.ok { background: var(--ok-weak); box-shadow: inset 0 -2px 0 var(--ok); }
.annotated .ref.bad { background: var(--bad-weak); box-shadow: inset 0 -2px 0 var(--bad); }
.annotated .ref.warn { background: var(--warn-weak); box-shadow: inset 0 -2px 0 var(--warn); }
.annotated .ref.mute { background: var(--bg-2); box-shadow: inset 0 -2px 0 var(--faint); }
.annotated .ref.flash { outline: 2px solid var(--accent); }
.ref-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ref-table th { text-align: left; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ref-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ref-table tr:hover td { background: var(--surface-2); }
.ref-table .note { color: var(--muted); font-size: 13px; margin-top: 3px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1023px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.drop { border: 2px dashed var(--line-2); border-radius: var(--r-3); padding: 18px; text-align: center; color: var(--muted); font-size: 14px; transition: border-color .12s, background .12s; }
.drop.over { border-color: var(--accent); background: var(--accent-weak); }
.ver-pick { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.ver-pick label { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; cursor: pointer; background: var(--surface); }
.ver-pick label:hover { border-color: var(--line-2); }
.ver-pick label.on-a { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad-weak); }
.ver-pick label.on-b { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok-weak); }
.ver-pick .ab { margin-left: auto; display: flex; gap: 4px; }
.ver-pick .ab button { width: 26px; height: 24px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12px; font-weight: 700; padding: 0; color: var(--muted); }
.ver-pick .ab button.a.on { background: var(--bad); color: #fff; border-color: transparent; }
.ver-pick .ab button.b.on { background: var(--ok); color: #fff; border-color: transparent; }

/* ---------------------------------------------------------------- veille & sources */

.day-group { margin-bottom: 26px; }
.day-group > h3 { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.day-group > h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.src-card { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.src-card h3 { font-size: 15.5px; margin: 0; display: flex; gap: 8px; align-items: center; }
.src-card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.src-card .n { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- print */

@media print {
  .topbar, .rail, .bottombar, .doc-toc, .doc-side, .doc-actions, .composer-wrap, .chat-list, .chat-sources { display: none !important; }
  .app { display: block; }
  main#view { padding: 0; }
  .doc-layout { display: block; }
  body { background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------------------------------------------------------------- modal */

dialog.modal { border: 1px solid var(--line); border-radius: var(--r-4); padding: 0; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 64px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); overflow: hidden; display: flex; flex-direction: column; }
dialog.modal:not([open]) { display: none; }
dialog.modal.wide { width: min(1080px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(10, 12, 18, .45); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; flex: 1; }
.modal-body { padding: 20px; overflow: auto; }
.side-sub + .side-sub { margin-top: 18px; }
.doc-side .tabs { gap: 0; }
.doc-side .tabs button { padding: 8px 10px; font-size: 13px; }
.search-layout > section { min-width: 0; }
.rail .rail-note a { display: inline; padding: 0; font-size: inherit; font-weight: 600; color: var(--accent); background: none; box-shadow: none; }
.rail .rail-note a:hover { text-decoration: underline; background: none; }
.composer .bar { flex-wrap: nowrap; }
.composer .bar .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 0 1 auto; }
@media (max-width: 640px) {
  .composer .bar .seg { flex: 1 1 auto; min-width: 96px; }
}
.composer .bar .seg::-webkit-scrollbar { display: none; }
.composer .bar .seg button { white-space: nowrap; flex: none; }
@media (min-width: 1280px) {
  .chat-layout.fresh { grid-template-columns: 270px minmax(0, 1fr); }
  .chat-layout.fresh .chat-sources { display: none; }
}
.cite.fam-doctrine { background: var(--fam-doctrine-weak); color: var(--fam-doctrine); border-color: color-mix(in srgb, var(--fam-doctrine) 30%, transparent); }
.cite.fam-autorite { background: var(--fam-autorite-weak); color: var(--fam-autorite); border-color: color-mix(in srgb, var(--fam-autorite) 30%, transparent); }
.cite.fam-ue { background: var(--fam-ue-weak); color: var(--fam-ue); border-color: color-mix(in srgb, var(--fam-ue) 30%, transparent); }
.cite.fam-inter { background: var(--fam-inter-weak); color: var(--fam-inter); border-color: color-mix(in srgb, var(--fam-inter) 30%, transparent); }
.cite.fam-doctrine:hover, .cite.fam-autorite:hover, .cite.fam-ue:hover, .cite.fam-inter:hover { color: #fff; }
.cite.fam-doctrine:hover { background: var(--fam-doctrine); } .cite.fam-autorite:hover { background: var(--fam-autorite); }
.cite.fam-ue:hover { background: var(--fam-ue); } .cite.fam-inter:hover { background: var(--fam-inter); }
.hero .eyebrow { display: inline-block; max-width: 100%; line-height: 1.45; }
.hero .eyebrow .icon { vertical-align: -3px; margin-right: 4px; }
.hero .eyebrow b.warn { color: var(--warn); }
@media (max-width: 640px) { .top-search .hint, .search-head .hint, #s-kb { display: none; } .searchbox input { padding-right: 14px; } }
@media (max-width: 640px) {
  .examples { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin: 18px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
  .examples::-webkit-scrollbar { display: none; }
  .examples .pill { flex: none; white-space: nowrap; }
  .searchbox.big input { padding-right: 60px; }
  .searchbox.big .go span { display: none; }
  .searchbox.big .go { width: 44px; padding: 0; }
}

/* ---------------------------------------------------------------- mobile drawer */
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(10, 12, 18, .42); }
@media (max-width: 1023px) {
  .bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 500; padding: 0; }
  .bottombar button.on, .app.drawer-open .bottombar button { color: var(--accent); }
  .app.drawer-open .rail {
    display: flex; position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; height: 100%; width: min(300px, 84vw);
    background: var(--surface); box-shadow: var(--shadow-3); padding-top: 20px; animation: drawer .18s ease-out;
  }
  @keyframes drawer { from { transform: translateX(-24px); opacity: .4; } to { transform: none; opacity: 1; } }
}
@media (min-width: 1024px) { .scrim { display: none; } }

/* ---------------------------------------------------------------- shared bits for the newer pages */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 18px 0 24px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: inherit; }
a.kpi:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow-1); }
.kpi .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 13px; color: var(--muted); }
.kpi.warn .n { color: var(--warn); } .kpi.bad .n { color: var(--bad); } .kpi.ok .n { color: var(--ok); } .kpi.acc .n { color: var(--accent); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.page-head h1 { font-size: clamp(24px, 3vw, 32px); margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 760px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 16px; }
.toolbar .searchbox { flex: 1 1 260px; min-width: 0; }
.toolbar .select { width: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--accent-line); text-decoration: none; }
.chip.on { background: var(--accent-weak); border-color: var(--accent-line); color: var(--accent); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1023px) { .grid-2, .grid-main { grid-template-columns: minmax(0, 1fr); } }

/* bill progress: 7 steps from deposit to promulgation */
.steps7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin: 8px 0 4px; }
.steps7 i { height: 6px; border-radius: 3px; background: var(--line); }
.steps7 i.done { background: var(--accent); }
.steps7.ok i.done { background: var(--ok); }
.steps7.bad i.done { background: var(--bad); }
.steps7-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; font-size: 11px; color: var(--faint); }
.steps7-labels span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps7-labels span.on { color: var(--ink-2); font-weight: 600; }
.bill { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); color: inherit; }
.bill + .bill { margin-top: 10px; }
.bill:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow-1); }
.bill .top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.bill h3 { font-size: 16px; margin: 6px 0 2px; color: var(--ink); font-weight: 600; }
.bill .by { font-size: 13px; color: var(--muted); }
.bill .now { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.bill .next { font-size: 13px; color: var(--accent); margin-top: 2px; }
.bill .res { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; border-left: 3px solid var(--accent-line); padding-left: 10px; }
.flag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.flag.acc { background: var(--warn-weak); color: var(--warn); }
.flag.gov { background: var(--accent-weak); color: var(--accent); }
.flag.parl { background: var(--fam-juri-weak); color: var(--fam-juri); }
.agenda-day { margin-top: 18px; }
.agenda-day h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; }
.agenda-item { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.agenda-item .ch { font-size: 12px; color: var(--muted); }
.agenda-item a { color: var(--ink); font-weight: 500; }
@media (max-width: 640px) { .agenda-item { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.mesure { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mesure .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.late { color: var(--bad); font-weight: 600; }
.digest { font-size: 15px; }
.digest h2, .digest h3 { font-size: 17px; margin-top: 18px; }

/* timeline of a parliamentary dossier */
.ptl { list-style: none; margin: 0; padding: 0; position: relative; }
.ptl::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.ptl li { position: relative; padding: 0 0 14px 28px; }
.ptl li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.ptl li.res::before { border-color: var(--ok); }
.ptl li.bad::before { border-color: var(--bad); }
.ptl li.future::before { border-style: dashed; border-color: var(--accent); }
.ptl .when { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ptl .what { font-size: 14px; }
.ptl .det { font-size: 12.5px; color: var(--muted); }
.ptl-phase { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin: 14px 0 8px; }
.ptl-phase:first-child { margin-top: 0; }

/* audit findings */
.finding { display: grid; grid-template-columns: 6px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); }
.finding + .finding { margin-top: 8px; }
.finding .sev { border-radius: 3px; background: var(--line-2); }
.finding.s3 .sev { background: var(--bad); } .finding.s2 .sev { background: var(--warn); } .finding.s1 .sev { background: var(--info); }
.finding .ttl { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 13px; color: var(--muted); }
.finding .ttl b { color: var(--ink); font-size: 14px; }
.finding .msg { margin-top: 3px; font-size: 14.5px; }
.finding .det { margin-top: 4px; font-size: 13px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.finding .refs { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.sev-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.sev-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* compliance map */
.cmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 14px 0; }
.cmap > div { border: 1px solid var(--line); border-radius: var(--r-2); padding: 12px 14px; background: var(--surface); }
.cmap h4 { margin: 0 0 4px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.cmap p { margin: 0; font-size: 13px; color: var(--muted); }
.cmap .k-ok h4 { color: var(--ok); } .cmap .k-cond h4 { color: var(--warn); } .cmap .k-no h4 { color: var(--bad); }
.cmap .k-obl h4 { color: var(--accent); } .cmap .k-sanc h4 { color: var(--fam-juri); } .cmap .k-grey h4 { color: var(--muted); }

/* charts */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bars .bar { display: grid; grid-template-columns: minmax(90px, 220px) minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 13px; }
.bars .bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bars .bar .track { display: block; height: 10px; border-radius: 5px; background: var(--bg-2); overflow: hidden; }
.bars .bar .fill { display: block; height: 100%; border-radius: 5px; background: var(--accent); min-width: 2px; }
.bars .bar .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.cols { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 10px; }
.cols > div { flex: 1; min-width: 2px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.cols > div:hover { opacity: 1; }
.cols-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 4px; }
@media (max-width: 640px) { .bars .bar { grid-template-columns: minmax(70px, 120px) minmax(0, 1fr) 54px; } }

/* bookmarks */
.fav { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); }
.fav + .fav { margin-top: 8px; }
.fav h3 { font-size: 15px; margin: 0; overflow-wrap: anywhere; }
.fav .note { font-size: 14px; color: var(--ink-2); margin-top: 4px; white-space: pre-wrap; }
.fav .meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.btn.on .icon { fill: currentColor; color: var(--warn); }

/* compare */
.cmp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.cmp .card { min-width: 0; }
@media (max-width: 1023px) { .cmp { grid-template-columns: minmax(0, 1fr); } }

/* analysis tools: audit checklist, chip sets, clickable KPIs, compare */
.checks li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.checks li:first-child { border-top: 0; padding-top: 0; }
.checks .dot { width: 10px; height: 10px; border-radius: 3px; margin-top: 5px; background: var(--info); }
.checks .dot.s3 { background: var(--bad); } .checks .dot.s2 { background: var(--warn); }
.chip-set { display: flex; flex-wrap: wrap; gap: 6px; }
button.kpi { font: inherit; text-align: left; cursor: pointer; }
button.kpi:hover { border-color: var(--accent-line); }
.kpi.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rel-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.rel-list li { padding: 5px 0; border-top: 1px solid var(--line); }
.rel-list li:first-child { border-top: 0; }
.cmp-head { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.cmp-head .small { margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cmp-text { white-space: pre-wrap; font-family: var(--serif, Georgia, serif); font-size: 15px; line-height: 1.65; max-height: 70vh; overflow: auto; overflow-wrap: anywhere; }
@media (max-width: 1023px) { .cmp-text { max-height: none; } }
@media (max-width: 760px) {
  .tool-switch { display: flex; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 2px; }
  .tool-switch::-webkit-scrollbar { display: none; }
  .tool-switch a { flex: 0 0 auto; padding: 10px 12px; }
}

/* observatory charts: stacked columns with 2px gaps, recessive grid, hover tooltip, table view */
.obs .obs-sub { margin: -4px 0 14px; }
.obs .panel-title { font-size: 13px; color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.legend i, .vchart .tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.vchart { position: relative; }
.vchart .plot { position: relative; display: flex; align-items: stretch; gap: 2px; border-bottom: 1px solid var(--line-2); margin-top: 16px; padding-left: 34px; }
.vchart .xrow { padding-left: 34px; }
.vchart .grid { position: absolute; inset: 0; pointer-events: none; }
.vchart .grid span { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--line); }
.vchart .grid em { position: absolute; left: 0; bottom: 2px; font-style: normal; font-size: 11px; line-height: 1; color: var(--faint); font-variant-numeric: tabular-nums; }
.vchart .col { flex: 1; min-width: 0; display: flex; flex-direction: column-reverse; gap: 2px; cursor: default; outline: none; position: relative; z-index: 1; }
.vchart .col i { display: block; min-height: 1px; transition: opacity .12s; }
.vchart .col i:last-child { border-radius: 4px 4px 0 0; }
.vchart .col.dim i { opacity: .38; }
.vchart .col:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 4px; }
.vchart .xrow { display: flex; gap: 2px; margin-top: 4px; }
.vchart .xrow span { flex: 1; min-width: 0; font-size: 11px; color: var(--faint); text-align: center; white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; }
.vchart .tip { position: absolute; top: 0; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-2);
  border-radius: 8px; padding: 8px 10px; font-size: 12.5px; white-space: nowrap; color: var(--ink-2); }
.vchart .tip b { color: var(--ink); }
.tview { margin-top: 12px; font-size: 13px; }
.tview summary { cursor: pointer; color: var(--muted); }
.tview table { margin-top: 8px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.data th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.obs-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.obs-split > div { padding: 12px 14px; border-radius: var(--r-2); background: var(--bg-2); }
.obs-split .big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.obs-h4 { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 4px 0 8px; }
@media (max-width: 640px) { .vchart .plot, .vchart .xrow { gap: 1px; } .vchart .col { gap: 1px; } .obs-split { grid-template-columns: minmax(0, 1fr); } }

/* bookmarks page */
.fav-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.fav-side { position: sticky; top: calc(var(--top) + 16px); }
.fside { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; margin: 0 -8px; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: 13.5px; color: var(--ink-2); text-align: left; cursor: pointer; }
.fside span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fside .c { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.fside:hover { background: var(--bg-2); }
.fside.on { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.fav-act { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 860px) {
  .fav-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .fav-side { position: static; display: flex; flex-direction: column; gap: 10px; }
  .fav-side .facet { margin: 0; }
  .fav-side .facet:first-child { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .fav-side .facet:first-child h4 { display: none; }
  .fav-side .fside { width: auto; flex: none; margin: 0; border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; }
  .fav-side .fside span:nth-child(2) { overflow: visible; }
  .fav-act { flex-direction: row; }
}

/* small screens: action rows scroll instead of stacking, headers breathe */
@media (max-width: 640px) {
  .doc-actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 2px; }
  .doc-actions::-webkit-scrollbar { display: none; }
  .doc-actions > * { flex: none; }
  .page-head > .row { width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi .n { font-size: 22px; }
  .finding { padding: 10px 12px; gap: 10px; }
  .grid-main > aside { order: 2; }
}
dialog .field + .field, dialog .field + .grid-2 { margin-top: 12px; }
@media (max-width: 640px) {
  .steps7-labels { display: block; }
  .steps7-labels span { display: none; }
  .steps7-labels span.on { display: block; overflow: visible; }
}

/* ---------------------------------------------------------------- page column, site footer, server-rendered content */

.main-col { min-width: 0; display: flex; flex-direction: column; }
.main-col > main#view { flex: 1; }
.sitefoot { border-top: 1px solid var(--line); background: var(--surface-2); padding: 36px clamp(16px, 3vw, 40px) 40px; font-size: 13.5px; color: var(--muted); }
.sitefoot-in { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.sitefoot h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 0 0 10px; }
.sitefoot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sitefoot a { color: var(--muted); }
.sitefoot a:hover { color: var(--accent); }
.sitefoot p { margin: 0 0 10px; line-height: 1.55; }
.sitefoot .fine { font-size: 12px; color: var(--faint); }
@media (max-width: 1023px) { .sitefoot { padding-bottom: 96px; } .sitefoot-in { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sitefoot-in { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.main-col:has(> main.chat-view) > .sitefoot { display: none; }  /* the assistant fills the viewport: no page scroll */

/* what crawlers and the first paint see, before the app takes over */
.app.ssr .rail a { font-size: 14px; }
.app.ssr .crumbs, .ssr-doc .crumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.crumbs a { color: var(--muted); }
.ssr-doc .tags { margin-bottom: 10px; }
.ssr-doc h1 { font-family: var(--serif); font-size: clamp(26px, 3.4vw, 38px); font-weight: 600; letter-spacing: -.02em; margin: 0 0 8px; }
.ssr-doc h1.long { font-size: clamp(21px, 2.4vw, 28px); line-height: 1.3; }
.ssr-sec { margin: 32px 0 0; }
.ssr-sec > h2, .ssr-nota h2 { font-size: 18px; margin: 0 0 12px; }
.ssr-sub { font-size: 17px; margin: 28px 0 8px; }
.ssr-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ssr-links li p, .ssr-hits li p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.ssr-links .tag { display: inline-block; min-width: 92px; font-size: 12px; color: var(--muted); }
.ssr-hits { margin: 0; padding-left: 18px; display: grid; gap: 12px; }
.ssr-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 20px; }
.ssr-grid li p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.ssr-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 20px; margin: 0 0 20px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); }
.ssr-facts dt { font-size: 12px; color: var(--muted); }
.ssr-facts dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.ssr-nota { margin: 24px 0 0; padding: 14px 16px; border-left: 3px solid var(--accent-line); background: var(--surface-2); border-radius: 0 var(--r-2) var(--r-2) 0; }
.ssr-art { margin: 22px 0; }
.ssr-art h3 { font-size: 16px; margin: 0 0 6px; }
.ssr-art p { margin: 0 0 .6em; line-height: 1.7; }
.ssr-pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.ssr-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.ssr-toc ul { margin: 4px 0; padding-left: 18px; }
.ssr-toc li { margin: 3px 0; }
.ssr-go { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 0; }
.ssr-go input { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--r-1, 8px); background: var(--surface); color: var(--ink); width: 9em; }
.ssr-source { margin: 32px 0 0; font-size: 12.5px; color: var(--faint); }
.ssr-tabs { font-size: 14px; margin: -8px 0 20px; }
.ssr-faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.ssr-faq summary { cursor: pointer; font-weight: 600; }
.ssr-faq p { margin: 8px 0 0; color: var(--ink-2); }
.app.ssr .hero form.searchbox { display: flex; gap: 8px; }
.app.ssr .hero form.searchbox input { flex: 1; }
.app.ssr .top-search input { width: 100%; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.msg-cached { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding: 8px 12px; border-radius: var(--r-2); background: var(--surface-2); border: 1px dashed var(--line-2); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; font-weight: 600; }
.linkish:hover { text-decoration: underline; }
.code-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 2px; font-weight: 600; font-size: 15.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--muted); transition: transform .2s ease; flex: none; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq p { margin: 0 0 16px; color: var(--ink-2); max-width: 820px; line-height: 1.65; }
.doc-head h1 .h1-of { display: block; font-family: var(--sans); font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-top: 6px; }

/* ---------------------------------------------------------------- motion */

#readbar {
  position: fixed; top: var(--top); left: 0; right: 0; height: 2px; z-index: 41; pointer-events: none;
  transform-origin: 0 50%; transform: scaleX(var(--p, 0)); opacity: 0; transition: opacity .25s; background: var(--accent);
}
body[data-route="doc"] #readbar.on { opacity: 1; }
#view.enter > * { animation: rise .28s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.code-pills .pill { transition: border-color .15s, background .15s; }
.prompts button:hover { box-shadow: var(--shadow-1); }

/* key case law under an article (doc.js juriInline, mirrors the server-rendered section) */
.doc-juri { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.doc-juri h2 { font-size: 19px; margin: 0 0 14px; }
.juri-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.juri-list li { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.juri-list li:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.juri-list a { font-weight: 600; line-height: 1.4; }
.juri-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }
.juri-list .snip { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

/* ---------------------------------------------------------------- home: one box, the assistant by default */

.top-links { display: none; }
.app[data-route="home"] { grid-template-columns: minmax(0, 1fr); }
.app[data-route="home"] .rail { display: none; }
.app[data-route="home"] .topbar { background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; position: static; }
.app[data-route="home"] .top-search, .app[data-route="home"] .brand, .app[data-route="home"] .top-actions .ask-btn { visibility: hidden; }
.app[data-route="home"] .top-links { display: flex; gap: 2px; align-items: center; }
.top-links a { padding: 6px 10px; border-radius: var(--r-2); color: var(--ink-2); font-size: 14px; font-weight: 500; }
.top-links a:hover { background: var(--bg-2); text-decoration: none; color: var(--ink); }
@media (max-width: 1023px) { .app[data-route="home"] .top-links { display: none; } }

.home-hero { min-height: calc(100vh - var(--top) - 96px); min-height: calc(100svh - var(--top) - 96px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 0 9vh; }
.home-logo { display: block; width: min(330px, 70vw); height: auto; color: var(--ink); margin: 0 0 14px; }
.home-hero h1 { font: 400 clamp(15.5px, 1.5vw, 17px)/1.45 var(--sans); color: var(--muted); margin: 0 0 30px; letter-spacing: 0; max-width: 640px; text-wrap: balance; }
.askbox { width: min(720px, 100%); position: relative; text-align: left; }
.askbox .well { background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; padding: 14px 12px 10px 20px; box-shadow: var(--shadow-1); transition: box-shadow .15s, border-color .15s; }
.askbox .well:hover, .askbox:focus-within .well { box-shadow: var(--shadow-2); }
.askbox:focus-within .well { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.askbox textarea { display: block; width: 100%; border: 0; outline: 0; resize: none; background: transparent; color: var(--ink); font-size: 17px; line-height: 1.5; min-height: 27px; max-height: 220px; padding: 0 8px 0 0; }
.askbox textarea::placeholder { color: var(--faint); }
.askbox .bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.askbox .modes-mini { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--bg-2); }
.askbox .modes-mini button { border: 0; background: none; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 550; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.askbox .modes-mini button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.askbox .go { margin-left: auto; width: 38px; height: 38px; border-radius: 50%; padding: 0; }
.askbox .go[disabled] { opacity: .35; }
.askbox .suggest { top: calc(100% + 8px); }
.askbox .hint-line { margin: 10px 4px 0; font-size: 12.5px; color: var(--faint); text-align: center; }
.home-ex { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px auto 0; max-width: 760px; }
.home-ex a { font-size: 13.5px; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.home-ex a:hover { border-color: var(--line-2); text-decoration: none; color: var(--ink); }
.home-meta { margin-top: 26px; font-size: 13px; color: var(--faint); display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.home-meta .live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
.home-meta.warn .live { background: var(--warn); }

.home-sec { max-width: 1080px; margin: 0 auto; padding: 40px 0 8px; border-top: 1px solid var(--line); }
.home-sec + .home-sec { margin-top: 28px; }
.home-sec > h2, .home-cols h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.home-sec h2 a, .home-cols h2 a { font: 500 13.5px var(--sans); letter-spacing: 0; }
.link-cols { columns: 3 220px; column-gap: 36px; margin: 0; padding: 0; list-style: none; }
.link-cols li { break-inside: avoid; }
.link-cols a { display: block; padding: 5px 0; color: var(--ink-2); font-size: 14.5px; }
.link-cols a:hover { color: var(--accent); }
.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 48px; }
.home-list { list-style: none; margin: 0; padding: 0; }
.home-list li { padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.home-list li:first-child { border-top: 0; padding-top: 0; }
.home-list a { color: var(--ink); font-weight: 500; line-height: 1.4; }
.home-list a:hover { color: var(--accent); text-decoration: none; }
.home-list .m { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.tool-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 40px; }
.tool-list a { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 2px 12px; padding: 13px 0; border-top: 1px solid var(--line); color: var(--ink); }
.tool-list a:hover { text-decoration: none; }
.tool-list a:hover b { color: var(--accent); }
.tool-list .icon { color: var(--muted); margin-top: 2px; }
.tool-list b { grid-column: 2; font-weight: 600; font-size: 15px; }
.tool-list span { grid-column: 2; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
@media (max-width: 1023px) {
  .home-hero { min-height: calc(100svh - var(--top) - 150px); padding-bottom: 4vh; }
  .home-cols { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 640px) {
  .home-logo { width: min(250px, 68vw); }
  .home-hero h1 { margin-bottom: 22px; }
  .askbox .well { border-radius: 18px; padding: 12px 10px 8px 16px; }
  .askbox textarea { font-size: 16px; }
  .home-ex { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin: 18px -16px 0; padding: 0 16px 4px; scrollbar-width: none; max-width: none; width: calc(100% + 32px); }
  .home-ex::-webkit-scrollbar { display: none; }
  .home-ex a { flex: none; white-space: nowrap; }
}

/* ---------------------------------------------------------------- assistant: research steps fold into one line */

.process { margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); }
.process > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; font-size: 13.5px; color: var(--muted); user-select: none; }
.process > summary::-webkit-details-marker { display: none; }
.process > summary .lbl { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.process > summary .now { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.process > summary .chev { margin-left: auto; color: var(--faint); transition: transform .15s; }
.process[open] > summary .chev { transform: rotate(180deg); }
.process > summary .icon.done { color: var(--ok); }
.process .proc-body { border-top: 1px solid var(--line); padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.process .step { border: 0; background: none; border-radius: var(--r-2); }
.process .step > summary { padding: 6px 8px; }
.process .step > summary:hover { background: var(--surface-2); }
.process .step .docs { padding: 2px 8px 8px 34px; }
.process .step .think-text { padding: 2px 10px 10px 34px; }
.process .note { font-size: 13.5px; color: var(--muted); padding: 4px 8px 4px 34px; line-height: 1.5; }
.process .note p { margin: 0; }
.step.think > summary .icon { color: var(--faint); }

/* mode picker: one compact button, the modes in a menu */
.mode-pick { position: relative; min-width: 0; }
.mode-pick > button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 550; max-width: 100%; }
.mode-pick > button:hover { border-color: var(--line-2); }
.mode-pick > button .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 30; width: min(360px, calc(100vw - 40px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-3); padding: 6px; display: none; }
.mode-menu.open { display: block; }
.mode-menu button { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 1px 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: var(--r-2); color: var(--ink); }
.mode-menu button:hover, .mode-menu button:focus-visible { background: var(--bg-2); outline: none; }
.mode-menu button.on { background: var(--accent-weak); }
.mode-menu button .icon { margin-top: 2px; color: var(--muted); }
.mode-menu button.on .icon { color: var(--accent); }
.mode-menu button b { font-size: 14px; font-weight: 600; }
.mode-menu button span { grid-column: 2; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.composer .bar { gap: 6px; }
.mode-pick > button .ic { display: inline-flex; color: var(--muted); }
.mode-pick > button[aria-expanded="true"] { border-color: var(--line-2); background: var(--surface); }
.process .note.md { font-size: 13.5px; }
.process .note.md > :last-child { margin-bottom: 0; }
.msg-ai .body > .md:first-child { margin-top: 2px; }
