/*
 * Billturn — Atesen Software · design system (tokens copied from the Unapprove system, accent changed)
 *
 * One stylesheet for the signed-in app and the public site. Every colour is a
 * token on :root and is redefined for dark mode, so a component never needs
 * its own media query for colour.
 *
 * Brand rules (API_NOTES §8, compliance notes): no Xero logo, no Xero blue
 * and no cyan family at all. The accent is a deep green (#15803d, 5.0:1 with
 * white text) that cannot be mistaken for the platform's palette.
 *
 * Sections: fonts · tokens · base · layout · app bar · site header/footer ·
 * page header · buttons · forms · cards · notices · badges · tables · stats ·
 * progress · lists · org cards · menus · empty state · marketing · utilities.
 */

/* ---------------------------------------------------------------- fonts --- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin-ext.woff2") format("woff2-variations");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------- tokens --- */

:root {
  color-scheme: light;

  /* neutrals */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --surface-3: #eceef3;
  --border: #e3e6ec;
  --border-strong: #cfd4dd;
  --text: #0e1525;
  --text-2: #3d4659;
  --text-dim: #5f6878;

  /* accent (deep green) */
  --accent: #15803d;
  --accent-hover: #166534;
  --accent-text: #ffffff;
  --accent-ink: #166534;
  --accent-soft: #f0fdf4;
  --accent-line: #bbf7d0;

  /* semantic */
  --ok: #0f7a55;
  --ok-soft: #e8f6ef;
  --ok-line: #b5e1cc;
  --warn: #9a5800;
  --warn-soft: #fff5e3;
  --warn-line: #f3d6a2;
  --danger: #c2302b;
  --danger-solid: #cb3530;
  --danger-hover: #b02a26;
  --danger-soft: #fdeeed;
  --danger-line: #f4c4c1;
  --info: #166534;
  --info-soft: #f0fdf4;
  --info-line: #bbf7d0;

  --focus: #15803d;
  --focus-ring: 0 0 0 3px rgba(21, 128, 61, 0.28);

  /* elevation */
  --shadow-xs: 0 1px 2px rgba(14, 21, 37, 0.05);
  --shadow-sm: 0 1px 3px rgba(14, 21, 37, 0.07), 0 1px 2px rgba(14, 21, 37, 0.04);
  --shadow-md: 0 6px 16px -4px rgba(14, 21, 37, 0.1), 0 2px 4px -2px rgba(14, 21, 37, 0.05);
  --shadow-lg: 0 18px 40px -12px rgba(14, 21, 37, 0.22), 0 4px 10px -4px rgba(14, 21, 37, 0.08);

  /* hero wash */
  --wash-1: rgba(21, 128, 61, 0.1);
  --wash-2: rgba(15, 122, 85, 0.06);

  /* spacing scale (4px base) */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;
  --s16: 64px;
  --s20: 80px;
  --gap: var(--s4);

  /* radius */
  --r-sm: 6px;
  --radius: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 999px;

  /* type */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;

  --maxw: 1160px;
  --maxw-read: 760px;
  --bar-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #0b0d12;
    --surface: #12151c;
    --surface-2: #171b24;
    --surface-3: #1e2330;
    --border: #252b38;
    --border-strong: #343b4b;
    --text: #edf0f6;
    --text-2: #c2c8d4;
    --text-dim: #949cad;

    --accent: #15803d;
    --accent-hover: #166534;
    --accent-text: #ffffff;
    --accent-ink: #4ade80;
    --accent-soft: #0e2a1a;
    --accent-line: #1f5a37;

    --ok: #4fd3a0;
    --ok-soft: #0d2a20;
    --ok-line: #1c4b39;
    --warn: #f2b65c;
    --warn-soft: #2a1f0d;
    --warn-line: #533d14;
    --danger: #ff8b84;
    --danger-solid: #cb3530;
    --danger-hover: #d9443e;
    --danger-soft: #2c1313;
    --danger-line: #5c2523;
    --info: #4ade80;
    --info-soft: #0e2a1a;
    --info-line: #1f5a37;

    --focus: #86efac;
    --focus-ring: 0 0 0 3px rgba(134, 239, 172, 0.35);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, 0.75);

    --wash-1: rgba(34, 197, 94, 0.16);
    --wash-2: rgba(79, 211, 160, 0.06);
  }
}

/* ----------------------------------------------------------------- base --- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

main {
  flex: 1 0 auto;
}

a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

a,
button,
input,
select,
textarea,
summary {
  font: inherit;
}

img,
svg {
  max-width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s6) 0;
}

::selection {
  background: var(--accent-soft);
}

/* ---------------------------------------------------------------- focus --- */

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  box-shadow: var(--focus-ring);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 100;
}

.skip:focus {
  left: 12px;
  top: 12px;
}

/* ------------------------------------------------------------- headings --- */

