/* Surfing Dog Inbox, hosted: the site's look (surfingdog.ai), self-contained. Values follow
   ~/surfingdog-inbox packages/ui/src/index.css + apps/site/src/styles/site.css (and the plain
   classes in apps/site/shell/parts.css); keep them in step. Everything here is served by this
   app: the CSP is style-src 'self', so no inline style anywhere, and no font from elsewhere.
   Colour has jobs: violet is the accent (focus, link underlines, in progress), palm is done or
   live, sun is "needs attention". No red. */

/* --- Fonts: the site's own files (same bytes), SIL OFL 1.1 (fonts/OFL-*.txt) ----------------- */
/* Each is named by the first 8 hex of its sha256: new bytes, new name (they are cached a year). */
@font-face { font-family: "Manrope Variable"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(fonts/manrope-latin-ext-wght-normal.3911b66d.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Manrope Variable"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(fonts/manrope-latin-wght-normal.a30ddcd3.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+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans Variable"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(fonts/plus-jakarta-sans-latin-ext-wght-normal.38e3b8fd.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans Variable"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(fonts/plus-jakarta-sans-latin-wght-normal.153fc85b.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+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* --- Day ------------------------------------------------------------------------------------ */
:root {
  color-scheme: light;
  --ground: #f6f5ff;
  --ink: #14163c;
  --ink-2: #3f4472;
  --ink-3: #565a86;
  --hairline: rgba(20, 22, 60, 0.08);
  --hairline-strong: rgba(20, 22, 60, 0.14);
  --edge: rgba(255, 255, 255, 0.55);          /* the lit glass edge */
  --edge-strong: rgba(255, 255, 255, 0.66);
  --glass-bg: rgba(255, 255, 255, 0.32);
  --glass-bg-strong: rgba(255, 255, 255, 0.44);
  --glass-fallback: rgba(255, 255, 255, 0.86);
  --glass-shadow: 0 8px 24px -16px rgba(20, 90, 140, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --glass-shadow-hover: 0 14px 32px -18px rgba(20, 90, 140, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --card-veil: color-mix(in srgb, var(--ground) 52%, transparent);
  --pill-bg: rgba(255, 255, 255, 0.34);
  --pill-bg-hover: rgba(255, 255, 255, 0.5);
  --row-bg: rgba(255, 255, 255, 0.24);
  --row-bg-hover: rgba(255, 255, 255, 0.4);
  --input-bg: rgba(255, 255, 255, 0.38);
  --input-bg-hover: rgba(255, 255, 255, 0.46);
  --input-border: color-mix(in srgb, var(--ink-3) 75%, transparent);   /* both themes: a hairline a field can be seen by (3:1) */
  --btn-primary-bg: #14163c;
  --btn-primary-fg: #ffffff;
  --violet-ink: #5a3fd0;
  --palm-ink: #10694a;   /* 4.5:1 on the palm-tinted chip */
  --sun-ink: #866000;
  --sky-1: var(--flamingo);
  --sky-2: var(--lagoon);
  --sky-3: var(--violet);
  --sky-4: var(--tangerine);
  --field-alpha: 0.3;
  --selection-bg: color-mix(in srgb, var(--violet) 22%, transparent);
  --selection-fg: var(--ink);
}
/* --- Night: the system's, unless the visitor chose day ---------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0d0e26;
    --ink: #f2f1ff;
    --ink-2: #b9bce0;
    --ink-3: #9a9dc4;
    --hairline: rgba(255, 255, 255, 0.1);
    --hairline-strong: rgba(255, 255, 255, 0.16);
    --edge: rgba(255, 255, 255, 0.14);
    --edge-strong: rgba(255, 255, 255, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-bg-strong: rgba(255, 255, 255, 0.1);
    --glass-fallback: rgba(22, 23, 52, 0.92);
    --glass-shadow: 0 8px 24px -16px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --glass-shadow-hover: 0 14px 32px -18px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --card-veil: color-mix(in srgb, var(--ground) 34%, transparent);
    --pill-bg: rgba(255, 255, 255, 0.08);
    --pill-bg-hover: rgba(255, 255, 255, 0.14);
    --row-bg: rgba(255, 255, 255, 0.05);
    --row-bg-hover: rgba(255, 255, 255, 0.09);
    --input-bg: rgba(255, 255, 255, 0.06);
    --input-bg-hover: rgba(255, 255, 255, 0.09);
    --btn-primary-bg: #f2f1ff;
    --btn-primary-fg: #0d0e26;
    --violet-ink: #ab95ff;
    --palm-ink: #72e6c3;
    --sun-ink: #ffda80;
    --sky-1: var(--violet);                     /* night is two hues, not four dimmed */
    --sky-2: var(--lagoon);
    --sky-3: var(--violet);
    --sky-4: transparent;
    --field-alpha: 0.26;
    --selection-bg: color-mix(in srgb, var(--violet) 40%, transparent);
    --selection-fg: #ffffff;
  }
}
/* --- Night, chosen (the site's sd_theme cookie, stamped on <html> by the server). Only on the
   root: Turnstile's box carries a data-theme of its own. ------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0d0e26;
  --ink: #f2f1ff;
  --ink-2: #b9bce0;
  --ink-3: #9a9dc4;
  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --edge: rgba(255, 255, 255, 0.14);
  --edge-strong: rgba(255, 255, 255, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-bg-strong: rgba(255, 255, 255, 0.1);
  --glass-fallback: rgba(22, 23, 52, 0.92);
  --glass-shadow: 0 8px 24px -16px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --glass-shadow-hover: 0 14px 32px -18px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --card-veil: color-mix(in srgb, var(--ground) 34%, transparent);
  --pill-bg: rgba(255, 255, 255, 0.08);
  --pill-bg-hover: rgba(255, 255, 255, 0.14);
  --row-bg: rgba(255, 255, 255, 0.05);
  --row-bg-hover: rgba(255, 255, 255, 0.09);
  --input-bg: rgba(255, 255, 255, 0.06);
  --input-bg-hover: rgba(255, 255, 255, 0.09);
  --btn-primary-bg: #f2f1ff;
  --btn-primary-fg: #0d0e26;
  --violet-ink: #ab95ff;
  --palm-ink: #72e6c3;
  --sun-ink: #ffda80;
  --sky-1: var(--violet);
  --sky-2: var(--lagoon);
  --sky-3: var(--violet);
  --sky-4: transparent;
  --field-alpha: 0.26;
  --selection-bg: color-mix(in srgb, var(--violet) 40%, transparent);
  --selection-fg: #ffffff;
}

/* --- Theme-independent ---------------------------------------------------------------------- */
:root {
  /* Palette. Flamingo, tangerine and lagoon only in the sky and the mark. */
  --flamingo: #ff6fa8;
  --violet: #8a6bff;
  --lagoon: #25cfe0;
  --palm: #2fd3a5;
  --tangerine: #ff9650;
  --sun: #ffcf5c;
  --c-success: var(--palm);
  --c-success-ink: var(--palm-ink);
  --c-warning: var(--sun);
  --c-warning-ink: var(--sun-ink);

  --font-display: "Plus Jakarta Sans Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-sans: "Manrope Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Type: six sizes under the headings, each with one job. */
  --fs-micro: 10px;      /* uppercase table heads */
  --fs-fine: 11.5px;     /* labels, hints, fine print, footer */
  --fs-ui: 13px;         /* small buttons, bar */
  --fs-card: 13.5px;     /* option rows, table cells, notes */
  --fs-body: 14.5px;     /* body */
  --fs-lede: 15.5px;     /* the one paragraph under the title */
  --fs-mono: 12px;
  --fs-h-card: 15px;
  --fs-h-sub: 16px;
  --fs-page-title: clamp(23px, 2.3vw, 28px);   /* every h1 */
  --lh-title: 1.14;
  --lh-heading: 1.25;
  --lh-body: 1.58;
  --lh-ui: 1.45;
  --measure: 66ch;
  --measure-lede: 58ch;
  --measure-tight: 52ch;

  /* Space: one scale. */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 56px; --sp-10: 80px;
  --gutter: var(--sp-6);
  --section-y: var(--sp-8);

  /* Radius. */
  --radius-control: 12px;
  --radius-card: 16px;
  --radius-pill: 9999px;
  --radius-code: 6px;

  /* Motion: one easing, three durations. */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 0.18s;
  --dur: 0.28s;
  --dur-slow: 0.5s;

  /* Focus: one ring everywhere. */
  --focus: color-mix(in srgb, var(--violet-ink) 78%, transparent);
  --focus-width: 2px;
  --focus-offset: 2px;
  --touch: 44px;
}
@media (min-width: 900px) {
  :root { --gutter: var(--sp-8); --section-y: var(--sp-9); }
}

/* --- Base ----------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--ground); color: var(--ink);
  font-family: var(--font-sans); font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 400;
  text-wrap: pretty;
}
main { flex: 1 0 auto; }
[hidden] { display: none !important; }      /* .appt etc. set display; hidden must still win */
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 500; color: var(--ink); text-wrap: balance; }
h1 { font-size: var(--fs-page-title); line-height: var(--lh-title); letter-spacing: -0.024em; }
h2 { font-size: var(--fs-h-sub); line-height: var(--lh-heading); letter-spacing: -0.018em; }
p, ul, ol, dl, figure { margin: 0; }
::selection { background: var(--selection-bg); color: var(--selection-fg); }
code { font-family: var(--font-mono); font-size: var(--fs-mono); }
/* Running-text links: ink, with the brand-tinted underline. */
main a:not(.btn) {
  color: var(--ink); text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--violet) 45%, transparent);
  text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; text-decoration-skip-ink: auto;
  transition: text-decoration-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
main a:not(.btn):hover, main a:not(.btn):focus-visible { text-decoration-color: var(--violet); }
a, button, summary { transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease, border-color var(--dur-fast) ease; }

/* One focus ring, on everything that takes focus. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, [tabindex]:focus-visible {
  outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); border-radius: var(--radius-control);
}
.btn:focus-visible, .copy:focus-visible, .skip:focus-visible { border-radius: var(--radius-pill); }
:focus:not(:focus-visible) { outline: none; }

/* Skip link: invisible until focused. */
.skip {
  position: absolute; top: -80px; left: var(--sp-6); z-index: 100; display: inline-flex; align-items: center;
  height: 40px; padding: 0 var(--sp-4); border-radius: var(--radius-pill);
  background: var(--btn-primary-bg); color: var(--btn-primary-fg); font-size: var(--fs-ui); font-weight: 600;
  text-decoration: none; box-shadow: var(--glass-shadow); transition: top var(--dur) var(--ease);
}
.skip:focus, .skip:focus-visible { top: var(--sp-3); }

/* Page shell: the site's reading column. */
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap-read { max-width: 560px; }                     /* 480 px of text on desktop, as /check */
.wrap-wide { max-width: 1200px; }                    /* ops */
main.wrap { padding-top: var(--section-y); padding-bottom: var(--sp-9); }

/* Rhythm down the page: 16 between blocks; 40 above a sub-heading and a section; 24 after the
   title and around forms and boxes; 12 under a sub-heading. Every selector is :where(), so all
   weigh the same and the LAST matching line wins: keep this order. A component that sets its own
   margin-top with a class (.expiry, .closeform) still wins over all of them. */
main > :where(* + *) { margin-top: var(--sp-4); }
main > :where(h2, section) { margin-top: var(--sp-8); }
main > :where(h1 + *, h1 + .sd-note, form, .status, .record-card, .table-card, .actions, ul.rows, .sd-ask-form) { margin-top: var(--sp-6); }
main > :where(h2 + *) { margin-top: var(--sp-3); }
main > :where(:first-child) { margin-top: 0; }
main > :where(form.inline) { display: block; }       /* "Send a new code", the close link: their own line */
section > :where(form.inline) { display: block; }
section > :where(* + *) { margin-top: var(--sp-4); }
section > :where(h2 + *) { margin-top: var(--sp-3); }

/* --- The sky: fixed, still; colour lives behind the glass ------------------------------------- */
.sky {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--ground);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.62) 58%, rgba(0, 0, 0, 0.42) 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.62) 58%, rgba(0, 0, 0, 0.42) 100%);
}
.sky > i { position: absolute; display: block; border-radius: 9999px; filter: blur(72px); opacity: var(--field-alpha); }
.sky .f1 { width: 52vw; height: 52vw; left: -14vw; top: -18vw;    background: var(--sky-1); }
.sky .f2 { width: 48vw; height: 48vw; right: -12vw; top: 6vh;     background: var(--sky-2); }
.sky .f3 { width: 56vw; height: 56vw; right: -10vw; bottom: -24vw; background: var(--sky-3); }
.sky .f4 { width: 38vw; height: 38vw; left: 4vw; bottom: -14vw;   background: var(--sky-4); }

