:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #1b1f24;
  --muted: #5a6477;
  --accent: #3b52d0;
  --accent-ink: #ffffff;
  --accent-soft: #e8ecfd;
  --ok: #17794a;
  --ok-soft: #e3f5ea;
  --warn: #945909;
  --warn-ink: #ffffff;
  --ok-solid: #17794a;
  --ok-solid-ink: #ffffff;
  --github-ink: #7e22ce;
  --warn-soft: #fbf1dc;
  --bad: #c03636;
  --bad-ink: #ffffff;
  --bad-soft: #fbe7e7;
  --term-bg: #0f1216;
  --term-text: #d6dae1;
  --space-0: 2px;
  --space-1: 4px;
  --space-1-5: 6px;
  --space-2: 8px;
  --space-2-5: 10px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  /* Type roles: every piece of text uses one of these sizes and weights (docs/web-ui-conventions.md). */
  --type-display: 28px;   /* sign-in and empty-state heroes */
  --type-page: 22px;      /* the page title */
  --type-home: 24px;      /* Home's title, the project's name: the page title plus 10% */
  --type-section: 18px;   /* card titles */
  --type-body: 15px;      /* running text, field labels (medium), subsection titles (bold) */
  --type-secondary: 13px; /* page subtitle, row meta, hints, explanations, timestamps */
  --type-tag: 11px;       /* small upper-case labels */
  --weight-regular: 400;
  --weight-medium: 550;
  --weight-bold: 650;
  --leading-tight: 1.2;
  --leading-body: 1.45;
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;
  --radius: var(--r-lg);
  --clamp: 320px;
  /* Screen widths (media queries can't use variables): 760px phone layout, 480px small phones, 860px the product page header. */
  --motion-fast: .15s;    /* hover, focus, small state changes */
  --motion-medium: .22s;  /* panels and drawers sliding, fades */
  --motion-slow: .3s;     /* progress bars, larger surfaces */
  --slide: 360ms;      /* Show more / Show less slide (set per element, by distance) */      /* how much of long content shows before "Show more" (set per element) */
  /* Layers, lowest to highest. A backdrop sits one below its layer, e.g. calc(drawer - 1). */
  --z-raised: 2;      /* a hovered row */
  --z-inner: 10;      /* something inside a component */
  --z-sticky: 30;     /* the phone tab bar, an open More menu */
  --z-float: 40;      /* the Setup button and its panel */
  --z-header: 45;     /* the phone header */
  --z-palette: 60;    /* search and jump */
  --z-drawer: 110;    /* the phone navigation drawer, above context menus */
  --z-menu: 100;      /* the Configuration menu, the skip link */
  --z-toast: 1000;    /* messages, above everything */
  /* Control heights: every button, input, select and tappable row uses one of these. */
  --control-xs: 28px;   /* inline targets: a link in a stat line, a sort header */
  --control-sm: 32px;   /* small buttons, menu rows */
  --control-md: 40px;   /* default buttons and inputs */
  --control-lg: 44px;   /* touch targets on phones */
  --control-xl: 48px;   /* the rare big call to action; the phone tab bar */
  --dialog-width: 560px;
  --dialog-width-compact: 440px;
  --dialog-padding: var(--space-5);
  --dialog-gap: var(--space-4);
  --container-pad-x: var(--space-5);
  --container-pad-y: var(--space-4);
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --backdrop: rgba(10, 12, 16, .45);
  --shadow-2: 0 8px 24px rgba(16, 24, 40, .18), 0 1px 3px rgba(16, 24, 40, .12);  /* menus, popovers */
  --shadow-3: 0 16px 48px rgba(16, 24, 40, .28);  /* dialogs, drawers */
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --manage-option-bg: #e2e6ee;
  --btn-secondary-bg: #edf2fc;
  --btn-secondary-border: #d0dbf0;
  --btn-secondary-hover: #e2ebfa;
  --btn-secondary-hover-border: #bccbf0;
  --btn-secondary-active: #d6e3f7;
  --btn-secondary-text: #1e2638;
  --job-bug: #ef4444;       /* New job: the selected job type's colour */
  --job-feature: #6366f1;
  --job-design: #f43f5e;
  --job-coverage: #10b981;
  --job-quick: #f59e0b;
  --job-tint: 6%;           /* how much of it tints the selected card */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --panel: #171a20;
    --panel-2: #1e222a;
    --border: #2a2f39;
    --text: #e6e8ec;
    --muted: #98a0b0;
    --accent: #7289ff;
    --accent-ink: #0f1115;
    --accent-soft: #232a45;
    --ok: #43c47d;
    --ok-soft: #173024;
    --warn: #e0a84a;
    --warn-ink: #1a1204;
    --ok-solid: #43c47d;
    --ok-solid-ink: #06210f;
    --github-ink: #d8b4fe;
    --warn-soft: #33291a;
    --bad: #f07070;
    --bad-ink: #1a0707;
    --bad-soft: #3a1d1f;
    --shadow: none;
    --shadow-2: 0 8px 24px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3);
    --shadow-3: 0 16px 48px rgba(0, 0, 0, .6);
    --manage-option-bg: #323947;
    --btn-secondary-bg: #1f2536;
    --btn-secondary-border: #303a54;
    --btn-secondary-hover: #273046;
    --btn-secondary-hover-border: #445378;
    --btn-secondary-active: #2e3952;
    --btn-secondary-text: #e6e8ec;
    --job-bug: #f87171;
    --job-feature: #818cf8;
    --job-design: #fb7185;
    --job-coverage: #34d399;
    --job-quick: #fbbf24;
    --job-tint: 12%;
    color-scheme: dark;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: var(--type-body)/var(--leading-body) -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: var(--leading-tight); font-weight: var(--weight-bold); }
strong, b { font-weight: var(--weight-bold); }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); font-size: var(--type-secondary); }
.icon { width: 21.6px; height: 21.6px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }

/* sidebar */
.mobile-header, .nav-close, .sidebar-backdrop { display: none; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-5) var(--space-4); background: var(--panel); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); font-weight: var(--weight-bold); font-size: var(--type-body); padding: 0 var(--space-3); }
.brand-mark { width: 24px; height: 24px; border-radius: var(--r-sm); background: url("icon-192.png") center / contain no-repeat; flex-shrink: 0; display: inline-block; }
.project-switch { display: flex; flex-direction: column; gap: var(--space-1); padding: 0 var(--space-2); }
.label { font-size: var(--type-tag); color: var(--muted); font-weight: var(--weight-medium); text-transform: uppercase; letter-spacing: .04em; }
.nav { display: flex; flex-direction: column; gap: var(--space-0); }
.nav a {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--r-md);
  color: var(--text); font-weight: var(--weight-medium);
}
.nav a:hover { background: var(--panel-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav .icon { opacity: .85; }
/* Phone tab bar: the top destinations, with New job in the middle. Hidden on wider screens, where the sidebar shows. */
.tabbar { display: none; }
.badge {
  margin-left: auto; min-width: 20px; padding: 0 var(--space-2); border-radius: var(--r-lg);
  background: var(--warn); color: var(--warn-ink); font-size: var(--type-secondary); font-weight: var(--weight-bold); text-align: center;
}
.badge.working { background: var(--accent); color: var(--accent-ink); }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-0); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.sidebar-footer .btn { justify-content: flex-start; gap: var(--space-3); min-height: var(--control-sm); padding: var(--space-2) var(--space-3); border: 0; background: none; box-shadow: none; color: var(--muted); font-weight: var(--weight-medium); font-size: var(--type-secondary); }
.sidebar-footer .btn:hover { background: var(--panel-2); color: var(--text); }
.sidebar-footer .icon { width: 19.2px; height: 19.2px; }
.nav-secondary { gap: 0; }
/* Group titles read as subtitles: dark, bold, with a rule above; the links under them sit indented and quieter. */
.nav-secondary .label { margin-top: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-2); border-top: 1px solid var(--border); color: var(--text); font-weight: var(--weight-bold); letter-spacing: .06em; }
.nav.nav-secondary > a { padding: var(--space-2) var(--space-3) var(--space-2) var(--space-5); font-size: var(--type-secondary); color: var(--muted); }
.nav-secondary .configuration-menu-trigger { padding-left: var(--space-5); }
.big-number { font-size: var(--type-display); font-weight: var(--weight-bold); }
pre.doc { margin: 0; padding: 0 var(--space-4) var(--space-4); white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: var(--type-body); }
.brief-path-chip { font-size: var(--type-secondary); color: var(--muted); user-select: all; overflow-wrap: anywhere; }
.brief-content { padding: var(--space-3) var(--space-4) var(--space-4); line-height: 1.6; }

/* main */
.main { min-width: 0; padding: var(--space-6) var(--space-7) var(--space-8); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.topbar { --back-w: var(--control-sm); }
.topbar-text { min-width: 0; }
.topbar-text:has(.back-link:not([hidden])) .sub { padding-left: calc(var(--back-w) - var(--space-1) + var(--space-2)); } /* beside the title, not under the arrow */
.topbar h1 { font-size: var(--type-page); font-weight: var(--weight-bold); }
body.signin-gate .topbar { display: none !important; }
body.signin-gate .mobile-header-start .nav-toggle { visibility: hidden; pointer-events: none; }
body.signin-gate .sidebar > .brand { visibility: hidden; }
.sub { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--type-secondary); }
.lang-bar {
  display: flex;
  width: 44px;
  height: 6px;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--panel-2);
  flex-shrink: 0;
}
.lang-bar-segment {
  height: 100%;
}
.lang-labels {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.lang-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-weight: var(--weight-medium);
  color: var(--text);
  white-space: nowrap;
}
.lang-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.project-card-languages {
  margin: var(--space-2) 0 var(--space-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.project-card-languages .lang-bar {
  width: 100%;
  height: 5px;
}
.project-card-languages .lang-labels {
  font-size: var(--type-tag);
}

.view { display: flex; flex-direction: column; gap: var(--space-4); }
.view > .mb-16 { margin-bottom: 0; } /* the view's gap already spaces them */

/* building blocks */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
/* One card header everywhere: title left, count beside it, actions right, the same height with or without buttons. */
.card-h { display: flex; flex-wrap: wrap; row-gap: var(--space-2); align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); min-height: calc(var(--control-sm) + 2 * var(--space-3)); padding: var(--space-3) var(--container-pad-x); border-bottom: 1px solid var(--border); }
/* A card's header is a title bar: tinted, with a heading that reads as one (Primer's Box header). */
.card-h { background: var(--panel-2); }
.card > .card-h:first-child, .card > details:first-child > summary.card-h { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.card > details:only-child:not([open]) > summary.card-h { border-radius: calc(var(--radius) - 1px); border-bottom: 0; }
.card-h h2 { font-size: var(--type-section); font-weight: var(--weight-bold); min-width: 0; overflow-wrap: anywhere; }
.card-h h2 .count { font-weight: var(--weight-bold); font-size: var(--type-secondary); margin-left: var(--space-1); }
.card-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
/* Facts about the card's content (where a file lives, when it changed) sit in a caption under the header. */
.card-caption { padding: var(--space-2) var(--container-pad-x); border-bottom: 1px solid var(--border); }
/* "Show more" for long content (wireExpandables in app.js) */
.expandable { position: relative; overflow: hidden; }
.expandable.is-clamped { max-height: var(--clamp); }
.expandable.is-sliding { transition: max-height var(--slide) cubic-bezier(.4, 0, .2, 1); }
.expandable::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 72px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--panel)); opacity: 0; transition: opacity var(--motion-medium) ease; }
.expandable.is-clamped::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { :root { --motion-fast: 0s; --motion-medium: 0s; --motion-slow: 0s; } }
@media (prefers-reduced-motion: reduce) { .expandable.is-sliding, .expandable::after { transition: none; } }
.expandable-bar { display: flex; justify-content: center; padding: var(--space-2) var(--space-4) var(--space-4); }
.card-h .count { color: var(--muted); font-weight: var(--weight-medium); }
.card-b { padding: var(--container-pad-y) var(--container-pad-x); }
/* Card content goes in .card-b (or a .list / row that pads itself). A bare paragraph or list straight inside a card
   still gets the card's padding, so text never touches the edge. */
.card > :is(p, ul, ol, form):not([class]) { margin: 0; padding: var(--space-3) var(--container-pad-x); }
.muted { color: var(--muted); }
.meta code, .item code, .card-b code { white-space: normal; overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: var(--space-5) var(--container-pad-x); } /* on the card's left edge */
.empty a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }
.empty a:not(.btn):hover { text-decoration-thickness: 2px; }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.spacer { flex: 1; }

.btn, .btn.secondary {
  appearance: none; border: 1px solid var(--btn-secondary-border); background: var(--btn-secondary-bg); color: var(--btn-secondary-text);
  padding: var(--space-2) var(--space-4); border-radius: var(--r-md); font: inherit; font-weight: var(--weight-medium); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-md);
  text-align: center;
  transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease, color var(--motion-fast) ease;
}
.btn:hover, .btn.secondary:hover {
  background: var(--btn-secondary-hover);
  border-color: var(--btn-secondary-hover-border);
  color: var(--btn-secondary-text);
}
.btn:disabled, .btn.secondary:disabled, .btn.primary:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
  filter: none;
  box-shadow: none;
}
.btn:disabled[title],
.btn[disabled][title] {
  pointer-events: auto;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* Tinted actions: green (go) does the thing a row is asking for (create, add, install, set up); red (danger) stops,
   cancels or removes. Subtle: a tint of the colour, not a solid fill, so the page's one primary button still leads. */
.btn.go, .btn.danger { --tone: var(--ok); background: color-mix(in srgb, var(--tone) 10%, var(--panel)); border-color: color-mix(in srgb, var(--tone) 35%, var(--border)); color: var(--tone); }
.btn.danger { --tone: var(--bad); }
.btn.go:hover:not(:disabled), .btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--tone) 16%, var(--panel)); border-color: color-mix(in srgb, var(--tone) 55%, var(--border)); color: var(--tone); }
.btn.go:active, .btn.danger:active { background: color-mix(in srgb, var(--tone) 20%, var(--panel)); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--border); }
.btn.small { padding: var(--space-1) var(--space-3); min-height: var(--control-sm); font-size: var(--type-secondary); }
.btn.big { min-height: var(--control-xl); font-size: var(--type-body); padding: var(--space-3) var(--space-5); }

/* Reference imports, job briefs and Git actions */
.reference-imports { border-top: 1px solid var(--border); padding: var(--space-4); background: var(--panel-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.reference-imports > .label { display: block; margin-bottom: var(--space-3); }
.import-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.import-option { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: var(--space-1); padding: var(--space-4); min-height: var(--control-xl); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.import-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn:active, .btn.secondary:active { background: var(--btn-secondary-active); transform: translateY(1px); }
.btn.primary:active { background: var(--accent); transform: translateY(1px); }
.btn.ghost:active { background: var(--panel-2); transform: translateY(1px); }
.import-option:active { border-color: var(--accent); background: var(--accent-soft); }
@media (hover: none) and (pointer: coarse) {
  .btn:hover:not(:active), .btn.secondary:hover:not(:active) { background: var(--btn-secondary-bg); border-color: var(--btn-secondary-border); color: var(--btn-secondary-text); }
  .btn.primary:hover:not(:active) { filter: none; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .btn.ghost:hover:not(:active) { background: transparent; border-color: var(--border); }
  .import-option:hover:not(:active) { border-color: var(--border); background: var(--panel); }
  .dialog-close-btn:hover:not(:active) { background: transparent; color: var(--muted); }
}
.import-option span { color: var(--muted); font-size: var(--type-secondary); }
div.import-option { cursor: default; justify-content: flex-start; }
div.import-option:hover { border-color: var(--border); background: var(--panel); }
.connected-apps-list { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: var(--space-1) 0; min-height: var(--control-xs); align-items: center; }
.connected-apps-actions, .import-link-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: auto; padding-top: var(--space-2); width: 100%; }
.import-link-form input[type="url"] { flex: 1; min-width: 0; min-height: var(--control-sm); padding: var(--space-1) var(--space-2); font-size: var(--type-secondary); }
.coverage-paths { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.coverage-sub-option { margin-top: var(--space-3); color: var(--muted); font-size: var(--type-secondary); }
.brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.autopilot-option { padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); }
/* Git: day-to-day work first, repository configuration disclosed below it. */
.git-page { display: flex; flex-direction: column; gap: var(--space-4); }
.git-page p { margin: 0; }
.git-remote-url { overflow-wrap: anywhere; }
.git-branch-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-6); }
.git-branch-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.git-field-label { font-size: var(--type-body); font-weight: var(--weight-medium); }
.git-branch-controls, .git-tracking-value { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.git-branch-controls select { min-width: 0; flex: 1; }
.git-branch-controls .btn { flex: none; min-height: var(--control-md); }
.git-tracking-value { min-height: var(--control-md); justify-content: space-between; }
.git-tracking-value .mono { min-width: 0; overflow-wrap: anywhere; font-size: var(--type-secondary); }
.git-sync-caption, .git-commit-caption { color: var(--muted); font-size: var(--type-secondary); }
.git-sync-note { display: flex; flex-direction: column; gap: var(--space-1); padding: 0 var(--container-pad-x) var(--space-3); color: var(--muted); font-size: var(--type-secondary); line-height: 1.5; }
.git-fetch-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--container-pad-x); border-top: 1px solid var(--border); font-size: var(--type-secondary); }
.git-fetch-row > span { min-width: 0; }
.git-fetch-row .btn { flex: none; }
.git-commit-caption { display: flex; gap: var(--space-2); flex-wrap: wrap; border-top: 1px solid var(--border); border-bottom: 0; }
.git-commit-caption .linklike { min-height: var(--control-xs); }
.git-commit-caption > span { min-width: 0; overflow-wrap: anywhere; }
.git-change-group + .git-change-group { border-top: 1px solid var(--border); }
.git-change-group h3, .git-connection-options > h3 { padding: var(--space-3) var(--container-pad-x) var(--space-2); font-size: var(--type-secondary); font-weight: var(--weight-bold); color: var(--muted); }
.git-change-group .count { margin-left: var(--space-1); font-weight: var(--weight-regular); }
.git-change-group .diff-files { gap: 0; }
.git-change-group .diff-file > summary { min-height: var(--control-md); padding: var(--space-2) var(--container-pad-x); font-size: var(--type-secondary); line-height: 1.5; }
.git-change-group .diff-file[open] > summary { background: var(--panel-2); }
.git-change-group .diff { margin: 0; border-radius: 0; }
.git-settings-fold > summary { cursor: pointer; list-style: none; }
.git-settings-fold > summary::-webkit-details-marker { display: none; }
.git-disclosure { color: var(--muted); font-size: var(--type-body); }
.git-settings-fold[open] .git-disclosure { transform: rotate(180deg); }
.git-provider-caption { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); font-size: var(--type-secondary); }
.git-provider-caption a { display: inline-flex; align-items: center; min-height: var(--control-xs); }
.git-settings-list { margin: 0; }
.git-setting-row { display: grid; grid-template-columns: minmax(0, calc(var(--space-8) * 3)) minmax(0, 1fr); align-items: center; gap: var(--space-4); padding: var(--space-3) var(--container-pad-x); border-top: 1px solid var(--border); }
.git-setting-row:first-child { border-top: 0; }
.git-setting-row dt { min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: var(--type-secondary); }
.git-setting-row dd { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-width: 0; margin: 0; font-size: var(--type-body); }
.git-setting-value { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; overflow-wrap: anywhere; }
.git-setting-value small { color: var(--muted); font-size: var(--type-secondary); line-height: 1.5; }
.git-setting-action { flex: none; }
.git-base-branch-form { display: flex; flex-direction: column; gap: var(--space-1); width: 100%; }
.git-base-branch-form > small { color: var(--muted); font-size: var(--type-secondary); line-height: 1.5; }
.git-base-branch-controls { display: flex; align-items: center; gap: var(--space-2); }
.git-base-branch-controls select { min-width: 0; max-width: 18rem; flex: 1; }
.git-base-branch-controls .btn { flex: none; }
.git-connection-options { border-top: 1px solid var(--border); }
.git-setup-message { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--container-pad-x); font-size: var(--type-body); }
@media (max-width: 760px) {
  .import-options, .brief-grid { grid-template-columns: minmax(0, 1fr); }
  .git-sync-header { flex-wrap: wrap; }
  .git-branch-fields { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .git-setting-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
  .git-page .btn.small, .git-commit-caption .linklike, .git-branch-controls select, .git-base-branch-controls select, .git-page .diff-file > summary, .git-provider-caption a { min-height: var(--control-lg); }
  .git-setup-message { align-items: flex-start; flex-direction: column; }
}

/* More menu */
.more { position: relative; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: var(--z-sticky); min-width: 240px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--space-2);
  box-shadow: var(--shadow-2); display: flex; flex-direction: column;
  max-height: min(78vh, 600px); overflow-y: auto;
}
.more-menu .btn { justify-content: flex-start; border: 0; background: transparent; width: 100%; }
.more-menu .btn:hover { background: var(--panel-2); border: 0; }
.more-menu .hint { font-size: var(--type-secondary); color: var(--muted); padding: 0 var(--space-4) var(--space-2); white-space: normal; margin-top: -4px; }
.more-menu-header { font-size: var(--type-tag); font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: var(--space-2) var(--space-3) var(--space-1); }
.more-menu-header:not(:first-child) { margin-top: var(--space-1); border-top: 1px solid var(--border); padding-top: var(--space-3); }
.more-menu .btn { min-height: var(--control-sm); font-weight: var(--weight-medium); }
.more-menu hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-1) 0; }
.more.left .more-menu { left: 0; right: auto; }
/* Open, it's placed by the button that opened it (placeMenu) and sits above the page. */
details.more[open] > .more-menu { z-index: var(--z-menu); }