h1,
h2,
h3,
h4 {
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h1 {
  font-size: 1.75rem;
  letter-spacing: -0.025em;
  margin: 0 0 var(--s2);
}

h2 {
  font-size: 1.1875rem;
  margin: var(--s10) 0 var(--s3);
}

h3 {
  font-size: 1rem;
  margin: var(--s6) 0 var(--s2);
}

p {
  margin: 0 0 var(--s3);
}

ul,
ol {
  margin: 0 0 var(--s3);
  padding-left: 1.25rem;
}

li {
  margin: 0 0 var(--s1);
}

li::marker {
  color: var(--text-dim);
}

.lede {
  color: var(--text-dim);
  font-size: var(--fs-md);
  line-height: 1.6;
  margin: 0 0 var(--s6);
  max-width: 68ch;
}

.muted {
  color: var(--text-dim);
}

.small {
  font-size: var(--fs-sm);
}

strong {
  font-weight: 600;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.88em;
}

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* --------------------------------------------------------------- layout --- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s8) var(--s6) var(--s16);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  align-items: center;
}

.row.end {
  justify-content: flex-end;
}

.spread {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  justify-content: space-between;
}

.stack > * + * {
  margin-top: var(--s3);
}

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 0 0 var(--gap);
}

.cols-2 {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ------------------------------------------------------------ brand mark --- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.98rem;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.logo {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(140deg, #15803d 0%, #14532d 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 1px 2px rgba(14, 21, 37, 0.2);
  color: #fff;
  flex: none;
}

.logo svg {
  width: 16px;
  height: 16px;
}

.brand .by {
  color: var(--text-dim);
  font-weight: 450;
  font-size: var(--fs-sm);
  letter-spacing: 0;
}

/* -------------------------------------------------------------- app bar --- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.appbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--bar-h);
  padding: 0 var(--s6);
  display: flex;
  align-items: center;
  gap: var(--s6);
}

.appnav {
  display: flex;
  gap: var(--s1);
  flex: 1;
  min-width: 0;
}

.appnav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--r-sm);
}

.appnav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.appnav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.who {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 10px;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  min-width: 0;
}

.who-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  border: 1px solid var(--accent-line);
  flex: none;
}

/* ------------------------------------------------------------ app footer --- */

.appfoot {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.appfoot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) var(--s8);
  justify-content: space-between;
  align-items: flex-start;
}

.appfoot p {
  margin: 0;
  max-width: 70ch;
}

.appfoot a {
  color: inherit;
}

.footlinks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footlinks li {
  margin: 0;
}

.footlinks a {
  color: var(--text-dim);
  text-decoration: none;
}

.footlinks a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ------------------------------------------------------------ page header --- */

.pagehead {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 0 var(--s6);
}

.pagehead > div:first-child {
  min-width: 0;
  flex: 1 1 420px;
}

.pagehead h1 {
  margin: 0;
  overflow-wrap: anywhere;
}

.pagehead .lede,
.pagehead .sub {
  margin: var(--s2) 0 0;
}

.sub {
  color: var(--text-dim);
  font-size: var(--fs-base);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 var(--s2);
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--text-dim);
}

.crumbs li {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.crumbs li + li::before {
  content: "/";
  color: var(--border-strong);
}

.crumbs a {
  color: var(--text-dim);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--text);
  text-decoration: underline;
}

.tabs {
  display: flex;
  gap: var(--s1);
  border-bottom: 1px solid var(--border);
  margin: 0 0 var(--s6);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 550;
  white-space: nowrap;
}

.tabs a:hover {
  color: var(--text);
}

.tabs a[aria-current="page"] {
  color: var(--text);
}

.tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.tabs svg {
  width: 15px;
  height: 15px;
  opacity: 0.8;
}

/* -------------------------------------------------------------- buttons --- */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-line: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--btn-line);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  --btn-bg: var(--surface-2);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0.5px);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn.primary {
  --btn-bg: var(--accent);
  --btn-fg: var(--accent-text);
  --btn-line: var(--accent);
  box-shadow: 0 1px 2px rgba(14, 21, 37, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn.primary:hover {
  --btn-bg: var(--accent-hover);
  --btn-line: var(--accent-hover);
}

.btn.danger {
  --btn-fg: var(--danger);
  --btn-line: var(--danger-line);
}

.btn.danger:hover {
  --btn-bg: var(--danger-soft);
}

.btn.danger-solid {
  --btn-bg: var(--danger-solid);
  --btn-fg: #ffffff;
  --btn-line: var(--danger-solid);
}

.btn.danger-solid:hover {
  --btn-bg: var(--danger-hover);
  --btn-line: var(--danger-hover);
}

.btn.ghost {
  --btn-bg: transparent;
  --btn-line: transparent;
  box-shadow: none;
}

.btn.ghost:hover {
  --btn-bg: var(--surface-2);
}

.btn.link {
  --btn-bg: transparent;
  --btn-line: transparent;
  --btn-fg: var(--accent-ink);
  box-shadow: none;
  padding: 4px 2px;
  min-height: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.big {
  min-height: 44px;
  padding: 10px 20px;
  font-size: var(--fs-base);
  border-radius: 10px;
}

.btn.sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: var(--fs-xs);
}

.btn.block {
  width: 100%;
}

form.inline {
  display: inline;
  margin: 0;
}

/* ---------------------------------------------------------------- forms --- */

label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

input[type="text"],
input[type="date"],
input[type="search"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-base);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--text-dim);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
  opacity: 0.8;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23808898' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.5 8 10l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: none;
  cursor: pointer;
}

