/* MayWe: warm editorial paper, near-black ink and one rust accent, ruled with 1px hairlines.
 * Every colour lives here. Headings are set in a serif, text and controls in a sans;
 * labels and table headers are sentence case. Corners are 2px: boxes are few, and a
 * hairline does the work a card used to. The dark theme has its own paper and a lighter
 * rust; the footer and the two-tone illustrations sit on the dark field in both themes.
 * The first eleven token names also belong to app/design.py. Subscriber mail keeps
 * that module's defaults; these values belong only to the portal.
 *
 * WCAG 2.2, measured (light / dark):
 *   ink on paper 17.49 / 16.17, ink-2 10.68 / 11.04, ink-3 6.06 / 7.25;
 *   ink-3 on paper-2 5.60 / 6.71 and on the warning ground 5.37 / 5.42.
 *   Accent text on paper 6.09 / 6.31; primary button text (accent-ink on accent) 6.09 / 6.31.
 *   Field text 15.55 / 16.98, secondary field text 9.51 / 10.38; signal text 11.65 in both.
 *   ok, danger, warn and info on their own grounds: all >= 6.10.
 * line is decorative; line-2 identifies controls (3.27:1 or more on paper, paper-2 and sheet).
 * Focus uses focus on paper, signal on the field. No opacity reduces text contrast.
 */

