/* Sivro Mail. Sivro's own palette and type (cream, navy, coral; Fredoka and Nunito), on Mailroom's layout.
   The design system (docs/design/system.md): use the tokens below, never a raw colour or size. */
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url(/fonts/fredoka-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 700; font-display: swap; src: url(/fonts/fredoka-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url(/fonts/nunito-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 400; font-style: italic; font-display: swap; src: url(/fonts/nunito-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 600; font-display: swap; src: url(/fonts/nunito-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url(/fonts/nunito-latin-700-normal.woff2) format('woff2'); }
/* Until the fonts arrive, Arial sized and spaced like them, so the swap moves nothing (metrics measured from the files, T095). */
@font-face { font-family: 'Nunito Fallback'; font-weight: 100 650; src: local('Arial'), local('ArialMT'); size-adjust: 102%; ascent-override: 99.1%; descent-override: 34.6%; line-gap-override: 0%; }
@font-face { font-family: 'Nunito Fallback'; font-weight: 651 900; src: local('Arial Bold'), local('Arial-BoldMT'); size-adjust: 98.8%; ascent-override: 102.4%; descent-override: 35.7%; line-gap-override: 0%; }
@font-face { font-family: 'Fredoka Fallback'; src: local('Arial Bold'), local('Arial-BoldMT'); size-adjust: 94.2%; ascent-override: 103.4%; descent-override: 25.1%; line-gap-override: 0%; }

:root {
  /* Sivro's palette (names kept: brand.js sets --coral and --cream, older screens use the rest) */
  --cream: #F4EBDD; --cream-2: #E8DBC6; --paper: #FFFBF4;
  --navy: #141D33; --navy-2: #27324F; --muted: #585F74;
  --coral: #FF6B4A; --coral-ink: #A8361A; --teal: #1FA39A; --teal-dark: #0F6E68; --mustard: #F2B33D; --sky: #CFE3EA;

  /* colour roles */
  --bg: var(--cream);                 /* the page (brand-able) */
  --surface: var(--paper);            /* cards, reader, dialogs */
  --surface-sunk: var(--cream-2);     /* hover, dividers, quiet chips */
  --field: #FFFFFF;                   /* inside inputs */
  --ink: var(--navy);                 /* text, outlines and shadows on surfaces */
  --ink-soft: #414B66;                /* secondary text, 7.3:1 */
  --ink-muted: var(--muted);          /* dates and hints, 5.4:1 */
  --link: var(--teal-dark);           /* links, breadcrumbs, Back, 5.2:1 */
  --accent: var(--coral);             /* the one primary action per view (brand-able) */
  --on-accent: var(--navy);           /* navy on the coral, in light and dark */
  --accent-soft: #FFE3DC;             /* your own bubbles */
  --danger: var(--coral-ink);         /* can't-undo actions and error text */
  --on-danger: var(--paper);
  --danger-bg: #FFE3DC;
  --ok: var(--teal-dark); --ok-bg: #DDF3EE; --ok-strong-bg: #C8EBD9;
  --warn-bg: #FFF1CF;                 /* Claude notes, cautions */
  --info-bg: var(--sky);              /* info notices, selected rows */
  --highlight: var(--mustard);        /* counts on navy, "new" tags, the view-as banner */
  --on-dark: #F4EBDD;                 /* text on navy surfaces (the composer bar) */
  --inverse: var(--navy); --on-inverse: var(--cream);   /* the toast and status line */
  --accent-text: var(--accent);       /* the accent as a mark or text: lightened in dark when it would not read */
  --scrim: rgba(20, 29, 51, .45);
  --alert: #FF6B4A;                   /* warning marks: stays Sivro coral under any brand */
  /* text on the page colour: the same as on surfaces unless a brand's page is dark (see the brand block) */
  --on-bg: var(--ink); --on-bg-soft: var(--ink-soft); --on-bg-muted: var(--ink-muted); --on-bg-link: var(--link);

  /* type: 6 sizes, Nunito 400/600/700, Fredoka 600/700 */
  --display: 'Fredoka', 'Fredoka Fallback', system-ui, sans-serif;
  --body: 'Nunito', 'Nunito Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --t-display: 28px;  /* page titles */
  --t-title: 20px;    /* card, section and dialog titles */
  --t-body: 15px;     /* reading */
  --t-ui: 14px;       /* buttons, labels, menu */
  --t-small: 13px;    /* hints, dates, previews */
  --t-tiny: 12px;     /* tags, pills, badges, table heads */
  --lh-tight: 1.15; --lh-ui: 1.3; --lh-body: 1.5;

  /* space (4 px steps), radii, lines, lifts */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;
  --line: 1.5px solid var(--surface-sunk);
  --outline: var(--navy);            /* outlines (navy; a soft grey-blue in dark) */
  --shadow: var(--navy);             /* the hard offset shadows */
  --edge: 2px solid var(--outline);
  --edge-bold: 3px solid var(--outline);
  --lift-1: 2px 2px 0 var(--shadow);   /* things you press */
  --lift-2: 4px 4px 0 var(--shadow);   /* cards, popovers, the picked row */
  --lift-3: 6px 6px 0 var(--shadow);   /* dialogs, the composer, the sign-in card */
  --r: var(--r-lg); --drop: var(--lift-2);   /* old names */
  --focus: var(--ink);

  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23141D33' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light;

  /* control heights */
  --h-sm: 32px; --h-md: 40px; --h-lg: 48px;
}
@media (max-width: 899px) {
  :root { --t-display: 24px; --t-body: 16px; --h-sm: 44px; --h-md: 44px; }
}
/* Dark: the person's own choice (Settings > Account > Appearance), never a brand's. "Match my device" (no class on
   <html>) follows the device; theme-light / theme-dark on <html> (set before the first paint by theme-boot.js) pin it. */
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) {
    color-scheme: dark;
    --bg: #0F1626;                    /* a deep navy page, not black */
    --surface: #1A2338; --surface-sunk: #263150; --field: #121A2C;
    --ink: #F4EBDD; --ink-soft: #D3C8B6; --ink-muted: #ADA597;     /* 13.3 / 9.5 / 6.4 : 1 on cards */
    --link: #5ED1C5;                                                    /* 8.5:1 on cards */
    --outline: #9DA6C2; --shadow: #05080F;
    --danger: #FF8F75; --on-danger: var(--navy); --danger-bg: #43201C;
    --ok: #6FD8C4; --ok-bg: #123430; --ok-strong-bg: #17402F;
    --warn-bg: #3A3119; --info-bg: #1C3846; --accent-soft: #3A2630;
    --inverse: #F4EBDD; --on-inverse: var(--navy);
    --scrim: rgba(3, 6, 12, .65);
    --on-bg: var(--ink); --on-bg-soft: var(--ink-soft); --on-bg-muted: var(--ink-muted); --on-bg-link: var(--link);
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23F4EBDD' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
:root.theme-dark {
  color-scheme: dark;
  --bg: #0F1626;                    /* a deep navy page, not black */
  --surface: #1A2338; --surface-sunk: #263150; --field: #121A2C;
  --ink: #F4EBDD; --ink-soft: #D3C8B6; --ink-muted: #ADA597;     /* 13.3 / 9.5 / 6.4 : 1 on cards */
  --link: #5ED1C5;                                                    /* 8.5:1 on cards */
  --outline: #9DA6C2; --shadow: #05080F;
  --danger: #FF8F75; --on-danger: var(--navy); --danger-bg: #43201C;
  --ok: #6FD8C4; --ok-bg: #123430; --ok-strong-bg: #17402F;
  --warn-bg: #3A3119; --info-bg: #1C3846; --accent-soft: #3A2630;
  --inverse: #F4EBDD; --on-inverse: var(--navy);
  --scrim: rgba(3, 6, 12, .65);
  --on-bg: var(--ink); --on-bg-soft: var(--ink-soft); --on-bg-muted: var(--ink-muted); --on-bg-link: var(--link);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23F4EBDD' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:root.theme-light { color-scheme: light; }

/* A brand's colours: text on its accent and on its page picks navy or cream, whichever reads (OKLCH lightness 0.58
   is where both read the same). Unbranded pages keep the exact Sivro values above. A brand's page colour is used in
   light only: in dark the page is Sivro's dark one, and an accent too dark to see there is lightened for marks. */
@supports (color: oklch(from red l c h)) {
  :root[data-brand]:not([data-brand="Sivro"]), :root .brand-preview {
    --accent: var(--coral);
    --on-accent: oklch(from var(--coral) clamp(0.234, (0.58 - l) * 1000, 0.943) clamp(0.021, (l - 0.58) * 1000, 0.045) clamp(79, (l - 0.58) * 100000, 266));
    --on-side-soft: color-mix(in oklab, var(--on-side, #F4EBDD) 85%, var(--side-bg, #141D33));
    --nav-count: var(--on-side);
  }
  :root.theme-light[data-brand]:not([data-brand="Sivro"]), :root .brand-preview {
    --bg: var(--cream);
    --on-bg: oklch(from var(--cream) clamp(0.234, (0.58 - l) * 1000, 0.943) clamp(0.021, (l - 0.58) * 1000, 0.045) clamp(79, (l - 0.58) * 100000, 266));
    --on-bg-soft: oklch(from var(--cream) clamp(0.415, (0.58 - l) * 1000, 0.86) 0.035 clamp(79, (l - 0.58) * 100000, 268));
    --on-bg-muted: oklch(from var(--cream) clamp(0.487, (0.58 - l) * 1000, 0.8) 0.03 clamp(79, (l - 0.58) * 100000, 270));
    --on-bg-link: oklch(from var(--cream) clamp(0.487, (0.58 - l) * 1000, 0.84) 0.08 188);
  }
  @media (prefers-color-scheme: light) {
    :root:not(.theme-dark)[data-brand]:not([data-brand="Sivro"]) {
      --bg: var(--cream);
      --on-bg: oklch(from var(--cream) clamp(0.234, (0.58 - l) * 1000, 0.943) clamp(0.021, (l - 0.58) * 1000, 0.045) clamp(79, (l - 0.58) * 100000, 266));
      --on-bg-soft: oklch(from var(--cream) clamp(0.415, (0.58 - l) * 1000, 0.86) 0.035 clamp(79, (l - 0.58) * 100000, 268));
      --on-bg-muted: oklch(from var(--cream) clamp(0.487, (0.58 - l) * 1000, 0.8) 0.03 clamp(79, (l - 0.58) * 100000, 270));
      --on-bg-link: oklch(from var(--cream) clamp(0.487, (0.58 - l) * 1000, 0.84) 0.08 188);
    }
  }
  @media (prefers-color-scheme: dark) {
    :root:not(.theme-light)[data-brand]:not([data-brand="Sivro"]) { --accent-text: oklch(from var(--coral) max(l, 0.74) c h); }
  }
  :root.theme-dark[data-brand]:not([data-brand="Sivro"]) { --accent-text: oklch(from var(--coral) max(l, 0.74) c h); }
}
/* The server's fixed mark follows the device by itself; a pinned choice moves it too. */
:root.theme-dark .sivro-watermark { color: #F4EBDD !important; }
:root.theme-light .sivro-watermark { color: #141D33 !important; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
/* --fg, --fg-soft, --fg-muted, --fg-link: the text colours where you are (the page, or a surface on it) */
body { --fg: var(--on-bg); --fg-soft: var(--on-bg-soft); --fg-muted: var(--on-bg-muted); --fg-link: var(--on-bg-link);
  background: var(--bg); color: var(--fg); font: 400 var(--t-body)/var(--lh-body) var(--body); -webkit-font-smoothing: antialiased; }
.card, .box, .card-tile, .reader, .composer, .popover, .help, .pick, .acct, .review-card, .token, .install-hint, .bubble,
.audit-table, .ticket-body, .timeline-list li, .mailbox-row, .suggest, .acct-form, .settings-hits li, .row[aria-selected="true"], .row.picked {
  --fg: var(--ink); --fg-soft: var(--ink-soft); --fg-muted: var(--ink-muted); --fg-link: var(--link); color: var(--fg); }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: var(--lh-tight); }
h1 { font-size: var(--t-display); } h2 { font-size: var(--t-title); } h3 { font-size: var(--t-body); }
strong, b { font-weight: 700; }
small { font-size: var(--t-small); }
code, pre, kbd, samp { font-size: var(--t-small); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.side :focus-visible, .topbar :focus-visible { outline-color: var(--on-side, var(--cream)); }
.compose-head :focus-visible { outline-color: var(--on-dark); }
.toast :focus-visible, .status :focus-visible { outline-color: var(--on-inverse); }
[hidden] { display: none !important; }
.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; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .spinner, .earlier.busy::before { animation: spin 2.4s linear infinite !important; }
}

.wordmark { font: 700 var(--t-display)/1 var(--display); letter-spacing: -0.5px; color: var(--ink); display: inline-flex; align-items: baseline; gap: var(--s2); }
.wordmark .dot { color: var(--coral); }
.wordmark small { font: 600 var(--t-ui)/1 var(--display); color: var(--ink-soft); letter-spacing: 0; }

/* ---------- buttons: primary / secondary (plain .btn) / quiet / danger; .small / (md) / lg ---------- */
.btn { --btn-h: var(--h-md); --btn-px: 16px; --btn-fs: var(--t-ui); --btn-lift: var(--lift-1); --btn-press: 2px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--btn-h); padding: 0 var(--btn-px);
  border: var(--edge); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: 700 var(--btn-fs)/1.2 var(--body);
  box-shadow: var(--btn-lift); cursor: pointer; text-decoration: none; transition: transform .06s, box-shadow .06s, background-color .1s; }
.btn:hover { background: var(--field); }
.btn:active { transform: translate(var(--btn-press), var(--btn-press)); box-shadow: 0 0 0 var(--shadow); }
.btn.small { --btn-h: var(--h-sm); --btn-px: 12px; --btn-fs: var(--t-small); }
.btn.lg, .side .compose, .auth form .btn.primary { --btn-h: var(--h-lg); --btn-px: 20px; --btn-fs: var(--t-body); --btn-lift: var(--lift-2); --btn-press: 4px; border: var(--edge-bold); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in oklab, var(--accent) 86%, var(--field)); }
.btn.danger { background: var(--danger); color: var(--on-danger); }
.btn.danger:hover { background: color-mix(in oklab, var(--danger) 88%, var(--ink)); }
.btn.quiet { border-color: transparent; box-shadow: none; background: transparent; color: inherit; }
.btn.quiet:hover { background: var(--surface-sunk); color: var(--ink); }
.btn.quiet:active { transform: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
/* icon-only buttons are square, the glyph at title size */
.menu-btn, .compose-close, .search-row .pop-anchor .btn { min-width: var(--btn-h); padding: 0; font-size: var(--t-title); }
.link { background: none; border: 0; padding: 0; color: var(--fg-link); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
a { color: var(--fg-link); }

/* ---------- fields ---------- */
label.field { display: grid; gap: 6px; font-weight: 700; font-size: var(--t-ui); }
.field input, .input { width: 100%; min-height: var(--h-md); padding: 8px 12px; border: var(--edge); border-radius: var(--r-md); background: var(--field);
  color: var(--ink); font: 600 var(--t-body)/var(--lh-ui) var(--body); }
textarea.input { min-height: 88px; line-height: var(--lh-body); }
.field input::placeholder, .input::placeholder, .chip-input::placeholder { color: var(--ink-muted); font-weight: 600; opacity: 1; }
select.input { appearance: none; padding-right: 36px; cursor: pointer; background: var(--field) var(--select-chevron) no-repeat right 12px center; }
input[type=file].input, .field input[type=file] { padding: 4px; min-height: var(--h-md); font-weight: 600; font-size: var(--t-small); color: var(--ink-soft); }
input[type=file]::file-selector-button { min-height: calc(var(--h-sm) - 4px); margin-right: var(--s3); padding: 0 12px; border: var(--edge); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font: 700 var(--t-small)/1 var(--body); box-shadow: var(--lift-1); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--field); }
.field .hint, .hint { font-weight: 600; color: var(--fg-soft); font-size: var(--t-small); }
.code-input { font: 700 var(--t-display)/1 var(--display) !important; letter-spacing: 10px; text-align: center; }

/* ---------- notices: info, warn, error, ok ---------- */
.error, .warn-note { background: var(--danger-bg); border: 2px solid var(--danger); color: var(--danger); border-radius: var(--r-md); padding: 10px 14px; font-weight: 700; }
.note { background: var(--info-bg); border: var(--edge); color: var(--ink); border-radius: var(--r-md); padding: 10px 14px; font-weight: 600; }
.warn-note { padding: 8px 12px; }
.ok-note { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); font-weight: 700; }

/* ---------- sign-in screens ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s6) var(--s4); }
.card { width: min(440px, 100%); background: var(--surface); border: var(--edge-bold); border-radius: var(--r-xl); box-shadow: var(--lift-3);
  padding: 28px 28px 24px; display: grid; gap: var(--s4); }
.card.wide { width: min(560px, 100%); }
.card h1 { font: 700 var(--t-display)/var(--lh-tight) var(--display); margin: 0; }
.card p { margin: 0; color: var(--ink-soft); font-weight: 600; }
.card form { display: grid; gap: var(--s4); }
.qr { justify-self: center; width: 220px; height: 220px; border: var(--edge); border-radius: var(--r-md); background: #FFFFFF; padding: 6px; }
.qr img { width: 100%; height: 100%; display: block; }
.secret { font: 700 var(--t-body)/1.6 var(--mono); background: var(--field); border: 2px dashed var(--outline); border-radius: var(--r-sm); padding: 8px 12px; text-align: center; word-break: break-all; user-select: all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.codes li { font: 700 var(--t-body)/1 var(--mono); background: var(--field); border: var(--edge); border-radius: var(--r-sm); padding: 10px; text-align: center; }
.steps { margin: 0; padding-left: 20px; color: var(--fg-soft); font-weight: 600; display: grid; gap: var(--s1); }
.foot { text-align: center; color: var(--fg-muted); font-size: var(--t-small); font-weight: 600; }

/* ---------- the mail app ---------- */
.shell { display: grid; grid-template-columns: 256px 400px 1fr; height: 100vh; height: 100dvh; }
.topbar, .backdrop { display: none; }

.side { background: var(--side-bg, var(--navy)); color: var(--on-side, var(--cream)); display: flex; flex-direction: column; padding: 18px 12px; gap: 2px; overflow-y: auto; }
.side .wordmark { color: var(--on-side, var(--cream)); padding: 4px 10px 14px; }
.side .wordmark small { color: var(--on-side-soft, var(--cream-2)); }
.side .compose { margin: 0 4px 14px; border-color: var(--on-side, var(--cream)); box-shadow: 4px 4px 0 var(--danger); }
.nav { display: flex; align-items: center; gap: var(--s2); min-height: 38px; padding: 7px 12px; border-radius: var(--r-md); color: var(--on-side, var(--cream)); background: none; border: 0; text-align: left; font: 700 var(--t-ui)/var(--lh-ui) var(--body); cursor: pointer; width: 100%; }
.nav .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.nav { text-decoration: none; }
.nav:hover { background: var(--side-hover, var(--navy-2)); }
.nav[aria-current="true"] { background: var(--on-side, var(--cream)); color: var(--side-bg, var(--navy)); }
.nav .count { margin-left: auto; font-weight: 700; color: var(--nav-count, var(--side-count, var(--highlight))); font-size: var(--t-small); }
.nav[aria-current="true"] .count { color: inherit; }
.nav.dim { opacity: .6; }
.nav.dim .label { text-decoration: line-through; text-decoration-thickness: 1px; }
.nav.more { color: var(--on-side-soft, var(--cream-2)); font-weight: 600; }
.nav.new { color: var(--nav-count, var(--side-count, var(--highlight))); }
.nav[aria-current="true"].new, .nav[aria-current="true"].more { color: var(--side-bg, var(--navy)); }
.warn { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: var(--r-pill); background: var(--alert); color: var(--navy); font: 700 var(--t-tiny)/1 var(--body); border: 2px solid var(--navy); }
.side .warn { border-color: var(--on-side, var(--cream)); }
.group { margin-top: 14px; }
.group-head { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; color: var(--on-side-soft, var(--cream-2)); cursor: pointer;
  font: 600 var(--t-tiny)/1 var(--display); letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border-radius: var(--r-md); }
.group-head:hover { color: var(--on-side, var(--cream)); }
.group-head .chev { display: inline-block; transition: transform .15s; }
.group-head[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.side .spacer { flex: 1; min-height: 16px; }
.nav-bottom { border-top: 2px solid var(--side-hover, var(--navy-2)); padding-top: 10px; display: grid; gap: 2px; }
.side .who { font-size: var(--t-small); color: var(--on-side-soft, var(--cream-2)); padding: 6px 12px; font-weight: 600; overflow-wrap: anywhere; }

/* the list column and its rows */
.list { border-right: var(--edge-bold); display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.list header { padding: var(--s4) var(--s4) var(--s3); display: grid; gap: var(--s3); }
.list-title { display: flex; align-items: center; justify-content: space-between; gap: 8px 10px; flex-wrap: wrap; }
.list-title h2 { flex: 1 1 auto; min-width: 140px; }
.list-tools { display: flex; gap: var(--s2); flex: none; flex-wrap: wrap; justify-content: flex-end; }
.list h2 { font: 700 var(--t-title)/var(--lh-tight) var(--display); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows { overflow-y: auto; flex: 1; padding: 2px 10px 16px; display: flex; flex-direction: column; gap: 2px; }
.row, .pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border-radius: var(--r-md); border: 2px solid transparent; cursor: pointer; background: none; width: 100%; text-align: left; flex: none; font-size: var(--t-ui); }
.row:hover { background: color-mix(in oklab, var(--surface-sunk) 70%, transparent); }
.row[aria-selected="true"] { background: var(--surface); border-color: var(--outline); box-shadow: var(--lift-2); }
.row .from { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; min-width: 0; }
.row.unread .from { font-weight: 700; }
.row .dot { flex: none; width: 9px; height: 9px; border-radius: var(--r-pill); background: var(--accent-text); box-shadow: 0 0 0 1.5px var(--outline); }
.row .conv { flex: none; font-size: var(--t-tiny); font-weight: 700; color: var(--ink-soft); background: var(--surface-sunk); border-radius: var(--r-pill); padding: 0 7px; line-height: 18px; }
.row .when, .pick .when { justify-self: end; font-size: var(--t-tiny); color: var(--fg-muted); font-weight: 700; white-space: nowrap; }
.row .subject { grid-column: 1 / -1; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.unread .subject { font-weight: 700; }
.row .preview, .pick .preview { grid-column: 1; color: var(--fg-soft); font-size: var(--t-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag, .row .tag { font-size: var(--t-tiny); font-weight: 700; line-height: 18px; color: var(--ink); background: var(--info-bg); border: 1.5px solid var(--outline); border-radius: var(--r-pill); padding: 0 8px; align-self: center; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip { font-size: var(--t-small); }
.more-btn { margin: 10px auto 0; flex: none; }
/* picks: pressable list cards (settings sections, tickets, help pages) */
.pick { background: var(--surface); border: var(--line); margin-bottom: var(--s2); }
.pick:hover { border-color: var(--outline); background: var(--surface); }
.pick[aria-current="true"] { background: var(--info-bg); border: var(--edge); box-shadow: var(--lift-2); }
.pick.dim { opacity: .6; }
.pick-title { font-weight: 700; display: flex; align-items: center; gap: var(--s2); min-width: 0; overflow: hidden; }
.pick-facts { grid-column: 1 / -1; font-size: var(--t-small); color: var(--fg-muted); font-weight: 600; }

/* the reader */
.reader { overflow-y: auto; background: var(--surface); min-width: 0; }
.reader .inner { max-width: 880px; padding: var(--s5) var(--s6) 40px; display: flex; flex-direction: column; gap: var(--s4); }
.reader .inner.formatted { min-height: 100%; }
.reader h1 { font: 700 var(--t-display)/1.2 var(--display); margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; padding-bottom: 14px; border-bottom: var(--line); }
.back { display: none; }
.meta { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; color: var(--fg-soft); font-weight: 600; font-size: var(--t-ui); }
.meta .who-from { flex: 1; min-width: 200px; }
.meta strong { color: var(--fg); }
.meta .addr { color: var(--fg-muted); font-weight: 600; }
.meta .date { font-size: var(--t-small); }
.avatar { flex: none; width: 44px; height: 44px; border-radius: var(--r-pill); background: var(--teal); color: var(--navy); display: grid; place-items: center; font: 700 var(--t-title)/1 var(--display); border: var(--edge); }
.leak { display: flex; gap: var(--s3); align-items: flex-start; background: var(--danger-bg); border: var(--edge); border-radius: var(--r-md); box-shadow: 4px 4px 0 var(--danger); padding: 12px 16px; font-weight: 600; color: var(--ink); }
.leak strong { color: var(--danger); }
.leak-mark { flex: none; width: 26px; height: 26px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--alert); border: 2px solid var(--navy); color: var(--navy); font: 700 var(--t-body)/1 var(--body); }
.attachments { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; min-height: var(--h-sm); border: var(--edge); border-radius: var(--r-pill); background: var(--field); color: var(--ink); font-weight: 700; font-size: var(--t-small); text-decoration: none; box-shadow: var(--lift-1); }
.chip small { color: var(--ink-muted); font-weight: 700; font-size: var(--t-tiny); }
.chip:hover { background: var(--info-bg); }
.pictures { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--info-bg); border: 1.5px solid var(--outline); border-radius: var(--r-md); padding: 6px 8px 6px 12px; font-weight: 600; font-size: var(--t-small); color: var(--ink); }
.mail-frame { flex: 1; width: 100%; min-height: 480px; border: var(--line); border-radius: var(--r-md); background: #FFFFFF; color-scheme: light; }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--t-body); line-height: 1.6; border-top: var(--line); padding-top: var(--s4); }

/* empty states */
.empty { display: grid; place-items: center; align-content: center; gap: var(--s1); height: 100%; color: var(--fg-muted); font-weight: 600; font-size: var(--t-small); text-align: center; padding: var(--s5); }
.rows .empty { height: auto; padding: var(--s7) var(--s5); }
.empty .big { font: 600 var(--t-title)/1.3 var(--display); color: var(--fg-soft); }
.empty .hint { font-size: var(--t-small); margin-top: 0; }

/* settings-style panels and boxes (cards) */
.panel { max-width: 640px; padding: 28px var(--s6); display: grid; gap: var(--s4); }
.panel h1 { font: 700 var(--t-display)/var(--lh-tight) var(--display); margin: 0; }
.panel p { margin: 0; }
.box { background: var(--surface); border: var(--edge); border-radius: var(--r-lg); box-shadow: var(--lift-2); padding: var(--s4) 18px; display: grid; gap: var(--s3); }
.line { display: flex; gap: var(--s2) 10px; align-items: center; flex-wrap: wrap; }
.ok { color: var(--ok); font-weight: 700; }
.status { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 30; background: var(--inverse); color: var(--on-inverse); padding: 10px 16px; border-radius: var(--r-md); font-weight: 700; font-size: var(--t-ui); box-shadow: 4px 4px 0 var(--coral); max-width: calc(100vw - 32px); }

/* dialog: keyboard shortcuts */
.help-wrap { position: fixed; inset: 0; z-index: 40; background: var(--scrim); display: grid; place-items: center; padding: var(--s4); }
.help { background: var(--surface); border: var(--edge-bold); border-radius: var(--r-xl); box-shadow: var(--lift-3); padding: 22px 26px; width: min(380px, 100%); display: grid; gap: 14px; }
.help h2 { font: 700 var(--t-title)/var(--lh-tight) var(--display); margin: 0; }
.help dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; align-items: center; font-size: var(--t-ui); }
.help dt { text-align: right; }
.help dd { margin: 0; font-weight: 600; }
kbd { font: 700 var(--t-small)/1 var(--body); background: var(--field); border: 1.5px solid var(--outline); border-radius: 6px; padding: 3px 7px; box-shadow: 1px 1px 0 var(--shadow); white-space: nowrap; color: var(--ink); }

/* ---------- picking several, actions ---------- */
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 10px 8px; padding: 8px 10px; background: var(--info-bg); color: var(--ink); border: var(--edge); border-radius: var(--r-md); }
.sel-count { font-weight: 700; margin-right: 4px; font-size: var(--t-ui); }
.row { user-select: none; }
.row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row .check { display: none; flex: none; width: 18px; height: 18px; border: 2px solid var(--outline); border-radius: 5px; background: var(--field); }
.rows.selecting .row .check { display: inline-grid; place-items: center; }
.row.picked { background: var(--info-bg); border-color: var(--outline); }
.row.picked .check { background: var(--accent); }
.row.picked .check::after { content: '✓'; font: 700 var(--t-tiny)/1 var(--body); color: var(--on-accent); }
.row .conv.opens { cursor: pointer; border: 1.5px solid var(--ink-soft); }
.row .conv.opens:hover { background: var(--accent); color: var(--on-accent); border-color: var(--outline); }

/* popovers (a sheet on the phone) */
.pop-anchor { position: relative; display: inline-flex; }
.popover { position: absolute; top: calc(100% + 6px); left: 0; z-index: 25; background: var(--surface); border: var(--edge); border-radius: var(--r-lg); box-shadow: var(--lift-2); padding: var(--s2); min-width: 230px; display: grid; gap: 2px; font-size: var(--t-ui); }
.popover p { margin: 4px 4px 10px; font-weight: 700; max-width: 280px; }
.pop-menu { display: grid; gap: 2px; }
.pop-title { font: 600 var(--t-tiny)/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); padding: 6px 10px 4px; }
.pop-item { display: block; width: 100%; min-height: 36px; padding: 7px 10px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; font-weight: 700; font-size: var(--t-ui); cursor: pointer; color: var(--ink); }
.pop-item:hover, .pop-item:focus-visible { background: var(--surface-sunk); }
.pop-item.new { color: var(--danger); }
.pop-sep { height: 2px; background: var(--surface-sunk); margin: 4px 2px; }
.pop-new { display: flex; gap: 6px; padding: 4px 2px; }
.pop-buttons { display: flex; gap: var(--s2); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 35; display: flex; align-items: center; gap: 14px;
  background: var(--inverse); color: var(--on-inverse); padding: 8px 10px 8px 16px; border-radius: var(--r-md); font-weight: 700; font-size: var(--t-ui); box-shadow: 4px 4px 0 var(--coral); }
.toast .btn { border-color: var(--on-inverse); box-shadow: 2px 2px 0 var(--on-inverse); }
.status { bottom: 76px; }

/* ---------- People ---------- */
.row.person .from { gap: 10px; }
.row.person .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.small { width: 30px; height: 30px; font-size: var(--t-ui); border-width: 2px; }
.row.person .preview { padding-left: 40px; }
.row.person .you { color: var(--fg); font-weight: 700; }
.badge { align-self: center; justify-self: end; min-width: 22px; text-align: center; font: 700 var(--t-tiny)/18px var(--body); background: var(--accent); color: var(--on-accent); border: 1.5px solid var(--outline); border-radius: var(--r-pill); padding: 0 6px; }

.reader:has(.convo) { overflow: hidden; }
.convo { display: flex; flex-direction: column; height: 100%; }
.convo-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s4) var(--s5); background: var(--surface); border-bottom: var(--edge); }
.convo-who { flex: 1; min-width: 160px; }
.convo-who h1 { font: 700 var(--t-display)/var(--lh-tight) var(--display); margin: 0; overflow-wrap: anywhere; }
.convo-who .addr { color: var(--fg-muted); font-weight: 600; font-size: var(--t-small); overflow-wrap: anywhere; }
.convo-tools { display: flex; gap: var(--s2); }
.input.rename { font: 700 var(--t-title)/1.2 var(--display); padding: 4px 10px; max-width: 340px; margin-bottom: 4px; }
.timeline { flex: 1; overflow-y: auto; overflow-anchor: none; padding: 18px var(--s5) 28px; display: flex; flex-direction: column; gap: 10px; background: var(--bg);
  --fg: var(--on-bg); --fg-soft: var(--on-bg-soft); --fg-muted: var(--on-bg-muted); --fg-link: var(--on-bg-link); color: var(--fg); }
.topic { align-self: center; margin: 14px 0 2px; font: 600 var(--t-small)/1.3 var(--display); color: var(--ink-soft); background: var(--surface-sunk); padding: 4px 14px; border-radius: var(--r-pill); text-align: center; }
.bubble { max-width: min(580px, 78%); border: var(--edge); border-radius: 18px; padding: 10px 14px 6px; box-shadow: var(--lift-1); flex: none; }
.bubble.theirs { align-self: flex-start; background: var(--field); border-bottom-left-radius: 5px; }
.bubble.mine { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 5px; }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: var(--lh-body); }
.bubble.loading .bubble-text { color: var(--ink-muted); }
.bubble.loading .bubble-text::after { content: ' …'; }
.bubble-meta { display: flex; gap: var(--s2); align-items: center; justify-content: flex-end; margin-top: 4px; font-size: var(--t-tiny); font-weight: 700; color: var(--ink-muted); }
.bubble .dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--accent); }
.link.small { font-size: var(--t-tiny); }
.earlier, .older-note { color: var(--fg-muted); }

/* ---------- writing ---------- */
.composer { position: fixed; right: 24px; bottom: 16px; z-index: 28; width: min(680px, calc(100vw - 48px)); height: min(780px, calc(100vh - 32px));
  display: flex; flex-direction: column; background: var(--surface); border: var(--edge-bold); border-radius: var(--r-xl); box-shadow: var(--lift-3); overflow: hidden; }
.composer.dropping { outline: 4px dashed var(--teal); outline-offset: -12px; }
.compose-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 20px; background: var(--navy); color: var(--on-dark); }
.compose-head h2 { font: 700 var(--t-title)/var(--lh-tight) var(--display); margin: 0; }
.compose-head .saved-note { margin-left: auto; font-size: var(--t-small); font-weight: 600; color: var(--cream-2); }
.compose-close { color: var(--on-dark); }
.compose-close:hover { background: var(--navy-2); color: var(--on-dark); }
.compose-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s2); padding: 14px 20px 16px; }
.compose-foot { order: 3; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: var(--line); background: var(--surface); }
.compose-foot .grow { flex: 1; }
.compose-foot .popover { top: auto; bottom: calc(100% + 6px); left: auto; right: 0; }
.compose-foot .total { font-size: var(--t-small); font-weight: 700; color: var(--ink-muted); }
.compose-foot .total.over { color: var(--danger); }
.send-btn { min-width: 96px; }
.field-row { display: flex; align-items: flex-start; gap: 10px; border-bottom: var(--line); padding-bottom: var(--s2); }
.field-label { flex: none; width: 62px; padding-top: 10px; font-weight: 700; color: var(--ink-soft); font-size: var(--t-ui); }
.field-row > .input, .from-wrap { flex: 1; min-width: 0; }
.from-wrap { display: grid; gap: 6px; }
.from-wrap .hint { font-size: var(--t-small); color: var(--ink-soft); font-weight: 600; }
.cc-links { flex: none; display: flex; gap: var(--s3); padding-top: 10px; font-size: var(--t-small); }
.cc-links [aria-disabled="true"] { color: var(--ink-muted); cursor: not-allowed; text-decoration: none; }
.chip-wrap { position: relative; flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: var(--h-md); padding: 3px 8px; border: var(--edge); border-radius: var(--r-md); background: var(--field); cursor: text; }
.chips:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip-addr { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 4px 2px 10px; border: 1.5px solid var(--outline); border-radius: var(--r-pill); background: var(--info-bg); color: var(--ink); font-weight: 700; font-size: var(--t-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-addr.bad { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.chip-x { border: 0; background: none; cursor: pointer; font-weight: 700; font-size: var(--t-body); line-height: 1; padding: 0 4px; border-radius: var(--r-pill); color: inherit; }
.chip-x:hover { background: color-mix(in oklab, currentColor 15%, transparent); }
.chip-input { flex: 1; min-width: 140px; border: 0; outline: 0; padding: 5px 2px; font-weight: 600; background: transparent; color: var(--ink); }
.suggest { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: var(--edge); border-radius: var(--r-md); box-shadow: var(--lift-2); }
.suggest li { padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--t-ui); }
.suggest li span { color: var(--ink-muted); font-weight: 600; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--surface-sunk); }
.compose-text { flex: 1; min-height: 240px; width: 100%; resize: vertical; border: var(--line); border-radius: var(--r-md); outline: 0; padding: 10px 12px; background: var(--field); color: var(--ink); font: 400 var(--t-body)/1.6 var(--body); }
.compose-text:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.attach-list { display: flex; flex-wrap: wrap; gap: var(--s2); }
.attach-list:empty { display: none; }
.chip.file progress { width: 70px; height: 8px; accent-color: var(--teal); }
.chip.file.theirs { background: var(--surface-sunk); }
.tag.claude { background: var(--highlight); color: var(--navy); }
body.composing .status, body.composing .toast { z-index: 40; }

/* Waiting for approval */
.row.draft .tag.claude { align-self: center; }
.claude-note { background: var(--warn-bg); border: var(--edge); }
.draft-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-weight: 600; color: var(--fg-soft); font-size: var(--t-ui); }
.draft-meta dt { font-weight: 700; color: var(--fg); }
.draft-meta dd { margin: 0; overflow-wrap: anywhere; }
.live-note { font-size: var(--t-small); font-weight: 600; color: var(--ink-soft); background: var(--surface-sunk); border-radius: var(--r-sm); padding: 4px 10px; }

