/* AIC Dashboard. The look is the AIC site's (aic-website/styles/tokens.css): its ink for the sidebar, its paper for the
   page, its blue, Inter for text and Source Serif 4 for a page's title. Sections are built from a few pieces (ui.ts):
   stat tiles, cards, pills, bars and tabs. The page's content security policy allows styles from this file only. */

/* The hidden attribute always wins over a rule that sets display. */
[hidden] { display: none !important; }

@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  color-scheme: light;
  /* paper: the page */
  --paper: #fafaf7;
  --surface: #ffffff;
  --sunken: #f4f4ef;
  --line: #e4e4df;
  --line-strong: #d0d0c8;
  --heading: #0e1116;
  --text: #1b1f27;
  --body: #3d4350;
  --muted: #5a6170;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eef3ff;
  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --warn: #92400e;
  --warn-soft: #fef3c7;
  --warn-line: #d97706;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;
  /* ink: the sidebar stays dark in both themes, like the AIC site's header */
  --ink: #0b0e14;
  --ink-deep: #07090d;
  --ink-surface: #141924;
  --ink-line: rgba(255, 255, 255, 0.1);
  --ink-heading: #f4f6ff;
  --ink-text: #c9cfe0;
  --ink-muted: #8d95ad;
  --ink-accent: #7db4ff;
  /* buttons keep one color in both themes */
  --btn: #1d4ed8;
  --btn-hover: #1e40af;
  --on-btn: #ffffff;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(14, 17, 22, 0.04), 0 1px 1px rgba(14, 17, 22, 0.03);
  --shadow-lift: 0 12px 32px rgba(14, 17, 22, 0.14), 0 2px 6px rgba(14, 17, 22, 0.08);
  --sidebar: 256px;
  --gutter: 40px;
  /* the makers' colors of the Lab's rankings, chosen to stay apart in both themes */
  --m-qwen: #5b4cc4; --m-google: #1f7a5a; --m-meta: #2c6fd1; --m-zai: #b5532b; --m-deepseek: #9a3b8f;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0b0e14;
    --surface: #141924;
    --sunken: #0f131c;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.2);
    --heading: #f4f6ff;
    --text: #e6e9f5;
    --body: #c9cfe0;
    --muted: #a3abc2;
    --accent: #7db4ff;
    --accent-hover: #a5cbff;
    --accent-soft: #16233f;
    --ok: #4ade80;
    --ok-soft: #0f2318;
    --warn: #fcd34d;
    --warn-soft: #3a2a0a;
    --warn-line: #d97706;
    --bad: #fca5a5;
    --bad-soft: #2a1215;
    --ink: #07090d;
    --shadow: none;
    --shadow-lift: 0 12px 32px rgba(0, 0, 0, 0.5);
    --m-qwen: #a99cf5; --m-google: #6fd3a8; --m-meta: #8fb8f7; --m-zai: #f3a07a; --m-deepseek: #e39bd8;
  }
}

/* Base ---------------------------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font: 15px/1.55 var(--font); color: var(--text); background: var(--paper);
  font-feature-settings: "cv11", "ss03"; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3 { color: var(--heading); }
h1 { font: 600 30px/1.15 var(--serif); letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 650; line-height: 1.3; }
h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 20px 0 8px; }
p + p, p + ul, ul + p, p + .actions { margin-top: 10px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
code { font: 12.5px var(--mono); font-variant-ligatures: none; background: var(--sunken); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
pre { margin: 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13.5px; line-height: 1.5; max-width: 86ch; }
.hint.foot { margin-top: 4px; }
.lead-line { font-weight: 600; color: var(--heading); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The shell: sidebar and page -------------------------------------------------------------------------------------- */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); display: flex; flex-direction: column;
  background: var(--ink); color: var(--ink-text); border-right: 1px solid var(--ink-line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 22px 22px 18px; color: var(--ink-heading); text-decoration: none;
  font-size: 15px; font-weight: 500; letter-spacing: 0.01em; }