:root {
  color-scheme: light;
  --paper: #faf8f3;
  --paper-2: #f2efe7;
  --ink: #141311;
  --ink-2: #3d3a34;
  --ink-3: #635e55;
  --line: #dfd9cd;
  --line-2: #8a8377;
  --accent: #a63a1f;
  --accent-ink: #faf8f3;
  --field: #1b1916;
  --field-ink: #f4f1ea;
  --field-muted: #c5beb2;
  --field-line: #3a362f;
  --signal: #d8e299;
  --signal-ink: #1c2410;
  --focus: #a63a1f;
  --danger: #9c2b23;
  --danger-bg: #f6e3e0;
  --ok: #1f5c3a;
  --ok-bg: #e3efe7;
  --warn: #734f0c;
  --warn-bg: #f3ead2;
  --info: #28546b;
  --info-bg: #e2edf2;
  --backdrop: #141311cc;
  /* A sheet sits a step above the paper: a mail, a document, a panel to work in. */
  --sheet: #fffdf7;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --serif: Newsreader, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  --radius: 2px;
  --radius-sm: 2px;
  --measure: 82ch;
  /* The page frame's gutter, as the frame rule below spells it out. A band that rules
   * edge to edge steps out of main by exactly this and pads back in. */
  --page-gutter: clamp(20px, 4vw, 64px);
  /* The space above a page's first section (the home page sets its own), and below its
   * last, before the footer: the same on the home page, the reading pages and the workspace. */
  --frame-top: clamp(20px, 2.2vw, 32px);
  --frame-bottom: clamp(32px, 4vw, 56px);
  /* One type scale for the home page, the reading pages and the workspace: a page's
   * title, and a section's. No heading below a page's h1 is set larger than it. */
  --type-h1: clamp(1.35rem, 2.1vw, 1.85rem);
  --type-h2: clamp(1.15rem, 1.45vw, 1.45rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #141311;
    --paper-2: #1d1b18;
    --ink: #f2efe8;
    --ink-2: #cdc7bc;
    --ink-3: #a8a196;
    --line: #2e2b26;
    --line-2: #7e776b;
    --accent: #e4785a;
    --accent-ink: #141311;
    --field: #100f0d;
    --field-ink: #f4f1ea;
    --field-muted: #c5beb2;
    --field-line: #3a362f;
    --signal: #d8e299;
    --signal-ink: #1c2410;
    --focus: #e4785a;
    --danger: #f5a69b;
    --danger-bg: #3d1d1a;
    --ok: #9fd4b2;
    --ok-bg: #183024;
    --warn: #e2c578;
    --warn-bg: #362b14;
    --info: #a5cde0;
    --info-bg: #192d38;
    --backdrop: #0b0a09cc;
    --sheet: #1d1b18;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141311;
  --paper-2: #1d1b18;
  --ink: #f2efe8;
  --ink-2: #cdc7bc;
  --ink-3: #a8a196;
  --line: #2e2b26;
  --line-2: #7e776b;
  --accent: #e4785a;
  --accent-ink: #141311;
  --field: #100f0d;
  --field-ink: #f4f1ea;
  --field-muted: #c5beb2;
  --field-line: #3a362f;
  --signal: #d8e299;
  --signal-ink: #1c2410;
  --focus: #e4785a;
  --danger: #f5a69b;
  --danger-bg: #3d1d1a;
  --ok: #9fd4b2;
  --ok-bg: #183024;
  --warn: #e2c578;
  --warn-bg: #362b14;
  --info: #a5cde0;
  --info-bg: #192d38;
  --backdrop: #0b0a09cc;
  --sheet: #1d1b18;
}

* { box-sizing: border-box; }
html { font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--paper); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
code, pre, kbd { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.05em 0.3em; overflow-wrap: anywhere; }
pre { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.85rem 1rem; overflow-x: auto; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
pre code { background: none; border: 0; padding: 0; font-size: 0.85rem; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.03em; text-wrap: balance; }
h1 { font-size: var(--type-h1); line-height: 1.08; letter-spacing: -0.04em; }
h2 { font-size: var(--type-h2); line-height: 1.18; letter-spacing: -0.03em; }
h3 { font-size: 1.02rem; line-height: 1.3; letter-spacing: -0.015em; }
h4 { font-size: 1rem; font-weight: 600; }
h2[id], h3[id], h4[id], section[id], li[id] { scroll-margin-top: 2rem; }
p { margin: 0 0 0.75rem; }
ul, ol { padding-left: 1.25rem; }
img { max-width: 100%; }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.lead { font-size: clamp(0.95rem, 1.05vw, 1.08rem); line-height: 1.55; color: var(--ink-2); max-width: 68ch; }
.eyebrow { font-size: 0.85rem; font-weight: 500; line-height: 1.4; color: var(--ink-3); margin: 0 0 0.75rem; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--signal); color: var(--signal-ink); }

/* Full width at every viewport: the header, the banners, the page and the footer span
 * the window edge to edge, with one fluid gutter, so their edges line up at 1440, 1920,
 * 2560 or 3840 px. No wrapper caps the page; only running text keeps a reading measure. */
.site-header, main.container, .site-footer, .banners { width: 100%; max-width: none; padding-inline: clamp(20px, 4vw, 64px); }

/* --- the shared header ------------------------------------------------------ */

.site-header {
  position: relative; display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  padding-block: 12px;
  border-bottom: 1px solid var(--line); background: var(--paper);
}
/* Out of sight until focused: the first stop for a keyboard, to the page's <main id="main">. */
.skip-link { position: absolute; left: 16px; top: 8px; z-index: 30; padding: 10px 16px; background: var(--accent); color: var(--accent-ink); font-weight: 600; border-radius: var(--radius-sm); text-decoration: none; }
.skip-link:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: -0.06em; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; fill: var(--accent); }
.site-header nav { display: flex; gap: 4px 24px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-decoration: none; border-bottom: 1px solid transparent; }
.site-header nav a:hover { color: var(--accent); border-bottom-color: currentColor; }
.site-header nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.site-header nav a.btn { min-height: 44px; color: var(--accent-ink); border: 1px solid var(--accent); }
/* Two classes, so .btn's display, later in the sheet, never shows it on a wide screen. */
.site-header .nav-toggle { display: none; }
/* nav.js folds the menu (nav-collapsed) when the links and the account do not fit on
 * the brand's row. Without JS, links remain visible and wrap naturally; the skip link
 * and the menu hooks are unchanged. */