.field {
  margin: 0 0 var(--s4);
}

.hint {
  display: block;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.filters {
  display: grid;
  gap: var(--s4);
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-items: end;
}

.filters label {
  margin-bottom: 6px;
}

.filters .actions {
  display: flex;
  gap: var(--s2);
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5) var(--s3);
  margin: 0 0 var(--gap);
  min-width: 0;
}

legend {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text);
  padding: 0 6px;
}

.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: var(--s2) 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.12s ease, background-color 0.12s ease;
  cursor: pointer;
}

.choice:hover {
  border-color: var(--border-strong);
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.choice:has(input:disabled) {
  opacity: 0.7;
  cursor: not-allowed;
}

.choice label,
label.choice {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
}

.choices-grid {
  display: grid;
  gap: var(--s2);
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
}

.choices-grid .choice {
  margin: 0;
}

.confirm-input {
  font-family: var(--mono) !important;
  font-size: 1.05rem !important;
  letter-spacing: 0.06em;
  max-width: 320px;
}

/* ---------------------------------------------------------------- cards --- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s5) var(--s6);
  margin: 0 0 var(--gap);
  box-shadow: var(--shadow-xs);
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.card.tight {
  padding: var(--s4);
}

.card.flush {
  padding: 0;
  overflow: hidden;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  justify-content: space-between;
  margin: 0 0 var(--s4);
}

.card-head h2,
.card-head h3 {
  margin: 0;
  font-size: var(--fs-md);
}

.card > .card-foot:last-child {
  margin-bottom: calc(-1 * var(--s5));
}

.card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  align-items: center;
  margin: var(--s5) calc(-1 * var(--s6)) calc(-1 * var(--s5));
  padding: var(--s4) var(--s6);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  margin: var(--s10) 0 var(--s3);
}

.section-title h2 {
  margin: 0;
}

/* ------------------------------------------------------------- notices --- */

.notice {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 16px 12px 44px;
  margin: 0 0 var(--gap);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-base);
}

.notice::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 14px;
  width: 18px;
  height: 18px;
  background: currentColor;
  color: var(--text-dim);
  -webkit-mask: var(--icon-info) center / contain no-repeat;
  mask: var(--icon-info) center / contain no-repeat;
}

.notice p {
  margin: 4px 0;
}

.notice p:first-child {
  margin-top: 0;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice .btn {
  margin-top: var(--s2);
}

.notice.bad {
  background: var(--danger-soft);
  border-color: var(--danger-line);
}

.notice.bad::before {
  color: var(--danger);
  -webkit-mask-image: var(--icon-alert);
  mask-image: var(--icon-alert);
}

.notice.good {
  background: var(--ok-soft);
  border-color: var(--ok-line);
}

.notice.good::before {
  color: var(--ok);
  -webkit-mask-image: var(--icon-check);
  mask-image: var(--icon-check);
}

.notice.warn {
  background: var(--warn-soft);
  border-color: var(--warn-line);
}

.notice.warn::before {
  color: var(--warn);
  -webkit-mask-image: var(--icon-alert);
  mask-image: var(--icon-alert);
}

.notice.info {
  background: var(--info-soft);
  border-color: var(--info-line);
}

.notice.info::before {
  color: var(--info);
}

:root {
  --icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5Zm0 4a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm1.25 9h-2.5v-1.5h.5V10h-.5V8.5h2v4.75h.5v1.5Z'/%3E%3C/svg%3E");
  --icon-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5Zm-.85 4.5h1.7l-.25 5.5h-1.2l-.25-5.5ZM10 12.9a1.1 1.1 0 1 1 0 2.2 1.1 1.1 0 0 1 0-2.2Z'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5Zm3.9 5.9-4.6 5.3a.9.9 0 0 1-1.3.05L5.6 10.6l1.2-1.25 1.7 1.6 4-4.6 1.4 1.3Z'/%3E%3C/svg%3E");
  --icon-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E");
  --icon-cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m4.5 4.5 7 7m0-7-7 7'/%3E%3C/svg%3E");
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.5 8 10l3.5-3.5'/%3E%3C/svg%3E");
  --icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h10m-4-4 4 4-4 4'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------- badges --- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--r-full);
  padding: 2px 9px 2px 8px;
  font-size: var(--fs-xs);
  font-weight: 550;
  line-height: 1.5;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
  vertical-align: middle;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
  flex: none;
}

.pill.ok {
  background: var(--ok-soft);
  border-color: var(--ok-line);
  color: var(--ok);
}

.pill.warn {
  background: var(--warn-soft);
  border-color: var(--warn-line);
  color: var(--warn);
}

.pill.bad {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}

.pill.live {
  background: var(--info-soft);
  border-color: var(--info-line);
  color: var(--info);
}

.pill.live::before {
  animation: pulse 1.4s ease-in-out infinite;
}

.pill.plain::before {
  display: none;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.7);
  }
}