/* ---------- settings ---------- */
.panel.settings { max-width: 720px; }
.panel > .back { justify-self: start; }
.panel.settings .box h2 { font: 700 var(--t-title)/1.2 var(--display); margin: 0; }
.panel.settings .box p { margin: 0; color: var(--fg-soft); font-weight: 600; }
.settings-form { display: grid; gap: 14px; }
.input.code-small { width: 11ch; font: 700 var(--t-title)/1 var(--display); letter-spacing: 4px; text-align: center; }
/* ticks and radios: the whole row is the target */
.tick { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: var(--t-ui); cursor: pointer; min-height: 36px; }
.tick input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
.tick .hint { font-weight: 600; color: var(--fg-soft); font-size: var(--t-small); }
.tick.small { font-size: var(--t-small); min-height: 32px; }
fieldset.scopes { border: var(--line); border-radius: var(--r-md); padding: 8px 14px 10px; margin: 0; display: grid; gap: 2px; }
fieldset.scopes legend { font-weight: 700; font-size: var(--t-ui); padding: 0 6px; }
.tokens { display: grid; gap: 10px; }
.token { border: var(--edge); border-radius: var(--r-md); padding: 10px 14px; background: var(--field); display: grid; gap: 6px; }
.token-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.token-scopes { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.token-facts { font-size: var(--t-small); color: var(--fg-muted); font-weight: 600; }
.send-ask { display: grid; gap: var(--s2); }
.secret-box { background: var(--warn-bg); border-color: var(--outline); }
.secret-box .strong { color: var(--danger); font-weight: 700; }
.token-secret { display: block; text-align: left; font-size: var(--t-ui); }
.cmd { font: 600 var(--t-small)/1.5 var(--mono); background: var(--field); color: var(--ink); border: var(--line); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
.steps-box .steps { gap: var(--s2); }
.also-in { align-self: flex-start; font-size: var(--t-small); font-weight: 700; color: var(--fg-soft); background: var(--bg); border: 1.5px dashed currentColor; border-radius: var(--r-pill); padding: 3px 12px; }

/* ---------- install and offline ---------- */
.install-hint { display: flex; align-items: center; gap: 10px; margin: 0 10px 10px; padding: 6px 6px 6px 10px; background: var(--surface);
  border: var(--edge); border-radius: var(--r-md); box-shadow: var(--lift-1); }
.install-hint img { flex: none; border-radius: var(--r-sm); }
.install-text { flex: 1; min-width: 0; display: grid; font-size: var(--t-small); font-weight: 600; color: var(--ink-soft); line-height: 1.35; }
.install-text strong { color: var(--ink); font-size: var(--t-ui); }
.install-x { flex: none; min-width: 36px; min-height: 36px; }
.offline-card .btn { justify-self: start; }

/* ---------- addresses ---------- */
.review-card { display: grid; gap: 10px; margin: 0 0 var(--s3); padding: 14px var(--s4); background: var(--surface); border: var(--edge); border-radius: var(--r-lg); box-shadow: var(--lift-2); flex: none; font-size: var(--t-ui); }
.review-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; min-width: 0; }
.review-address { overflow-wrap: anywhere; }
.tag.new-tag { background: var(--highlight); color: var(--navy); }
.review-facts { margin: 0; font-size: var(--t-small); font-weight: 600; color: var(--fg-soft); display: grid; gap: 2px; }
.review-card label.field { font-size: var(--t-small); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
/* tabs / segmented filters */
.chip-filter { border: var(--edge); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); padding: 3px 12px; font-weight: 700; font-size: var(--t-small); cursor: pointer; min-height: var(--h-sm); }
.chip-filter:hover { background: var(--field); }
.chip-filter[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.addr-note:empty { display: none; }
.addr-note { margin: 0 10px 10px; }
.leak-notice .line { margin-top: var(--s2); }
.warn-text { margin: 0; color: var(--danger); font-weight: 700; }
.warn-text:empty { display: none; }
.sig-list { display: grid; gap: 14px; }
.sig-group { font: 700 var(--t-title)/1.2 var(--display); margin: var(--s2) 0 0; }
.sig-text { font: 400 var(--t-ui)/var(--lh-body) var(--body); resize: vertical; }
.sig-box details summary { cursor: pointer; font-weight: 700; font-size: var(--t-small); color: var(--fg-soft); }
.sig-preview { margin: var(--s2) 0 0; white-space: pre-wrap; font: 400 var(--t-small)/var(--lh-body) var(--body); background: var(--field); color: var(--ink); border: 2px dashed var(--surface-sunk); border-radius: var(--r-sm); padding: 10px 12px; }

/* ---------- search, older mail ---------- */
.search-row { display: flex; gap: var(--s2); align-items: center; }
.search-row .input { flex: 1; min-width: 0; }
.scopes { align-items: center; }
.scopes-label { font-size: var(--t-small); font-weight: 700; color: var(--fg-soft); }
.row .where { grid-column: 1 / -1; font-size: var(--t-tiny); font-weight: 700; color: var(--fg-link); }
.search-help-pop { display: grid; gap: var(--s2); max-width: 300px; font-size: var(--t-ui); }
.search-help-pop p { margin: 0; font-weight: 600; color: var(--ink-soft); }
.search-help-pop dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; }
.search-help-pop dd { margin: 0; font-weight: 600; }
.search-help-pop code { font: 700 var(--t-small)/1.4 var(--mono); background: var(--field); border: var(--line); border-radius: 6px; padding: 0 5px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: var(--r-pill); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.older-note { text-align: center; font-size: var(--t-small); font-weight: 600; padding: 12px 8px 0; flex: none; }
.earlier { align-self: center; font-size: var(--t-small); font-weight: 600; padding: 2px 0 6px; }
.earlier.busy::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid currentColor; border-right-color: transparent; border-radius: var(--r-pill); animation: spin .8s linear infinite; vertical-align: -1px; }
.cmd-block { position: relative; margin: 6px 0; min-width: 0; max-width: 100%; }
.steps-box .steps li { min-width: 0; }
.steps-box, .steps-box .steps { min-width: 0; }
.cmd-block pre.cmd { display: block; margin: 0; padding: 10px 70px 10px 12px; white-space: pre; overflow-x: auto; overflow-wrap: normal; font-size: var(--t-small); line-height: 1.5; border-radius: var(--r-sm); }
.cmd-block .copy-btn { position: absolute; top: 4px; right: 4px; }
.cmd.inline { padding: 1px 6px; }
.paste-note { display: block; color: var(--danger); }

/* ---------- branding and the Sivro watermark ---------- */
.brand-mark { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { height: 30px; width: auto; max-width: 120px; border-radius: 6px; object-fit: contain; }
.wordmark.small .brand-logo { height: 24px; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.powered { display: inline-flex; align-items: center; gap: 4px; font: 600 var(--t-tiny)/1 var(--body); letter-spacing: .2px; user-select: none; }
.powered strong { font: 600 var(--t-tiny)/1 var(--body); }
.powered-dot { display: none; }
.powered-side { color: var(--on-side, var(--cream)); padding: 10px 12px 0; opacity: .8; }   /* menu text, a little softer (still 9:1 or more) */
.powered-page { color: var(--fg-soft); }
.powered-top { color: var(--on-side, var(--cream)); margin-left: auto; }
.auth .powered-page { margin-top: 14px; }
.auth { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.topbar .powered-top { display: none; }

/* ---------- the panel ---------- */
.panel-shell { display: grid; grid-template-columns: 248px 1fr; height: 100vh; height: 100dvh; }
.panel-main { overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.panel-content { padding: var(--s5) var(--s6) var(--s6); display: grid; gap: 18px; align-content: start; max-width: 980px; width: 100%; flex: 1; }
.panel-content > h1 { font: 700 var(--t-display)/var(--lh-tight) var(--display); margin: 0; }
.panel-content > p { color: var(--fg-soft); }
.panel-footer { padding: 14px var(--s6) 18px; display: flex; justify-content: flex-start; }
.viewas-banner { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: 10px var(--s6); background: var(--highlight); color: var(--navy); font-weight: 700; font-size: var(--t-ui); border-bottom: var(--edge); }
.viewas-banner .btn { margin-left: auto; }
.cards { gap: var(--s4); }   /* wrapping: see "T195" at the end */
.card-tile { background: var(--surface); border: var(--edge); border-radius: var(--r-lg); box-shadow: var(--lift-2); padding: var(--s4) 18px; display: grid; gap: var(--s2); align-content: start; }
.card-tile h2 { font: 700 var(--t-title)/1.2 var(--display); margin: 0; }
.card-tile > .level { justify-self: start; }
.card-tile .big { font: 700 var(--t-display)/1 var(--display); }
.card-tile p { margin: 0; color: var(--fg-soft); font-weight: 600; font-size: var(--t-ui); }
/* pills: levels and states (sentence case, colour by meaning) */
.level, .state { display: inline-block; font-size: var(--t-tiny); font-weight: 700; line-height: 18px; border: 1.5px solid var(--outline); border-radius: var(--r-pill); padding: 0 9px; background: var(--field); color: var(--ink); }
.level::first-letter, .state::first-letter { text-transform: uppercase; }
.level-sivro { background: var(--navy); color: var(--on-dark); }
.level-admin { background: var(--highlight); color: var(--navy); }
.level-reseller { background: var(--info-bg); }
.level-customer { background: var(--field); }
.tree { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.tree .tree { padding-left: 22px; border-left: 2px dashed var(--surface-sunk); margin-left: var(--s3); margin-top: var(--s2); }
.acct { background: var(--surface); border: var(--edge); border-radius: var(--r-md); padding: 10px 12px; display: grid; gap: var(--s2); font-size: var(--t-ui); }
.acct-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.acct-head .name { font-weight: 700; }
.acct-facts { font-size: var(--t-small); color: var(--fg-muted); font-weight: 600; }
.acct-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.acct-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; background: var(--field); border: 2px dashed var(--surface-sunk); border-radius: var(--r-md); padding: 10px 12px; }
.roles-list { display: grid; gap: var(--s3); }
.perm-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.perm-list li { font-size: var(--t-tiny); font-weight: 700; line-height: 18px; background: var(--info-bg); color: var(--ink); border: 1.5px solid var(--outline); border-radius: var(--r-pill); padding: 0 10px; }
.audit-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t-small); background: var(--surface); border: var(--edge); border-radius: var(--r-md); overflow: hidden; }
.audit-table th, .audit-table td { text-align: left; padding: 8px 10px; border-bottom: var(--line); vertical-align: top; }
.audit-table tr:last-child td { border-bottom: 0; }
.audit-table th { font: 700 var(--t-tiny)/1 var(--body); color: var(--ink-soft); background: var(--field); }
.audit-table .refused { color: var(--danger); font-weight: 700; }
.audit-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.audit-filters label.field { font-size: var(--t-small); }
.audit-filters select, .audit-filters .input { min-width: 160px; }
.brand-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.2fr); gap: 20px; align-items: start; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 48px; height: var(--h-md); border: var(--edge); border-radius: var(--r-sm); padding: 2px; background: var(--field); }
.color-row .input { width: 11ch; min-width: 100px; font-family: var(--mono); }
.logo-preview { height: 48px; width: auto; max-width: 180px; object-fit: contain; border: 2px dashed var(--surface-sunk); border-radius: var(--r-sm); padding: 4px; background: #FFFFFF; }
.contrast-ok { color: var(--ok); font-weight: 700; }
.preview-wrap { display: grid; gap: var(--s3); }
.preview-label { font-weight: 700; font-size: var(--t-small); color: var(--fg-soft); }
/* the brand preview: a picture of the app, so its text is the smallest size */
.mini { display: grid; grid-template-columns: 96px 1fr; border: var(--edge); border-radius: var(--r-md); overflow: hidden; height: 160px; background: var(--cream); font-size: var(--t-tiny); }
.mini-side { background: var(--side-bg, var(--navy)); color: var(--on-side, var(--cream)); padding: 10px 8px; display: grid; gap: 6px; align-content: start; font-weight: 700; }
.mini-side .mini-item { border-radius: 6px; padding: 3px 6px; }
.mini-side .mini-item.on { background: var(--on-side, var(--cream)); color: var(--side-bg, var(--navy)); }
.mini-side .powered { font-size: var(--t-tiny); margin-top: auto; padding: 0; }
.mini-side .powered strong { font-size: var(--t-tiny); }
.mini-main { padding: 10px; display: grid; gap: 6px; align-content: start; color: var(--on-bg); }
.mini-main .mini-row { background: var(--paper); color: var(--navy); border: 1.5px solid var(--navy); border-radius: var(--r-sm); padding: 4px 6px; font-weight: 700; }
.mini-main .mini-btn { justify-self: start; background: var(--coral); color: var(--on-accent); border: 2px solid var(--navy); border-radius: var(--r-sm); padding: 3px 10px; font-weight: 700; }
.placeholder-note { color: var(--fg-muted); font-weight: 600; }
/* tickets */
.state-new, .state-triaged { background: var(--info-bg); }
.state-waiting, .state-needs_info { background: var(--highlight); color: var(--navy); }
.state-approved, .state-working { background: var(--ok-bg); }
.state-done { background: var(--ok-strong-bg); }
.state-closed { background: var(--surface-sunk); }
.ticket-list { display: grid; gap: var(--s2); }
.ticket-row { text-decoration: none; color: inherit; }
.ticket-row .pick-facts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ticket-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600; color: var(--fg-soft); font-size: var(--t-ui); }
.ticket-id { font: 700 var(--t-small)/1 var(--mono); color: var(--fg); }
.ticket-body { background: var(--surface); border: var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.ticket-pics { display: flex; flex-wrap: wrap; gap: var(--s2); }
.ticket-pic { width: 120px; height: 90px; object-fit: cover; border: var(--edge); border-radius: var(--r-sm); background: var(--field); }
.timeline-list { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 3px solid var(--surface-sunk); display: grid; gap: var(--s3); }
.timeline-list li { background: var(--surface); border: var(--line); border-radius: var(--r-md); padding: 8px 12px; display: grid; gap: 4px; font-size: var(--t-ui); }
.timeline-list li.tl-state { background: var(--field); border-style: dashed; }
.tl-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-note textarea, .ticket-new textarea { resize: vertical; font: 400 var(--t-ui)/var(--lh-body) var(--body); }
.ticket-params { display: grid; gap: 10px; }
a.btn { text-decoration: none; }

/* panel: mail across the branch, servers */
.mail-accounts { display: grid; gap: 14px; }
.mailbox-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.mailbox-row { background: var(--field); border: var(--line); border-radius: var(--r-md); padding: 8px 10px; display: grid; gap: 6px; font-size: var(--t-ui); }
.mailbox-row.state-row-failing { border-color: var(--danger); }
.mb-head { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.state-mb-ok, .state-svc-active { background: var(--ok-strong-bg); }
.state-mb-failing, .state-svc-failed, .state-failing { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.state-mb-on { background: var(--info-bg); }
.state-mb-off, .state-svc-inactive { background: var(--surface-sunk); }
.quota { display: flex; align-items: center; gap: var(--s2); }
.quota progress { flex: 1; max-width: 260px; }
progress { appearance: none; height: 10px; border: 1.5px solid var(--outline); border-radius: var(--r-pill); background: var(--surface-sunk); overflow: hidden; accent-color: var(--teal); }
progress::-webkit-progress-bar { background: var(--surface-sunk); }
progress::-webkit-progress-value { background: var(--teal); }
progress.full::-webkit-progress-value { background: var(--danger); }
progress::-moz-progress-bar { background: var(--teal); }
.server-block { display: grid; gap: var(--s3); }
.server-block > .acct-head h2 { font: 700 var(--t-title)/var(--lh-tight) var(--display); margin: 0; }
.server-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
/* T161: Servers › Health uses a big screen: no 1200 px cap from 1280 px; two servers side by side when each gets 760 px,
   otherwise each server across the whole width (its tiles in more columns, its uptime strip full width). The phone is as it was. */
@media (min-width: 1280px) {
  .panel-content:has(> .server-block) { max-width: none; grid-template-columns: repeat(auto-fit, minmax(min(100%, 760px), 1fr)); column-gap: var(--s5); }
  .panel-content:has(> .server-block) > :not(.server-block) { grid-column: 1 / -1; }
  .server-block { align-content: start; }
}
.svc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--t-small); font-weight: 600; }
.spark { width: 100%; height: 44px; display: block; }
.spark polyline { fill: none; stroke: var(--link); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.stale-note { font-weight: 700; }
/* ---------- breadcrumbs (T055): the whole trail on a desktop, one Back on a phone ---------- */
.crumbs { display: flex; align-items: center; min-width: 0; font: 600 var(--t-small)/1.3 var(--body); color: var(--fg-soft); }
.crumbs:empty { display: none; }
.crumbs-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.crumb { max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.crumb { color: var(--fg-link); text-decoration: none; border-radius: 4px; }
a.crumb:hover { text-decoration: underline; }
.crumb.here { color: var(--fg); font-weight: 700; }
.crumb.above { color: var(--fg-muted); }
.crumb-prefix { background: var(--highlight); color: var(--navy); padding: 1px 8px; border-radius: var(--r-pill); font-weight: 700; }
.crumb-sep { color: var(--fg-muted); }
.crumbs-back { display: none; }
.panel-main > .crumbs { padding: 14px var(--s6) 0; }
.shell { grid-template-rows: auto 1fr; }
.shell > .side { grid-row: 1 / 3; }
.shell > .crumbs { grid-column: 2 / 4; grid-row: 1; padding: 8px 18px 7px; border-bottom: var(--edge-bold); background: var(--bg); }
.shell > .list, .shell > .reader { grid-row: 2; min-height: 0; }
.tree .acct.here { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.acct-head a.name { color: inherit; text-decoration: none; font-weight: 700; }
.acct-head a.name:hover { text-decoration: underline; }
@media (max-width: 899px) {
  .crumbs-trail { display: none; }
  .crumbs-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--link); text-decoration: none; font-weight: 700; font-size: var(--t-ui); }
  .crumbs:not(:has(.crumbs-back)) { display: none; }
  .panel-main > .crumbs { padding: 0 14px; }
  .shell { grid-template-rows: auto auto 1fr; }
  .shell > .crumbs { grid-column: 1; grid-row: 2; padding: 0 14px; border-bottom: 0; }
  .shell > .list { grid-row: 3; }
}
/* ---------- phone: one pane at a time ---------- */
@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .topbar { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--side-bg, var(--navy)); color: var(--on-side, var(--cream)); grid-row: 1; }
  .topbar .wordmark.small { color: var(--on-side, var(--cream)); font-size: var(--t-title); gap: 0; }
  .top-title { margin-left: 8px; font: 600 var(--t-ui)/1 var(--display); color: var(--on-side-soft, var(--cream-2)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-btn { color: var(--on-side, var(--cream)); }
  .menu-btn:hover { background: var(--side-hover, var(--navy-2)); color: var(--on-side, var(--cream)); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 20; transform: translateX(-105%); transition: transform .2s ease; visibility: hidden; }
  .menu-open .side { transform: none; visibility: visible; box-shadow: 6px 0 0 var(--danger); }
  .menu-open .backdrop { display: block; position: fixed; inset: 0; z-index: 15; background: var(--scrim); }
  .nav, .group-head { min-height: 44px; }
  .list { grid-row: 2; border-right: 0; }
  .list header { padding: 4px 14px 8px; gap: var(--s2); }
  .rows { padding: 0 6px 16px; }
  .row { padding: 10px 12px; }
  .reader { position: fixed; inset: 0; z-index: 10; }
  .reader.closed { display: none; }
  .back { display: inline-flex; }
  .reader .inner, .panel { padding: 12px var(--s4) var(--s6); }
  .actions { position: sticky; top: 0; background: var(--surface); z-index: 1; padding: 4px 0 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .actions .back { grid-column: 1 / -1; justify-self: start; }
  .actions .btn.small { white-space: nowrap; }
  .mail-frame { min-height: 60vh; }
  .actions .pop-anchor { display: flex; }
  .actions .pop-anchor > .btn { width: 100%; }
  .selbar { margin: 0 6px 8px; }
  .popover { position: fixed; top: auto; left: 8px; right: 8px; bottom: 8px; min-width: 0; padding: 10px; border-radius: var(--r-xl); box-shadow: var(--lift-2), 0 0 0 100vmax var(--scrim); }
  .pop-item { min-height: 44px; }
  .toast { bottom: 12px; width: max-content; max-width: calc(100vw - 24px); }
  .convo-head { padding: 8px 12px 10px; gap: var(--s2); }
  .convo-head .avatar { width: 36px; height: 36px; font-size: var(--t-body); }
  .convo-who h1 { font-size: var(--t-title); }
  .timeline { padding: 12px 10px 24px; }
  .bubble { max-width: 88%; }
  .link.small { min-height: 44px; display: inline-flex; align-items: center; padding: 0 6px; }
  .composer { inset: 0; width: auto; height: 100%; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .compose-head { padding: 4px 4px 4px 14px; }
  .compose-foot { order: 0; border-top: 0; border-bottom: var(--line); padding: 8px 12px; }
  .compose-body { padding: 10px 12px 16px; }
  .field-label { width: 56px; }
  .chips { min-height: 44px; }
  .chip-x { min-width: 32px; min-height: 32px; }
  .cc-links .link { min-height: 44px; min-width: 44px; justify-content: center; display: inline-flex; align-items: center; }
  .field-row .input, .field input, .input { min-height: 44px; }
  .compose-text { min-height: 180px; }
  .chip, .chip-filter { min-height: 44px; }
  .tick, .tick.small { min-height: 44px; }
  .acct-tools { margin-left: 0; }
  .acct-head a.name { min-height: 44px; display: inline-flex; align-items: center; }
  .sig-box details summary { min-height: 44px; display: flex; align-items: center; }
  .install-x { min-width: 44px; min-height: 44px; }
  .auth-links a, .auth-links .link { min-height: 44px; display: inline-flex; align-items: center; }
  .link.small { min-width: 44px; justify-content: center; }
  .chips { padding: 0 8px; }
  .chip-input { align-self: stretch; min-height: 40px; }
  .pick { min-height: 44px; }
  /* the install card is a one-line notice on the phone (an iPhone keeps its how-to line: it is the only way there) */
  .install-hint { margin: 0 6px 8px; padding: 0 0 0 12px; box-shadow: none; min-height: 44px; }
  .install-hint img { display: none; }
  .install-text > span:not(.ios-steps) { display: none; }
  .install-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .powered-top { display: inline-flex; flex: none; }
  .topbar { min-width: 0; overflow: hidden; }
  .topbar .wordmark.small, .topbar .top-mark { min-width: 0; flex: 0 1 auto; overflow: hidden; }
  .topbar .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-title { flex: 1 1 auto; min-width: 0; }
  .panel-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .panel-shell > .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 20; transform: translateX(-105%); transition: transform .2s ease; visibility: hidden; }
  .panel-shell.menu-open > .side { transform: none; visibility: visible; box-shadow: 6px 0 0 var(--danger); }
  .panel-shell.menu-open .backdrop { display: block; position: fixed; inset: 0; z-index: 15; background: var(--scrim); }
  .panel-content { padding: var(--s3) 14px var(--s5); }
  .panel-footer { padding: 8px 14px 14px; justify-content: center; }
  .viewas-banner { padding: 8px 14px; }
  .brand-grid { grid-template-columns: 1fr; }
  .audit-table:not(.helper-table):not(.helper-chat-people) th:nth-child(4), .audit-table:not(.helper-table):not(.helper-chat-people) td:nth-child(4) { display: none; }
  .powered { display: none !important; }
}
@media (max-width: 899px) { .install-hint:has(.ios-steps) { padding: 6px 0 6px 12px; } }
/* T055: invites, storage cap, download */
.invite-pop { display: grid; gap: var(--s2); max-width: 320px; }
.invite-code { font: 700 var(--t-body)/1.3 var(--mono); background: var(--surface-sunk); color: var(--ink); padding: 4px 8px; border-radius: 6px; word-break: break-all; user-select: all; }
.storage-edit { align-items: flex-end; flex-wrap: wrap; gap: var(--s2); }
.storage-edit .input.gb { width: 110px; }
.export-status { margin-top: 14px; display: grid; gap: var(--s2); justify-items: start; }
/* T063: review notes, verdicts, strictness, sign-in links */
.review-note { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; padding: 8px 12px; border-radius: var(--r-md); background: var(--bg); color: var(--fg-soft); font-size: var(--t-ui); }
.review-note-mark { flex: none; width: 20px; height: 20px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; background: var(--info-bg); color: var(--navy); font: 700 var(--t-tiny)/1 var(--body); }
.review-auto { margin: 6px 0; padding: 8px 10px; border-radius: var(--r-sm); background: var(--bg); color: var(--fg); font-size: var(--t-ui); }
.review-auto.review-spam, .review-auto.held { background: var(--danger-bg); color: var(--ink); }
.review-auto.review-unclear { background: var(--warn-bg); color: var(--ink); }
.verdict-buttons { gap: var(--s2); }
.strictness { border: 0; padding: 0; margin: 12px 0 0; display: grid; gap: var(--s2); }
.strictness legend { font-weight: 700; font-size: var(--t-ui); margin-bottom: 6px; }
.strictness[disabled] { opacity: .55; }
.tick.radio { align-items: flex-start; }
.auth-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
/* T063: How do I */
.crumbs .help-link { margin-left: auto; padding-left: 16px; color: var(--fg-link); font-weight: 700; text-decoration: none; white-space: nowrap; }
.crumbs .help-link:hover { text-decoration: underline; }
.top-help { display: none; }
.help-index { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); max-width: 720px; }
.help-index .pick { display: block; text-decoration: none; color: var(--fg); }
.help-page { max-width: 760px; line-height: 1.55; display: block; }
.help-page > * { margin: 0 0 10px; }
.help-page > *:last-child { margin-bottom: 0; }
.help-page > p:has(> strong:only-child) { margin: 16px 0 4px; }
.help-page h2, .help-page h3 { margin: 16px 0 6px; }
.help-page .help-list { padding-left: 22px; }
.help-page code { font: 600 var(--t-small)/1.3 var(--mono); background: var(--surface-sunk); color: var(--ink); padding: 1px 5px; border-radius: 4px; }
.help-table { border-collapse: collapse; margin: 8px 0 12px; width: 100%; font-size: var(--t-ui); }
.help-table th, .help-table td { text-align: left; padding: 6px 10px; border-bottom: var(--line); vertical-align: top; }
input[name=help-find] { max-width: 480px; }
@media (max-width: 899px) {
  .crumbs .help-link { display: none; }
  .top-help:not([hidden]) { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 44px; min-height: 44px; color: var(--on-side, #F4EBDD); font: 800 20px/1 var(--display); text-decoration: none; }
}
/* T067: one Settings */
.settings-page { display: grid; gap: 14px; }
.settings-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.settings-top .input[type=search] { flex: 1 1 260px; max-width: 520px; }
.settings-body { display: grid; gap: 18px; align-items: start;
  /* T170: the list is 300 px, down to 260 when the page is narrow (1280 with the menu open), so the content keeps about 720 */
  grid-template-columns: clamp(260px, calc(100% - 738px), 300px) minmax(0, 1fr); }
.settings-list { display: grid; gap: 8px; }
.settings-list .pick { display: grid; text-decoration: none; color: inherit; }
.settings-list .pick[aria-current=true] { background: var(--info-bg); }
.settings-host { display: grid; gap: 14px; min-width: 0; }
.settings-host .panel.settings { padding: 0; }
.settings-host .panel.settings > h1 { font-size: var(--t-title); margin: 0 0 8px; }
.settings-host .back { display: none; }
.settings-results { display: grid; gap: 8px; }
.settings-hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 720px; }
.settings-hits li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 8px 12px; border-radius: var(--r-md); background: var(--surface); border: var(--edge); }
.settings-hits .hit { color: var(--ink); text-decoration: none; }
.settings-hits .help-hit { color: var(--link); font-weight: 700; text-decoration: none; font-size: var(--t-ui); }
.readonly-note { margin: 0; }
.readonly-items { margin: 6px 0 0; }
.state-locked { font-weight: 700; margin-right: 6px; }
.archive-terms { margin-top: 12px; }
.crumbs .settings-link { margin-left: auto; padding-left: 16px; color: var(--fg-link); font-weight: 700; text-decoration: none; white-space: nowrap; }
.crumbs .settings-link:hover { text-decoration: underline; }
.crumbs .settings-link + .help-link { margin-left: 0; }
@media (max-width: 899px) { .crumbs .settings-link { display: none; } }
@media (max-width: 899px) {
  .settings-body { grid-template-columns: 1fr; }
  .settings-page.has-section .settings-list { display: none; }
  .settings-page:not(.has-section) .settings-host { display: none; }
  .settings-host .back { display: inline-flex; }
  .settings-top .settings-back { display: none; }
}
@media (max-width: 899px) { .settings-host .settings-part:not(:first-of-type) .back { display: none; } }

/* ---------- folded in from B's new-*.css (T073 archive, T077 account page and Overview, T075 design JS) ---------- */
/* the mail menu's Archive group: years, then months */
.nav-year { margin: 8px 12px 2px; font: 700 var(--t-tiny)/1 var(--body); letter-spacing: .08em; color: var(--on-side-soft, var(--cream-2)); }
.nav.archive-month .label { font-weight: 600; }
.cloud { color: var(--fg-link); font-size: var(--t-ui); line-height: 1; }
.row .cloud { margin-left: 6px; }
.archive-note { margin: 0 14px 8px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-sunk); color: var(--ink-soft); font-size: var(--t-small); }
.archived-note { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0; padding: 3px 10px; border-radius: var(--r-pill); background: var(--surface-sunk); color: var(--ink-soft); font-size: var(--t-small); font-weight: 700; }
.year-head { margin: 10px 4px 2px; font: 700 var(--t-body)/1.2 var(--display); color: var(--fg); }
/* Settings > Archive */
.archive-points, .archive-unpaid { margin: 4px 0 10px; padding-left: 22px; display: grid; gap: 4px; }
.archive-unpaid li::marker { font-weight: 700; color: var(--danger); }
.archive-full-terms { margin: 6px 0 10px; }
.archive-full-terms summary { cursor: pointer; font-weight: 700; color: var(--fg-link); }
.archive-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 6px 0 12px; }
.archive-facts dt { font-weight: 600; color: var(--fg-soft); }
.archive-facts dd { margin: 0; font-weight: 700; }
.archive-pick { flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.archive-pick .input { min-width: 150px; }
.archive-estimate { display: grid; gap: var(--s2); justify-items: start; margin-top: 10px; }
.archive-estimate .btn { white-space: normal; text-align: left; }
.recovery-key { display: block; font: 700 var(--t-body)/1.6 var(--mono); background: var(--surface-sunk); color: var(--ink); padding: 8px 12px; border-radius: var(--r-sm); word-break: break-word; user-select: all; max-width: 100%; }
.archive-key .line { flex-wrap: wrap; gap: var(--s2); }
/* Panel > Archive */
.table-wrap { max-width: 100%; overflow-x: auto; }
.archive-table td, .archive-table th { white-space: nowrap; }
.archive-table tfoot th, .archive-table tfoot td { font-weight: 700; border-top: var(--edge); }
.archive-terms { display: block; }
.archive-terms > * { margin: 0 0 8px; }
.archive-terms h3 { margin: 14px 0 4px; font: 700 var(--t-body)/1.3 var(--display); }

/* one page per account: tabs and facts */
.acct-page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: -8px; }
.acct-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; border-bottom: 2px solid var(--surface-sunk); -webkit-overflow-scrolling: touch; }
.acct-tab { flex: none; padding: 9px 14px; border-radius: var(--r-md) var(--r-md) 0 0; text-decoration: none; color: var(--fg-soft); font-weight: 700; font-size: var(--t-ui); white-space: nowrap; border: 2px solid transparent; border-bottom: 0; }
.acct-tab:hover { color: var(--fg); background: var(--surface-sunk); }
.acct-tab[aria-selected=true] { color: var(--ink); background: var(--surface); border-color: var(--outline); margin-bottom: -2px; }
.acct-body { display: grid; gap: 14px; min-width: 0; }
.acct-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; max-width: 560px; }
.acct-facts dt { color: var(--fg-soft); font-weight: 600; }
.acct-facts dd { margin: 0; font-weight: 700; }
.needs-attention ul, .plain-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.needs-attention a { color: var(--fg-link); font-weight: 700; text-decoration: none; }
.needs-attention a:hover { text-decoration: underline; }
.quick-actions { flex-wrap: wrap; gap: var(--s2); }
.mail-setup h2 { font-size: var(--t-title); margin: 0 0 6px; }
/* the Overview: what needs you */
.attention-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.attention-row { --fg: var(--ink); --fg-soft: var(--ink-soft); --fg-muted: var(--ink-muted); --fg-link: var(--link);
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md);
  text-decoration: none; color: var(--fg); background: var(--surface); border: var(--edge); font-size: var(--t-ui); }