.site-header.nav-collapsed .nav-toggle { display: inline-flex; order: 2; }
.site-header.nav-collapsed nav { order: 3; display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 0 8px; border-top: 1px solid var(--line); }
.site-header.nav-collapsed .nav-toggle[aria-expanded="true"] ~ nav { display: flex; }
.site-header.nav-collapsed nav a { min-height: 44px; padding: 0 4px; border-bottom: 1px solid var(--line); }
.site-header.nav-collapsed nav a[aria-current="page"] { border-bottom-color: var(--line); box-shadow: inset 2px 0 0 var(--accent); padding-left: 12px; }
.site-header.nav-collapsed nav a.btn { margin-top: 12px; justify-content: center; border: 1px solid var(--accent); }
/* The signed-in account at the header's right, where Sign in stands for a visitor: the
 * address and Sign out, set off from the links by a rule. With the menu folded it sits
 * beside the brand, ahead of the menu button, so the folded menu never hides it; on a
 * phone it takes its own row. */
.header-account { display: flex; align-items: center; gap: 12px; min-width: 0; padding-left: 20px; border-left: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.header-account-email { min-width: 0; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-account-email:empty { display: none; }
.site-header.nav-collapsed .header-account { order: 1; padding-left: 0; border-left: 0; }
@media (max-width: 599px) {
  .site-header.nav-collapsed .header-account { order: 3; flex-basis: 100%; justify-content: flex-end; }
  .site-header.nav-collapsed nav { order: 4; }
}

/* --- page frame --------------------------------------------------------------- */

main.container { flex: 1; margin: 0; padding-block: var(--frame-top) var(--frame-bottom); }
.page-intro { margin: 8px 0 48px; }
.page-intro h1 { margin-bottom: 1.25rem; max-width: 24ch; }
.page-intro .lead { margin-bottom: 0; }

/* --- the shared footer ------------------------------------------------------ */

.site-footer {
  padding-block: 56px 24px;
  background: var(--field); color: var(--field-muted); border-top: 1px solid var(--field-line); font-size: 0.9rem;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.1fr 1.2fr; gap: 40px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 0.5rem; font-family: var(--serif); font-weight: 400; font-size: 2.1rem; line-height: 1.1; letter-spacing: -0.06em; color: var(--field-ink); }
.footer-brand .brand-mark { width: 34px; height: 34px; fill: var(--signal); }
.footer-tagline { margin: 0 0 1.5rem; font-family: var(--serif); font-size: 1.15rem; letter-spacing: -0.015em; color: var(--field-ink); }
.footer-company { font-style: normal; line-height: 1.6; }
.footer-heading { font-family: var(--font); font-size: 0.85rem; font-weight: 500; letter-spacing: 0; color: var(--signal); margin: 0.25rem 0 0.9rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li + li { margin-top: 4px; }
.footer-links a { display: inline-block; padding: 5px 0; color: var(--field-ink); text-decoration: none; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--field-ink); text-decoration: underline; }
.footer-links a[aria-current="page"] { color: var(--field-ink); font-weight: 600; text-decoration: underline; }
.footer-contacts li + li { margin-top: 8px; }
.footer-contacts span { display: block; font-size: 0.825rem; color: var(--field-muted); }
.footer-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--field-line); font-family: var(--mono); font-size: 12px; color: var(--field-muted); }
.footer-meta .link-button { color: var(--field-ink); min-height: 44px; text-decoration-color: var(--signal); }
.site-footer :focus-visible { outline-color: var(--signal); }
.site-footer a { text-decoration-color: var(--signal); }

/* --- cards and headings ----------------------------------------------------- */

.card { padding: clamp(18px, 1.8vw, 24px); margin-bottom: 1rem; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); }
.card > h2:first-child { margin-top: 0; }
.card h3 { margin-top: 1.25rem; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; margin-bottom: 0.85rem; }

/* --- signed-in workspace ---------------------------------------------------- */