/* status */
.pill {
  display: inline-block; padding: var(--space-0) var(--space-2); border-radius: var(--r-pill); font-size: var(--type-secondary); font-weight: var(--weight-medium);
  background: var(--panel-2); color: var(--muted); white-space: nowrap;
}
.pill.done, .pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.attention, .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.failed, .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.working, .pill.run { background: var(--accent-soft); color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: var(--space-2); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
/* Running: a ring with one bright arc that turns, in the text's colour, sized to the text beside it. */
.run-spin {
  display: inline-block; width: .9em; height: .9em; margin-right: var(--space-1); vertical-align: -.12em; flex-shrink: 0;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; border-radius: 50%;
  animation: spin .9s linear infinite;
}
/* A job page's banner while it runs: a bar that sweeps along its bottom edge (no overflow clipping, so menus still show). */
.job-hero.is-running { position: relative; }
.job-hero.is-running::after {
  content: ""; position: absolute; left: var(--radius); right: var(--radius); bottom: 0; height: 3px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat; background-size: 35% 100%;
  animation: run-sweep 1.6s ease-in-out infinite;
}
.job-hero.is-running .job-hero-title { display: inline-flex; align-items: center; }
.job-hero.is-running .job-hero-title .run-spin { color: var(--accent); }
@keyframes run-sweep { from { background-position: -60% 0; } to { background-position: 160% 0; } }
@media (prefers-reduced-motion: reduce) {
  .run-spin { animation: none; border-color: currentColor; border-right-color: transparent; }
  .job-hero.is-running::after { animation: none; background: var(--accent); opacity: .4; }
}

.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border);
  color: var(--text); min-width: 0;
}
.item:first-child { border-top: 0; }
a.item:hover { background: var(--panel-2); }
.item .main-col { min-width: 0; flex: 1; color: var(--text); }
.item .title { font-weight: var(--weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: var(--type-secondary); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .side { display: flex; align-items: center; gap: var(--space-2); flex: 0 0 auto; }
.item > .mono, .item > span:not(.pill) { min-width: 0; overflow-wrap: anywhere; }

.status-line { display: flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: var(--type-secondary); flex-wrap: wrap; margin-top: var(--space-1); }
.status-line .sep { opacity: .5; }
.status-stats a, .card-h a { display: inline-flex; align-items: center; min-height: var(--control-xs); }
.topbar-text, .status-line, .status-branch { min-width: 0; max-width: 100%; }
.status-line .branch-select { min-height: var(--control-md); width: 16rem; max-width: 100%; text-overflow: ellipsis; padding: var(--space-1) var(--space-6) var(--space-1) var(--space-3); font-family: inherit; font-size: var(--type-body); font-weight: var(--weight-medium); }

.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }

.filters { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.filters .btn { border-radius: var(--r-pill); }
.filters .btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.banner { display: flex; align-items: center; gap: var(--space-3) var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius); border: 1px solid var(--border); flex-wrap: wrap; background: var(--panel-2); }
.banner.done { border-color: var(--ok); background: var(--ok-soft); }
.banner.failed { border-color: var(--bad); background: var(--bad-soft); }
.banner.attention { border-color: var(--warn); background: var(--warn-soft); }
.banner p { flex: 1 1 200px; margin: 0; font-size: var(--type-body); line-height: 1.45; }
.banner.run-status p, .run-status-notice-body p { flex: 0 1 auto; } /* these stack in a column, where that basis would be a height */
.run-status { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.run-status.working { border-color: var(--accent); background: var(--accent-soft); }
.run-status-heading { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); min-width: 0; }
.run-status-heading strong { font-size: var(--type-body); line-height: 1.35; overflow-wrap: anywhere; }
.run-status-task { flex-basis: 100%; color: var(--muted); overflow-wrap: anywhere; font-size: var(--type-secondary); }
.run-status-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; gap: var(--space-2) var(--space-4); margin: 0; }
.run-status-details > div { display: contents; }
.run-status-details dt { color: var(--muted); font-size: var(--type-secondary); margin: 0; font-weight: var(--weight-regular); }
.run-status-details dd { margin: 0; font-size: var(--type-secondary); font-weight: var(--weight-medium); color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; text-align: left; }
.run-status-progress { width: 100%; height: var(--space-1); accent-color: var(--accent); border: 0; }
.run-status-progress::-webkit-progress-bar { background: var(--border); border-radius: var(--r-pill); }
.run-status-progress::-webkit-progress-value { background: var(--accent); border-radius: var(--r-pill); }
.run-status-progress::-moz-progress-bar { background: var(--accent); border-radius: var(--r-pill); }
.banner.done .run-status-progress { accent-color: var(--ok); }
.banner.done .run-status-progress::-webkit-progress-value { background: var(--ok); }
.banner.done .run-status-progress::-moz-progress-bar { background: var(--ok); }
.banner.attention .run-status-progress { accent-color: var(--warn); }
.banner.attention .run-status-progress::-webkit-progress-value { background: var(--warn); }
.banner.attention .run-status-progress::-moz-progress-bar { background: var(--warn); }
.banner.failed .run-status-progress { accent-color: var(--bad); }
.banner.failed .run-status-progress::-webkit-progress-value { background: var(--bad); }
.banner.failed .run-status-progress::-moz-progress-bar { background: var(--bad); }
.run-status-progress-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}
.run-status-progress-wrap .run-status-progress {
  flex: 1 1 auto;
}
.run-status-pct {
  font-size: var(--type-secondary);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}
.banner.working .run-status-pct {
  color: var(--accent);
}
.banner.done .run-status-pct {
  color: var(--ok);
}
.banner.failed .run-status-pct {
  color: var(--bad);
}
.banner.attention .run-status-pct {
  color: var(--warn);
}
.run-status .run-status-caveat { display: flex; align-items: flex-start; gap: var(--space-2); flex: none; font-size: var(--type-secondary); line-height: 1.5; }
.run-status .run-status-hint { margin: 0; font-size: var(--type-secondary); line-height: 1.5; }
.run-status .run-status-skipped { margin: var(--space-1) 0 0; padding-left: var(--space-4); font-size: var(--type-secondary); }
.run-status [data-run-skipped] summary { cursor: pointer; }
.run-status-details .text-ok {
  color: var(--ok);
}
.run-status-details .text-bad {
  color: var(--bad);
}
.run-status-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
}

.run-status-guidance {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-top: 0;
}
.run-status-guidance-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--bad);
  font-size: var(--type-secondary);
  font-weight: var(--weight-medium);
}
.run-status-guidance-detail {
  margin: 0;
  font-size: var(--type-secondary);
  color: var(--text);
  line-height: 1.5;
}
.run-status-guidance-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 0;
}

