/*
  AppStoreKite design system.

  One stylesheet for every page, with no build step. It is laid out as:
    1. Fonts and tokens (light and dark)
    2. Base elements
    3. Pieces used everywhere: buttons, fields, cards, tags, tables
    4. The signed-in shell: sidebar, top bar, page frame
    5. Data pieces: stat tiles, charts, score ring, findings
    6. Page-specific layout
  The public pages (landing, pricing, sign-in) add site.css on top.

  Colours are only ever used through the tokens below, so light and dark
  stay in step. Data-driven sizes live in SVG attributes, because the
  content security policy does not allow style attributes.
*/

/* ---------- 1. Fonts and tokens ---------- */

@font-face {
  font-family: 'Geist';
  src: url('/static/fonts/geist-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/static/fonts/geist-mono-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/static/fonts/instrument-serif-latin-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;

  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  --bg: #f4f5f7;
  --panel: #fcfcfd;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --surface-3: #eaedf2;
  --line: #e4e7ec;
  --line-2: #d2d7df;
  --text: #0c1017;
  --text-2: #454d5c;
  --text-3: #687182;

  --accent: #d83a0b;
  --accent-hover: #bf320a;
  --accent-bright: #ff5a1f;
  --accent-text: #c2380a;
  --accent-soft: #fff0e9;
  --accent-line: #ffd0bb;
  --on-accent: #ffffff;

  --sky: #2a78d6;
  --sky-soft: #e8f1fc;

  --good: #0e7a45;
  --good-solid: #12a05c;
  --good-soft: #e6f6ed;
  --warn: #8f5400;
  --warn-solid: #e59a0b;
  --warn-soft: #fff3da;
  --bad: #b42318;
  --bad-solid: #e0362a;
  --bad-soft: #feecea;
  --info: #1d4ed8;
  --info-solid: #3b82f6;
  --info-soft: #eaf1fe;

  --shadow-xs: 0 1px 2px rgba(12, 16, 23, 0.04);
  --shadow-sm: 0 1px 2px rgba(12, 16, 23, 0.05), 0 2px 6px -2px rgba(12, 16, 23, 0.06);
  --shadow-md: 0 2px 4px rgba(12, 16, 23, 0.04), 0 12px 28px -10px rgba(12, 16, 23, 0.14);
  --shadow-lg: 0 4px 10px rgba(12, 16, 23, 0.05), 0 32px 64px -24px rgba(12, 16, 23, 0.28);
  --ring: 0 0 0 3px rgba(216, 58, 11, 0.22);
  --glow: rgba(255, 90, 31, 0.1);
  --grid-dot: rgba(12, 16, 23, 0.07);
  --fade-from: 0.2;
}

:root[data-theme='dark'],
.force-dark {
  color-scheme: dark;

  --bg: #090b0f;
  --panel: #0e1116;
  --surface: #13161c;
  --surface-2: #191d25;
  --surface-3: #222732;
  --line: #20252e;
  --line-2: #2e3441;
  --text: #f1f3f7;
  --text-2: #b6bcc9;
  --text-3: #8a93a4;

  --accent: #dc3d0d;
  --accent-hover: #f04d1a;
  --accent-bright: #ff6a33;
  --accent-text: #ff7d52;
  --accent-soft: #2a1710;
  --accent-line: #5a2a17;

  --sky: #4a94ec;
  --sky-soft: #132235;

  --good: #4ade80;
  --good-solid: #22c55e;
  --good-soft: #10241a;
  --warn: #fbbf24;
  --warn-solid: #f5a50b;
  --warn-soft: #2a2010;
  --bad: #f87171;
  --bad-solid: #ef4444;
  --bad-soft: #2b1516;
  --info: #7cb0fb;
  --info-solid: #3b82f6;
  --info-soft: #131f36;

  --shadow-xs: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  --ring: 0 0 0 3px rgba(255, 106, 51, 0.32);
  --glow: rgba(255, 106, 51, 0.13);
  --grid-dot: rgba(255, 255, 255, 0.07);
  --fade-from: 0.28;
}

/* Without script there is no saved choice, so the system setting decides. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #090b0f;
    --panel: #0e1116;
    --surface: #13161c;
    --surface-2: #191d25;
    --surface-3: #222732;
    --line: #20252e;
    --line-2: #2e3441;
    --text: #f1f3f7;
    --text-2: #b6bcc9;
    --text-3: #8a93a4;
    --accent: #dc3d0d;
    --accent-hover: #f04d1a;
    --accent-bright: #ff6a33;
    --accent-text: #ff7d52;
    --accent-soft: #2a1710;
    --accent-line: #5a2a17;
    --sky: #4a94ec;
    --sky-soft: #132235;
    --good: #4ade80;
    --good-solid: #22c55e;
    --good-soft: #10241a;
    --warn: #fbbf24;
    --warn-solid: #f5a50b;
    --warn-soft: #2a2010;
    --bad: #f87171;
    --bad-solid: #ef4444;
    --bad-soft: #2b1516;
    --info: #7cb0fb;
    --info-solid: #3b82f6;
    --info-soft: #131f36;
    --shadow-xs: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
    --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 40px 80px -30px rgba(0, 0, 0, 0.9);
    --ring: 0 0 0 3px rgba(255, 106, 51, 0.32);
    --glow: rgba(255, 106, 51, 0.13);
    --grid-dot: rgba(255, 255, 255, 0.07);
    --fade-from: 0.28;
  }
}

/* ---------- 2. Base elements ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}
h1 {
  font-size: 1.7rem;
  letter-spacing: -0.028em;
}
h2 {
  font-size: 1.08rem;
  letter-spacing: -0.015em;
}
h3 {
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
p {
  margin: 0;
  text-wrap: pretty;
}
a {
  color: var(--accent-text);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration: underline;
}
strong {
  font-weight: 620;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
img,
svg {
  display: block;
  max-width: 100%;
}
code,
pre,
kbd {
  font-family: var(--font-mono);
  font-size: 0.86em;
}
code {
  padding: 0.12em 0.4em;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}
::selection {
  background: color-mix(in srgb, var(--accent-bright) 28%, transparent);
}
:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
[hidden] {
  display: none !important;
}

.icon {
  flex: none;
}
.muted {
  color: var(--text-3);
}
.soft {
  color: var(--text-2);
}
.small {
  font-size: 0.87rem;
}
.xs {
  font-size: 0.8rem;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.num {
  font-variant-numeric: tabular-nums;
}
.center {
  text-align: center;
}
.nowrap {
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stack.tight {
  gap: 8px;
}
.stack.loose {
  gap: 24px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.row.top {
  align-items: flex-start;
}
.row.tight {
  gap: 8px;
}
.row.nowrap {
  flex-wrap: nowrap;
}
.grow {
  flex: 1 1 0;
  min-width: 0;
}
.grid {
  display: grid;
  gap: 16px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 860px) {
  .grid.two,
  .grid.three {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- 3. Pieces used everywhere ---------- */

/* Buttons */
.btn {
  --btn-bg: var(--accent);
  --btn-fg: var(--on-accent);
  --btn-line: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--btn-line);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 560;
  letter-spacing: -0.005em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(120, 30, 5, 0.3);
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.08s, color 0.15s;
}
.btn:hover {
  --btn-bg: var(--accent-hover);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn.secondary {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-line: var(--line-2);
  box-shadow: var(--shadow-xs);
}
.btn.secondary:hover {
  --btn-bg: var(--surface-2);
}
.btn.quiet {
  --btn-bg: transparent;
  --btn-fg: var(--text-2);
  box-shadow: none;
}
.btn.quiet:hover {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
}
.btn.ink {
  --btn-bg: var(--text);
  --btn-fg: var(--panel);
  box-shadow: var(--shadow-xs);
}
.btn.ink:hover {
  --btn-bg: color-mix(in srgb, var(--text) 86%, var(--panel));
}
.btn.danger {
  --btn-bg: var(--surface);
  --btn-fg: var(--bad);
  --btn-line: color-mix(in srgb, var(--bad-solid) 40%, var(--line-2));
  box-shadow: var(--shadow-xs);
}
.btn.danger:hover {
  --btn-bg: var(--bad-soft);
}
/* The last step of something that cannot be undone is a solid red button. */
dialog.confirm .btn.danger {
  --btn-bg: #c52a1e;
  --btn-fg: #fff;
  --btn-line: transparent;
}
dialog.confirm .btn.danger:hover {
  --btn-bg: #ab2318;
}
.btn.sm {
  height: 32px;
  padding: 0 11px;
  font-size: 0.84rem;
  border-radius: var(--r-sm);
  gap: 6px;
}
.btn.lg {
  height: 48px;
  padding: 0 22px;
  font-size: 1rem;
  border-radius: 12px;
}
.btn.block {
  display: flex;
  width: 100%;
}
.btn.icon-only {
  width: 38px;
  padding: 0;
}
.btn.sm.icon-only {
  width: 32px;
}
.btn[disabled],
.btn.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  font-weight: 540;
  cursor: pointer;
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link.subtle {
  color: var(--text-2);
}
.link.danger {
  color: var(--bad);
}
form.inline {
  display: inline;
}

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-margin-top: 96px;
}
.field > label,
.label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.87rem;
  font-weight: 560;
  color: var(--text);
}
/* Two short fields side by side, stacked on a narrow screen. */
.field-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 12px;
}
@media (max-width: 520px) {
  .field-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}