/* --- Glass ------------------------------------------------------------------------------------ */
/* Never more than two blurred layers on a page: the bar and one card. */
.glass, .glass-strong {
  background-color: var(--glass-bg);
  background-image: linear-gradient(0deg, var(--card-veil), var(--card-veil)); /* same colour whatever the sky does */
  -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--edge); box-shadow: var(--glass-shadow);
}
.glass-strong { background-color: var(--glass-bg-strong); border-color: var(--edge-strong); }
.panel { padding: var(--sp-6); border-radius: var(--radius-card); }

/* --- The bar (the site's Nav, reduced to the brand and the actions) --------------------------- */
.sd-nav { position: sticky; top: 0; z-index: 40; padding-top: 10px; }
.sd-nav::before {          /* the page fades out through the gap above the pill */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.sd-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0;
  height: 52px; padding: 0 6px 0 8px; border-radius: var(--radius-pill);
  transition: box-shadow 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.sd-nav.is-scrolled .sd-bar { background-color: var(--glass-bg-strong); border-color: var(--edge-strong); box-shadow: var(--glass-shadow-hover); }
.sd-brand {
  display: inline-flex; flex: none; align-items: center; gap: 9px; padding: 6px 8px 6px 4px; border-radius: var(--radius-pill);
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-ui); letter-spacing: -0.005em;
  color: var(--ink); text-decoration: none;
}
.sd-mark { display: block; flex: none; transition: transform 0.35s var(--ease); }
.sd-brand:hover .sd-mark, .sd-brand:focus-visible .sd-mark { transform: translateY(-1px); }   /* the sun rises a hair */
.sd-word { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.sd-actions > * { flex: none; }
.sd-actions > .sd-email { flex: 0 1 auto; }
.sd-email {
  min-width: 0; max-width: 26ch; padding: 0 var(--sp-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-fine); color: var(--ink-3);
}
.sd-actions form { display: flex; margin: 0; }
/* Theme toggle: moon by day, sun by night; half a turn per press. */
.sd-tt svg { width: 16px; height: 16px; transition: transform 0.4s var(--ease); }
.sd-tt[data-spun="1"] svg { transform: rotate(180deg); }
.sd-tt .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sd-tt .i-sun { display: block; }
  :root:not([data-theme="light"]) .sd-tt .i-moon { display: none; }
}
:root[data-theme="dark"] .sd-tt .i-sun { display: block; }
:root[data-theme="dark"] .sd-tt .i-moon { display: none; }
@media (max-width: 899px) { .sd-bar { height: 56px; gap: 6px; } }
/* The actions never shrink: above 560 the address gives way, below it the brand does. */
@media (max-width: 560px) {
  .sd-email { display: none; }
  .sd-brand { flex: 0 1 auto; min-width: 0; }
  .sd-actions { flex: none; }
}
@media (max-width: 430px) { .sd-bar.has-ops .sd-word { display: none; } } /* signed-in ops only: the mark alone, the link keeps its aria-label */
@media (max-width: 359px) { .sd-word { display: none; } }                     /* 320 (and 400% zoom): the mark alone, never a cut word */

