/* The brand's purple and gold, from the logo. Light by default; dark when
   the device prefers it -- unless the person has picked a theme with the
   switch at the top right (_theme_toggle.html), which sets
   <html data-theme="light|dark"> and remembers it in a cookie. */
:root {
  --bg: #FBFAFE;
  --ink: #1E1654;
  --muted: #625E86;
  --border: #E4E1F2;
  --accent: #534AB7;
  --accent-soft: #EFEDFD;
  --gold: #EF9F27;
  --gold-soft: #FDF1DD;
  --on-gold: #1E1654;
  --danger: #C0392B;
  --success: #1E7E4A;
  /* The background's radial glows -- a shade deeper than --bg in light mode,
     a shade lighter in dark. Kept faint enough that every text colour still
     has at least 4.6:1 contrast at the glow's strongest point. */
  --glow: #EEEBFB;
  --glow-warm: #FBF1E1;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  /* A violet glow from the top and a faint warm one at the bottom right,
     fixed while the page scrolls: dark-on-light in light mode,
     light-on-dark in dark mode. */
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -10%, var(--glow) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, var(--glow-warm) 0%, transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

nav.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

nav.topbar .brand {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

nav.topbar .links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 14px; }
/* On a phone the links drop below the brand instead of pushing the page wider. */
nav.topbar { flex-wrap: wrap; gap: 12px 24px; }
nav.topbar .links a.button { color: var(--ink); }

/* Breadcrumbs are plain inline links with the separator in the markup
   itself, so they read as one line even if this stylesheet is stale. */
nav.breadcrumbs { margin: -16px 0 24px; font-size: 13px; color: var(--muted); line-height: 1.8; }
nav.breadcrumbs .sep { margin: 0 3px; }
nav.breadcrumbs [aria-current="page"] { color: var(--ink); }

h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.subtitle { color: var(--muted); font-size: 14px; margin: 0 0 28px; }

.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.messages li {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 8px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
tr:last-child td { border-bottom: none; }

.btn {
  display: inline-block;
  border: none;
  background: var(--gold);
  color: var(--on-gold);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { opacity: 0.88; text-decoration: none; }
.btn:focus-visible, a:focus-visible, button:focus-visible, .pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--border); }

form .field { margin-bottom: 18px; }
form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
form input[type="text"], form input[type="email"], form input[type="url"],
form input[type="number"], form input[type="date"], form input[type="password"],
form textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14.5px;
  color: var(--ink);
  font-family: inherit;
}
form select {
  width: 100%;
  border: 1px solid var(--border);
  /* Solid, not transparent: a <select>'s open option-list popup is drawn
     by the browser/OS, not the page, and doesn't reliably inherit a
     transparent background -- it tends to fall back to a system default
     (often white), which combined with var(--ink) text color can render
     as invisible white-on-white in dark mode. option { } below applies
     the same treatment to the popup's individual rows. */
  background: var(--bg);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14.5px;
  color: var(--ink);
  font-family: inherit;
}
form select option {
  background: var(--bg);
  color: var(--ink);
}
form input:focus, form textarea:focus, form select:focus { outline: none; border-color: var(--accent); }
form .helptext { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
form ul.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--danger); font-size: 13px; }

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge.muted { background: var(--border); color: var(--muted); }

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 1px; /* avoids a layout jump when the first chip appears */
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  font-size: 13px;
  line-height: 1.4;
}
.chip button {
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
}
.chip button:hover { background: var(--border); }

.progress-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; width: 100px; }
.progress-fill { height: 100%; background: var(--accent); }

.empty { color: var(--muted); font-size: 14px; padding: 32px 0; text-align: center; }

.alert-warning {
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-success {
  background: rgba(46, 160, 90, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 20px;
}

.actions-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.key-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--accent-soft);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  word-break: break-all;
}

/* -- Back office (admin subdomain) ------------------------------------ */