.run-status.run-status-notice {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.run-status.run-status-notice.attention {
  border-color: var(--warn);
  background: var(--warn-soft);
}
.run-status-notice-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  flex: 1 1 300px;
}
.run-status.run-status-notice:not(.run-status-keychain):not(.run-status-apikey) {
  justify-content: flex-start;
}
.run-status.run-status-notice:not(.run-status-keychain):not(.run-status-apikey) .run-status-notice-body {
  flex: 0 1 auto;
}
.run-status-notice-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--warn);
  font-size: var(--type-body);
  font-weight: var(--weight-medium);
  line-height: 1.35;
}
.run-status-notice-title .icon {
  color: var(--warn);
  flex-shrink: 0;
}
.run-status-notice-desc {
  margin: 0;
  color: var(--text);
  font-size: var(--type-secondary);
  line-height: 1.45;
}
.run-status-notice-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: var(--space-2);
  flex-shrink: 0;
}
@media (max-width: 760px) {
  .run-status.run-status-notice {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  .run-status-notice-actions {
    width: 100%;
  }
}

.run-status.run-status-keychain {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
}
.run-status-keychain .keychain-unlock-form {
  margin-top: var(--space-1);
}
.keychain-pwd-input {
  min-height: var(--control-sm);
  padding: var(--space-1) var(--space-2-5);
  font-size: var(--type-secondary);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  flex: 1 1 200px;
  max-width: 320px;
}
.keychain-pwd-note {
  line-height: 1.4;
}
.keychain-manual-fold {
  border-top: 1px dashed var(--border);
  padding-top: var(--space-2);
}
.keychain-manual-fold summary {
  color: var(--muted);
  font-size: var(--type-secondary);
  cursor: pointer;
  user-select: none;
}
.keychain-manual-body {
  padding: var(--space-2);
  background: var(--panel-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.code-box {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: var(--type-secondary);
  color: var(--text);
  word-break: break-all;
  flex: 1 1 auto;
}

.run-status.run-status-apikey {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
}
.run-status-apikey .inline-apikey-form {
  margin-top: var(--space-1);
}
.apikey-select,
.apikey-input {
  min-height: var(--control-sm);
  padding: var(--space-1) var(--space-2-5);
  font-size: var(--type-secondary);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.apikey-select {
  flex: 0 1 200px;
}
.apikey-input {
  flex: 1 1 220px;
  max-width: 360px;
}
.apikey-note {
  line-height: 1.4;
}

/* forms */
form.stack, .stack { display: flex; flex-direction: column; gap: var(--space-4); }
.field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; max-width: 100%; }
.field > span, .field > legend { font-weight: var(--weight-medium); font-size: var(--type-body); overflow-wrap: anywhere; word-break: break-word; }
.field small, .hint-text { color: var(--muted); font-size: var(--type-secondary); overflow-wrap: anywhere; word-break: break-word; }
input[type=text], input[type=search], input[type=url], input[type=number], input[type=email], input[type=password], input[type=date], textarea, select {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--space-2) var(--space-3); width: 100%; max-width: 100%; box-sizing: border-box; min-width: 0;
}
.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.input-with-suffix input {
  padding-right: var(--space-6);
}
.input-suffix {
  position: absolute;
  right: var(--space-3);
  color: var(--muted);
  font-weight: var(--weight-medium);
  font-size: var(--type-secondary);
  pointer-events: none;
}
input[type=text], input[type=search], input[type=url], input[type=number], input[type=email], input[type=password], input[type=date], select {
  min-height: var(--control-md);
}
select option {
  background-color: var(--panel);
  color: var(--text);
}
select option[value="__manage__"],
option.manage-projects-option {
  background-color: var(--manage-option-bg) !important;
  color: var(--text) !important;
  font-weight: var(--weight-medium);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus, .btn:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button:focus:not(:focus-visible), .btn:focus:not(:focus-visible), .import-option:focus:not(:focus-visible), summary:focus:not(:focus-visible) { outline: none; }
.segmented { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: var(--space-2); }
.segmented label {
  border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--space-3) var(--space-3); cursor: pointer; background: var(--panel);
}
.segmented label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.segmented input { margin-right: var(--space-2); }
.segmented small { display: block; color: var(--muted); font-size: var(--type-secondary); margin-top: var(--space-0); }

/* Job type selection cards with representative thematic background art */
.job-type-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: border-color var(--motion-slow) ease, background-color var(--motion-slow) ease, box-shadow var(--motion-slow) ease;
}
.job-type-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: right -6px bottom -6px;
  background-size: 80px 80px;
  opacity: 0.14;
  filter: grayscale(35%) brightness(0.9);
  transform: scale(0.96);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.job-type-card:hover::before {
  opacity: 0.32;
  filter: grayscale(12%) brightness(1.05);
  transform: scale(1.0);
}
.job-type-card:has(input:checked)::before {
  opacity: 0.62;
  filter: grayscale(0%) brightness(0.95);
  transform: scale(1.04);
}
.job-type-card:has(input:checked) small {
  color: var(--text);
  opacity: 0.88;
}

.job-type-card { --job: var(--accent); }
.job-type-bug { --job: var(--job-bug); }
.job-type-feature { --job: var(--job-feature); }
.job-type-design { --job: var(--job-design); }
.job-type-coverage { --job: var(--job-coverage); }
.job-type-quick { --job: var(--job-quick); }
.job-type-card input { accent-color: var(--job); }
/* .segmented outranks .segmented label:has(input:checked), which would paint every type in the accent colour */
.segmented .job-type-card:has(input:checked) { border-color: var(--job); background: color-mix(in srgb, var(--job) var(--job-tint), var(--panel)); }

.job-type-bug::before { background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http:%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox=%220%200%20100%20100%22%20fill=%22none%22%3E%20%3Cdefs%3E%20%3CradialGradient%20id=%22bug-glow%22%20cx=%2272%25%22%20cy=%2265%25%22%20r=%2265%25%22%3E%20%3Cstop%20offset=%220%25%22%20stop-color=%22%23ef4444%22%20stop-opacity=%220.38%22%2F%3E%20%3Cstop%20offset=%22100%25%22%20stop-color=%22%23ef4444%22%20stop-opacity=%220%22%2F%3E%20%3C%2FradialGradient%3E%20%3ClinearGradient%20id=%22bug-grad%22%20x1=%2245%22%20y1=%2235%22%20x2=%2285%22%20y2=%2285%22%20gradientUnits=%22userSpaceOnUse%22%3E%20%3Cstop%20offset=%220%25%22%20stop-color=%22%23f87171%22%2F%3E%20%3Cstop%20offset=%22100%25%22%20stop-color=%22%23dc2626%22%2F%3E%20%3C%2FlinearGradient%3E%20%3C%2Fdefs%3E%20%3Crect%20width=%22100%22%20height=%22100%22%20fill=%22url(%23bug-glow)%22%2F%3E%20%3Ccircle%20cx=%2264%22%20cy=%2258%22%20r=%2236%22%20stroke=%22%23ef4444%22%20stroke-width=%221.2%22%20stroke-dasharray=%223%203%22%20opacity=%220.4%22%2F%3E%20%3Ccircle%20cx=%2264%22%20cy=%2258%22%20r=%2225%22%20stroke=%22%23f87171%22%20stroke-width=%221.4%22%20stroke-dasharray=%225%202.5%22%20opacity=%220.5%22%2F%3E%20%3Cline%20x1=%2264%22%20y1=%2216%22%20x2=%2264%22%20y2=%2228%22%20stroke=%22%23ef4444%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22%20opacity=%220.75%22%2F%3E%20%3Cline%20x1=%2264%22%20y1=%2288%22%20x2=%2264%22%20y2=%22100%22%20stroke=%22%23ef4444%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22%20opacity=%220.75%22%2F%3E%20%3Cline%20x1=%2222%22%20y1=%2258%22%20x2=%2234%22%20y2=%2258%22%20stroke=%22%23ef4444%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22%20opacity=%220.75%22%2F%3E%20%3Cline%20x1=%2294%22%20y1=%2258%22%20x2=%22106%22%20y2=%2258%22%20stroke=%22%23ef4444%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22%20opacity=%220.75%22%2F%3E%20%3Cpath%20d=%22M51%2035%20H39%20V47%22%20stroke=%22%23fca5a5%22%20stroke-width=%221.8%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Cpath%20d=%22M77%2035%20H89%20V47%22%20stroke=%22%23fca5a5%22%20stroke-width=%221.8%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Cpath%20d=%22M51%2081%20H39%20V69%22%20stroke=%22%23fca5a5%22%20stroke-width=%221.8%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Cpath%20d=%22M77%2081%20H89%20V69%22%20stroke=%22%23fca5a5%22%20stroke-width=%221.8%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Cpath%20d=%22M57%2042%20C53%2032%2044%2028%2036%2029%22%20stroke=%22%23f87171%22%20stroke-width=%222%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Ccircle%20cx=%2235%22%20cy=%2229%22%20r=%222%22%20fill=%22%23f87171%22%2F%3E%20%3Cpath%20d=%22M71%2042%20C75%2032%2084%2028%2092%2029%22%20stroke=%22%23f87171%22%20stroke-width=%222%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Ccircle%20cx=%2293%22%20cy=%2229%22%20r=%222%22%20fill=%22%23f87171%22%2F%3E%20%3Cpath%20d=%22M52%2050%20C41%2046%2034%2040%2028%2042%22%20stroke=%22%23ef4444%22%20stroke-width=%222.2%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Cpath%20d=%22M76%2050%20C87%2046%2094%2040%20100%2042%22%20stroke=%22%23ef4444%22%20stroke-width=%222.2%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Cpath%20d=%22M49%2059%20C37%2059%2030%2058%2024%2064%22%20stroke=%22%23ef4444%22%20stroke-width=%222.2%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Cpath%20d=%22M79%2059%20C91%2059%2098%2058%20104%2064%22%20stroke=%22%23ef4444%22%20stroke-width=%222.2%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Cpath%20d=%22M52%2068%20C41%2072%2034%2080%2030%2086%22%20stroke=%22%23ef4444%22%20stroke-width=%222.2%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Cpath%20d=%22M76%2068%20C87%2072%2094%2080%2098%2086%22%20stroke=%22%23ef4444%22%20stroke-width=%222.2%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Cpath%20d=%22M57%2045%20C57%2040%2060%2037%2064%2037%20C68%2037%2071%2040%2071%2045%20Z%22%20fill=%22%23dc2626%22%2F%3E%20%3Cellipse%20cx=%2264%22%20cy=%2262%22%20rx=%2214%22%20ry=%2217%22%20fill=%22url(%23bug-grad)%22%2F%3E%20%3Cline%20x1=%2264%22%20y1=%2246%22%20x2=%2264%22%20y2=%2279%22%20stroke=%22%231c1917%22%20stroke-width=%221.6%22%20stroke-linecap=%22round%22%20opacity=%220.65%22%2F%3E%20%3Cpath%20d=%22M64%2055%20H56%22%20stroke=%22%231c1917%22%20stroke-width=%221.2%22%20opacity=%220.65%22%2F%3E%20%3Cpath%20d=%22M64%2055%20H72%22%20stroke=%22%231c1917%22%20stroke-width=%221.2%22%20opacity=%220.65%22%2F%3E%20%3Cpath%20d=%22M64%2066%20H54%22%20stroke=%22%231c1917%22%20stroke-width=%221.2%22%20opacity=%220.65%22%2F%3E%20%3Cpath%20d=%22M64%2066%20H74%22%20stroke=%22%231c1917%22%20stroke-width=%221.2%22%20opacity=%220.65%22%2F%3E%20%3Ccircle%20cx=%2264%22%20cy=%2258%22%20r=%224%22%20fill=%22%23fee2e2%22%2F%3E%20%3Ccircle%20cx=%2264%22%20cy=%2258%22%20r=%227.5%22%20stroke=%22%23fee2e2%22%20stroke-width=%221%22%20opacity=%220.8%22%2F%3E%20%3C%2Fsvg%3E'); }
.job-type-feature::before { background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http:%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox=%220%200%20100%20100%22%20fill=%22none%22%3E%20%3Cdefs%3E%20%3CradialGradient%20id=%22feat-glow%22%20cx=%2272%25%22%20cy=%2245%25%22%20r=%2265%25%22%3E%20%3Cstop%20offset=%220%25%22%20stop-color=%22%236366f1%22%20stop-opacity=%220.45%22%2F%3E%20%3Cstop%20offset=%22100%25%22%20stop-color=%22%236366f1%22%20stop-opacity=%220%22%2F%3E%20%3C%2FradialGradient%3E%20%3ClinearGradient%20id=%22rocket-body%22%20x1=%2245%22%20y1=%2220%22%20x2=%2285%22%20y2=%2260%22%20gradientUnits=%22userSpaceOnUse%22%3E%20%3Cstop%20offset=%220%25%22%20stop-color=%22%23ffffff%22%2F%3E%20%3Cstop%20offset=%2250%25%22%20stop-color=%22%23e0e7ff%22%2F%3E%20%3Cstop%20offset=%22100%25%22%20stop-color=%22%23818cf8%22%2F%3E%20%3C%2FlinearGradient%3E%20%3ClinearGradient%20id=%22flame-grad%22%20x1=%2246%22%20y1=%2264%22%20x2=%2226%22%20y2=%2292%22%20gradientUnits=%22userSpaceOnUse%22%3E%20%3Cstop%20offset=%220%25%22%20stop-color=%22%23f59e0b%22%2F%3E%20%3Cstop%20offset=%2260%25%22%20stop-color=%22%23ef4444%22%2F%3E%20%3Cstop%20offset=%22100%25%22%20stop-color=%22%23dc2626%22%20stop-opacity=%220%22%2F%3E%20%3C%2FlinearGradient%3E%20%3C%2Fdefs%3E%20%3Crect%20width=%22100%22%20height=%22100%22%20fill=%22url(%23feat-glow)%22%2F%3E%20%3Cpath%20d=%22M16%2092%20C38%2074%2064%2054%2088%2018%22%20stroke=%22%23818cf8%22%20stroke-width=%221.5%22%20stroke-dasharray=%224%203%22%20opacity=%220.45%22%2F%3E%20%3Cpath%20d=%22M28%2098%20C50%2080%2074%2060%2096%2032%22%20stroke=%22%23a5b4fc%22%20stroke-width=%221%22%20stroke-dasharray=%222%203%22%20opacity=%220.3%22%2F%3E%20%3Cpath%20d=%22M88%2012%20L89.5%2016.5%20L94%2018%20L89.5%2019.5%20L88%2024%20L86.5%2019.5%20L82%2018%20L86.5%2016.5%20Z%22%20fill=%22%23fbbf24%22%2F%3E%20%3Cpath%20d=%22M30%2028%20L31%2031%20L34%2032%20L31%2033%20L30%2036%20L29%2033%20L26%2032%20L29%2031%20Z%22%20fill=%22%23818cf8%22%20opacity=%220.8%22%2F%3E%20%3Cpath%20d=%22M78%2074%20L79%2076%20L81%2077%20L79%2078%20L78%2080%20L77%2078%20L75%2077%20L77%2076%20Z%22%20fill=%22%23c7d2fe%22%20opacity=%220.7%22%2F%3E%20%3Ccircle%20cx=%2292%22%20cy=%2244%22%20r=%221.8%22%20fill=%22%23fbbf24%22%20opacity=%220.85%22%2F%3E%20%3Ccircle%20cx=%2242%22%20cy=%2218%22%20r=%221.5%22%20fill=%22%23a5b4fc%22%20opacity=%220.75%22%2F%3E%20%3Cpath%20d=%22M48%2066%20Q37%2077%2030%2092%20Q43%2083%2054%2072%20Z%22%20fill=%22url(%23flame-grad)%22%2F%3E%20%3Cpath%20d=%22M47%2067%20Q39%2075%2036%2084%20Q43%2079%2050%2071%20Z%22%20fill=%22%23fde68a%22%20opacity=%220.9%22%2F%3E%20%3Cpath%20d=%22M49%2059%20L36%2068%20Q43%2055%2054%2050%20Z%22%20fill=%22%234f46e5%22%2F%3E%20%3Cpath%20d=%22M69%2039%20L78%2026%20Q64%2033%2059%2044%20Z%22%20fill=%22%234f46e5%22%2F%3E%20%3Cpath%20d=%22M46%2063%20L53%2069%20L59%2062%20Z%22%20fill=%22%233730a3%22%2F%3E%20%3Cpath%20d=%22M48%2063%20C44%2051%2054%2033%2078%2017%20C88%2041%2070%2051%2058%2068%20C54%2068%2050%2067%2048%2063%20Z%22%20fill=%22url(%23rocket-body)%22%2F%3E%20%3Cpath%20d=%22M70%2022%20C74%2019%2078%2017%2078%2017%20C78%2017%2076%2021%2073%2025%20Z%22%20fill=%22%23ef4444%22%2F%3E%20%3Ccircle%20cx=%2262%22%20cy=%2238%22%20r=%226%22%20fill=%22%23312e81%22%20stroke=%22%23e0e7ff%22%20stroke-width=%221.8%22%2F%3E%20%3Ccircle%20cx=%2262%22%20cy=%2238%22%20r=%223.8%22%20fill=%22%2338bdf8%22%2F%3E%20%3Ccircle%20cx=%2260.5%22%20cy=%2236.5%22%20r=%221.2%22%20fill=%22%23ffffff%22%2F%3E%20%3Cline%20x1=%2236%22%20y1=%2248%22%20x2=%2224%22%20y2=%2256%22%20stroke=%22%23a5b4fc%22%20stroke-width=%221.4%22%20stroke-linecap=%22round%22%20opacity=%220.5%22%2F%3E%20%3Cline%20x1=%2260%22%20y1=%2280%22%20x2=%2252%22%20y2=%2288%22%20stroke=%22%23818cf8%22%20stroke-width=%221.4%22%20stroke-linecap=%22round%22%20opacity=%220.5%22%2F%3E%20%3C%2Fsvg%3E'); }
.job-type-design::before { background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http:%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox=%220%200%20100%20100%22%20fill=%22none%22%3E%20%3Cdefs%3E%20%3CradialGradient%20id=%22dsg-glow%22%20cx=%2272%25%22%20cy=%2260%25%22%20r=%2265%25%22%3E%20%3Cstop%20offset=%220%25%22%20stop-color=%22%23f43f5e%22%20stop-opacity=%220.4%22%2F%3E%20%3Cstop%20offset=%22100%25%22%20stop-color=%22%23f43f5e%22%20stop-opacity=%220%22%2F%3E%20%3C%2FradialGradient%3E%20%3ClinearGradient%20id=%22pen-grad%22%20x1=%2255%22%20y1=%2220%22%20x2=%2295%22%20y2=%2260%22%20gradientUnits=%22userSpaceOnUse%22%3E%20%3Cstop%20offset=%220%25%22%20stop-color=%22%23f43f5e%22%2F%3E%20%3Cstop%20offset=%22100%25%22%20stop-color=%22%23be123c%22%2F%3E%20%3C%2FlinearGradient%3E%20%3C%2Fdefs%3E%20%3Crect%20width=%22100%22%20height=%22100%22%20fill=%22url(%23dsg-glow)%22%2F%3E%20%3Crect%20x=%2226%22%20y=%2216%22%20width=%2256%22%20height=%2242%22%20rx=%226%22%20fill=%22%23ffffff%22%20stroke=%22%23fbcfe8%22%20stroke-width=%221.5%22%20opacity=%220.6%22%2F%3E%20%3Crect%20x=%2236%22%20y=%2230%22%20width=%2258%22%20height=%2248%22%20rx=%227%22%20fill=%22%23ffffff%22%20stroke=%22%23f43f5e%22%20stroke-width=%221.8%22%20opacity=%220.9%22%2F%3E%20%3Cpath%20d=%22M36%2036%20C36%2033%2038%2031%2042%2031%20H88%20C92%2031%2094%2033%2094%2036%20V41%20H36%20Z%22%20fill=%22%23ffe4e6%22%2F%3E%20%3Ccircle%20cx=%2243%22%20cy=%2236%22%20r=%221.6%22%20fill=%22%23f43f5e%22%2F%3E%20%3Ccircle%20cx=%2248%22%20cy=%2236%22%20r=%221.6%22%20fill=%22%23fb7185%22%2F%3E%20%3Ccircle%20cx=%2253%22%20cy=%2236%22%20r=%221.6%22%20fill=%22%23fda4af%22%2F%3E%20%3Crect%20x=%2242%22%20y=%2246%22%20width=%2222%22%20height=%2218%22%20rx=%223%22%20fill=%22%23fecdd3%22%20opacity=%220.8%22%2F%3E%20%3Crect%20x=%2268%22%20y=%2246%22%20width=%2220%22%20height=%224%22%20rx=%222%22%20fill=%22%23fda4af%22%20opacity=%220.9%22%2F%3E%20%3Crect%20x=%2268%22%20y=%2253%22%20width=%2215%22%20height=%223%22%20rx=%221.5%22%20fill=%22%23fbcfe8%22%2F%3E%20%3Crect%20x=%2268%22%20y=%2259%22%20width=%2218%22%20height=%223%22%20rx=%221.5%22%20fill=%22%23fbcfe8%22%2F%3E%20%3Cpath%20d=%22M28%2078%20C42%2086%2060%2068%2084%2074%22%20stroke=%22%23ec4899%22%20stroke-width=%222%22%20stroke-linecap=%22round%22%20fill=%22none%22%2F%3E%20%3Cline%20x1=%2250%22%20y1=%2284%22%20x2=%2266%22%20y2=%2268%22%20stroke=%22%23d946ef%22%20stroke-width=%221.2%22%20stroke-dasharray=%222%202%22%2F%3E%20%3Ccircle%20cx=%2250%22%20cy=%2284%22%20r=%222.2%22%20fill=%22%23ffffff%22%20stroke=%22%23d946ef%22%20stroke-width=%221.5%22%2F%3E%20%3Ccircle%20cx=%2266%22%20cy=%2268%22%20r=%222.2%22%20fill=%22%23ffffff%22%20stroke=%22%23d946ef%22%20stroke-width=%221.5%22%2F%3E%20%3Crect%20x=%2256%22%20y=%2274%22%20width=%225%22%20height=%225%22%20fill=%22%23ec4899%22%20rx=%221%22%2F%3E%20%3Cpath%20d=%22M78%2014%20L94%2030%20L87%2037%20L84%2034%20L76%2042%20L72%2038%20L80%2030%20L77%2027%20Z%22%20fill=%22url(%23pen-grad)%22%2F%3E%20%3Cpath%20d=%22M72%2038%20L66%2046%20L74%2040%20Z%22%20fill=%22%23881337%22%2F%3E%20%3Ccircle%20cx=%2267.5%22%20cy=%2244.5%22%20r=%221%22%20fill=%22%23ffffff%22%2F%3E%20%3C%2Fsvg%3E'); }
.job-type-coverage::before { background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http:%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox=%220%200%20100%20100%22%20fill=%22none%22%3E%20%3Cdefs%3E%20%3CradialGradient%20id=%22cov-glow%22%20cx=%2272%25%22%20cy=%2258%25%22%20r=%2265%25%22%3E%20%3Cstop%20offset=%220%25%22%20stop-color=%22%2310b981%22%20stop-opacity=%220.4%22%2F%3E%20%3Cstop%20offset=%22100%25%22%20stop-color=%22%2310b981%22%20stop-opacity=%220%22%2F%3E%20%3C%2FradialGradient%3E%20%3ClinearGradient%20id=%22shield-grad%22%20x1=%2242%22%20y1=%2218%22%20x2=%2282%22%20y2=%2282%22%20gradientUnits=%22userSpaceOnUse%22%3E%20%3Cstop%20offset=%220%25%22%20stop-color=%22%2334d399%22%2F%3E%20%3Cstop%20offset=%2260%25%22%20stop-color=%22%2310b981%22%2F%3E%20%3Cstop%20offset=%22100%25%22%20stop-color=%22%23059669%22%2F%3E%20%3C%2FlinearGradient%3E%20%3ClinearGradient%20id=%22shield-inner%22%20x1=%2247%22%20y1=%2224%22%20x2=%2277%22%20y2=%2276%22%20gradientUnits=%22userSpaceOnUse%22%3E%20%3Cstop%20offset=%220%25%22%20stop-color=%22%23ffffff%22%20stop-opacity=%220.9%22%2F%3E%20%3Cstop%20offset=%22100%25%22%20stop-color=%22%23d1fae5%22%20stop-opacity=%220.7%22%2F%3E%20%3C%2FlinearGradient%3E%20%3C%2Fdefs%3E%20%3Crect%20width=%22100%22%20height=%22100%22%20fill=%22url(%23cov-glow)%22%2F%3E%20%3Ccircle%20cx=%2262%22%20cy=%2252%22%20r=%2240%22%20stroke=%22%2310b981%22%20stroke-width=%221.2%22%20stroke-dasharray=%223%204%22%20opacity=%220.3%22%2F%3E%20%3Ccircle%20cx=%2262%22%20cy=%2252%22%20r=%2232%22%20stroke=%22%2334d399%22%20stroke-width=%221.2%22%20stroke-dasharray=%226%203%22%20opacity=%220.4%22%2F%3E%20%3Cg%20opacity=%220.85%22%3E%20%3Ccircle%20cx=%2232%22%20cy=%2230%22%20r=%225.5%22%20fill=%22%2310b981%22%20opacity=%220.2%22%2F%3E%20%3Cpath%20d=%22M29.5%2030%20L31.5%2032%20L35%2028.5%22%20stroke=%22%2310b981%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20opacity=%220.85%22%3E%20%3Ccircle%20cx=%2288%22%20cy=%2228%22%20r=%225.5%22%20fill=%22%2310b981%22%20opacity=%220.2%22%2F%3E%20%3Cpath%20d=%22M85.5%2028%20L87.5%2030%20L91%2026.5%22%20stroke=%22%2310b981%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20opacity=%220.85%22%3E%20%3Ccircle%20cx=%2290%22%20cy=%2272%22%20r=%225.5%22%20fill=%22%2310b981%22%20opacity=%220.2%22%2F%3E%20%3Cpath%20d=%22M87.5%2072%20L89.5%2074%20L93%2070.5%22%20stroke=%22%2310b981%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%2F%3E%20%3C%2Fg%3E%20%3Cpath%20d=%22M62%2018%20C76%2018%2086%2024%2086%2038%20C86%2058%2070%2075%2062%2082%20C54%2075%2038%2058%2038%2038%20C38%2024%2048%2018%2062%2018%20Z%22%20fill=%22url(%23shield-grad)%22%2F%3E%20%3Cpath%20d=%22M62%2022%20C73%2022%2081%2027%2081%2038%20C81%2054%2068%2069%2062%2075%20C56%2069%2043%2054%2043%2038%20C43%2027%2051%2022%2062%2022%20Z%22%20fill=%22url(%23shield-inner)%22%20opacity=%220.25%22%2F%3E%20%3Cpath%20d=%22M50%2048%20L58%2056%20L76%2036%22%20stroke=%22%23ffffff%22%20stroke-width=%224.5%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%2F%3E%20%3Cpath%20d=%22M58%2064%20L64%2070%20L80%2052%22%20stroke=%22%236ee7b7%22%20stroke-width=%222.2%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%20opacity=%220.75%22%2F%3E%20%3C%2Fsvg%3E'); }
.job-type-quick::before { background-image: url('data:image/svg+xml,%3Csvg%20xmlns=%22http:%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox=%220%200%20100%20100%22%20fill=%22none%22%3E%20%3Cdefs%3E%20%3CradialGradient%20id=%22qck-glow%22%20cx=%2268%25%22%20cy=%2250%25%22%20r=%2265%25%22%3E%20%3Cstop%20offset=%220%25%22%20stop-color=%22%23f59e0b%22%20stop-opacity=%220.45%22%2F%3E%20%3Cstop%20offset=%22100%25%22%20stop-color=%22%23f59e0b%22%20stop-opacity=%220%22%2F%3E%20%3C%2FradialGradient%3E%20%3ClinearGradient%20id=%22bolt-grad%22%20x1=%2242%22%20y1=%2212%22%20x2=%2282%22%20y2=%2288%22%20gradientUnits=%22userSpaceOnUse%22%3E%20%3Cstop%20offset=%220%25%22%20stop-color=%22%23fef08a%22%2F%3E%20%3Cstop%20offset=%2235%25%22%20stop-color=%22%23fbbf24%22%2F%3E%20%3Cstop%20offset=%2270%25%22%20stop-color=%22%23f59e0b%22%2F%3E%20%3Cstop%20offset=%22100%25%22%20stop-color=%22%23d97706%22%2F%3E%20%3C%2FlinearGradient%3E%20%3C%2Fdefs%3E%20%3Crect%20width=%22100%22%20height=%22100%22%20fill=%22url(%23qck-glow)%22%2F%3E%20%3Cpath%20d=%22M22%2028%20L36%2028%20L42%2022%22%20stroke=%22%23f59e0b%22%20stroke-width=%221.8%22%20stroke-linecap=%22round%22%20opacity=%220.4%22%2F%3E%20%3Cpath%20d=%22M16%2044%20L36%2044%22%20stroke=%22%23fbbf24%22%20stroke-width=%222.4%22%20stroke-linecap=%22round%22%20opacity=%220.6%22%2F%3E%20%3Cpath%20d=%22M20%2060%20L40%2060%22%20stroke=%22%23f59e0b%22%20stroke-width=%222%22%20stroke-linecap=%22round%22%20opacity=%220.5%22%2F%3E%20%3Cpath%20d=%22M26%2076%20L44%2076%22%20stroke=%22%23fbbf24%22%20stroke-width=%221.6%22%20stroke-linecap=%22round%22%20opacity=%220.35%22%2F%3E%20%3Cline%20x1=%2282%22%20y1=%2218%22%20x2=%2294%22%20y2=%2218%22%20stroke=%22%23fde68a%22%20stroke-width=%221.8%22%20stroke-linecap=%22round%22%20opacity=%220.5%22%2F%3E%20%3Cline%20x1=%2288%22%20y1=%2230%22%20x2=%2298%22%20y2=%2230%22%20stroke=%22%23fcd34d%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22%20opacity=%220.6%22%2F%3E%20%3Cpolygon%20points=%2286%2C44%2088%2C48%2092%2C50%2088%2C52%2086%2C56%2084%2C52%2080%2C50%2084%2C48%22%20fill=%22%23fde047%22%2F%3E%20%3Cpolygon%20points=%2240%2C84%2041%2C87%2044%2C88%2041%2C89%2040%2C92%2039%2C89%2036%2C88%2039%2C87%22%20fill=%22%23fbbf24%22%20opacity=%220.7%22%2F%3E%20%3Cpath%20d=%22M68%2012%20L40%2050%20H58%20L48%2088%20L82%2044%20H64%20L74%2012%20Z%22%20fill=%22%23d97706%22%20opacity=%220.35%22%20transform=%22translate(3%2C%203)%22%2F%3E%20%3Cpath%20d=%22M66%2010%20L38%2050%20H58%20L48%2090%20L84%2044%20H64%20L74%2010%20Z%22%20fill=%22url(%23bolt-grad)%22%2F%3E%20%3Cpath%20d=%22M64%2016%20L46%2048%20H60%20L54%2076%20L74%2046%20H58%20L68%2016%20Z%22%20fill=%22%23ffffff%22%20opacity=%220.65%22%2F%3E%20%3C%2Fsvg%3E'); }

@media (prefers-color-scheme: dark) {
  .job-type-card::before { opacity: 0.16; filter: grayscale(25%) brightness(0.95); }
  .job-type-card:hover::before { opacity: 0.38; filter: grayscale(8%) brightness(1.1); }
  .job-type-card:has(input:checked)::before { opacity: 0.68; filter: grayscale(0%) brightness(0.98) drop-shadow(0 0 8px rgba(0, 0, 0, 0.5)); }
}
.check { display: flex; gap: var(--space-3); align-items: flex-start; }
.check input { margin-top: var(--space-1); }
.check small { display: block; color: var(--muted); }
.check.risky { padding: var(--space-3) var(--space-3); border: 1px solid var(--warn); border-radius: var(--r-md); background: var(--warn-soft); }
details.advanced { border: 1px solid var(--border); border-radius: var(--r-md); }
details.advanced > summary { cursor: pointer; padding: var(--space-3) var(--space-3); color: var(--muted); font-weight: var(--weight-medium); }
/* Every fold uses the same chevron (see .fold), not the browser's triangle. */
details.advanced > summary, details.raw > summary, .account-card details > summary { display: flex; align-items: center; gap: var(--space-2); list-style: none; }
details.advanced > summary::-webkit-details-marker, details.raw > summary::-webkit-details-marker, .account-card details > summary::-webkit-details-marker { display: none; }
details.advanced > summary::before, details.raw > summary::before, .account-card details > summary::before {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 var(--space-1) 0 var(--space-0);
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform var(--motion-fast) ease;
}
details.advanced[open] > summary::before, details.raw[open] > summary::before, .account-card details[open] > summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { details.advanced > summary::before, details.raw > summary::before, .account-card details > summary::before { transition: none; } }
.upload-drop { gap: var(--space-2); }
#nj-files:focus-visible + .upload-drop { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
details.advanced > .stack { padding: var(--space-1) var(--space-3) var(--space-3); }
pre.file {
  margin: 0; padding: var(--space-4) var(--space-4); max-height: 70vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius);
}
details.raw summary { cursor: pointer; color: var(--muted); padding: var(--space-3) var(--space-4); }
details.raw pre { margin: 0; padding: 0 var(--space-4) var(--space-4); overflow: auto; }
.question { font-size: var(--type-body); font-weight: var(--weight-medium); }
/* A planner's questions and the answers, as a conversation: the AI on the left, you on the right */
.clarify-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.clarify-msg { display: flex; flex-direction: column; gap: var(--space-1); max-width: 85%; padding: var(--space-2) var(--space-3); border-radius: var(--r-lg); }
.clarify-msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.clarify-ai { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); }
.clarify-you { align-self: flex-end; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); }
.clarify-who { font-size: var(--type-tag); font-weight: var(--weight-bold); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.clarify-reply { display: flex; align-items: flex-end; gap: var(--space-2); }
.clarify-reply .field { flex: 1 1 auto; margin: 0; }

/* terminal */
.term-wrap { display: flex; flex-direction: column; gap: var(--space-2); min-height: 0; }
.term {
  background: var(--term-bg); border-radius: var(--radius); padding: var(--space-2); height: calc(100vh - 260px); min-height: 320px;
}
.term .xterm { height: 100%; }
.term-fallback { color: var(--term-text); margin: 0; height: 100%; overflow: auto; white-space: pre-wrap; }
.keybar { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.keybar[hidden], .term-input[hidden] { display: none !important; }
.keybar .btn { min-width: 44px; }
/* Desktop types straight into the terminal; the line box is for phones and the no-xterm fallback. */
.term-input { display: none; gap: var(--space-2); }
.term-input input { font-family: var(--mono); }
.term-wrap.fallback .term-input { display: flex; }
.term-wrap.term-empty,
body[data-page="run"]:has(.banner.failed) .term-wrap.term-empty,
body[data-page="run"].run-failed .term-wrap.term-empty {
  display: none !important;
}
.term-wrap.run-failed .term,
body[data-page="run"]:has(.banner.failed) .term,
body[data-page="run"].run-failed .term {
  height: auto;
  min-height: 0;
  max-height: min(280px, 35vh);
  overflow-y: auto;
}

dialog {
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 0; background: var(--panel); color: var(--text);
  width: min(var(--dialog-width), calc(100% - 2 * var(--space-4)), calc(100vw - 2 * var(--space-4))); box-shadow: var(--shadow-3);
  max-width: min(var(--dialog-width), calc(100% - 2 * var(--space-4)), calc(100vw - 2 * var(--space-4)));
  max-height: min(85vh, 720px);
  max-height: min(85dvh, 720px);
  margin: auto;
  box-sizing: border-box;
  overflow: hidden;
}
dialog:focus, dialog:focus-visible, #dialog:focus, #dialog:focus-visible { outline: none; }
dialog::backdrop { background: var(--backdrop); }
dialog form {
  padding: var(--dialog-padding);
  display: flex;
  flex-direction: column;
  gap: var(--dialog-gap);
  max-height: min(85vh, 720px);
  max-height: min(85dvh, 720px);
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}
dialog.dialog-compact {
  width: min(var(--dialog-width-compact), calc(100% - 2 * var(--space-4)), calc(100vw - 2 * var(--space-4)));
  max-width: min(var(--dialog-width-compact), calc(100% - 2 * var(--space-4)), calc(100vw - 2 * var(--space-4)));
  max-height: min(70vh, 400px);
  box-sizing: border-box;
  overflow: hidden;
}
dialog.dialog-compact form {
  padding: var(--dialog-padding);
  gap: var(--dialog-gap);
  max-height: min(70vh, 400px);
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.dialog-header {
  display: flex;
  align-items: flex-start; /* a title that wraps keeps the ✕ beside its first line */
  justify-content: space-between;
  gap: var(--space-2);
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
}
dialog h2 {
  font-size: var(--type-body);
  margin: 0;
  min-height: var(--control-md); /* the ✕'s height, so a one-line title sits level with it */
  display: flex;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.dialog-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: var(--type-body);
  scale: 1.15; /* the ✕ and its target, 15% larger than other icon buttons */
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: var(--control-md);
  flex-shrink: 0; /* a long title never squeezes it */
  margin-right: calc(-1 * var(--space-2)); /* the ✕ itself lines up with the dialog's right edge of content */
  transform-origin: center;
  transition: color var(--motion-fast) ease, background-color var(--motion-fast) ease;
}
.dialog-close-btn:focus:not(:focus-visible) {
  outline: none;
  background: transparent;
  color: var(--muted);
}
@media (hover: hover) {
  .dialog-close-btn:hover {
    color: var(--text);
    background: var(--panel-2);
  }
}
.dialog-close-btn:active {
  color: var(--text);
  background: var(--panel-2);
}
.dialog-close-btn:focus-visible {
  color: var(--text);
  background: var(--panel-2);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#dialog-body {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#dialog-body.stack { gap: var(--dialog-gap); }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
}
.dialog-tabs {
  display: flex;
  background: var(--panel-2);
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  gap: 4px;
  flex-shrink: 0;
}
.dialog-tab-btn {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  font-size: var(--type-secondary);
  font-weight: var(--weight-medium);
  text-align: center;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--motion-fast) ease;
  min-height: var(--control-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.dialog-tab-btn:hover {
  color: var(--text);
}
.dialog-tab-btn.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: var(--weight-medium);
}
.dialog-tab-btn .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.dialog-tab-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
}
.dialog-tab-panel[hidden] {
  display: none !important;
}
.tc-import-dialog { gap: var(--space-3); }
.tc-import-filter { width: 100%; }
.tc-import-list { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-2); }
.tc-import-badge { font-size: var(--type-secondary); margin-left: var(--space-2); }
.project-discovery-head h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--type-body);
}
.project-discovery { display: flex; flex-direction: column; gap: var(--space-3); }
.project-discovery h3 { margin: 0 0 var(--space-1); font-size: var(--type-body); }
.project-discovery-list {
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; max-height: min(320px, 40vh); overflow-y: auto;
}
.project-discovery-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
}
.project-discovery-row:last-child { border-bottom: 0; }
.project-discovery-info { min-width: 0; }
.project-discovery-title { font-weight: var(--weight-medium); }
.project-discovery-path {
  margin-top: var(--space-0); color: var(--muted); font: var(--type-tag) var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-discovery-status { padding: var(--space-5); text-align: center; }
.dialog-divider { display: flex; align-items: center; gap: var(--space-3); color: var(--muted); font-size: var(--type-secondary); }
.dialog-divider::before, .dialog-divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.project-discovery + .dialog-divider ~ .row.end { justify-content: flex-end; }

.notice { padding: var(--space-3) var(--space-4); border-radius: var(--radius); border: 1px solid var(--warn); background: var(--warn-soft); color: var(--text); font-size: var(--type-body); line-height: 1.45; }
.notice.bad { border-color: var(--bad); background: var(--bad-soft); }
/* The code shown while signing in to Sentry: big enough to compare with the one on Sentry's page */
.sentry-code { align-self: flex-start; padding: var(--space-2) var(--space-4); border: 1px dashed var(--border); border-radius: var(--r-md); background: var(--panel); font-size: var(--type-section); font-weight: var(--weight-bold); letter-spacing: .12em; }
/* Set up free AI: a checklist that ticks off as each step finishes */
.ai-steps { list-style: none; margin: var(--space-3) 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.ai-step { display: flex; align-items: flex-start; gap: var(--space-3); color: var(--muted); }
.ai-step-text { display: flex; flex-direction: column; gap: 2px; }
.ai-step-icon { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: var(--type-tag); font-weight: var(--weight-bold); }
.ai-step.is-active { color: var(--text); }
.ai-step.is-active .ai-step-icon { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.ai-step.is-done, .ai-step.is-skipped { color: var(--text); }
.ai-step.is-done .ai-step-icon { border-color: var(--ok); background: var(--ok); color: #fff; }
.ai-step.is-done .ai-step-icon::before { content: "✓"; }
.ai-step.is-skipped .ai-step-icon { border-color: var(--ok); color: var(--ok); }
.ai-step.is-skipped .ai-step-icon::before { content: "✓"; }
.ai-step.is-failed { color: var(--text); }
.ai-step.is-failed .ai-step-icon { border-color: var(--bad); background: var(--bad); color: #fff; }
.ai-step.is-failed .ai-step-icon::before { content: "!"; }
.ai-free-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.notice.good { border-color: var(--ok); background: var(--ok-soft); }
.notice .row { margin-top: var(--space-3); }

/* Home only needs a project switcher when the sidebar's picker is hidden. */
/* Home's branch field: label above the control. */
.status-branch { display: inline-flex; flex-direction: column; align-items: stretch; gap: var(--space-1); max-width: 100%; min-width: 0; }

/* phones */
@media (max-width: 760px) {
  :root {
    --container-pad-x: var(--space-4);
    --container-pad-y: var(--space-3);
  }
  .app { grid-template-columns: minmax(0, 1fr); }
  .mobile-header {
    position: fixed; inset: 0 0 auto; z-index: var(--z-header);
    display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center; gap: var(--space-2);
    height: calc(64px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(var(--space-4), env(safe-area-inset-right)) 0 max(var(--space-2), env(safe-area-inset-left));
    background: var(--panel); border-bottom: 1px solid var(--border);
    font-size: var(--type-body); font-weight: var(--weight-bold);
  }
  .nav-toggle, .nav-close {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: var(--control-lg); min-height: var(--control-lg); padding: var(--space-2);
    border: 0; border-radius: var(--r-md); background: transparent; color: var(--text); font: inherit; cursor: pointer;
  }
  .nav-toggle:hover, .nav-close:hover { background: var(--panel-2); }
  .nav-toggle .icon { width: 24px; height: 24px; }
  .nav-toggle:disabled { opacity: .4; cursor: default; }
  .nav-close { margin-left: auto; }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); background: var(--backdrop);
  }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: var(--z-drawer);
    width: min(320px, calc(100vw - 48px)); height: 100dvh;
    padding: calc(var(--space-3) + env(safe-area-inset-top)) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom));
    transform: translateX(-100%); visibility: hidden;
    transition: transform var(--motion-medium) ease, visibility 0s linear var(--motion-medium);
    box-shadow: var(--shadow-3);
  }
  .app.drawer-open .sidebar { transform: translateX(0); visibility: visible; transition-delay: 0s; }
  .sidebar .brand { padding: 0 var(--space-3); }
  .sidebar .nav a, .sidebar .nav-secondary a, .sidebar .btn, .sidebar select, .configuration-menu-trigger { min-height: var(--control-lg); }
  .main { padding: calc(80px + env(safe-area-inset-top)) var(--space-4) calc(96px + env(safe-area-inset-bottom)); }
  .topbar { flex-direction: column; gap: var(--space-3); }
  .topbar-actions { justify-content: flex-start; width: 100%; }
  .topbar-actions > .btn.primary { flex: 1; min-height: var(--control-lg); }
  body[data-page="tests"] .topbar-actions { flex-wrap: nowrap; }
  body[data-page="tests"] .topbar-actions > .test-run-all-btn { flex: 2 1 0; min-width: 0; min-height: var(--control-lg); }
  body[data-page="tests"] .topbar-actions > .test-expand-coverage-btn {
    flex: 1 1 0; min-width: 0; min-height: var(--control-lg);
    padding-inline: var(--space-2); font-size: var(--type-secondary); text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .topbar-actions:has(.home-new-job-btn:only-child) { display: none; }
  .home-new-job-btn { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
    position: fixed; inset: auto 0 0 0; z-index: var(--z-sticky);
    padding: var(--space-1) max(var(--space-1), env(safe-area-inset-right)) calc(var(--space-1) + env(safe-area-inset-bottom)) max(var(--space-1), env(safe-area-inset-left));
    background: var(--panel); border-top: 1px solid var(--border);
  }
  .tabbar a {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-0);
    min-height: var(--control-xl); padding: var(--space-1) 0; border-radius: var(--r-md);
    color: var(--muted); font-size: var(--type-tag); font-weight: var(--weight-medium); text-decoration: none;
  }
  .tabbar a.active { color: var(--accent); }
  .tabbar .icon { width: 22px; height: 32px; } /* every icon gets the New button's height, so the labels line up */
  /* The chosen tab's icon grows a little (with a soft overshoot) and the others ease back; a press dips it slightly */
  .tabbar .icon { transform-origin: 50% 60%; transition: transform var(--motion-medium) cubic-bezier(.34, 1.4, .64, 1), color var(--motion-fast) ease; }
  .tabbar a.active .icon { transform: scale(1.14); }
  .tabbar a:active .icon { transform: scale(.94); transition-duration: var(--motion-fast); }
  .tabbar .badge { position: absolute; top: 0; left: calc(50% + 6px); margin: 0; min-width: 18px; font-size: var(--type-tag); }
  .tabbar-new .icon { width: 32px; height: 32px; padding: var(--space-1); border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); stroke-width: 2.5; }
  .tabbar-new.active { color: var(--accent); }
  .projects-actions { width: 100%; }
  .projects-actions > .btn { min-height: var(--control-lg); padding: var(--space-2) var(--space-2); font-size: var(--type-secondary); gap: var(--space-1); }
  .term { height: calc(100vh - 380px); min-height: 240px; }
  .keybar .btn { min-height: var(--control-lg); }
  /* The header already names the project, so Home doesn't repeat it as a title. */
  body[data-page="home"] #page-title { display: none; }
  .status-line .branch-select { width: min(12rem, calc((100vw - 2 * var(--space-4)) / 2)); }
  .status-stats a, .card-h a { min-height: var(--control-md); }
  .item .meta { white-space: normal; }
  .item .meta .reason-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .item:has(.side .btn) { flex-wrap: wrap; row-gap: var(--space-2); }
  .item:has(.side .btn) .main-col { flex-basis: 100%; }
  .item:has(.side .btn) .side { width: 100%; justify-content: space-between; }
  .job-hero { padding: var(--container-pad-y) var(--container-pad-x); gap: var(--space-3); }
  .job-hero-action { width: 100%; }
  .job-hero-action .btn { width: 100%; min-height: var(--control-lg); }
  .term-input { display: flex; }
  dialog {
    --dialog-padding: var(--space-4);
    --dialog-gap: var(--space-3);
    width: min(var(--dialog-width), calc(100% - 2 * var(--space-4)), calc(100vw - 2 * var(--space-5) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-width: min(var(--dialog-width), calc(100% - 2 * var(--space-4)), calc(100vw - 2 * var(--space-5) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-height: calc(100dvh - 24px);
    border-radius: var(--r-md);
    box-sizing: border-box;
    overflow: hidden;
    margin: auto;
  }
  dialog form {
    padding: var(--dialog-padding);
    gap: var(--dialog-gap);
    max-height: calc(100dvh - 24px);
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
  }
  dialog.dialog-compact {
    width: min(var(--dialog-width-compact), calc(100% - 2 * var(--space-4)), calc(100vw - 2 * var(--space-5) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-width: min(var(--dialog-width-compact), calc(100% - 2 * var(--space-4)), calc(100vw - 2 * var(--space-5) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-height: min(80dvh, 380px);
    box-sizing: border-box;
    overflow: hidden;
  }
  dialog.dialog-compact form {
    padding: var(--dialog-padding);
    gap: var(--dialog-gap);
    max-height: min(80dvh, 380px);
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  .dialog-actions {
    flex-direction: row;
    gap: var(--space-2);
    min-width: 0;
    max-width: 100%;
  }
  .dialog-actions .btn {
    flex: 1;
    min-width: 0;
    min-height: var(--control-lg);
    justify-content: center;
    text-align: center;
  }
  .dialog-tabs {
    padding: 2px;
  }
  .dialog-tab-btn {
    font-size: var(--type-secondary);
    min-height: var(--control-md);
    padding: var(--space-1) var(--space-2);
  }
  .dialog-tab-panel {
    gap: var(--space-3);
  }
  .project-discovery-list {
    max-height: min(280px, 40vh);
  }
  .project-discovery-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-3);
  }
  .project-discovery-info {
    width: 100%;
    min-width: 0;
  }
  .project-discovery-path {
    max-width: 100%;
    font-size: var(--type-tag);
    line-height: 1.35;
  }
  .project-discovery-row .pill-badge {
    margin-right: auto;
  }
  .project-discovery-row button[data-add-project-path] {
    min-height: var(--control-md);
    min-width: 72px;
    padding: var(--space-1) var(--space-3);
  }
  #manual-add-project {
    width: 100%;
    min-height: var(--control-lg);
    justify-content: center;
  }
  #panel-custom .row.end {
    width: 100%;
    justify-content: stretch;
  }
  .scope-notice-clean {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }
  .scope-notice-clean .btn {
    width: 100%;
    min-height: var(--control-md);
    justify-content: center;
  }
  .signin-wrap {
    padding: var(--space-1) 0 var(--space-6);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* sign-in gate */
.signin-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-2) var(--space-4) var(--space-8);
}
.signin-card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.signin-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--type-section);
  font-weight: var(--weight-bold);
}
.signin-wrap:has(.signin-preview) { padding-inline: 0; }
.signin-card:has(.signin-preview) { max-width: 520px; gap: var(--space-5); }
@media (max-width: 480px) {
  .signin-card:has(.signin-preview) { padding: var(--space-4); }
}
.signin-preview { margin: var(--space-1) 0; display: grid; gap: var(--space-3); }
.signin-preview h3 { font-size: var(--type-section); font-weight: var(--weight-bold); letter-spacing: -.025em; text-align: center; }
.signin-preview .signin-privacy { margin: calc(var(--space-1) * -1) 0 0; text-align: center; color: var(--muted); font-size: var(--type-secondary); }
.signin-preview picture { display: block; overflow: hidden; border-radius: var(--r-md); background: var(--term-bg); box-shadow: var(--shadow); }
.signin-preview img { display: block; width: 100%; height: auto; }
.signin-brand .brand-mark {
  width: 26px;
  height: 26px;
}
.sso-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.sso-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  font-size: var(--type-body);
  font-weight: var(--weight-medium);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease, transform 0.05s ease;
}
.sso-btn:hover {
  background: var(--panel);
  border-color: var(--text);
}
.sso-btn:active {
  transform: scale(0.99);
}
.sso-btn .icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sso-btn.apple-btn,
.sso-btn.github-btn {
  background: #24292f;
  color: #fff;
  border-color: #3b4148;
}
.sso-btn.apple-btn:hover,
.sso-btn.github-btn:hover {
  background: #32383f;
  border-color: #5b636b;
}
.sso-btn.email-btn {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--border);
}
.sso-btn.email-btn:hover {
  background: var(--panel);
  border-color: var(--text);
}
/* The sign-in screen: one plain column on the page (no card), logo and title, the animation, then the options lower down */
.signin-wrap:has(.signin-plain) { padding: var(--space-8) var(--space-4) var(--space-8); }
.signin-card.signin-plain { max-width: 460px; padding: 0; background: transparent; border: 0; box-shadow: none; gap: var(--space-6); }
.signin-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.signin-logo { width: var(--control-xl); height: var(--control-xl); border-radius: var(--r-md); }
.signin-title { margin: var(--space-2) 0 0; font-size: var(--type-display); font-weight: var(--weight-bold); letter-spacing: -.02em; line-height: 1.15; }
.signin-plain .signin-preview { margin: 0; }
.signin-plain .signin-preview h3, .signin-plain .signin-preview .signin-privacy { text-align: left; }
.signin-plain .sso-buttons { margin-top: var(--space-4); }
.signin-plain .sso-btn { min-height: var(--control-xl); border-radius: var(--r-pill); padding-inline: var(--space-6); background: transparent; color: var(--text); border-color: var(--border); }
.signin-plain .sso-btn:hover { background: var(--panel-2); border-color: var(--muted); }
.signin-plain .sso-btn .icon { left: var(--space-5); }
.signin-or { display: flex; align-items: center; gap: var(--space-3); color: var(--muted); font-size: var(--type-tag); text-transform: uppercase; letter-spacing: .06em; }
.signin-or::before, .signin-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.signin-plain .manual-token-details, .signin-plain .notice { border-radius: var(--r-lg); }
@media (max-width: 480px) {
  .signin-wrap:has(.signin-plain) { padding: var(--space-6) var(--space-4) var(--space-8); }
  .signin-card.signin-plain { padding: 0; }
}
/* Forgot password: a quiet link under the sign-in buttons, and its own step in the email panel */
.signin-forgot-link { align-self: center; margin-top: var(--space-1); font-size: var(--type-secondary); }
.email-reset-step p { margin: 0; }
.email-reset-actions { justify-content: space-between; font-size: var(--type-secondary); }
.email-reset-actions .linklike:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.email-signin-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding: var(--space-3);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-align: left;
}
.email-signin-panel .field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.email-signin-panel .field span {
  font-size: var(--type-secondary);
  font-weight: var(--weight-medium);
  color: var(--muted);
}
.email-signin-panel input {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--text);
  font-size: var(--type-body);
  width: 100%;
  box-sizing: border-box;
}
.email-signin-panel input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}
.email-auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.email-panel-header {
  justify-content: space-between;
  align-items: center;
}
.email-panel-header strong {
  font-size: var(--type-secondary);
}
.email-panel-close {
  font-size: var(--type-secondary);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}