.workspace { --panel-gap: clamp(14px, 1.5vw, 22px); font-size: 0.9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.workspace-context { display: flex; justify-content: space-between; align-items: baseline; gap: 0.25rem 1rem; flex-wrap: wrap; margin-bottom: 0.65rem; }
.workspace-context > .account-bar, .workspace-context > p, .workspace .page-heading > h1, .workspace .page-heading :last-child:is(h1, p, .account-bar) { margin-bottom: 0; }
.workspace .page-heading .eyebrow { margin-bottom: 0.25rem; }
.workspace .page-heading .muted { font-size: 0.875rem; }
.workspace .hint { max-width: 72ch; }
.workspace .page-heading > *, .workspace-grid > *, .workspace-pair > * { min-width: 0; }
.workspace-grid, .workspace-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--panel-gap); align-items: start; }
.workspace-grid > .card { margin: 0; }
.workspace-wide { grid-column: 1 / -1; }
.workspace-nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin-bottom: 0.85rem; border-block: 1px solid var(--line); }
.workspace-nav a { display: inline-flex; align-items: center; min-height: 36px; font-size: 0.85rem; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.workspace-nav a:hover, .workspace-nav a:focus-visible { color: var(--accent); text-decoration: underline; }
.workspace-nav #campaigns-link { margin-inline-start: auto; }
.workspace .card:target { border-color: var(--accent); }
.workspace .card > h2 { margin-bottom: 0.75rem; }
.workspace :where(.actions, .row, .table-wrap, form, pre) + :where(.actions, .row, .field, p, form, div:not(:empty)) { margin-top: 0.65rem; }
.workspace #sending-domain-form { max-width: 55rem; }
.workspace #choose, .workspace #delete-subscriber-form { max-width: 28rem; }
.workspace .page-heading > .account-bar { margin: 0 0 0 auto; }
.workspace .workspace-pair > div > h3:first-child, .workspace .sender-dns > h3:first-child { margin-top: 0; }
.workspace-pair { padding-block: 0.75rem; border-block: 1px solid var(--line); }
.template-preview, #preview-html { display: block; width: 100%; border: 1px solid var(--line-2); background: var(--sheet); }
.template-preview { height: 340px; margin-top: 0.5rem; }
.mailbox-list, .mailbox-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--panel-gap); }
.mailbox-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.mailbox-list > *, .mailbox-tools > * { min-width: 0; }
.mailbox-list .card, .mailbox-tools .draft { border: 0; border-top: 1px solid var(--line); padding: 0.75rem 0; margin: 0; }
.mailbox-list h3:first-child, .mailbox-tools h3:first-child { margin-top: 0; }
.mailbox-tools { padding-top: 0.75rem; border-top: 1px solid var(--line); }
.mailbox-form { display: grid; gap: 0.45rem; align-content: start; justify-items: start; margin-bottom: 0.75rem; }
.mailbox-form label { display: grid; gap: 0.25rem; width: 100%; }
.mailbox-form textarea { min-height: 4rem; }
.workspace details > summary { cursor: pointer; }
@media (min-width: 64rem) {
  .workspace-grid, .workspace-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid:has(#create[hidden]) { grid-template-columns: minmax(0, 1fr); }
  .sender-layout { display: grid; grid-template-columns: minmax(16rem, 1fr) minmax(0, 2fr); align-items: start; gap: var(--panel-gap); }
  .sender-dns { padding-left: var(--panel-gap); border-left: 1px solid var(--line); }
}
@media (max-width: 599px) {
  .workspace-nav { column-gap: 1rem; }
  .workspace-nav #campaigns-link { margin-inline-start: 0; }
}
@media (pointer: coarse) {
  .workspace .btn, .workspace-nav a, .site-header .nav-toggle { min-height: 44px; }
}

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

form .field { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }
label { font-weight: 500; font-size: 0.85rem; }
.hint { color: var(--ink-2); font-size: 0.85rem; font-weight: 400; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="datetime-local"], input[type="file"], textarea, select {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line-2); font-size: 0.9375rem; padding: 7px 10px; min-height: 38px; line-height: 1.35; min-width: 0; width: 100%; border-radius: var(--radius-sm);
}
textarea { min-height: 7rem; font-family: var(--mono); font-size: 0.875rem; line-height: 1.6; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; }
.row .field { flex: 1 1 200px; margin-bottom: 0; }
.check { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 400; cursor: pointer; }

/* The sender: three fields, the line subscribers will see, and an address whose domain
 * is fixed once the sending domain exists (the part before the @ is the only input). */