.label-note {
  font-weight: 400;
  color: var(--text-3);
  font-size: 0.82rem;
}
.hint {
  font-size: 0.82rem;
  color: var(--text-3);
}
input:not([type='checkbox'], [type='radio'], [type='hidden']),
textarea,
select {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.93rem;
  line-height: 1.45;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
textarea {
  resize: vertical;
  min-height: 72px;
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23808898' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 9.500l5.500 5.500 5.500-5.500'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--text-3) 75%, transparent);
}
input:hover,
textarea:hover,
select:hover {
  border-color: color-mix(in srgb, var(--text-3) 55%, var(--line-2));
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: var(--ring);
}
.field.is-over input,
.field.is-over textarea {
  border-color: var(--bad-solid);
}
.field:target > label {
  color: var(--accent-text);
}
.field:target input,
.field:target textarea,
.field:target select {
  border-color: var(--accent-bright);
  box-shadow: var(--ring);
}
.field-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 16px;
}
.field-foot .meter {
  flex: 1 1 auto;
}
.counter {
  flex: none;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.counter.over {
  color: var(--bad);
  font-weight: 560;
}
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 0.87rem;
  font-weight: 560;
}

/* A choice shown as a card: used for the token level and the theme. */
.choices {
  display: grid;
  gap: 8px;
}
.choice {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.choice:hover {
  border-color: color-mix(in srgb, var(--text-3) 55%, var(--line-2));
}
.choice input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}
.choice:has(input:checked) {
  border-color: var(--accent-bright);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-bright);
}
.choice strong {
  display: block;
  font-size: 0.92rem;
}
.choice span {
  color: var(--text-2);
  font-size: 0.86rem;
}