/* --- Footer: the site's one-line footer ------------------------------------------------------- */
.sd-foot { padding-block: var(--sp-6) var(--sp-7); text-align: center; font-size: var(--fs-fine); line-height: 1.5; color: var(--ink-3); }
.sd-foot a {
  display: inline-flex; align-items: center; min-height: 24px; color: var(--ink-2);
  text-decoration: underline; text-decoration-color: var(--hairline-strong); text-decoration-thickness: 1px; text-underline-offset: 0.18em;
}
.sd-foot a:hover, .sd-foot a:focus-visible { color: var(--ink); text-decoration-color: var(--ink-3); }

/* --- Type ------------------------------------------------------------------------------------- */
.h-page { font-size: var(--fs-page-title); line-height: var(--lh-title); letter-spacing: -0.024em; }
.h-sub  { font-size: var(--fs-h-sub); line-height: var(--lh-heading); letter-spacing: -0.018em; }
.lede   { max-width: var(--measure-lede); font-size: var(--fs-lede); line-height: 1.5; color: var(--ink-2); }
.fine   { max-width: var(--measure-tight); font-size: var(--fs-fine); line-height: 1.5; color: var(--ink-3); }
.hint   { max-width: var(--measure-tight); font-size: var(--fs-fine); font-weight: 500; line-height: 1.5; color: var(--ink-3); }
.label  { display: block; font-size: var(--fs-fine); font-weight: 600; line-height: 1.5; color: var(--ink-2); }
.eyebrow { font-size: var(--fs-micro); font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.unit   { font-size: var(--fs-fine); color: var(--ink-3); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.flag {  /* "please check" */
  display: inline-flex; align-items: center; flex: none; min-height: 18px; margin-left: var(--sp-1); padding: 0 7px;
  border: 1px solid var(--hairline-strong); border-radius: var(--radius-pill);
  font-size: var(--fs-micro); font-weight: 600; letter-spacing: 0.01em; line-height: 1.2; color: var(--ink-2);
  vertical-align: 1px; white-space: nowrap;
}
.mono, .sd-url { font-family: var(--font-mono); font-size: var(--fs-mono); }
.sd-url {
  display: block; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--hairline); border-radius: var(--radius-control);
  background: var(--row-bg); line-height: 1.55; overflow-wrap: anywhere; color: var(--ink);
}

/* --- Buttons (the site's .btn; one ink button per screen, nothing destructive-coloured) ------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 18px; border-radius: var(--radius-pill); border: 1px solid transparent;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
  color: var(--ink); background: transparent; text-decoration: none; cursor: pointer; user-select: none;
  transition: transform 0.2s var(--ease), background-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary {
  background: var(--btn-primary-bg); color: var(--btn-primary-fg);
  box-shadow: 0 10px 22px -14px color-mix(in srgb, var(--ink) 60%, transparent);
}
.btn-secondary {
  background: var(--pill-bg); border-color: var(--edge-strong);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn-secondary:hover { background: var(--pill-bg-hover); }
.glass .btn-secondary, .glass-strong .btn-secondary { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--pill-bg-hover); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--pill-bg); color: var(--ink); }
.btn-sm { height: 32px; padding: 0 14px; font-size: var(--fs-ui); }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
@media (pointer: coarse) { .btn { height: var(--touch); } .btn-sm { height: 40px; } .btn-icon.btn-sm { width: 40px; } }

/* A button that reads as a link (inline actions: Check now, Send a new code, Show the steps…). */
.linkbtn {
  appearance: none; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--violet) 45%, transparent);
  text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; text-align: left; border-radius: 3px;
}
.linkbtn:hover, .linkbtn:focus-visible { text-decoration-color: var(--violet); }
.linkbtn.quiet, main a.quiet { font-size: var(--fs-fine); color: var(--ink-3); text-decoration-color: var(--hairline-strong); }
.linkbtn.quiet:hover, main a.quiet:hover { color: var(--ink); text-decoration-color: var(--ink-3); }
/* Copy: the site's small pill, inside the box that holds the value. */
.copy {
  flex: none; height: 26px; padding: 0 10px; border: 1px solid var(--hairline-strong); border-radius: var(--radius-pill);
  background: transparent; font: inherit; font-size: var(--fs-fine); font-weight: 600; line-height: 1; color: var(--ink-2); cursor: pointer;
}
.copy:hover, .copy:focus-visible { background: var(--pill-bg-hover); color: var(--ink); }
@media (pointer: coarse) { .copy { height: 32px; padding: 0 12px; } }
:where(form.inline) { display: inline; margin: 0; }   /* zero weight: the page rhythm and .closeform still place it */