.shell.wide { max-width: 1160px; }
nav.topbar .links a.current { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--gold); padding-bottom: 2px; }
.messages li.error { background: rgba(192, 57, 43, 0.1); color: var(--danger); }
.muted { color: var(--muted); }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 0 0 28px;
}
.kpi { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.kpi .label { font-size: 12.5px; color: var(--muted); }
.kpi .value { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .note { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 600; border-top: 2px solid var(--border); }
.neg { color: var(--danger); }
.table-scroll { overflow-x: auto; }

.section { margin-top: 40px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.section-head .links { display: flex; gap: 14px; font-size: 13.5px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; }
@media (max-width: 820px) { .grid-2, .grid-main { grid-template-columns: minmax(0, 1fr); } }
.panel { border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 20px; }
.panel h2 { font-size: 15px; }

form.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 20px; }
form.toolbar .field { margin: 0; }
form.toolbar input, form.toolbar select { width: auto; padding: 7px 10px; font-size: 14px; }
form.toolbar input[type="search"] { min-width: 220px; border: 1px solid var(--border); background: transparent; border-radius: 8px; color: var(--ink); font-family: inherit; }
form.toolbar .range { display: flex; gap: 10px; align-items: flex-end; }
form.toolbar .range[hidden] { display: none; }
form.toolbar .check { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--ink); margin: 0 0 8px; }
.period-label { font-size: 13px; color: var(--muted); margin: 0 0 9px; }

form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
form.inline input[type="number"] { width: 100px; padding: 5px 8px; font-size: 13.5px; }
form.inline .inline-label { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); margin: 0; }
form.inline:has(.inline-label) { align-items: flex-end; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pill { font-size: 13px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); color: var(--ink); }
.pill:hover { text-decoration: none; border-color: var(--accent); }
.pill.on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.pill .count { color: var(--muted); margin-left: 4px; }
.pill.on .count { color: var(--bg); opacity: 0.7; }

.badge.warn { background: rgba(192, 57, 43, 0.1); color: var(--danger); }
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.gold { background: var(--gold-soft); color: var(--ink); }

.bar-track { background: var(--border); border-radius: 4px; height: 8px; min-width: 120px; }
.bar-fill { background: var(--accent); border-radius: 4px; height: 100%; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: none; }
.timeline .meta { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.timeline .body { white-space: pre-line; font-size: 14px; }

.report-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.report-list .panel { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.report-list .panel p { margin: 0; font-size: 13.5px; color: var(--muted); flex: 1; }
.report-list .panel .links { display: flex; gap: 14px; font-size: 13.5px; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); font-size: 13px; }
dl.facts dd { margin: 0; }

.checkbox-list label { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Hourly weighting preview on the ad page. The equalizer itself is styled
   in ads/ad_weighting.html. */
.eq-mini { display: inline-flex; align-items: flex-end; gap: 2px; width: 168px; height: 28px; vertical-align: middle; }
.eq-mini span { flex: 1; min-height: 2px; background: var(--accent); border-radius: 1px; }
.eq-mini:hover { text-decoration: none; opacity: 0.8; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13102A; --ink: #F2F0FC; --muted: #9C97C0; --border: #2D2852;
    --accent: #A99FF5; --accent-soft: #231E47;
    --gold: #F4B04A; --gold-soft: #3A2C14; --on-gold: #1E1654; --danger: #FF7B6E; --success: #5BD08A;
    --glow: #211B49; --glow-warm: #241A2E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #13102A; --ink: #F2F0FC; --muted: #9C97C0; --border: #2D2852;
    --accent: #A99FF5; --accent-soft: #231E47;
    --gold: #F4B04A; --gold-soft: #3A2C14; --on-gold: #1E1654; --danger: #FF7B6E; --success: #5BD08A;
    --glow: #211B49; --glow-warm: #241A2E;
    color-scheme: dark;
}

/* == Workspace building blocks (tabs, dialogs, menus, cards) ================
   A client's pages share a header and a row of tabs (backoffice/client_base);
   occasional actions open in a dialog instead of sitting open on the page;
   per-row actions live in a "..." menu. See static/js/ui.js. */

.ws-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ws-header h1 { margin: 0; }
.ws-header .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.ws-stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 4px 0 18px; font-size: 14px; }
.ws-stats .stat .label { color: var(--muted); font-size: 12px; display: block; }
.ws-stats .stat .value { font-weight: 600; font-variant-numeric: tabular-nums; }
.ws-stats .stat .value.neg { color: var(--danger); }
.ws-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 24px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: 9px 14px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14.5px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold); font-weight: 600; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: -8px 0 20px; }
.subtabs a { padding: 5px 12px; border-radius: 999px; font-size: 13.5px; color: var(--muted); border: 1px solid var(--border); }
.subtabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.toolbar .filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .filters input, .toolbar .filters select { width: auto; min-width: 140px; }