.brand:hover { color: #fff; }
.brand .logo { height: 26px; width: auto; flex: none; }
.brand span { padding-left: 10px; border-left: 1px solid var(--ink-line); color: var(--ink-text); }
.tabs { flex: 1; padding: 4px 12px 12px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-title { padding: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.tabs button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 36px; padding: 7px 10px; margin: 1px 0;
  background: none; border: 0; border-radius: var(--radius-sm); color: var(--ink-text); font: inherit; font-size: 14px; font-weight: 500;
  text-align: left; cursor: pointer; transition: background 0.12s, color 0.12s; }
.tabs button .icon { color: var(--ink-muted); transition: color 0.12s; }
.tabs button:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.tabs button.active { background: rgba(125, 180, 255, 0.14); color: #fff; }
.tabs button.active .icon, .tabs button:hover .icon { color: var(--ink-accent); }
.tabs button:focus-visible { outline-color: var(--ink-accent); }
.nav-label { flex: 1; }
.count { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 10px; background: var(--btn); color: #fff;
  font-size: 11.5px; font-weight: 600; line-height: 1.5; text-align: center; font-variant-numeric: tabular-nums; }
.count:empty { display: none; }
.sidebar-foot { padding: 14px 22px 18px; border-top: 1px solid var(--ink-line); font-size: 13px; }
.sidebar-foot .nav-title { padding: 0 0 4px; }
.sites { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.sites a { color: var(--ink-text); text-decoration: none; }
.sites a:hover { color: #fff; text-decoration: underline; }
.who { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ink-line); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.who span { color: var(--ink-muted); font-size: 12.5px; overflow-wrap: anywhere; }
.who button.link { color: var(--ink-text); padding: 2px 0; font-size: 13px; }
.who button.link:hover { color: #fff; }

.topbar, .scrim { display: none; }
main { margin-left: var(--sidebar); padding: 36px var(--gutter) 72px; }
.tab { display: none; max-width: 1240px; margin: 0 auto; }
.tab.active { display: flex; flex-direction: column; gap: 20px; }
body.has-selection main { padding-bottom: 120px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; padding-bottom: 4px; }
.page-title p { margin-top: 6px; color: var(--muted); max-width: 70ch; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.section-title { margin: 12px 0 -6px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* While signing in, or when an account isn't allowed */
.gate { max-width: 420px; margin: 22vh auto 0; padding: 0 24px; text-align: center; }
.gate .logo { height: 40px; color: var(--heading); margin-bottom: 20px; }
.gate h1 { font-size: 26px; }
.gate p { color: var(--muted); margin: 10px 0 18px; }
body.signed-out main, body.signed-out .sidebar, body.signed-out .topbar { display: none; }
body:not(.signed-out) .gate { display: none; }

/* Controls ------------------------------------------------------------------------------------------------------------ */
input[type=search], input[type=text], input[type=email], input[type=number], input[type=month], input[type=date], select, textarea {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 8px 11px; min-height: 38px; transition: border-color 0.12s, box-shadow 0.12s; }
select { padding-right: 30px; }
input[type=number] { width: 72px; }
textarea { width: 100%; resize: vertical; font: 13px/1.55 var(--mono); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
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:disabled { color: var(--muted); background: var(--sunken); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--btn); vertical-align: -3px; }

button, .button { font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; border-radius: var(--radius-sm); padding: 9px 15px; min-height: 38px; cursor: pointer;
  border: 1px solid var(--btn); background: var(--btn); color: var(--on-btn); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background 0.12s, border-color 0.12s, color 0.12s; }
button:hover, .button:hover { background: var(--btn-hover); border-color: var(--btn-hover); color: var(--on-btn); }
button:disabled { opacity: 0.5; cursor: default; }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
button.secondary:hover, .button.secondary:hover { background: var(--sunken); border-color: var(--muted); color: var(--heading); }
button.link { background: none; border-color: transparent; color: var(--accent); padding: 6px 6px; min-height: 0; font-weight: 500; }
button.link:hover { background: none; border-color: transparent; color: var(--accent-hover); text-decoration: underline; }
button.small, .button.small { padding: 6px 11px; min-height: 32px; font-size: 13px; }
button.danger { background: var(--surface); color: var(--bad); border-color: var(--line-strong); }
button.danger:hover { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
button.danger.solid { background: #b91c1c; border-color: #b91c1c; color: #fff; }
button.danger.solid:hover { background: #991b1b; border-color: #991b1b; }
button.danger-link, button.link.danger-link { color: var(--bad); }
.icon-button { background: none; border-color: transparent; color: var(--muted); padding: 0; width: 36px; min-height: 36px; }
.icon-button:hover { background: var(--sunken); border-color: transparent; color: var(--heading); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.actions.end { justify-content: flex-end; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0 16px 8px 0; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; }
.segmented button, .scrubber button { border: 0; background: none; color: var(--body); font-weight: 500; padding: 6px 13px; min-height: 30px; border-radius: 7px; }
.segmented button:hover, .scrubber button:hover { background: none; color: var(--heading); }
.segmented button.active, .scrubber button.on { background: var(--surface); color: var(--heading); font-weight: 600; box-shadow: 0 1px 2px rgba(14, 17, 22, 0.14); }

/* Tabs inside a section */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subtabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px; padding: 10px 14px; min-height: 0;
  color: var(--muted); font-weight: 500; white-space: nowrap; }
.subtabs button:hover { background: none; color: var(--heading); border-color: transparent; border-bottom-color: var(--line-strong); }
.subtabs button.active { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.subtabs .count { margin-left: 4px; }
.panel { display: none; }
.panel.active { display: block; }

/* Pieces -------------------------------------------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); min-width: 0; }
.card.quiet { background: none; box-shadow: none; }
.card > h2 { margin-bottom: 8px; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.card-head .hint { margin-top: 4px; }
.card-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-actions { display: flex; align-items: center; gap: 8px; }
.card.flush { padding-left: 0; padding-right: 0; padding-bottom: 0; overflow: hidden; }
.card.flush > .card-head, .card.flush > .empty { margin-left: 24px; margin-right: 24px; }
.card.flush > .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.card.flush > .empty { margin-bottom: 24px; }
.card label { display: block; margin: 0 0 14px; font-size: 13.5px; font-weight: 550; color: var(--body); }
.card label > input, .card label > select, .card label > textarea { display: block; width: 100%; margin-top: 6px; font-weight: 400; }
.card label > input[type=number] { display: inline-block; width: 76px; margin: 0 6px; }
.card label > input[type=radio], .card label > input[type=checkbox] { display: inline; width: 16px; margin: 0 6px 0 0; }
.card label.narrow { max-width: 360px; }
.card label.inline, .ticks label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--text); font-size: 14px; }
.ticks { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }

details.fold > summary { cursor: pointer; font-weight: 600; color: var(--heading); list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: ""; width: 7px; height: 7px; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg) translateY(-2px); transition: transform 0.12s; flex: none; }
details.fold[open] > summary::before { transform: rotate(45deg) translateY(-3px); }
details.fold > summary .hint { font-weight: 400; }
details.fold[open] > summary { margin-bottom: 14px; }
.card details.fold:not(.card) { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: inherit; text-decoration: none; min-width: 0; transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s; }
a.stat:hover { border-color: var(--accent); color: inherit; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(14, 17, 22, 0.08); }
.stat strong { font-size: 28px; font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; color: var(--heading); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.stat em { font-style: normal; font-size: 13px; font-weight: 550; color: var(--body); }
.stat.accent strong { color: var(--accent); }
.stat.warn strong { color: var(--warn); }
.stat.bad strong { color: var(--bad); }
.stat.ok strong { color: var(--ok); }

.pill, .lab-badge, .flag, .badge { display: inline-flex; align-items: center; white-space: nowrap; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5;
  background: var(--sunken); color: var(--body); border: 1px solid var(--line); }
.pill.accent, .flag.linked { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.ok, .lab-badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn, .lab-badge.warn, .flag, .badge { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad, .lab-badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.lab-badge.wrap { white-space: normal; border-radius: 10px; }
.flag { margin: 3px 4px 0 0; font-size: 11px; padding: 0 7px; }
.badge { margin-left: 8px; font-size: 11px; padding: 0 7px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 7px; font-size: 12.5px; background: var(--sunken); border: 1px solid var(--line); color: var(--body); white-space: nowrap; }
td .chip { margin: 0 4px 3px 0; }
.chip strong { color: var(--heading); font-weight: 600; }
.chip.izuran_beta { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip.server_trial { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip.moved { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); white-space: normal; }
.chip.moved strong { color: inherit; }
button.chip.opens { font: inherit; font-size: 12.5px; min-height: 0; cursor: pointer; }
button.chip.opens:hover { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
button.chip.opens[aria-expanded="true"] { outline: 2px solid var(--warn-line); }

.banner { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--body); font-size: 14px; border-left: 3px solid var(--accent); max-width: none; }
.banner.warn { background: var(--warn-soft); color: var(--warn); border-left-color: var(--warn-line); }
.banner.bad { background: var(--bad-soft); color: var(--bad); border-left-color: var(--bad); font-weight: 600; }
p.warn, .warn { color: var(--warn); font-weight: 600; }
p.ok, .state-done, .state-skipped { color: var(--ok); font-weight: 600; }
.state-failed { color: var(--bad); font-weight: 600; }
.state-started { color: var(--accent); font-weight: 600; }
.state-off { color: var(--bad); }
.state-on { color: var(--ok); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty.boxed { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 48px 16px; }
.result { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); }
.result.error { background: var(--bad-soft); color: var(--bad); }
.progress { color: var(--muted); font-size: 13px; }
pre.cmd { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font: 12.5px/1.5 var(--mono); overflow: auto; font-variant-ligatures: none; }
ul.plain { list-style: none; padding: 0; display: grid; gap: 8px; }
ul.plain li { padding-left: 18px; position: relative; }
ul.plain li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }

.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  font-size: 12px; font-weight: 650; letter-spacing: 0.02em; background: var(--accent-soft); color: var(--accent); }
.avatar.tint-1 { background: var(--ok-soft); color: var(--ok); }
.avatar.tint-2 { background: var(--warn-soft); color: var(--warn); }
.avatar.tint-3 { background: color-mix(in srgb, var(--m-qwen) 16%, var(--surface)); color: var(--m-qwen); }
.avatar.tint-4 { background: color-mix(in srgb, var(--m-deepseek) 16%, var(--surface)); color: var(--m-deepseek); }
.avatar.tint-5 { background: color-mix(in srgb, var(--m-zai) 18%, var(--surface)); color: var(--m-zai); }

/* Tables */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.table-wrap.small { max-height: 240px; box-shadow: none; }
.table-wrap.inset { box-shadow: none; margin: 4px 0 16px; }
.card .table-wrap { box-shadow: none; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child > th, tbody tr:last-child > td { border-bottom: 0; }
thead th { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--sunken); position: sticky; top: 0; z-index: 1;
  white-space: nowrap; padding-top: 9px; padding-bottom: 9px; }
tbody th { font-weight: 600; color: var(--heading); }
th.num { text-align: right; }
.card.flush th:first-child, .card.flush td:first-child { padding-left: 24px; }
.card.flush th:last-child, .card.flush td:last-child { padding-right: 24px; }
td.check, th.check { width: 44px; padding-right: 0; }
td .sub, th .sub { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.muted-row td { color: var(--muted); }
table.leads tbody tr { cursor: pointer; transition: background 0.1s; }
table.leads tbody tr:hover { background: var(--sunken); }
table.leads tbody tr.selected { background: var(--accent-soft); }
table.leads td { vertical-align: middle; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
table.leads th, table.leads td { padding-left: 12px; padding-right: 12px; }
table.leads td:nth-child(3) { min-width: 132px; }
table.leads td:nth-child(5) .chip { white-space: normal; }
.person strong { color: var(--heading); font-weight: 600; }
td.asked { max-width: 380px; font-size: 13px; color: var(--body); overflow-wrap: anywhere; }
#sample td, #sample th, #x-sample td, #x-sample th { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
#x-columns td, #x-columns th { white-space: normal; max-width: none; }
.more { text-align: center; }

dl.facts, dl.about { display: grid; grid-template-columns: 1fr auto; gap: 0; }
dl.facts dt, dl.facts dd, dl.about dt, dl.about dd { padding: 10px 0; border-bottom: 1px solid var(--line); }
dl.facts dt, dl.about dt { color: var(--muted); }
dl.facts dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--heading); }
dl.about { grid-template-columns: minmax(120px, max-content) 1fr; column-gap: 20px; font-size: 14px; }
dl.about dd { overflow-wrap: anywhere; }
dl.facts dt:last-of-type, dl.facts dd:last-of-type, dl.about dt:last-of-type, dl.about dd:last-of-type { border-bottom: 0; }

/* Bars and the chart of days */
.meter { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 4px; background: var(--accent); }
.meter-fill.ok { background: var(--ok); }
.bar-list ul { list-style: none; padding: 0; display: grid; gap: 12px; }
.bar-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; font-size: 14px; }
.bar-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list .num { font-weight: 600; color: var(--heading); }
.bar-list .meter { grid-column: 1 / -1; height: 6px; }
.funnel { list-style: none; padding: 0; display: grid; gap: 14px; margin-bottom: 18px; }
.funnel li { display: grid; grid-template-columns: 150px 56px minmax(0, 1fr) 48px; gap: 14px; align-items: center; }
.funnel .name { font-weight: 550; color: var(--heading); }
.funnel .num { font-weight: 650; color: var(--heading); }
.funnel .meter { height: 14px; border-radius: 7px; }
.funnel .meter-fill { border-radius: 7px; }
.funnel .share { color: var(--muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13px; color: var(--muted); margin: 6px 0; }
.legend i, .anatomy i.kind, .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; }
.swatch.accent, .bars i.accent { background: var(--accent); }
.swatch.ok, .bars i.ok { background: var(--ok); }
.day-chart .columns { display: flex; align-items: stretch; gap: 3px; height: 200px; margin-top: 14px; padding-top: 6px; border-bottom: 1px solid var(--line); }
.day-chart .column { flex: 1; min-width: 0; display: flex; flex-direction: column; border-radius: 4px 4px 0 0; }
.day-chart .column:hover { background: var(--sunken); }
.day-chart .bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 1px; }
.day-chart .bars i { flex: 1; max-width: 14px; border-radius: 3px 3px 0 0; min-height: 0; }
.day-chart .tick { height: 0; font-size: 11px; color: var(--muted); white-space: nowrap; text-align: center; transform: translateY(8px); }
.day-chart { padding-bottom: 26px; }

/* Home: what waits */
.todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.todo-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 16px 20px; border-radius: var(--radius); text-decoration: none;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn-line) 40%, transparent); color: var(--warn); transition: transform 0.12s, box-shadow 0.12s; }
.todo-item:hover { color: var(--warn); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(14, 17, 22, 0.08); }
.todo-item strong { font-size: 16px; }
.todo-item span { grid-column: 1; font-size: 13.5px; }
.todo-item .go { grid-column: 2; grid-row: 1 / span 2; font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--surface); }

/* Leads --------------------------------------------------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters input[type=search] { flex: 1 1 320px; max-width: 460px; }
.bulk { position: fixed; z-index: 15; left: calc(var(--sidebar) + 50vw - var(--sidebar) / 2); bottom: 24px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  max-width: calc(100vw - var(--sidebar) - 48px); padding: 10px 12px 10px 18px; background: var(--ink-surface); color: var(--ink-heading);
  border: 1px solid var(--ink-line); border-radius: 14px; box-shadow: var(--shadow-lift); font-size: 14px; }
.bulk label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-text); }
.bulk input, .bulk select { min-height: 34px; padding: 5px 9px; background: var(--ink); color: var(--ink-heading); border-color: var(--ink-line); }
.bulk input[type=number] { width: 58px; }
.bulk button { min-height: 34px; padding: 6px 12px; }
.bulk button.secondary, .bulk button.danger { background: transparent; color: var(--ink-heading); border-color: rgba(255, 255, 255, 0.24); }
.bulk button.secondary:hover { background: rgba(255, 255, 255, 0.08); }
.bulk button.danger { color: #fca5a5; }
.bulk button.danger:hover { background: rgba(252, 165, 165, 0.12); border-color: #fca5a5; }
.bulk button.link { color: var(--ink-text); }
.divider { width: 1px; height: 22px; background: var(--ink-line); }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lift); display: flex; flex-direction: column; animation: slide-in 0.18s ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: 20px 20px 18px 24px; border-bottom: 1px solid var(--line); }
.drawer-head .avatar { width: 44px; height: 44px; font-size: 15px; }
.drawer-who { flex: 1; min-width: 0; }
.drawer-head h2 { font-size: 19px; overflow-wrap: anywhere; }
.drawer-head p { font-size: 13.5px; overflow-wrap: anywhere; }
.drawer-body { padding: 4px 24px 40px; overflow: auto; }
.drawer-body > section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.drawer-body > section:last-child { border-bottom: 0; }
.drawer-body h3 { margin-top: 0; }
.drawer-body .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin: 0; }
.drawer-body .fields label, .notes-field, .read span { font-size: 12.5px; font-weight: 550; color: var(--muted); }
.drawer-body .fields input, .drawer-body .fields select, .notes-field textarea { display: block; width: 100%; margin-top: 5px; font-weight: 400; }
.notes-field { display: block; margin-top: 12px; }
.notes-field textarea { font: inherit; font-size: 14px; }
.read { display: flex; flex-direction: column; gap: 5px; }
.read strong { font-weight: 500; padding: 8px 0; }
div.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
div.checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.attention { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px !important; margin-top: 16px; border-radius: var(--radius-sm); background: var(--warn-soft); border-bottom: 0 !important; }
.note-form { display: flex; gap: 8px; margin-bottom: 8px; }
.note-form input { flex: 1; min-width: 0; }
.timeline { list-style: none; padding: 0; margin: 0 0 0 5px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 10px 0 10px 18px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline .when { color: var(--muted); font-size: 12.5px; }
.timeline .kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-left: 8px; padding: 1px 6px; border-radius: 5px; background: var(--sunken); }
.timeline .muted { font-size: 12.5px; }
.timeline details { margin-top: 4px; font-size: 13px; }
.timeline summary { cursor: pointer; color: var(--accent); }
.timeline pre, .invite details pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; padding: 10px 12px; font: 12.5px/1.5 var(--mono);
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.submission { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; }
.submission .about { margin-top: 10px; font-size: 13.5px; }
.submission dl.about dt, .submission dl.about dd { padding: 6px 0; }
.submission .meta, .invite .meta { color: var(--muted); font-size: 13px; }
.submission .buttons, .invite .buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.submission details { margin-top: 8px; font-size: 13px; color: var(--muted); }
.conflicts { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.danger-zone { text-align: right; }

/* Invitations */
.cards-list { display: grid; gap: 12px; }
.invite { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.drawer .invite { box-shadow: none; padding: 14px 16px; margin-bottom: 10px; border-radius: var(--radius-sm); }
.invite-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.invite-who { flex: 1; min-width: 0; }
.invite-who strong { display: block; font-size: 15px; color: var(--heading); overflow-wrap: anywhere; }
.submission .invite-head strong { font-size: 14px; }
.invite details { margin-top: 12px; font-size: 13.5px; }
.invite summary { cursor: pointer; color: var(--accent); font-weight: 500; }

/* Import */
.file { display: block; margin: 16px 0 0 !important; }
.file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--sunken); cursor: pointer; text-align: center; color: var(--muted); transition: border-color 0.12s, background 0.12s; }
.file span:hover { border-color: var(--accent); background: var(--accent-soft); }
.file .icon { width: 26px; height: 26px; color: var(--accent); margin-bottom: 4px; }
.file strong { color: var(--heading); font-size: 15px; }
.file em { font-style: normal; font-size: 13px; font-weight: 400; }
.file:focus-within span { outline: 2px solid var(--accent); outline-offset: 2px; }
#x-preview, #preview { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 14px 0 6px; align-items: start; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 14px 10px; margin: 0; }
fieldset label { display: block; font-weight: 400 !important; margin: 4px 0 !important; color: var(--text) !important; font-size: 14px !important; }
legend { font-size: 12.5px; font-weight: 550; color: var(--muted); padding: 0 6px; }
.mapping { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mapping label { margin: 0; }
.notes { margin: 6px 0 10px; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.imports { list-style: none; margin: 0; padding: 0; }
.imports li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.imports li:last-child { border-bottom: 0; padding-bottom: 0; }
.imports li:first-child { padding-top: 4px; }
.imports .muted { font-size: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 12px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); }
.form-row label { margin: 0 !important; }
#x-links .form-row { grid-template-columns: 2fr auto 1.4fr; }
#x-forms-add { margin-top: 12px; }

/* Approvals */
.approval.pending { border-left: 4px solid var(--warn-line); }
.approval:not(.pending) { box-shadow: none; }
.approval-email { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px;
  font: inherit; font-size: 14px; max-height: 480px; overflow: auto; margin: 8px 0; }

/* Dialogs and the toast */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 26px; width: min(460px, 92vw); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lift); }
dialog::backdrop { background: rgba(7, 9, 13, 0.55); }
dialog h2 { font: 600 22px/1.2 var(--serif); margin-bottom: 14px; }
dialog label { display: block; margin-bottom: 12px; font-size: 13.5px; font-weight: 550; color: var(--body); }
dialog label input[type=text], dialog label input[type=email] { display: block; width: 100%; margin-top: 6px; font-weight: 400; }
dialog p { margin-bottom: 12px; }
#delete-dialog { width: min(540px, 92vw); }
#toast { position: fixed; left: calc(var(--sidebar) + 50vw - var(--sidebar) / 2); bottom: 28px; transform: translate(-50%, 8px); background: var(--ink-surface); color: var(--ink-heading);
  padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50;
  max-width: 80vw; box-shadow: var(--shadow-lift); border: 1px solid var(--ink-line); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: #b91c1c; color: #fff; border-color: transparent; }
body.has-selection #toast { bottom: 96px; }

/* Assistants: connect */
.connect-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-top: 14px; }
.connect-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--sunken); }
.connect-card h2 { margin-bottom: 8px; }
.connect-card ol { padding-left: 20px; margin: 10px 0; font-size: 14px; display: grid; gap: 4px; }
.connect-card .muted { font-size: 13px; }
.copy-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 6px 0; font-size: 13.5px; }
.copy-row code { overflow-wrap: anywhere; background: var(--surface); }