/* --- Forms and fields ------------------------------------------------------------------------- */
/* A form with fields: a column of fields 16 apart. With a box: add .glass-strong.panel. */
.form { display: grid; gap: var(--sp-4); justify-items: stretch; }
.form > .btn, .form > button { justify-self: start; }
.form > :is(.hint, .fielderr) { margin-top: calc(var(--sp-2) - var(--sp-4)); }   /* 8 px under its field */
.form > label + fieldset { margin-top: var(--sp-2); }                     /* a question after a field: a little more air */
.form > p:not(.hint):not(.fielderr) { max-width: var(--measure); font-size: var(--fs-card); color: var(--ink-2); }
.stack { display: grid; gap: var(--sp-4); }                                  /* inside the card's <details> */
.stack > .fielderr { margin-top: calc(var(--sp-2) - var(--sp-4)); }
.stack > .hint { max-width: none; }

/* A label wrapping its input: the label's words over the field, 4 apart. */
.form label:not(.choice), .stack label:not(.choice) {
  display: grid; gap: var(--sp-1); font-size: var(--fs-fine); font-weight: 600; line-height: 1.5; color: var(--ink-2);
}

/* Fields. :where keeps specificity at zero so any component can restyle a field. */
:where(input:not([type="radio"], [type="checkbox"], [type="hidden"]), select, textarea) {
  width: 100%; min-width: 0; appearance: none; -webkit-appearance: none;
  border-radius: var(--radius-control); border: 1px solid var(--input-border); background-color: var(--input-bg);
  padding: 10px 14px; font: 400 16px/1.4 var(--font-sans); color: var(--ink);   /* 400 explicitly: labels around them are 600 */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); outline: none;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