.attention-row:hover { background: var(--field); }
.attention-mark { width: 26px; height: 26px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: var(--surface-sunk); color: var(--ink); }
.kind-failing .attention-mark { background: var(--alert); color: var(--navy); }
.kind-ticket .attention-mark { background: var(--highlight); color: var(--navy); }
.kind-unpaid .attention-mark { background: var(--info-bg); }
.attention-text { font-weight: 700; min-width: 0; }
.attention-account { color: var(--fg-soft); font-size: var(--t-small); white-space: nowrap; }
.totals-head { margin: 6px 0 0; font-size: var(--t-title); }

/* Branding: why a colour is refused, and the nearest one that passes */
.field-why { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; padding: 8px 10px; border-radius: var(--r-md);
  background: var(--danger-bg); color: var(--ink); font-size: var(--t-ui); font-weight: 600; }
.swatch { width: 16px; height: 16px; border-radius: 4px; border: var(--edge); display: inline-block; }
.save-blocked { margin: 0; font-weight: 700; }
input[aria-invalid=true] { border-color: var(--danger); }
/* a ticket: one primary, the rest under "More actions" */
.pop-menu { min-width: 220px; }
.pop-menu .pop-item { text-align: left; }

@media (max-width: 899px) {
  .acct-tab { padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; }
  .attention-row { grid-template-columns: 26px 1fr; }
  .attention-account { grid-column: 2; white-space: normal; }
  .acct-facts { grid-template-columns: 1fr; gap: 0; }
  .acct-facts dd { margin-bottom: var(--s2); }
  /* the one Back control: the trail's phone Back looks and sizes like every other Back (link colour, 44 px) */
  .crumbs-back.back { min-height: 44px; display: inline-flex; align-items: center; }
  .btn.quiet.back, .crumbs-back.back { color: var(--ink-muted); font-weight: 600; font-size: var(--t-small); }   /* one look for every Back (T213: quiet, muted; the accent on hover and focus) */
  .btn.quiet.back:hover, .btn.quiet.back:focus-visible { color: var(--accent-ink); }
  .reader .btn.quiet.back, .shell .btn.quiet.back { min-height: 44px; display: inline-flex; align-items: center; }
  /* Settings: the trail's Back to Settings is the one Back (the section's own is hidden) */
  .settings-page .settings-host .back { display: none; }
  /* a message or a conversation fills the phone: its own Back is the one (the list's trail waits behind it) */
  .shell.reading > .crumbs { display: none; }
}