/* Feedback */
.report-text { margin: 10px 0; padding: 14px 16px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); white-space: pre-wrap;
  overflow-wrap: anywhere; font: inherit; max-height: 320px; overflow: auto; }
.report-text.log { font: 12.5px/1.5 var(--mono); }
.report.state-is-done { opacity: 0.72; box-shadow: none; }
.report h3 { margin: 14px 0 0; }
.report select { min-height: 34px; padding: 5px 30px 5px 10px; }

/* Releases ------------------------------------------------------------------------------------------------------------ */
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.plan > * + * { margin-top: 12px; }
.plan > h2 { font-size: 18px; }
.plan.proposal { border-left: 4px solid var(--warn-line); }
.plan .table-wrap { box-shadow: none; }
.plan tr.current th, .plan tr.current td { background: var(--accent-soft); }
.state-none { color: var(--muted); }
.fields { display: flex; flex-wrap: wrap; gap: 14px 16px; margin: 12px 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--muted); min-width: 0; }
.field textarea { width: min(100%, 680px); font: inherit; font-size: 14px; }
.field select { max-width: min(100%, 560px); }
.plan > .field { display: flex; }
details.runtime-change > summary { cursor: pointer; font-weight: 650; font-size: 16px; color: var(--heading); }
details.runtime-change:not([open]) { box-shadow: none; }
.runtime-change h3 { margin: 18px 0 2px; }
.runtime-change .libraries .field { width: 150px; }
.runtime-change .libraries input { width: 100%; }
.runtime-change input.edited { border-color: var(--warn-line); background: var(--warn-soft); }
.changed { border-top: 1px solid var(--line); padding-top: 14px; }
.changed > * + * { margin-top: 10px; }
.changed h3, .lenses h3, .commands h3 { margin: 14px 0 4px; }
.changed h3:first-child { margin-top: 0; }
.scrubber { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; margin: 4px 0 14px; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; }
.scrubber + div > * + * { margin-top: 12px; }
.sizebar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; margin: 10px 0 6px; gap: 2px; }
.sizebar .seg { flex-basis: 0; min-width: 3px; }
.seg-voice { background: #7c3aed; } .seg-frameworks { background: #0e7490; } .seg-runtime { background: #0f766e; }
.seg-executables { background: #1d4ed8; } .seg-engine { background: #b45309; } .seg-rest { background: var(--line-strong); }
.kind-ours { background: #1d4ed8; } .kind-fork { background: #0f766e; } .kind-theirs { background: var(--muted); }
.anatomy tr.group th { background: var(--sunken); text-align: left; font-size: 12.5px; font-weight: 650; padding-top: 12px; color: var(--heading); }
.anatomy tr.group th span { font-weight: 400; color: var(--muted); }
.anatomy tr.part { cursor: pointer; }
.recipe .anatomy tr.part { cursor: default; }
.anatomy tr.part:hover td, .anatomy tr.part:hover th, .anatomy tr.part.open td, .anatomy tr.part.open th { background: var(--sunken); }
.recipe .anatomy tr.part:hover td, .recipe .anatomy tr.part:hover th { background: none; }
.anatomy tr.part:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.anatomy tr.part.moved th { box-shadow: inset 3px 0 0 var(--warn-line); }
.anatomy tr.detail td { background: var(--sunken); font-size: 13.5px; }
.anatomy tr.detail p { margin: 4px 0; }
.anatomy td:nth-child(2) { white-space: nowrap; }
.recipe, .lenses:not(.card) { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; background: var(--surface); }
.recipe > summary { cursor: pointer; font-weight: 600; color: var(--heading); }
.recipe[open] > summary { margin-bottom: 12px; }
.recipe > * + * { margin-top: 10px; }
.commands pre.cmd { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 4px; }
.commands > div + div { margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--line); }
.lenses ul { margin: 6px 0 10px; padding-left: 20px; font-size: 14px; display: grid; gap: 4px; }
.lenses > div + div { margin-top: 14px; }
/* The path of a part (path.ts): a picker, five steps in a row, what shows on the Mac, then the installed folders. */
.path-pick { display: grid; gap: 14px; }
.path-track > p { margin-bottom: 8px; }
.path-parts { display: flex; flex-wrap: wrap; gap: 6px; }
button.path-part { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--body); cursor: pointer; }
button.path-part:hover { background: var(--sunken); color: var(--heading); }
button.path-part.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.path-part i.kind { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; }
.path-stages { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; }
.path-stages li { position: relative; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunken); font-size: 13.5px; line-height: 1.5; }
.path-stages li + li::before { content: ""; position: absolute; left: -19px; top: 26px; width: 8px; height: 8px;
  border-top: 2px solid var(--line-strong); border-right: 2px solid var(--line-strong); transform: rotate(45deg); }