@media (min-width: 768px) {
  :where(input:not([type="radio"], [type="checkbox"], [type="hidden"]), select, textarea) { font-size: var(--fs-body); }
}
:where(input, textarea)::placeholder { color: var(--ink-3); opacity: 1; }
:where(input:not([type="radio"], [type="checkbox"], [type="hidden"]), select, textarea):hover { background-color: var(--input-bg-hover); }
:where(input:not([type="radio"], [type="checkbox"], [type="hidden"]), select, textarea):focus {
  border-color: color-mix(in srgb, var(--violet) 50%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 18%, transparent);
}
textarea { resize: vertical; min-height: 88px; }
select {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
/* Chrome paints an autofilled field an opaque blue (slate by night): keep it on the ground, in ink. */
input:-webkit-autofill, input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--ink); caret-color: var(--ink);
  box-shadow: inset 0 0 0 100px var(--ground); transition: background-color 600000s 0s;
}
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: inset 0 0 0 100px var(--ground), 0 0 0 3px color-mix(in srgb, var(--violet) 18%, transparent);
}
/* Radios and checkboxes: a hairline ring, the choice an ink dot or an ink box (the native ones
   turn into heavy grey discs by night). */
input[type="radio"], input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; display: inline-grid; place-content: center;
  width: 16px; height: 16px; margin: 0; border: 1.5px solid var(--ink-3); border-radius: 50%; background: transparent;
  color: var(--ink); cursor: pointer; transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