/* ---------- the Sivro mark: once per screen, at the bottom ---------- */
/* On a desktop with a menu, the menu's foot carries it; on a desktop sign-in page, the line under the card; on the
   phone (where the in-page marks are hidden), the server's own fixed mark. */
@media (min-width: 900px) {
  .panel-footer:has(> .powered:only-child) { display: none; }
  body:has(.side .powered-side) .sivro-watermark, body:has(.auth .powered-page) .sivro-watermark { display: none !important; }
}
@media (max-width: 899px) {
  /* the phone's one mark is the server's fixed one: give it a small pill of the page colour so it never sits on text,
     and leave room under the last row so nothing has to hide behind it */
  .sivro-watermark { background: var(--bg); padding: 3px 6px; border-radius: var(--r-pill); }
  .rows, .panel-content, .reader .inner, .timeline { padding-bottom: 40px; }
}

/* ---------- T090: review round 1 ---------- */
/* Settings and "How do I" live in the menu's foot only (desktop); on the phone they are in the menu. The top bar
   carries the trail alone. */
.crumbs .settings-link, .crumbs .help-link { display: none !important; }
.topbar .top-help:not([hidden]) { display: none; }
/* One app: the brand mark alone, no "Mail" after it. */
.wordmark small { display: none; }
/* A pick's description gets two lines before it is cut. */
.pick .preview { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }

/* empty and error states: what shows here, a hint, one action (js/states.js) */
.empty-state, .error-state { gap: var(--s1); }
.empty-state .big, .error-state .big { font: 600 var(--t-title)/1.3 var(--display); color: var(--fg-soft); }
.error-state .big { color: var(--fg); }
.empty-state .hint, .error-state .hint { max-width: 40ch; margin: 0 auto; color: var(--fg-muted); font-weight: 600; font-size: var(--t-small); }
.empty-action { margin-top: var(--s3); }
.rows .empty-state, .rows .error-state { padding: var(--s7) var(--s5); }
li.empty-state, li.error-state, td .empty-state, td .error-state, .ticket-list .empty-state, .ticket-list .error-state, .panel-content > .empty-state {
  height: auto; place-items: start; text-align: left; padding: var(--s4) var(--s2); }
li.empty-state .hint, li.error-state .hint, td .empty-state .hint, .ticket-list .empty-state .hint, .ticket-list .error-state .hint, .panel-content > .empty-state .hint { margin: 0; }
.tree > li.empty-state { list-style: none; }

/* loading: skeleton rows the size of the real ones, so nothing jumps when they arrive */
.skeleton-list { display: grid; gap: 2px; align-content: start; }
.skeleton { display: grid; gap: 10px; align-content: center; padding: 12px; border-radius: var(--r-md); }
.skeleton.row { min-height: 88px; }
.skeleton.person { min-height: 64px; }
.skeleton.card { min-height: 96px; background: var(--surface); border: var(--line); margin-bottom: var(--s2); }
.bone { display: block; height: 10px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--surface-sunk) 0%, color-mix(in oklab, var(--surface-sunk) 55%, var(--surface)) 50%, var(--surface-sunk) 100%);
  background-size: 200% 100%; animation: bone 1.4s ease-in-out infinite; }
.bone.w60 { width: 60%; } .bone.w90 { width: 90%; } .bone.w40 { width: 40%; }
@keyframes bone { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .bone { animation: none; } }
/* Wide screens: panel content (cards, lists, tables) up to about 1200 px, left-aligned with the trail; forms keep
   their own narrower width. */
.panel-content { max-width: calc(1200px + 2 * var(--s6)); }

/* ---------- T095: the most-used screens ---------- */
/* the rows sit in a listbox inside the scroll box (the box also holds Load older, notes, empty states) */
.rows-list { display: flex; flex-direction: column; gap: 2px; }
/* nothing jumps when data arrives: the trail's bar keeps its height while empty; Settings parts keep room */
@media (min-width: 900px) {
  .shell > .crumbs { min-height: 35px; }
  .shell > .crumbs:empty { display: flex; }
}
.settings-host[aria-busy="true"] .settings-part { visibility: hidden; }
/* the server's mark reads (it is aria-hidden, but it is text people see) */
:root .sivro-watermark { opacity: .85 !important; }
/* wide screens: a comfortable reader; the list a little wider */
@media (min-width: 1440px) {
  .shell { grid-template-columns: 256px clamp(400px, 26vw, 480px) 1fr; }
  .reader .inner { max-width: 820px; margin: 0 auto; }
  .body-text { max-width: 72ch; }
}
/* the phone: Write and Reply where a thumb reaches them */
.fab-write { display: none; }
@media (max-width: 899px) {
  .fab-write { display: inline-flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 9; border-radius: var(--r-pill); }
  .shell.reading .fab-write, body.composing .fab-write, .shell.menu-open .fab-write { display: none; }
  .rows { padding-bottom: 96px; }
  /* the reader's actions sit at the bottom; Back stays at the top */
  .reader .inner { padding-top: 56px; }
  .actions { order: 99; position: sticky; top: auto; bottom: 0; padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); border-bottom: 0; border-top: var(--line); margin-top: auto; }
  .actions .back { position: fixed; top: 0; left: 0; right: 0; z-index: 2; justify-content: flex-start; padding: 0 var(--s4); min-height: 48px; border-radius: 0; background: var(--surface); border-bottom: var(--line); }
}
@media (max-width: 899px) {
  .actions .back, .actions .back:hover { width: 100%; background: var(--surface); color: var(--link); }
  /* while reading, the server's mark sits in the Back bar (top right), not on the bottom actions */
  body:has(.shell.reading) .sivro-watermark { top: 14px !important; bottom: auto !important; }
}
/* the list's title row keeps its height whether or not it has buttons (People has none): no jump */
.list-title { min-height: calc(var(--h-sm) + 2px); }
@media (max-width: 899px) {
  /* the phone's Write takes the bottom right; the server's mark moves to the bottom left */
  body:has(.shell:not(.reading) .fab-write) .sivro-watermark { right: auto !important; left: 12px !important; }
}