/* A switch: a checkbox drawn as a toggle. */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.switch input {
  appearance: none;
  flex: none;
  width: 40px;
  height: 24px;
  margin: 0;
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  position: relative;
  cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s;
}
.switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s;
}
.switch input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.switch input:checked::after {
  transform: translateX(16px);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  padding: 22px;
  min-width: 0;
}
.card.flush {
  padding: 0;
  overflow: hidden;
}
.card.inset {
  background: var(--surface-2);
  box-shadow: none;
}
.card.dashed {
  background: transparent;
  border-style: dashed;
  border-color: var(--line-2);
  box-shadow: none;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
/* A head whose controls drop under the heading when the two do not fit side by side. */
.card-head.wraps {
  flex-wrap: wrap;
  gap: 12px 16px;
}
.card.flush > .card-head {
  padding: 20px 22px 0;
}
.card-head p {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 0.87rem;
}
.card-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 0.84rem;
}
.card.flush > .card-foot {
  margin-top: 0;
  padding: 14px 22px;
}

/* An icon in a soft tile, used at the head of cards and steps. */
.glyph {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.glyph.accent {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text);
}
.glyph.sky {
  background: var(--sky-soft);
  border-color: color-mix(in srgb, var(--sky) 30%, var(--line));
  color: var(--sky);
}
.glyph.good {
  background: var(--good-soft);
  border-color: color-mix(in srgb, var(--good-solid) 30%, var(--line));
  color: var(--good);
}
.glyph.lg {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

/* Tags: a short status word. Colour always comes with a word, never alone. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.74rem;
  font-weight: 580;
  letter-spacing: 0.005em;
  white-space: nowrap;
  vertical-align: middle;
}
.tag .icon {
  width: 12px;
  height: 12px;
}
.tag.pass,
.tag.good {
  background: var(--good-soft);
  border-color: color-mix(in srgb, var(--good-solid) 35%, transparent);
  color: var(--good);
}
.tag.error,
.tag.bad {
  background: var(--bad-soft);
  border-color: color-mix(in srgb, var(--bad-solid) 35%, transparent);
  color: var(--bad);
}
.tag.warn,
.tag.sample {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn-solid) 40%, transparent);
  color: var(--warn);
}
.tag.tip,
.tag.info {
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--info-solid) 35%, transparent);
  color: var(--info);
}
.tag.accent {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text);
}
.tag.dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Notices and the message that follows an action */
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.9rem;
}
.notice .icon {
  margin-top: 2px;
}
.notice.ok {
  background: var(--good-soft);
  border-color: color-mix(in srgb, var(--good-solid) 35%, transparent);
  color: var(--good);
}
.notice.error {
  background: var(--bad-soft);
  border-color: color-mix(in srgb, var(--bad-solid) 35%, transparent);
  color: var(--bad);
}
.notice.warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn-solid) 40%, transparent);
  color: var(--warn);
}
.notice strong {
  color: inherit;
}
.flash {
  margin-bottom: 20px;
  animation: flash-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes flash-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th,
td {
  padding: 11px 22px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  padding-top: 9px;
  padding-bottom: 9px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: background-color 0.12s;
}
tbody tr:hover {
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
td.strong {
  font-weight: 560;
}

/* Code blocks with a copy button */
.code {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.code pre {
  margin: 0;
  padding: 13px 52px 13px 14px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.code.wrap pre {
  white-space: pre-wrap;
  word-break: break-all;
}
.code .copy {
  position: absolute;
  top: 6px;
  right: 6px;
}
.copy.is-done {
  color: var(--good);
}

/* A row of choices where one is active: used for chart metrics and snippets */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  max-width: 100%;
  overflow-x: auto;
}
.seg button,
.seg a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 540;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.seg button:hover,
.seg a:hover {
  color: var(--text);
}
.seg [aria-selected='true'],
.seg [aria-pressed='true'],
.seg [aria-current='page'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.js [data-panel]:not(.is-active) {
  display: none;
}

/* Fold-away sections */
details > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
details > summary::-webkit-details-marker {
  display: none;
}
.fold > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 560;
}
.fold > summary::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
  margin-right: 3px;
}
.fold[open] > summary::before {
  transform: rotate(45deg);
}
.fold > summary:hover {
  color: var(--text);
}
.fold[open] > summary {
  margin-bottom: 14px;
}

/* Empty states */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 44px 24px;
}
.empty h2 {
  font-size: 1.2rem;
}
.empty p {
  max-width: 46ch;
  color: var(--text-2);
}
.empty .btn {
  margin-top: 8px;
}
.empty-art {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: radial-gradient(120% 120% at 20% 10%, var(--accent-soft), var(--surface-2));
  border: 1px solid var(--line);
  color: var(--accent-text);
  margin-bottom: 6px;
}

/* A confirmation asked in a dialog, in place of the browser's own prompt */
dialog.confirm {
  width: min(420px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog.confirm::backdrop {
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(3px);
}
dialog.confirm h2 {
  margin-bottom: 8px;
}
dialog.confirm p {
  color: var(--text-2);
}
dialog.confirm .row {
  margin-top: 20px;
  justify-content: flex-end;
}

/* ---------- 4. The signed-in shell ---------- */

.shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 12px 12px 14px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 640;
  font-size: 1.04rem;
  letter-spacing: -0.025em;
  text-decoration: none;
}
.brand:hover {
  text-decoration: none;
}
.brand .kite {
  filter: drop-shadow(0 3px 6px rgba(255, 90, 31, 0.3));
}
.sidebar .brand {
  padding: 4px 8px;
}

/* The app switcher */
.switcher {
  position: relative;
}
.switcher > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s;
}
.switcher > summary:hover {
  border-color: var(--line-2);
}
.switcher .who {
  flex: 1 1 0;
  min-width: 0;
  line-height: 1.25;
}
.switcher .who strong,
.switcher .who span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.switcher .who strong {
  font-size: 0.9rem;
}
.switcher .who span {
  font-size: 0.76rem;
  color: var(--text-3);
}
.switcher > summary > .icon {
  color: var(--text-3);
  transition: transform 0.15s;
}
.switcher[open] > summary > .icon {
  transform: rotate(180deg);
}
.switcher-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: pop 0.14s ease-out;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}
.switcher-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 520;
  text-decoration: none;
}
.switcher-menu a:hover {
  background: var(--surface-2);
}
.switcher-menu a span:not(.avatar) {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.switcher-menu a .icon {
  color: var(--accent-text);
}
.switcher-menu hr {
  margin: 6px 0;
}
.switcher-menu .add {
  color: var(--text-2);
}

/* The square with an app's first letter */
.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0;
  background: linear-gradient(140deg, #ff7a45, #d83a0b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.avatar.lg {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 1.1rem;
}
.avatar.sm {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 0.7rem;
}
.avatar.round {
  border-radius: 50%;
}
.avatar.tone-1 {
  background: linear-gradient(140deg, #ff7a45, #d83a0b);
}
.avatar.tone-2 {
  background: linear-gradient(140deg, #5aa2f3, #2462c0);
}
.avatar.tone-3 {
  background: linear-gradient(140deg, #35c595, #0d7f5b);
}
.avatar.tone-4 {
  background: linear-gradient(140deg, #a08af5, #5a41d1);
}
.avatar.tone-5 {
  background: linear-gradient(140deg, #f2a43a, #c66a05);
}
.avatar.tone-6 {
  background: linear-gradient(140deg, #ee7fa9, #c23a6f);
}
.avatar.ghost {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--line);
  box-shadow: none;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-label {
  padding: 0 10px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: 0.91rem;
  font-weight: 520;
  text-decoration: none;
  transition: background-color 0.12s, color 0.12s;
}
.side-link:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
  color: var(--text);
  text-decoration: none;
}
.side-link .icon {
  color: var(--text-3);
  transition: color 0.12s;
}
.side-link[aria-current='page'] {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  font-weight: 580;
  box-shadow: var(--shadow-sm);
}
.side-link[aria-current='page'] .icon {
  color: var(--accent-text);
}
.side-link .count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.7rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: 0.82rem;
  color: var(--text-2);
}
.plan-box .row {
  margin-bottom: 8px;
}
.plan-box strong {
  color: var(--text);
  font-size: 0.86rem;
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 2px 6px;
}
.me .who {
  flex: 1 1 0;
  min-width: 0;
  line-height: 1.25;
}
.me .who strong,
.me .who span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me .who strong {
  font-size: 0.86rem;
}
.me .who span {
  font-size: 0.75rem;
  color: var(--text-3);
}

/* Light, dark or system */
.theme {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.theme button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.theme button:hover {
  color: var(--text);
}
.theme button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
html:not(.js) .theme {
  display: none;
}

.main {
  min-width: 0;
  padding: 10px 10px 10px 0;
}
.panel {
  min-height: calc(100dvh - 20px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 30px 36px 72px;
}
.page.narrow {
  max-width: 760px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.page-head .lead {
  margin-top: 6px;
  max-width: 62ch;
  color: var(--text-2);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.84rem;
  color: var(--text-3);
}
.crumbs a {
  color: var(--text-3);
}
.crumbs a:hover {
  color: var(--text);
}
.crumbs .icon {
  width: 13px;
  height: 13px;
}
.title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sections {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar,
.nav-toggle,
.scrim {
  display: none;
}

@media (max-width: 940px) {
  .shell {
    display: block;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 56px;
    padding: 0 14px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    background: var(--bg);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    visibility: hidden;
  }
  .nav-toggle:checked ~ .sidebar {
    transform: none;
    visibility: visible;
  }
  .nav-toggle:checked ~ .scrim {
    display: block;
    position: fixed;
    z-index: 35;
    inset: 0;
    background: rgba(8, 10, 14, 0.5);
    backdrop-filter: blur(2px);
  }
  .main {
    padding: 0;
  }
  .panel {
    min-height: calc(100dvh - 56px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .page {
    padding: 22px 16px 56px;
  }
  h1 {
    font-size: 1.45rem;
  }
}

/* ---------- 5. Data pieces ---------- */

/* Stat tiles */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
}
.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  min-height: 132px;
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}
.kpi-label {
  font-size: 0.82rem;
  font-weight: 540;
  color: var(--text-2);
}
.kpi-value {
  font-size: 1.75rem;
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.kpi-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  font-size: 0.78rem;
  color: var(--text-3);
}
.kpi .spark {
  margin: auto 0 14px;
  padding-top: 8px;
  width: 100%;
  height: 46px;
  overflow: visible;
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-2);
}
.delta .icon {
  width: 13px;
  height: 13px;
}
.delta.good {
  color: var(--good);
}
.delta.bad {
  color: var(--bad);
}
.delta.pill {
  height: 22px;
  padding: 0 8px 0 6px;
  border-radius: var(--r-full);
  background: var(--surface-2);
}
.delta.pill.good {
  background: var(--good-soft);
}
.delta.pill.bad {
  background: var(--bad-soft);
}

.spark-line {
  fill: none;
  stroke: var(--sky);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spark-dot {
  fill: none;
  stroke: var(--accent-bright);
  stroke-width: 7;
  stroke-linecap: round;
}

/* The fills under a line fade from the line's colour to nothing. Their
   gradients are written once into each page (chartDefs in charts.js). */
.chart-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.fade-sky {
  stop-color: var(--sky);
}
.fade-accent {
  stop-color: var(--accent-bright);
}
.fade-from {
  stop-opacity: var(--fade-from);
}
.fade-to {
  stop-opacity: 0;
}

/* Charts */
.chart {
  margin: 0;
}
.chart-body {
  display: flex;
  gap: 10px;
  height: 232px;
}
.chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  min-width: 30px;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.chart-y span {
  height: 0;
  line-height: 0;
}
.chart-plot {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  border-radius: 4px;
  cursor: crosshair;
  touch-action: pan-y;
}
.chart-plot:focus-visible {
  outline-offset: 6px;
}
.chart-plot svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  fill: none;
}
.chart-base {
  stroke: var(--line-2);
  stroke-dasharray: none;
}
.chart-line {
  fill: none;
  stroke: var(--sky);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-dot-ring {
  fill: none;
  stroke: var(--surface);
  stroke-width: 13;
  stroke-linecap: round;
}
.chart-dot {
  fill: none;
  stroke: var(--accent-bright);
  stroke-width: 9;
  stroke-linecap: round;
}
.chart-score .chart-line {
  stroke: var(--accent-bright);
}
.chart-x {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 0 40px;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.chart-x span {
  width: 0;
  display: flex;
  justify-content: center;
  white-space: nowrap;
}
.chart-x span:first-child {
  justify-content: flex-start;
}
.chart-x span:last-child {
  justify-content: flex-end;
}
.chart-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--text-3);
  pointer-events: none;
}
.chart-cursor::after {
  content: '';
  position: absolute;
  left: -5px;
  top: var(--y, 0);
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--sky);
  border: 2px solid var(--surface);
}
.chart-score .chart-cursor::after {
  background: var(--accent-bright);
}
.chart-tip {
  position: absolute;
  z-index: 5;
  top: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--text-3);
  line-height: 1.35;
}
.chart-tip strong {
  display: block;
  font-size: 0.98rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Score ring */
.ring {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
}
.ring svg {
  display: block;
}
.ring-track {
  stroke: var(--surface-3);
}
.ring-value {
  stroke: var(--accent-bright);
  animation: ring-draw 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes ring-draw {
  from {
    stroke-dasharray: 0 1000;
  }
}
.ring-good .ring-value {
  stroke: var(--good-solid);
}
.ring-fair .ring-value {
  stroke: var(--warn-solid);
}
.ring-poor .ring-value {
  stroke: var(--bad-solid);
}
.ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.ring-text strong {
  font-size: 2.3rem;
  font-weight: 640;
  letter-spacing: -0.04em;
}
.ring-text span {
  font-size: 0.72rem;
  color: var(--text-3);
}
.ring.sm .ring-text strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.ring.md .ring-text strong {
  font-size: 1.65rem;
}

/* The small audit card on other pages. It sizes its own columns, because it sits in wide and narrow places. */
.digest {
  container-type: inline-size;
}
.digest-top {
  display: flex;
  align-items: center;
  gap: 16px;
}
.digest-top h3 {
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}
.digest-top .counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.areas-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 22px;
  margin-top: 18px;
}
@container (max-width: 430px) {
  .areas-mini {
    grid-template-columns: minmax(0, 1fr);
  }
}
.audit-note {
  margin-top: 10px;
  max-width: 44ch;
}

/* Meters */
.meter {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: var(--r-full);
  overflow: hidden;
}
.meter-track {
  fill: var(--surface-3);
}
.meter-fill {
  fill: var(--accent-bright);
}
.meter-good .meter-fill {
  fill: var(--good-solid);
}
.meter-fair .meter-fill {
  fill: var(--warn-solid);
}
.meter-poor .meter-fill {
  fill: var(--bad-solid);
}
.meter-sky .meter-fill {
  fill: var(--sky);
}
.meter-neutral .meter-fill {
  fill: var(--text-3);
}

/* Findings from the listing audit */
.findings {
  display: flex;
  flex-direction: column;
}
.finding {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.finding:first-child {
  border-top: 0;
  padding-top: 4px;
}
.finding:last-child {
  padding-bottom: 2px;
}
.finding-mark {
  grid-row: 1 / span 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.finding.error .finding-mark {
  background: var(--bad-soft);
  color: var(--bad);
}
.finding.warn .finding-mark {
  background: var(--warn-soft);
  color: var(--warn);
}
.finding.tip .finding-mark {
  background: var(--info-soft);
  color: var(--info);
}
.finding.pass .finding-mark {
  background: var(--good-soft);
  color: var(--good);
}
.finding-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.93rem;
  font-weight: 580;
  line-height: 1.35;
}
.finding-body {
  color: var(--text-2);
  font-size: 0.89rem;
  overflow-wrap: anywhere;
}
.finding-fix {
  margin-top: 4px;
  color: var(--text);
  font-size: 0.89rem;
}
.finding-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-3);
}
.finding-meta a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 540;
}
.findings.compact .finding {
  padding: 10px 0;
}
.findings.compact .finding:first-child {
  padding-top: 0;
}
.findings.compact .finding-title {
  color: var(--text);
}
.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 2px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}
.group-title:first-child {
  margin-top: 0;
}
.group-title b {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 0.7rem;
  letter-spacing: 0;
}

/* ---------- 6. Page-specific layout ---------- */

/* Apps home */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.app-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.app-card .go {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--text-3);
  transition: color 0.18s, transform 0.18s;
}
.app-card:hover .go {
  color: var(--accent-text);
  transform: translate(2px, -2px);
}
.app-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 28px;
}
.app-card-head h2 {
  font-size: 1.02rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-card-head p {
  color: var(--text-3);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-card-score {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.app-card-score .counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.app-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  white-space: nowrap;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-3);
}
.add-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
}
.add-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The start page for an account with no apps */
.welcome {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.welcome-copy {
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: radial-gradient(90% 120% at 0% 0%, var(--glow), transparent 60%);
}
.welcome-copy h2 {
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}
.welcome-form {
  padding: 36px;
  border-left: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}
@media (max-width: 860px) {
  .welcome {
    grid-template-columns: minmax(0, 1fr);
  }
  .welcome-copy,
  .welcome-form {
    padding: 24px;
  }
  .welcome-form {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
.steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: step;
}
.steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 12px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.steps li strong {
  font-size: 0.93rem;
}
.steps li span,
.steps li p {
  grid-column: 2;
  color: var(--text-2);
  font-size: 0.88rem;
}

/* Briefing */
.brief {
  position: relative;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: radial-gradient(70% 140% at 100% 0%, var(--glow), transparent 55%), var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.brief-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.brief h2 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}
.headline .phrase {
  display: inline-block;
}
.headline {
  max-width: 44ch;
  font-size: clamp(1.45rem, 2.4vw, 1.95rem);
  font-weight: 620;
  letter-spacing: -0.032em;
  line-height: 1.16;
  text-wrap: balance;
}
.brief-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: 0.84rem;
  color: var(--text-2);
}
.chip b {
  color: var(--text);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.chip.good .icon {
  color: var(--good);
}
.chip.bad .icon {
  color: var(--bad);
}
.chip.accent .icon {
  color: var(--accent-text);
}
/* The briefing below its numbers: what to do and the charts in a main
   column, what changed and the listing's health in a rail beside it. On a
   narrow screen the two fold into one column, with what changed second. */
.brief-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.brief-main,
.brief-rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
@media (max-width: 1080px) {
  .brief-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .brief-grid > * > * {
    min-width: 0;
  }
  .brief-main,
  .brief-rail {
    display: contents;
  }
  .brief-grid > * > * {
    order: 3;
  }
  .brief-main > :first-child {
    order: 1;
  }
  .brief-rail > :first-child {
    order: 2;
  }
  .brief-rail > :last-child:not(:first-child) {
    order: 4;
  }
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.split.even {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.split.wide-left {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}
@media (max-width: 1080px) {
  .split,
  .split.even,
  .split.wide-left {
    grid-template-columns: minmax(0, 1fr);
  }
}

.todo {
  display: flex;
  flex-direction: column;
  counter-reset: todo;
}
.todo li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 2px 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  counter-increment: todo;
}
.todo li:first-child {
  border-top: 0;
  padding-top: 2px;
}
.todo li:last-child {
  padding-bottom: 0;
}
.todo li::before {
  content: counter(todo);
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.todo strong {
  font-size: 0.94rem;
  line-height: 1.35;
}
.todo p {
  grid-column: 2;
  color: var(--text-2);
  font-size: 0.88rem;
}
.todo .btn {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
}
@media (max-width: 520px) {
  .todo li {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .todo .btn {
    grid-column: 2;
    grid-row: auto;
    justify-self: start;
    margin-top: 6px;
  }
}

.changes {
  display: flex;
  flex-direction: column;
}
.changes li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--text-2);
}
.changes li:first-child {
  border-top: 0;
  padding-top: 2px;
}
.changes li:last-child {
  padding-bottom: 0;
}
.move {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-3);
}
.good > .move {
  background: var(--good-soft);
  color: var(--good);
}
.bad > .move {
  background: var(--bad-soft);
  color: var(--bad);
}

.notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px dashed var(--line-2);
  color: var(--text-3);
  font-size: 0.84rem;
}
.notes li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}
.notes .icon {
  margin-top: 3px;
  width: 14px;
  height: 14px;
}

/* Search positions */
.pos {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.pos b {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 620;
}
.pos.top b {
  background: var(--good-soft);
  border-color: color-mix(in srgb, var(--good-solid) 35%, transparent);
  color: var(--good);
}
.bar-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.bar-cell .meter {
  width: 72px;
  flex: none;
}

/* Listing audit */
.audit-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 26px 28px;
}
.audit-score {
  display: flex;
  align-items: center;
  gap: 22px;
}
.audit-score h2 {
  font-size: 1.3rem;
  letter-spacing: -0.025em;
}
.audit-score .counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 22px;
  padding-left: 28px;
  border-left: 1px solid var(--line);
}
.area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  align-items: center;
  font-size: 0.84rem;
  color: var(--text-2);
}
.area .meter {
  grid-column: 1 / -1;
}
.area b {
  font-size: 0.78rem;
  font-weight: 560;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1080px) {
  .audit-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .areas {
    padding: 22px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 520px) {
  .audit-top {
    padding: 20px;
  }
  .audit-score {
    flex-direction: column;
    align-items: flex-start;
  }
}
.audit-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.audit-side {
  position: sticky;
  top: 20px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
@media (max-width: 1080px) {
  .audit-cols {
    grid-template-columns: minmax(0, 1fr);
  }
  .audit-side {
    position: static;
    max-height: none;
    order: -1;
  }
}
.listing-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.form-group:first-of-type {
  padding-top: 0;
  border-top: 0;
}
.form-group > h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.form-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 -22px -22px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(14px);
}

/* The listing preview: the developer's own words, laid out like a listing */
.preview {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.preview-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.preview-card strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.preview-card span {
  color: var(--text-2);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
.preview-intro {
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.preview-details {
  color: var(--text-2);
  font-size: 0.88rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.preview-features {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.87rem;
  color: var(--text-2);
}
.preview-features li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}
.preview-features .icon {
  margin-top: 4px;
  color: var(--good);
}
.preview-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.is-placeholder {
  color: var(--text-3) !important;
  font-weight: 400 !important;
}
.cut {
  color: var(--bad);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--bad) 55%, transparent);
}

/* Connections */
.conn {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.conn-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.conn-head h2 {
  flex: 1 1 0;
}
.gets {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.9rem;
  color: var(--text-2);
}
.gets li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
}
.gets .icon {
  margin-top: 3px;
  color: var(--good);
}
.conn details > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 560;
}
.conn details > summary::before {
  content: '';
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.conn details[open] > summary::before {
  transform: rotate(45deg);
}
.conn details[open] > summary {
  margin-bottom: 14px;
}
.conn form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.conn ol {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 20px;
  list-style: decimal;
  color: var(--text-2);
  font-size: 0.89rem;
}
.promise {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 24px;
  padding: 20px 22px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
}
.promise li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  gap: 2px 10px;
  font-size: 0.86rem;
  color: var(--text-2);
}
.promise .icon {
  grid-row: 1 / span 2;
  margin-top: 2px;
  color: var(--text-3);
}
.promise strong {
  color: var(--text);
  font-size: 0.88rem;
}

/* Moving between pages: the browser fades the old page into the new one.
   The sidebar and the public top bar keep their place, so only the content
   changes. Browsers without this simply load the page as before. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  .sidebar {
    view-transition-name: sidebar;
  }
  .site-top {
    view-transition-name: site-top;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.16s;
  }
  ::view-transition-group(sidebar),
  ::view-transition-group(site-top) {
    animation-duration: 0s;
  }
}

/* Assistants */
.token-new {
  border-color: color-mix(in srgb, var(--good-solid) 45%, var(--line));
  background: radial-gradient(80% 140% at 0% 0%, color-mix(in srgb, var(--good-solid) 10%, transparent), transparent 60%), var(--surface);
}
.level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 560;
  text-transform: capitalize;
}
.level i {
  display: inline-flex;
  gap: 2px;
}
.level i::before,
.level i::after,
.level i b {
  content: '';
  width: 5px;
  height: 12px;
  border-radius: 2px;
  background: var(--surface-3);
}
.level.read i::before,
.level.prepare i::before,
.level.prepare i b,
.level.act i::before,
.level.act i b,
.level.act i::after {
  background: var(--accent-bright);
}
.tool-list {
  display: flex;
  flex-direction: column;
}
.tool-list .level {
  min-width: 84px;
}
.tool-list li {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: baseline;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--text-2);
}
.tool-list li:first-child {
  border-top: 0;
}
.tool-list code {
  justify-self: start;
}
@media (max-width: 720px) {
  .tool-list li {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .tool-list li > span {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Approvals */
.approval {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 20px 22px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
  background: radial-gradient(60% 160% at 0% 0%, var(--glow), transparent 60%), var(--surface);
  box-shadow: var(--shadow-sm);
}
.approval h2 {
  font-size: 1rem;
}
.approval p {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 0.85rem;
}
@media (max-width: 720px) {
  .approval {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .approval > .row {
    grid-column: 1 / -1;
  }
}

/* Settings */
.setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px 40px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.setting:first-child {
  border-top: 0;
  padding-top: 4px;
}
.setting > div:first-child p {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 0.87rem;
}
.setting form,
.setting .stack {
  max-width: 480px;
}
@media (max-width: 860px) {
  .setting {
    grid-template-columns: minmax(0, 1fr);
  }
}
.kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 20px;
  font-size: 0.9rem;
}
.kv dt {
  color: var(--text-3);
}
.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.danger-zone {
  border-color: color-mix(in srgb, var(--bad-solid) 30%, var(--line));
}

/* The email preview frame */
.mail-frame {
  width: 100%;
  height: min(1100px, 82dvh);
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #f3f4f6;
}

/* Error pages */
.lost {
  min-height: 60dvh;
  display: grid;
  place-items: center;
}
.lost-card {
  gap: 12px;
}
.lost-card h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  letter-spacing: -0.035em;
}
/* The number sits behind, faint, and the kite drifts in front of it. */
.lost-sky {
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}
.lost-sky > * {
  grid-area: 1 / 1;
}
.lost .code-big {
  font-size: clamp(6.5rem, 22vw, 11rem);
  font-weight: 680;
  letter-spacing: -0.06em;
  line-height: 0.9;
  color: transparent;
  background: linear-gradient(180deg, var(--line-2), transparent 92%);
  -webkit-background-clip: text;
  background-clip: text;
  user-select: none;
}
.lost-kite {
  display: grid;
  filter: drop-shadow(0 14px 22px rgba(255, 90, 31, 0.38));
  animation: drift 6s ease-in-out infinite;
}
@keyframes drift {
  50% {
    transform: translate(10px, -12px) rotate(-7deg);
  }
}
.lost-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
.lost-actions .btn {
  margin-top: 0;
}

/* Phones: tighter tables, two stat tiles across, and controls that scroll sideways and never push the page wide. */
@media (max-width: 600px) {
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .card-head {
    flex-wrap: wrap;
  }
  .card-head > .seg {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .card-head > .seg button {
    flex: none;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi {
    padding: 14px 14px 0;
  }
  .kpi:last-child:nth-child(odd) {
    grid-column: span 2;
  }
  .kpi-value {
    font-size: 1.5rem;
  }
  th,
  td {
    padding-left: 14px;
    padding-right: 14px;
  }
  .card.flush > .card-head {
    padding: 18px 16px 0;
  }
  .bar-cell .meter {
    display: none;
  }
}

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

@media print {
  .sidebar,
  .topbar,
  .form-actions,
  .theme {
    display: none !important;
  }
  .shell {
    display: block;
  }
  .panel {
    border: 0;
    box-shadow: none;
  }
}

/* ---------- The Built for Shopify self-check ---------- */

.bfs-top .notice {
  margin-top: 18px;
}
.bfs-top a.area {
  text-decoration: none;
  border-radius: var(--r-xs);
}
.bfs-top a.area:hover span {
  color: var(--text);
}
.bfs-form {
  position: relative;
}
.bfs-num {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  margin-right: 10px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 620;
  letter-spacing: 0;
  vertical-align: 2px;
}
.req-progress {
  flex: none;
  font-size: 0.84rem;
  color: var(--text-3);
  white-space: nowrap;
}
.req-progress b {
  color: var(--text);
  font-weight: 620;
}
.req-group {
  margin-top: 20px;
}
.req {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 96px;
}
.req-group > .eyebrow + .req,
.cat-items > .req:first-child {
  border-top: 0;
}
.req-num {
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
}
.req:has(.tri-met input:checked) .req-num {
  color: var(--good);
}
.req:has(.tri-not_met input:checked) .req-num {
  color: var(--warn);
}
.req-body strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.req-body p {
  margin-top: 2px;
  max-width: 68ch;
  color: var(--text-2);
  font-size: 0.89rem;
}
.req-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.req-tags .tag {
  height: auto;
  min-height: 22px;
  padding-block: 2px;
  white-space: normal;
}
.req-fold {
  margin-top: 8px;
}
.req-fold > summary {
  font-size: 0.84rem;
  font-weight: 520;
  color: var(--text-3);
}
.req-fold[open] > summary {
  margin-bottom: 6px;
}
.req-fold ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 20px;
  color: var(--text-2);
  font-size: 0.86rem;
}

/* One answer per requirement: radio buttons drawn as a small switch with two or three positions. */
.tri {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.tri label {
  position: relative;
  cursor: pointer;
}
.tri input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.tri span {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 7px;
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 540;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.tri label:hover span {
  color: var(--text);
}
.tri input:checked + span {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.tri-met input:checked + span {
  background: var(--good-soft);
  color: var(--good);
}
.tri-not_met input:checked + span {
  background: var(--warn-soft);
  color: var(--warn);
}
.tri input:focus-visible + span {
  box-shadow: var(--ring);
}

/* Categories: ticking one opens its requirements. */
.cats {
  margin-top: 6px;
}
.cat {
  border-top: 1px solid var(--line);
}
.cat-pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
}
.cat-pick input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.cat-pick > span:first-of-type {
  display: grid;
}
.cat-pick strong {
  font-size: 0.93rem;
  font-weight: 580;
}
.cat-count {
  white-space: nowrap;
}
.cat-items {
  display: none;
  padding: 0 0 10px 30px;
}
.cat-items > .hint {
  padding-bottom: 6px;
}
.cat:has(.cat-pick input:checked) .cat-items {
  display: block;
}
.cat:has(.cat-pick input:checked) .cat-pick strong {
  color: var(--accent-text);
}
/* A browser too old for :has() shows every list, so nothing is out of reach. */
@supports not selector(:has(*)) {
  .cat-items {
    display: block;
  }
}

/* The save bar stays in reach while the long list scrolls. */
.bfs-actions {
  bottom: 14px;
  margin: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-md);
}
.bfs-about ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bfs-about li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  color: var(--text-2);
  font-size: 0.9rem;
}
.bfs-about li .icon {
  margin-top: 3px;
  color: var(--text-3);
}
@media (max-width: 700px) {
  .req {
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .req .tri {
    grid-column: 2;
    justify-self: start;
    margin-top: 8px;
  }
  .cat-items {
    padding-left: 0;
  }
  .cat-count {
    display: none;
  }
}