input[type="checkbox"] { border-radius: 4px; }
input[type="radio"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform var(--dur-fast) var(--ease); }
input[type="checkbox"]::before {
  content: ""; width: 8px; height: 4px; border-left: 1.5px solid var(--btn-primary-fg); border-bottom: 1.5px solid var(--btn-primary-fg);
  transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform var(--dur-fast) var(--ease);
}
input[type="radio"]:checked, input[type="checkbox"]:checked, label:hover > input:is([type="radio"], [type="checkbox"]) { border-color: var(--ink); }
input[type="checkbox"]:checked { background: var(--ink); }
input[type="radio"]:checked::before { transform: scale(1); }
input[type="checkbox"]:checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }
/* Forced colours paint over backgrounds, and the dot with them: the system's own controls there. */
@media (forced-colors: active) {
  input[type="radio"], input[type="checkbox"] { appearance: auto; -webkit-appearance: auto; }
  input[type="radio"]::before, input[type="checkbox"]::before { content: none; }
}

/* Compact fields: hours, services, the DNS picker (the admin table's are with the tables). */
.day input:not([type="checkbox"]), .svc input, .pick select { height: 36px; padding: 0 12px; font-size: 16px; }
@media (min-width: 768px) { .day input:not([type="checkbox"]), .svc input, .pick select { font-size: var(--fs-card); } }
.pick select { width: auto; max-width: 100%; padding-right: 36px; }

/* The code: one field, digits spaced, centred. */
input.code {
  max-width: 240px; height: 56px; padding: 0 var(--sp-4);
  font-size: 24px; font-weight: 400; font-variant-numeric: tabular-nums;
  letter-spacing: 0.32em; text-indent: 0.32em; text-align: center; caret-color: var(--violet-ink);
}

/* Fieldsets: no frame. The legend is floated so it becomes an ordinary grid row
   (no notch in a border, and padding-top sits above it). */
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: var(--sp-2); }
legend {
  float: left; width: 100%; margin: 0 0 var(--sp-1); padding: 0;
  font-family: var(--font-display); font-size: var(--fs-h-sub); font-weight: 500; line-height: var(--lh-heading);
  letter-spacing: -0.018em; color: var(--ink);
}
legend.label { font-family: var(--font-sans); font-size: var(--fs-fine); font-weight: 600; line-height: 1.5; letter-spacing: 0; color: var(--ink-2); }   /* one field among others */
/* In the start card, each part sits under a hairline. */
.form-card > fieldset + fieldset, .form-card > fieldset + p { padding-top: var(--sp-5); border-top: 1px solid var(--hairline); margin-top: var(--sp-1); }
.sub { margin-top: var(--sp-3); font-size: var(--fs-fine); font-weight: 600; line-height: 1.5; color: var(--ink-2); }   /* "Opening hours", "What people can book" */
fieldset > p:not(.sub):not(.hint):not(.fielderr) { font-size: var(--fs-card); color: var(--ink-2); }

/* Choices: option rows (the site's .row; selected = .row[data-selected]). */
.choice {
  display: flex; align-items: center; gap: var(--sp-3); min-height: var(--touch); padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--hairline); border-radius: var(--radius-control); background: var(--row-bg);
  font-size: var(--fs-card); font-weight: 500; line-height: var(--lh-ui); color: var(--ink); cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.choice:hover { background: var(--row-bg-hover); }