.sender-block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.65rem 0.8rem 0.8rem; margin: 0.8rem 0; min-width: 0; }
.sender-block legend { font-weight: 600; padding: 0 0.35rem; }
.sender-block > .hint { margin-top: 0; }
.sender-preview { margin: 0.9rem 0 0; padding: 0.6rem 0.8rem; background: var(--paper-2); border-left: 2px solid var(--accent); border-radius: 0; overflow-wrap: anywhere; }
.sender-preview strong { font-weight: 600; }
.sender-preview + .actions { margin-top: 0.9rem; }
.address-input { display: flex; align-items: stretch; min-width: 0; }
.address-input input { flex: 1 1 0; width: auto; min-width: 6ch; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.address-input .address-domain { display: block; align-self: stretch; align-content: center; padding: 0 0.6rem; border: 1px solid var(--line-2); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--paper-2); color: var(--ink-2); font-family: var(--mono); font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; max-width: 75%; }
.sender-status { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.zone-choice { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; margin: 0 0 0.75rem; }
.zone-choice select { width: auto; max-width: 100%; }
.record-cell { display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-start; }
.record-cell .copy-line { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.record-cell .hint { margin: 0; }
.records td.nowrap code { white-space: nowrap; }
/* A reply's text in the replies table: its first three lines, the rest behind the
 * ellipsis (a screen reader still reads it all, and the title carries it). */
.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 12rem; }

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

.btn {
  font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  padding: 7px 14px; min-height: 38px; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; justify-content: center; line-height: 1.4; border-radius: var(--radius-sm);
}
.btn:hover { border-color: var(--ink); background: var(--paper-2); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); text-decoration: underline; text-underline-offset: 0.2em; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn:disabled { background: var(--paper-2); border-color: var(--line-2); color: var(--ink-2); opacity: 1; cursor: not-allowed; }
.btn-ghost { border-color: transparent; }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.link-button { font: inherit; background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.2em; cursor: pointer; }

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

/* A badge says its word as written, in the mono face, on its tone's own ground. */
.badge { display: inline-block; max-width: 100%; padding: 1px 7px; border-radius: var(--radius-sm); font-family: var(--mono); font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: 0; overflow-wrap: anywhere; border: 1px solid transparent; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-muted { color: var(--ink-2); background: var(--paper-2); border-color: var(--line); }

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

/* Every table sits in a .table-wrap, which scrolls on its own so the page never does;
 * give a wide one tabindex="0", role="region" and an aria-label so a keyboard can scroll it.
 * A table is ruled, not boxed: a hairline above and below, and between its rows. */
.table-wrap { overflow-x: auto; max-width: 100%; border-block: 1px solid var(--line-2); }
caption { caption-side: top; text-align: left; font-weight: 600; padding: 0.5rem 0.65rem; color: var(--ink); border-bottom: 1px solid var(--line); }
th[scope="row"] { font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-family: var(--font); font-size: 0.8rem; font-weight: 500; letter-spacing: 0; color: var(--ink-3); background: transparent; border-bottom-color: var(--line-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--ink-2); font-style: italic; }

/* --- banners ---------------------------------------------------------------- */

.banners { position: sticky; top: 0; z-index: 10; display: flex; flex-direction: column; gap: 0.5rem; padding-block: 0.5rem 0; margin: 0; }
.banners:empty { display: none; }
.banner { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding: 0.65rem 0.9rem; border: 1px solid; border-radius: var(--radius-sm); font-size: 0.925rem; background: var(--paper); }
.banner-error { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
.banner-success { color: var(--ok); background: var(--ok-bg); border-color: var(--ok); }
.banner-info { color: var(--info); background: var(--info-bg); border-color: var(--info); }
.banner a { color: inherit; }
.banner-close { background: none; border: 0; color: inherit; font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 0 0.2rem; }
.notice { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2); padding: 0.75rem 1rem; margin: 0 0 1rem; }
.notice-warn { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
/* A panel that could not load says so where it would stand, with its retry. */
.notice-error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.notice-error .btn { margin-top: 0.5rem; }

/* --- reveal-once panels and copy rows --------------------------------------- */

.reveal { border: 1px solid var(--warn); border-radius: var(--radius); background: var(--warn-bg); padding: 1rem 1.25rem; margin: 0 0 1.25rem; color: var(--ink); }
.reveal h3 { margin-top: 0; }
.reveal .warning { color: var(--warn); font-weight: 600; }
.secret-field { margin: 0.75rem 0; }
.secret-field .label { font-family: var(--font); font-size: 0.8rem; font-weight: 500; color: var(--ink-3); }
.secret { display: block; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0.55rem 0.7rem; font-family: var(--mono); font-size: 0.85rem; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; margin: 0.25rem 0; color: var(--ink); }
.copy-row { display: flex; gap: 0.5rem; align-items: flex-start; }
.copy-row > pre, .copy-row > .secret { flex: 1; min-width: 0; }
.records td code { white-space: pre-wrap; }
/* A mailbox draft under review: its text as written, the raw message folded away. */
.draft-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.draft-mime pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- toggle ----------------------------------------------------------------- */

.toggle { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; font-weight: 500; }
.toggle input { width: 2.4rem; height: 1.3rem; appearance: none; -webkit-appearance: none; background: var(--line-2); border-radius: var(--radius-sm); position: relative; cursor: pointer; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 0.15rem; left: 0.15rem; width: 1rem; height: 1rem; background: var(--paper); border-radius: var(--radius-sm); transition: transform 0.15s; }
.toggle input:checked { background: var(--ok); }
.toggle input:checked::after { transform: translateX(1.1rem); }
.toggle input:disabled { cursor: not-allowed; }

/* --- account bar, usage, stats ---------------------------------------------- */

.account-bar { display: flex; gap: 0.25rem 1rem; align-items: center; flex-wrap: wrap; font-size: 0.8rem; color: var(--ink-3); margin-bottom: 0.5rem; }
.account-bar strong { color: var(--ink); font-weight: 600; }
.usage-bar .notice { padding: 0.45rem 0.75rem; margin-bottom: 0.75rem; }
.usage-line, .paused-sites { font-size: 0.85rem; }
.paused-sites { list-style: none; }
.paused-sites li { overflow-wrap: anywhere; }
.paused-sites li + li { margin-top: 0.35rem; }
/* Sized to its longest label ("complained"), so a campaign's nine counts make one row on a laptop. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: 0.5rem; margin: 0.75rem 0; }
.stat { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; background: transparent; }
.stat strong { display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-family: var(--font); font-size: 0.8rem; font-weight: 500; color: var(--ink-3); }

/* --- site list -------------------------------------------------------------- */

/* Sites are a ruled list: a hairline between rows, and no box around each. */
.site-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.site-item { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0.7rem 0; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.site-item a.name { font-family: var(--serif); font-weight: 400; font-size: 1.2rem; letter-spacing: -0.015em; }
.site-item .origin { font-family: var(--mono); font-size: 0.85rem; color: var(--ink-2); }
/* An access request is a site item whose first column is a person. */
.request-email, .request-note { overflow-wrap: anywhere; }
.request-note { margin: 0.35rem 0 0; }

/* --- plans ------------------------------------------------------------------ */

.plans td:first-child { font-weight: 600; }
/* Keep the price column in view on narrow screens. */
@media (max-width: 30rem) {
  .plans th, .plans td { padding-left: 0.4rem; padding-right: 0.4rem; }
}

/* --- dialogs ---------------------------------------------------------------- */

dialog { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--paper); color: var(--ink); padding: 1.25rem; max-width: 32rem; width: calc(100% - 32px); }
dialog::backdrop { background: var(--backdrop); }
dialog h2 { margin-top: 0; }
dialog .actions { margin-top: 1rem; justify-content: flex-end; }
.signin-dialog form { margin-top: 1rem; }
.signin-dialog form .btn { width: 100%; }
.signin-error { color: var(--danger); font-size: 0.9rem; margin: 0 0 0.75rem; overflow-wrap: anywhere; }
.signin-error:empty { display: none; }
.signin-other { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.signin-other .link-button { min-height: 44px; text-align: left; }
.signin-address { overflow-wrap: anywhere; }

/* --- misc ------------------------------------------------------------------- */

.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }
.callback-card { max-width: 36rem; overflow-wrap: anywhere; }

/* --- content pages: sections, prose, legal text ------------------------------- */

.section { margin: 0 0 3rem; }
.section > h2:first-child { margin-top: 0; }

/* Long text: a readable measure and an even rhythm. Wrap a page's text in
 * <article class="prose">; legal pages add .doc-meta, .toc and ol.clauses. */
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--type-h2); margin: 1.65rem 0 0.65rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.prose h3 { margin: 1.75rem 0 0.5rem; }
.prose h4 { margin: 1.5rem 0 0.4rem; }
.prose .page-intro + h2, .prose .doc-meta + h2, .prose .toc + h2 { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose dl, .prose blockquote, .prose pre, .prose .table-wrap { margin: 0 0 1rem; }
.prose li + li { margin-top: 0.35rem; }
.prose li > ul, .prose li > ol, .prose li > p { margin-top: 0.35rem; margin-bottom: 0; }
.prose strong { font-weight: 600; }
.prose blockquote { margin-left: 0; padding: 0.25rem 0 0.25rem 1rem; border-left: 2px solid var(--line-2); color: var(--ink-2); font-family: var(--serif); font-size: 1.1rem; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.prose dt { font-weight: 600; }
.prose dd { margin: 0 0 0.75rem; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0 0 1.75rem; padding: 0.6rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 0.9rem; color: var(--ink-2); }
.toc { margin: 0 0 2.25rem; padding: 1rem 0; background: none; border: 0; border-block: 1px solid var(--line); border-radius: 0; }
.toc-title { font-family: var(--font); font-size: 0.85rem; font-weight: 500; color: var(--ink-3); margin: 0 0 0.5rem; }
.toc ol, .toc ul { margin: 0; padding-left: 1.25rem; columns: 2 16rem; column-gap: 2rem; }
.toc li { break-inside: avoid; }
.toc li + li { margin-top: 0.25rem; }
/* Numbered clauses, 1. / 1.1. / 1.1.1., from nested <ol class="clauses"> lists. Only the
 * items of those ols are clauses: a <ul> inside a clause keeps its bullets. */
.prose ol.clauses, .prose ol.clauses ol { list-style: none; padding-left: 0; counter-reset: clause; }
.prose ol.clauses > li, .prose ol.clauses ol > li { counter-increment: clause; position: relative; padding-left: 3rem; }
.prose ol.clauses > li::before, .prose ol.clauses ol > li::before { content: counters(clause, ".") "."; position: absolute; left: 0; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.prose ol.clauses ol > li { padding-left: 3.5rem; }
/* A document in sections (the terms, the acceptable use policy, the DPA): one
 * <ol class="clauses sectioned"> whose items are the sections, each an h2 followed by
 * its text and its clauses in a nested ol. The section number moves from the item's
 * margin into its heading, so the clauses below it indent one step only; they are still
 * numbered 1.1. and 1.1.1. A section's own paragraphs keep the prose rhythm, and a
 * clause's first paragraph sits level with its number. */
.prose ol.clauses.sectioned > li { padding-left: 0; }
.prose ol.clauses.sectioned > li::before { content: none; }
.prose ol.clauses.sectioned > li + li { margin-top: 0; }
.prose ol.clauses.sectioned > li > h2::before { content: counter(clause) ". "; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.prose ol.clauses.sectioned > li > p, .prose ol.clauses.sectioned > li > ol { margin: 0 0 1rem; }
.prose ol.clauses.sectioned ol > li > p:first-child { margin-top: 0; }

/* --- steps, checklists, facts ------------------------------------------------- */

/* Ruled steps with plain numerals: 01, 02, 03 in the accent, a hairline down to the next. */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 1.25rem; }
.steps > li { counter-increment: step; position: relative; min-height: 2.25rem; padding-left: 3.25rem; }
.steps > li + li { margin-top: 0; }
.steps > li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0.15em; width: 2.25rem; color: var(--accent); font-family: var(--mono); font-size: 0.85rem; font-weight: 500; line-height: 1.6; font-variant-numeric: tabular-nums; }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 0.55rem; top: 2rem; bottom: -1rem; border-left: 1px solid var(--line); }
.step-title { display: block; margin-bottom: 0.2rem; font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.steps > li > p { margin: 0 0 0.4rem; }
.steps > li > :last-child { margin-bottom: 0; }

.checklist { list-style: none; padding-left: 0; }
.checklist > li { position: relative; padding-left: 1.75rem; }
.checklist > li::before { content: ""; position: absolute; left: 0.4rem; top: 0.3em; width: 0.4rem; height: 0.75rem; border: solid var(--ok); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }

/* Label and value pairs (the company, the contacts): <dl class="facts"><div><dt>…</dt><dd>…</dd></div>…</dl>.
 * A pair breaks onto two lines where both do not fit. */
.facts { margin: 0 0 1.25rem; padding: 0; }
.facts > div { display: flex; flex-wrap: wrap; gap: 0.15rem 1.5rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.facts > div:first-child { border-top: 1px solid var(--line); }
.facts dt { flex: 0 0 11rem; font-weight: 500; color: var(--ink-3); }
.facts dd { flex: 1 1 14rem; min-width: 0; margin: 0; color: var(--ink); overflow-wrap: anywhere; }

/* Shared control details and small screens. */
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input:disabled, textarea:disabled, select:disabled { color: var(--ink-2); -webkit-text-fill-color: var(--ink-2); background: var(--paper-2); opacity: 1; cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
input[type="file"]::file-selector-button { font: inherit; background: var(--paper-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px 8px; margin-right: 8px; }
.row .field, .site-item > * { min-width: 0; }
.site-item .origin, .account-bar strong { overflow-wrap: anywhere; }
tbody tr:last-child th { border-bottom: 0; }
.card > :last-child, .notice > :last-child { margin-bottom: 0; }
main, .card, .footer-grid > * { min-width: 0; }
@media (max-width: 1099px) {
  .footer-grid { grid-template-columns: 1.2fr 1fr; gap: 40px; }
}
@media (max-width: 599px) {
  .site-header { padding-top: 10px; padding-bottom: 10px; }
  .page-intro { margin-bottom: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  .footer-about, .footer-grid > :last-child { grid-column: 1 / -1; }
  .footer-company { font-size: 0.85rem; }
  .site-footer { padding-top: 40px; }
  .footer-heading { margin-top: 0; }
  .footer-links a { padding: 7px 0; }
  .footer-meta { margin-top: 32px; }
  .workspace input, .workspace textarea, .workspace select { font-size: 1rem; }
  .copy-row { flex-wrap: wrap; }
  .copy-row > pre, .copy-row > .secret { flex-basis: 100%; }
  /* DNS records, replies and direct messages as blocks, each field under its column's
   * name (data-label). */
  .records thead, .activity thead { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .records table, .records tbody, .records tr, .records td,
  .activity table, .activity tbody, .activity tr, .activity td { display: block; width: 100%; }
  .records tr, .activity tr { border-bottom: 1px solid var(--line-2); padding: 0.4rem 0; }
  .records tbody tr:last-child, .activity tbody tr:last-child { border-bottom: 0; }
  .records td, .activity td { border-bottom: 0; padding: 0.35rem 0.8rem; }
  .records td.num { text-align: left; }
  .records td::before, .activity td::before { content: attr(data-label); display: block; font-family: var(--font); font-size: 0.8rem; font-weight: 500; color: var(--ink-3); }
  .activity .clamp { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* --- print: the text, without the chrome ------------------------------------------ */

@media print {
  .site-header nav, .nav-toggle, .skip-link, .footer-meta, .banners, .toc { display: none !important; }
  .site-footer { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .prose { max-width: none; }
  a { text-decoration: underline; }
}