/* ---------- the big-screen home: panels on a 12-column grid (T092 design; B builds it in T094) ---------- */
/* line icons (icons/ui/*.svg) as masks, so they take the text colour in light, dark and brands */
.icon { display: inline-block; flex: none; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.i-overview { --i: url(/icons/ui/overview.svg); } .i-mail { --i: url(/icons/ui/mail.svg); } .i-accounts { --i: url(/icons/ui/accounts.svg); }
.i-tickets { --i: url(/icons/ui/tickets.svg); } .i-roles { --i: url(/icons/ui/roles.svg); } .i-audit { --i: url(/icons/ui/audit.svg); }
.i-branding { --i: url(/icons/ui/branding.svg); } .i-servers { --i: url(/icons/ui/servers.svg); } .i-settings { --i: url(/icons/ui/settings.svg); }
.i-help { --i: url(/icons/ui/help.svg); } .i-archive { --i: url(/icons/ui/archive.svg); } .i-billing { --i: url(/icons/ui/billing.svg); }
.i-activity { --i: url(/icons/ui/activity.svg); } .i-actions { --i: url(/icons/ui/actions.svg); } .i-attention { --i: url(/icons/ui/attention.svg); }
.i-fold { --i: url(/icons/ui/fold.svg); } .i-unfold { --i: url(/icons/ui/unfold.svg); } .i-grip { --i: url(/icons/ui/grip.svg); }
.i-more { --i: url(/icons/ui/more.svg); } .i-customize { --i: url(/icons/ui/customize.svg); } .i-chevron { --i: url(/icons/ui/chevron.svg); }   /* T225: the menu items with places inside them */
.side .nav .icon { opacity: .9; }

/* the side menu folds to its icons (a desktop choice; the phone keeps its drawer) */
.menu-toggle { align-self: flex-end; margin: -6px 0 6px; color: var(--on-side, var(--cream)); }
.menu-toggle:hover { background: var(--side-hover, var(--navy-2)); color: var(--on-side, var(--cream)); }
@media (min-width: 900px) {
  .panel-shell { transition: grid-template-columns .18s ease; }
  .panel-shell.menu-folded { grid-template-columns: 72px 1fr; }
  .menu-folded > .side { padding: 14px 10px; align-items: center; overflow-x: hidden; }
  .menu-folded > .side .menu-toggle { align-self: center; margin: 0 0 10px; }
  .menu-folded > .side .nav { width: 48px; justify-content: center; padding: 10px 0; }
  .menu-folded > .side .nav .label, .menu-folded > .side .who, .menu-folded > .side .powered, .menu-folded > .side .brand-name, .menu-folded > .side .wordmark { display: none; }
  .menu-folded > .side .nav-bottom { width: 100%; justify-items: center; }
  /* folded, the menu has no room for "Powered by Sivro": the server's own mark carries it */
  body:has(.panel-shell.menu-folded) .sivro-watermark { display: block !important; }
}
@media (max-width: 899px) { .menu-toggle { display: none; } }

/* the home grid */
.panel-content.is-home { max-width: none; }
.home-bar { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.home-bar h1 { flex: 1; margin: 0; }
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row; gap: var(--s4); align-items: stretch;
  container: dash / inline-size; }   /* in the person's order (T153: no dense); sizes follow the grid's own width */
.dash-panel { --span: 4; grid-column: span var(--span); min-width: 0; min-height: 248px; display: flex; flex-direction: column;
  --fg: var(--ink); --fg-soft: var(--ink-soft); --fg-muted: var(--ink-muted); --fg-link: var(--link); color: var(--fg);
  background: var(--surface); border: var(--edge); border-radius: var(--r-lg); box-shadow: var(--lift-2); }
.dash-panel[data-size="s"] { --span: 4; } .dash-panel[data-size="m"] { --span: 6; } .dash-panel[data-size="l"] { --span: 8; } .dash-panel[data-size="wide"] { --span: 12; }
/* T153: by the grid's width, not the window's (the menu open or folded changes it by 176 px): an S panel stays 265 px or wider */
@container dash (min-width: 1150px) { .dash-panel[data-size="s"] { --span: 3; } .dash-panel[data-size="m"] { --span: 4; } .dash-panel[data-size="l"] { --span: 6; } }
@container dash (min-width: 1760px) { .dash-panel[data-size="s"] { --span: 2; } .dash-panel[data-size="m"] { --span: 3; } .dash-panel[data-size="l"] { --span: 4; } }
/* T153: the last panel of a row takes the row's spare columns (fewer than 6), set by dashboard.js as data-span; the saved size stays */
.dash-panel[data-span="2"] { grid-column: span 2; } .dash-panel[data-span="3"] { grid-column: span 3; } .dash-panel[data-span="4"] { grid-column: span 4; } .dash-panel[data-span="5"] { grid-column: span 5; } .dash-panel[data-span="6"] { grid-column: span 6; } .dash-panel[data-span="7"] { grid-column: span 7; } .dash-panel[data-span="8"] { grid-column: span 8; } .dash-panel[data-span="9"] { grid-column: span 9; } .dash-panel[data-span="10"] { grid-column: span 10; } .dash-panel[data-span="11"] { grid-column: span 11; } .dash-panel[data-span="12"] { grid-column: span 12; }
.dash-panel.keep-open { grid-row: span 2; min-height: 560px; }
/* a narrow panel (S on a big screen): the grip mark goes (the whole header still drags) and the header tightens, so the title fits */
.dash-panel { container: panel / inline-size; }
@container panel (max-width: 340px) { .dash-head { gap: 4px; padding-left: 8px; } .dash-head .i-grip { display: none; } .dash-head .dash-open { padding-inline: 8px; } }
.dash-head { display: flex; align-items: center; gap: var(--s2); padding: 8px 8px 8px 12px; border-bottom: var(--line); cursor: grab; touch-action: none; user-select: none; }
.dash-head .icon { color: var(--ink-soft); }
.dash-title { flex: 1; min-width: 0; margin: 0; font: 700 var(--t-body)/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-count { font: 700 var(--t-tiny)/18px var(--body); min-width: 22px; text-align: center; padding: 0 7px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); border: 1.5px solid var(--outline); }
.dash-head .btn { cursor: pointer; }
.dash-body { flex: 1; min-height: 0; overflow: auto; padding: 6px 6px 10px; display: grid; align-content: start; gap: 2px; }
.dash-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 7px 8px; border-radius: var(--r-md); color: var(--fg); text-decoration: none; font-size: var(--t-ui); }
.dash-item:hover { background: var(--surface-sunk); }
.dash-item .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-item.unread .who { font-weight: 700; }
.dash-item.unread .who::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: var(--r-pill); background: var(--accent-text); box-shadow: 0 0 0 1.5px var(--outline); vertical-align: 1px; }
.dash-item .when { justify-self: end; font-size: var(--t-tiny); font-weight: 700; color: var(--fg-muted); white-space: nowrap; }
.dash-item .what { grid-column: 1 / -1; font-size: var(--t-small); color: var(--fg-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-stat { display: flex; align-items: baseline; gap: var(--s2); padding: 6px 8px; }
.dash-stat .big { font: 700 var(--t-display)/1 var(--display); }
.dash-stat .of { font-size: var(--t-small); font-weight: 600; color: var(--fg-soft); }
.dash-foot { padding: 6px 8px 0; font-size: var(--t-small); color: var(--fg-muted); font-weight: 600; }
.dash-actions { display: flex; flex-wrap: wrap; gap: var(--s2); padding: 8px; }
.dash-search { margin: 4px 6px 6px; }
.dash-spark { width: 100%; height: 40px; display: block; }
.dash-spark polyline { fill: none; stroke: var(--link); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* My mail kept open: the list and the reader side by side, in place */
.dash-split { display: grid; grid-template-columns: minmax(220px, 2fr) 3fr; gap: var(--s3); min-height: 0; height: 100%; }
.dash-split .dash-list { overflow: auto; display: grid; align-content: start; gap: 2px; }
.dash-split .dash-item[aria-current="true"] { background: var(--info-bg); }
.dash-reader { border-left: var(--line); padding: 4px 4px 4px 14px; overflow: auto; display: grid; align-content: start; gap: var(--s2); }
.dash-reader h3 { margin: 0; font-size: var(--t-title); }
.dash-reader .meta { font-size: var(--t-small); }
.dash-reader .body-text { border-top: var(--line); padding-top: var(--s3); font-size: var(--t-ui); max-width: 72ch; }
.dash-panel.keep-open:only-child { min-height: calc(100dvh - 170px); }
/* moving */
.dash-panel.dragging { opacity: .45; }
.dash-panel.drop-before { box-shadow: -6px 0 0 var(--link), var(--lift-2); }
.dash-panel.drop-after { box-shadow: 6px 0 0 var(--link), var(--lift-2); }
.dash-panel.just-moved { animation: dash-land .28s ease-out; }
@keyframes dash-land { from { transform: scale(.97); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .dash-panel.just-moved { animation: none; } .panel-shell { transition: none; } }
/* Customize home: a sheet from the right */
.sheet-wrap { position: fixed; inset: 0; z-index: 45; background: var(--scrim); }
.sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 46; overflow: auto; display: grid; align-content: start; gap: var(--s3);
  padding: var(--s5); background: var(--surface); color: var(--ink); border-left: var(--edge-bold); box-shadow: -6px 0 0 var(--shadow);
  --fg: var(--ink); --fg-soft: var(--ink-soft); --fg-muted: var(--ink-muted); --fg-link: var(--link); }
.sheet h2 { margin: 0; }
.sheet .hint { margin: 0; }
.custom-row { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; padding: 10px 12px; border: var(--line); border-radius: var(--r-md); background: var(--field); }
.custom-row .opts { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.custom-row.off .opts { opacity: .6; }
.seg { display: inline-flex; border: var(--edge); border-radius: var(--r-pill); overflow: hidden; }
.seg label { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; font-size: var(--t-small); font-weight: 700; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--ink); color: var(--surface); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; }
.sheet-foot { display: flex; gap: var(--s2); justify-content: space-between; padding-top: var(--s2); }
/* T203: the panel home from 600 px up; only a phone keeps the Overview list */
@media (max-width: 599px) { .dash-only { display: none !important; } }
@media (min-width: 600px) { .list-only { display: none !important; } }

/* menus with a choice show it: a tick on the chosen size and on what is on */
.pop-item[aria-checked] { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.pop-item[aria-checked="true"]::after { content: "✓"; font-weight: 700; color: var(--link); }

/* ---------- T112: the panel pages ---------- */
/* the account page: the tab bar scrolls sideways only; the Summary facts at reading size, label and value aligned */
.acct-tabs { overflow-x: auto; overflow-y: hidden; }
dl.acct-facts { font-size: var(--t-body); font-weight: 400; color: var(--fg); align-items: baseline; gap: 8px 24px; }
dl.acct-facts dt { font-size: var(--t-ui); font-weight: 600; color: var(--fg-soft); }
dl.acct-facts dd { font-weight: 600; }
/* the accounts tree: one primary (Open), the tree's Show/Hide, and a ⋯ menu for the rest */
.acct-tools { align-items: center; }
.acct-more-wrap { position: relative; }
.acct-more { position: absolute; top: calc(100% + 6px); right: 0; left: auto; min-width: 220px; z-index: 25; display: grid; gap: 2px; }
.acct-more[hidden] { display: none; }
.acct-more > .btn, .acct-more > .pop-anchor > .btn, .acct-more > .add-wrap > .btn { width: 100%; justify-content: flex-start; min-height: 36px; border-color: transparent; box-shadow: none; background: transparent; font-size: var(--t-ui); }
.acct-more > .btn:hover, .acct-more > .pop-anchor > .btn:hover { background: var(--surface-sunk); }
.acct-more > .pop-anchor { display: block; }
.acct-more .popover { top: 0; right: calc(100% + 8px); left: auto; }
.acct > .add-slot:empty, .acct > span:empty { display: none; }
@media (max-width: 899px) {
  .acct-more { position: fixed; top: auto; left: 8px; right: 8px; bottom: 8px; }
  .acct-more > .btn, .acct-more > .pop-anchor > .btn { min-height: 44px; }
  .acct-more .popover { right: 0; top: calc(100% + 4px); }
}
/* the tab bar on the phone: a soft fade at the edges says it scrolls (no half-cut word at a hard edge) */
@media (max-width: 899px) {
  .acct-tabs { -webkit-mask: linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); mask: linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); padding: 0 12px; scroll-padding: 0 24px; }
}
/* How do I: two or three columns on wide screens, one tidy list on the phone */
.help-index { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); max-width: 1200px; gap: var(--s2) var(--s3); }
.help-index .pick { margin-bottom: 0; height: 100%; display: flex; align-items: center; }
/* the Branding preview: room for "Powered by Sivro" on one line */
.mini { grid-template-columns: 120px 1fr; }
.mini-side .powered { white-space: nowrap; }

/* ---------- T118: with a lived-in amount of data ---------- */
/* ticket states: one colour per meaning (the class names are the API's own words) */
.state-new { background: var(--accent-soft); }
.state-triaged { background: var(--info-bg); }
.state-working { background: var(--ok-bg); }
.state-needs-info, .state-needs_info { background: var(--warn-bg); }
.state-waiting-for-sysadmin, .state-waiting { background: var(--highlight); color: var(--navy); }
.state-done { background: var(--ok-strong-bg); }
.state-closed { background: var(--surface-sunk); color: var(--ink-soft); border-style: dashed; }
/* the accounts tree: one line per account on a desktop (level, name, role, facts, Open, the rest) */
@media (min-width: 900px) {
  .tree .acct { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 10px 8px 12px; }
  .tree .acct > .acct-head { display: contents; }
  .tree .acct .name { min-width: 0; max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tree .acct > .acct-facts { order: 3; margin-left: auto; white-space: nowrap; }
  .tree .acct .acct-tools { order: 4; margin-left: 0; flex-wrap: nowrap; }
  .tree .acct > :not(.acct-head):not(.acct-facts) { order: 5; flex-basis: 100%; }
}
/* long tables: the header stays in view while you scroll */
.audit-table { overflow: clip; }
.audit-table thead th { position: sticky; top: 0; z-index: 1; }
/* lists and tables grouped by day */
.day-head { margin: var(--s4) 4px var(--s1); font: 600 var(--t-tiny)/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); }
.day-head:first-child { margin-top: 0; }
.audit-table tr.day-row th { position: static; padding: 10px 10px 6px; background: var(--surface-sunk); color: var(--ink-soft); font: 600 var(--t-tiny)/1 var(--display); letter-spacing: .06em; text-transform: uppercase; }
/* a brand's name in the menu: title size, up to two lines, never cut to "Planet Mail De..." */
.side .brand-mark .brand-name { font-size: var(--t-title); line-height: 1.15; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* ---------- T088/T131: billing, sign-ins, download parts, the domain check (B's new-billing.css, folded in) ---------- */
/* statements: one card a month (account › Billing, Settings › Billing). The Archive tab only says paid or not. */
.statement-list { list-style: none; margin: var(--s3) 0; padding: 0; display: grid; gap: var(--s3); }
.statement { background: var(--surface); border: var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.statement-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.statement-month { font: 600 var(--t-title)/var(--lh-tight) var(--display); color: var(--ink); }
.statement-total { margin-left: auto; font-weight: 800; font-size: var(--t-body); font-variant-numeric: tabular-nums; color: var(--ink); }
.statement-state, .session-place, .session-current, .dns-state {
  display: inline-flex; align-items: center; min-height: 24px; font: 700 var(--t-tiny)/1 var(--body);
  padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid transparent; background: var(--surface-sunk); color: var(--ink);
}
.statement-state.state-open { background: var(--info-bg); }
.statement-state.state-paid { background: var(--ok-strong-bg); }
.statement-state.state-overdue { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.statement-state.state-waived { color: var(--ink-soft); border: 1px dashed var(--ink-soft); }
.statement-overdue { border-color: var(--danger); }
.statement-lines { width: 100%; border-collapse: collapse; margin-top: var(--s2); font-size: var(--t-ui); color: var(--ink-soft); }
.statement-lines td { padding: var(--s1) 0; border-top: var(--line); }
.statement-lines .num { text-align: right; white-space: nowrap; padding-left: var(--s3); font-variant-numeric: tabular-nums; }
.statement-when { margin: var(--s2) 0 0; }
.statement-actions { margin-top: var(--s2); flex-wrap: wrap; }
.billing-step, .billing-due, .archive-locked { margin: var(--s3) 0; }
.archive-locked p { margin: 0 0 var(--s2); }
.billing-steps { margin-top: var(--s2); }
.billing-steps summary { cursor: pointer; font-weight: 700; color: var(--ink); padding: 12px 0; }   /* 44 px, and keeps its marker */
.billing-steps summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.paid-state .see-bills { font-weight: 700; white-space: nowrap; }
@media (max-width: 599px) {
  .statement { padding: var(--s3); }
  .statement-total { margin-left: 0; flex-basis: 100%; order: 3; }
}

/* What needs you: the kind's mark, and how long on the right */
.attention-since { color: var(--fg-soft, var(--ink-soft)); font-size: var(--t-small); white-space: nowrap; }
@media (max-width: 899px) { .attention-since { grid-column: 2; white-space: normal; } }
.needs-attention .attention-mark { width: 22px; height: 22px; font-size: var(--t-small); }

/* sign-ins */
.session-list { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s2); }
.session-row { border-top: var(--line); padding-top: var(--s2); }
.session-what { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.session-current { background: var(--ok-strong-bg); }
.session-code { align-items: end; flex-wrap: wrap; }

/* download parts */
.export-parts { list-style: none; margin: var(--s2) 0; padding: 0; display: grid; gap: var(--s2); }
.export-parts li { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.export-parts li span { min-width: 7em; font-weight: 700; color: var(--ink); }
.tl-parts { margin-top: var(--s2); }

/* Check my domain */
.domain-list { list-style: none; margin: 0; padding: 0; }
.domain-list > li { padding: var(--s2) 0; border-top: var(--line); }
.domain-list > li:first-child { border-top: 0; }
.domain-check:empty { display: none; }
.domain-check { margin-top: var(--s2); }
.dns-records { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s2); }
.dns-record { border: var(--line); border-radius: var(--r-md); padding: var(--s2) var(--s3); background: var(--surface); }
.dns-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.dns-head code, .dns-value code { font: var(--t-small)/1.4 var(--mono); overflow-wrap: anywhere; }
.dns-state { margin-left: auto; background: var(--warn-bg); }
.dns-record.state-ok .dns-state { background: var(--ok-strong-bg); }
.dns-value { margin-top: var(--s1); }
.dns-record p { margin: var(--s1) 0 0; }

/* Activity: the CSV link beside the tick */
.activity-tools { justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--s2); }
.side .who .level { margin-left: var(--s1); }
.side .who .level-sivro { border-color: var(--on-side-soft, var(--cream-2)); }   /* a navy pill on the navy menu needs its edge */

/* ---------- T094/T131: the big-screen home's extras (B's new-dashboard.css, folded in) ---------- */
.dash-head { position: relative; }
.dash-pop { top: calc(100% + 4px); left: auto; right: 6px; z-index: 30; }
.dash-head.fixed { cursor: default; }   /* viewing as: nothing moves */
.dash-item .attention-mark { display: inline-grid; place-items: center; width: 20px; font-size: var(--t-small); }
/* My mail kept open: the real reader (sandboxed /page frame), without its own Back */
.dash-reader .back { display: none; }
.dash-reader .inner { display: flex; flex-direction: column; gap: var(--s3); min-height: 100%; }
.dash-reader .inner h1 { margin: 0; font-size: var(--t-title); }
.dash-reader .actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.dash-reader .mail-frame { min-height: 360px; }
.dash-panel.keep-open .dash-body { grid-template-rows: auto minmax(0, 1fr); }
.dash-body > .empty { padding: var(--s3) var(--s2); }
.dash-search { width: auto; }   /* inside its margins, not 12 px past the panel's edge */
/* the folded menu: Sign out keeps a mark when its words are hidden */
.side .sign-out-mark { display: none; }
@media (min-width: 900px) {
  .menu-folded > .side .sign-out { width: 48px; justify-content: center; padding: 10px 0; }
  .menu-folded > .side .sign-out .sign-out-mark { display: inline; }
}

/* ---------- T116/T153: the uptime strip, the ticket helper, ticket entries (B's new-helper.css, folded in) ---------- */
/* ---------- the uptime strip: colour, and shape (full height, shorter, hatched, hollow), and words below ---------- */
:root { --up-full: var(--ok); --up-high: #A86A12; --up-low: var(--danger); }
@media (prefers-color-scheme: dark) { :root:not(.theme-light) { --up-high: #F2B33D; } }
:root.theme-dark { --up-high: #F2B33D; }   /* the person's own choice (theme-boot.js), not only the device's */
.uptime { margin-top: var(--s3); padding: 12px 14px; background: var(--surface); border: var(--line); border-radius: var(--r-md); display: grid; gap: 6px; }
.uptime-head { margin: 0; font-size: var(--t-ui); }
.uptime-cells { display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 2px; height: 30px; align-items: end; border-radius: var(--r-sm); padding: 2px; cursor: crosshair; }
.uptime-cells:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.up-cell { display: block; height: 100%; border-radius: 2px; background: var(--up-full); }
.up-cell[data-band="high"] { background: var(--up-high); height: 70%; }
.up-cell[data-band="low"] { background: repeating-linear-gradient(135deg, var(--up-low) 0 3px, transparent 3px 5px); border: 1.5px solid var(--up-low); }
.up-cell[data-band="none"] { background: transparent; border: 1.5px solid var(--ink-muted); height: 40%; }
.up-cell[data-band="before"] { background: var(--surface-sunk); height: 20%; }
.up-cell.is-active { outline: 2px solid var(--ink); outline-offset: 1px; }
.uptime-scale { display: flex; justify-content: space-between; margin: 0; }
.uptime-day { margin: 0; font-weight: 700; color: var(--ink); min-height: 1.3em; }
.uptime-sum { margin: 0; }
.uptime-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.uptime-key li { display: inline-flex; align-items: end; gap: 4px; }
.uptime-key .up-cell { width: 10px; height: 16px; }
.uptime-key .up-cell[data-band="high"] { height: 11px; }
.uptime-key .up-cell[data-band="none"] { height: 7px; }
@media (max-width: 599px) { .uptime-cells { gap: 1px; padding: 1px; } }

/* ---------- Servers' two sections, and the ticket helper ---------- */
.servers-tabs { margin-bottom: var(--s3); }
.helper-top { display: grid; gap: var(--s3); }
.helper-facts { margin: 0; }
.helper-spend { display: grid; gap: 4px; max-width: 420px; }
.helper-spend .line { justify-content: space-between; }
.helper-spend .quota progress { max-width: none; }
progress.near::-webkit-progress-value { background: var(--up-high); }
progress.near::-moz-progress-bar { background: var(--up-high); }
progress.full::-moz-progress-bar { background: var(--danger); }
.helper-warning { background: var(--warn-bg); }
.helper-warning.stopped { background: var(--danger-bg); border-color: var(--danger); }
.draft-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.helper-runs { margin-top: var(--s4); }
.helper-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- tickets: the "we got it" reply lighter, internal notes, by mail, the helper's draft ---------- */
.timeline-list li.tl-auto { background: transparent; border-style: dotted; padding: 4px 12px; font-size: var(--t-small); color: var(--ink-soft); }
.timeline-list li.tl-auto .tl-head strong { font-weight: 600; }
.timeline-list li.tl-internal { background: var(--warn-bg); }
.tl-tag { margin-left: 8px; font-size: var(--t-tiny); font-weight: 700; color: var(--ink-soft); background: var(--surface-sunk); border-radius: var(--r-pill); padding: 1px 8px; }
.tl-tag.internal { background: var(--surface); border: 1px solid var(--outline); }
.mail-mark { font-weight: 700; }
.ticket-by-mail { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.ticket-by-mail.unverified { background: var(--warn-bg); }
.not-verified { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.ticket-about { font-weight: 700; }
.note-kind { border: 0; padding: 0; margin: 0 0 var(--s2); display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.note-kind legend { font-weight: 700; font-size: var(--t-ui); padding: 0; margin-bottom: 4px; }
.note-kind .note-where { flex-basis: 100%; margin: 0; }
.draft-box { display: grid; gap: var(--s2); margin-top: 6px; padding: 10px 12px; border: 1.5px dashed var(--outline); border-radius: var(--r-md); background: var(--surface); }
.draft-box .hint { margin: 0; }
.draft-actions { flex-wrap: wrap; }

/* ---------- Settings › Tickets ---------- */
.ticket-settings .box { display: grid; gap: var(--s2); }
.mail-in select { max-width: 420px; }
.export-parts-box .export-gone { font-weight: 700; }

/* ---------- T166: the help chat (Patchy under Sivro's branding; "Help" under another brand). Spec: docs/design/patchy.md ---------- */
/* the launcher: a round button, bottom-right, on every screen of the panel and the mail, only while the chat is on */
.patchy-launcher {
  position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 25;
  width: 56px; height: 56px; padding: 0; display: grid; place-items: center; border-radius: 50%;
  border: var(--edge); background: var(--mustard); color: var(--navy); box-shadow: var(--lift-2); cursor: pointer;
}
.patchy-launcher img { width: 46px; height: 46px; border-radius: 50%; display: block; }
.patchy-launcher:hover { transform: translate(-1px, -1px); box-shadow: var(--lift-3); }
.patchy-launcher:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.patchy-launcher.neutral { background: var(--accent); color: var(--on-accent); }   /* another brand: "?" in its own colours */
.patchy-launcher.neutral .icon { width: 26px; height: 26px; }
/* out of the way: while writing, while the chat is open, while a sheet, dialog or the phone menu is open, and on paper */
body.composing .patchy-launcher, .patchy-launcher[aria-expanded="true"], body:has(.sheet-wrap:not([hidden])) .patchy-launcher,
body:has(.help-wrap:not([hidden])) .patchy-launcher, body:has(.menu-open) .patchy-launcher { display: none; }
/* a toast or status line takes the bottom centre: the launcher steps up while one shows */
body:has(.toast:not([hidden])) .patchy-launcher, body:has(.status:not(:empty):not([hidden])) .patchy-launcher { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 899px) {
  .patchy-launcher { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 52px; height: 52px; }
  .patchy-launcher img { width: 42px; height: 42px; }
  /* the mail's Write button owns the corner: Patchy sits just above it */
  body:has(.shell:not(.reading) .fab-write) .patchy-launcher { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  /* reading a message: the reader's actions own the bottom, so no launcher (back in the list) */
  body:has(.shell.reading) .patchy-launcher { display: none; }
}
/* room under the last thing on a page, so scrolling to the end never leaves it under the launcher */
body:has(.patchy-launcher) .panel-content:not(.is-mail) { padding-bottom: 104px; }
/* T179: My mail fills the panel to the bottom (no band); the room goes under the reader's last line instead, so the
   launcher floats over the reader's bottom-right corner and scrolling to the end never leaves text under it */
body:has(.patchy-launcher) .shell.in-panel .reader .inner { padding-bottom: 104px; }
@media print { .patchy-launcher, .patchy { display: none !important; } }

/* the chat: a small panel above the corner on a desktop, a full-height sheet on the phone */
.patchy {
  position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 42;
  width: 380px; height: min(560px, calc(100vh - 48px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface); color: var(--ink); border: var(--edge); border-radius: var(--r-xl); box-shadow: var(--lift-3); overflow: hidden;
}
.patchy[hidden] { display: none; }
@media (max-width: 899px) {
  .patchy { inset: 0; width: auto; height: auto; border: 0; border-radius: 0; box-shadow: none;
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
}
.patchy-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 12px 12px 16px; border-bottom: var(--line); background: var(--surface); }
.patchy-face { width: 40px; height: 40px; border-radius: 50%; background: var(--mustard); border: 2px solid var(--outline); display: block; }
.patchy-head .neutral-face { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.patchy-head h2 { margin: 0; font: 700 var(--t-title)/var(--lh-tight) var(--display); }
.patchy-sub { margin: 2px 0 0; font-size: var(--t-small); color: var(--ink-soft); }
.patchy-close { width: 44px; height: 44px; padding: 0; justify-content: center; }
/* B's T167, folded in T179: "Start over" sits with Close in the header's last column */
.patchy-tools { display: flex; align-items: center; gap: 2px; }
.patchy-tools .patchy-again[hidden] { display: none; }
/* B's T178, folded on merge (T186): the question box's counter, quiet, from 1,800 characters (the server takes 2,000) */
.patchy-ask .patchy-count { grid-column: 1 / -1; margin: -4px 0 0; font-size: .8rem; color: var(--ink-muted); text-align: right; }
.patchy-ask .patchy-count[hidden] { display: none; }

/* the conversation */
.patchy-log { overflow: auto; padding: 16px; display: grid; align-content: start; gap: 14px; overscroll-behavior: contain; }
.patchy-q { justify-self: end; max-width: 85%; padding: 10px 14px; border-radius: var(--r-lg) var(--r-lg) 4px var(--r-lg); background: var(--info-bg); color: var(--ink); font-size: var(--t-ui); overflow-wrap: anywhere; }
.patchy-a { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; }
.patchy-a.neutral { grid-template-columns: minmax(0, 1fr); }
.patchy-a .patchy-face { width: 32px; height: 32px; }
.patchy-a .patchy-body { display: grid; gap: 8px; padding: 10px 14px; border-radius: 4px var(--r-lg) var(--r-lg) var(--r-lg); background: var(--surface-sunk); font-size: var(--t-ui); line-height: var(--lh-body); overflow-wrap: anywhere; }
.patchy-body p, .patchy-body ol, .patchy-body ul { margin: 0; }
.patchy-body ol, .patchy-body ul { padding-left: 20px; display: grid; gap: 4px; }
.patchy-sources { display: grid; gap: 2px; margin: 0; padding: 8px 0 0; border-top: var(--line); list-style: none; font-size: var(--t-small); }
.patchy-sources::before { content: "From the help pages"; display: block; font-weight: 700; color: var(--ink-soft); margin-bottom: 2px; }
.patchy-sources a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; display: inline-block; padding: 6px 0; }
.patchy-ticket { justify-self: start; }
.patchy-note { padding: 10px 14px; border-radius: var(--r-md); background: var(--warn-bg); font-size: var(--t-ui); }
.patchy-note.off { background: var(--surface-sunk); }
/* thinking: Patch looks up, three dots pulse gently; still with reduced motion */
.patchy-a.thinking .patchy-body { color: var(--ink-soft); grid-auto-flow: column; justify-content: start; align-items: center; gap: 8px; }
.patchy-dots { display: inline-flex; gap: 4px; }
.patchy-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; animation: patchy-dot 1.2s ease-in-out infinite; }
.patchy-dots i:nth-child(2) { animation-delay: .2s; } .patchy-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes patchy-dot { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .patchy-dots i { animation: none; opacity: .7; } .patchy-launcher:hover { transform: none; } }

/* empty: a hello and three example questions for the person's role */
.patchy-empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 12px 4px; }
.patchy-empty .patchy-face { width: 64px; height: 64px; }
.patchy-empty p { margin: 0; color: var(--ink-soft); font-size: var(--t-ui); }
.patchy-examples { display: grid; gap: 8px; width: 100%; margin-top: 4px; }
.patchy-examples .btn { justify-content: flex-start; text-align: left; white-space: normal; min-height: 44px; height: auto; padding-block: 8px; }

/* the question box */
.patchy-ask { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 10px 12px 12px; border-top: var(--line); background: var(--surface); }
.patchy-ask textarea { min-height: 44px; max-height: 132px; resize: none; line-height: var(--lh-ui); }
.patchy-ask .btn { min-height: 44px; }
.patchy-ask .hint { grid-column: 1 / -1; margin: 0; }
@media (max-width: 899px) {
  /* the server's mark keeps the bottom-right corner of the phone: the question box sits above it */
  .patchy-ask { padding-bottom: 36px; }
  /* the mail list leaves room for Write and the launcher above it */
  body:has(.patchy-launcher) .rows { padding-bottom: 160px; }
}

/* ---------- T174: My mail inside the panel (B mounts the mail's .shell in .panel-content.is-mail as .shell.in-panel) ----------
   Spec: docs/design/mail-in-panel.md. From 900 px: one navy column (the panel menu), the mail's folders a light second
   column. On the phone: today's mail screen exactly (its own top bar and drawer, with "Panel" as the way back). */
.panel-content.is-mail { flex: 1; min-height: 0; max-width: none; width: 100%; padding: 0; gap: 0; display: flex; container: mail / inline-size; }
.shell.in-panel { flex: 1; min-width: 0; height: auto; min-height: 0; }
.panel-main:has(> .panel-content.is-mail) { overflow: hidden; }
.panel-main:has(> .panel-content.is-mail) > .crumbs, .panel-main:has(> .panel-content.is-mail) > .panel-footer { display: none; }   /* no breadcrumb; the menu carries the mark */
.shell.in-panel > .crumbs { display: none; }
@media (min-width: 900px) {
  .shell.in-panel { grid-template-columns: 208px 344px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .shell.in-panel > .topbar, .shell.in-panel > .backdrop { display: none; }
  .shell.in-panel > .side, .shell.in-panel > .list, .shell.in-panel > .reader { grid-row: 1; min-height: 0; }
  /* the folder column: light, on the page's own colours (brands can't use dark page colours; dark mode follows the person) */
  .shell.in-panel > .side {
    --side-bg: var(--surface-sunk); --on-side: var(--ink); --on-side-soft: var(--ink-soft); --side-hover: var(--bg); --nav-count: var(--danger); --side-count: var(--danger);
    border-right: var(--line); padding: 14px 10px; }
  .shell.in-panel > .side .nav[aria-current="true"] { background: var(--info-bg); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
  .shell.in-panel > .side .nav[aria-current="true"] .count { color: var(--ink); }
  .shell.in-panel > .side .compose { margin: 2px 4px 12px; border-color: var(--outline); box-shadow: var(--lift-1); }
  .shell.in-panel > .side .group-head { color: var(--ink-soft); }
  .shell.in-panel > .side .nav.dim { opacity: 1; color: var(--ink-soft); }   /* blocked: struck through, in the soft ink (60% opacity fails AA here) */
  /* what the panel menu already shows goes: the wordmark, Panel, Settings, How do I, who is signed in, Sign out,
     Powered by (Mailboxes stays: it is the mail's own) */
  .shell.in-panel > .side > .wordmark, .shell.in-panel > .side .powered, .shell.in-panel .nav-bottom > .who,
  .shell.in-panel .nav-bottom > a.nav[href="/"], .shell.in-panel .nav-bottom > a.nav[href="/help"],
  .shell.in-panel .nav-bottom > [data-view^="settings"], .shell.in-panel .nav-bottom > button.nav:not([data-view]) { display: none; }
  .shell.in-panel .reader .inner { max-width: 820px; margin: 0 auto; }
}
/* by the mail area's own width (the panel menu open or folded changes it by 176 px); the container is .panel-content.is-mail */
@container mail (min-width: 1150px) { .shell.in-panel { grid-template-columns: 232px 380px minmax(0, 1fr); } }
@container mail (min-width: 1600px) { .shell.in-panel { grid-template-columns: 248px clamp(400px, 26cqw, 480px) minmax(0, 1fr); } }
@media (max-width: 899px) {
  /* the phone: today's mail screen. The panel's top bar steps aside for the mail's own; the mail's drawer keeps
     Panel, Settings, How do I and Sign out, so there is one way back. */
  .panel-shell:has(.panel-content.is-mail) > .topbar { display: none; }
  .panel-shell:has(.panel-content.is-mail) { grid-template-rows: minmax(0, 1fr); }
}

/* ---------- T185: grouped lists (Settings first; the account page and the sign-in pages use the same parts).
   Spec: docs/design/settings.md. Sivro stays in the buttons, type, colours and Patch; the lists go quiet: one hairline
   group per idea, rows split by hairlines, switches on the right, two weights of type (400 and 700), no box in a box. */
:root { --hairline: 1px solid color-mix(in oklab, var(--outline) 22%, transparent); --row-h: 48px; }

/* the section list: one group of rows with a chevron; the picked one has the accent bar */
.settings-list { gap: 0; align-self: start; background: var(--surface); border: var(--hairline); border-radius: var(--r-lg); overflow: hidden; }
.settings-list .pick, .settings-list .pick:hover, .settings-list .pick[aria-current="true"] {
  margin: 0; border: 0; border-radius: 0; box-shadow: none; min-height: var(--row-h); align-content: center;
  padding: 12px 40px 12px 16px; position: relative; background: transparent; }
.settings-list .pick + .pick { border-top: var(--hairline); }
.settings-list .pick:hover { background: var(--surface-sunk); }
.settings-list .pick[aria-current="true"] { background: var(--info-bg); box-shadow: inset 3px 0 0 var(--accent); }
.settings-list .pick::after { content: ''; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted); transform: rotate(-45deg); }
.settings-list .pick-title { font-weight: 700; }
.settings-list .pick .when { font-weight: 400; }
.settings-list .pick .preview { font-weight: 400; color: var(--ink-muted); }
@media (min-width: 900px) { .settings-list .pick .preview { display: none; } }   /* the desk: titles only; the phone's list keeps the line */
.settings-list .pick:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }

/* a section: its title, then groups. A group is a hairline box with no lift; its heading small; its rows split by hairlines */
.settings-host .panel.settings > h1 { font: 700 var(--t-title)/var(--lh-tight) var(--display); margin: 0; }
.settings-host .panel.settings { gap: var(--s5); }
.settings-host .box, .settings-host .panel.settings .box { border: var(--hairline); box-shadow: none; border-radius: var(--r-lg); padding: 14px 18px; gap: var(--s3); }
.settings-host .box h2, .settings-host .panel.settings .box h2 { font: 700 var(--t-body)/var(--lh-ui) var(--body); margin: 0; }
.settings-host .box .box { border: 0; padding: 0; background: transparent; }   /* never a box in a box */
/* two weights: 400 for words, 700 for names and actions */
.settings-host :is(p, .hint, .note, li, .preview, .when, .session-place, legend, .tick .hint),
.settings-host .panel.settings .box p, .settings-host .field .hint, .settings-host .tick, .settings-host .input,
.settings-host .input::placeholder, .settings-page .settings-top .input, .settings-page .settings-top .input::placeholder { font-weight: 400; }
.settings-host :is(strong, b, label.field, .btn, h2, h3, .session-what strong, .pick-title) { font-weight: 700; }
.settings-page :is(strong, b) { font-weight: 700; }
.settings-host .cmd { font-weight: 400; }
.cmd-block pre.cmd:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.settings-host .hint { color: var(--fg-muted); }

/* rows: a tick, radio or switch is a full-width row of at least 48 px; neighbours are split by a hairline */
.settings-host .box > .tick, .settings-host .box fieldset > .tick { min-height: var(--row-h); margin: 0 -18px; padding: 10px 18px; }
.settings-host .box > .tick + .tick, .settings-host .box fieldset > .tick + .tick { border-top: var(--hairline); }
.settings-host fieldset.strictness, .settings-host fieldset.theme-choice { border: 0; padding: 0; margin: 0; display: grid; gap: 0; }
.settings-host .box > :is(p, div):empty { display: none; }   /* an empty hint adds no gap */
.settings-host fieldset.strictness > legend { font-weight: 700; font-size: var(--t-ui); padding: 0 0 4px; }
.settings-host .tick.radio > span strong { font-weight: 700; }

/* the switch: a checkbox that saves at once (B's T185 hook: label.tick.switch, input role=switch). Label left, switch right */
.tick.switch { justify-content: space-between; gap: var(--s4); }
.tick.switch > input { order: 2; appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 46px; height: 28px; margin: 0;
  border-radius: var(--r-pill); border: 2px solid var(--outline); background: var(--surface-sunk); cursor: pointer; transition: background-color .15s; }
.tick.switch > input::before { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--field); border: 1.5px solid var(--outline); transition: transform .15s; }
.tick.switch > input:checked { background: var(--ok); }
.tick.switch > input:checked::before { transform: translateX(18px); }
.tick.switch > input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.tick.switch > input:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .tick.switch > input, .tick.switch > input::before { transition: none; } }
@media (forced-colors: active) { .tick.switch > input:checked { background: Highlight; } }

/* search: the row a hit points at is shown for a moment (settingspage.js adds .found to the part it scrolls to) */
.settings-host .found { animation: found 1.6s ease-out 1; }
@keyframes found { from { box-shadow: 0 0 0 3px var(--accent); } to { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .settings-host .found { animation: none; box-shadow: 0 0 0 3px var(--accent); } }
.settings-hits li { border: var(--hairline); }
.settings-hits .hit strong { font-weight: 700; }

/* the danger zone: can't-undo actions at the bottom of a section, apart */
.settings-host .danger-zone { border-color: color-mix(in oklab, var(--danger) 45%, transparent); }
.settings-host .danger-zone h2 { color: var(--danger); }
.settings-host .panel.settings > .danger-zone { order: 99; }
.settings-host .danger-zone .btn:not(.quiet) { background: var(--danger); color: var(--on-danger); }   /* always last in its section */
.settings-host .found { border-radius: var(--r-lg); }

/* T185 (c): the account page. Its facts are a grouped list (label left, value right, hairlines); its cards are quiet
   groups; two weights. The tabs stay as they are (one row, the picked one raised). */
.acct-body dl.acct-facts { --fg: var(--ink); --fg-soft: var(--ink-soft); color: var(--ink); max-width: 720px; gap: 0;
  grid-template-columns: minmax(max-content, 1fr) auto; background: var(--surface); border: var(--hairline); border-radius: var(--r-lg); overflow: hidden; }
.acct-body dl.acct-facts > :is(dt, dd) { margin: 0; padding: 12px 16px; min-height: var(--row-h); display: flex; align-items: center; border-top: var(--hairline); font-size: var(--t-body); }
.acct-body dl.acct-facts > dt { font-weight: 400; color: var(--ink-soft); }
.acct-body dl.acct-facts > dd { font-weight: 400; justify-content: flex-end; text-align: right; }
.acct-body dl.acct-facts > :is(dt, dd):nth-child(-n + 2) { border-top: 0; }
.acct-body .box { border: var(--hairline); box-shadow: none; padding: 14px 18px; max-width: 720px; }
.acct-body .box h2 { font: 700 var(--t-body)/var(--lh-ui) var(--body); margin: 0; }
.acct-body .needs-attention:has(.placeholder-note) { gap: var(--s1); }
.acct-body .tree .acct { border: var(--hairline); box-shadow: none; }
.acct-body :is(p, .hint, span.hint, .acct-facts, .placeholder-note, .big + .hint, .empty .hint) { font-weight: 400; }
.acct-body .empty .big { font-weight: 700; }
.acct-page-head .hint { font-weight: 400; }
@media (max-width: 899px) {
  .acct-body dl.acct-facts { grid-template-columns: 1fr auto; }
  .acct-body dl.acct-facts dd { margin-bottom: 0; }
}

/* T185 (d): the sign-in pages keep their one Sivro card and one primary action (the first thing a new person sees);
   on the phone every link under the form is a 44 px target, and the small print is in the light weight */
.auth .auth-links ~ p, .auth form + p.hint, .auth .card > p.hint { font-weight: 400; }
@media (max-width: 899px) {
  .auth .link, .auth .auth-links a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ---------- T187: the invite pages (B's T183 markup; spec in docs/design/settings.md, "Invites") ---------- */
/* 1. the server's own page for a used, run-out or unknown link: no JS, only this file. The sign-in card, one sentence,
   the way to sign in. */
main.invite-gone { box-sizing: border-box; width: min(440px, calc(100% - 32px)); margin: max(48px, 18vh) auto 48px; display: grid; gap: var(--s4);
  background: var(--surface); color: var(--ink); border: var(--edge-bold); border-radius: var(--r-xl); box-shadow: var(--lift-3); padding: 28px 28px 24px; }
main.invite-gone h1 { margin: 0; font: 700 var(--t-display)/var(--lh-tight) var(--display); }
main.invite-gone p { margin: 0; color: var(--ink-soft); font-size: var(--t-body); line-height: var(--lh-body); }
main.invite-gone .btn { justify-self: start; min-height: 44px; }
main.invite-gone a { color: var(--ink); }

/* 2. the landing card: the brand at the top (a wide logo, a tall one or none), the username as one row, one action */
.card .brand-mark { flex-wrap: wrap; row-gap: var(--s2); }
.card .brand-mark .brand-logo { height: 40px; max-width: min(220px, 100%); }
.card .brand-mark .brand-name { font: 700 var(--t-title)/var(--lh-tight) var(--display); overflow-wrap: anywhere; }
.invite-card .brand-mark:has(.brand-logo) .brand-name { display: none; }   /* the heading says "Welcome to <brand>": the logo alone above it */
.invite-card .invite-user { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); min-height: var(--row-h);
  padding: 10px 14px; border: var(--hairline); border-radius: var(--r-md); background: var(--field); }
.invite-card .invite-user .hint { font-weight: 400; }
.invite-card .invite-user strong { font: 700 var(--t-body)/var(--lh-ui) var(--mono); overflow-wrap: anywhere; text-align: right; }
.invite-card > p, .invite-card > p.hint { font-weight: 400; }
.card p.invite-gone { font-weight: 400; color: var(--ink-soft); }

/* 3. the account's Team tab: the form, the link shown once, and the invites waiting as grouped rows */
.acct-body[data-tab="team"] { display: grid; gap: var(--s5); }
.acct-body[data-tab="team"] > p { margin: 0; max-width: 720px; font-weight: 400; }
.acct-body[data-tab="team"] > .box { max-width: 720px; }
.invite-form .btn.primary { justify-self: start; }
.invite-form label.field { max-width: 420px; }
/* the moment the link shows: one calm box with a coloured edge; the link, Copy, then two short lines */
.acct-body .invite-made { background: var(--surface); border: 2px solid var(--accent); }
.invite-made p { margin: 0; }
.invite-made .invite-warn { font-weight: 700; color: var(--ink); }
.invite-made .pop-buttons { display: flex; justify-content: flex-end; }
.invite-link-row { display: flex; gap: var(--s2); align-items: center; }
.invite-link-row .invite-link { flex: 1; min-width: 0; font: 400 var(--t-small)/var(--lh-ui) var(--mono); }
.invite-rows { list-style: none; margin: 0 -18px; padding: 0; }
.invite-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s3); align-items: center; min-height: var(--row-h);
  padding: 10px 18px; border-top: var(--hairline); }
.invite-row:first-child { border-top: 0; }
.invite-row .invite-who { display: flex; gap: var(--s2); align-items: center; min-width: 0; }
.invite-row .invite-who strong { overflow-wrap: anywhere; }
.invite-row .invite-when { grid-column: 1; font-weight: 400; }
.invite-row .invite-tools { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: var(--s2); }
@media (max-width: 599px) {
  .invite-row { grid-template-columns: minmax(0, 1fr); }
  .invite-row .invite-tools { grid-column: 1; grid-row: auto; flex-wrap: wrap; }
  .invite-link-row { flex-direction: column; align-items: stretch; }
}

/* ---------- T187: the composer as a bar (look only; B's JS adds .is-bar and the Minimise / Open buttons) ----------
   When the person leaves My mail with a draft open, or presses Minimise, the composer folds to a slim bar in its corner:
   the subject (or "New message"), Open and Close. One click on the bar or Open brings it back as it was. */
.compose-min, .compose-open { min-width: var(--btn-h); padding: 0; color: inherit; }
.compose-open { display: none; }
.composer.is-bar { height: auto; width: min(360px, calc(100vw - 48px)); border-width: 2px; border-radius: var(--r-lg); box-shadow: var(--lift-2); cursor: pointer; }
.composer.is-bar > :not(.compose-head) { display: none; }
.composer.is-bar .compose-head { padding: 4px 4px 4px 16px; min-height: 52px; }
.composer.is-bar .compose-head h2 { flex: 1; min-width: 0; font: 700 var(--t-body)/var(--lh-ui) var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer.is-bar .saved-note, .composer.is-bar .compose-min { display: none; }
.composer.is-bar .compose-open { display: inline-flex; }
/* Patch steps up above the bar (the full composer still hides it) */
body:has(.composer.is-bar) .patchy-launcher { display: grid; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 899px) {
  .composer.is-bar { inset: auto 8px calc(8px + env(safe-area-inset-bottom, 0px)) 8px; width: auto; height: auto; border: var(--edge); border-radius: var(--r-lg); }
  body:has(.composer.is-bar) .patchy-launcher { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- T193: under a brand (Dan's first hour) ----------
   In light, the surfaces follow the brand's page colour instead of staying Sivro's cream and tan: cards a lighter
   tint of it, the sunk parts (the mail's folder column, dividers, hovers) a slightly darker one. A brand's page colour
   is always light (the Branding page asks 7:1 with dark text), so these always read. Sivro's own look is untouched. */
:root.theme-light[data-brand]:not([data-brand="Sivro"]) {
  --paper: color-mix(in oklab, var(--cream) 30%, #FFFFFF); --cream-2: color-mix(in oklab, var(--cream) 91%, #141D33);
  --surface: var(--paper); --surface-sunk: var(--cream-2);
}
@media (prefers-color-scheme: light) {
  :root:not(.theme-dark)[data-brand]:not([data-brand="Sivro"]) {
    --paper: color-mix(in oklab, var(--cream) 30%, #FFFFFF); --cream-2: color-mix(in oklab, var(--cream) 91%, #141D33);
    --surface: var(--paper); --surface-sunk: var(--cream-2);
  }
}
/* the brand's mark in the menu: the logo above the name, so a wide logo and a two-word name both have room */
.side .brand-mark:has(.brand-logo) { flex-direction: column; align-items: flex-start; gap: 6px; }
.side .brand-mark .brand-logo { max-width: 180px; height: 32px; }

/* ---------- T189: the signed-out pages before go-live ----------
   An error line shows under the button you just pressed, so the fields and the button don't move when it appears
   (it is still first in the form for screen readers, and role=alert announces it). */
.auth form > .error { order: 1; margin: 0; }
/* the card sits near the top rather than in the middle, so a card that grows (an error line) grows downwards only */
.auth { justify-content: flex-start; padding-top: clamp(24px, 14vh, 160px); }


/* ---------- T195: box grids fit any screen (docs/design/settings.md, "Box grids") ----------
   The rule: every row of boxes spans the width. Boxes wrap by the space the grid has (not the window), and the boxes
   of a row share what is left over, so a lone box takes the row and a short last row stretches. Four boxes that would
   go 3 + 1 go 2 + 2, five that would go 4 + 1 go 3 + 2. A count tile with room lays out as a row. */
.cards { display: flex; flex-wrap: wrap; container: cards / inline-size; }
.cards > * { flex: 1 1 240px; min-width: 0; }
@container cards (min-width: 752px) and (max-width: 1007px) { .cards:has(> :nth-child(4):last-child) > * { flex-basis: 40%; } }
@container cards (min-width: 1008px) and (max-width: 1263px) { .cards:has(> :nth-child(5):last-child) > * { flex-basis: 30%; } }
/* a count tile reads as a row when it has room (title, number, its words, the button at the right) and wraps to a
   stack when it has not: plain flex-wrap, so it needs no query */
.cards:not(.server-cards) > .card-tile { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s3); row-gap: var(--s2); }
.cards:not(.server-cards) > .card-tile > h2 { flex: 0 0 auto; }
.cards:not(.server-cards) > .card-tile > p { flex: 1 1 14ch; }
.cards:not(.server-cards) > .card-tile > .btn { margin-left: auto; flex: 0 0 auto; }
/* the big-screen Home: the same rule with the panels' sizes as their shares (S 4, M 6, L 8 of 12, by the grid's width);
   with a panel kept open (two rows tall) it stays the 12-column grid and dashboard.js fills the rows (T153) */
.dash:not(:has(> .keep-open)) { display: flex; flex-wrap: wrap; align-content: flex-start; }
.dash:not(:has(> .keep-open)) > .dash-panel { flex: var(--span) 1 calc((100% + var(--s4)) * var(--span) / 12 - var(--s4) - 1px); }
.dash:not(:has(> .keep-open)) > .empty { flex: 1 1 100%; }

/* ---------- T203: one Home for every screen bigger than a phone ----------
   The panels wrap by the space the content has (the .dash container): from 900 px of content the usual shares (S 4, M 6,
   L 8 of 12; 3-4 columns on big screens); under 900 px every panel takes the row, so a tall, narrow screen stacks them in
   the person's order and uses its height. Sets --span (the flex rule above) and grid-column (a kept-open panel). */
@container dash (max-width: 899px) {
  .dash-panel, .dash-panel[data-size] { --span: 12; }
  .dash-panel[data-span] { grid-column: span 12; }
  .dash-panel { min-height: 0; }
}
/* T203: on a phone the four count tiles are one shape: the label (and its number) on the first line, the words on the second,
   the button, when there is one, at the right of the third; none of them taller than it needs */
@container cards (max-width: 599px) {
  .cards:not(.server-cards) > .card-tile > h2 { flex: 0 0 auto; }
  .cards:not(.server-cards) > .card-tile > p { flex: 1 1 100%; order: 2; }
  .cards:not(.server-cards) > .card-tile > .btn { order: 3; }
}

/* ---------- T195: table screens use the room ----------
   A page with a table (Audit, the helper's lists) reads up to about 1800 px instead of 1200: the table takes the width and
   the What column the spare room, so sentences are not cut. Under 900 px Account folds away (When, Who, What, Result stay).
   Forms and cards on the same screens keep their own widths. */
.panel-content:has(.audit-table, .ticket-list):not(:has(.acct-tabs)) { max-width: calc(1800px + 2 * var(--s6)); }
.audit-table { table-layout: auto; }
.audit-table:not(.helper-table):not(.helper-chat-people) td:nth-child(3) { overflow-wrap: break-word; width: 99%; }
.audit-table:not(.helper-table):not(.helper-chat-people) td:nth-child(1) { white-space: nowrap; }
.audit-table:not(.helper-table):not(.helper-chat-people) td:nth-child(2) { overflow-wrap: break-word; }

/* the ticket helper's runs table: the sentence column (What it did, the fifth) takes the spare room; the others stay as tight as their text */
.audit-table.helper-table td:nth-child(5) { width: 99%; overflow-wrap: break-word; }
@media (min-width: 600px) { .audit-table.helper-table td:nth-child(3), .audit-table.helper-table td:nth-child(1) { white-space: nowrap; } }

/* ---------- T195 addendum 2: the account page on a very wide screen ----------
   The text keeps its reading width (720 px boxes); from about 1,600 px of content the independent parts sit side by side:
   Team: People beside Invite someone (a new link under it), Waiting to be used under both; Summary: the facts beside
   Needs attention, the quick actions under both. Below that width nothing changes. */
.panel-content:has(.acct-tabs) { max-width: calc(1800px + 2 * var(--s6)); }
.panel-content:has(.acct-tabs) { container: acct / inline-size; }   /* the page is the container: a container cannot restyle itself */
@container acct (min-width: 1480px) {
  .acct-body[data-tab="team"], .acct-body[data-tab="summary"] { grid-template-columns: repeat(2, minmax(0, 720px)); column-gap: var(--s6); row-gap: 0; align-items: start; justify-content: start; }
  .acct-body > [hidden] { display: none !important; }
  .acct-body[data-tab="team"] > *, .acct-body[data-tab="summary"] > * { margin-block-end: var(--s4); }   /* rows that hold nothing then take no room */
  .acct-body[data-tab="team"] > p, .acct-body[data-tab="team"] > .invite-list, .acct-body[data-tab="summary"] > .quick-actions { grid-column: 1 / -1; }
  .acct-body[data-tab="team"] > p { grid-row: 1; margin: 0 0 var(--s4); }
  .acct-body[data-tab="team"] > .people-list { grid-column: 1; grid-row: 2 / span 4; align-self: start; align-content: start; height: auto; }
  .acct-body[data-tab="team"] > .invite-form, .acct-body[data-tab="team"] > .placeholder-note { grid-column: 2; grid-row: 2; }
  .acct-body[data-tab="team"] > .error { grid-column: 2; grid-row: 3; }
  .acct-body[data-tab="team"] > .invite-made { grid-column: 2; grid-row: 4; }
  .acct-body[data-tab="team"] > .invite-list { grid-row: 6; }
  .acct-body[data-tab="summary"] > .acct-facts { grid-column: 1; grid-row: 1; }
  .acct-body[data-tab="summary"] > .needs-attention { grid-column: 2; grid-row: 1; }
  .acct-body[data-tab="summary"] > .quick-actions { grid-row: 2; }
}

/* ---------- T185: B's JS hand-offs, folded in (T197) ---------- */

/* The "Saved" tick after a change saves at once: beside the switch (label left, tick, switch right), or under a field. */
.saved-tick { color: var(--ok); font-size: var(--t-small); font-weight: 700; white-space: nowrap; }
.saved-tick[hidden] { display: none; }
.tick.switch > .saved-tick { order: 1; margin-left: auto; }
.tick.radio > .saved-tick { margin-left: auto; }
label.field > .saved-tick { justify-self: start; }

/* The address panel's leak note, updated in place (hidden when there is none). */
.address-leak[hidden] { display: none; }

/* A row that opens a push-in screen (rule 1: a chevron), at the foot of a group, split by a hairline. */
.push-row { display: grid; gap: 2px; width: 100%; min-height: var(--row-h, 48px); padding: 12px 40px 12px 0; margin: 0; position: relative;
  text-align: left; background: transparent; border: 0; border-top: var(--hairline); color: var(--ink); font: inherit; cursor: pointer; }
.push-row:hover .push-title { text-decoration: underline; }
.push-row:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.push-row .push-title { font-weight: 700; }
.push-row .push-hint { font-weight: 400; color: var(--ink-muted); font-size: var(--t-small); }
.push-row::after { content: ''; position: absolute; right: 12px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted); transform: rotate(-45deg); }

/* A push-in screen's own Back: shown on the desk (Settings hides a section's Back there); on the phone the trail's
   Back is the one Back, and it goes up one step (Settings › Claude access › New access). */
@media (min-width: 900px) { .settings-host .push-in > .back { display: inline-flex; color: var(--link); font-weight: 700; } }

/* Forms outside Settings in E's parts (T185): New ticket, branding, the storage cap. Hairline groups, a small h2,
   the one sentence under the group, the actions after the groups. */
.form-groups { display: grid; gap: var(--s4); max-width: 720px; }
.form-groups > .box { border: var(--hairline); box-shadow: none; padding: 14px 18px; gap: var(--s3); }
.form-groups > .box > h2 { font: 700 var(--t-body)/var(--lh-ui) var(--body); margin: 0; }
.storage-group { display: grid; gap: var(--s2); }
.form-groups .hint, .storage-group .hint { font-weight: 400; margin: 0; }
.form-groups .form-actions { gap: var(--s2); }

/* ---------- T192: Home's What needs you uses spare height, folded in (T197) ----------
   dashboard.js reads --attention-rows from the panel: that many rows show, then "Show all (n)". It reads 5 when this
   is not set, and 10 when the panel is kept open. Steps by the window's height (a proposal: E decides the rule). */
.dash-panel[data-id="attention"] { --attention-rows: 5; }
@media (min-height: 1150px) { .dash-panel[data-id="attention"] { --attention-rows: 7; } }
@media (min-height: 1300px) { .dash-panel[data-id="attention"] { --attention-rows: 10; } }

/* .dash-item is display: grid, which would beat the hidden attribute */
.dash-item[hidden], .attention-more[hidden] { display: none; }
.dash-body > .attention-more { justify-self: start; margin: 4px 8px 0; }

/* B's T197 (press and hold to arrange Home): the look is in the movement block below */
.dash-head { -webkit-touch-callout: none; }
.custom-move { display: inline-flex; gap: 4px; }
.custom-move .btn[aria-disabled="true"] { opacity: .5; }

/* ---------- T213: Home in two columns from about 900 px of content ----------
   Pairs that belong together sit side by side (Tickets + Servers, My mail + Billing, Recent activity beside them); What needs
   you and Accounts take the row. A panel alone in its row stretches (the flex rule above), so there is no half-width orphan.
   From 1150 px of content the three- and four-column shares above apply; below 900 px one column. */
@container dash (min-width: 900px) and (max-width: 1149px) {
  .dash-panel[data-size="s"], .dash-panel[data-size="m"], .dash-panel[data-size="l"] { --span: 6; }
  .dash-panel[data-id="attention"], .dash-panel[data-id="accounts"] { --span: 12; }
}
/* What needs you's rows have the same room as every other list: a little more height for the two-line rows */
.dash-panel[data-id="attention"] .dash-item { padding-block: 9px; }

/* ---------- T213: "Quiet + Control room" (Christopher's pick; drawing: sivro-mail-loop/design/home-quiet-plus-control.html) ----------
   Colours stay tokens, so a brand carries it: the page, a panel one step lighter (no outline, no ring, radius 14), the
   brand's accent as the only bright thing. Lines only between rows. Type stays Fredoka/Nunito (no new font to load): the
   hero numbers are Fredoka 700 (Nunito has no 800 here) with tabular figures. The drag, the Customize sheet and the
   keyboard moves are untouched; the grip shows on hover and focus (always on a touch screen). */
:root { --row-line: color-mix(in oklab, var(--ink) 11%, transparent); --panel-r: 14px; --panel-lift: none; }
:root.theme-light, :root:not(.theme-dark) { --panel-lift: 0 1px 2px rgba(20, 29, 51, .07); }
@media (prefers-color-scheme: dark) { :root:not(.theme-light) { --panel-lift: none; } }
:root.theme-dark { --panel-lift: none; }
.dash-panel { border: 0; border-radius: var(--panel-r); box-shadow: var(--panel-lift); }
.dash-head { border-bottom: 0; padding: 14px 12px 2px 14px; }
.dash-title { font: 700 16px/1.25 var(--body); letter-spacing: 0; }
.dash-head .icon { color: var(--ink-muted); width: 18px; height: 18px; }
.dash-head .i-grip { opacity: .35; transition: opacity var(--mv-press); }
@media (hover: hover) { .dash-head .i-grip { opacity: 0; position: absolute; left: 0; top: 50%; translate: 0 -50%; width: 14px; } .dash-panel:hover .i-grip, .dash-head:focus-within .i-grip, .dash-panel.lifted .i-grip { opacity: .6; } }
.dash-head .dash-open { color: var(--link); font-weight: 700; }
.dash-body { padding: 4px 14px 14px; gap: 0; }
.dash-item { border-radius: 0; padding: 13px 0; font-size: var(--t-body); }
.dash-item + .dash-item { border-top: 1px solid var(--row-line); }
.dash-item:hover { background: none; }
.dash-item:hover .who { text-decoration: underline; text-underline-offset: 3px; }
.dash-item .when, .dash-item .what { font-weight: 600; font-size: var(--t-small); }
.dash-panel[data-id="attention"] .dash-item { padding-block: 13px; }
.dash-stat { display: flex; align-items: baseline; gap: var(--s2) var(--s3); flex-wrap: wrap; padding: 2px 0 8px; }
.dash-stat .big { font: 700 44px/1.05 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.dash-stat .of { font-size: var(--t-small); font-weight: 600; color: var(--ink-muted); }
.dash-foot { padding: 8px 0 0; }
.dash-body > .empty { padding: var(--s4) 0; }
.dash-panel { min-height: 0; }

.dash-search { margin: 4px 0 8px; }
.home-bar h1 { font-size: 30px; letter-spacing: -.01em; }
.home-bar { margin-block-end: var(--s2); }
/* the phone's tiles (Overview) and the other box grids: the same surface */
.card-tile { border: 0; border-radius: var(--panel-r); box-shadow: var(--panel-lift); padding: 18px 20px; }
.card-tile h2 { font: 700 16px/1.25 var(--body); }
.card-tile .big { font: 700 36px/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.card-tile p { color: var(--ink-muted); font-size: var(--t-small); }
.box { border: 0; border-radius: var(--panel-r); box-shadow: var(--panel-lift); }
/* Part 1b: the top of Home (greeting, one sentence, status strip), the row of number tiles, one accent, quiet buttons */
:root { --accent-ink: oklch(from color-mix(in oklab, var(--accent) 58%, var(--ink)) min(l, 0.5) c h);   /* a floor in light (F, addc3e1): a pale brand accent (#FFE066) still reads 4.5:1 on a card; dark: below */ --field-quiet: color-mix(in oklab, var(--ink) 7%, var(--surface)); --btn-quiet: color-mix(in oklab, var(--ink) 10%, var(--surface));
  --field-edge: color-mix(in oklab, var(--ink) 50%, var(--surface)); }   /* a field's hairline at rest: 3.6:1 on the card in light, 4:1 in dark (WCAG 1.4.11) */
@media (prefers-color-scheme: dark) { :root:not(.theme-light) { --accent-ink: var(--accent-text, var(--accent)); } }
:root.theme-dark { --accent-ink: var(--accent-text, var(--accent)); }
.panel-content:has(.home-tiles) { container: home / inline-size; }
.home-bar { align-items: flex-start; justify-content: space-between; gap: var(--s3) var(--s5); margin-block-end: var(--s4); }
.home-greet { min-width: 0; }
.home-greet h1 { margin: 0; font: 700 30px/1.15 var(--display); letter-spacing: -.01em; }
.home-sub { margin: 4px 0 0; font-size: var(--t-ui); font-weight: 600; color: var(--ink-muted); }
.home-sub:empty { display: none; }
.home-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); font-size: var(--t-small); font-weight: 600; color: var(--ink-muted); }
.status-item { display: inline-flex; align-items: center; gap: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.status-dot.warn { background: var(--highlight); } .status-dot.bad { background: var(--danger); }
.home-tiles { display: flex; flex-wrap: wrap; gap: var(--s4); margin-block-end: var(--s4); --tile-w: 100%; }
.home-tiles:empty { display: none; }
.home-tiles[data-count="5"] { --tile-n: 3; }
@container home (min-width: 560px) { .home-tiles { --tile-w: calc(50% - 8px); } }
@container home (min-width: 1000px) { .home-tiles { --tile-w: calc(25% - 12px); } .home-tiles[data-count="5"] { --tile-w: calc(33.3% - 11px); } }
.home-tile { flex: 1 1 var(--tile-w); min-width: 0; display: flex; flex-direction: column; padding: 20px 22px; border-radius: var(--panel-r); background: var(--surface); box-shadow: var(--panel-lift); color: var(--ink); text-decoration: none; }
.home-tile:hover .tile-big { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.tile-label { font-size: var(--t-small); font-weight: 600; color: var(--ink-muted); }
.tile-big { margin-top: 4px; font: 700 48px/1.1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.tile-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 30px; margin-top: 4px; }
.tile-strip .dash-spark { height: 30px; }
.tile-caption { font-size: var(--t-tiny); font-weight: 600; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.level-chip { font-size: var(--t-tiny); font-weight: 700; padding: 3px 9px; border-radius: 6px; background: color-mix(in oklab, var(--accent) 10%, var(--surface)); color: var(--accent-ink); }
/* the numbers now live in the tiles: a panel keeps its list */
.dash-panel:is([data-id="tickets"], [data-id="mail"], [data-id="accounts"], [data-id="billing"], [data-id="servers"]) .dash-stat, .dash-panel[data-id="servers"] .dash-spark { display: none; }
/* an empty panel is its title and one line ("No open tickets. New ticket") */
.dash-panel .empty { display: flex; flex-wrap: nowrap; align-items: baseline; justify-content: flex-start; gap: 2px 12px; padding: 8px 0 6px; text-align: left; }
.dash-panel .empty .big { font: 700 var(--t-body)/1.3 var(--body); color: var(--ink); }
.dash-panel .empty .hint { flex: 0 1 auto; min-width: 0; margin: 0; font-size: var(--t-small); font-weight: 600; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-panel .empty .btn, .dash-panel .empty a.btn { min-height: 0; padding: 0; background: none; box-shadow: none; border: 0; color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.dash-panel { --fg-link: var(--accent-ink); }
.dash-head .dash-open, .dash-panel .dash-foot a, .dash-item .attention-more { color: var(--accent-ink); }
/* quiet buttons and fields on Home: a filled surface, no ring */
.home-bar .btn, .dash-panel .btn:not(.primary), .home-tile .btn { border: 0; box-shadow: none; background: var(--btn-quiet); color: var(--ink); border-radius: 8px; min-height: 36px; }
.dash-panel .btn.dash-open, .dash-panel .btn.dash-menu { background: none; }
.dash-panel .btn.dash-open, .dash-panel .btn.attention-more { color: var(--accent-ink); }
.dash-panel .btn.primary { border: 0; box-shadow: none; border-radius: 8px; }
.home-bar .btn:hover, .dash-panel .btn:not(.primary):hover { background: color-mix(in oklab, var(--ink) 16%, var(--surface)); transform: none; }
.dash-panel .btn.dash-open:hover, .dash-panel .btn.dash-menu:hover { background: color-mix(in oklab, var(--ink) 9%, transparent); }
.dash-panel .input, .dash-search { background: var(--field-quiet); background-clip: padding-box; border: 2px solid transparent; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--field-edge); }
.dash-panel .input:focus-visible, .dash-search:focus-visible { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); outline: none; }
/* breadcrumbs (Addendum 4): no crumb on a top-level page; one quiet back link ("← Tickets") on a page below it. The whole
   trail stays in the nav for a screen reader (hidden by size, not display, on a desktop). */
.crumbs:not(:has(.crumbs-back)) { display: none; }
.crumbs .crumbs-trail { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 899px) { .crumbs .crumbs-trail { display: none; } }
.crumbs .crumbs-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; margin-left: -6px; border: 0; box-shadow: none; background: none;
  color: var(--ink-muted); font: 600 var(--t-small)/1 var(--body); text-decoration: none; border-radius: 8px; }
.crumbs .crumbs-back:hover, .crumbs .crumbs-back:focus-visible { color: var(--accent-ink); background: none; transform: none; }
.panel-main > .crumbs { padding-block: 6px 0; }
/* Settings on a desktop: the list is beside the section, so "← Settings" (which opens the first section again) is no step up */
@media (min-width: 900px) { .panel-main:has(.settings-page) > .crumbs:has(> .crumbs-back[href="/settings"]) { display: none; } }
/* Part 2: the same surfaces on every screen. Buttons: three ranks (main = the accent fill, plain = a quiet filled surface,
   quiet = no fill); fields: filled, no border until focus; the sign-in and invite card: the same surface with presence;
   the role badges: one family. No outlines, no offset shadows. */
.btn { border: 0; box-shadow: none; background: var(--btn-quiet); color: var(--ink); border-radius: 8px; }
.btn:hover { background: color-mix(in oklab, var(--ink) 16%, var(--surface)); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in oklab, var(--accent) 86%, var(--field)); }
.btn.danger { background: var(--danger); color: var(--on-danger); }
.btn.danger:hover { background: color-mix(in oklab, var(--danger) 88%, var(--ink)); }
.btn.quiet, .btn.quiet:hover { box-shadow: none; }
.btn.quiet { background: transparent; color: inherit; }
.btn.quiet:hover { background: color-mix(in oklab, var(--ink) 9%, transparent); color: var(--ink); }
.btn.lg, .auth form .btn.primary { border: 0; box-shadow: none; border-radius: 10px; }
/* Fields: the fill plus a 1 px hairline at rest (inside a 2 px clear edge, so focus can thicken it without moving
   anything); focus: a 3 px edge in the page's focus colour (ink, as every other focus ring; not the accent, which under Sivro's
   coral reads as "wrong"); wrong: a red edge, plus the focus ring when it has focus. The focus and wrong rules repeat the base rule's selectors so
   they weigh the same and come after it (F, dc60657: a lighter focus rule lost, and no field showed focus). */
.input, select.input, textarea.input, .field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .field textarea {
  background: var(--field-quiet); background-clip: padding-box; border: 2px solid transparent; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--field-edge); }
.input:focus-visible, select.input:focus-visible, textarea.input:focus-visible, .field input:not([type=checkbox]):not([type=radio]):not([type=range]):focus-visible,
.field select:focus-visible, .field textarea:focus-visible { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); outline: none; }
.input[aria-invalid=true], select.input[aria-invalid=true], textarea.input[aria-invalid=true], .field input:not([type=checkbox]):not([type=radio]):not([type=range])[aria-invalid=true],
.field select[aria-invalid=true], .field textarea[aria-invalid=true] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.input[aria-invalid=true]:focus-visible, .field input:not([type=checkbox]):not([type=radio]):not([type=range])[aria-invalid=true]:focus-visible,
.field select[aria-invalid=true]:focus-visible, .field textarea[aria-invalid=true]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.card { border: 0; border-radius: 18px; box-shadow: 0 1px 2px rgba(20, 29, 51, .08), 0 12px 32px rgba(20, 29, 51, .10); }
@media (prefers-color-scheme: dark) { :root:not(.theme-light) .card { box-shadow: 0 12px 32px rgba(0, 0, 0, .35); } }
:root.theme-dark .card { box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
/* the role badges: one grey family. Only .level: the ticket and service states (.state-*) keep their own colours and
   edges as before (Waiting yellow, Done green, Closed dashed, failing red; F, dc60657). */
.level { border: 0; border-radius: 6px; padding: 1px 9px; background: color-mix(in oklab, var(--ink) 11%, var(--surface)); color: var(--ink); }
.level-sivro { background: var(--ink); color: var(--surface); }
.level-admin { background: color-mix(in oklab, var(--highlight) 38%, var(--surface)); color: var(--ink); }
.level-reseller { background: var(--info-bg); color: var(--ink); }
.level-customer { background: color-mix(in oklab, var(--ink) 11%, var(--surface)); }
.side .who .level-sivro { border: 0; background: color-mix(in oklab, var(--on-side, var(--cream)) 90%, transparent); color: var(--side-bg, var(--navy)); }
/* T213 Addendum 5: one family of role colours, the same on the role badges and the Accounts tile's chips (the drawing:
   Reseller amber, Customer grey; Admin sky; Sivro the ink). Fixed hues, not the brand's accent, which stays for actions. */
.level-admin, .level-chip.lc-admin { background: var(--info-bg); color: var(--ink); }
.level-reseller, .level-chip.lc-reseller { background: color-mix(in oklab, var(--mustard) 38%, var(--surface)); color: var(--ink); }
.level-customer, .level-chip.lc-customer { background: color-mix(in oklab, var(--ink) 11%, var(--surface)); color: var(--ink); }
.level-chip.lc-sivro { background: var(--ink); color: var(--surface); }
/* each panel takes its own height (a short Tickets doesn't stretch to Servers' height); a kept-open panel's grid is left as it was */
.dash:not(:has(> .keep-open)) { align-items: flex-start; }
/* the 7-day line on the Tickets and Unread mail tiles; all zeros: flat and faint, but there */
.tile-strip .day-spark.flat polyline { opacity: .35; }
/* ---------- T213 part 2, item 1: Dan's first screens (sign-in, its code step, the invite landing) ----------
   The card wears the brand: a 4 px accent edge along its top, a soft glow of the accent behind it on the page, and the
   card's links in the accent (darkened in light, lightened in dark, as on Home). The username on an invite is a quiet
   filled row, not a field-like box. The Sivro watermark under the card stays. */
.auth { background: radial-gradient(64rem 30rem at 50% -8rem, color-mix(in oklab, var(--accent) 16%, transparent), transparent 72%) no-repeat; }
.auth > .card { box-shadow: inset 0 4px 0 var(--accent), 0 1px 2px rgba(20, 29, 51, .08), 0 12px 32px rgba(20, 29, 51, .10); }
@media (prefers-color-scheme: dark) { :root:not(.theme-light) .auth > .card { box-shadow: inset 0 4px 0 var(--accent), 0 12px 32px rgba(0, 0, 0, .35); } }
:root.theme-dark .auth > .card { box-shadow: inset 0 4px 0 var(--accent), 0 12px 32px rgba(0, 0, 0, .35); }
.auth .card .auth-links a, .auth .card .auth-links .link, .auth .card a.link { color: var(--accent-ink); }
.invite-card .invite-user { border: 0; background: var(--field-quiet); }
/* ---------- T213 part 2, item 2: the Tickets list and the Accounts list ----------
   The drawing's rule: no outlines; a list is one surface a shade lighter than the page, with hairlines between rows and
   a soft hover surface. Tickets: each day's rows are one rounded surface under its day heading. Accounts: each row its
   own borderless surface, the levels below indented with one hairline. "New ticket" (the one main button) at the end
   of the filter bar. The state and role badges keep their families (Addendum 5). */
.ticket-list { gap: 0; }
.ticket-list > .ticket-row.pick { margin: 0; border: 0; border-radius: 0; background: var(--surface); padding: 12px 16px; }
.ticket-list > .ticket-row + .ticket-row { border-top: 1px solid color-mix(in oklab, var(--ink) 9%, transparent); }
.ticket-list > .ticket-row:first-child, .ticket-list > .day-head + .ticket-row { border-top-left-radius: var(--panel-r); border-top-right-radius: var(--panel-r); }
.ticket-list > .ticket-row:last-child, .ticket-list > .ticket-row:has(+ .day-head) { border-bottom-left-radius: var(--panel-r); border-bottom-right-radius: var(--panel-r); }
.ticket-list > .ticket-row.pick:hover { background: color-mix(in oklab, var(--ink) 4%, var(--surface)); }
.ticket-list > .day-head { margin: var(--s4) 4px var(--s2); }
.ticket-list > .day-head:first-child { margin-top: 0; }
.audit-filters .new-ticket { margin-left: auto; }
.tree { gap: 6px; }
.tree .tree { border-left: 1px solid color-mix(in oklab, var(--ink) 12%, transparent); margin-top: 6px; }
:is(.panel-content, .acct-body) .tree .acct { border: 0; box-shadow: none; border-radius: 10px; background: var(--surface); }
:is(.panel-content, .acct-body) .tree .acct:hover { background: color-mix(in oklab, var(--ink) 4%, var(--surface)); }
/* ---------- T213 part 2, item 3: Settings and the account page's groups on the same surface ----------
   Groups are borderless surfaces (radius 14) on the page, rows inside them keep their hairlines; the picked section in
   Settings' list is marked as the menu marks its own: a soft surface and the accent's 3 px edge (not a sky fill). */
.settings-list { border: 0; border-radius: var(--panel-r); }
.settings-list .pick[aria-current="true"] { background: color-mix(in oklab, var(--ink) 7%, var(--surface)); box-shadow: inset 3px 0 0 var(--accent-ink); }
.settings-list .pick:hover { background: color-mix(in oklab, var(--ink) 4%, var(--surface)); }
.settings-host .box, .settings-host .panel.settings .box, .acct-body .box, .form-groups > .box { border: 0; border-radius: var(--panel-r); }
.settings-host .box .box, .acct-body .box .box { border-radius: 0; }
.acct-body dl.acct-facts { border: 0; border-radius: var(--panel-r); }
/* ---------- T213 part 2, item 4: the light pass ----------
   The account page's tabs: no boxed tab; the picked one is underlined in --accent-ink (floored in light, so a pale brand
   accent still shows), the strip's rule a hairline. On a phone the strip's fade is wide enough to read as "it scrolls"
   (B's phone walk: "am" and "A" cut at hard edges), and the first and last tab sit clear of it. */
.acct-tabs { border-bottom: 1px solid color-mix(in oklab, var(--ink) 12%, transparent); }
.acct-tab, .acct-tab[aria-selected=true] { border: 0; border-radius: 8px 8px 0 0; margin-bottom: 0; }
.acct-tab:hover { background: color-mix(in oklab, var(--ink) 5%, transparent); }
.acct-tab[aria-selected=true] { background: none; color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent-ink); }
/* T213 (the orchestrator's walk, 1:29 AM): a page's filter bar (Tickets, Audit, Servers' dates) is quiet filled controls,
   the same surface as the quiet buttons, no hairline at rest; the focus edge stays (the base field rule applies on focus).
   Form fields elsewhere keep their 1 px hairline (68162ec). */
.audit-filters :is(select, input:not([type=checkbox]):not([type=radio]), .input):not(:focus-visible):not([aria-invalid=true]) {
  background-color: var(--btn-quiet); background-clip: padding-box; border-color: transparent; box-shadow: none; }
/* the walk as Dan (2:40 AM): the Audit table (and the account page's Activity, the helper's tables) loses the old 2 px
   frame: one surface with hairlines between rows, as the lists (item 2) */
.audit-table, .table-wrap > .audit-table { border: 0; border-radius: var(--panel-r); }
@media (max-width: 899px) {
  .acct-tabs { -webkit-mask: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
    mask: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%); padding: 0 28px; scroll-padding: 0 40px; }
}
/* the menu: 216 px, 44 px rows, a soft active surface with the brand's accent edge */
@media (min-width: 900px) { .panel-shell { grid-template-columns: 216px 1fr; } .panel-shell.menu-folded { grid-template-columns: 72px 1fr; } }
.side { padding: 22px 12px 14px; gap: 2px; }
.side .nav { min-height: 44px; border-radius: 8px; padding: 0 12px; font-weight: 600; color: var(--on-side-soft, var(--cream-2)); }
.side .nav:hover { background: color-mix(in oklab, var(--on-side, var(--cream)) 9%, transparent); color: var(--on-side, var(--cream)); }
.side .nav[aria-current="true"] { background: color-mix(in oklab, var(--on-side, var(--cream)) 15%, transparent); color: var(--on-side, var(--cream)); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent-text, var(--accent)); }
.side .nav[aria-current="true"] .count { color: var(--on-side, var(--cream)); }
.side .nav-bottom { border-top: 0; padding-top: 6px; margin-top: 4px; }
.side .who { display: block; margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; font-size: var(--t-small); }
.side .who strong { font-size: var(--t-ui); color: var(--on-side, var(--cream)); }

/* ---------- T197: movement (docs/design/settings.md, "Movement"): one set of timings, one curve; only transform and opacity ---------- */
:root { --mv-press: 110ms; --mv-move: 200ms; --mv-ease: cubic-bezier(.2, .7, .3, 1); }
@keyframes mv-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes mv-toast { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes mv-side { from { opacity: 0; transform: translateX(28px); } }
@keyframes mv-fade { from { opacity: 0; } }
.btn { transition: transform var(--mv-press) var(--mv-ease), box-shadow var(--mv-press) var(--mv-ease), background-color var(--mv-press); }
.panel-content { animation: mv-in var(--mv-move) var(--mv-ease); }
.popover, .dash-pop { animation: mv-in 150ms var(--mv-ease); }
.toast { animation: mv-toast var(--mv-move) var(--mv-ease); }
.sheet-wrap { animation: mv-fade var(--mv-press) linear; }
.sheet { animation: mv-side var(--mv-move) var(--mv-ease); }
.patchy:not([hidden]) { animation: mv-in var(--mv-move) var(--mv-ease); }
.tick.switch > input::before { transition: transform var(--mv-press) var(--mv-ease); }
/* the press-and-hold drag (arrange.js slides the others): the lifted box rises and follows the pointer without easing */
.dash-panel { transition: box-shadow var(--mv-move) var(--mv-ease), scale var(--mv-move) var(--mv-ease), opacity var(--mv-move); }
.dash-panel.lifted { position: relative; scale: 1.012; opacity: 1; box-shadow: 8px 10px 0 var(--shadow); z-index: 30; transition: box-shadow var(--mv-press), scale var(--mv-press); }
html.arranging, html.arranging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
@media (prefers-reduced-motion: reduce) {
  .panel-content, .popover, .dash-pop, .toast, .sheet, .sheet-wrap, .patchy:not([hidden]) { animation: mv-fade 80ms linear !important; }
  .dash-panel.lifted { scale: none; }
}

/* ==================== folded in (T213 part 2, item 3): new-start.css (B's T211 hand-off, E's look) ==================== */
/* B's T211 hand-off: "Getting started" (the panel Home's "start" panel and the small Home's first box), the plain look
   for E to restyle (row, tick, the "You're set up." moment with one quiet movement from T197's set) and fold into
   app.css. The rows: a mark (tick, empty circle, or an arrow for an any-time step), the sentence, one button. */
.start-steps { list-style: none; margin: 0; padding: 4px 8px; display: grid; gap: 6px; }
.start-step { display: grid; grid-template-columns: 1.5em 1fr auto; align-items: center; gap: 8px; }
.start-mark { font-weight: 700; text-align: center; }
.start-step.done .start-mark { color: var(--ok, inherit); }
.start-step.done .start-text { color: var(--fg-soft); }
.start-intro, .start-done { margin: 0; padding: 6px 8px; }
.start-done { font-weight: 700; }
.start-foot { padding: 4px 8px 8px; }

/* ---------- T213 Addendum 5 (E): the drawing's Getting started ----------
   "2 of 4" with a thin accent bar; open steps first, done steps greyed below them (getting-started.js orders them);
   each step's action a quiet accent link right after its sentence, 44 px tall to tap, not a boxed button at the far edge. */
.start-progress { display: flex; align-items: center; gap: 10px; padding: 2px 8px 8px; }
.start-progress .start-bar { flex: 1; min-width: 0; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 12%, var(--surface)); overflow: hidden; }
.start-progress .start-bar::-webkit-progress-bar { background: color-mix(in oklab, var(--ink) 12%, var(--surface)); border-radius: 999px; }
.start-progress .start-bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.start-progress .start-bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.start-count { flex: none; font: 700 var(--t-small)/1 var(--body); color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.start-steps { gap: 0; }
.start-steps .start-step { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; min-height: 44px; }
.start-steps .start-step + .start-step { border-top: 1px solid color-mix(in oklab, var(--ink) 9%, transparent); }
.start-steps .start-mark { flex: 0 0 1.5em; }
.start-steps .start-text { flex: 0 1 auto; min-width: 0; }
/* B's phone walk: a long step wrapped onto a line of its own below its mark. One line per step: the words wrap beside
   the mark and the link stays right after them (on a wide screen) or at the end (when the words fill the line). */
.start-steps .start-step { flex-wrap: nowrap; }
.start-steps .start-step .btn.start-go { flex: none; }
/* an any-time step ("Open a ticket to ask for anything else"): a plain line under the list, no mark, not counted
   (the orchestrator's walk, Thu 8 AM) */
.start-anytime { margin: 4px 8px 0; font-size: var(--t-small); color: var(--ink-soft); }
.start-anytime .btn.start-go { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; border: 0; box-shadow: none; background: none;
  color: var(--accent-ink, var(--link)); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transform: none; }
.start-anytime .btn.start-go:hover { background: none; text-decoration-thickness: 2px; transform: none; }
.start-steps .start-step .btn.start-go { min-height: 44px; padding: 0 6px; border: 0; box-shadow: none; background: none; color: var(--accent-ink, var(--link));
  font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transform: none; }
.start-steps .start-step .btn.start-go:hover { background: none; text-decoration-thickness: 2px; transform: none; }
.start-steps .start-step.done .start-mark { color: var(--ok); }
.start-steps .start-step.done .start-text, .start-steps .start-step.done .btn.start-go { color: var(--ink-muted); }

/* ==================== folded in (T213 part 2, item 3): new-mailbox.css (B's T214 hand-off) ==================== */
/* B's T214 hand-off: the "Add a mailbox" form on Mail set-up, the plain look for E to restyle and fold into app.css.
   One column on a phone; the server settings (closed at first) put each port beside its server from 481 px up. */
.add-mailbox { display: grid; gap: 8px; margin-top: 10px; }
.add-mailbox h3 { margin: 0; }
.add-mailbox .password-line { display: flex; gap: 6px; align-items: center; }
.add-mailbox .password-line .input { flex: 1; min-width: 0; }
.add-mailbox .server-settings { display: grid; gap: 8px; }
.add-mailbox .server-settings summary { cursor: pointer; font-weight: 700; padding-block: 10px; min-height: 44px; box-sizing: border-box; }   /* a thumb's 44 px (T215) */
.add-mailbox .server-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 481px) { .add-mailbox .server-row { grid-template-columns: 1fr 7em; } }
.add-mailbox .field-error, .add-mailbox .add-status { margin: 0; }

/* ==================== T221 (E): the full polish pass before the freeze ==================== */
/* Slice 2, Roles: each role a borderless surface; what it may do as a plain list with a tick, two columns where there
   is room (one on a phone), not outlined pills */
.roles-list .card-tile { border: 0; box-shadow: none; border-radius: var(--panel-r); padding: 18px 20px; gap: 12px; }
.roles-list .card-tile .acct-head { display: flex; align-items: center; gap: 10px; }
.roles-list .card-tile h2 { font: 700 var(--t-body)/1.3 var(--body); }
.perm-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 28px; max-width: 920px; }
@media (min-width: 600px) { .perm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.perm-list li { position: relative; padding: 0 0 0 24px; border: 0; border-radius: 0; background: none;
  font-size: var(--t-ui); font-weight: 400; line-height: 1.4; color: var(--ink); }
.perm-list li::before { content: '✓' / ''; position: absolute; left: 2px; top: 0; color: var(--ok); font-weight: 700; }
/* Slice 3, Home's boxes: a narrow panel's empty state (Scott's Accounts and My mail at a quarter width) wraps by words:
   the sentence on its own line, then the hint and the action, the action never broken across lines. Each panel already
   takes its content's height (Addendum 5). New default widths per level are the server's (DashboardApi.cs): after
   Saturday (MESSAGES). */
@container panel (max-width: 560px) {
  .dash-panel .empty { flex-wrap: wrap; row-gap: 4px; }
  .dash-panel .empty .big { flex: 1 1 100%; }
  .dash-panel .empty .hint { flex: 0 1 auto; white-space: normal; overflow: visible; }
  .dash-panel .empty .btn, .dash-panel .empty a.btn { white-space: nowrap; }
}
/* A panel sized Small stays small: it never grows past half the row (a short panel left alone on a row, like Scott's
   Archive, was a full-width box). Medium, Large and Wide still grow to fill their row; under 900 px every panel takes
   the row, as before. */
@container dash (min-width: 900px) {
  .dash:not(:has(> .keep-open)) > .dash-panel[data-size="s"] { max-width: calc(50% - var(--s4) / 2); }
}

/* Slice 4, Branding: the form on the new surfaces and the two previews as tidy cards. The colour wells and the logo well
   take a quiet edge (a 1 px hairline that reads 3:1, like the fields) instead of the 2 px navy ring and the dashed frame;
   the file button is a quiet filled button; the previews are cards (radius 14, a hairline, no navy ring) whose rows and
   button follow today's families (filled rows, a filled button, no outlines). Save stays the one main button. */
.color-row input[type=color] { border: 0; border-radius: 8px; padding: 3px; background: var(--field-quiet); box-shadow: inset 0 0 0 1px var(--field-edge); cursor: pointer; }
.color-row input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-row input[type=color]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.color-row input[type=color]::-moz-color-swatch { border: 0; border-radius: 6px; }
.logo-preview { border: 0; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--field-edge); }
input[type=file]::file-selector-button {
  border: 0; box-shadow: none; transform: none; border-radius: 6px; background: var(--btn-quiet); color: var(--ink); font: 700 var(--t-small)/1 var(--body); padding: 8px 12px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: color-mix(in oklab, var(--ink) 16%, var(--surface)); }
.preview-wrap { gap: 10px; }
.preview-wrap .preview-label { font: 600 var(--t-tiny)/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin-top: 6px; }
.mini { border: 0; border-radius: var(--panel-r); box-shadow: 0 0 0 1px var(--row-line), 0 8px 24px rgba(20, 29, 51, .08); }
.mini-side .mini-item { border-radius: 6px; }
.mini-main .mini-row { border: 0; border-radius: 6px; box-shadow: 0 1px 2px rgba(20, 29, 51, .10); }
.mini-main .mini-btn { border: 0; border-radius: 6px; }

/* Slice 5, Settings: the section list and the rows are on the new surfaces since T213 item 3; here the read-only and
   info notes ("Viewing as …: read-only", "Signed in from …", "It's off for your branch …") become quiet lines: no box,
   no navy ring, the words in the soft ink with a small accent bar at the start. Warnings (.error, .warn-note) and the
   "passes" line (.ok-note) keep their colours: they say something is wrong or right. */
:is(.settings-page, .settings-host, .acct-body) .note:not(.ok-note):not(.billing-due):not(.billing-step):not(.archive-locked) { background: none; border: 0; border-radius: 0;
  padding: 2px 0 2px 12px; box-shadow: inset 3px 0 0 color-mix(in oklab, var(--accent-ink) 55%, transparent);
  color: var(--ink-soft); font-weight: 400; }
:is(.settings-page, .settings-host, .acct-body) .note:not(.ok-note):not(.billing-due):not(.billing-step):not(.archive-locked) .btn { margin-left: 6px; }
/* The orchestrator's look at 1568 px (Thu 12:28): the five number tiles sit in one row from 1100 px of Home (3 + 2 only
   below that, where five would be too narrow); What needs you shows 5 rows before "Show all" at every height (it showed
   7 on a tall screen; kept open, still 10). */
@container home (min-width: 1100px) { .home-tiles[data-count="5"] { --tile-w: calc(20% - 13px); } }
.dash-panel[data-id="attention"] { --attention-rows: 5; }

/* Slice 6, My mail, New addresses, Audit, Servers: the same surfaces, hairlines, badges and one accent; nothing outlined
   that isn't a text field. Write is the one main button without a ring or offset shadow; the open message's row is
   marked as the menu marks its own (a soft surface and the accent's 3 px edge) instead of a navy ring and lift; tags and
   the filter chips are filled chips (the pressed one the ink); the line between the list and the reader is a hairline;
   the folder column's current item matches Settings; a leak warning keeps its red but loses the offset shadow; the
   servers' cards are borderless surfaces like the rest. */
.side .compose, .shell.in-panel > .side .compose { border: 0; box-shadow: none; border-radius: 10px; }
.side .compose:active { transform: translateY(1px); }
.row[aria-selected="true"] { border-color: transparent; box-shadow: inset 3px 0 0 var(--accent-ink); background: var(--surface); }   /* --accent-ink: 4.5:1 on a card in light under every allowed accent (F, 61023f6) */
.row.picked { border-color: transparent; }
.tag, .row .tag { border: 0; border-radius: 6px; padding: 1px 8px; }
.chip-filter { border: 0; border-radius: 8px; background: var(--btn-quiet); }
.chip-filter:hover { background: color-mix(in oklab, var(--ink) 16%, var(--surface)); }
.chip-filter[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.search-row .pop-anchor .btn { border: 0; box-shadow: none; }
.list { border-right: 1px solid var(--row-line); }
@media (min-width: 900px) { .shell.in-panel > .side .nav[aria-current="true"] { background: color-mix(in oklab, var(--ink) 7%, var(--surface)); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent-ink); } }
.leak { border: 1px solid color-mix(in oklab, var(--danger) 45%, transparent); box-shadow: none; }
.leak-mark { border: 0; }
.cards .card-tile, .server-cards .card-tile { border: 0; box-shadow: none; border-radius: var(--panel-r); }
.install-hint { border: 0; box-shadow: none; border-radius: var(--panel-r); }
/* Slice 7, the sweep: How do I at 874 px cut its third column off at the right (the page's grid sized its column to the
   list's widest arrangement, 984 px); the column now shrinks to fit, so the list goes two across there. */
.panel-content:has(> .help-index) { grid-template-columns: minmax(0, 1fr); }
/* F on 61023f6: New addresses' review cards were still ringed with an offset shadow: borderless like the other cards */
.review-card { border: 0; box-shadow: none; border-radius: var(--panel-r); }
/* T223 E1, My mail's list and reader on the new surfaces (no motion added). What was still ringed or lifted in the
   2 px navy family now matches the rest: the sender's initial is a plain filled disc; an attachment is a filled quiet
   chip (the hover a step darker), not a ringed pill with an offset shadow; the "pictures are hidden" bar and the
   "also in" note are filled, not outlined; the unread dot is a plain dot (no outline ring); the conversation count is a
   filled pill whose hover is the accent; the Select bar is a filled strip; the message's frame takes the card radius. */
.avatar, .avatar.small { border: 0; }
.chip { border: 0; box-shadow: none; border-radius: 8px; background: var(--btn-quiet); }
.chip:hover { background: color-mix(in oklab, var(--ink) 16%, var(--surface)); }
.chip.file.theirs { background: var(--surface-sunk); }
.pictures { border: 0; border-radius: 10px; padding: 6px 6px 6px 14px; }
.also-in { border: 0; background: var(--btn-quiet); color: var(--ink-soft); }
.row .dot { box-shadow: none; background: var(--accent-ink); }   /* the floored accent (F, 7ffff93): without its ring the raw accent was 2.38:1 on its row under Sivro's coral, 1.21:1 under #FFE066 */
.row .conv, .row .conv.opens { border: 0; background: var(--btn-quiet); color: var(--ink-soft); }
.row .conv.opens:hover { background: var(--accent); color: var(--on-accent); }
.selbar { border: 0; border-radius: 10px; }
.mail-frame { border: 1px solid var(--row-line); border-radius: 10px; }
/* T225 addendum (Christopher, Thu 10:25 PM: "the pill style in general is the new in style"): buttons, filter selects,
   chips, tags, badges and the menu's items are pills, from one token a brand could turn down later. The three button
   ranks stay (main: the accent fill; plain: the quiet fill one shade above its surface; quiet: no fill, a pill-shaped
   hover); nothing is outlined but the keyboard's focus ring, which follows the pill. Text fields and textareas stay
   softly rounded rectangles (10 px): long text in a pill reads badly. Cards and panels keep their radius. Heights are
   unchanged (44 px targets on a phone). Each selector repeats the rule it replaces, so it wins by coming last. */
:root { --radius-pill: 999px; }
.btn, .btn.small, .btn.quiet, .btn.primary, .btn.danger { border-radius: var(--radius-pill); }
.home-bar .btn, .dash-panel .btn:not(.primary), .home-tile .btn, .dash-panel .btn.primary { border-radius: var(--radius-pill); }
.btn.lg, .auth form .btn.primary { border-radius: var(--radius-pill); }
.side .compose, .shell.in-panel > .side .compose { border-radius: var(--radius-pill); }
.nav, .side .nav { border-radius: var(--radius-pill); }
.chip, .chip.file, .chip-filter, .chip-addr, .tag, .row .tag, .badge, .dash-count, .level, .state, .level-chip, .seg { border-radius: var(--radius-pill); }
input[type=file]::file-selector-button, input[type=file].input::file-selector-button, .field input[type=file]::file-selector-button { border-radius: var(--radius-pill); }
.input, select.input, textarea.input, .field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .field textarea { border-radius: 10px; }
.dash-panel .input { border-radius: 10px; }
.audit-filters select, .audit-filters select.input, .audit-filters .field select, .audit-filters input:not([type=checkbox]):not([type=radio]), .audit-filters .input { border-radius: var(--radius-pill); padding-left: 16px; }
.search-row .input, .dash-panel .dash-search, .dash-search { border-radius: var(--radius-pill); padding-inline: 16px; }
/* ...but what is drawn as a link (underlined, no fill: Getting started's steps, an empty panel's action, "Back to …")
   stays a link: a small rounded focus ring around its words, not a pill hugging them. */
.dash-panel .empty .btn, .dash-panel .empty a.btn, .start-anytime .btn.start-go, .start-steps .start-step .btn.start-go, .crumbs .crumbs-back { border-radius: 6px; }
/* Found by the pill sweep, on main since T221 part 2 (E's own): the fields' rule sets the whole background, which took
   the arrow off every select (Audit's, Tickets' and Servers' filters, Settings' lists). The arrow is back, inside the
   pill's or the field's end padding. And a ticket's state badge loses its outline ring: no outlined pills. */
select.input, .field select { appearance: none; background-image: var(--select-chevron); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.level, .state { border: 0; }
/* F's low on 2f73fd9: Audit's "Words" box stayed a rectangle (the fields' own rule is more exact for a box inside
   .field); this one is more exact still, so the filter bar's boxes are all pills. And what the sweep didn't open: an
   address chip in Write, People's unread badge, a panel's count and the segmented control kept their 1.5 to 2 px
   outline: filled pills now (a bad address keeps its red fill and words). */
.audit-filters .field input:not([type=checkbox]):not([type=radio]):not([type=range]) { border-radius: var(--radius-pill); padding-left: 16px; }
.chip-addr, .chip-addr.bad, .badge, .dash-count { border: 0; }
.seg { border: 0; background: var(--btn-quiet); }