dialog.modal { border: 1px solid var(--border); border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgba(20, 14, 60, 0.25); }
dialog.modal::backdrop { background: rgba(20, 14, 60, 0.45); }
dialog.modal .modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
dialog.modal .modal-head h2 { margin: 0; font-size: 17px; }
dialog.modal .modal-body { padding: 16px 20px; max-height: 70vh; overflow-y: auto; }
dialog.modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
dialog.modal .close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }

details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; color: var(--ink); user-select: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { background: var(--accent-soft); }
details.menu .menu-items { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 200px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 14, 60, 0.15); padding: 6px; }
details.menu .menu-items a, details.menu .menu-items button { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px; background: none; border: none; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
details.menu .menu-items a:hover, details.menu .menu-items button:hover { background: var(--accent-soft); text-decoration: none; }
details.menu .menu-items .danger { color: var(--danger); }
details.menu .menu-items hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
details.user-menu > summary { border-color: transparent; color: var(--muted); font-size: inherit; }
details.user-menu .menu-items { min-width: 160px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.card h3 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h3 a { font-size: 13px; font-weight: 400; }
.card .big { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.card .line { font-size: 13.5px; color: var(--muted); }

details.explain { margin: 8px 0 20px; font-size: 13px; color: var(--muted); }
details.explain > summary { cursor: pointer; }

/* Printing (e.g. an invoice): just the page itself, without the site's navigation. */
@media print {
  .topbar, .breadcrumbs, .tabs, .subtabs, .btn-row, .ws-actions, .messages { display: none !important; }
}

/* == The branded header band ================================================
   Every page's top bar and breadcrumbs sit on the landing page's deep indigo
   field -- shades and tints of --ink and --accent with a warm gold glow and a
   faint grid -- drawn full width behind them. The page below keeps its own
   light or dark theme. */
:root { --band-deep: #120C38; --band-mid: #2A2170; --band-pale: #C9C4F4; }
body { overflow-x: clip; }
nav.topbar { position: relative; border-bottom: none; padding: 0 0 20px; margin-bottom: 0; }
nav.topbar::before {
  content: "";
  position: absolute; z-index: -1;
  top: -32px; bottom: -66px; left: 50%; width: 100vw; margin-left: -50vw;
  background:
    linear-gradient(rgba(201, 196, 244, 0.06) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(201, 196, 244, 0.06) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(ellipse 45% 120% at 88% 0%, rgba(140, 132, 224, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 35% 110% at 6% 100%, rgba(239, 159, 39, 0.20) 0%, transparent 70%),
    radial-gradient(ellipse 60% 120% at 30% 0%, rgba(83, 74, 183, 0.70) 0%, transparent 75%),
    linear-gradient(160deg, var(--band-mid) 0%, var(--band-deep) 75%);
  border-bottom-left-radius: 0; box-shadow: 0 12px 40px rgba(18, 12, 56, 0.18);
}
nav.topbar .brand, nav.topbar .brand a { color: #FFFFFF; }
nav.topbar .links, nav.topbar .links span { color: var(--band-pale) !important; }
nav.topbar .links a { color: var(--band-pale); }
nav.topbar .links a:hover, nav.topbar .links a.current { color: #FFFFFF; text-decoration: none; }
nav.topbar .links a.current { box-shadow: inset 0 -2px 0 var(--gold); padding-bottom: 2px; }
nav.topbar .links a.muted { color: var(--band-pale); opacity: 0.8; }
nav.topbar .links button { color: #FFFFFF !important; }
nav.topbar details.menu > summary { color: var(--band-pale); border-color: rgba(201, 196, 244, 0.35); background: transparent; }
nav.topbar details.menu[open] > summary { background: rgba(201, 196, 244, 0.15); }
nav.topbar details.menu .menu-items a, nav.topbar details.menu .menu-items button { color: var(--ink) !important; }

nav.breadcrumbs { margin: 4px 0 64px; color: var(--band-pale); position: relative; }
nav.breadcrumbs a { color: #FFFFFF; opacity: 0.85; }
nav.breadcrumbs a:hover { opacity: 1; }
nav.breadcrumbs [aria-current="page"] { color: #FFFFFF; font-weight: 500; }
/* Pages without breadcrumbs: the band's depth below the top bar, then a gap. */
.shell:not(:has(nav.breadcrumbs)) > nav.topbar { margin-bottom: 98px; }

/* Panels, cards and figures: the landing page's softer, lifted surfaces. */
.panel, .card, .kpi, dialog.modal { border-radius: 14px; }
.panel, .card, .kpi { background: var(--bg); box-shadow: 0 10px 28px rgba(20, 14, 60, 0.06); }
.tabs { margin-top: 0; }

/* The band in each theme. Light: pale tints of --accent with a soft violet
   glow, a warm gold one and a faint violet grid, under dark text. Dark: the
   landing page's deep indigo (above), under light text. */
:root {
  --band-text: #4A4478; --band-strong: #1E1654; --band-grid: rgba(83, 74, 183, 0.07);
  --band-fill:
    radial-gradient(ellipse 45% 120% at 88% 0%, rgba(140, 132, 224, 0.38) 0%, transparent 70%),
    radial-gradient(ellipse 35% 110% at 6% 100%, rgba(239, 159, 39, 0.16) 0%, transparent 70%),
    radial-gradient(ellipse 60% 120% at 30% 0%, rgba(201, 196, 244, 0.70) 0%, transparent 75%),
    linear-gradient(160deg, #E9E6FB 0%, #F6F4FE 75%);
  --band-shadow: 0 10px 30px rgba(83, 74, 183, 0.10);
  --band-edge: #E0DCF6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --band-text: #C9C4F4; --band-strong: #FFFFFF; --band-grid: rgba(201, 196, 244, 0.06);
    --band-fill:
      radial-gradient(ellipse 45% 120% at 88% 0%, rgba(140, 132, 224, 0.55) 0%, transparent 70%),
      radial-gradient(ellipse 35% 110% at 6% 100%, rgba(239, 159, 39, 0.20) 0%, transparent 70%),
      radial-gradient(ellipse 60% 120% at 30% 0%, rgba(83, 74, 183, 0.70) 0%, transparent 75%),
      linear-gradient(160deg, #2A2170 0%, #120C38 75%);
    --band-shadow: 0 12px 40px rgba(18, 12, 56, 0.18);
    --band-edge: transparent;
  }
}
:root[data-theme="dark"] {
  --band-text: #C9C4F4; --band-strong: #FFFFFF; --band-grid: rgba(201, 196, 244, 0.06);
  --band-fill:
    radial-gradient(ellipse 45% 120% at 88% 0%, rgba(140, 132, 224, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 35% 110% at 6% 100%, rgba(239, 159, 39, 0.20) 0%, transparent 70%),
    radial-gradient(ellipse 60% 120% at 30% 0%, rgba(83, 74, 183, 0.70) 0%, transparent 75%),
    linear-gradient(160deg, #2A2170 0%, #120C38 75%);
  --band-shadow: 0 12px 40px rgba(18, 12, 56, 0.18);
  --band-edge: transparent;
}
nav.topbar::before {
  background:
    linear-gradient(var(--band-grid) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--band-grid) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--band-fill);
  box-shadow: var(--band-shadow);
  border-bottom: 1px solid var(--band-edge);
}
nav.topbar .brand, nav.topbar .brand a { color: var(--band-strong); }
nav.topbar .links, nav.topbar .links span { color: var(--band-text) !important; }
nav.topbar .links a, nav.topbar .links a.muted { color: var(--band-text); }
nav.topbar .links a:hover, nav.topbar .links a.current { color: var(--band-strong); }
nav.topbar .links button { color: var(--band-strong) !important; }
nav.topbar details.menu > summary { color: var(--band-text); border-color: color-mix(in srgb, var(--band-text) 35%, transparent); }
nav.topbar details.menu[open] > summary { background: color-mix(in srgb, var(--band-text) 12%, transparent); }
nav.breadcrumbs { color: var(--band-text); }
nav.breadcrumbs a { color: var(--band-strong); opacity: 0.8; }
nav.breadcrumbs [aria-current="page"] { color: var(--band-strong); }
