/* ==========================================================================
   Opportunity Intelligence: design system
   1. Tokens (light + dark)   2. Base   3. App shell   4. Components
   5. Page patterns (legacy classes kept)   6. Agents / activity   7. Responsive + print
   Every colour in the app comes from a token below. Do not hard-code hex values in templates.
   ========================================================================== */

/* ---- 1. Tokens ---------------------------------------------------------- */
:root {
  /* surfaces */
  /* text */
  /* brand accent: deep lagoon */
  /* semantic */
  
  
  
  
  /* shape + depth */
  
  /* spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  /* type */
  /* layout */
  

  /* legacy aliases: older templates and social.css still use these names */
  --ink: var(--text);
  --paper: var(--bg);
  --lagoon: var(--accent);
  --lagoon-soft: var(--accent-soft);
  --coral: var(--danger);
  --amber: var(--warn);

  color-scheme: light;
  font-size: 15px; line-height: 1.5; color: var(--text);
  font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] {
  
  
  
  
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

/* ---- identity tokens (formerly the top of v2.css) ---------------------------------------------------
   Declared after the base tokens above, so where both set a property this one wins. The component rules
   that use them are in theme.css. -------------------------------------------------------------------- */
:root {
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --bg: #ece9e2;
  --surface: #fffefb;
  --surface-2: #f8f6f1;
  --sunken: #e9e5dd;
  --sidebar: rgba(255, 254, 251, .78);
  --line: rgba(33, 27, 66, .09);
  --line-strong: rgba(33, 27, 66, .17);
  --text: #16132a;
  --muted: #625f78;
  --faint: #67647f;
  --on-accent: #ffffff;

  --accent: #5a47f5;
  --accent-hover: #4a38e6;
  --accent-soft: #ebe8ff;
  --accent-text: #4535d6;
  --ember: #ff6a3d;
  --ember-soft: #ffe9e0;
  --mint: #12b886;

  --ok: #12a174;       --ok-soft: #dbf5ec;      --ok-text: #0b6e4f;
  --warn: #e08a12;     --warn-soft: #fff0d4;    --warn-text: #8a5200;
  --danger: #e5484d;   --danger-soft: #ffe3e3;  --danger-text: #b0262b;
  --info: #3b82f6;     --info-soft: #e2edff;    --info-text: #1f55b8;

  --radius-s: 12px; --radius-m: 18px; --radius-l: 26px;

  /* depth: a top highlight + a tight contact shadow + a wide ambient shadow */
  --lift: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(33, 27, 66, .06), 0 14px 34px -14px rgba(52, 38, 150, .22);
  --lift-hi: inset 0 1px 0 rgba(255, 255, 255, 1), 0 2px 4px rgba(33, 27, 66, .07), 0 26px 50px -16px rgba(52, 38, 150, .34);
  --shadow-s: var(--lift);
  --shadow-m: 0 10px 30px -8px rgba(33, 27, 66, .22), 0 2px 6px rgba(33, 27, 66, .08);
  --shadow-l: 0 40px 90px -20px rgba(24, 16, 90, .45);
  --focus: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent);
  --grad-accent: linear-gradient(135deg, #6e5cff 0%, #5a47f5 45%, #7b3df0 100%);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --side-w: 248px; --side-w-collapsed: 84px; --top-h: 56px;
  font-family: var(--font);
  font-feature-settings: "ss01", "cv11";
}
:root[data-theme="dark"] {
  --bg: #08070f;
  --surface: #14122a;
  --surface-2: #1b1836;
  --sunken: #0e0c1d;
  --sidebar: rgba(20, 18, 42, .72);
  --line: rgba(190, 180, 255, .1);
  --line-strong: rgba(190, 180, 255, .2);
  --text: #f0eefc;
  --muted: #a29fbd;
  --faint: #7f7c9c;
  --on-accent: #ffffff;
  --accent: #8a7bff;
  --accent-hover: #a094ff;
  --accent-soft: rgba(138, 123, 255, .16);
  --accent-text: #b9afff;
  --ember: #ff8a5f;
  --ember-soft: rgba(255, 138, 95, .14);
  --ok: #34d3a0;       --ok-soft: rgba(52, 211, 160, .13);   --ok-text: #7ce8c4;
  --warn: #f4b04a;     --warn-soft: rgba(244, 176, 74, .13); --warn-text: #f8cd84;
  --danger: #ff7478;   --danger-soft: rgba(255, 116, 120, .13); --danger-text: #ffa5a8;
  --info: #6aa3ff;     --info-soft: rgba(106, 163, 255, .14); --info-text: #a5c6ff;
  --lift: inset 0 1px 0 rgba(255, 255, 255, .07), 0 1px 2px rgba(0, 0, 0, .5), 0 18px 40px -16px rgba(0, 0, 0, .8);
  --lift-hi: inset 0 1px 0 rgba(255, 255, 255, .12), 0 2px 4px rgba(0, 0, 0, .5), 0 30px 60px -16px rgba(60, 40, 220, .5);
  --shadow-m: 0 14px 40px -8px rgba(0, 0, 0, .8);
  --shadow-l: 0 40px 100px -20px rgba(0, 0, 0, .95);
  --grad-accent: linear-gradient(135deg, #8a7bff 0%, #6d5bff 50%, #9b5cff 100%);
}

/* ---- 2. Base ------------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); border-radius: var(--radius-s); }   /* transparent outline: invisible normally, drawn in the system colour in forced-colors mode, where box-shadow is dropped */
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--sunken); padding: 1px 5px; border-radius: 4px; }
h1 { margin: 0 0 4px; }
h3 { font-weight: 650; }
.sub { color: var(--muted); margin: 0 0 18px; max-width: 78ch; }
.meta { color: var(--muted); font-size: 12.5px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: var(--radius-s); }
.skip:focus { top: 8px; } .skip-2:focus { left: 190px; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 15px; height: 15px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---- 3. App shell ------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s var(--ease); }
html[data-side="collapsed"] .shell { grid-template-columns: var(--side-w-collapsed) minmax(0, 1fr); }