.email-auth-actions {
  justify-content: space-between;
  align-items: center;
  font-size: var(--type-secondary);
}
.email-auth-mode-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: var(--type-secondary);
  cursor: pointer;
}
.email-auth-forgot-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--type-secondary);
  cursor: pointer;
}
.email-auth-submit-btn {
  width: 100%;
  justify-content: center;
  position: relative;
}
.email-auth-link-wrap {
  text-align: center;
}
.email-auth-link-btn {
  background: none;
  border: none;
  font-size: var(--type-tag);
  cursor: pointer;
  color: var(--muted);
}
.email-auth-notice {
  font-size: var(--type-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-sm);
  background: var(--panel);
  border: 1px solid var(--border);
  line-height: 1.4;
  color: var(--muted);
}
.email-auth-notice strong {
  color: var(--text);
}
.email-auth-suggestion {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  font-size: var(--type-secondary);
}
.email-auth-suggestion p {
  margin: 0;
  color: var(--text);
}
.email-auth-suggestion button {
  align-self: flex-start;
}
.email-confirm-card h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--type-body);
  font-weight: var(--weight-bold);
}
.email-confirm-card p {
  margin: 0 0 var(--space-3);
  font-size: var(--type-secondary);
}
.email-confirm-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.email-confirm-form .field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-align: left;
}
.email-confirm-form .field span {
  font-size: var(--type-secondary);
  font-weight: var(--weight-medium);
  color: var(--muted);
}
.email-confirm-form input[type="email"] {
  padding: var(--space-2);
  font-size: var(--type-body);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
.email-confirm-form button[type="submit"] {
  width: 100%;
  justify-content: center;
  padding: var(--space-2);
}

/* Highlight and tag for the last used login method */
.sso-btn.last-used,
#account-continue-btn.last-used,
.signin-error { margin: var(--space-1) 0 0; color: var(--bad); font-size: var(--type-secondary); }
#account-continue-btn, #signin-submit-btn { width: 100%; justify-content: center; position: relative; }
.backend-config-card { display: flex; flex-direction: column; gap: var(--space-1); margin-top: var(--space-3); padding: var(--space-2-5) var(--space-3); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-md); font-size: var(--type-secondary); text-align: left; }
.ok-text { color: var(--ok); }
.bad-text { color: var(--bad); }
.warn-text { color: var(--warn); }
.manual-token-details { font-size: var(--type-secondary); margin-top: var(--space-2); border-top: 1px solid var(--border); padding-top: var(--space-3); }
.manual-token-details > summary { cursor: pointer; user-select: none; text-align: center; font-weight: var(--weight-medium); display: flex; align-items: center; justify-content: center; gap: var(--space-2); }
#signin-submit-btn.last-used {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}
.sso-btn.apple-btn.last-used,
.sso-btn.github-btn.last-used {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}
.last-used-tag {
  position: absolute;
  right: var(--space-3);
  display: inline-flex;
  align-items: center;
  font-size: var(--type-tag);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  line-height: 1.25;
  pointer-events: none;
}
.sso-btn.apple-btn .last-used-tag,
.sso-btn.github-btn .last-used-tag,
#account-continue-btn .last-used-tag,
#signin-submit-btn.primary .last-used-tag {
  background: color-mix(in srgb, var(--accent-ink) 20%, transparent);
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent-ink) 35%, transparent);
}
.last-used-tag.token-tag {
  position: static;
  display: inline-flex;
}
.manual-token-details.last-used-section {
  border-top-color: var(--accent) !important;
}
@media (max-width: 480px) {
  .last-used-tag {
    font-size: var(--type-tag);
    padding: 1px 5px;
    right: var(--space-2);
  }
}

.app.session-locked .sidebar {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.5);
}
.app.session-locked .tabbar {
  display: none !important;
}
.app.session-locked .topbar {
  margin-bottom: var(--space-3);
}

/* projects hub */
.projects-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  align-items: stretch;
}
.projects-actions > .btn {
  width: 100%;
  min-height: var(--control-md);
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}
.projects-actions > .btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.projects-actions > .btn .icon {
  flex-shrink: 0;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}
.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}
.project-card:hover {
  border-color: var(--accent);
}
.project-card.active-project {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.project-card-title {
  font-size: var(--type-body);
  font-weight: var(--weight-bold);
  margin: 0;
}
.project-card-path {
  font-size: var(--type-secondary);
  color: var(--muted);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.project-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}
.pill-badge {
  font-size: var(--type-secondary);
  font-weight: var(--weight-medium);
  padding: var(--space-0) var(--space-2);
  border-radius: var(--r-sm);
  background: var(--panel-2);
  color: var(--muted);
}
.pill-badge.active-badge {
  background: var(--accent);
  color: var(--accent-ink);
}
.pill-badge.needs-badge {
  background: var(--warn);
  color: var(--warn-ink);
}
.pill-badge.configured-badge {
  background: var(--ok-soft);
  color: var(--ok);
}
.pill-badge.github-badge {
  background: color-mix(in srgb, var(--github-ink) 14%, transparent);
  color: var(--github-ink);
  border: 1px solid color-mix(in srgb, var(--github-ink) 35%, transparent);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.pill-badge.local-badge {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.pill-badge .badge-icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
  stroke: none;
  flex-shrink: 0;
}
.projects-filter {
  margin-bottom: 1.25rem;
}

/* original home layout styles (debug / comparison) */
.stats {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
}
.stat {
  padding: var(--space-4) var(--space-4);
}
.stat .k {
  font-size: var(--type-secondary);
  color: var(--muted);
}
.stat .v {
  font-size: var(--type-section);
  font-weight: var(--weight-bold);
  margin-top: var(--space-0);
  overflow-wrap: anywhere;
}
.grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
}
@media (max-width: 760px) {
  .grid, .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }
  .stat {
    padding: var(--space-3);
  }
  .stat .v {
    font-size: var(--type-body);
  }
}

/* job table on home screen */
.job-table {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.job-table-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 140px 160px;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--container-pad-x);
  font-size: var(--type-tag);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.job-table-body {
  display: flex;
  flex-direction: column;
}
.job-table-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 140px 160px;
  align-items: center;
  gap: var(--space-4);
  padding: var(--container-pad-y) var(--container-pad-x);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  position: relative;
  cursor: pointer;
  background: var(--panel);
  transition: background var(--motion-fast) ease, box-shadow var(--motion-medium) ease, border-color var(--motion-medium) ease, transform 0.08s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.job-table-row:last-child {
  border-bottom: 0;
}

/* Tests jobs: a faint tint of the accent over the panel, so they read as a different kind of row without a new colour */
.job-table-row.job-tests:not(:hover):not(:active), .item.job-tests { background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }

/* hover glow & highlight */
.job-table-row:hover {
  background: var(--panel-2);
  border-color: var(--accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow);
  z-index: var(--z-raised);
}

/* click state */
.job-table-row:active {
  transform: scale(0.996) translateY(1px);
  background: var(--accent-soft);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* column styles */
.job-table-row .col-job {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.job-table-row .job-title {
  font-weight: var(--weight-medium);
  font-size: var(--type-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.job-table-row .job-meta {
  font-size: var(--type-secondary);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-table-row .job-reason {
  color: var(--warn);
  font-weight: var(--weight-medium);
}
.job-table-row .col-type {
  display: flex;
  align-items: center;
}
.job-type-tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--type-secondary);
  font-weight: var(--weight-medium);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.job-table-row .job-mobile-info {
  display: none;
}
.date-header-short {
  display: none;
}
.job-table-row .col-status {
  display: flex;
  align-items: center;
}
.job-table-row .col-date {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: var(--space-0);
}
.job-table-row .date-relative {
  font-size: var(--type-secondary);
  font-weight: var(--weight-medium);
  color: var(--text);
}

@media (max-width: 760px) {
  .job-table-header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: var(--space-2) var(--space-3);
  }
  .job-table-header .col-type,
  .job-table-header .col-status {
    display: none;
  }
  .job-table-header .col-date {
    display: block;
  }
  .job-table-header .date-header-long {
    display: none;
  }
  .job-table-header .date-header-short {
    display: inline;
  }
  .job-table-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
  }
  .job-table-row .col-type,
  .job-table-row .col-status {
    display: none;
  }
  .job-table-row .col-date {
    display: flex;
    flex-shrink: 0;
    padding-top: var(--space-0);
  }
  .job-table-row .job-mobile-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-top: var(--space-1);
  }
  .job-table-row .job-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
  }
  .job-table-row .job-meta {
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
    margin-top: var(--space-0);
  }
}

.doc-text { max-height: 60vh; overflow: auto; white-space: pre-wrap; font-size: var(--type-secondary); }

/* Running tasks */
.live-run { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
.live-run:first-child { border-top: 0; }
.live-run.waiting { box-shadow: inset 3px 0 0 var(--warn); }
.live-run.stopping { pointer-events: none; }
.live-run-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border-radius: inherit;
  z-index: var(--z-inner);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.live-run-overlay .spinner {
  width: 22px;
  height: 22px;
  border-width: 3px;
  flex: 0 0 auto;
}
.live-run-overlay-text {
  font-size: var(--type-secondary);
  font-weight: var(--weight-medium);
  color: var(--text);
}
.live-run .main-col { min-width: 0; flex: 1 1 260px; color: var(--text); }
.live-run { min-width: 0; max-width: 100%; }
.live-run .title { overflow-wrap: anywhere; font-weight: var(--weight-medium); }
.live-run-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.live-run .meta { margin-top: var(--space-1); font-variant-numeric: tabular-nums; }
.live-run-progress { display: block; width: 100%; max-width: 320px; height: var(--space-1); margin-top: var(--space-2); border: 0; accent-color: var(--accent); }
.live-run-progress::-webkit-progress-bar { background: var(--border); border-radius: var(--r-pill); }
.live-run-progress::-webkit-progress-value { background: var(--accent); border-radius: var(--r-pill); }
.live-run-progress::-moz-progress-bar { background: var(--accent); border-radius: var(--r-pill); }
.live-run-doing { margin-top: var(--space-2); font-size: var(--type-secondary); color: var(--muted); overflow-wrap: anywhere; }
/* The newest output line can be one long unbroken path or URL; keep it to the card's width. */
.last-line { margin-top: var(--space-1); font-size: var(--type-secondary); color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
  display: inline-block;
  vertical-align: middle;
  margin-right: var(--space-2);
}
@media (max-width: 760px) { .live-run .row { width: 100%; } }
/* Job Lifecycle Stepper */
.job-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.job-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
  font-size: var(--type-secondary);
  white-space: nowrap;
  flex: 1 1 0;
  min-width: fit-content;
}
.job-step.active {
  color: var(--text);
  font-weight: var(--weight-medium);
}
.job-step.done {
  color: var(--text);
}
.job-step-dot {
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  font-size: var(--type-tag);
  font-weight: var(--weight-medium);
  flex-shrink: 0;
  background: var(--panel-2);
}
.job-step.active .job-step-dot {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.job-step.done .job-step-dot {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}
.job-step.attention .job-step-dot {
  border-color: var(--warn);
  background: var(--warn-soft);
  color: var(--warn);
}
.job-step.failed .job-step-dot {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
}
.job-step-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.job-step-title {
  font-size: var(--type-tag);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.job-step-sub {
  font-size: var(--type-tag);
  color: var(--muted);
  font-weight: var(--weight-regular);
}
.job-step-arrow {
  color: var(--border);
  font-size: var(--type-secondary);
  flex-shrink: 0;
  margin: 0 var(--space-1);
  user-select: none;
}
@media (max-width: 760px) {
  .job-stepper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2) var(--space-3);
  }
  .job-step-arrow { display: none; }
}

.job-hero-next-preview {
  font-size: var(--type-secondary);
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: var(--space-2);
  margin-top: var(--space-1);
  line-height: 1.4;
}
.job-hero-next-label {
  color: var(--muted);
  font-weight: var(--weight-medium);
  margin-right: var(--space-1);
}

.job-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  flex-wrap: wrap;
  padding: var(--container-pad-y) var(--container-pad-x);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.job-hero.tone-attention { border-color: var(--warn); background: var(--warn-soft); }
.job-hero.tone-working { border-color: var(--accent); background: var(--accent-soft); }
.job-hero.tone-done { border-color: var(--ok); background: var(--ok-soft); }
.job-hero.tone-failed { border-color: var(--bad); background: var(--bad-soft); }
.job-hero-main { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); min-width: 0; flex: 1 1 260px; }
.job-hero-title { margin: 0; font-size: var(--type-body); font-weight: var(--weight-bold); line-height: 1.3; color: var(--text); }
.job-hero-reason { margin: 0; font-size: var(--type-body); line-height: 1.45; overflow-wrap: anywhere; }
.job-hero-action { display: flex; align-items: center; flex-shrink: 0; }