.tag {
  display: inline-block;
  line-height: 1.6;
  border-radius: var(--r-sm);
  padding: 1px 7px;
  font-size: var(--fs-xs);
  font-weight: 550;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
}

.tag.accent {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-ink);
}

/* --------------------------------------------------------------- tables --- */

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  margin: 0 0 var(--gap);
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: var(--fs-sm);
}

caption {
  caption-side: top;
  text-align: left;
  padding: 12px 16px;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--border);
}

th,
td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  background: var(--surface-2);
  font-size: var(--fs-xs);
  font-weight: 550;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  white-space: nowrap;
  padding-top: 9px;
  padding-bottom: 9px;
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: none;
}

tbody tr {
  transition: background-color 0.1s ease;
}

.tablewrap tbody tr:hover {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

tbody tr:has(input[type="checkbox"]:checked) {
  background: var(--accent-soft);
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td.pick,
th.pick {
  width: 44px;
  padding-right: 0;
}

td .small.muted,
td .small {
  margin-top: 2px;
}

.card table th,
.card table td {
  padding-left: 0;
}

.card table th:last-child,
.card table td:last-child {
  padding-right: 0;
}

.card table thead th {
  background: transparent;
}

.table-empty {
  text-align: center;
  color: var(--text-dim);
  padding: var(--s10) var(--s4);
}

/* ---------------------------------------------------------------- stats --- */

.tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.tile > strong:first-child {
  display: block;
  margin-bottom: var(--s1);
}

.tile p {
  margin: var(--s1) 0 0;
}

.tile .n {
  display: block;
  font-size: 1.875rem;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.tile .k {
  display: block;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.tile.ok,
.tile.warn,
.tile.off,
.tile.bad {
  padding-left: calc(var(--s5) + 4px);
}

.tile.ok::before,
.tile.warn::before,
.tile.off::before,
.tile.bad::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--border-strong);
}

.tile.ok::before {
  background: var(--ok);
}

.tile.ok .n {
  color: var(--ok);
}

.tile.warn::before {
  background: var(--warn);
}

.tile.warn .n {
  color: var(--warn);
}

.tile.bad::before {
  background: var(--danger);
}

.tile.off .n {
  color: var(--text-dim);
}

/* ------------------------------------------------------------- progress --- */

.bar {
  height: 8px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, #3ea96a 100%);
  transition: width 0.4s ease;
}

.bar.done > i {
  background: var(--ok);
}

.bar.live > i {
  background-image: linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.18) 25%,
      transparent 25%,
      transparent 50%,
      rgba(255, 255, 255, 0.18) 50%,
      rgba(255, 255, 255, 0.18) 75%,
      transparent 75%
    ),
    linear-gradient(90deg, var(--accent) 0%, #3ea96a 100%);
  background-size: 16px 16px, 100% 100%;
  animation: stripes 1s linear infinite;
}

@keyframes stripes {
  to {
    background-position: 16px 0, 0 0;
  }
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  margin: var(--s3) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--text-dim);
}

.counts li {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.counts li {
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  display: inline-block;
  flex: none;
}

.dot.ok {
  background: var(--ok);
}

.dot.warn {
  background: var(--warn);
}

.dot.bad {
  background: var(--danger);
}

.dot.live {
  background: var(--accent);
}

/* ----------------------------------------------------------- definition --- */

.dl {
  display: grid;
  grid-template-columns: minmax(140px, max-content) 1fr;
  gap: 10px 24px;
  margin: 0;
  font-size: var(--fs-base);
}

.dl dt {
  color: var(--text-dim);
}

.dl dd {
  margin: 0;
  min-width: 0;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.steps li {
  padding: 2px 0;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s3);
}

.checks li {
  position: relative;
  padding-left: 28px;
  margin: 0 0 var(--s3);
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ok-soft);
  box-shadow: inset 0 0 0 1px var(--ok-line);
}

.checks li::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 10px;
  height: 10px;
  background: var(--ok);
  -webkit-mask: var(--icon-tick) center / contain no-repeat;
  mask: var(--icon-tick) center / contain no-repeat;
}

.checks.no li::before {
  background: var(--danger-soft);
  box-shadow: inset 0 0 0 1px var(--danger-line);
}

.checks.no li::after {
  background: var(--danger);
  -webkit-mask-image: var(--icon-cross);
  mask-image: var(--icon-cross);
}

.linklist {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--gap);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.linklist li {
  position: relative;
  margin: 0;
  padding: 14px 44px 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.1s ease;
}

.linklist li:last-child {
  border-bottom: none;
}

.linklist li:hover {
  background: var(--surface-2);
}

.linklist li::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: var(--text-dim);
  -webkit-mask: var(--icon-arrow) center / contain no-repeat;
  mask: var(--icon-arrow) center / contain no-repeat;
  opacity: 0.6;
}

.linklist a {
  color: var(--text);
  text-decoration: none;
  font-weight: 550;
}

.linklist a::before {
  content: "";
  position: absolute;
  inset: 0;
}