.choice:has(input:checked) { background: var(--glass-bg-strong); border-color: var(--edge-strong); box-shadow: var(--glass-shadow); }
.choice > span { min-width: 0; }
/* The ring goes round the row; without :has() the input keeps its own. */
@supports selector(:has(*)) {
  .choice:has(input:focus-visible) { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
  .choice input:focus-visible { outline: none; }
}

/* Custom hours: a compact grid; its checkbox label is plain, not a row. */
.days { display: grid; gap: var(--sp-1); margin: var(--sp-1) 0 var(--sp-2); }
.day { display: grid; grid-template-columns: 84px 1fr 1fr; gap: var(--sp-2); align-items: center; max-width: 340px; }
.day .choice { min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; font-weight: 500; }
.appt { display: grid; gap: var(--sp-2); }

/* Services: name, minutes, "min", price. */
.svc { display: grid; grid-template-columns: minmax(0, 1fr) 64px auto 110px; gap: var(--sp-2); align-items: baseline; }
@media (max-width: 520px) {
  .svc { grid-template-columns: minmax(0, 1fr) 56px auto; }
  .svc input[name^="svc_price"] { grid-column: 1 / -1; }
  .svc { row-gap: 6px; }
  .svc + .svc { margin-top: var(--sp-2); }      /* on two lines, each service still reads as one */
  .day { grid-template-columns: 72px 1fr 1fr; }
}

/* Without :has() everything shows; with it, the custom days follow "Custom",
   and hours and services follow "People book time with you". */
fieldset:has(input[name=hours]):not(:has(input[name=hours][value=custom]:checked)) .days { display: none; }
.form-card:has(input[name=kind]:checked):not(:has(input[name=kind][value=appointments]:checked)) .appt { display: none; }

/* Turnstile: hold its height so nothing jumps when it arrives. */
.cf-turnstile { min-height: 65px; }

/* A row of inline things: the host label and ".domain", the DNS picker. */
.inline-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.inline-row input { flex: 1 1 160px; width: auto; }
.inline-row > .unit { font-size: var(--fs-body); color: var(--ink-2); }   /* ".domain": part of the name, not a footnote */
.pick .inline-row { font-size: var(--fs-card); font-weight: 500; color: var(--ink-2); }

/* --- The ask box (home): /check's box ----------------------------------------------------------- */
.sd-ask-form { display: grid; gap: var(--sp-2); }
.sd-ask {
  position: relative; display: flex; align-items: center; width: 100%; height: 52px;
  border: 1px solid var(--input-border); border-radius: var(--radius-pill); background: var(--input-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 28px -22px color-mix(in srgb, var(--ink) 55%, transparent);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.sd-ask:hover { background: var(--input-bg-hover); }
.sd-ask:focus-within {
  border-color: var(--violet-ink); outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset);
  box-shadow: 0 12px 30px -22px color-mix(in srgb, var(--ink) 55%, transparent);
}
.sd-ask .sd-ask-input {
  flex: 1 1 auto; height: 100%; padding: 0 10px 0 20px; border: 0; border-radius: 0; background: transparent;
  box-shadow: none; font-size: 16px; caret-color: var(--violet-ink);
}
.sd-ask .sd-ask-input:hover, .sd-ask .sd-ask-input:focus { background: transparent; box-shadow: none; border: 0; }
.sd-ask .sd-ask-input:focus-visible { outline: none; }
.sd-ask-go {
  display: inline-flex; flex: none; align-items: center; gap: 6px; height: 38px; margin-right: 6px; padding: 0 12px 0 16px;
  border: 0; border-radius: var(--radius-pill); background: var(--pill-bg);
  font: inherit; font-size: var(--fs-ui); font-weight: 600; white-space: nowrap; color: var(--ink); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease);
}
.sd-ask-go svg { width: 16px; height: 16px; color: var(--ink-2); transition: transform var(--dur-fast) var(--ease); }
.sd-ask-go:hover, .sd-ask-go:focus-visible { background: var(--pill-bg-hover); }
.sd-ask-go:hover svg { transform: translateX(1px); }
@media (min-width: 768px) { .sd-ask .sd-ask-input { font-size: var(--fs-body); } }
@media (max-width: 420px) { .sd-ask-go { padding: 0 12px; } .sd-ask-go svg { display: none; } }

/* --- Notes, errors, problems (never red) ------------------------------------------------------ */
.sd-note {
  max-width: var(--measure); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-control); background: var(--row-bg);
  font-size: var(--fs-card); line-height: var(--lh-ui); color: var(--ink);
}
.sd-note-warn { border-color: color-mix(in srgb, var(--c-warning) 46%, transparent); background: color-mix(in srgb, var(--c-warning) 12%, transparent); }
/* A field's error and a status problem: ink words after a small sun dot. */
.fielderr, .problem { position: relative; padding-left: 14px; font-size: var(--fs-fine); font-weight: 500; line-height: 1.5; color: var(--ink); }
.problem { font-size: var(--fs-card); }
.fielderr::before, .problem::before {
  content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--c-warning);
}
.sd-note, .fielderr { animation: sd-in var(--dur) var(--ease) both; }   /* they arrive; they do not blink */

/* --- Status (Connect and the share page) ------------------------------------------------------ */
.status { padding: var(--sp-4) var(--sp-5); border-radius: var(--radius-card); }
.status > * + * { margin-top: var(--sp-2); }
.status-line { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-body); line-height: var(--lh-ui); color: var(--ink); }
.status-line .dot { margin-top: calc((var(--lh-ui) * 1em - 6px) / 2); }   /* on the first line, however many follow */
.status form.inline { display: block; margin-top: var(--sp-3); font-size: var(--fs-card); }
.status table.record { margin-top: var(--sp-3); }
.dot { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.dot-waiting, .dot-seen, .dot-certificate, .dot-testing { background: var(--violet); animation: sd-pulse 2.4s ease-in-out infinite; }
.dot-live { background: var(--c-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-success) 22%, transparent); }

/* --- What was tested: chips; never colour alone (✓/✗ and the edge differ too) ------------------- */
.tests { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); font-size: var(--fs-fine); color: var(--ink-3); }
.cap {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 10px; border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-pill); font-size: var(--fs-fine); font-weight: 600; line-height: 1.2; white-space: nowrap; color: var(--ink-2);
}
.cap.is-yes { background: color-mix(in srgb, var(--c-success) 14%, transparent); border-color: color-mix(in srgb, var(--c-success) 45%, transparent); color: var(--c-success-ink); }
.cap.is-no { border-style: dashed; color: var(--ink-3); }

