@font-face { font-family: "Geist"; src: url("/static/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/static/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --font: "Geist", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;

  --bg: #f5f6f8;
  --bg-grain: rgba(17, 24, 32, .018);
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e8ebef;
  --line: #e2e6eb;
  --line-strong: #cfd5dc;
  --ink: #111820;
  --ink-2: #3c4653;
  --muted: #677180;
  --faint: #8d96a3;

  --accent: #0e7c74;
  --accent-hover: #0b6861;
  --accent-ink: #ffffff;
  --accent-soft: #e2f2ef;
  --accent-line: #a9d8d1;
  --focus: #3aa596;

  --ok: #127a4a;   --ok-soft: #e3f4ea;
  --warn: #9a5b06; --warn-soft: #fcf0d9;
  --bad: #b42318;  --bad-soft: #fdecea;
  --info: #2c5f9e; --info-soft: #e7eef8;
  --demo: #6b4fa0; --demo-soft: #efeaf8;

  --shadow-sm: 0 1px 2px rgba(17, 32, 48, .06);
  --shadow-md: 0 1px 2px rgba(17, 32, 48, .05), 0 8px 24px -12px rgba(17, 32, 48, .18);
  --shadow-lg: 0 24px 48px -20px rgba(17, 32, 48, .28), 0 2px 6px rgba(17, 32, 48, .06);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --z-header: 20;
  --z-menu: 30;
  --z-toast: 40;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1116;
    --bg-grain: rgba(255, 255, 255, .012);
    --surface: #131920;
    --surface-2: #19212a;
    --surface-3: #212b36;
    --line: #232d38;
    --line-strong: #314050;
    --ink: #e8edf2;
    --ink-2: #b9c3ce;
    --muted: #8e99a6;
    --faint: #6c7785;
    --accent: #3cb5a6;
    --accent-hover: #55c6b8;
    --accent-ink: #04211d;
    --accent-soft: #10302c;
    --accent-line: #1f5a52;
    --focus: #5fd0c1;
    --ok: #4fc58a;   --ok-soft: #12301f;
    --warn: #e3a64a; --warn-soft: #33260f;
    --bad: #f07a6f;  --bad-soft: #3a1714;
    --info: #7fb0ec; --info-soft: #152538;
    --demo: #b49ce6; --demo-soft: #261d3a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .7);
    --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1116;
  --bg-grain: rgba(255, 255, 255, .012);
  --surface: #131920;
  --surface-2: #19212a;
  --surface-3: #212b36;
  --line: #232d38;
  --line-strong: #314050;
  --ink: #e8edf2;
  --ink-2: #b9c3ce;
  --muted: #8e99a6;
  --faint: #6c7785;
  --accent: #3cb5a6;
  --accent-hover: #55c6b8;
  --accent-ink: #04211d;
  --accent-soft: #10302c;
  --accent-line: #1f5a52;
  --focus: #5fd0c1;
  --ok: #4fc58a;   --ok-soft: #12301f;
  --warn: #e3a64a; --warn-soft: #33260f;
  --bad: #f07a6f;  --bad-soft: #3a1714;
  --info: #7fb0ec; --info-soft: #152538;
  --demo: #b49ce6; --demo-soft: #261d3a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .4);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--bg);
  background-image: radial-gradient(var(--bg-grain) 1px, transparent 1px); background-size: 3px 3px;
  font-feature-settings: "ss01", "cv11"; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
img, svg { display: block; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 650; letter-spacing: -.022em; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; }
p { margin: 0; text-wrap: pretty; }
.num, td.num, .stat-value { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: var(--z-toast); background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r-sm); text-decoration: none; font-weight: 600; transition: top .2s var(--ease); }
.skip-link:focus { top: 12px; color: var(--accent-ink); }

/* Header */
.app-header { position: sticky; top: 0; z-index: var(--z-header); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.app-header-row { max-width: 1360px; margin: 0 auto; padding: 0 28px; height: 58px; display: flex; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; letter-spacing: -.015em; font-size: 15px; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 4px 10px -4px color-mix(in srgb, var(--accent) 70%, transparent); }
.crumb-sep { color: var(--faint); font-size: 18px; font-weight: 300; }
.header-spacer { flex: 1; }

/* Menus (details-based) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-trigger { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; border: 1px solid transparent; transition: background .18s var(--ease), border-color .18s var(--ease); max-width: 280px; }
.menu-trigger:hover, .menu[open] > .menu-trigger { background: var(--surface); border-color: var(--line); color: var(--ink); }
.menu-trigger .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-panel { position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; max-width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; z-index: var(--z-menu); animation: pop .16s var(--ease); }
.menu-panel.right { left: auto; right: 0; }
.menu-panel .menu-title { font-size: 11.5px; color: var(--muted); padding: 6px 10px 4px; font-weight: 500; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); color: var(--ink); }
.menu-item[aria-current="true"], .menu-item.is-active { background: var(--accent-soft); color: var(--accent); }
.menu-item .sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }

.avatar { width: 28px; height: 28px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); display: grid; place-items: center; font-size: 11.5px; font-weight: 650; letter-spacing: .02em; }
.user-meta { display: grid; line-height: 1.25; text-align: left; }
.user-meta small { color: var(--muted); font-size: 11.5px; }

/* Workspace sub-navigation */
.subnav { max-width: 1360px; margin: 0 auto; padding: 0 22px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px 12px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; transition: color .18s var(--ease); }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); }
.subnav a[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.subnav .count { font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 5px; padding: 0 5px; font-variant-numeric: tabular-nums; }

/* Layout */
main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 30px 28px 64px; }
main.wide { max-width: none; padding: 0; display: flex; flex-direction: column; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head .lede { color: var(--muted); margin-top: 6px; max-width: 68ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; margin-bottom: 12px; }
.back:hover { color: var(--ink); }
.eyebrow { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 13px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.panel-body { padding: 20px 22px; }
.panel-head { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.panel-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.panel.sticky { position: sticky; top: 124px; }
.inset { background: var(--surface-2); border-radius: var(--r-md); padding: 14px 16px; }

/* Buttons */
.btn { --b: var(--surface); --f: var(--ink); --bd: var(--line-strong); display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--bd); background: var(--b); color: var(--f); font: inherit; font-weight: 550; font-size: 13.5px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .12s var(--ease), box-shadow .18s var(--ease); box-shadow: var(--shadow-sm); }
.btn:hover { --b: var(--surface-2); color: var(--f); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { --b: var(--accent); --f: var(--accent-ink); --bd: var(--accent); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn-primary:hover { --b: var(--accent-hover); --bd: var(--accent-hover); }
.btn-quiet { --b: transparent; --bd: transparent; box-shadow: none; color: var(--ink-2); }
.btn-quiet:hover { --b: var(--surface-2); }
.btn-danger { --b: var(--bad); --f: #fff; --bd: var(--bad); }
.btn-danger:hover { --b: color-mix(in srgb, var(--bad) 88%, #000); }
.btn-danger-quiet { --b: transparent; --bd: transparent; --f: var(--bad); box-shadow: none; }
.btn-danger-quiet:hover { --b: var(--bad-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.icon-btn { width: 34px; height: 34px; padding: 0; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
form.inline { display: inline; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 550; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.succeeded, .badge.sent, .badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.failed, .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.running, .badge.queued, .badge.warn, .badge.skipped { background: var(--warn-soft); color: var(--warn); }
.badge.running .dot, .badge.queued .dot { animation: pulse 1.4s ease-in-out infinite; }
.badge.demo { background: var(--demo-soft); color: var(--demo); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; color: var(--ink-2); background: var(--surface); }

/* Stats */
.stats { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.stat { padding: 18px 22px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 600; letter-spacing: -.025em; margin-top: 4px; line-height: 1.15; }
.stat-value small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stat-note { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Catalogue */
.catalogue-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 34px; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button, .segmented label { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--muted); padding: 5px 11px; border-radius: 6px; cursor: pointer; transition: background .16s var(--ease), color .16s var(--ease); display: inline-flex; align-items: center; gap: 6px; }
.segmented button:hover, .segmented label:hover { color: var(--ink); }
.segmented button[aria-pressed="true"], .segmented input:checked + label { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.category { margin-top: 30px; }
.category:first-of-type { margin-top: 0; }
.category-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.category-head .count { color: var(--muted); font-size: 12.5px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.report-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.report-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.report-card .rc-top { display: flex; align-items: flex-start; gap: 12px; }
.glyph { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.glyph.security { background: var(--info-soft); color: var(--info); }
.glyph.devops { background: var(--demo-soft); color: var(--demo); }
.report-card p.desc { color: var(--muted); font-size: 13px; line-height: 1.5; }
.report-card .rc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); min-height: 22px; }
.report-card .rc-foot { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.report-card .stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.report-card .rc-foot .btn, .report-card .rc-foot a:not(.stretched) { position: relative; z-index: 1; }
.segmented .seg-link { font-size: 12.5px; font-weight: 550; color: var(--muted); padding: 5px 11px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.segmented .seg-link:hover { color: var(--ink); }
.segmented .seg-link[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.version-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; position: relative; z-index: 1; }
.version-list li { display: flex; justify-content: space-between; gap: 8px; }
.library-filters select { width: auto; flex: 0 1 auto; max-width: 260px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.viewer-bar .versions { display: inline-flex; align-items: center; gap: 6px; }
.notice { font-size: 12.5px; color: var(--warn); display: flex; gap: 6px; align-items: flex-start; }
.notice.bad { color: var(--bad); }
.notice.muted { color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.table-wrap.flat { border: 0; box-shadow: none; border-radius: 0; background: transparent; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 550; color: var(--muted); font-size: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .14s var(--ease); }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td .primary { font-weight: 550; color: var(--ink); text-decoration: none; }
td .primary:hover { color: var(--accent); }
td .secondary { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
td.actions { text-align: right; white-space: nowrap; }
.row-link { cursor: pointer; }

/* Forms */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.field > label, .field > .label, legend { font-weight: 550; font-size: 13px; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 12.5px; font-weight: 550; color: var(--bad); background: var(--bad-soft); border-radius: 6px; padding: 6px 10px; margin: 0; }
.field-error[hidden] { display: none; }
.field .req { color: var(--bad); margin-left: 2px; }
input[type=text], input[type=url], input[type=email], input[type=number], input[type=time], input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
textarea { resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--line-strong) 60%, var(--ink-2)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
input[type=file] { font: inherit; font-size: 12.5px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 550; font-size: 12.5px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); padding: 6px 11px; margin-right: 10px; cursor: pointer; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23808a97' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .field + .field { margin-top: 0; }
.form-grid .wide { grid-column: 1 / -1; }
.form-section + .form-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-section > h3 { margin-bottom: 4px; }
.form-section > .hint { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 13.5px; }
.check input { margin: 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; margin-top: 2px; }
.check .t { display: grid; gap: 1px; }
.check .t small { color: var(--muted); font-size: 12px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 34px; height: 20px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; transition: background .18s var(--ease), border-color .18s var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

.choice-list { display: grid; gap: 8px; }
.choice { position: relative; display: flex; gap: 12px; align-items: center; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease); }
.choice:hover { border-color: var(--line-strong); }
.choice input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.choice:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.choice .ci { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.choice .ct { display: grid; min-width: 0; line-height: 1.35; }
.choice .ct strong { font-weight: 550; font-size: 13.5px; }
.choice .ct small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice .badge { margin-left: auto; }

/* Alerts & empty states */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); margin-bottom: 18px; font-size: 13.5px; border: 1px solid transparent; }
.alert svg { flex: none; margin-top: 2px; }
.alert.error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.alert.success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.alert.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.empty { display: grid; justify-items: start; gap: 8px; padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.empty h3 { font-size: 15px; }
.empty p { color: var(--muted); max-width: 60ch; font-size: 13.5px; }
.empty .btn { margin-top: 6px; }
.empty.center { justify-items: center; text-align: center; padding: 48px 28px; }
.empty .empty-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); margin-bottom: 4px; }

/* Definition lists */
.facts { display: grid; grid-template-columns: fit-content(55%) minmax(0, 1fr); gap: 10px 18px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.kv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.kv { padding: 14px 18px; border-left: 1px solid var(--line); min-width: 0; }
.kv:first-child { border-left: 0; }
.kv .k { color: var(--muted); font-size: 12px; }
.kv .v { font-weight: 550; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.bullets { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 4px; }
.steps-list { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.steps-list li::before { content: counter(s); width: 24px; height: 24px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--ink-2); }

/* Run timeline */
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 4px 0 0; padding: 0; list-style: none; }
.progress li { position: relative; padding-top: 22px; font-size: 12.5px; color: var(--faint); }
.progress li::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 2px; background: var(--line); }
.progress li::after { content: ""; position: absolute; top: 1px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.progress li.done { color: var(--ink-2); }
.progress li.done::before { background: var(--accent); }
.progress li.done::after { background: var(--accent); border-color: var(--accent); }
.progress li.current { color: var(--ink); font-weight: 550; }
.progress li.current::after { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); animation: pulse 1.4s ease-in-out infinite; }
.progress li.failed { color: var(--bad); font-weight: 550; }
.progress li.failed::after { background: var(--bad); border-color: var(--bad); }
.progress li .t { display: block; color: var(--muted); font-weight: 400; font-size: 12px; font-variant-numeric: tabular-nums; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.timeline li:last-child { border-bottom: 0; }
.timeline .ti { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.timeline .detail { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }

/* Report preview */
.preview { position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-md); }
.preview-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.preview-bar .dots { display: flex; gap: 5px; }
.preview-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.preview iframe { display: block; width: 100%; height: 560px; border: 0; background: #fff; }

/* Viewer */
.viewer-bar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.viewer-bar .title { display: grid; line-height: 1.3; min-width: 0; flex: 1; }
.viewer-bar .title strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-bar .title small { color: var(--muted); font-size: 12px; }
.viewer-bar select { width: auto; min-width: 200px; max-width: 320px; min-height: 32px; padding-top: 4px; padding-bottom: 4px; }
.viewer-frame { flex: 1; display: flex; min-height: 0; }
.viewer-frame iframe { flex: 1; width: 100%; border: 0; background: #fff; min-height: calc(100dvh - 58px - 44px - 54px); }

/* Drawer (send panel) */
.drawer { position: fixed; inset: 0; z-index: var(--z-menu); display: none; }
.drawer:target { display: block; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(8, 12, 16, .42); animation: fade .2s var(--ease); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .26s var(--ease); }
.drawer-panel header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer-panel .drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer-panel footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

/* Disclosure */
details.disclosure { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
details.disclosure > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; align-items: center; gap: 10px; font-weight: 550; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .chev { margin-left: auto; color: var(--muted); transition: transform .2s var(--ease); }
details.disclosure[open] > summary .chev { transform: rotate(180deg); }
details.disclosure > .disclosure-body { padding: 4px 14px 16px; }

/* Workspaces */
.workspace-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.workspace { display: grid; gap: 14px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.workspace:hover { color: inherit; border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.workspace .ws-top { display: flex; gap: 12px; align-items: center; }
.ws-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 650; font-size: 14px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); letter-spacing: .02em; }
.workspace .ws-foot { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }

/* Footer */
.app-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.app-footer div { max-width: 1360px; margin: 0 auto; padding: 16px 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Toast */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r-md); box-shadow: var(--shadow-lg); font-size: 13px; animation: pop .2s var(--ease); }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Error page */
.error-page { min-height: 52vh; display: grid; place-items: center; text-align: center; }
.error-page .code { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.error-page h1 { margin: 8px 0; }
.error-page p { color: var(--muted); max-width: 52ch; margin: 0 auto 18px; }

.danger-zone { border-color: color-mix(in srgb, var(--bad) 28%, var(--line)); }
.danger-zone .panel-head h2 { color: var(--bad); }

.reveal { animation: rise .45s var(--ease) both; }
.reveal:nth-child(2) { animation-delay: .04s; }
.reveal:nth-child(3) { animation-delay: .08s; }
.reveal:nth-child(4) { animation-delay: .12s; }
.reveal:nth-child(5) { animation-delay: .16s; }
.reveal:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 1080px) {
  .split, .split.even { grid-template-columns: 1fr; }
  .panel.sticky { position: static; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .kv:nth-child(3) { border-left: 0; }
  .kv:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .app-header-row { padding: 0 16px; gap: 8px; }
  .subnav { padding: 0 10px; }
  main { padding: 22px 16px 48px; }
  .user-meta, .hide-sm { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: 0; }
  .progress { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .preview iframe { height: 420px; }
  td, th { padding: 10px 12px; }
}

.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.chart { width: 100%; height: 40px; margin-top: 10px; overflow: visible; }
.chart .bar { fill: var(--accent-line); }
.chart .bar.fail { fill: var(--bad); }
.chart .bar.today { fill: var(--accent); }
.ring { width: 100%; height: 6px; margin-top: 12px; }
.ring .track { fill: var(--surface-3); }
.ring .fill { fill: var(--accent); }
.w-auto { width: auto; min-width: 200px; }
.btn.is-active { background: var(--surface-2); }
.panel-foot-flat { border-top: 1px solid var(--line); }
textarea.no-mono { font-family: var(--font); font-size: 13.5px; }
.grow { flex: 1; min-width: 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px 16px; }
.error-page .row { justify-content: center; }
.error-page .empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); margin: 0 auto 14px; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
.split > *, .stack > * { min-width: 0; }
.stack, .stack-sm { align-content: start; }
.list .grow strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-card h3 a { color: var(--ink); text-decoration: none; }
.report-card h3 a:hover { color: var(--accent); }
.report-card.is-blocked { background: color-mix(in srgb, var(--surface) 50%, transparent); box-shadow: none; }
.report-card.is-blocked .glyph { filter: grayscale(1); opacity: .6; }
.report-card.is-blocked p.desc { color: var(--faint); }
.search input[type=search] { padding-left: 34px; }
.app-header-row > * { flex-shrink: 0; }
.app-header-row > .menu.workspace-menu { flex-shrink: 1; min-width: 0; }
.workspace-menu > .menu-trigger { max-width: 100%; min-width: 0; }
@media (max-width: 720px) {
  .crumb-sep, .workspace-menu .badge { display: none; }
  .app-header-row .menu-panel { position: fixed; top: 56px; left: 12px; right: 12px; max-width: none; }
}
.licence-bar { border-bottom: 1px solid var(--line); background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.licence-bar > div { max-width: 1360px; margin: 0 auto; padding: 9px 28px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.licence-bar svg { flex: none; }
.licence-bar a { margin-left: auto; font-weight: 600; color: inherit; }
.licence-bar.level-info { background: var(--info-soft); color: var(--info); }
.licence-bar.level-danger { background: var(--bad-soft); color: var(--bad); border-bottom-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.licence-bar strong { font-weight: 700; }
.licence-bar .countdown { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; font-size: 12px; white-space: nowrap; }
.licence-bar .countdown b { font-size: 14px; }
.licence-bar .licence-cta { margin-left: auto; padding: 5px 12px; border-radius: 8px; background: var(--surface, #fff); border: 1px solid currentColor; text-decoration: none; }
.licence-bar .licence-cta, .licence-bar .licence-cta:visited { color: inherit; }
.licence-bar.level-danger .licence-cta, .licence-bar.level-warn .licence-cta { background: var(--surface, #fff); border: 1px solid currentColor; }
.licence-bar .licence-hint { margin-left: auto; opacity: .85; }

/* Hosted onboarding */
pre.code { margin: 8px 0 0; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); font-family: var(--mono); font-size: 12.5px; line-height: 1.55; overflow-x: auto; white-space: pre; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* Connections */
.conn-area { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 14px 0 8px; }
.conn-area:first-child { margin-top: 0; }
.conn-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.conn-checks li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 13.5px; align-items: start; }
.conn-checks .conn-mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; margin-top: 1px; }
.conn-checks li.ok .conn-mark { background: var(--ok-soft); color: var(--ok); }
.conn-checks li.bad .conn-mark { background: var(--bad-soft); color: var(--bad); }
.conn-checks li.skip .conn-mark { background: var(--surface-2); color: var(--muted); }
.field.grow { flex: 1; margin: 0; }

.grant-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 4px; }

.pat-box { border-top: 1px solid var(--line); padding-top: 14px; }
.pat-box h3 { font-size: 14px; margin: 0 0 6px; }

.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; }

.danger-zone > summary { cursor: pointer; list-style: none; }
.danger-zone > summary::-webkit-details-marker { display: none; }
.danger-zone[open] > summary { border-bottom: 1px solid var(--line); }
.danger-zone h2 { color: var(--bad); }

.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
th.pick, td.pick { width: 36px; }
td.pick input, th.pick input { width: 16px; height: 16px; cursor: pointer; }

/* Workspace branding */
.brand-logo { height: 28px; width: auto; max-width: 140px; object-fit: contain; border-radius: 6px; flex: none; }
.login-brand .brand-logo { height: 34px; max-width: 180px; }
.login-brand .powered { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.brand-preview { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.brand-preview .brand-logo { height: 36px; max-width: 200px; }
.brand-preview .swatch { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.brand-preview .name { font-weight: 650; }

.accent-swatch { background: var(--accent); }
/* Operator console: enterprise deals */
.pre-wrap { white-space: pre-wrap; }
.bad-text { color: var(--bad); }
.deal-lines td { vertical-align: middle; }
.deal-lines select { min-width: 190px; }
.deal-lines input.w-qty { width: 64px; text-align: right; }
.deal-lines input.w-price { width: 110px; text-align: right; }
.deal-lines tfoot td { border-top: 1px solid var(--line); }
.deal-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.deal-history li { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.deal-history li:last-child { border-bottom: 0; padding-bottom: 0; }
/* Change tracking: reports whose history starts at their first run */
.tracking-panel { margin-bottom: 18px; }
.tracking-panel.is-urgent { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 10%, transparent); }
.tracking-panel h2 { display: inline-flex; align-items: center; gap: 8px; }
.tracking-list { list-style: none; margin: 0; padding: 0; }
.tracking-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 18px; border-top: 1px solid var(--line); }
.tracking-list li > div:first-child { display: grid; gap: 2px; min-width: 0; }
.tracking-state { display: flex; align-items: center; gap: 10px; flex: none; }
.tracking-state form { margin: 0; }
.tracking-foot { padding: 10px 18px 14px; border-top: 1px solid var(--line); margin: 0; }
.chip.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
@media (max-width: 720px) { .tracking-list li { flex-direction: column; align-items: flex-start; } }

/* =====================================================================================================================
   Refresh: app shell (sidebar, top bar, command palette) and a more modern look. Everything above still applies; this
   section refines it, and the operator console (which shares this file) keeps its own header.
   ===================================================================================================================== */
:root {
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --sb-w: 252px; --sb-rail: 68px; --topbar-h: 56px;
  --shadow-sm: 0 1px 2px rgba(17, 32, 48, .05), 0 1px 1px rgba(17, 32, 48, .03);
  --shadow-md: 0 1px 2px rgba(17, 32, 48, .05), 0 12px 32px -16px rgba(17, 32, 48, .22);
  --sb-bg: #fbfcfd; --sb-ink: var(--ink-2); --sb-hover: #eff2f5; --sb-active: #ffffff;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sb-bg: #10151b; --sb-hover: #18202a; --sb-active: #1c2631; } }
:root[data-theme="dark"] { --sb-bg: #10151b; --sb-hover: #18202a; --sb-active: #1c2631; }
h1 { font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -.028em; }

/* Shell */
body.has-shell { display: block; }
.shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100dvh; transition: grid-template-columns .22s var(--ease); }
.sb-rail .shell, .page-viewer .shell { grid-template-columns: var(--sb-rail) minmax(0, 1fr); }
.sb-wide .page-viewer .shell { grid-template-columns: var(--sb-w) minmax(0, 1fr); }
.sb-scrim { display: none; }
.shell-main { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.shell-main main { width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 36px 64px; }
.shell-main main.wide { max-width: none; padding: 0; }
.shell-main .app-footer div { max-width: 1320px; padding: 16px 36px; }
.shell-main .licence-bar > div { max-width: none; padding: 9px 36px; }

/* Sidebar */
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px 12px; background: var(--sb-bg);
  border-right: 1px solid var(--line); overflow: hidden; z-index: var(--z-header); }
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 8px; min-height: 40px; }
.sb-top .brand { min-width: 0; overflow: hidden; }
.sb-top .brand-name { overflow: hidden; text-overflow: ellipsis; }
.sb-collapse { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: background .16s var(--ease), color .16s var(--ease), transform .22s var(--ease); }
.sb-collapse:hover { background: var(--sb-hover); color: var(--ink); }
.sb-workspace > .menu-trigger { width: 100%; max-width: none; height: 44px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); border-radius: var(--r-md); }
.sb-workspace > .menu-trigger .label { flex: 1; font-weight: 600; color: var(--ink); }
.sb-workspace .menu-panel { left: 0; right: 0; min-width: 0; max-width: none; }
.ws-dot { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.sb-nav.subnav { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; margin: 0; max-width: none; overflow-y: auto; overflow-x: hidden; flex: 1; scrollbar-width: thin; }
.sb-group { font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 14px 12px 6px; white-space: nowrap; }
.sb-group:first-child { padding-top: 6px; }
.sb-nav.subnav a { position: relative; display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 12px; border-radius: 9px; color: var(--sb-ink); font-weight: 520; white-space: nowrap; transition: background .14s var(--ease), color .14s var(--ease); }
.sb-nav.subnav a svg { flex: none; color: var(--muted); transition: color .14s var(--ease); }
.sb-nav.subnav a:hover { background: var(--sb-hover); color: var(--ink); }
.sb-nav.subnav a:hover svg { color: var(--ink-2); }
.sb-nav.subnav a[aria-current="page"] { background: var(--sb-active); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.sb-nav.subnav a[aria-current="page"] svg { color: var(--accent); }
.sb-nav.subnav a[aria-current="page"]::after { content: ""; position: absolute; left: -12px; right: auto; top: 9px; bottom: 9px; width: 3px; height: auto; border-radius: 0 3px 3px 0; background: var(--accent); }
.sb-nav .nav-count { margin-left: auto; }
.sb-foot { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.sb-foot .menu > .menu-trigger { width: 100%; max-width: none; height: 40px; border-radius: 9px; }
.sb-foot .menu > .menu-trigger:hover, .sb-foot .menu[open] > .menu-trigger { background: var(--sb-hover); border-color: transparent; }
.sb-foot .theme-menu .menu-trigger { color: var(--sb-ink); font-weight: 520; gap: 11px; padding: 0 12px; }
.sb-foot .theme-menu .menu-trigger svg { color: var(--muted); }
.sb-foot .user-meta { display: grid; min-width: 0; }
.menu-panel.up { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }
.theme-menu:not(.sb-menu) .sb-label { display: none; }

/* Rail (collapsed sidebar): icons only, labels as tooltips. The report viewer starts as a rail. */
.sb-rail .sb-collapse, .page-viewer .sb-collapse { transform: rotate(180deg); }
.sb-wide .page-viewer .sb-collapse { transform: none; }
.sb-rail .sidebar, .page-viewer .sidebar { padding: 14px 10px 12px; overflow: visible; }
.sb-rail .sb-top, .page-viewer .sb-top { flex-direction: column; padding: 2px 0 8px; }
.sb-rail .brand-name, .sb-rail .sb-workspace .label, .sb-rail .sb-workspace .badge, .sb-rail .sb-workspace .menu-trigger > svg, .sb-rail .sb-group, .sb-rail .user-meta,
.page-viewer .brand-name, .page-viewer .sb-workspace .label, .page-viewer .sb-workspace .badge, .page-viewer .sb-workspace .menu-trigger > svg, .page-viewer .sb-group, .page-viewer .user-meta { display: none; }
.sb-rail .sb-workspace > .menu-trigger, .page-viewer .sb-workspace > .menu-trigger { justify-content: center; padding: 0; }
.sb-rail .sb-workspace .menu-panel, .page-viewer .sb-workspace .menu-panel { left: 0; right: auto; min-width: 240px; }
.sb-rail .sb-nav.subnav, .page-viewer .sb-nav.subnav { overflow: visible; padding-top: 10px; gap: 4px; }
.sb-rail .sb-nav.subnav a, .page-viewer .sb-nav.subnav a { justify-content: center; padding: 0; }
.sb-rail .sb-nav .nav-count, .page-viewer .sb-nav .nav-count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; margin: 0; }
.sb-rail .sb-label, .page-viewer .sb-label { position: absolute; left: calc(100% + 12px); top: 50%; transform: translate(-4px, -50%); padding: 5px 9px; border-radius: 7px; background: var(--ink); color: var(--bg);
  font-size: 12px; font-weight: 550; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .14s var(--ease), transform .14s var(--ease); z-index: var(--z-menu); box-shadow: var(--shadow-md); }
.sb-rail .sb-nav a:hover .sb-label, .sb-rail .sb-nav a:focus-visible .sb-label, .sb-rail .menu-trigger:hover .sb-label,
.page-viewer .sb-nav a:hover .sb-label, .page-viewer .sb-nav a:focus-visible .sb-label, .page-viewer .menu-trigger:hover .sb-label { opacity: 1; transform: translate(0, -50%); }
.sb-rail .sb-foot .menu > .menu-trigger, .page-viewer .sb-foot .menu > .menu-trigger { justify-content: center; padding: 0; }
.sb-rail .sb-nav.subnav a[aria-current="page"]::after, .page-viewer .sb-nav.subnav a[aria-current="page"]::after { left: -10px; }
/* Widening the viewer's rail restores the full sidebar for that page. */
.sb-wide .page-viewer .sidebar { padding: 14px 12px 12px; overflow: hidden; }
.sb-wide .page-viewer .sb-top { flex-direction: row; padding: 2px 4px 8px; }
.sb-wide .page-viewer .brand-name, .sb-wide .page-viewer .sb-workspace .label, .sb-wide .page-viewer .sb-group { display: initial; }
.sb-wide .page-viewer .sb-group { display: block; }
.sb-wide .page-viewer .sb-workspace .menu-trigger > svg, .sb-wide .page-viewer .sb-workspace .badge { display: inline-flex; }
.sb-wide .page-viewer .user-meta { display: grid; }
.sb-wide .page-viewer .sb-workspace > .menu-trigger, .sb-wide .page-viewer .sb-nav.subnav a, .sb-wide .page-viewer .sb-foot .menu > .menu-trigger { justify-content: flex-start; padding: 0 12px; }
.sb-wide .page-viewer .sb-nav.subnav { overflow-y: auto; padding-top: 6px; gap: 1px; }
.sb-wide .page-viewer .sb-label { position: static; opacity: 1; transform: none; background: none; color: inherit; padding: 0; box-shadow: none; font-size: inherit; font-weight: inherit; }
.sb-wide .page-viewer .sb-nav .nav-count { position: static; margin-left: auto; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: calc(var(--z-header) - 1); display: flex; align-items: center; gap: 12px; height: var(--topbar-h); padding: 0 36px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.page-viewer .topbar { padding: 0 20px; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.crumbs a:hover { color: var(--ink); }
.crumbs .crumb-sep { color: var(--faint); display: inline-flex; font-size: inherit; }
.crumbs .crumb-current { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.show-sm { display: none; }
.sb-open { display: none; }
.search-trigger { display: inline-flex; align-items: center; gap: 10px; height: 36px; min-width: 260px; padding: 0 8px 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .16s var(--ease), color .16s var(--ease); }
.search-trigger:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line-strong)); color: var(--ink); }
.search-trigger kbd { margin-left: auto; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted); box-shadow: 0 1px 0 var(--line-strong); }
.app-header .search-trigger { min-width: 0; }

/* Command palette */
dialog.palette { padding: 0; border: 0; background: transparent; width: min(640px, calc(100% - 32px)); max-width: none; margin: 12vh auto auto; overflow: visible; color: var(--ink); }
dialog.palette::backdrop { background: rgba(6, 10, 14, .48); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.palette[open] .palette-box { animation: pop .18s var(--ease); }
.palette-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .55), var(--shadow-md); overflow: hidden; }
.palette-search { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-search input[type=search] { border: 0; box-shadow: none; background: transparent; height: 56px; padding: 0; font-size: 16px; color: var(--ink); }
.palette-search input[type=search]:focus { box-shadow: none; }
.palette-list { max-height: min(52vh, 440px); overflow-y: auto; padding: 8px; }
.palette-group { font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 0; background: none;
  color: var(--ink); text-decoration: none; font: inherit; text-align: left; cursor: pointer; }
.palette-item .pl { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .ph { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette-item[aria-selected="true"] { background: var(--accent-soft); color: var(--ink); }
.palette-item[aria-selected="true"] .ph { color: var(--accent); }
.palette-item:hover { color: var(--ink); }
.palette-empty { padding: 26px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 12px; }
.palette-foot kbd { margin-right: 3px; }

/* Page headers */
.page-head { margin-bottom: 28px; }
.page-head .lede { font-size: 14.5px; }

/* Surfaces: softer edges and a little lift */
.panel-head { padding: 18px 22px; }
.panel-head h2 { font-size: 15.5px; }
.report-card:hover { transform: translateY(-2px); }
.report-card.is-blocked:hover { transform: none; }
.glyph { border-radius: 11px; }

/* Stats as separate cards */
.stats { gap: 14px; background: none; border: 0; box-shadow: none; overflow: visible; }
.stats .stat { position: relative; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.stats .stat::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); opacity: .85; }
.stat-value { font-size: 28px; }

/* Tables */
th { position: sticky; top: 0; z-index: 1; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.row-link:hover td .primary { color: var(--accent); }

/* Buttons and fields */
.btn-primary { background-image: linear-gradient(180deg, color-mix(in srgb, #fff 10%, transparent), transparent); }
.segmented button, .segmented label, .segmented .seg-link { border-radius: 7px; }

/* Small screens: the sidebar becomes a drawer */
@media (max-width: 1080px) {
  .shell, .sb-rail .shell, .page-viewer .shell, .sb-wide .page-viewer .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-104%); transition: transform .24s var(--ease); box-shadow: var(--shadow-lg); z-index: calc(var(--z-menu) + 1); }
  .sidebar-open .sidebar { transform: none; }
  .sb-scrim { display: block; position: fixed; inset: 0; background: rgba(6, 10, 14, .42); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); z-index: var(--z-menu); }
  .sidebar-open .sb-scrim { opacity: 1; pointer-events: auto; }
  .sb-collapse { display: none; }
  .sb-open { display: inline-flex; }
  /* In the drawer the rail never applies: labels are always shown. */
  .sb-rail .sidebar, .page-viewer .sidebar { padding: 14px 12px 12px; overflow: hidden; }
  .sb-rail .sb-top, .page-viewer .sb-top { flex-direction: row; padding: 2px 4px 8px; }
  .sb-rail .brand-name, .page-viewer .brand-name, .sb-rail .sb-workspace .label, .page-viewer .sb-workspace .label { display: initial; }
  .sb-rail .sb-group, .page-viewer .sb-group { display: block; }
  .sb-rail .sb-workspace .menu-trigger > svg, .page-viewer .sb-workspace .menu-trigger > svg, .sb-rail .sb-workspace .badge, .page-viewer .sb-workspace .badge { display: inline-flex; }
  .sb-rail .user-meta, .page-viewer .user-meta { display: grid; }
  .sb-rail .sb-nav.subnav a, .page-viewer .sb-nav.subnav a, .sb-rail .sb-foot .menu > .menu-trigger, .page-viewer .sb-foot .menu > .menu-trigger,
  .sb-rail .sb-workspace > .menu-trigger, .page-viewer .sb-workspace > .menu-trigger { justify-content: flex-start; padding: 0 12px; }
  .sb-rail .sb-nav.subnav, .page-viewer .sb-nav.subnav { overflow-y: auto; padding-top: 6px; gap: 1px; }
  .sb-rail .sb-label, .page-viewer .sb-label { position: static; opacity: 1; transform: none; background: none; color: inherit; padding: 0; box-shadow: none; font-size: inherit; font-weight: inherit; }
  .sb-rail .sb-nav .nav-count, .page-viewer .sb-nav .nav-count { position: static; margin-left: auto; }
  .topbar, .shell-main main { padding-left: 20px; padding-right: 20px; }
  .shell-main main.wide { padding: 0; }
  .search-trigger { min-width: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:nth-child(n) { border: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .shell-main main { padding: 20px 16px 48px; }
  .shell-main .app-footer div, .shell-main .licence-bar > div { padding-left: 16px; padding-right: 16px; }
  .show-sm { display: inline; }
  .search-trigger { width: 36px; padding: 0; justify-content: center; }
  .stats { grid-template-columns: 1fr; }
  dialog.palette { margin-top: 8vh; }
  .palette-foot { display: none; }
  /* The drawer has room for the brand name even on a phone. */
  .sidebar .brand-name { display: initial; }
}
@media (prefers-reduced-motion: reduce) { .shell, .sidebar { transition: none; } }

/* ---------- Exports and the board report ---------- */
.glyph.exec { background: var(--warn-soft); color: var(--warn); }
.export-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; transition: border-color .16s var(--ease), background .16s var(--ease); }
.export-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.export-item > svg:first-child { flex: none; color: var(--accent); }
.export-item > span { flex: 1; min-width: 0; display: grid; gap: 1px; }
.export-item small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.export-item > svg:last-child { flex: none; color: var(--muted); }
.export-lists summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 2px 0; }
.export-lists ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.export-lists a { display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm, 6px); text-decoration: none; color: var(--ink); font-size: 13px; }
.export-lists a:hover { background: var(--sb-hover, var(--accent-soft)); }
.stack-sm { display: grid; gap: 8px; }
.report-picks { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.report-picks legend { font-weight: 600; font-size: 13.5px; padding: 0; margin-bottom: 2px; }
.pick-group { display: grid; gap: 4px; }
.pick-head { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.export-menu .menu-trigger { list-style: none; }
.export-menu .menu-trigger::-webkit-details-marker { display: none; }

/* ---------- Folded panels and options ---------- */
details.panel-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
details.panel-fold > summary::-webkit-details-marker { display: none; }
details.panel-fold > summary .chev, .options-fold > summary .chev { margin-left: auto; color: var(--muted); transition: transform .2s var(--ease); }
details.panel-fold[open] > summary .chev, .options-fold[open] > summary .chev { transform: rotate(180deg); }
details.panel-fold:not([open]) > summary { border-bottom: 0; }
.options-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.options-fold > summary::-webkit-details-marker { display: none; }
.options-fold > summary h3 { margin: 0; }
.options-fold[open] > summary { margin-bottom: 12px; }
.small-head { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 0; }
.tracking-why > summary { cursor: pointer; color: var(--muted); width: fit-content; }
.tracking-why[open] > summary { margin-bottom: 2px; }
.report-card .desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Library, by report: categories on the left, a compact list per category, each row opening to its earlier versions. */
.lib { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 28px; align-items: start; }
.lib-nav { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 2px; }
.lib-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 1px solid transparent; border-radius: 8px; background: none; font: inherit; font-size: 13.5px; color: var(--ink-2); cursor: pointer; text-align: left; transition: background .16s var(--ease), color .16s var(--ease); }
.lib-nav-item > span:not(.count):not(.glyph) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-nav-item:hover { background: var(--surface-2); color: var(--ink); }
.lib-nav-item[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink); font-weight: 600; }
.lib-nav-item[aria-pressed="true"] > svg { color: var(--accent); }
.lib-nav-item .count { font-size: 11.5px; color: var(--muted); background: var(--surface-2); border-radius: 5px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.lib-nav-item[aria-pressed="true"] .count { background: var(--surface); color: var(--ink-2); }
.lib-nav-item.is-warn > svg { color: var(--warn); }
.lib-nav-item .glyph { width: 22px; height: 22px; border-radius: 6px; }
.lib-nav-h { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }

.lib-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.lib-tools .search { max-width: 360px; }
.lib-tools .search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.lib-tools .search input { padding-right: 34px; }
.lib-tools [data-lib-expand] svg { transition: transform .16s var(--ease); }
.lib-tools [data-lib-expand][aria-pressed="true"] svg { transform: rotate(180deg); }
.lib-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.lib-legend [data-lib-count] { margin-right: auto; color: var(--ink-2); font-weight: 550; }
.lib-key { display: inline-flex; align-items: center; gap: 6px; }
.fresh-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.fresh-dot.fresh { background: var(--ok); }
.fresh-dot.ageing { background: var(--warn); }
.fresh-dot.stale { background: var(--bad); }

.lib-section { margin-bottom: 26px; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.lib-section[hidden], .lib-row[hidden] { display: none; }
.lib-section-h { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.lib-section-h .glyph { width: 24px; height: 24px; border-radius: 7px; }
.lib-section-h .count { font-size: 12px; font-weight: 500; color: var(--muted); }
.lib-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.lib-row + .lib-row { border-top: 1px solid var(--line); }
.lib-row { transition: background .16s var(--ease); }
.lib-row:hover, .lib-row:focus-within { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.lib-row-head { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 84px auto; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; }
.lib-toggle, .lib-toggle-space { width: 24px; height: 24px; }
.lib-toggle { display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.lib-toggle:hover { background: var(--surface-3); color: var(--ink); }
.lib-toggle svg { transition: transform .16s var(--ease); }
.lib-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.lib-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lib-name { overflow: hidden; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
a.lib-name:hover { color: var(--accent); }
.lib-sub { overflow: hidden; font-size: 12.5px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.lib-row.is-new .lib-name { font-weight: 550; color: var(--ink-2); }
.lib-state { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.lib-state a.badge { text-decoration: none; }
.lib-age { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.lib-versions { font-size: 12.5px; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lib-actions { display: flex; justify-content: flex-end; gap: 4px; min-width: 132px; }
.lib-history { padding: 0 14px 12px 48px; }
.lib-versions-list { display: grid; gap: 2px; margin: 0 0 6px; padding: 2px 0 0 12px; border-left: 2px solid var(--line); list-style: none; font-size: 13px; }
.lib-versions-list li { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 12px; padding: 4px 8px; border-radius: 6px; }
.lib-versions-list li:hover { background: var(--surface-2); }
.lib-versions-list li .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 960px) {
  .lib { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .lib-nav { position: static; flex-direction: row; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .lib-nav-h { display: none; }
  .lib-nav-item { width: auto; flex: none; border-color: var(--line); }
}
@media (max-width: 640px) {
  .lib-nav { scrollbar-width: none; }
  .lib-nav::-webkit-scrollbar { display: none; }
  .lib-row-head { grid-template-columns: 24px minmax(0, 1fr) auto; row-gap: 6px; gap: 10px; }
  .lib-title { grid-column: 2 / span 2; }
  .lib-name, .lib-sub { white-space: normal; }
  .lib-state { grid-column: 2; grid-row: 2; justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .lib-versions { display: none; }
  .lib-actions { grid-column: 3; grid-row: 2; min-width: 0; }
  .lib-actions a[href*="download=true"] { display: none; }
  .lib-history { padding-left: 16px; }
  .lib-versions-list li { grid-template-columns: auto minmax(0, 1fr); }
  .lib-versions-list li a { white-space: nowrap; }
  .lib-versions-list li .mono { display: none; }
  .lib-legend .lib-key { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lib-toggle svg, .lib-tools [data-lib-expand] svg, .lib-row, .lib-nav-item { transition: none; }
}