.linklist a:hover {
  color: var(--accent-ink);
}

.linklist .small {
  margin-top: 2px;
}

/* ------------------------------------------------------------ org cards --- */

.org-grid {
  display: grid;
  gap: var(--s4);
  grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
  margin: 0 0 var(--s8);
}

.org-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}

.org-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.org-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: var(--s5) var(--s5) 0;
}

.org-avatar {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-ink);
  font-weight: 650;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  flex: none;
}

.org-title {
  min-width: 0;
  flex: 1;
}

.org-title h2 {
  margin: 0 0 4px;
  font-size: var(--fs-md);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.org-body {
  padding: var(--s4) var(--s5);
  flex: 1;
}

.org-last {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px 12px;
  font-size: var(--fs-sm);
}

.org-last .k {
  display: block;
  color: var(--text-dim);
  font-size: var(--fs-xs);
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.org-last a {
  font-weight: 550;
}

.org-note {
  margin: var(--s2) 0 0;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.org-foot {
  display: flex;
  gap: var(--s2);
  align-items: center;
  padding: var(--s3) var(--s5);
  border-top: 1px solid var(--border);
}

.org-foot .btn.primary {
  flex: 1;
}

/* ---------------------------------------------------------------- menus --- */

.menu {
  position: relative;
}

.menu > summary {
  list-style: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu > summary:hover,
.menu[open] > summary {
  background: var(--surface-2);
  color: var(--text);
}

.menu > summary svg {
  width: 18px;
  height: 18px;
}

.menu-list {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  min-width: 230px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

.menu-list.down {
  bottom: auto;
  top: calc(100% + 6px);
}

.menu-list li {
  margin: 0;
}

.menu-list hr {
  margin: 6px -6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.menu-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  flex: none;
}

.menu-item.danger,
.menu-item.danger svg {
  color: var(--danger);
}

.menu-item.danger:hover {
  background: var(--danger-soft);
}

/* ---------------------------------------------------------- empty state --- */

.empty {
  text-align: center;
  padding: var(--s12) var(--s6);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-xl);
  margin: 0 0 var(--s8);
}

.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-ink);
  margin-bottom: var(--s4);
}

.empty-icon svg {
  width: 26px;
  height: 26px;
}

.empty h2 {
  margin: 0 0 var(--s2);
  font-size: 1.125rem;
}

.empty p {
  color: var(--text-dim);
  max-width: 48ch;
  margin: 0 auto var(--s5);
}

.state {
  max-width: 560px;
  margin: var(--s8) auto;
  text-align: center;
}

.state .empty-icon.bad {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}

.state h1 {
  margin-bottom: var(--s3);
}

.state .notice {
  text-align: left;
}

.state .row {
  justify-content: center;
}

.ref {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1px 6px;
}

/* -------------------------------------------------------------- callout --- */

.callout {
  display: flex;
  gap: var(--s4);
  align-items: flex-start;
  padding: var(--s4) var(--s5);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.callout-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ok-soft);
  border: 1px solid var(--ok-line);
  color: var(--ok);
  flex: none;
}

.callout-icon svg {
  width: 18px;
  height: 18px;
}

.callout h2,
.callout h3 {
  margin: 0 0 4px;
  font-size: var(--fs-base);
}

.callout p {
  margin: 0;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

/* ------------------------------------------------------------ confirm box --- */

.confirm {
  border-color: var(--danger-line);
  box-shadow: var(--shadow-sm);
}

.confirm p > code {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}

/* ============================================================ marketing === */

.site {
  background: var(--bg);
}

.sitebar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.sitebar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--bar-h);
  padding: 0 var(--s6);
  display: flex;
  align-items: center;
  gap: var(--s6);
}

.marknav {
  display: flex;
  gap: 2px;
  align-items: center;
  flex: 1;
}

.marknav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--r-sm);
}

.marknav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.marknav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.sitebar-cta {
  display: flex;
  gap: var(--s2);
  align-items: center;
  margin-left: auto;
}

.mnav {
  display: none;
  position: relative;
}

.mnav > summary {
  list-style: none;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.mnav > summary::-webkit-details-marker {
  display: none;
}

.mnav > summary svg {
  width: 18px;
  height: 18px;
}

.mnav .menu-list {
  top: calc(100% + 8px);
  bottom: auto;
  min-width: 220px;
}

/* the public pages keep one reading rhythm */
.mwrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s12) var(--s6) var(--s16);
}

.mwrap > h1:first-child,
.mwrap > .crumb + h1,
.mwrap > p.small.muted:first-child + h1 {
  font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: var(--s4);
  max-width: 22ch;
}

.mwrap > h1:first-child + .lede,
.mwrap > p.small.muted:first-child + h1 + .lede {
  font-size: 1.125rem;
  max-width: 62ch;
  margin-bottom: var(--s8);
}

.mwrap > h2,
.legal h2,
.guide h2 {
  font-size: 1.375rem;
  letter-spacing: -0.025em;
  margin-top: var(--s12);
}

.legal,
.guide {
  max-width: var(--maxw-read);
}