/* Tasks Progress Bar */
.tasks-progress-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-1);
}
.progress-bar-container {
  flex: 1;
  height: 12px;
  background: var(--panel-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-pill);
  transition: width var(--motion-slow) ease;
}
.progress-text {
  font-size: var(--type-secondary);
  font-weight: var(--weight-medium);
  color: var(--text);
  white-space: nowrap;
}

/* Delta Card */
.delta-summary-line {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.delta-line {
  font-size: var(--type-secondary);
  font-family: var(--mono);
}
.delta-line.unsaved {
  color: var(--warn);
  font-weight: var(--weight-medium);
}
.delta-line.total {
  color: var(--text);
}
.delta-file-chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: var(--space-0) var(--space-2);
  border-radius: var(--r-xs);
  font-size: var(--type-secondary);
}

.sort-head { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.sort-head:hover { color: var(--text); }
.job-table-header .col-date { justify-self: end; text-align: right; }
.job-table-header .sort-head { min-height: var(--control-xs); text-transform: inherit; letter-spacing: inherit; }
.sort-arrow { margin-left: var(--space-1); font-size: var(--type-tag); }

/* Setup checklist */
.setup-full { max-width: 720px; }
.setup-progress { height: 6px; background: var(--panel-2); border-radius: var(--r-pill); overflow: hidden; margin-bottom: var(--space-3); }
.setup-progress > div { height: 100%; background: var(--accent); transition: width var(--motion-slow); }
.setup-group-h { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4) var(--space-2); }
.setup-group-h h3 { font-size: var(--type-tag); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.setup-item { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--container-pad-x); border-top: 1px solid var(--border); }
.card-b > .setup-item:only-child { padding: 0; border-top: 0; } /* already inside the card's inset */
.setup-item .main-col { flex: 1; min-width: 0; }
.setup-item .meta { color: var(--muted); font-size: var(--type-secondary); }
.setup-item.is-done .title { color: var(--muted); }
.onboarding-list > .item, .onboarding-list > .setup-item {
  display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto; align-items: start;
}
.onboarding-list > :is(.item, .setup-item) > :is(.pill, .setup-icon) { grid-column: 1; justify-self: start; white-space: normal; }
.onboarding-list > :is(.item, .setup-item) > .main-col { grid-column: 2; overflow-wrap: anywhere; }
.onboarding-list > :is(.item, .setup-item) :is(.title, .meta) { white-space: normal; overflow: visible; }
.onboarding-list > :is(.item, .setup-item) > :is(.side, .btn) { grid-column: 3; }
@media (max-width: 760px) {
  .onboarding-list > .item, .onboarding-list > .setup-item { grid-template-columns: minmax(0, 7rem) minmax(0, 1fr); }
  .onboarding-list > :is(.item, .setup-item) > :is(.side, .btn) { grid-column: 2; width: auto; justify-content: flex-start; justify-self: start; }
  .onboarding-list .btn { max-width: 100%; white-space: normal; text-align: left; }
}
/* Checklist rows lead with a 20px check, not a status pill: size the first column to it and keep the button in the row. */
.onboarding-list > .setup-item { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--space-3); align-items: start; }
.onboarding-list > .setup-item > .btn { grid-column: 3; justify-self: end; white-space: nowrap; }
.setup-icon { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); margin-top: var(--space-0); display: grid; place-items: center; font-size: var(--type-secondary); }
.setup-icon.todo { border-color: var(--accent); }
.setup-icon.done { background: var(--ok-solid); border-color: var(--ok-solid); color: var(--ok-solid-ink); }
.setup-hint { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); flex-wrap: wrap; }
.setup-hint code { background: var(--panel-2); padding: var(--space-1) var(--space-2); border-radius: var(--r-sm); font-size: var(--type-secondary); }
.setup-fab { position: fixed; right: calc(20px + env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: var(--z-float); --pct: 0; width: 56px; height: 56px; padding: 4px; border-radius: 50%; border: 0; box-shadow: var(--shadow); cursor: pointer; font: inherit;
  /* the ring: --pct of the border is blue, the rest is the track */
  background: conic-gradient(from 0deg, var(--accent) calc(var(--pct) * 1%), var(--border) 0); }
.setup-fab-core { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--panel); color: var(--text); font-size: var(--type-secondary); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.setup-fab[hidden], .setup-panel[hidden] { display: none; }
.setup-panel { position: fixed; right: 20px; bottom: 72px; z-index: var(--z-float); width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 640px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-2); }
.setup-panel-h { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.setup-panel-h .btn { margin-left: auto; }
.setup-panel-b { overflow: auto; padding-bottom: var(--space-2); }
.setup-panel-more { margin: var(--space-2) var(--space-4) 0; }
@media (max-width: 760px) {
  .setup-fab { right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .setup-panel { left: 16px; right: 16px; bottom: calc(128px + env(safe-area-inset-bottom)); width: auto; }
}

/* Configuration navigation and menu */
.nav-item-row {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}
.configuration-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--r-md);
  font: inherit;
  font-size: var(--type-secondary);
  text-align: left;
}
.configuration-menu-trigger:hover,
.configuration-menu-trigger.active,
.configuration-menu-trigger[aria-expanded="true"] {
  background: var(--panel-2);
  color: var(--accent);
}
.configuration-menu-trigger:focus-visible,
.configuration-context-menu button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.configuration-context-menu {
  position: fixed; /* fixed so the scrolling sidebar can't clip it */
  left: 242px;
  bottom: 16px;
  z-index: var(--z-menu);
  width: min(380px, calc(100vw - 268px));
  max-height: min(80vh, 680px);
  overflow-y: auto;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-3);
}
.configuration-context-menu[hidden] { display: none; }
.configuration-menu-group + .configuration-menu-group {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}
.configuration-menu-heading {
  padding: var(--space-1) var(--space-2);
  color: var(--muted);
  font-size: var(--type-tag);
  font-weight: var(--weight-bold);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.configuration-context-menu button {
  display: flex;
  flex-direction: column;
  gap: var(--space-0);
  width: 100%;
  padding: var(--space-2);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.configuration-context-menu button:hover:not(:disabled) { background: var(--panel-2); }
.configuration-context-menu button small { color: var(--muted); }
.configuration-context-menu button:disabled {
  cursor: not-allowed;
  opacity: .62;
}
@media (max-width: 760px) {
  .configuration-nav-item { flex-direction: column; align-items: stretch; }
  .configuration-context-menu {
    position: static; width: 100%; max-height: none;
    margin-top: var(--space-2); box-shadow: none;
  }
}

.configuration-page { display: flex; flex-direction: column; gap: var(--space-4); }
.configuration-card { overflow: hidden; }
.configuration-setting-list { display: flex; flex-direction: column; }
.configuration-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--container-pad-x);
  border-top: 1px solid var(--border);
}
.configuration-setting-row:first-child { border-top: 0; }
.card-b .configuration-setting-row { padding-left: 0; padding-right: 0; } /* already inside the card's inset */
.role-row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: center; }
.role-row select { width: 100%; }
.configuration-setting-row > * { min-width: 0; overflow-wrap: anywhere; } /* long emails, IPs and paths wrap inside the card */
.ai-provider .card-b.stack { gap: var(--space-2); }
.ai-tool-list { display: flex; flex-direction: column; }
.ai-tool { border-top: 1px solid var(--border); }
.ai-tool > summary { display: grid; grid-template-columns: minmax(0, 1fr) 130px 104px 200px; align-items: center; gap: var(--space-3); min-height: var(--control-lg); padding: var(--space-2) var(--container-pad-x); cursor: pointer; list-style: none; }
.ai-tool > summary::-webkit-details-marker { display: none; }
.ai-tool > summary .pill { justify-self: start; }
.ai-tool-title { display: flex; flex-direction: column; gap: var(--space-0); min-width: 0; }
.ai-tool-name { min-width: 0; font-size: var(--type-body); font-weight: var(--weight-medium); }
.ai-tool-count { color: var(--muted); font-size: var(--type-secondary); }
.model-new-count { color: var(--accent); font-weight: var(--weight-medium); }
.model-tree-item.model-new .model-id { color: var(--accent); }
.yolo-switch { display: inline-flex; align-items: center; gap: var(--space-2); justify-self: start; min-height: var(--control-sm); cursor: pointer; font-size: var(--type-tag); font-weight: var(--weight-bold); letter-spacing: .04em; color: var(--muted); }
.yolo-switch input { appearance: none; position: relative; width: 34px; height: 20px; margin: 0; border-radius: var(--r-pill); background: var(--border); cursor: pointer; transition: background var(--motion-fast); }
.yolo-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--panel); box-shadow: var(--shadow); transition: transform var(--motion-fast); }
.yolo-switch input:checked { background: var(--ok); }
.yolo-switch input:checked::after { transform: translateX(14px); }
.yolo-switch input:checked + span { color: var(--ok); }
/* Home: YOLO all sits apart from the job filters, at the far end of the row. */
/* Home's Jobs header: the title and YOLO all on one row, YOLO all at the far right; on desktop the filters sit between them. */
.home-jobs-h > h2 { order: 0; }
.home-jobs-h > .home-jobs-filters { order: 1; margin-left: auto; }
.home-jobs-h > .home-yolo { order: 2; white-space: nowrap; padding-left: var(--space-3); border-left: 1px solid var(--border); }
@media (max-width: 760px) {
  .home-jobs-h > .home-yolo { order: 1; margin-left: auto; padding-left: 0; border-left: 0; }
  .home-jobs-h > .home-jobs-filters { order: 2; flex-basis: 100%; margin-left: 0; }
}
.ai-tool-details .ai-key-row { padding: var(--space-3) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ai-tool-cost { color: var(--muted); font-size: var(--type-secondary); text-align: right; justify-self: end; }
@media (max-width: 760px) {
  .ai-tool > summary { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--space-1); }
  .ai-tool > summary .pill, .ai-tool > summary .yolo-switch { justify-self: start; }
  .ai-tool > summary > .pill:nth-child(2) { justify-self: end; } /* the status sits beside the name; YOLO and cost share the next line */
  .role-row { grid-template-columns: minmax(0, 1fr); }
}
.ai-tool-details { padding: 0 var(--container-pad-x) var(--space-4); font-size: var(--type-body); }
.ai-tool-details > p { margin: 0; }
.ai-ready-note { color: var(--ok); }
.ai-empty-group { padding: var(--space-4) var(--container-pad-x); font-size: var(--type-body); }
.ai-machine-status-list { display: flex; flex-direction: column; }
.ai-machine-status { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--container-pad-x); border-top: 1px solid var(--border); }
.ai-machine-status > * { min-width: 0; }
.ai-machine-status details { flex: 1; }
.ai-machine-status details > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); cursor: pointer; list-style: none; }
.ai-machine-status details > summary::-webkit-details-marker { display: none; }
.ai-machine-provider-list { grid-column: 1 / -1; padding: var(--space-2) 0 0 var(--space-4); color: var(--muted); }
.ai-machine-provider-list li { padding: var(--space-1) 0; }
.ai-machine-status.is-unreachable { color: var(--muted); }
.plain-list { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-1); }
.configuration-setting-row .main-col { display: flex; flex-direction: column; gap: var(--space-1); }
.configuration-setting-row small { color: var(--muted); }
.configuration-status { color: var(--muted); font-size: var(--type-secondary); }
.configuration-chooser {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
.configuration-chooser-group {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.configuration-chooser-group h2 { margin-bottom: var(--space-3); font-size: var(--type-body); }
.configuration-chooser-list { display: flex; flex-direction: column; gap: var(--space-2); }
.configuration-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-0);
  width: 100%;
  padding: var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  text-align: left;
}
.configuration-choice[href]:hover { border-color: var(--accent); }
.configuration-choice span,
.configuration-choice small { color: var(--muted); }
.configuration-choice:disabled { cursor: not-allowed; opacity: .68; }
.configuration-document-list { margin: 0; padding: 0; list-style: none; }
.configuration-document-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
}
.configuration-document-list li:first-child { border-top: 0; }
@media (max-width: 760px) {
  .configuration-chooser { grid-template-columns: minmax(0, 1fr); }
  .configuration-setting-row { align-items: flex-start; flex-direction: column; }
}

/* Highlight flash when jumped to */
@keyframes highlightGlow {
  0% { box-shadow: 0 0 0 2px var(--accent); }
  50% { box-shadow: 0 0 16px var(--accent); }
  100% { box-shadow: none; }
}
.highlight-flash {
  animation: highlightGlow 1.8s ease;
}

/* Connections + link picker */
.connections-section { padding-top: var(--space-5); border-top: 1px solid var(--border); scroll-margin-top: var(--space-7); }
.connections-sections > .connections-section:first-child { padding-top: 0; border-top: 0; }
.connections-section-title,
.connections-plugin-group > h3 { margin: 0 0 var(--space-4); font-size: var(--type-section); font-weight: var(--weight-bold); }
.connections-plugin-group + .connections-plugin-group { margin-top: var(--space-5); }
#connections-alerts .card-h { flex-wrap: wrap; }
@media (max-width: 760px) {
  .connections-section { scroll-margin-top: calc(80px + env(safe-area-inset-top)); }
}

.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.conn-name { font-size: var(--type-section); margin-right: auto; display: inline-flex; align-items: center; gap: var(--space-2); }
.brand-icon { width: 14px; height: 14px; flex-shrink: 0; display: inline-block; vertical-align: -1px; border-radius: var(--r-xs); }
.conn-name .brand-icon { width: 18px; height: 18px; }
.conn-summary { font-size: var(--type-secondary); color: var(--muted); word-break: break-all; }
.link-picker .lp-results { max-height: 220px; overflow: auto; margin-top: var(--space-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.link-picker .lp-results:empty { display: none; }
.link-picker .lp-result { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; font: inherit; color: inherit; }
.link-picker .lp-result:hover { background: var(--panel-2); }
.link-picker .lp-chips { margin-top: var(--space-2); gap: var(--space-2); }
.chip { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3); border-radius: var(--r-pill); background: var(--panel-2); border: 1px solid var(--border); font-size: var(--type-secondary); }
.chip:not(:has(button)) { padding: var(--space-1) var(--space-3); }
.chip button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0 var(--space-2); font-size: var(--type-secondary); }
.link-picker-empty { font-size: var(--type-secondary); }
.conn-options { gap: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.conn-options-h { font-size: var(--type-tag); text-transform: uppercase; letter-spacing: .04em; }
.conn-options input[type="text"] { width: 100%; }
.conn-auth-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--space-3);
}
.conn-auth-box p {
  margin: 0;
  font-size: var(--type-secondary);
}
.conn-auth-divider {
  font-size: var(--type-secondary);
  color: var(--muted);
}
/* Container padding consistency standard:
   Ensures connection cards, configuration cards, and cards on the connections page
   strictly use the canonical --container-pad-x (20px desktop, 16px mobile) and
   --container-pad-y (16px desktop, 12px mobile) matching the home page. */
.conn-card .card-b,
body[data-page="connections"] .card-b,
body[data-page="connections"] .configuration-card .card-b {
  padding: var(--container-pad-y) var(--container-pad-x);
}

/* Recommended installs section */
.rec-section-header { margin-top: var(--space-6); margin-bottom: var(--space-3); }
.rec-section-title { font-size: var(--type-section); font-weight: var(--weight-medium); margin: 0; }
.rec-subhead { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-5); margin-bottom: var(--space-2); }
.rec-subhead h3 { margin: 0; font-size: var(--type-body); font-weight: var(--weight-bold); }
.rec-callout {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}
.rec-callout-title { font-weight: var(--weight-medium); display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); }
.conn-card .setup-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-2);
}
.conn-card .setup-hint code {
  word-break: break-all;
  max-width: calc(100% - 60px);
}

/* Model Tree (expandable tree-style hierarchy) */
.model-tree {
  margin-top: var(--space-3);
  border-top: 1px solid var(--border);
  padding-top: var(--space-2);
}
.model-tree-summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  padding: var(--space-1) 0;
  font-size: var(--type-secondary);
  user-select: none;
}
.model-tree-content {
  padding: var(--space-2) 0 var(--space-1) var(--space-1);
}
.model-tree-branch {
  list-style: none;
  padding: 0 0 0 var(--space-3);
  margin: 0 0 0 var(--space-1);
  border-left: 2px solid var(--border);
}
.model-tree-item {
  position: relative;
  padding: var(--space-1) 0 var(--space-1) var(--space-3);
}
.model-tree-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-3) - 2px);
  top: 50%;
  width: var(--space-3);
  height: 2px;
  background: var(--border);
}
.model-tree-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: var(--type-secondary);
}
.model-tree-row .model-id {
  font-size: var(--type-secondary);
}
.model-tree-row .model-label {
  font-size: var(--type-secondary);
}
.model-tree-row .model-caps {
  color: var(--muted);
  font-size: var(--type-tag);
  margin-left: auto;
}
@media (max-width: 760px) {
  .model-tree-row .model-caps {
    margin-left: 0;
    width: 100%;
  }
}

/* Home header: branch on its own row, stats + language mix beneath it */
.status-line.status-stack { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.status-stack .status-stats { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

/* Start a new project */
body[data-page="new-project"] #page-sub { margin-top: var(--space-2); }
.np-stepper { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--type-secondary); }
.np-step { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--muted); }
.np-step.on { color: var(--text); font-weight: var(--weight-medium); }
.np-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: var(--type-tag); }
.np-step.on .np-dot { border-color: var(--accent); }
.np-step.done .np-dot { background: var(--ok-solid); border-color: var(--ok-solid); color: var(--ok-solid-ink); }
.np-line { width: 24px; height: 2px; background: var(--border); }
.np-form { max-width: 720px; }
.np-section-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  min-width: 0;
}
.np-section-legend {
  font-size: var(--type-body);
  font-weight: var(--weight-medium);
  color: var(--text);
  padding: 0 var(--space-2);
  margin: 0;
}
.np-more > summary { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-md); padding: 0; cursor: pointer; list-style: none; }
.np-more > summary::-webkit-details-marker { display: none; }
.np-more > summary::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform var(--motion-fast) ease;
}
.np-more[open] > summary::before { transform: rotate(45deg); }
.np-more[open] > summary { margin-bottom: var(--space-3); }
.np-section-desc {
  font-size: var(--type-secondary);
  color: var(--muted);
  margin: 0 0 var(--space-2);
}
.np-hosts { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.np-host { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-4); border: 2px solid var(--border); border-radius: var(--r-lg); cursor: pointer; position: relative; }
.np-host.on { border-color: var(--accent); background: var(--panel-2); }
.np-host input { position: absolute; opacity: 0; pointer-events: none; }
.np-host small { color: var(--muted); }
.np-gh { padding: var(--space-3) var(--space-3); border-radius: var(--r-md); font-size: var(--type-body); }
.np-gh.ok { background: var(--ok-soft); }
.np-gh.warn { background: var(--warn-soft); }

.project-card[role="button"] { cursor: pointer; }
.project-card[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Job conversation */
.chat-thread { display: flex; flex-direction: column; gap: var(--space-3); max-height: 420px; overflow-y: auto; }
.chat-msg { display: flex; flex-direction: column; gap: var(--space-0); padding: var(--space-2) var(--space-3); border-radius: var(--r-md); background: var(--panel-2); max-width: 90%; }
.chat-msg.user { align-self: flex-end; background: var(--accent-soft); }
.chat-who { font-size: var(--type-tag); font-weight: var(--weight-medium); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--type-body); }
#notify-btn[hidden] { display: none; }
.assumptions { margin: 0 0 var(--space-2); padding-left: var(--space-5); } .assumptions li { margin: var(--space-1) 0; }

/* Feature map */
.fmap { position: relative; display: flex; flex-direction: row; gap: 56px; align-items: flex-start; overflow-x: auto; padding-bottom: var(--space-2); }
.fmap-links { position: absolute; inset: 0; pointer-events: none; }
.fmap-link { fill: none; stroke: var(--accent); stroke-width: 1.75; opacity: 0.55; }
.fmap-col { position: relative; display: flex; flex-direction: column; gap: var(--space-3); min-width: 200px; flex: 0 0 auto; }
.fmap-col-h { font-size: var(--type-tag); font-weight: var(--weight-medium); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.fmap-node { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); padding: var(--space-3) var(--space-3); border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); background: var(--panel); color: inherit; text-decoration: none; font-size: var(--type-secondary); }
.fmap-node:hover { border-color: var(--accent); }
.fmap-node.tone-done { border-left-color: var(--ok); }
.fmap-node.tone-working { border-left-color: var(--accent); }
.fmap-wait { color: var(--warn); font-size: var(--type-secondary); }
@media (max-width: 760px) {
  .fmap { flex-direction: column; gap: var(--space-5); overflow-x: visible; }
  .fmap-col { min-width: 0; }
}

/* Test cases */
.tc-row { display: block; }
.tc-row > summary { display: grid; grid-template-columns: 112px 84px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); cursor: pointer; }
.tc-row > summary .pill { justify-self: start; }
@media (max-width: 760px) { .tc-row > summary { grid-template-columns: auto 1fr; } .tc-title { grid-column: 1 / -1; order: 3; } }
.tc-id { font-size: var(--type-secondary); color: var(--muted); }
.tc-title { min-width: 0; overflow-wrap: anywhere; }
.tc-body { padding: var(--space-2) 0 var(--space-1) var(--space-2); font-size: var(--type-secondary); }
.tc-body ul, .tc-body ol { margin: var(--space-1) 0 0; padding-left: var(--space-5); }
.tc-area-h { padding: var(--space-3) var(--space-4) var(--space-1); font-size: var(--type-tag); font-weight: var(--weight-medium); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.tc-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); border-top: 1px solid var(--border); padding-top: var(--space-2); }
.row .chip:not(:has(button)) { padding-right: var(--space-3); }

/* Measure */
.kpi-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto auto; align-items: center; gap: var(--space-3); }
.kpi-row .kpi-log { grid-column: 1 / -1; }
.kpi-latest { display: flex; flex-direction: column; font-size: var(--type-secondary); }
.kpi-log summary { cursor: pointer; font-size: var(--type-secondary); color: var(--muted); }
.kpi-entry { padding: var(--space-1) 0; font-size: var(--type-secondary); }
@media (max-width: 760px) { .kpi-row { grid-template-columns: 1fr auto; } .kpi-row .kpi-latest, .kpi-row .side { grid-column: 1 / -1; } }

/* Accessibility and phone layout */
:where(a, button, summary, [tabindex], select, input, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#page-title:focus, #view:focus { outline: none; }
.skip-link { position: fixed; left: 8px; top: -48px; z-index: var(--z-menu); padding: var(--space-2) var(--space-4); border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink); border: 0; font: inherit; }
.skip-link:focus { top: 8px; }
.tc-row > summary, .kpi-log summary { min-height: var(--control-sm); padding-block: var(--space-2); }
@media (max-width: 760px) { .fmap-node { width: 100%; } }