/* --- Tables ----------------------------------------------------------------------------------- */
/* The DNS record: a glass card, a label column, monospace values, a quiet Copy at the row's end. */
.record-card { padding: var(--sp-1) var(--sp-5); border-radius: var(--radius-card); overflow-x: auto; }
table.record { width: 100%; border-collapse: collapse; font-size: var(--fs-card); line-height: var(--lh-ui); }
table.record th { width: 7.5em; padding: var(--sp-2) var(--sp-3) var(--sp-2) 0; text-align: left; vertical-align: middle; font-weight: 500; color: var(--ink-2); }
table.record td { padding: var(--sp-2) 0; vertical-align: middle; color: var(--ink); overflow-wrap: anywhere; }
table.record tr + tr > * { border-top: 1px solid var(--hairline); }
table.record td:last-child { width: 1%; padding-left: var(--sp-3); text-align: right; white-space: nowrap; }
table.record tr { height: 48px; }
@media (max-width: 520px) { table.record th { width: 5.5em; } }   /* room for the target on a phone */

/* Ops: the site's plain table. */
.table-card { padding: var(--sp-1) var(--sp-5); border-radius: var(--radius-card); overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: var(--fs-card); line-height: var(--lh-ui); color: var(--ink-2); }
table.grid th {
  padding: var(--sp-3) var(--sp-2); text-align: left; vertical-align: bottom; white-space: nowrap;
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3);
}
table.grid td { padding: var(--sp-3) var(--sp-2); text-align: left; vertical-align: top; border-top: 1px solid var(--hairline); overflow-wrap: break-word; }
/* Words keep whole: on a phone the table scrolls inside its card instead of breaking "Done" in two. */
table.grid td:first-child { font-weight: 600; color: var(--ink); }
table.grid .unit, table.grid .fine { display: block; }
table.grid form.inline { display: inline-flex; align-items: center; gap: var(--sp-1); margin-right: var(--sp-2); }
table.grid input { width: 9em; height: 32px; padding: 0 10px; font-size: var(--fs-card); }
table.grid td:has(> form input:not([type="hidden"])) { padding-top: 6px; }   /* the field's middle on the row's first line */
table.grid.grid-plain td:first-child { font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }   /* a time, not a name */
table.grid .linkbtn { font-size: var(--fs-ui); }
@media (max-width: 899px) { table.grid { min-width: 720px; } }   /* readable columns; the card scrolls */
.stats { max-width: none; }                       /* the ops counts line runs the full width */

/* --- Lists ------------------------------------------------------------------------------------ */
/* Your inboxes: hairline rows, the action a quiet pill at the end. */
ul.rows { list-style: none; padding: 0; }
ul.rows li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--sp-4); align-items: center;
  padding: var(--sp-4) 0; border-top: 1px solid var(--hairline);
}
ul.rows li:first-child { border-top: 0; padding-top: 0; }
ul.rows strong { font-family: var(--font-display); font-size: var(--fs-h-card); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); overflow-wrap: anywhere; }
ul.rows .fine { grid-column: 1; }
ul.rows li > a { grid-row: 1 / span 2; grid-column: 2; }

/* DNS steps. */
ol.steps { padding-left: 1.3em; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink); }
ol.steps li + li { margin-top: 0.35em; }
ol.steps li::marker { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* --- Disclosures (the start card's <details open> keeps no class) ----------------------------- */
details > summary {
  display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-fine); font-weight: 600; color: var(--ink-3);
  cursor: pointer; list-style: none; border-radius: 3px;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: ""; flex: none; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease);
}
details[open] > summary::before { transform: rotate(45deg); }
details > summary:hover, details[open] > summary { color: var(--ink); }
details > :not(summary) { margin-top: var(--sp-3); }
details.hint > :not(summary) { max-width: var(--measure); font-size: var(--fs-card); font-weight: 400; line-height: var(--lh-body); color: var(--ink-2); }
details.hint > p + p { margin-top: var(--sp-2); }

/* --- Actions, expiry, close ------------------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); }
.expiry { max-width: none; margin-top: var(--sp-7); }
.closeform { display: block; margin-top: var(--sp-9); }
/* The share link: one box, its Copy inside at the top right. */
.share-row {
  display: flex; align-items: flex-start; gap: var(--sp-2); padding: 8px 8px 8px 12px;
  border: 1px solid var(--hairline-strong); border-radius: var(--radius-control); background: color-mix(in srgb, var(--ground) 40%, transparent);
}
.share-row .sd-url { flex: 1 1 auto; min-width: 0; padding: 3px 0 0; border: 0; border-radius: 0; background: none; }

/* --- Without backdrop blur, glass is a plain veil (after .glass, so it wins) ------------------ */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .glass-strong, .btn-secondary { background-color: var(--glass-fallback); background-image: none; }
}

/* --- Motion: gentle, purposeful, off under reduced motion ------------------------------------- */
@keyframes sd-in { from { opacity: 0; transform: translateY(2px); } }
@keyframes sd-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .btn:hover, .sd-brand:hover .sd-mark { transform: none; }
}