.legal h1,
.guide h1 {
  font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.5rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: var(--s4);
}

.legal h3 {
  margin-top: var(--s6);
}

.legal p,
.legal li,
.guide p,
.guide li {
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--text-2);
}

.guide li {
  margin: 6px 0;
}

.legal .lede,
.guide .lede {
  font-size: 1.125rem;
  color: var(--text-dim);
}

/* The card under a guide's opening paragraph: what the tool does, how to try it. */
.guide-next {
  margin: var(--s6) 0 var(--s4);
  padding: var(--s5) var(--s6);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-lg);
}

.guide-next p {
  margin: var(--s2) 0;
}

.guide-next p:first-child {
  margin-top: 0;
}

.guide-next p:last-child {
  margin-bottom: 0;
}

.guide-next .guide-next-title {
  font-size: var(--fs-md);
  color: var(--text);
}

.guide-next .row {
  margin: var(--s3) 0;
}

@media (max-width: 640px) {
  .guide-next {
    padding: var(--s4);
  }

  .guide-next .row .btn {
    width: 100%;
  }
}

/* "Which plan?" line above the pricing cards. */
.which-plan {
  max-width: 64ch;
  margin: 0 0 var(--s6);
  padding: var(--s4) var(--s5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.which-plan p {
  margin: var(--s2) 0;
}

.which-plan p:first-child {
  margin-top: 0;
}

.which-plan p:last-child {
  margin-bottom: 0;
}

.placeholder {
  background: var(--warn-soft);
  border: 1px dashed var(--warn);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
}

/* faq */
.qa {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.qa:first-of-type {
  border-top: 1px solid var(--border);
}

.qa > summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-md);
  padding: 18px 40px 18px 0;
  color: var(--text);
}

.qa > summary::-webkit-details-marker {
  display: none;
}

.qa > summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  background: var(--text-dim);
  -webkit-mask: var(--icon-chevron) center / contain no-repeat;
  mask: var(--icon-chevron) center / contain no-repeat;
  transition: transform 0.15s ease;
}

.qa[open] > summary::after {
  transform: rotate(180deg);
}

.qa > summary:hover {
  color: var(--accent-ink);
}

.qa > div {
  padding: 0 0 18px;
  color: var(--text-dim);
  max-width: 72ch;
  line-height: 1.7;
}

/* data-flow diagram on /support */
.flow {
  margin: 16px 0 0;
}

.flow svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 740px;
  margin: 0 auto;
  font-size: 13px;
  font-family: var(--font);
}

.flow .flow-box {
  fill: var(--surface);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

.flow .flow-main {
  fill: var(--accent-soft);
  stroke: var(--accent);
}

.flow .flow-text {
  fill: var(--text);
  font-weight: 600;
}

.flow .flow-dim {
  fill: var(--text-dim);
  font-size: 12px;
}

.flow .flow-line {
  stroke: var(--text-dim);
  stroke-width: 1.5;
}

.flow .flow-dash {
  stroke-dasharray: 5 4;
}

.flow .flow-head {
  fill: var(--text-dim);
}

.flow figcaption {
  margin-top: 8px;
  text-align: center;
}

/* ---- hero */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--s12);
  align-items: center;
  padding: var(--s8) 0 var(--s12);
}

.hero::before {
  content: "";
  position: absolute;
  /* Sides at 0, not -12%: a wash that sticks out of the page makes it scroll sideways (49px at 1280). */
  inset: -140px 0 auto 0;
  height: 620px;
  z-index: -1;
  background: radial-gradient(600px 300px at 30% 30%, var(--wash-1), transparent 70%),
    radial-gradient(520px 260px at 80% 40%, var(--wash-2), transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: var(--s4) 0 var(--s5);
}

.hero .lede {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-2);
  margin-bottom: var(--s6);
}

.hero .row {
  gap: var(--s3);
}

.hero-note {
  margin: var(--s4) 0 0;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  max-width: 60ch;
}

.eyebrow {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 4px 12px 4px 6px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}

.eyebrow .tag {
  border-radius: var(--r-full);
}

.kicker {
  display: block;
  color: var(--accent-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 var(--s2);
}

/* product mock: a preview card that looks like the app */
.mock {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.mock-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.mock-bar span {
  margin-left: 8px;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-weight: 500;
}

.mock-body {
  padding: var(--s5);
}

.mock-body > p:first-child {
  margin-bottom: var(--s4);
}

.mock .grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s2);
}

.mock .tile {
  padding: 10px 12px 10px 16px;
  box-shadow: none;
}

.mock .tile .n {
  font-size: 1.5rem;
}

.mock .tile .k {
  font-size: 0.72rem;
}

.mock .tablewrap {
  box-shadow: none;
}

.mock .row {
  margin-top: var(--s4);
}

/* trust row */
.trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s4);
  margin: 0 0 var(--s16);
  padding: var(--s5) var(--s6);
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.trust li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.45;
}

.trust svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--accent-ink);
  margin-top: 1px;
}

.trust strong {
  display: block;
  color: var(--text);
}

/* sections */
.section {
  margin: 0 0 var(--s16);
}