/* spacing utilities (replacing repeated inline styles) */
.mb-16 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-2); }
.mt-16 { margin-top: var(--space-4); }
.mt-12 { margin-top: var(--space-3); }
.mt-8 { margin-top: var(--space-2); }
.gap-8 { gap: var(--space-2); }
.gap-12 { gap: var(--space-3); }
.gap-16 { gap: var(--space-4); }
.gap-4 { gap: var(--space-1); }
.gap-6 { gap: var(--space-1-5); }
.mt-4 { margin-top: var(--space-1); }
.mb-12 { margin-bottom: var(--space-3); }
.pt-8 { padding-top: var(--space-2); }
.pt-12 { padding-top: var(--space-3); }
.ml-8 { margin-left: var(--space-2); }
.flex-wrap { flex-wrap: wrap; }
.cursor-pointer { cursor: pointer; }
.text-danger { color: var(--bad); }
.m-0 { margin: 0; }
select.inline-select { width: auto; min-width: 140px; max-width: 100%; }
.push-right { margin-left: auto; padding-right: var(--space-3); }
.improve-banner { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: var(--space-3) var(--space-4); }
.diffstat-details { border-top: 1px solid var(--border); }
.diffstat-details > summary { padding: var(--space-2) var(--space-4); font-size: var(--type-secondary); color: var(--muted); cursor: pointer; }
.diffstat-details > pre.file { margin: 0; border: none; border-radius: 0; }
textarea.code-editor { font-size: var(--type-secondary); line-height: 1.5; resize: vertical; }
textarea.code-editor.tall { min-height: 220px; }
.block { display: block; }
.radio-card { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); cursor: pointer; }
.radio-card > input { margin-top: var(--space-1); }
.between { justify-content: space-between; }
.wrap-anywhere { overflow-wrap: anywhere; }
.indented-list { margin-bottom: 0; padding-left: var(--space-4); }
.divider-top { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.user-select-all { user-select: all; -webkit-user-select: all; }
.flex-1 { flex: 1; }

.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); flex-wrap: wrap; }
.home-new-job-btn {
  position: fixed;
  top: var(--space-6);
  right: var(--space-7);
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-2);
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}
.home-new-job-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-3);
}
.home-new-job-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow);
}
.topbar-actions:has(.home-new-job-btn) {
  min-width: 120px;
  min-height: var(--control-md);
}
.test-run-all-btn, .test-expand-coverage-btn { white-space: nowrap; }
.warn-link { color: var(--warn); font-weight: var(--weight-medium); }
.badge.good { background: var(--ok-solid); color: var(--ok-solid-ink); }
.badge.muted-badge { background: var(--panel-2); color: var(--muted); }

/* Scope check */
.scope-finding { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.scope-files { margin: 0; padding-left: var(--space-5); font-size: var(--type-secondary); }
.scope-notice-clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: var(--type-secondary);
  color: var(--muted);
  flex-wrap: wrap;
}
.scope-notice-clean .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; text-align: left; }

.help-steps { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }
.help-terms { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); }
.help-terms dt { font-weight: var(--weight-bold); }
.help-terms dd { margin: 0; color: var(--muted); }
.help-faq details { padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.help-faq details:first-child { border-top: 0; }
.help-faq summary { cursor: pointer; font-weight: var(--weight-medium); min-height: var(--control-xs); }
.help-faq p { margin: var(--space-2) 0 0; color: var(--muted); }
@media (max-width: 760px) {
  .help-terms { grid-template-columns: minmax(0, 1fr); gap: var(--space-0); }
  .help-terms dd { margin-bottom: var(--space-2); }
}

/* Command palette */
.search-btn {
  margin: 0 var(--space-2);
  padding: var(--space-2) var(--space-3);
  justify-content: space-between;
  color: var(--muted);
  font-weight: var(--weight-medium);
  font-size: var(--type-secondary);
  background: var(--panel);
}
.search-btn:hover {
  background: var(--panel-2);
  color: var(--text);
}
.search-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.palette-foot kbd { font: inherit; font-size: var(--type-tag); padding: 1px var(--space-2); border: 1px solid var(--border); border-radius: var(--r-xs); background: var(--panel-2); color: var(--muted); }
.search-btn kbd {
  font: inherit;
  font-size: var(--type-tag);
  padding: 1px var(--space-3) 1px var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--panel-2);
  color: var(--muted);
  flex-shrink: 0;
}
@media (max-width: 760px), (pointer: coarse) {
  .search-btn kbd { display: none !important; }
}
.palette-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: calc(var(--z-palette) - 1); }
.palette { position: fixed; z-index: var(--z-palette); left: 50%; top: 14vh; transform: translateX(-50%); width: min(640px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-3); overflow: hidden; }
.palette input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: var(--space-4) var(--space-4); font-size: var(--type-body); background: transparent; color: var(--text); outline: none; }
.palette ul { list-style: none; margin: 0; padding: var(--space-2); overflow-y: auto; }
.palette-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--r-md); cursor: pointer; min-height: var(--control-md); }
.palette-item.active { background: var(--accent-soft); }
.palette-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-hint { font-size: var(--type-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.palette-empty { padding: var(--space-4); }
.palette-foot { padding: var(--space-2) var(--space-4); font-size: var(--type-secondary); border-top: 1px solid var(--border); }
@media (max-width: 760px) { .palette { top: 8vh; } .palette-hint { display: none; } .palette-item { grid-template-columns: minmax(0, 1fr) auto; } }
.palette[hidden], .palette-backdrop[hidden] { display: none; }

.fold > summary { cursor: pointer; list-style: none; min-height: var(--control-lg); }
.fold > summary::-webkit-details-marker { display: none; }
/* Disclosure: a chevron before the title (it turns when open) and the count beside the title, as in Primer. */
.fold > summary.card-h { justify-content: flex-start; flex-wrap: nowrap; gap: var(--space-2); min-height: calc(var(--control-sm) + 2 * var(--space-3)); }
.fold > summary::before {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 var(--space-1) 0 var(--space-0);
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg);
  transition: transform var(--motion-fast) ease;
}
.fold[open] > summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .fold > summary::before { transition: none; } }

@media (min-width: 761px) and (max-height: 860px) {
  .sidebar { gap: var(--space-2); padding: var(--space-3) var(--space-4); }
  .nav.nav-secondary > a { padding-top: var(--space-1); padding-bottom: var(--space-1); }
  .nav-secondary .label { padding: var(--space-0) var(--space-3) var(--space-0); }
  .nav-secondary .label { margin-top: var(--space-2); padding-top: var(--space-2); }
}

/* Inline diff */
.diff-files { display: flex; flex-direction: column; gap: var(--space-1); }
.diff-file > summary { cursor: pointer; padding: var(--space-1) 0; min-height: var(--control-xs); overflow-wrap: anywhere; }
.diff { margin: var(--space-1) 0 var(--space-2); padding: var(--space-2) 0; max-height: 420px; overflow: auto; background: var(--panel-2); border-radius: var(--r-md); font-size: var(--type-secondary); line-height: 1.5; }
.diff-line { display: block; padding: 0 var(--space-3); white-space: pre; min-height: 1.5em; }
.diff-line.add { background: var(--ok-soft); color: var(--text); }
.diff-line.del { background: var(--bad-soft); color: var(--text); }
.diff-line.hunk { color: var(--muted); }
.task-controls { display: flex; gap: var(--space-1); flex-wrap: wrap; justify-content: flex-end; }
.task-more > summary { min-width: var(--control-sm); justify-content: center; padding-inline: var(--space-2); letter-spacing: 0.1em; }
.task-more .more-menu { min-width: 160px; }
.task-number.is-done { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.progress-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); min-width: 0; }
.progress-now:empty { display: none; }
.progress-now strong { min-width: 0; overflow-wrap: anywhere; }
.progress-now .label { text-transform: uppercase; font-size: var(--type-tag); font-weight: var(--weight-bold); letter-spacing: 0.05em; color: var(--muted); }
.progress-foot { font-size: var(--type-secondary); border-top: 1px solid var(--border); padding-top: var(--space-2); overflow-wrap: anywhere; }
.empty-state { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2) 0; }

/* New job */
.nj-logs { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.nj-logs .check small { display: block; color: var(--muted); }
.upload-chips { gap: var(--space-2); flex-wrap: wrap; }
input[type="file"] { font: inherit; color: var(--muted); max-width: 100%; }
input[type="file"]::file-selector-button { font: inherit; padding: var(--space-2) var(--space-3); margin-right: var(--space-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); color: var(--text); cursor: pointer; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }

[hidden] { display: none !important; }

/* Product documents */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.md { line-height: 1.6; overflow-wrap: anywhere; }
.md h2, .md h3, .md h4 { margin: var(--space-5) 0 var(--space-2); }
.md h2:first-child { margin-top: 0; }
.md p { margin: 0 0 var(--space-3); }
.md ul, .md ol { margin: 0 0 var(--space-3); padding-left: var(--space-6); }
.md blockquote { margin: 0 0 var(--space-3); padding: var(--space-1) var(--space-3); border-left: 3px solid var(--border); color: var(--muted); }
.md pre { padding: var(--space-3) var(--space-3); background: var(--panel-2); border-radius: var(--r-md); overflow-x: auto; }
.md table { border-collapse: collapse; margin: 0 0 var(--space-3); }
.md th, .md td { border: 1px solid var(--border); padding: var(--space-1) var(--space-3); text-align: left; }
.md code { font-family: var(--mono); font-size: 0.9em; }
#pd-text { font-family: var(--mono); font-size: var(--type-secondary); width: 100%; }

/* Signing in */
.signin-card.signing-in { align-items: center; text-align: center; gap: var(--space-3); }
.signin-card.signing-in h2 { margin: 0; font-size: var(--type-section); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--accent); } }

/* Product requirements */
body[data-page="product"] .topbar {
  align-items: center;
}

@media (min-width: 861px) {
  body[data-page="product"] .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: var(--space-4);
  }
  body[data-page="product"] .topbar-text {
    grid-column: 1;
  }
  body[data-page="product"] .topbar-actions {
    grid-column: 2;
    justify-content: center;
    align-self: center;
  }
}

@media (max-width: 860px) {
  body[data-page="product"] .topbar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  body[data-page="product"] .topbar-actions {
    justify-content: center;
    width: 100%;
  }
}

body[data-page="product"] .topbar-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

body[data-page="product"] .topbar-actions .btn {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

body[data-page="product"] .topbar-actions .btn:hover {
  filter: brightness(1.06);
  background: var(--accent);
}

.prd-file-link {
  font-size: var(--type-body);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prd-file-link:hover {
  filter: brightness(1.15);
}

.product-pitch { display: block; margin: 0; font-size: var(--type-body); line-height: 1.5; color: inherit; text-decoration: none; }
.product-pitch:hover, .card-title-link:hover { text-decoration: underline; }
.card-title-link { color: inherit; text-decoration: none; }
.prd-notice .row { margin-top: var(--space-2); }
.prd-designs { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.prd-design { display: block; margin: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--panel-2); }
.prd-design img { display: block; max-height: 160px; max-width: 100%; min-width: 80px; min-height: 60px; object-fit: contain; }
.prd-version .prd-diff { margin-top: var(--space-2); }
.prd-version .prd-diff[hidden] { display: none; }
.prd-features-edit { display: flex; flex-direction: column; gap: var(--space-2); }
.prd-feature-row { display: flex; align-items: center; gap: var(--space-2); }
.prd-feature-bullet { color: var(--muted); font-size: var(--type-section); line-height: 1; user-select: none; width: 14px; text-align: center; flex-shrink: 0; }
.prd-feature-input { flex: 1; min-width: 0; }
.prd-feature-del { flex-shrink: 0; width: var(--control-sm); height: var(--control-sm); min-height: var(--control-sm); padding: 0; color: var(--muted); font-size: var(--type-body); line-height: 1; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.prd-feature-del:hover { color: var(--bad); background: var(--bad-soft); }
.prd-model-picker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--type-secondary);
  margin-left: auto;
}
.prd-model-select {
  width: auto;
  max-width: 260px;
  min-height: var(--control-md);
  padding: var(--space-1) var(--space-2);
  font-size: var(--type-secondary);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
}
@media (max-width: 760px) {
  .prd-model-picker {
    margin-left: 0;
    width: 100%;
    margin-top: var(--space-1);
  }
  .prd-model-select {
    flex: 1;
    max-width: 100%;
    min-height: var(--control-md);
  }
}

/* Docs */
.docs-search { margin: 0 0 var(--space-4); }
.docs-search input { width: 100%; }
.doc-blurb { color: var(--muted); }
.doc-row[hidden] { display: none; }
.md .task { font-size: inherit; margin-right: var(--space-1); }
.md .task.done { color: var(--ok); }
.md li > ul { margin: var(--space-1) 0 var(--space-1); }
#page-sub > a:first-child { display: inline-flex; align-items: center; min-height: var(--control-xs); }
@media (max-width: 760px) { #page-sub > a:first-child { min-height: var(--control-md); } }

/* Working on it: prominent, with a spinner */
#prd-panel:empty { display: none; }
.prd-busy { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-4); border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); }
.prd-busy strong { display: block; font-size: var(--type-body); font-weight: var(--weight-bold); }
.prd-busy-sub { margin-top: var(--space-1); font-size: var(--type-secondary); color: var(--text); opacity: .8; }
.prd-busy .spinner { flex: 0 0 auto; border-color: var(--bg); border-top-color: var(--accent); width: 32px; height: 32px; border-width: 4px; }
.prd-busy .btn { margin-left: auto; flex-shrink: 0; }

/* Proposed PRD sections review */
.proposal-summary {
  padding: var(--space-3) var(--space-4);
  background: var(--panel-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.proposal-summary-title {
  margin-bottom: var(--space-2);
  color: var(--text);
  font-size: var(--type-secondary);
}
.proposal-summary .md ul {
  margin: 0;
  padding-left: var(--space-4);
}
.proposal-summary .md li {
  margin-bottom: var(--space-1);
}
.proposal-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}
.proposal-section-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
}
.proposal-section-item .card-h {
  background: var(--panel-2);
}
.proposal-sec-title {
  margin: 0;
  font-size: var(--type-body);
  font-weight: var(--weight-bold);
}

/* Drop zone for an existing PRD */
.prd-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1); padding: var(--space-6) var(--space-4); border: 2px dashed var(--border); border-radius: var(--radius); background: var(--panel-2); text-align: center; cursor: pointer; transition: border-color var(--motion-fast), background var(--motion-fast); }
.prd-drop:hover, .prd-drop:focus-visible { border-color: var(--accent); }
.prd-drop.over { border-color: var(--accent); background: var(--accent-soft); }
/* One dashed container: the title, the Browse button, the drop hint and the accepted types all sit inside it. */
.prd-drop.file-picker { width: 100%; min-width: 0; min-height: calc(3 * var(--control-xl)); gap: var(--space-3); padding: var(--space-6) var(--space-5); border: 2px dashed var(--border); border-radius: var(--r-lg); background: var(--panel); color: var(--text); font: inherit; text-align: center; }
.file-picker-title { font-size: var(--type-body); font-weight: var(--weight-bold); overflow-wrap: anywhere; }
.file-picker-target { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); width: 100%; }
.file-picker-action { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-lg); padding: var(--space-3) var(--space-5); border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: var(--type-body); font-weight: var(--weight-bold); }
.file-picker .drop-hint, .file-picker-types { font-size: var(--type-secondary); color: var(--muted); }
.file-picker-types { display: block; margin-top: var(--space-2); line-height: 1.45; max-width: 440px; }
.prd-drop.file-picker:hover, .prd-drop.file-picker:focus-visible, .field:has(input[type="file"]:focus-visible) .prd-drop.file-picker, .prd-drop.file-picker.over { border-color: var(--accent); background: var(--accent-soft); }
.file-picker:focus-visible, .field:has(input[type="file"]:focus-visible) .file-picker { outline: 2px solid var(--accent); outline-offset: 2px; }
.import-options .reference-file-picker { grid-column: 1 / -1; }
.import-options:has(.reference-file-picker) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .import-options:has(.reference-file-picker) { grid-template-columns: minmax(0, 1fr); } }
.prd-drop.reference-file-picker { background: var(--panel); }
.prd-drop.reference-file-picker:hover, .prd-drop.reference-file-picker:focus-visible, .prd-drop.reference-file-picker.over { border-color: var(--accent); background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { .prd-drop.file-picker { transition: none; } }
@media (pointer: coarse) { .prd-drop .drop-hint { display: none; } }

/* Messages: everything the app tells you, over the top of the page (see messages.js) */
.messages {
  position: fixed; z-index: var(--z-toast); inset: auto; top: calc(var(--space-4) + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 2 * var(--space-4))); margin: 0; padding: 0; border: 0; background: transparent; color: inherit; overflow: visible;
  display: flex; flex-direction: column; gap: var(--space-2); pointer-events: none;
}
.messages[hidden] { display: none; }
.msg {
  --kind: var(--accent);
  pointer-events: auto; display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  background: var(--panel); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--kind); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  font-size: var(--type-body); line-height: 1.4;
}
.msg-success { --kind: var(--ok); }
.msg-info { --kind: var(--accent); }
.msg-warning { --kind: var(--warn); }
.msg-cancel { --kind: var(--warn); }
.msg-error { --kind: var(--bad); }
.msg-icon { flex: 0 0 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--kind); color: var(--panel); font-size: var(--type-secondary); font-weight: var(--weight-bold); }
.msg-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); overflow-wrap: anywhere; }
.msg-text { flex: 1 1 14ch; }
.msg-actions { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); }
.msg-action { display: inline-flex; align-items: center; min-height: var(--control-xs); padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); color: var(--text); font: inherit; font-size: var(--type-secondary); font-weight: var(--weight-medium); text-decoration: none; cursor: pointer; }
.msg-action:hover { border-color: var(--kind); }
.msg-close { flex: 0 0 auto; width: var(--control-xs); height: var(--control-xs); margin: 0; border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted); font-size: var(--type-secondary); cursor: pointer; }
.msg-close:hover { background: var(--panel-2); color: var(--text); }
/* Messages slide down into place and slide back up as they go. */
.msg-new { animation: msg-in var(--motion-medium) ease-out; }
.msg-out { animation: msg-out var(--motion-fast) ease-in forwards; pointer-events: none; }
@keyframes msg-in { from { opacity: 0; transform: translateY(calc(-1 * var(--space-6))); } }
@keyframes msg-out { to { opacity: 0; transform: translateY(calc(-1 * var(--space-6))); } }
@media (prefers-reduced-motion: reduce) { .msg-new, .msg-out { animation: none; } }

/* account (hosted app): your computers and adding one */
.account-card { max-width: 640px; gap: var(--space-5); }
.account-title { margin: 0; font-size: var(--type-section); font-weight: var(--weight-bold); }
.account-sub { margin: var(--space-2) 0 0; }
.account-message { margin: var(--space-3) 0 0; padding: var(--space-2) var(--space-3); border-radius: var(--r-md); background: var(--panel-2); border: 1px solid var(--border); }
.account-troubleshoot {
  margin: var(--space-3) 0 0;
  padding: var(--space-3);
  border-radius: var(--r-md);
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.account-troubleshoot-header {
  font-size: var(--type-body);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
/* Addresses, commands and error text are long unbroken strings: wrap them inside the card, never past its edge. */
.account-card, .account-troubleshoot { min-width: 0; }
.account-card code, .account-card pre, .account-message, .account-troubleshoot p, .account-troubleshoot-header strong { overflow-wrap: anywhere; }
.account-card pre { white-space: pre-wrap; }
.account-troubleshoot-details {
  margin-top: var(--space-2);
  font-size: var(--type-secondary);
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: var(--space-2);
}
.account-troubleshoot-details summary {
  cursor: pointer;
  font-weight: var(--weight-medium);
  color: var(--text);
  margin-bottom: var(--space-2);
}
.account-troubleshoot-details ul {
  margin: var(--space-1) 0 0;
  padding-left: var(--space-4);
}
.account-troubleshoot-details li {
  margin-bottom: var(--space-2);
  line-height: 1.4;
}
.account-machines { display: flex; flex-direction: column; gap: var(--space-4); }
.account-machine { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3);
  padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel-2); }
.account-machine-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.account-machine-heading strong { overflow-wrap: anywhere; min-width: 0; }
.account-machine-meta, .account-connection-error, .account-machine .account-update { margin: 0; font-size: var(--type-secondary); line-height: 1.5; }
.account-connection-error { color: var(--warn); }
.account-machine-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-1); min-width: 0; }
.account-machine-more { position: relative; }
.account-machine-more > summary { cursor: pointer; min-width: 80px; }
.account-machine-more[open] > summary::before { position: static; inset: auto; z-index: auto; background: transparent; cursor: inherit; }
.account-machine-menu { position: absolute; z-index: var(--z-menu); top: calc(100% + var(--space-2)); left: 0;
  width: min(320px, calc(100vw - 120px)); display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3);
  padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); box-shadow: var(--shadow-2); }
.account-machine-menu > .btn { justify-content: flex-start; }
.account-machine-menu summary { cursor: pointer; font-size: var(--type-secondary); }
.account-machine-menu p, .account-machine-menu ul { margin: var(--space-3) 0 0; font-size: var(--type-secondary); line-height: 1.5; }
.account-machine-menu ul { padding-left: var(--space-4); }
.account-connection-help { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.account-machine-menu .account-remove { border-top: 1px solid var(--border); border-radius: 0; padding-top: var(--space-3); color: var(--bad); }
.account-add { border-top: 1px solid var(--border); padding-top: var(--space-4); }
.account-foot { border-top: 1px solid var(--border); padding-top: var(--space-4); overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .account-machine { padding: var(--space-4); }
  /* The buttons wrap inside the card; More's menu opens across the whole row, so it fits wherever More lands */
  .account-machine-actions { position: relative; }
  .account-machine-actions > .btn, .account-machine-more { flex: 1 1 auto; }
  .account-machine-more { position: static; }
  .account-machine-more > summary { justify-content: center; }
  .account-machine-menu { left: 0; right: 0; width: auto; }
}
.account-machine-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-status { font-size: var(--type-secondary); color: var(--muted); }
.account-status.good { color: var(--ok); }
.account-status.warn { color: var(--warn); }
.account-steps { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: var(--space-3); }
.account-steps pre { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--r-md); white-space: pre-wrap; word-break: break-all; font-size: var(--type-secondary); user-select: all; }
.account-code-form { margin-top: var(--space-2); flex-wrap: wrap; }
.account-code-form input { flex: 1 1 140px; min-width: 0; text-transform: uppercase; letter-spacing: 0.08em; }
.account-add summary { cursor: pointer; color: var(--muted); margin-bottom: var(--space-3); }
.account-foot { margin: 0; font-size: var(--type-secondary); }
.account-card code { white-space: nowrap; } /* keep `orchestrator ui --tunnel` on one line */
.account-card code.account-address { white-space: normal; overflow-wrap: anywhere; } /* an address can be longer than the card */
.account-offline-notice { padding: var(--space-2) var(--space-3); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-md); font-size: var(--type-secondary); align-items: center; margin-top: var(--space-2); }
.account-start-guide { margin-top: var(--space-2); gap: 6px; }
.account-cmd-box { align-items: center; flex-wrap: wrap; }
.account-cmd-box code { padding: 3px 6px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: var(--type-secondary); user-select: all; }
.account-listening { font-size: var(--type-secondary); color: var(--muted); display: inline-flex; align-items: center; }
.account-more-options { font-size: var(--type-secondary); color: var(--muted); margin-top: 2px; }
.account-more-options summary { cursor: pointer; color: var(--muted); }
.account-more-options ul { margin: var(--space-1) 0 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 4px; }
.desktop-setup, .desktop-idea { max-width: 720px; }
.setup-detected-summary { padding: var(--space-3) var(--space-4); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.desktop-setup .advanced-settings { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); }
.desktop-setup .advanced-settings > summary { padding: var(--space-3) var(--space-4); font-weight: var(--weight-medium); color: var(--text); user-select: none; }
.desktop-setup .advanced-settings[open] > summary { border-bottom: 1px solid var(--border); }
.desktop-setup .advanced-settings .card-b { padding: var(--space-4); background: var(--panel); }
#desktop-setup-error:focus-visible { outline: 2px solid var(--bad); outline-offset: 2px; }

/* Tests: suites grouped by folder */
.suite-group + .suite-group { border-top: 1px solid var(--border); }
.suite-group > summary h3 { margin: 0; font-size: var(--type-body); font-weight: var(--weight-bold); overflow-wrap: anywhere; }

/* Projects */
.projects-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-4); }
.projects-head h2 { margin: 0; font-size: var(--type-body); }
.project-card-badges { display: flex; gap: var(--space-1); align-items: center; flex-wrap: wrap; }
.project-card:not(.active-project) .project-card-title { color: var(--accent); }
.projects-filter .badge-icon { width: 12px; height: 12px; margin-right: var(--space-1); vertical-align: -1px; }