nav.side { border-right: 1px solid var(--line); position: sticky; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 1px; z-index: 40; }
.brand { display: flex; align-items: center; font-weight: 650; line-height: 1.2; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { color: var(--on-accent); display: grid; place-items: center; flex: none; }
.brand small { display: block; font-weight: 500; color: var(--muted); }
nav.side a.nav, nav.side .nav { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 7px 10px; border-radius: var(--radius-s); font-size: 14px; white-space: nowrap; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; font-family: inherit; }
nav.side a.nav:hover { text-decoration: none; }
nav.side .group { margin: 16px 10px 4px; text-transform: uppercase; color: var(--faint); font-weight: 600; white-space: nowrap; }
nav.side .grow { flex: 1; }
.badge { color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; font-weight: 600; line-height: 17px; min-width: 17px; text-align: center; margin-left: auto; }
.side-foot { margin-top: 8px; padding-top: 8px; }
html[data-side="collapsed"] nav.side .label, html[data-side="collapsed"] nav.side .group, html[data-side="collapsed"] .brand span.txt, html[data-side="collapsed"] nav.side .badge { display: none; }
html[data-side="collapsed"] nav.side a.nav, html[data-side="collapsed"] nav.side .nav { justify-content: center; padding: 9px 0; }
html[data-side="collapsed"] .brand { justify-content: center; padding-left: 0; padding-right: 0; }
html[data-side="collapsed"] .side-toggle .ico { transform: scaleX(-1); }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { z-index: 30; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); min-width: 0; overflow: hidden; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--text); }
.crumbs .cur { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--faint); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; padding: 0; position: relative; }
.icon-btn:hover { text-decoration: none; }
.icon-btn .badge { position: absolute; top: 2px; right: 0; margin: 0; }
.search-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); color: var(--faint); cursor: pointer; font: inherit; font-size: 13.5px; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; color: var(--muted); }
.search-btn kbd { margin-left: auto; }
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; border: 1px solid var(--line); z-index: 60; display: none; }
.menu.open .menu-panel { display: block; animation: pop .12s var(--ease); }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-s); color: var(--text); background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--sunken); text-decoration: none; }
.menu-panel .who { padding: 8px 10px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; }
.menu-panel form { margin: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

main { width: 100%; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.claude { display: flex; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 20px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.claude.stale .dot { background: var(--warn); }

/* ---- 4. Components ------------------------------------------------------ */
button, .btn { font: inherit; font-size: 14px; font-weight: 550; padding: 6px 14px; min-height: 34px; border-radius: var(--radius-s); border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .12s, border-color .12s, opacity .12s; }
button:hover, .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
button.ghost, .btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
button.ghost:hover, .btn.ghost:hover { background: var(--sunken); }
button.danger { border-color: var(--danger); }
button.danger:hover { background: var(--danger-soft); }
button.sm, .btn.sm { padding: 2px 10px; min-height: 28px; font-size: 13px; }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
button.loading::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

input, select, textarea { font: inherit; font-size: 14px; padding: 6px 9px; min-height: 34px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid transparent; border-color: var(--accent); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:user-invalid, textarea:user-invalid { border-color: var(--danger); }
textarea { width: 100%; line-height: 1.55; }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--accent); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; background: var(--sunken); color: var(--muted); white-space: nowrap; line-height: 1.6; }
.pill.lead, .pill.prop, .pill.warn { background: var(--warn-soft); color: var(--warn-text); }
.pill.no, .pill.err { background: var(--danger-soft); color: var(--danger-text); }
.pill.yes, .pill.appr, .pill.ok { background: var(--ok-soft); color: var(--ok-text); }
.pill.info { background: var(--info-soft); color: var(--info-text); }
.pill.run { background: var(--info-soft); color: var(--info-text); }
.pill.run::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.pill.off { background: var(--sunken); color: var(--faint); }

.panel, .pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; box-shadow: var(--shadow-s); }
.panel h3, .pcard h3 { margin: 0 0 8px; font-size: 14.5px; }
.pcard ul { margin: 4px 0 0 18px; padding: 0; font-size: 13.5px; }
.warn { border-left: 3px solid var(--warn); background: var(--warn-soft); color: var(--text); padding: 9px 12px; font-size: 13.5px; margin: 8px 0; }
.empty { padding: 32px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.skeleton { background: linear-gradient(90deg, var(--sunken), var(--surface-2), var(--sunken)); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: var(--radius-s); min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

table.t { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.t th { text-align: left; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
.t tr:last-child td { border-bottom: 0; }
.t .title { font-weight: 600; color: var(--text); }
.t .meta { color: var(--muted); font-size: 12.5px; }
.num { text-align: right; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); overflow: hidden; }
.kpi { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.kpi b { display: block; }
.kpi span { color: var(--muted); }

.runway { width: 110px; }
.runway .bar, .meter { height: 6px; background: var(--sunken); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.runway .bar i, .meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.runway.urgent { color: var(--danger-text); font-weight: 600; }
.score { display: inline-block; min-width: 34px; text-align: center; font-weight: 700; padding: 1px 6px; background: var(--sunken); }
.score.hi { color: var(--on-accent); }
.score.mid { background: var(--accent-soft); color: var(--accent-text); }

form.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: end; background: var(--surface); }
form.filters label, .form-grid label, .stack label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }

.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; }
.prose { max-width: 75ch; white-space: pre-wrap; }
dl.facts { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.match { border-top: 1px solid var(--line); padding: 12px 0; }
.match:first-of-type { border-top: 0; }
pre.md { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); padding: 18px; font-family: inherit; max-width: 90ch; }
.row, .row2 { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* tabs: ONE component. A <nav class="tabs"> of links moves between pages (the current link has aria-current="page");
   a <div class="tabs" role="tablist"> of buttons switches panels on the same page (aria-selected="true", keyboard model in app.js). */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 0 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 9px 16px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 550; margin-bottom: -1px; }
.tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; box-shadow: none; min-height: 0; font: inherit; font-weight: 550; cursor: pointer; }
.tabs a[aria-current="page"], .tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 650; }
.tabs a:hover, .tabs button:hover { text-decoration: none; color: var(--text); }
.tabs button:hover { background: transparent; }
.tabs .n { font-size: 11px; background: var(--sunken); color: var(--muted); border-radius: 9px; padding: 0 6px; margin-left: 4px; }

/* ---- 5. Page patterns (Professional Master etc.) ------------------------ */
.pbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 6px; }
.pbar form { display: flex; gap: 6px; align-items: center; margin: 0; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.rte { border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); }
.rte .bar { display: flex; gap: 4px; padding: 4px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.rte .bar button { padding: 2px 9px; background: var(--surface); color: var(--text); border-color: var(--line); }
.rte .ed { min-height: 120px; padding: 10px 12px; outline: none; }
details.sec { margin-bottom: 10px; }
details.sec > summary { cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
details.sec > .body { padding: 4px 16px 16px; }
.item-edit { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; margin-bottom: 10px; background: var(--surface-2); }
.check-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 10px; background: var(--surface); }
.check-list label { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; font-size: 14px; color: var(--text); flex-direction: row; }
/* The CV preview is a paper document: it stays light in both themes. */
.cvpage { background: #fff; color: #1b1b1b; max-width: 820px; margin: 0 auto; padding: 36px 44px; border: 1px solid var(--line); box-shadow: var(--shadow-m); --muted: #5d6b68; }
.cvpage h1 { font-size: 26px; margin: 0; } .cvpage h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid #1c7068; padding-bottom: 2px; margin: 18px 0 6px; }
.cvpage.modern h1, .cvpage.modern h2 { color: #1c7068; } .cvpage.classic { font-family: Georgia, "Times New Roman", serif; } .cvpage.compact { font-size: 13px; }
.cvpage .cv-meta { color: #5d6b68; font-size: 13px; }
.cvpage a { color: #14564f; }

/* ---- 6. Agents, activity, integrations --------------------------------- */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.agent-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; color: var(--text); }
.agent-card:hover { text-decoration: none; }
.agent-card .top { display: flex; gap: 12px; align-items: center; }
.agent-card h3 { margin: 0; font-size: 15px; }
.agent-card p { margin: 0; font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.agent-card .foot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; font-size: 12.5px; color: var(--muted); }
.agent-avatar { width: 40px; height: 40px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.agent-avatar.lg { width: 52px; height: 52px; border-radius: 14px; }
.agent-avatar.c-discovery { background: var(--info-soft); color: var(--info-text); }
.agent-avatar.c-analysis { background: var(--accent-soft); color: var(--accent-text); }
.agent-avatar.c-writing { background: var(--warn-soft); color: var(--warn-text); }
.agent-avatar.c-monitoring { background: var(--ok-soft); color: var(--ok-text); }
.agent-avatar.c-system { background: var(--sunken); color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.active::before, .status.connected::before { background: var(--ok); }
.status.running::before { background: var(--info); animation: pulse 1.2s ease-in-out infinite; }
.status.failed::before, .status.error::before { background: var(--danger); }
.status.stale::before, .status.needs-auth::before { background: var(--warn); }
.status.idle::before, .status.disabled::before, .status.disconnected::before { background: var(--faint); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line-strong); color: var(--muted); font-size: 13px; cursor: pointer; font-weight: 550; }
.chip:hover { color: var(--text); text-decoration: none; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 14px 44px; }
.timeline .node { position: absolute; left: 6px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); display: grid; place-items: center; }
.timeline .node.ok { border-color: var(--ok); } .timeline .node.failed { border-color: var(--danger); background: var(--danger-soft); }
.timeline .node.running { border-color: var(--info); } .timeline .node.claude { border-color: var(--accent); background: var(--accent-soft); }
.timeline .tl-title { font-weight: 600; font-size: 14px; }
.timeline .tl-body { font-size: 13px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.flow { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.flow .step { flex: 1 1 150px; padding: 12px 14px; min-width: 150px; position: relative; }
.flow .step b { display: block; font-size: 13.5px; }
.flow .step span { font-size: 12.5px; color: var(--muted); }
.flow .arrow { display: grid; place-items: center; width: 28px; color: var(--faint); flex: none; }
.checkpoint { border-left: 3px solid var(--warn); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.log { background: var(--sunken); border: 1px solid var(--line); padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; max-height: 280px; overflow: auto; }

/* ---- Command palette, dialog, toasts ------------------------------------ */
dialog { background: var(--surface); color: var(--text); padding: 0; max-width: min(620px, calc(100vw - 24px)); width: 100%; }
dialog[open] { animation: pop .14s var(--ease); }
#palette { margin: 12vh auto auto; }
#palette .pal-in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
#palette input { border: 0; background: none; box-shadow: none; flex: 1; min-height: 28px; font-size: 16px; padding: 0; }
#palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
#palette .pal-h { padding: 8px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 600; }
#palette li.item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); cursor: pointer; font-size: 14px; }
#palette li.item[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-text); }
#palette li.item small { margin-left: auto; color: var(--muted); }
#palette .pal-empty { padding: 24px; text-align: center; color: var(--muted); }
#palette .pal-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.dlg-body { padding: 20px 22px 8px; } .dlg-body h2 { margin: 0 0 6px; font-size: 17px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 10px 14px; font-size: 14px; animation: pop .16s var(--ease); display: flex; gap: 10px; align-items: flex-start; }
.toast.ok { border-left-color: var(--ok); } .toast.error { border-left-color: var(--danger); } .toast.warn { border-left-color: var(--warn); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--muted); padding: 0 2px; min-height: 0; }
.toast button:hover { background: none; color: var(--text); }
.toast .toast-act { margin-left: 10px; color: var(--accent); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---- 7. Responsive + print --------------------------------------------- */
.scrim { display: none; }
.only-m { display: none; }
@media (max-width: 960px) {
  .shell, html[data-side="collapsed"] .shell { grid-template-columns: minmax(0, 1fr); }
  nav.side { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-102%); transition: transform .2s var(--ease); }
  html[data-drawer="open"] nav.side { transform: none; }
  html[data-drawer="open"] .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 14, 13, .45); z-index: 35; }
  html[data-side="collapsed"] nav.side .label, html[data-side="collapsed"] nav.side .group, html[data-side="collapsed"] .brand span.txt { display: revert; }
  html[data-side="collapsed"] nav.side a.nav { justify-content: flex-start; padding: 7px 10px; }
  .side-toggle { display: none; }
  .only-m { display: inline-grid; }
  .search-btn .lbl, .search-btn kbd { display: none; }
      .cols { grid-template-columns: 1fr; }
  .t .hide-m { display: none; }
  dl.facts, .kv { grid-template-columns: 1fr; }
  .cvpage { padding: 20px 18px; }
    .flow .arrow { display: none; }
  .flow .step { flex-basis: 100%; margin-bottom: 8px; }
}
@media print { nav.side, .claude, .noprint, .topbar, #toasts { display: none !important; } .shell { display: block; } .cvpage { border: 0; box-shadow: none; } }

/* answer review diff: marks carry a text label for screen readers and a decoration, never colour alone */
.diff ins { background: var(--ok-soft); color: var(--ok-text); text-decoration: underline; }
.diff del { background: var(--danger-soft); color: var(--danger-text); text-decoration: line-through; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

nav.side .subgroup { margin: 10px 10px 2px 14px; font-size: 10.5px; letter-spacing: .05em; color: var(--faint); font-weight: 600; white-space: nowrap; opacity: .85; }
html[data-side="collapsed"] nav.side .subgroup { display: none; }
.report-pre { white-space: pre-wrap; font: 14px/1.5 system-ui; max-width: 110ch; margin: 24px auto; }   /* the plain-text coverage and limitations reports */