.section-head {
  max-width: 64ch;
  margin: 0 0 var(--s6);
}

.section-head h2 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0 0 var(--s3);
}

.section-head p {
  color: var(--text-dim);
  font-size: var(--fs-md);
  margin: 0;
}

/* before / after */
.ba {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--s4);
  align-items: stretch;
}

.ba-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s5);
  box-shadow: var(--shadow-xs);
}

.ba-col h3 {
  margin: 0 0 var(--s4);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ba-arrow {
  display: grid;
  place-items: center;
  color: var(--text-dim);
}

.ba-arrow span {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.ba-arrow svg {
  width: 18px;
  height: 18px;
}

.docrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  margin: 0 0 var(--s2);
}

.docrow:last-child {
  margin-bottom: 0;
}

.docrow b {
  font-size: var(--fs-sm);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.docrow small {
  grid-column: 1 / -1;
  color: var(--text-dim);
  font-size: var(--fs-xs);
}

.docrow.faded {
  opacity: 0.7;
}

/* three steps */
.steps3 {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s4);
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps3 li {
  counter-increment: step;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s6);
  box-shadow: var(--shadow-xs);
}

.steps3 li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 650;
  font-size: var(--fs-sm);
  margin-bottom: var(--s4);
}

.steps3 strong {
  display: block;
  font-size: var(--fs-md);
  margin-bottom: 6px;
}

.steps3 p {
  margin: 0;
  color: var(--text-dim);
  font-size: var(--fs-base);
}

/* feature cards */
.features {
  display: grid;
  gap: var(--s4);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.features .tile {
  padding: var(--s5) var(--s6) var(--s6);
}

.features .tile.wide {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%);
  border-color: var(--accent-line);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-ink);
  margin-bottom: var(--s4);
}

.feature-icon svg {
  width: 18px;
  height: 18px;
}

.features .tile strong {
  display: block;
  font-size: var(--fs-md);
  margin-bottom: 6px;
}

.features .tile p {
  margin: 0;
  font-size: var(--fs-base);
  line-height: 1.6;
}

/* pricing cards (home, /pricing, plan page) */
.plans {
  display: grid;
  gap: var(--s4);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 var(--gap);
  align-items: stretch;
}

/* four cards (Free, 7-day pass, clean-up pass, monthly): 4 across on wide screens, 2 x 2 in between; below 1001px the
   existing single-column (site) and auto-fit (app) rules apply unchanged. */
@media (min-width: 1181px) {
  .plans.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1001px) and (max-width: 1180px) {
  .plans.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plan {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s6);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.plan.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}

.plan.current {
  border-color: var(--ok);
  box-shadow: 0 0 0 1px var(--ok), var(--shadow-sm);
}

.plan-flag {
  position: absolute;
  top: -11px;
  left: var(--s6);
  padding: 2px 10px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--accent-text);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.plan.current .plan-flag {
  background: var(--ok);
  color: #fff;
}

.plan h3 {
  margin: 0 0 var(--s3);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.01em;
}

.plan .price {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  display: block;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.plan .per {
  display: block;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  margin-top: 4px;
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: var(--s5) 0 var(--s4);
  border-top: 1px solid var(--border);
  padding-top: var(--s4);
}

.plan li {
  position: relative;
  padding-left: 26px;
  margin: 0 0 var(--s3);
  font-size: var(--fs-base);
  color: var(--text-2);
  line-height: 1.55;
}

.plan li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  background: var(--accent);
  -webkit-mask: var(--icon-tick) center / 12px no-repeat;
  mask: var(--icon-tick) center / 12px no-repeat;
}

.plan .foot {
  margin-top: auto;
  padding-top: var(--s3);
}

.plan .foot .btn,
.plan .foot form,
.plan .foot form .btn {
  width: 100%;
}

.plan .summary {
  margin: var(--s3) 0 0;
  color: var(--text-2);
}

/* operator / trust card */
.operator {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s5);
  align-items: start;
}

.operator .org-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 1rem;
}

/* final call to action */
.cta-band {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: var(--s12) var(--s6);
  border-radius: var(--r-xl);
  background: radial-gradient(600px 240px at 50% 0%, rgba(255, 255, 255, 0.14), transparent 70%),
    linear-gradient(140deg, #14532d 0%, #15803d 100%);
  color: #fff;
  margin: 0 0 var(--s8);
}

.cta-band h2 {
  color: #fff;
  margin: 0 0 var(--s3);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  letter-spacing: -0.035em;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.86);
  max-width: 56ch;
  margin: 0 auto var(--s6);
  font-size: var(--fs-md);
}

.cta-band .row {
  justify-content: center;
}

.cta-band .btn {
  --btn-bg: rgba(255, 255, 255, 0.12);
  --btn-fg: #fff;
  --btn-line: rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

.cta-band .btn:hover {
  --btn-bg: rgba(255, 255, 255, 0.2);
}

.cta-band .btn.primary {
  --btn-bg: #ffffff;
  --btn-fg: #14532d;
  --btn-line: #ffffff;
}

.cta-band .btn.primary:hover {
  --btn-bg: #f0fdf4;
}

.cta-band a:focus-visible {
  outline-color: #ffffff;
}

/* site footer */
.sitefoot {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.sitefoot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s12) var(--s6) var(--s8);
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: var(--s8);
}