/* Small layout utilities (instead of inline styles) */
.card-h-wrap { flex-wrap: wrap; gap: var(--space-3); }
.card-b-split { border-top: 1px solid var(--border); }
.card-next { border-color: var(--accent); }
/* Type roles for markup built in scripts. */
.t-display { font-size: var(--type-display); font-weight: var(--weight-bold); line-height: var(--leading-tight); }
.t-page { font-size: var(--type-page); font-weight: var(--weight-bold); line-height: var(--leading-tight); }
.t-section { font-size: var(--type-section); font-weight: var(--weight-bold); line-height: var(--leading-tight); }
.t-subsection { font-size: var(--type-body); font-weight: var(--weight-bold); }
.t-body { font-size: var(--type-body); font-weight: var(--weight-regular); }
.t-label { font-size: var(--type-body); font-weight: var(--weight-medium); text-transform: none; letter-spacing: normal; color: var(--text); }
.t-secondary { font-size: var(--type-secondary); }
.t-tag { font-size: var(--type-tag); font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.wrap { flex-wrap: wrap; }
.icon-sm { width: 14px; height: 14px; }
.framework-grid { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.framework { flex: 1 1 200px; padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); }
.framework-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.framework-desc { font-size: var(--type-secondary); color: var(--muted); }
.framework > summary { cursor: pointer; min-height: var(--control-lg); gap: var(--space-2); }
.framework > summary::after { content: "+"; color: var(--muted); }
.framework[open] > summary::after { content: "−"; }
.framework-detail { padding-top: var(--space-3); font-size: var(--type-secondary); }
.framework-guide { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-1); }
.framework-guide-row { font-size: var(--type-secondary); line-height: 1.5; color: var(--text); }
.framework-guide-row strong { color: var(--text); font-weight: var(--weight-medium); margin-right: var(--space-1); }

/* Tablets: the sidebar stays, but narrower, and the page gets less padding. */
@media (min-width: 761px) and (max-width: 1100px) {
  .app { grid-template-columns: 200px minmax(0, 1fr); }
  .main { padding: var(--space-5) var(--space-5) var(--space-7); }
  .home-new-job-btn { top: var(--space-5); right: var(--space-5); }
  .search-btn kbd { display: none; }
  .job-table-row, .job-table-header { grid-template-columns: minmax(180px, 1fr) 100px 130px 110px; gap: var(--space-3); }
}

/* UX review: screenshot strips and findings */
.ux-check .main-col { white-space: normal; overflow-wrap: anywhere; }
.ux-check .main-col p { margin: var(--space-1) 0 0; }
.ux-check-evidence { font-size: var(--type-body); }
.ux-review-progress { width: 100%; height: var(--space-2); accent-color: var(--accent); }
.ux-review-stages { margin: 0; padding-left: var(--space-5); color: var(--muted); }
.ux-screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); }
.ux-screen { margin: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.ux-screen-preview { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.ux-screen img { width: 100%; max-height: 260px; object-fit: cover; object-position: top; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); }
.ux-screen figcaption { font-size: var(--type-secondary); color: var(--muted); overflow-wrap: anywhere; }
.ux-finding .main-col { display: flex; flex-direction: column; gap: var(--space-1); white-space: normal; }
.nowrap { white-space: nowrap; }
.card-note { padding-block: var(--space-2); border-bottom: 1px solid var(--border); font-size: var(--type-secondary); }
/* Tests: a long folder takes its own line on phones, with the counts under it */
.suite-group > summary.card-h { flex-wrap: wrap; row-gap: var(--space-0); }
.suite-group > summary h3 { min-width: 0; flex: 0 1 auto; }
@media (max-width: 760px) {
  /* A job's More menu sits beside its title instead of on a row of its own */
  .topbar:has(> .topbar-actions > details.more:only-child) { flex-direction: row; align-items: flex-start; }
  .topbar-actions:has(> details.more:only-child) { width: auto; flex: none; }
}

/* In-progress run screens: Stop button sits on the right side, same row as the title across desktop & mobile */
.topbar:has(> .topbar-actions > [data-stop]),
body[data-page="run"] .topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title actions"
    "sub sub";
  align-items: center;
  gap: var(--space-1) var(--space-3);
}

.topbar:has(> .topbar-actions > [data-stop]) .topbar-text,
body[data-page="run"] .topbar-text {
  display: contents;
}

.topbar:has(> .topbar-actions > [data-stop]) .topbar-title-row,
body[data-page="run"] .topbar-title-row {
  grid-area: title;
  margin: 0;
}

.topbar:has(> .topbar-actions > [data-stop]) #page-title,
body[data-page="run"] #page-title {
  margin: 0;
  line-height: 1.25;
}

.topbar:has(> .topbar-actions > [data-stop]) #page-sub,
body[data-page="run"] #page-sub {
  grid-area: sub;
  margin-top: 0;
}

.topbar:has(> .topbar-actions > [data-stop]) .topbar-actions,
body[data-page="run"] .topbar-actions {
  grid-area: actions;
  width: auto;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
}

@media (max-width: 760px) {
  html:has(body[data-page="run"]) {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body[data-page="run"] {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body[data-page="run"] .app {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  body[data-page="run"] .main {
    height: 100dvh;
    max-height: 100dvh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding-top: calc(64px + env(safe-area-inset-top) + var(--space-2));
    padding-bottom: calc(56px + env(safe-area-inset-bottom) + var(--space-2));
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  body[data-page="run"] .topbar {
    flex-shrink: 0;
    margin-bottom: var(--space-2);
    gap: var(--space-0) var(--space-2);
  }

  body[data-page="run"] .topbar-title-row {
    min-width: 0;
    overflow: hidden;
  }

  body[data-page="run"] #page-title {
    font-size: var(--type-body);
    font-weight: var(--weight-bold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-page="run"] #page-sub {
    font-size: var(--type-tag);
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-page="run"] .topbar-actions .btn {
    min-height: var(--control-sm);
    padding: var(--space-1) var(--space-2-5);
    font-size: var(--type-secondary);
  }

  body[data-page="run"] #view {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    overflow: hidden;
  }

  body[data-page="run"] #next-step {
    flex-shrink: 0;
    max-height: 38dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body[data-page="run"] #next-step .run-status,
  body[data-page="run"] #next-step .banner {
    padding: var(--space-2) var(--space-3);
    gap: var(--space-1-5);
    border-radius: var(--radius);
  }

  body[data-page="run"] #next-step .run-status-heading {
    gap: var(--space-1) var(--space-2);
    align-items: center;
  }

  body[data-page="run"] #next-step .run-status-heading strong {
    font-size: var(--type-secondary);
    line-height: 1.25;
  }

  body[data-page="run"] #next-step .run-status-task {
    font-size: var(--type-secondary);
    line-height: 1.25;
  }

  body[data-page="run"] #next-step .run-status-details {
    gap: var(--space-0) var(--space-3);
  }

  body[data-page="run"] #next-step .run-status-details dt,
  body[data-page="run"] #next-step .run-status-details dd {
    font-size: var(--type-secondary);
  }

  body[data-page="run"] #next-step .run-status-progress {
    height: 3px;
  }

  body[data-page="run"] #next-step .run-status-pct {
    font-size: var(--type-tag);
  }

  body[data-page="run"] #next-step .pill {
    font-size: var(--type-secondary);
    padding: 2px 6px;
  }

  body[data-page="run"] #next-step .visual-check-banner {
    padding: var(--space-2) var(--space-3);
  }

  body[data-page="run"] #next-step .visual-check-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-2);
  }

  body[data-page="run"] .term-wrap {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1-5);
    overflow: hidden;
  }

  body[data-page="run"] .term {
    flex: 1 1 0;
    min-height: 120px;
    height: auto;
    padding: var(--space-1-5);
    overflow: hidden;
  }

  body[data-page="run"]:has(.banner.failed) #next-step,
  body[data-page="run"].run-failed #next-step {
    max-height: none;
    flex-shrink: 0;
  }

  body[data-page="run"]:has(.banner.failed) .term-wrap,
  body[data-page="run"].run-failed .term-wrap {
    flex: 0 1 auto;
    max-height: 35vh;
  }

  body[data-page="run"]:has(.banner.failed) .term-wrap .term,
  body[data-page="run"].run-failed .term-wrap .term {
    flex: 0 1 auto;
    height: auto;
    min-height: 0;
    max-height: 35vh;
  }

  body[data-page="run"] .keybar {
    flex-shrink: 0;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: var(--space-1);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
  }

  body[data-page="run"] .keybar::-webkit-scrollbar {
    display: none;
  }

  body[data-page="run"] .keybar .btn {
    min-height: var(--control-sm);
    min-width: var(--control-sm);
    padding: var(--space-1) var(--space-2);
    font-size: var(--type-secondary);
    flex-shrink: 0;
  }

  body[data-page="run"] .term-input {
    flex-shrink: 0;
    display: flex;
    gap: var(--space-1-5);
  }

  body[data-page="run"] .term-input input {
    min-height: var(--control-sm);
    font-size: var(--type-secondary);
    padding: var(--space-1) var(--space-2-5);
  }

  body[data-page="run"] .term-input button {
    min-height: var(--control-sm);
    padding: var(--space-1) var(--space-3);
    font-size: var(--type-secondary);
  }
}


/* Back button beside a detail page's title: returns to where you came from (see routeParent in app.js). */
.topbar-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-sm);
  height: var(--control-sm);
  min-width: var(--control-sm);
  min-height: var(--control-sm);
  margin: 0 0 0 calc(-1 * var(--space-1));
  padding: 0;
  border-radius: var(--r-md);
  color: var(--muted);
  text-decoration: none;
  flex: 0 0 var(--control-sm);
  transition: color var(--motion-fast) ease, background-color var(--motion-fast) ease;
}
.back-link:hover {
  color: var(--text);
  background: var(--panel-2);
}
.back-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.back-link .icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
  transform: rotate(180deg);
}
.back-link[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .topbar { --back-w: var(--control-md); }
  .back-link {
    width: var(--control-md);
    height: var(--control-md);
    min-width: var(--control-md);
    min-height: var(--control-md);
    flex-basis: var(--control-md);
  }
  .back-link .icon {
    width: 24px;
    height: 24px;
  }
}

/* Job page: the context rail beside the job on wide screens, under its top section on narrow ones */
.job-layout { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "rail" "preview" "body"; }
.job-top { grid-area: top; min-width: 0; }
.job-layout > .job-preview { grid-area: preview; min-width: 0; }
.job-body { grid-area: body; min-width: 0; }
.job-rail { grid-area: rail; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-4); }
@media (min-width: 1100px) {
  .job-layout { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "top rail" "preview rail" "body rail"; column-gap: var(--space-5); align-items: start; }
  .job-rail { position: sticky; top: var(--space-4); }
}
/* Side by side: the job on the left, its preview on the right, kept in view and as tall as the window */
.job-preview-layout { display: none; }
@media (min-width: 1280px) {
  .job-preview-layout { display: inline-flex; }
  .job-layout.split { grid-template-columns: minmax(360px, 1fr) minmax(0, 1.35fr); grid-template-areas: "top preview" "rail preview" "body preview"; }
  .job-layout.split > .job-rail { position: static; }
  /* The whole card fits the window (its controls never scroll out of reach); the frame takes what's left */
  .job-layout.split > .job-preview { position: sticky; top: var(--space-4); align-self: start; display: flex; flex-direction: column;
    height: calc(100vh - 120px); min-height: 520px; }
  .job-layout.split > .job-preview > .card-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
  .job-layout.split .job-preview-frame { flex: 1 1 auto; height: auto; min-height: 280px; }
  .job-layout.split .job-stepper { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-3); }
  .job-layout.split .job-step-arrow { display: none; }
}
.rail-h { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: var(--control-sm); }
.rail-empty { margin: 0; padding: var(--space-3) var(--space-4); border: 1px dashed var(--border); border-radius: var(--radius); font-size: var(--type-secondary); }
.rail-card .card-h h2 { font-size: var(--type-body); }
.context-item { align-items: flex-start; }
.context-item .main-col { white-space: normal; overflow-wrap: anywhere; }
.context-thumb { width: 56px; height: 56px; object-fit: cover; flex: none; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--panel-2); }
.ticket-chip { display: inline-flex; align-items: center; min-height: var(--control-xs); padding: 0 var(--space-2); border: 1px solid var(--border);
  border-radius: var(--r-pill); background: var(--panel); color: var(--text); font-size: var(--type-secondary); font-weight: var(--weight-medium); text-decoration: none; }
a.ticket-chip:hover { border-color: var(--accent); color: var(--accent); }
.job-top .banner { margin-bottom: var(--space-4); }

/* The plan, shown under the decision while it waits for approval */
.plan-review.needs-approval { border-color: var(--warn); background: var(--warn-soft); }
.plan-review.needs-approval .card-h { background: transparent; border-bottom-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.plan-review.needs-approval .list .item, .plan-review.needs-approval .plan-summary, .plan-review.needs-approval .card-b-split { border-color: color-mix(in srgb, var(--warn) 25%, var(--border)); }
.plan-summary { font-size: var(--type-body); border-bottom: 1px solid var(--border); }
.plan-review.too-large { border-color: var(--bad); background: var(--bad-soft); }
.plan-review.too-large .card-h { background: transparent; }
.plan-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border); font-size: var(--type-secondary); color: var(--muted); }
.plan-verdict.bad { color: var(--text); }
.plan-size { font-weight: var(--weight-bold); color: var(--text); }
.plan-flag { color: var(--warn); }
.task-detail { margin-top: var(--space-1); }
.task-detail > summary { cursor: pointer; font-size: var(--type-secondary); width: fit-content; }
.task-detail[open] > summary { margin-bottom: var(--space-1); }
.task-row { align-items: flex-start; }
.task-number { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-top: 1px;
  border-radius: var(--r-pill); background: var(--panel-2); border: 1px solid var(--border); font-size: var(--type-secondary); font-weight: var(--weight-bold); color: var(--muted); }
.task-row .main-col { white-space: normal; display: flex; flex-direction: column; gap: var(--space-1); }
.task-done-when ul { margin: var(--space-1) 0 0; padding-left: var(--space-5); color: var(--text); font-size: var(--type-secondary); }
.task-files { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.task-files code { padding: 0 var(--space-2); border-radius: var(--r-sm); background: var(--panel-2); font-size: var(--type-secondary); overflow-wrap: anywhere; }

.gh-code { display: flex; align-items: center; gap: var(--space-3); }
.gh-code code { font-size: var(--type-page); font-weight: var(--weight-bold); letter-spacing: .08em; padding: var(--space-2) var(--space-3); border-radius: var(--r-md); background: var(--panel-2); }

/* Phone header: menu and logo on the left, the current project's name centred */
.mobile-header-start { display: flex; align-items: center; gap: var(--space-2); }
.brand-home { display: inline-flex; align-items: center; justify-content: center; min-width: var(--control-lg); min-height: var(--control-lg); flex-shrink: 0; border-radius: var(--r-md); }
.mobile-title { display: flex; align-items: center; justify-content: center; min-width: 0; font-size: var(--type-body); font-weight: var(--weight-bold); }
.mobile-title-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A task's ⋯ menu stays beside its title on phones instead of dropping to a row of its own */
@media (max-width: 760px) {
  .task-row:has(.side .btn) { flex-wrap: nowrap; }
  .task-row:has(.side .btn) .main-col { flex-basis: auto; }
  .task-row:has(.side .btn) .side { width: auto; }
}

/* Visual check done container & screenshots */
.visual-check-banner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: stretch;
}
.visual-check-done-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.visual-check-done-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.visual-check-desc {
  margin: 0;
  font-size: var(--type-secondary);
  color: var(--muted);
  line-height: 1.45;
}
.card > .visual-check-desc {
  padding: var(--space-2) var(--space-4) 0;
}
.visual-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-1);
}
.visual-check-thumb-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--space-2);
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease, border-color var(--motion-fast) ease;
}
.visual-check-thumb-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.visual-check-thumb-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: var(--panel-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  overflow: hidden;
  line-height: 0;
}
.visual-check-thumb-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: top;
  border-radius: var(--r-sm);
  transition: transform var(--motion-medium) ease;
  display: block;
}
.visual-check-thumb-btn:hover .visual-check-thumb-img {
  transform: scale(1.02);
}
.visual-check-thumb-badge {
  position: absolute;
  inset: auto 6px 6px auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: var(--type-tag);
  font-weight: var(--weight-medium);
  border-radius: var(--r-pill);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0.85;
  transition: opacity var(--motion-fast) ease;
}
.visual-check-thumb-btn:hover .visual-check-thumb-badge {
  opacity: 1;
}
.visual-check-thumb-badge .icon {
  width: 11px;
  height: 11px;
}
.visual-check-thumb-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
  font-size: var(--type-secondary);
  color: var(--muted);
  padding-inline: var(--space-1);
}
.visual-check-thumb-caption .mono {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--type-tag);
}
.visual-check-ext-link {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--type-secondary);
  padding: 0 var(--space-1);
  border-radius: var(--r-xs);
}
.visual-check-ext-link:hover {
  color: var(--accent);
  background: var(--panel-2);
}

.visual-check-mode-badge {
  position: absolute;
  inset: 6px auto auto 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-size: var(--type-tag);
  font-weight: var(--weight-medium);
  border-radius: var(--r-pill);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: var(--z-inner);
}
.visual-check-mode-badge.light {
  background: rgba(255, 255, 255, 0.9);
  color: #18181b;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.visual-check-mode-badge.dark {
  background: rgba(24, 24, 27, 0.9);
  color: #fafafa;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.visual-check-mode-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.visual-check-mode-badge.light .badge-dot {
  background: #f59e0b;
}
.visual-check-mode-badge.dark .badge-dot {
  background: #818cf8;
}
.visual-check-video-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--space-3);
  margin-top: var(--space-1);
}
.visual-check-video-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--type-secondary);
  font-weight: var(--weight-medium);
  color: var(--text);
}
.visual-check-player {
  width: 100%;
  max-width: 440px;
  border-radius: var(--r-sm);
  background: #000;
  border: 1px solid var(--border);
  outline: none;
  display: block;
}
.visual-check-job-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}
.visual-check-job-video-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.visual-check-job-grid {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-1);
}
.visual-check-job-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-align: center;
}
.visual-check-job-item a {
  position: relative;
  display: block;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.visual-check-job-item img {
  max-height: 220px;
  width: auto;
  display: block;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform var(--motion-fast) ease;
}
.visual-check-job-item a:hover img {
  transform: scale(1.02);
}

/* Modal lightbox for full size preview */
dialog.dialog-image-viewer {
  width: min(920px, calc(100vw - 24px));
  max-height: min(92vh, 860px);
  max-height: min(92dvh, 860px);
}
dialog.dialog-image-viewer form {
  padding: var(--space-4);
  max-height: min(92vh, 860px);
  max-height: min(92dvh, 860px);
}
.image-preview-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
  width: 100%;
}
.image-preview-modal-frame {
  max-height: min(65vh, 600px);
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--space-2);
  width: 100%;
  box-sizing: border-box;
}
.image-preview-modal-img {
  max-width: 100%;
  max-height: min(60vh, 560px);
  object-fit: contain;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
}
.image-preview-modal-foot {
  width: 100%;
}

/* ---------------------------------------------------------------- feedback button & modal */
.feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.job-type-auto-improve {
  background: var(--warn-soft) !important;
  border-color: var(--border) !important;
  color: var(--warn) !important;
  font-weight: var(--weight-medium);
}
.prize-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--warn-soft);
  border: 1px solid var(--border);
  color: var(--warn);
  font-weight: var(--weight-medium);
  border-radius: var(--r-pill);
  padding: 2px var(--space-2-5);
  font-size: var(--type-secondary);
}
.prize-btn {
  background: var(--warn-soft);
  border: 1px solid var(--border);
  color: var(--warn);
  font-weight: var(--weight-medium);
}
.prize-btn:hover {
  background: var(--panel-2);
  border-color: var(--warn);
  color: var(--warn);
}
.feedback-dialog {
  padding: 0;
  border: none;
  background: transparent;
  max-width: 100vw;
  max-height: 100dvh;
  margin: auto;
  overflow: visible;
}
.feedback-dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.feedback-card {
  max-width: 420px;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px;
  position: relative;
  text-align: center;
  border-radius: 20px;
  background: var(--panel);
  color: var(--text);
  border: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: var(--shadow-3);
  box-sizing: border-box;
}
/* The feedback card is dark in both themes: it carries the dark theme's colours, so everything inside follows the tokens. */
.feedback-card {
  --bg: #0f1115;
  --panel: #171a20;
  --panel-2: #1e222a;
  --border: #2a2f39;
  --text: #e6e8ec;
  --muted: #98a0b0;
  --accent: #7289ff;
  --accent-ink: #0f1115;
  --accent-soft: #232a45;
  --ok: #43c47d;
  --ok-soft: #173024;
  --warn: #e0a84a;
  --warn-ink: #1a1204;
  --ok-solid: #43c47d;
  --ok-solid-ink: #06210f;
  --github-ink: #d8b4fe;
  --warn-soft: #33291a;
  --bad: #f07070;
  --bad-ink: #1a0707;
  --bad-soft: #3a1d1f;
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-3: 0 16px 48px rgba(0, 0, 0, .6);
  --manage-option-bg: #323947;
  --btn-secondary-bg: #1f2536;
  --btn-secondary-border: #303a54;
  --btn-secondary-hover: #273046;
  --btn-secondary-hover-border: #445378;
  --btn-secondary-active: #2e3952;
  --btn-secondary-text: #e6e8ec;
}
.feedback-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-inner);
  width: 30px;
  height: 30px;
  line-height: 1;
  transition: all var(--motion-fast) ease;
}
.feedback-close-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 15%, transparent);
}
.feedback-title {
  font-size: var(--type-page);
  font-weight: var(--weight-bold);
  letter-spacing: 0.5px;
  margin: 0 32px 12px 32px;
  text-align: center;
  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.feedback-subtitle {
  text-align: center;
  padding: 0 var(--space-2);
  margin: 0 0 16px 0;
  font-size: var(--type-body);
  color: var(--muted);
  line-height: 1.45;
  text-align: left;
  padding: 0 4px;
}
.feedback-subtitle .feedback-email {
  color: var(--accent);
  font-weight: var(--weight-bold);
}
.feedback-textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: var(--type-body);
  line-height: 1.45;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}
.feedback-textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}
.feedback-empty-hint {
  font-size: var(--type-secondary);
  color: var(--muted);
  text-align: left;
  margin: 4px 4px 12px 4px;
  line-height: 1.4;
}
.feedback-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.feedback-submit-btn {
  flex: 1;
  justify-content: center;
  font-size: var(--type-body);
  font-weight: var(--weight-bold);
  padding: 10px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.feedback-submit-btn[disabled] {
  opacity: 0.55;
  cursor: default;
}
.feedback-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: feedback-spin 0.8s linear infinite;
}
@keyframes feedback-spin {
  to { transform: rotate(360deg); }
}
.feedback-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  margin: 0 -20px -24px -20px;
  border-radius: 0 0 20px 20px;
  overflow: hidden;
}
.feedback-choice-btn {
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--motion-fast) ease;
}
.feedback-choice-btn:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}
.feedback-choice-btn.left {
  border-right: 1px solid var(--border);
}
.feedback-choice-emoji {
  font-size: var(--type-display);
  line-height: 1;
}
.feedback-choice-label {
  font-size: var(--type-body);
  font-weight: var(--weight-bold);
}
.feedback-choice-label.muted {
  color: var(--muted);
}
.feedback-choice-label.accent {
  color: var(--accent);
}
.feedback-status-view {
  padding: 16px 0;
  text-align: center;
}
.feedback-status-emoji {
  font-size: var(--type-display);
  margin-bottom: 10px;
}
.feedback-status-title {
  font-size: var(--type-page);
  font-weight: var(--weight-bold);
  margin: 0 0 8px 0;
}
.feedback-status-title.error {
  color: var(--bad);
}
.feedback-status-msg {
  font-size: var(--type-body);
  color: var(--muted);
  margin: 0 0 18px 0;
  line-height: 1.45;
}
.feedback-status-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* One feedback form; improving Orchestrator itself is an option within it */
.feedback-improve-toggle {
  align-self: flex-start;
}
.feedback-actions .btn.ghost {
  color: inherit;
}
.feedback-improve-box {
  color: var(--text);
  background: var(--warn-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
}
.feedback-prize-line {
  font-size: var(--type-secondary);
  line-height: 1.45;
  color: var(--text);
  margin: 0;
}
.feedback-job-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-height: 11rem;
  overflow-y: auto;
}
.feedback-job-option {
  font-size: var(--type-secondary);
}
.feedback-fields-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2-5);
  text-align: left;
}
.feedback-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--type-secondary);
  color: inherit;
  font-weight: var(--weight-medium);
}
.feedback-field span {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
}
.feedback-field .accent-required {
  color: var(--warn);
  font-weight: var(--weight-medium);
  font-size: var(--type-secondary);
}
.feedback-input, .feedback-textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: var(--type-secondary);
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}
.feedback-input:focus, .feedback-textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}
.prize-card {
  border: 1px solid var(--border) !important;
  background: var(--panel) !important;
}
.prize-card-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Delivery / Distribution: Branch metadata container */
.branch-meta-box {
  display: flex;
  flex-direction: column;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.branch-meta-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  min-width: 0;
}