.path-step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--btn); color: var(--on-btn); font-size: 12px; font-weight: 600; }
.path-stages h3 { margin: 10px 0 0; font-size: 15px; font-weight: 650; text-transform: none; letter-spacing: 0; color: var(--heading); }
.path-stages .hint { font-size: 12.5px; margin-bottom: 10px; }
.path-stages code { overflow-wrap: anywhere; background: var(--surface); }
.path-pin { display: block; margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.path-seen { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 8px 24px; align-items: center; margin-top: 16px; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius); }
.path-seen h3, .path-place h3 { margin: 0 0 8px; }
.path-seen + .legend { margin-top: 14px; }
.path-explorer { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.path-tree { display: grid; gap: 2px; }
.path-tree button { display: block; width: 100%; min-height: 32px; text-align: left; padding: 6px 10px; border: 0; border-radius: var(--radius-sm); background: none;
  font: 12.5px var(--mono); color: var(--body); cursor: pointer; overflow-wrap: anywhere; }
.path-tree button.depth-0 { color: var(--heading); font-weight: 600; margin-top: 8px; }
.path-tree button.depth-0:first-child { margin-top: 0; }
.path-tree button.depth-1 { padding-left: 28px; }
.path-tree button:hover { background: var(--sunken); }
.path-tree button.on { background: var(--accent-soft); color: var(--accent); }
.path-tree button.holds { box-shadow: inset 3px 0 0 var(--accent); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.path-place { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunken); display: grid; gap: 12px; }
.path-place p { margin: 0; }
.path-name code { font-size: 13.5px; overflow-wrap: anywhere; background: var(--surface); }
@media (max-width: 1180px) {
  .path-stages { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .path-stages li + li::before { left: 24px; top: -16px; transform: rotate(135deg); }
}
@media (max-width: 760px) {
  .path-seen, .path-explorer { grid-template-columns: minmax(0, 1fr); }
}
ul.checks { list-style: none; margin: 6px 0 12px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
ul.checks li { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--sunken); }
ul.checks li.ok strong { color: var(--ok); }
ul.checks li.warn { font-weight: 400; color: var(--text); background: var(--bad-soft); }
ul.checks li.warn strong { color: var(--bad); }
ul.checks li.differs { background: var(--warn-soft); }
ul.checks li.differs strong { color: var(--warn); }
.assistant-words { padding: 10px 16px 12px; border-left: 3px solid var(--line-strong); background: var(--sunken); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.assistant-words h3 { margin-top: 2px; }
.assistant-words summary { cursor: pointer; font-weight: 550; }
.assistant-words ul { padding-left: 20px; margin-top: 8px; }
.assistant-words li { overflow-wrap: anywhere; }

/* Lab ----------------------------------------------------------------------------------------------------------------- */
.copy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.lab-copy { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--sunken); font-size: 14px; min-width: 0; }
.lab-copy > p:first-child { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.lab-copy code { overflow-wrap: anywhere; background: var(--surface); }
.lab-copy ul { margin: 6px 0 8px; padding-left: 18px; }
.lab tr.detail code { overflow-wrap: anywhere; }
.lab-badge { margin: 0 6px 3px 0; }
.rankings { display: flex; flex-direction: column; gap: 16px; }
.rank-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rank-controls label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin: 0; }
.rank-controls select { min-height: 34px; padding: 5px 30px 5px 10px; }
.rank-chart { padding: 16px 18px 10px; }
svg.rank-scatter { width: 100%; height: auto; display: block; }
svg.rank-scatter .grid { stroke: var(--line); stroke-width: 1; }
svg.rank-scatter .tick { fill: var(--muted); font-size: 11px; }
svg.rank-scatter .axis { fill: var(--muted); font-size: 12px; font-weight: 600; }
svg.rank-scatter .label { fill: var(--text); font-size: 11px; }
svg.rank-scatter .pt { cursor: pointer; }
svg.rank-scatter .pt:focus { outline: none; }
svg.rank-scatter .whisker { stroke: var(--muted); stroke-width: 2; }
svg.rank-scatter .pt circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
svg.rank-scatter .pt:focus circle, svg.rank-scatter .pt:hover circle { stroke: var(--heading); }
svg.rank-scatter .pt.m-qwen circle { fill: var(--m-qwen); } svg.rank-scatter .pt.m-google circle { fill: var(--m-google); }
svg.rank-scatter .pt.m-meta circle { fill: var(--m-meta); } svg.rank-scatter .pt.m-zai circle { fill: var(--m-zai); }
svg.rank-scatter .pt.m-deepseek circle { fill: var(--m-deepseek); }
svg.rank-scatter .pt.unranked circle { fill: var(--surface); stroke: var(--muted); stroke-dasharray: 2 2; }
.rank-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 4px; color: var(--muted); font-size: 12.5px; }
.rank-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.rank-dot.m-qwen { background: var(--m-qwen); } .rank-dot.m-google { background: var(--m-google); } .rank-dot.m-meta { background: var(--m-meta); }
.rank-dot.m-zai { background: var(--m-zai); } .rank-dot.m-deepseek { background: var(--m-deepseek); }
.rank-dot.hollow { background: transparent; border: 1px dashed var(--muted); }
details.rank-board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); transition: border-color 0.12s; }
details.rank-board:hover { border-color: var(--line-strong); }
details.rank-board > summary { list-style: none; cursor: pointer; }
details.rank-board > summary::-webkit-details-marker { display: none; }
.rank-row { display: grid; grid-template-columns: 44px minmax(200px, 2fr) repeat(3, minmax(120px, 1fr)) minmax(150px, 1fr); gap: 6px 18px; align-items: center; }
.rank-who { display: block; min-width: 0; }
.rank-row .rank { font: 600 22px/1 var(--serif); color: var(--heading); font-variant-numeric: tabular-nums; }
.rank-row .col { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.rank-row .col .lab-badge { align-self: flex-start; }
.rank-row .sub { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.rank-score { display: flex; align-items: center; gap: 8px; }
.rank-score .track { position: relative; flex: 1; height: 8px; min-width: 60px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.rank-score .track span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.rank-score .track span.intel { background: var(--m-qwen); } .rank-score .track span.fit { background: var(--ok); }
.rank-score .track i.range { position: absolute; top: 0; height: 100%; background: var(--heading); opacity: 0.3; border-radius: 4px; }
.rank-score .num { font-size: 13px; font-weight: 600; min-width: 34px; }
.rank-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 28px; padding: 14px 0 2px; border-top: 1px solid var(--line); margin-top: 14px; }
.rank-breakdown h3 { margin-top: 0; }
.rank-part { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(140px, 1.4fr); gap: 8px; align-items: center; margin: 5px 0; font-size: 13.5px; }

/* Narrow windows ------------------------------------------------------------------------------------------------------ */
@media (max-width: 1100px) {
  :root { --gutter: 28px; }
  .split, .split.even, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .rank-row { grid-template-columns: 36px 1fr; }
  .rank-row .col { grid-column: 2; }
}
@media (max-width: 860px) {
  :root { --gutter: 16px; --sidebar: 0px; }
  .topbar { display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 18; height: 56px; padding: 0 8px; background: var(--ink); border-bottom: 1px solid var(--ink-line); }
  .topbar .brand { padding: 0 8px; }
  .menu-button { background: none; border: 0; color: var(--ink-heading); width: 44px; min-height: 44px; padding: 0; }
  .menu-button:hover { background: rgba(255, 255, 255, 0.08); }
  .sidebar { width: 272px; transform: translateX(-100%); transition: transform 0.2s ease; z-index: 40; }
  body.menu-open .sidebar { transform: none; box-shadow: var(--shadow-lift); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(7, 9, 13, 0.55); }
  main { margin-left: 0; padding-top: 24px; }
  h1 { font-size: 26px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .card, .plan { padding: 18px 16px; }
  .card.flush > .card-head, .card.flush > .empty { margin-left: 16px; margin-right: 16px; }
  .card.flush th:first-child, .card.flush td:first-child { padding-left: 16px; }
  .funnel li { grid-template-columns: 1fr auto 44px; }
  .funnel .meter { grid-column: 1 / -1; grid-row: 2; }
  .filters input[type=search] { max-width: none; flex-basis: 100%; }
  .form-row, #x-links .form-row { grid-template-columns: 1fr; }
  .bulk { left: 50%; max-width: calc(100vw - 24px); bottom: 12px; }
  .drawer-body .fields { grid-template-columns: 1fr; }
  #toast { left: 50%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* In a lead's drawer the invitation's card needs no name: the drawer's head has it. */
.drawer .invite .avatar, .drawer .invite-who { display: none; }
.anatomy tr.part > th { min-width: 210px; }
.connect-cards, .copy-grid { align-items: start; }
@media (max-width: 860px) { .filters select { flex: 1 1 150px; } }

/* Refresh: the button turns while its section loads, the section dims, and the time of the answer shows beside it. */
button.refresh .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
button.refresh.busy { opacity: 1; color: var(--accent); border-color: var(--accent); cursor: progress; }
button.refresh.busy .icon { animation: turn 0.7s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.refreshed { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.refreshed.failed { color: var(--bad); font-weight: 600; }
.tab.refreshing > :not(.page-head) { opacity: 0.45; pointer-events: none; transition: opacity 0.15s; }
/* A section that has not had its first answer yet. */
.tab > .stack:empty:not(#approvals)::before { content: "Loading…"; display: block; padding: 48px 16px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--radius); }
@media (prefers-reduced-motion: reduce) { button.refresh.busy .icon { animation: turn 1.4s linear infinite !important; } }