.sitefoot .foot-h {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin: 0 0 var(--s3);
}

.sitefoot ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sitefoot li {
  margin: 0 0 8px;
}

.sitefoot a {
  color: var(--text-dim);
  text-decoration: none;
}

.sitefoot a:hover {
  color: var(--text);
  text-decoration: underline;
}

.sitefoot p {
  margin: var(--s3) 0 0;
  max-width: 46ch;
  line-height: 1.6;
}

.sitefoot-legal {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s5) var(--s6) var(--s8);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s6);
  justify-content: space-between;
  font-size: var(--fs-xs);
}

.sitefoot-legal p {
  margin: 0;
  max-width: none;
}

/* ======================================================== responsive === */

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s10);
  }

  .trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plans {
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
  }

  .plans.app {
    max-width: none;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .sitefoot-inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sitefoot-inner > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .marknav {
    display: none;
  }

  .mnav {
    display: block;
  }

  .sitebar-cta .btn.ghost {
    display: none;
  }

  .appnav {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --bar-h: 56px;
  }

  body {
    font-size: var(--fs-base);
  }

  h1 {
    font-size: 1.5rem;
  }

  .wrap {
    padding: var(--s6) var(--s4) var(--s12);
  }

  .mwrap {
    padding: var(--s8) var(--s4) var(--s12);
  }

  .appbar-inner,
  .sitebar-inner {
    padding: 0 var(--s4);
    gap: var(--s3);
  }

  .brand .by,
  .who-name {
    display: none;
  }

  .appfoot-inner {
    padding: var(--s5) var(--s4);
  }

  .card {
    padding: var(--s4);
  }

  .card-foot,
  .card > .card-foot:last-child {
    margin: var(--s4) calc(-1 * var(--s4)) calc(-1 * var(--s4));
    padding: var(--s3) var(--s4);
  }

  .pagehead {
    margin-bottom: var(--s5);
  }

  .pagehead .row {
    width: 100%;
  }

  .org-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cols-2,
  .ba,
  .steps3,
  .features,
  .trust {
    grid-template-columns: minmax(0, 1fr);
  }

  .features .tile.wide {
    grid-column: auto;
  }

  .ba-arrow {
    transform: rotate(90deg);
  }

  .hero {
    padding-top: 0;
  }

  .hero .row .btn {
    width: 100%;
  }

  .mock .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .dl dd {
    margin-bottom: var(--s3);
  }

  .notice {
    padding-left: 40px;
  }

  th,
  td {
    padding: 10px 12px;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters .actions {
    grid-column: 1 / -1;
  }

  .filters .actions .btn {
    flex: 1;
  }

  .sitefoot-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: var(--s8) var(--s4) var(--s6);
    gap: var(--s6);
  }

  .sitefoot-legal {
    padding: var(--s4) var(--s4) var(--s6);
  }

  .operator {
    grid-template-columns: minmax(0, 1fr);
  }

  .cta-band {
    padding: var(--s10) var(--s4);
  }

  .menu-list {
    min-width: 210px;
  }

  .tabs {
    margin-left: calc(-1 * var(--s4));
    margin-right: calc(-1 * var(--s4));
    padding: 0 var(--s2);
  }
}

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

@media print {
  .appbar,
  .sitebar,
  .appfoot,
  .sitefoot,
  .tabs,
  .menu {
    display: none !important;
  }

  body {
    background: #fff;
  }
}

/* ------------------------------------------------------------ utilities --- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

fieldset.bare {
  border: 0;
  padding: 0;
  margin: 0;
}

.nowrap {
  white-space: nowrap;
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.docnum {
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
}

label.docnum {
  display: inline;
  margin: 0;
  cursor: pointer;
}

/* home: plan summary line, guide grid */

.plan .summary strong {
  display: block;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 4px;
}

.plan .summary {
  color: var(--text-dim);
  margin: 0 0 var(--s5);
}

.linklist.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.linklist.cols li:nth-child(odd) {
  border-right: 1px solid var(--border);
}

.linklist.cols li:nth-last-child(2):nth-child(odd) {
  border-bottom: none;
}

@media (max-width: 720px) {
  .linklist.cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .linklist.cols li:nth-child(odd) {
    border-right: none;
  }

  .linklist.cols li:nth-last-child(2):nth-child(odd) {
    border-bottom: 1px solid var(--border);
  }
}

/* "created" / "voided" / "raised" markers in the run table */
td > .mono.small {
  display: inline-block;
  font-family: var(--font);
  font-size: var(--fs-xs);
  font-weight: 550;
  padding: 1px 7px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.section-title + .plans {
  margin-top: var(--s6);
}

.only-narrow {
  display: none;
}

@media (max-width: 520px) {
  .only-wide {
    display: none;
  }

  .only-narrow {
    display: inline;
  }
}