.branch-meta-row + .branch-meta-row {
  border-top: 1px solid var(--border);
}

.branch-meta-label {
  flex: 0 0 110px;
  min-width: 90px;
  padding-top: 2px;
}

.branch-meta-tag {
  display: inline-block;
  font-size: var(--type-tag);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.branch-meta-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.branch-meta-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--type-body);
  color: var(--text);
  line-height: 1.4;
}

.branch-commit-hash {
  display: inline-flex;
  align-items: center;
  padding: 1px var(--space-1-5);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--type-secondary);
  font-weight: var(--weight-medium);
  color: var(--text);
}

.branch-commit-subject {
  font-weight: var(--weight-medium);
  color: var(--text);
  overflow-wrap: anywhere;
}

.branch-job-link {
  color: var(--text);
  text-decoration: none;
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
}

.branch-job-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.branch-meta-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1-5);
  font-size: var(--type-secondary);
  color: var(--muted);
}

.branch-meta-sub .sep {
  opacity: 0.5;
}

@media (max-width: 760px) {
  .branch-meta-row {
    flex-direction: column;
    gap: var(--space-1-5);
  }
  .branch-meta-label {
    flex: none;
    padding-top: 0;
  }
}


/* Repository health keeps normal job automation separate from manual maintenance. */
.git-access-details, .git-label-details, .git-publishing-details { border-top: 1px solid var(--border); }
.git-access-details > summary, .git-label-details > summary, .git-publishing-details > summary { cursor: pointer; padding: var(--space-3) var(--container-pad-x); min-height: var(--control-md); font-size: var(--type-body); font-weight: var(--weight-medium); }
.git-label-details > summary .muted { margin-left: var(--space-2); font-weight: var(--weight-regular); font-size: var(--type-secondary); }
.git-section-note { padding: var(--space-3) var(--container-pad-x); font-size: var(--type-secondary); line-height: 1.5; color: var(--muted); }
.git-host-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); border-bottom: 0; border-top: 1px solid var(--border); }
.git-advanced-tools > summary { cursor: pointer; list-style: none; }
.git-advanced-tools > summary::-webkit-details-marker { display: none; }
.git-advanced-tools[open] > summary .git-disclosure { transform: rotate(180deg); }
.git-advanced-content > .card { border: 0; border-radius: 0; box-shadow: none; }
.git-advanced-content > .card > .card-h { border-radius: 0; border-top: 1px solid var(--border); }
.git-advanced-tools:not([open]) > summary { border-bottom: 0; }
.git-job-row + .git-job-row { border-top: 1px solid var(--border); }
@media (max-width: 760px) {
  .git-access-details > summary, .git-label-details > summary, .git-publishing-details > summary { min-height: var(--control-lg); }
  .git-job-row dd { align-items: flex-start; flex-direction: column; }
}

/* Home's subtitle spans the full header so health aligns with the page's right edge. */
body[data-page="home"] .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: var(--space-4); }
body[data-page="home"] .topbar-text { display: contents; }
body[data-page="home"] .topbar-title-row { grid-column: 1; grid-row: 1; }
body[data-page="home"] .topbar-actions { grid-column: 2; grid-row: 1; }
body[data-page="home"] #page-sub { grid-column: 1 / -1; grid-row: 2; width: 100%; }
.status-line.status-stack.home-status-line { display: flex; flex-direction: column; align-items: stretch; width: 100%; gap: var(--space-2); }
.home-status-line .status-main-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); width: 100%; }
.home-status-line .status-branch { flex: 0 1 16rem; }
.home-health-inline { position: relative; flex: none; } /* bottom-aligned with the branch dropdown: same height, no offset */
.home-health-trigger { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-md); padding: var(--space-1) var(--space-3); border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--panel); color: var(--text); cursor: pointer; list-style: none; font-size: var(--type-body); font-weight: var(--weight-medium); }
.home-health-trigger::-webkit-details-marker { display: none; }
.home-health-light { width: 10.8px; height: 10.8px; flex: none; border-radius: var(--r-pill); background: var(--ok); }
.home-health-light-optional { background: linear-gradient(135deg, var(--ok) 50%, var(--warn) 50%); }
.home-health-yellow .home-health-light { background: var(--warn); }
.home-health-red .home-health-light { background: var(--bad); }
.home-health-red .home-health-trigger { border-color: var(--bad); }
.home-health-popover { position: fixed; z-index: var(--z-menu); top: auto; right: auto; left: 0; width: min(26rem, calc(100vw - 2 * var(--space-4))); max-height: min(70vh, 34rem); max-height: min(70vh, 34rem, calc(100dvh - 2 * var(--space-4))); overflow: auto; overscroll-behavior: contain; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); }
.home-health-popover-head { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--container-pad-x); background: var(--panel-2); }
.home-health-popover-head strong { font-size: var(--type-body); }
.home-health-popover-head > span { color: var(--muted); font-size: var(--type-secondary); }
.home-health-section h3 { padding: var(--space-3) var(--container-pad-x) 0; font-size: var(--type-body); }
.home-health-popover .setup-item { padding-inline: var(--container-pad-x); }
.home-health-popover .setup-item .meta { font-size: var(--type-body); }
.home-health-ready, .home-health-popover > p { padding: var(--space-3) var(--container-pad-x); color: var(--ok); font-size: var(--type-body); }
.home-health-yellow .home-health-popover > p { color: var(--warn); }
.home-health-optional { border-top: 1px solid var(--border); }
/* Keep urgent repository blockers ahead of setup details and easy to scan. */
.git-problems-card { border-inline-start: 3px solid var(--bad); }
.git-problems-card > .card-h { background: var(--bad-soft); }
.git-problems-card > .card-h h2 { color: var(--bad); }
.git-problems-summary { color: var(--muted); font-size: var(--type-secondary); }
.git-section-note, .git-setting-value small, .git-provider-caption { font-size: var(--type-body); }
@media (max-width: 760px) {
  .git-problems-card > .card-h { align-items: flex-start; flex-direction: column; gap: var(--space-1); }
}

/* Suggested features: one tickable card per epic, grouped by build order or release slice */
.feature-proposal-layer { display: flex; flex-direction: column; gap: var(--space-2); }
.feature-proposal-layer > .tc-area-h { padding-inline: 0; }
.feature-proposal-item { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.feature-proposal-item input { flex: none; margin-top: var(--space-1); }
.feature-proposal-item .stack { gap: var(--space-1); min-width: 0; overflow-wrap: anywhere; }
.feature-stories, .feature-requirements, .feature-proposal-questions ul { margin: 0; padding-left: var(--space-4); }
.feature-proposal-questions > .tc-area-h { padding-inline: 0; }

/* Epics */
.job-type-tag.job-type-epic { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.jira-chip { display: inline-flex; align-items: center; gap: var(--space-1); vertical-align: middle; padding: 0 var(--space-2); border: 1px solid var(--border);
  border-radius: var(--r-pill); background: var(--panel); color: var(--text); font-size: var(--type-secondary); font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap; }
.jira-chip .icon { width: 14px; height: 14px; }
a.jira-chip:hover { border-color: var(--accent); color: var(--accent); }
.epic-row .side { flex-wrap: wrap; justify-content: flex-end; }
.epic-technique { min-width: 16rem; margin: 0; }
.epic-question { padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.epic-question .field { margin: 0; }
.epic-question:last-of-type { border-bottom: 0; }
.card-attention { border-color: var(--warn); background: var(--warn-soft); }
.card-attention .card-h { background: transparent; border-bottom-color: var(--warn); }
.card-attention .card-h h2 { margin-right: auto; }
.pill.idle { background: var(--panel-2); color: var(--muted); }
#epics-body .row.end { align-items: flex-end; }
/* The second half of a page (Epics, under the Product requirements): a heading of its own, set apart from the cards above. */
.page-part { margin: var(--space-8) 0 var(--space-4); padding-top: var(--space-6); border-top: 1px solid var(--border); }
.page-part h2 { margin: 0 0 var(--space-1); font-size: var(--type-section); }
.page-part p { margin: 0; }
/* Recommended MCP servers: which AI tool has which (Connections) */
.mcp-grid-wrap { overflow-x: auto; margin-bottom: var(--space-3); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); }
.mcp-grid { width: 100%; border-collapse: collapse; font-size: var(--type-secondary); }
.mcp-grid th, .mcp-grid td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.mcp-grid thead th { background: var(--panel-2); font-weight: var(--weight-bold); color: var(--muted); }
.mcp-grid tbody th { text-align: left; font-weight: var(--weight-medium); }
.mcp-grid tbody th small { display: block; font-weight: var(--weight-regular); }
.mcp-grid .mcp-name { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--text); }
.mcp-grid tr:last-child > * { border-bottom: 0; }
.mcp-grid .mcp-yes { color: var(--ok); font-weight: var(--weight-bold); font-size: var(--type-body); }
.mcp-grid tbody th, .mcp-grid thead th:first-child { position: sticky; left: 0; z-index: var(--z-raised); background: var(--panel); } /* the server stays in view while the tools scroll */
.mcp-grid thead th:first-child { background: var(--panel-2); }
/* Project kind (Web / Desktop / Mobile): a tinted label next to the project's name everywhere it's shown */
.kind-pill { --kind: var(--accent); display: inline-flex; align-items: center; margin-left: var(--space-2); padding: 1px var(--space-2); border-radius: var(--r-pill);
  border: 1px solid color-mix(in srgb, var(--kind) 35%, var(--border)); background: color-mix(in srgb, var(--kind) 12%, var(--panel)); color: var(--kind);
  font-size: var(--type-tag); font-weight: var(--weight-bold); letter-spacing: .02em; text-transform: none; vertical-align: middle; white-space: nowrap; }
.kind-web { --kind: var(--job-feature); }
.kind-desktop { --kind: var(--job-quick); }
.kind-mobile { --kind: var(--job-coverage); }
.project-card-badges .kind-pill { margin-left: 0; }
/* Centred on the line it sits in (vertical-align: middle drops a small pill to the lowercase letters' middle) */
.project-switch > .label { display: flex; align-items: center; }
/* Home's title is the project's name and a project switcher: the sidebar's list, opened from the name */
body[data-page="home"] #page-title { font-size: var(--type-home); }
/* Product, Activity and Tests need no title: the sidebar and the tab already say where you are */
body[data-page="product"] #page-title, body[data-page="activity"] #page-title, body[data-page="tests"] #page-title { display: none; }
.home-project-title { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); max-width: 100%; border-radius: var(--r-md); cursor: pointer; }
.home-project-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-project-chevron { color: var(--muted); font-size: .7em; }
.home-project-title:hover .home-project-chevron, .home-project-title:focus-within .home-project-chevron { color: var(--text); }
.home-project-title:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-project-select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: var(--type-body); }
/* "i" info tips (infoTip in app.js): the explanation shows on hover, tap or focus */
.info-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: var(--space-1); padding: 0; vertical-align: middle;
  border: 1px solid var(--border); border-radius: 50%; background: var(--panel-2); color: var(--muted); font: italic var(--weight-bold) 11px/1 Georgia, serif; cursor: help; }
.info-tip:hover, .info-tip:focus-visible { color: var(--text); border-color: var(--muted); }
.info-tip::after { content: attr(data-tip); position: absolute; z-index: var(--z-menu); top: calc(100% + var(--space-2)); left: calc(-1 * var(--space-2));
  width: max-content; max-width: min(280px, calc(100vw - 2 * var(--space-4))); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--panel); color: var(--text); box-shadow: var(--shadow-2); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; font-style: normal; font-weight: var(--weight-regular); font-size: var(--type-secondary); line-height: 1.4; text-align: left; white-space: normal;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--motion-fast); }
.info-tip:hover::after, .info-tip:focus::after { opacity: 1; visibility: visible; }

.ux-platforms { border: 0; padding: 0; margin: 0; }
.ux-platforms legend { font-weight: var(--weight-medium); margin-bottom: var(--space-2); padding: 0; }
.ux-platform[hidden] { display: none; }
#ux-current-progress { margin-bottom: var(--space-4); }
#ux-current-progress .ux-review-progress { flex: 1 1 200px; }
#ux-setup .card-h .muted { overflow-wrap: anywhere; text-align: right; }

/* Phones: small buttons are touch targets too (filter chips stay compact). */
@media (max-width: 760px) {
  .btn.small:not(.filters .btn) { min-height: var(--control-lg); }
}

/* The checklist explains what's wrong in full sentences: let them wrap instead of cutting them off. */
body[data-page="checkup"] .item :is(.title, .meta) { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
/* "Show N more" on a long list reads as a link, not a row of data. */
.sign-in-rest > summary { justify-content: flex-start; color: var(--accent); }

/* What the run found: a headline in the result's colour and the lines behind it. */
.run-status-result { display: flex; flex-direction: column; gap: var(--space-1); width: 100%; text-align: left; font-size: var(--type-body); line-height: 1.45; }
.run-status-result > strong { font-size: var(--type-body); font-weight: var(--weight-bold); overflow-wrap: anywhere; }
.run-status-result.ok > strong { color: var(--ok); }
.run-status-result.warn > strong { color: var(--warn); }
.run-status-result.bad > strong { color: var(--bad); }
.run-status-result ul { margin: 0; padding-left: var(--space-5); color: var(--text); }
.run-status-result li { overflow-wrap: anywhere; }
.run-status-notice-list { margin: var(--space-1) 0 0; padding-left: var(--space-5); font-size: var(--type-secondary); line-height: 1.45; color: var(--text); }
.run-status-notice-list li { overflow-wrap: anywhere; }

/* Several bugs found in pasted text: one editable line each. */
.bug-split-list { display: flex; flex-direction: column; gap: var(--space-2); max-height: 50vh; overflow-y: auto; }
.bug-split-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-2); }
.bug-split-row small { grid-column: 2; }

/* Packages page */
.package-row .package-meta { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.package-row .title { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.package-row .side { flex-wrap: wrap; justify-content: flex-end; }
input.package-find { width: 12rem; max-width: 100%; min-height: var(--control-sm); margin-left: auto; }
.package-sources { margin: var(--space-2) 0 0; padding-left: var(--space-5); font-size: var(--type-secondary); overflow-wrap: anywhere; }
@media (max-width: 760px) { .package-row .side { justify-content: flex-start; flex: 1 1 100%; } }

/* Source control chooser on Git setup */
.sc-blurb { margin: 0; line-height: 1.5; }
.sc-option { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); }
.sc-option h3 { font-size: var(--type-body); margin: 0 0 var(--space-1); }
.sc-option ul, .sc-option ol { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--type-body); line-height: 1.45; }
.sc-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.sc-actions { align-items: center; }
.sc-ai { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--border); }
@media (max-width: 760px) { .sc-cols { grid-template-columns: minmax(0, 1fr); } }

/* Loading skeletons: the page's shape while it loads, and a thin bar the moment you navigate. */
.skeleton { display: block; border-radius: var(--r-sm, 6px); background: linear-gradient(90deg, var(--panel-2) 25%, var(--border) 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s ease-in-out infinite; }
.skeleton-page { display: flex; flex-direction: column; gap: var(--space-4); }
.skeleton-card { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); }
.skeleton-line { height: var(--space-4); }
.skeleton-w-30 { width: 30%; } .skeleton-w-70 { width: 70%; } .skeleton-w-90 { width: 90%; }
.skeleton-title { color: transparent; border-radius: var(--r-sm, 6px); background: linear-gradient(90deg, var(--panel-2) 25%, var(--border) 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s ease-in-out infinite; width: min(14em, 60%); }
body.route-loading::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: var(--z-toast, 1000); background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: route-bar 1s ease-in-out infinite; }
@keyframes skeleton-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes route-bar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton, .skeleton-title, body.route-loading::before { animation: none; } }
.skeleton-flush { padding: 0; gap: 0; overflow: hidden; }
.skeleton-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.skeleton-card-head .skeleton-w-30 { width: 30%; }
.skeleton-chips { display: inline-flex; gap: var(--space-2); }
.skeleton-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.skeleton-row:last-child { border-bottom: 0; }
.skeleton-row-main { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; min-width: 0; }
.skeleton-row-main .skeleton-w-70 { width: min(70%, 28rem); }
.skeleton-row-main .skeleton-w-30 { width: min(30%, 12rem); height: var(--space-3); }
.skeleton-pill { width: 72px; height: 24px; border-radius: var(--r-pill); flex: none; }
.skeleton-button { width: 120px; height: var(--control-md, 36px); border-radius: var(--r-md); }
.skeleton-input { width: 100%; height: var(--control-md, 36px); border-radius: var(--r-md); }
.skeleton-field { display: flex; flex-direction: column; gap: var(--space-2); }
.skeleton-field .skeleton-w-30 { width: 25%; height: var(--space-3); }
.skeleton-stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.skeleton-step { height: 56px; border-radius: var(--r-md); }
.skeleton-hero { padding: var(--space-5) var(--space-4); }
.skeleton-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); }
.skeleton-stat { width: 50%; height: var(--space-6, 32px); }
.skeleton-bar { height: var(--space-1); width: 100%; border-radius: var(--r-pill); }
.skeleton-terminal { height: 280px; border-radius: var(--r-md); }
@media (max-width: 760px) {
  .skeleton-stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skeleton-chips { display: none; }
}
/* iPhone Safari zooms the whole page into any field whose text is under 16px when it gets focus, which pushes
   dialogs out to the screen edges. Touch screens get 16px fields everywhere, inline styles included. */
@media (hover: none) and (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]), textarea, select {
    font-size: 16px !important;
  }
}

/* A web project's job page: its branch running in a frame, with pins for pointing out a problem. */
.job-preview-tabs, .job-preview-devices { margin-left: auto; }
.job-preview-tabs + .job-preview-devices { margin-left: 0; }
.job-preview-frame { transition: max-width var(--motion-medium); width: 100%; max-width: 100%; margin-inline: auto; }
.job-preview-devices .btn.on, .job-preview-tabs .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.job-preview-frame[data-device="tablet"] { max-width: 820px; }
.job-preview-frame[data-device="phone"] { max-width: 390px; }
.job-preview-pickbar { padding: var(--space-2) var(--space-3); border-radius: var(--r-md); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); }
.job-preview-pickbar > span { flex: 1 1 200px; }
.job-preview-shot { display: block; max-width: 100%; max-height: 140px; margin: 0 auto var(--space-3): var(--space-3); border: 1px solid var(--border); border-radius: var(--r-md); object-fit: contain; }
.job-preview-chosen { margin: 0 0 var(--space-3); padding-left: var(--space-5); }
.job-preview-frame { position: relative; height: min(70vh, 720px); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--panel); }
.job-preview-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.job-preview-pins { position: absolute; inset: 0; z-index: var(--z-inner); cursor: crosshair; background: color-mix(in srgb, var(--accent) 6%, transparent); outline: 2px dashed var(--accent); outline-offset: -2px; }
.job-preview-hint { position: absolute; top: var(--space-2); left: 50%; transform: translateX(-50%); padding: var(--space-1) var(--space-3); border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: var(--type-secondary); pointer-events: none; }
.job-preview-pin { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--bad); border: 3px solid #fff; box-shadow: var(--shadow); }
.job-preview-ask { align-items: flex-end; }
.job-preview-ask .field { flex: 1 1 auto; margin: 0; }
.job-preview-ask textarea { resize: vertical; min-height: var(--control-lg); }
.job-preview-problems { padding: var(--space-2) var(--space-3); border-radius: var(--r-md); background: color-mix(in srgb, var(--bad) 8%, var(--panel)); border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--border)); }
.job-preview-problems-count { flex: 1 1 200px; color: var(--bad); }
.job-preview-problem-list { margin: var(--space-2) 0 0; padding-left: var(--space-5); max-height: 220px; overflow: auto; overflow-wrap: anywhere; }
@media (max-width: 760px) { .job-preview-frame { height: 60vh; } }

/* Product requirements: each section's header says whether it's written yet. Blue: filled in. Yellow: still to fill in. */
.prd-sec.is-filled > .card-h { background: var(--accent-soft); border-left: 4px solid var(--accent); }
.prd-sec.is-empty > .card-h { background: var(--warn-soft); border-left: 4px solid var(--warn); }
.prd-sec > .card-h .prd-sec-state { margin-left: auto; font-size: var(--type-tag); font-weight: var(--weight-bold); letter-spacing: .04em; }
.prd-sec.is-filled .prd-sec-state { color: var(--accent); }
.prd-sec.is-empty .prd-sec-state { color: var(--warn); }

/* The sidebar's "which computer am I on": the primary for this session, and how many supporting computers it uses. */
/* Machines, under Project: its label, the menu or chip, then a rule and a little room before Search */
.machine-switch { display: flex; flex-direction: column; gap: var(--space-1); padding: 0 var(--space-2) var(--space-4); margin-bottom: var(--space-1); border-bottom: 1px solid var(--border); }
.machine-switch .session-computer { margin: 0; }
.session-computer { display: flex; align-items: center; gap: var(--space-2); margin: 0 var(--space-2); padding: var(--space-1) var(--space-2); min-height: var(--control-sm); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); color: var(--text); font: inherit; font-size: var(--type-secondary); cursor: pointer; text-align: left; }
.session-computer:hover { background: var(--panel-2); }
.session-computer .icon { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; color: var(--muted); }
.session-computer-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--weight-bold); }
.session-primary { background: var(--accent-soft); color: var(--accent); }
.session-not-primary { background: var(--warn-soft); color: var(--warn); }
.session-computer.is-secondary { border-color: var(--warn); }
.session-workers { color: var(--muted); }
/* Under the analytics stats: the provider's region and status, lined up with the stats above. */
.analytics-summary .analytics-provider-row { padding: 0 var(--space-4) var(--space-4); }

/* Home: a brief, source-backed project overview with suggestions that open a draft job. */
.home-project-status { border-color: var(--accent); background: linear-gradient(var(--accent-soft), var(--panel)); overflow: hidden; }
.home-project-status .card-h { flex-wrap: wrap; gap: var(--space-2); }
.home-status-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.home-status-facts li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--space-3); font-size: var(--type-secondary); }
.home-status-facts li > span { min-width: 0; overflow-wrap: anywhere; }
.home-status-facts strong { color: var(--muted); font-weight: var(--weight-medium); }
.home-status-suggestions { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.home-status-suggestions h3 { margin: 0 0 var(--space-3); font-size: var(--type-secondary); }
.home-suggestion-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.home-suggestion { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--panel); font-size: var(--type-secondary); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.home-suggestion:hover, .home-suggestion:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 680px) { .home-suggestion-list { grid-template-columns: 1fr; } .home-status-facts li { grid-template-columns: 1fr; gap: var(--space-1); } }
