/* Rapid Store control plane — design system (see docs/design-system.md) */

/* Tokens. The same set, the same names and the same dark values as the store admin's
   `store/static/css/dashboard.css` — the two files are one contract (docs/design-system.md), and
   a merchant crosses between them by SSO in a single click, so one of them following the device
   while the other stayed white would read as a bug in whichever they landed on second.
   `--brand-ink` vs `--brand-600` and `--danger-fg` vs `--danger` are the load-bearing splits;
   the header comment in dashboard.css says why. `control/tests/test_dark_mode.py` sweeps this
   file for a literal that escaped. */
:root {
  color-scheme: light;
  --brand-600: #4f46e5; --brand-700: #4338ca; --brand-500: #6366f1; --brand-100: #e0e7ff; --brand-50: #eef2ff;
  --brand-ink: #4f46e5; --brand-ink-hover: #4338ca;
  --on-brand: #ffffff;
  /* A data URI cannot hold a `var()`, so the select chevron is the whole URL as one token. */
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235e6d82' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --focus-ring: #e0e7ff;
  --accent-500: #0ea5e9;
  /* slate-500 (#64748b) is 4.76:1 on a white card and **4.34:1 on `--canvas`**, so every hint,
     filter label and back-link that sits outside a card — which is most of them — has been under
     AA since the admin was written. Nothing showed it: the contrast matrix in
     `docs/design-system.md` was only ever verified for storefront palettes. Darkened to clear 4.5
     against the canvas, which is the darkest ground muted text lands on. */
  --ink: #0f172a; --text: #1e293b; --text-2: #475569; --muted: #5e6d82;
  --border: #e2e8f0; --border-strong: #cbd5e1;
  --surface: #ffffff; --surface-2: #f8fafc; --canvas: #f1f5f9;
  --topbar-bg: rgb(255 255 255 / .92);
  --code-bg: #0f172a; --code-fg: #e2e8f0;
  /* The operator's rail is dark in both modes and is not the page: the same five tokens, with the
     same values, as the store admin's (`store/static/css/dashboard.css`). */
  --overlay: rgb(15 23 42 / .4);
  --rail-bg: #0f172a; --rail-ink: #cbd5e1; --rail-on-bg: #1e293b; --rail-on-ink: #ffffff; --rail-bar: #a5b4fc;
  --ok: #16a34a; --ok-bg: #dcfce7; --ok-fg: #166534; --ok-border: #bbf7d0;
  --warn: #d97706; --warn-bg: #fef3c7; --warn-fg: #92400e; --warn-border: #fde68a;
  --danger: #dc2626; --danger-bg: #fee2e2; --danger-fg: #991b1b; --danger-border: #fecaca;
  --danger-strong: #b91c1c;
  --info: #0ea5e9; --info-bg: #e0f2fe; --info-fg: #075985; --info-border: #bae6fd;
  /* A fourth status tint, distinct from warn on purpose: `trial_expired` and `provisioning` are
     two different things to be told about a store, and one amber for both loses that. */
  --alt-bg: #ffedd5; --alt-fg: #9a3412;
  --radius: 12px; --radius-sm: 8px; --radius-lg: 20px; --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .06);
  --shadow: 0 4px 16px rgb(15 23 42 / .08);
  --shadow-lg: 0 20px 50px rgb(15 23 42 / .12);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: 24px;
  --rail-w: 64px; --panel-w: 236px; --op-topbar-h: 64px;
  /* The marketing page is dark in both modes on purpose: the theme screenshots on its wall are
     the colour, and they read as a lit wall only against a dark ground. So these are the same
     values in both blocks, and every rule under `body.marketing` paints from them. */
  --mk-bg: #15111b; --mk-bg-veil: rgb(21 17 27 / .75); --mk-bg-clear: rgb(21 17 27 / 0);
  --mk-head: rgb(21 17 27 / .9); --mk-surface: #221c2b; --mk-line: #3a3046;
  --mk-ink: #f4efe7; --mk-text: #ddd4d9; --mk-text-2: #b3a8b8; --mk-lilac: #c9bcff;
  --mk-amber: #ffb45c; --mk-amber-ink: #1c1206; --mk-frame: rgb(255 255 255 / .06);
  --mk-shadow: 0 30px 60px -20px rgb(0 0 0 / .8);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2393a1b5' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --brand-600: #4f46e5; --brand-700: #4338ca; --brand-500: #818cf8;
    --brand-100: #2b2f5e; --brand-50: #1e2143;
    --brand-ink: #a5b4fc; --brand-ink-hover: #c7d2fe;
    --on-brand: #ffffff;
    --focus-ring: rgb(129 140 248 / .55);
    --accent-500: #38bdf8;
    --ink: #f1f5f9; --text: #dbe3ec; --text-2: #b3c0d1; --muted: #93a1b5;
    --border: #2f3b55; --border-strong: #465575;
    --surface: #131a2b; --surface-2: #1c2436; --canvas: #0b1120;
    --topbar-bg: rgb(11 17 32 / .92);
    --overlay: rgb(0 0 0 / .65);
    --rail-bg: #060a14; --rail-ink: #b3c0d1; --rail-on-bg: #1c2436; --rail-on-ink: #f1f5f9; --rail-bar: #a5b4fc;
    /* The provisioning log is a terminal in both modes. It used to be `background: var(--ink)`,
       which inverts: on dark that is near-white ground under the near-white `#e2e8f0` it hard-codes
       for text, i.e. the one panel an operator reads when a tenant has failed to build. */
    --code-bg: #05080f; --code-fg: #cbd5e1;
    --ok: #16a34a; --ok-bg: #062e1c; --ok-fg: #86efac; --ok-border: #166534;
    --warn: #d97706; --warn-bg: #402009; --warn-fg: #fcd34d; --warn-border: #92400e;
    --danger: #dc2626; --danger-bg: #401014; --danger-fg: #fca5a5; --danger-border: #991b1b;
    --danger-strong: #b91c1c;
    --info: #0ea5e9; --info-bg: #062c40; --info-fg: #7dd3fc; --info-border: #075985;
    --alt-bg: #40200a; --alt-fg: #fdba74;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .5);
    --shadow: 0 4px 16px rgb(0 0 0 / .55);
    --shadow-lg: 0 20px 50px rgb(0 0 0 / .65);
    /* The marketing page is dark in both modes on purpose: the theme screenshots on its wall are
       the colour, and they read as a lit wall only against a dark ground. So these are the same
       values in both blocks, and every rule under `body.marketing` paints from them. */
    --mk-bg: #15111b; --mk-bg-veil: rgb(21 17 27 / .75); --mk-bg-clear: rgb(21 17 27 / 0);
    --mk-head: rgb(21 17 27 / .9); --mk-surface: #221c2b; --mk-line: #3a3046;
    --mk-ink: #f4efe7; --mk-text: #ddd4d9; --mk-text-2: #b3a8b8; --mk-lilac: #c9bcff;
    --mk-amber: #ffb45c; --mk-amber-ink: #1c1206; --mk-frame: rgb(255 255 255 / .06);
    --mk-shadow: 0 30px 60px -20px rgb(0 0 0 / .8);
  }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--canvas); }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { color: var(--brand-ink-hover); text-decoration: underline; }
/* A link inside a sentence is underlined — the same rule `store/static/css/dashboard.css` and
   `commerce.css` keep, because the two admins are meant to read as one product. The reset above
   leaves colour as the only thing saying "link", and colour alone is not a distinction every
   reader can make. Prose only, so nav, tabs, table controls and buttons are untouched. */
:is(p, li, dd, .hint, .alert, .page-intro, .card-section-desc) a:not(.btn):not(.btn-sm):not(.link):not(.badge) {
  text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: from-font;
}
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -0.01em; margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
small, .hint { font-size: .85rem; color: var(--muted); }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
code, .mono { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 8px; top: 8px; background: var(--surface); color: var(--ink); padding: .5rem 1rem; z-index: 100; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.container { max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 30rem; margin: 0 auto; padding: 0 var(--gutter); }
/* The gutter is repeated here on purpose. `<main class="container page">` is what base_shell
   renders, and this rule's shorthand used to reset the horizontal padding `.container` had just
   set — so every app page's main element sat hard against the window edge below 72rem. Nothing
   showed it while every page put its content inside a card or a narrow container; the cookie
   notice, which is prose straight into main, is what made it visible. */
.page { padding: 2.5rem var(--gutter) 4rem; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-header h1 { margin: 0; }
/* The line under a page's title: whose shop, which address. The title's own margin is off inside
   the header, so without this the two sat on each other. */
.page-header h1 + p { margin: .35rem 0 0; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.grid-3 { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr); }
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, 1fr); }
/* A page's main column with its side column. It was `.grid-2` with `style="grid-template-columns:
   2fr 1fr"` on three screens, and an inline style beats the media query below: on a phone a
   shop's own page kept both columns and ran 133px off the screen. */
.grid-main { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 800px) { .grid-3, .grid-2, .grid-main { grid-template-columns: minmax(0, 1fr); } :root { --gutter: 16px; } }
/* A grid item's `min-width` is `auto`, i.e. its content, so a wide form or table inside one pushes
   the column past the page instead of shrinking. */
.grid > *, .grid-2 > *, .grid-3 > *, .grid-main > * { min-width: 0; }

/* ---------------------------------------------------------------- nav */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--ink); font-size: 1.1rem; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand-600), var(--accent-500)); display: inline-grid; place-items: center; color: var(--on-brand); font-weight: 800; font-size: .95rem; }
.nav { display: flex; align-items: center; gap: 1.25rem; }
.nav a { color: var(--text-2); font-weight: 500; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--brand-ink); }
.nav a.btn { color: var(--on-brand); }
.nav a.btn:hover { color: var(--on-brand); }
.nav .btn { margin-left: .25rem; }
.nav form { display: inline; }
@media (max-width: 720px) { .nav .hide-sm { display: none; } }
@media (max-width: 480px) {
  .topbar-inner { gap: .6rem; }
  .brand, .nav a, .nav button { white-space: nowrap; }
  .brand { font-size: 1rem; gap: .45rem; }
  .nav { gap: .7rem; }
  .nav .btn { padding: .45rem .65rem; margin-left: 0; }
}
/* Below this the name does not fit beside the menu; the mark stays and the link keeps its name. */
@media (max-width: 420px) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; background: var(--brand-600); color: var(--on-brand); border: 1px solid transparent; border-radius: var(--radius-sm); padding: .6rem 1rem; font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--brand-700); color: var(--on-brand); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-strong); }
.btn-lg { padding: .8rem 1.35rem; font-size: 1.05rem; border-radius: 10px; }
.btn-sm { padding: .4rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; }
button.link { background: none; border: 0; padding: 0; color: var(--text-2); font: inherit; font-weight: 500; cursor: pointer; }
button.link:hover { color: var(--ink); }

/* The language switcher (templates/partials/_language_switcher.html). A disclosure, not a select:
   an OS-drawn select ignores the page's design, and this opens with no script. */
.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; }
.lang-switch { position: relative; }
.lang-switch > summary { list-style: none; display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .5rem; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: .875rem; cursor: pointer; white-space: nowrap; }
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary:hover, .lang-switch[open] > summary { color: var(--ink); background: var(--surface-2); }
.lang-switch > summary:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.lang-menu { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 60; width: max-content; padding: .3rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.lang-switch .lang-menu { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.lang-menu button { text-align: left; background: none; border: 0; border-radius: var(--radius-sm); padding: .45rem .8rem; font: inherit; color: var(--text); cursor: pointer; }
.lang-menu button:hover { background: var(--surface-2); color: var(--ink); }
.lang-menu button:focus-visible { outline: 2px solid var(--brand-600); outline-offset: -2px; }
.lang-menu button[aria-current] { color: var(--brand-ink); font-weight: 600; }

/* ---------------------------------------------------------------- forms */
.field { margin-bottom: 1.1rem; }
.field label, .form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; color: var(--ink); }
.input, .form input:not([type=checkbox]):not([type=radio]):not([type=submit]), .form select, .form textarea,
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=tel], select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; color: var(--text); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
/* Drawn here, not by the operating system: `appearance: auto` is painted in the OS's font with
   its arrow whatever the palette says. `.form select` is named because the rule above sets
   `background` as a shorthand at that weight, which would take the chevron away again. */
select, .form select {
  appearance: none; -webkit-appearance: none; padding-right: 2.25rem;
  background-image: var(--select-chevron); background-repeat: no-repeat; background-position: right .75rem center;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--focus-ring); }
input[aria-invalid="true"], .field.has-error input { border-color: var(--danger); }
.field .hint { display: block; margin-top: .35rem; }
.field-error, .errorlist { color: var(--danger-fg); font-size: .85rem; margin: .35rem 0 0; padding: 0; list-style: none; }
.field-check { display: flex; gap: .5rem; align-items: flex-start; }
.field-check input { width: auto; margin-top: .3rem; }
.field-check label { font-weight: 500; margin: 0; }
.form-actions { display: flex; gap: .75rem; align-items: center; margin-top: 1.25rem; flex-wrap: wrap; }
/* What `static/js/turnstile.js` says when a press is held back. The script builds the element, so
   no template can be swept for this class; it has a rule in all three of this platform's
   stylesheets because the placeholder appears here, in the store admin and on the storefront. */
.turnstile-note { margin: 0 0 .6rem; font-size: .85rem; font-weight: 500; color: var(--text); }
/* Its Try again: a word in the sentence, not a second submit button beside the real one. */
.turnstile-note .turnstile-retry {
  padding: 0; border: 0; background: none; font: inherit; color: var(--brand-ink);
  text-decoration: underline; cursor: pointer;
}
.form-footer { margin-top: 1.25rem; text-align: center; font-size: .9rem; color: var(--text-2); }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
legend { font-weight: 700; color: var(--ink); margin-bottom: .75rem; font-size: 1.05rem; padding: 0; }

/* ---------------------------------------------------------------- cards / surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 1rem; }
/* `.card + .card` is the rhythm of cards in a *stack*. In a grid the `gap` is the rhythm, so the
   stack's margin must not also apply: it put every card after the first a rem lower — My stores,
   the operator's counts, capacity and backups. The store admin has had this rule since its theme
   gallery showed the same fault; `geometry.py`'s `uneven-siblings` finds a container missing
   from this list (`tests/test_layout_geometry_browser.py`). */
.grid > .card, .grid-2 > .card, .grid-3 > .card, .grid-main > .card, .op-counts > .card { margin-top: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-header h2, .card-header h3 { margin: 0; }
.card-footer { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
/* A card in parts, as the store admin's: a rule and room between one part and the next. The class
   was in six templates with no rule here, so a part's heading sat on the last line of the one
   before it. */
.card-section + .card-section { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.card-section-title { font-size: 1rem; margin: 0 0 .5rem; }
.progress { height: .6rem; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand-600); }
.progress + p { margin-top: .75rem; }
/* Words under a box need air: a note beneath a table, a second line under a badge. */
.table + p, .table-wrap + p { margin-top: .75rem; }
.badge + .muted { margin-top: .4rem; }
.card-hover { transition: box-shadow .15s, transform .15s; }
.card-hover:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.auth-card { max-width: 28rem; margin: 3rem auto; padding: 2rem; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .35rem; }
.auth-card .lead { color: var(--text-2); margin-bottom: 1.5rem; }
/* The authenticator QR code is a transparent SVG of black modules, so it vanishes on a dark card
   and a scanner needs a light quiet zone round it anyway: white in both modes, on purpose. */
.qr-code { display: block; width: 12rem; height: auto; margin: 0 auto 1.25rem; padding: .75rem; background: #fff; border-radius: var(--radius-sm); }
/* The account screens (allauth's manage layout): one card; their menu is the shell's Account
   group. A form this short reads badly stretched across a wide page. */
.account-content { max-width: 48rem; }
.account-content > h1:first-child { font-size: 1.5rem; margin-top: 0; }
.account-content > h2 { font-size: 1.15rem; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- badges, alerts */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: var(--radius-pill); font-size: .75rem; font-weight: 600; letter-spacing: .01em; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.badge-danger { background: var(--danger-bg); color: var(--danger-fg); border-color: transparent; }
.badge-info { background: var(--info-bg); color: var(--info-fg); border-color: transparent; }
.badge-brand { background: var(--brand-50); color: var(--brand-ink); border-color: transparent; }
.status-active { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }
.status-provisioning { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.status-trial_expired { background: var(--alt-bg); color: var(--alt-fg); border-color: transparent; }
.status-provisioning_failed, .status-suspended, .status-deleting { background: var(--danger-bg); color: var(--danger-fg); border-color: transparent; }
.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 1rem; font-size: .95rem; }
.alert-ok, .alert.success { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-fg); }
.alert-warn, .alert.warning { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-fg); }
.alert-danger, .alert.error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-fg); }
.alert-info, .alert.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-fg); }
.messages { list-style: none; padding: 0; margin: 0 0 1.25rem; }

/* ---------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.table td { padding: .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: var(--surface-2); }
table:not(.table) { width: 100%; border-collapse: collapse; }
table:not(.table) th, table:not(.table) td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); text-align: left; }

/* ---------------------------------------------------------------- misc components */
.steps { list-style: none; padding: 0; margin: 0; }
.step { padding: .45rem 0 .45rem 1.85rem; position: relative; color: var(--muted); }
.step::before { content: "○"; position: absolute; left: .3rem; }
.step-running { color: var(--ink); }
.step-running::before { content: "◔"; color: var(--warn); animation: spin 1.2s linear infinite; display: inline-block; }
.step-succeeded { color: var(--text-2); }
.step-succeeded::before { content: "●"; color: var(--ok); }
.step-failed { color: var(--danger-fg); }
.step-failed::before { content: "✕"; color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; background: var(--border); border-radius: var(--radius-pill); overflow: hidden; margin: 1rem 0; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--accent-500)); transition: width .4s; }
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--text-2); }
.empty .icon { font-size: 2.5rem; margin-bottom: .75rem; }
.empty h2 { margin-bottom: .35rem; }
.stat { padding: 1.25rem; }
.stat .label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.75rem; font-weight: 700; color: var(--ink); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
/* The design step of creating a shop: each card is a picture of the design itself. */
.theme-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.theme-grid .theme-option { position: relative; display: flex; flex-direction: column; padding: 0; margin: 0; border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; overflow: hidden; background: var(--surface); font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.theme-option:hover { border-color: var(--border-strong); }
.theme-option:has(input:checked) { border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-100); }
.theme-option:has(input:focus-visible) { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.theme-option input { position: absolute; opacity: 0; }
/* A generated picture of the theme's front page (720x540). The hairline under it is literal:
   the picture is a storefront in its own colours, so its edge must not take on this page's mode. */
.theme-shot { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-bottom: 1px solid rgb(0 0 0 / .08); }
.theme-body { display: block; padding: .7rem .8rem .8rem; }
/* Twelve designs one to a row is a very long page on a phone; two to a row halves it and the
   pictures are still a design you can tell from its neighbour. */
@media (max-width: 640px) {
  .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .theme-body { padding: .5rem .55rem .6rem; }
}
.theme-name { display: block; font-weight: 600; color: var(--ink); }
.theme-desc { display: block; font-size: .8rem; color: var(--muted); margin-top: .1rem; }
.footer { border-top: 1px solid var(--border); padding: 2rem 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer a { color: var(--text-2); }

/* ---------------------------------------------------------------- marketing
   templates/marketing/landing.html. Dark in both modes (see the `--mk-*` tokens), with its own
   type: Gloock for headings, Instrument Sans for text, loaded by that page alone. Every class is
   `mk-` so nothing here can restyle an app screen, and the shell's topbar and footer are re-painted
   from `body.marketing` rather than forked. */
body.marketing { background: var(--mk-bg); color: var(--mk-text); color-scheme: dark; font-family: "Instrument Sans", var(--font); font-size: 17px; line-height: 1.65; }
body.marketing h1, body.marketing h2, body.marketing h3 { font-family: "Gloock", Georgia, "Times New Roman", serif; font-weight: 400; color: var(--mk-ink); letter-spacing: 0; text-wrap: balance; margin: 0; }
body.marketing p { margin: 0; }
body.marketing a { color: var(--mk-amber); }
body.marketing a:focus-visible, body.marketing summary:focus-visible { outline: 2px solid var(--mk-amber); outline-offset: 3px; }
body.marketing .topbar { background: var(--mk-head); border-bottom-color: var(--mk-line); }
body.marketing .brand, body.marketing .brand:hover { color: var(--mk-ink); font-family: "Gloock", Georgia, serif; font-weight: 400; font-size: 1.4rem; white-space: nowrap; }
body.marketing .brand-mark { background: var(--mk-amber); color: var(--mk-amber-ink); font-weight: 400; font-size: 1.15rem; border-radius: 7px; }
body.marketing .nav { gap: .35rem; }
body.marketing .nav a { color: var(--mk-ink); padding: .45rem .7rem; border-radius: 4px; white-space: nowrap; }
body.marketing .nav a:hover { background: var(--mk-surface); color: var(--mk-ink); }
body.marketing .nav a.mk-btn { color: var(--mk-amber-ink); padding: .55rem 1rem; margin-left: .35rem; }
body.marketing .nav a.mk-btn:hover { background: var(--mk-amber); color: var(--mk-amber-ink); }
body.marketing .footer { border-top-color: var(--mk-line); color: var(--mk-text-2); }
body.marketing .footer a { color: var(--mk-text-2); }
body.marketing .footer a:hover { color: var(--mk-ink); }
body.marketing .lang-switch > summary { color: var(--mk-ink); }
body.marketing .lang-switch > summary:hover, body.marketing .lang-switch[open] > summary { background: var(--mk-surface); color: var(--mk-ink); }
body.marketing .lang-switch > summary:focus-visible, body.marketing .lang-menu button:focus-visible { outline-color: var(--mk-amber); }
body.marketing .lang-menu { background: var(--mk-surface); border-color: var(--mk-line); box-shadow: var(--mk-shadow); }
body.marketing .lang-menu button { color: var(--mk-text); }
body.marketing .lang-menu button:hover { background: var(--mk-bg); color: var(--mk-ink); }
body.marketing .lang-menu button[aria-current] { color: var(--mk-amber); }
@media (max-width: 980px) { body.marketing .nav .hide-md { display: none; } }

.mk-wrap { max-width: 76rem; margin-inline: auto; padding-inline: 24px; }
.mk-label { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--mk-lilac); font-weight: 600; }
.mk-btn { display: inline-flex; align-items: center; justify-content: center; padding: .85em 1.4em; font-weight: 600; background: var(--mk-amber); color: var(--mk-amber-ink); border: 1px solid var(--mk-amber); border-radius: 4px; white-space: nowrap; }
body.marketing a.mk-btn { color: var(--mk-amber-ink); }
body.marketing a.mk-btn:hover { text-decoration: none; filter: brightness(1.07); }
body.marketing a.mk-btn-line { background: transparent; color: var(--mk-ink); border-color: var(--mk-line); }
body.marketing a.mk-btn-line:hover { border-color: var(--mk-text-2); filter: none; }

.mk-hero { position: relative; overflow: hidden; min-height: 42rem; border-bottom: 1px solid var(--mk-line); }
.mk-wall-stage { position: absolute; inset: -14% -18% -12% 30%; perspective: 1400px; }
.mk-wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; height: 150%; transform: rotateX(22deg) rotateY(-16deg) rotateZ(8deg); transform-origin: 30% 40%; }
.mk-col { display: flex; flex-direction: column; gap: 22px; animation: mk-rise 60s linear infinite; will-change: transform; backface-visibility: hidden; }
.mk-col:nth-child(2) { animation-duration: 46s; animation-direction: reverse; }
.mk-col:nth-child(3) { animation-duration: 72s; }
.mk-col:nth-child(4) { animation-duration: 54s; animation-direction: reverse; }
/* No pause on hover: the wall is most of the first screen, so a parked pointer would hold it still and scrolling under that pointer would start and stop it at random. The Pause control is the way to stop it. */
.mk-wall-toggle { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mk-wall-toggle:checked ~ .mk-wall-stage .mk-col { animation-play-state: paused; }
.mk-wall-pause { position: absolute; right: 16px; top: 16px; z-index: 3; padding: .4em .9em; font-size: .8125rem; font-weight: 600; color: var(--mk-ink); background: var(--mk-surface); border: 1px solid var(--mk-line); border-radius: 999px; cursor: pointer; }
.mk-wall-pause:hover { border-color: var(--mk-text-2); }
.mk-wall-toggle:focus-visible + .mk-wall-pause { outline: 2px solid var(--mk-lilac); outline-offset: 2px; }
.mk-wall-pause .is-paused, .mk-wall-toggle:checked + .mk-wall-pause .is-moving { display: none; }
.mk-wall-toggle:checked + .mk-wall-pause .is-paused { display: inline; }
@keyframes mk-rise { to { transform: translateY(-50%); } }
.mk-col img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; box-shadow: var(--mk-shadow), 0 0 0 1px var(--mk-frame); }
.mk-hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, var(--mk-bg) 0%, var(--mk-bg) 34%, var(--mk-bg-veil) 52%, var(--mk-bg-clear) 78%), linear-gradient(0deg, var(--mk-bg) 0%, var(--mk-bg-clear) 22%); }
.mk-hero-copy { position: relative; z-index: 2; padding-block: 88px 104px; max-width: 37rem; display: grid; gap: 24px; }
.mk-hero h1 { font-size: clamp(3rem, 6.6vw, 5.8rem); line-height: .95; }
.mk-hero h1 em { font-style: normal; color: var(--mk-amber); }
.mk-lead { font-size: 1.2rem; color: var(--mk-text); max-width: 32rem; }
.mk-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.mk-small { font-size: .875rem; color: var(--mk-text-2); }
@media (prefers-reduced-motion: reduce) { .mk-col { animation: none; } .mk-wall-pause { display: none; } }
@media (max-width: 820px) {
  .mk-hero { min-height: 0; display: flex; flex-direction: column-reverse; }
  .mk-wall-stage { position: relative; inset: auto; height: 18rem; margin: 8px 0 0; overflow: hidden; }
  .mk-wall { height: 260%; transform: rotateX(18deg) rotateZ(6deg); }
  .mk-hero::before { background: linear-gradient(180deg, var(--mk-bg) 0%, var(--mk-bg-clear) 30%, var(--mk-bg-clear) 70%, var(--mk-bg) 100%); }
  .mk-hero-copy { padding-block: 48px 8px; }
}

.mk-section { padding-block: 104px; border-bottom: 1px solid var(--mk-line); }
.mk-h2 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); line-height: 1; margin-top: 14px; }
body.marketing .mk-h2 { margin-top: 14px; }
.mk-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; }
.mk-intro-text { margin-top: 20px; color: var(--mk-text-2); max-width: 26rem; }
body.marketing .mk-intro-text { margin-top: 20px; }
.mk-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px 64px; align-items: end; margin-bottom: 56px; }
.mk-head > p { color: var(--mk-text-2); max-width: 34rem; }
@media (max-width: 860px) { .mk-split, .mk-head { grid-template-columns: 1fr; gap: 28px; } }

.mk-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; }
.mk-steps li { counter-increment: step; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 16px; align-items: baseline; padding-block: 18px; border-top: 1px solid var(--mk-line); }
.mk-steps li::before { content: counter(step, decimal-leading-zero); font: 400 28px/1 "Gloock", Georgia, serif; color: var(--mk-lilac); }
.mk-steps b { color: var(--mk-ink); font-weight: 600; display: block; }
.mk-steps span { color: var(--mk-text-2); font-size: .95rem; }

.mk-kit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--mk-ink); }
.mk-kit > div { padding: 28px 28px 28px 0; border-bottom: 1px solid var(--mk-line); display: grid; gap: 8px; align-content: start; }
.mk-kit > div:not(:nth-child(3n + 1)) { padding-left: 28px; border-left: 1px solid var(--mk-line); }
.mk-kit h3 { font-size: 1.6rem; line-height: 1.1; }
.mk-kit p { color: var(--mk-text-2); font-size: 1rem; }
@media (max-width: 860px) {
  .mk-kit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-kit > div, .mk-kit > div:not(:nth-child(3n + 1)) { padding: 24px 20px 24px 0; border-left: 0; }
  .mk-kit > div:nth-child(2n) { padding-left: 20px; border-left: 1px solid var(--mk-line); }
}
@media (max-width: 560px) { .mk-kit { grid-template-columns: 1fr; } .mk-kit > div:nth-child(2n) { padding-left: 0; border-left: 0; } }

.mk-quote { font: 400 clamp(1.8rem, 3.6vw, 3rem)/1.12 "Gloock", Georgia, serif; color: var(--mk-ink); max-width: 22ch; }
body.marketing .mk-quote { margin-top: 18px; }
.mk-quote span { color: var(--mk-amber); }
.mk-stack { display: grid; gap: 28px; }
.mk-stack > p { color: var(--mk-text-2); }
.mk-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; }
.mk-rules div { border-top: 1px solid var(--mk-line); padding-top: 14px; }
.mk-rules b { color: var(--mk-ink); display: block; margin-bottom: 4px; }
.mk-rules p { color: var(--mk-text-2); font-size: .95rem; }
@media (max-width: 600px) { .mk-rules { grid-template-columns: 1fr; } }

.mk-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.mk-plan { background: var(--mk-surface); border: 1px solid var(--mk-line); border-radius: 10px; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; }
.mk-plan-stripe { height: 10px; background: var(--mk-line); }
.mk-plan.is-featured { border-color: var(--mk-amber); }
.mk-plan.is-featured .mk-plan-stripe { background: var(--mk-amber); }
.mk-plan-body { padding: 26px; display: grid; gap: 14px; align-content: start; }
.mk-plan-name { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; color: var(--mk-ink); font-size: 1.1rem; }
.mk-plan-name span { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mk-amber); }
.mk-price { font: 400 2.75rem/1 "Gloock", Georgia, serif; color: var(--mk-ink); font-variant-numeric: tabular-nums; }
.mk-price small { font: 400 .95rem/1 "Instrument Sans", var(--font); color: var(--mk-text-2); }
.mk-price.is-tba { font-size: 1.9rem; color: var(--mk-text-2); }
.mk-plan ul { padding-left: 1.1em; margin: 0; display: grid; gap: 7px; }
.mk-plan li::marker { color: var(--mk-lilac); }
body.marketing .mk-plan .mk-btn { margin: 0 26px 26px; }
.mk-fine { margin-top: 16px; font-size: .875rem; color: var(--mk-text-2); }
body.marketing .mk-fine { margin-top: 16px; }
.mk-plans.is-single { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
body.marketing .mk-plan-then { margin: -6px 0 0; color: var(--mk-text-2); }
@media (max-width: 860px) { .mk-plans, .mk-plans.is-single { grid-template-columns: 1fr; } }

.mk-faq details { border-top: 1px solid var(--mk-line); padding-block: 20px; }
.mk-faq summary { cursor: pointer; font: 400 1.4rem/1.3 "Gloock", Georgia, serif; color: var(--mk-ink); }
.mk-faq details p { color: var(--mk-text-2); max-width: 42rem; }
body.marketing .mk-faq details p { margin-top: 10px; }

.mk-final { border-bottom: 0; }
.mk-final .mk-wrap { display: grid; justify-items: center; text-align: center; gap: 24px; }
.mk-final h2 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: .98; max-width: 16ch; }

.pricing { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.price-card { padding: 1.75rem; display: flex; flex-direction: column; }
.price-card.featured { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.price-card .price { font-size: 2rem; font-weight: 800; color: var(--ink); margin: .5rem 0; }
.price-card .price small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.price-card ul { list-style: none; padding: 0; margin: 1rem 0 1.5rem; color: var(--text-2); font-size: .95rem; display: grid; gap: .45rem; }
.price-card li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: .5rem; }
.price-card .btn { margin-top: auto; }
@media (max-width: 800px) { .pricing { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- domains */
.domain-card h3.mono { background: none; padding: 0; font-size: 1.05rem; }
.dns-table code { white-space: nowrap; }
.checks { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .25rem; font-size: .9rem; }
.check::before { margin-right: .4rem; font-weight: 700; }
.check-ok::before { content: "✓"; color: var(--ok); }
.check-fail::before { content: "✕"; color: var(--danger); }
/* Advisory: the domain works, this is something else worth fixing (the www alias). */
.check-warn::before { content: "!"; color: var(--warn); }
.dom-active, .sub-active, .sub-trialing, .job-succeeded { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }
.dom-pending, .dom-verified, .sub-past_due, .job-running, .job-pending { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.dom-failed, .sub-canceled, .sub-paused, .job-failed { background: var(--danger-bg); color: var(--danger-fg); border-color: transparent; }
.text-danger { color: var(--danger-fg); }

/* ---------------------------------------------------------------- billing */
.price-card.current { border-color: var(--ok); }
.price-card .card-header { margin-bottom: 0; }

/* ---------------------------------------------------------------- operator */
.op-counts { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); margin-bottom: 1.25rem; }
.op-counts .stat { padding: .9rem 1rem; color: inherit; }
.op-counts .stat:hover { text-decoration: none; border-color: var(--border-strong); }
.op-counts .stat.active { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.op-counts .stat .value { font-size: 1.4rem; display: block; }
/* Stretch, not `.row`'s centre: the select and the button beside it are a few pixels apart in
   height, and centred their outlines stepped. */
.op-search { margin-bottom: 1.25rem; align-items: stretch; }
.op-search input[type=search] { flex: 1; min-width: 14rem; }
.op-search select { width: auto; }
.op-actions form { display: inline-flex; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; font-size: .9rem; max-height: 28rem; overflow: auto; }
.timeline li { display: grid; grid-template-columns: 6.5rem 1fr; gap: .5rem; align-items: baseline; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline .payload { display: block; grid-column: 2; font-size: .75rem; color: var(--text-2); white-space: pre-wrap; word-break: break-word; background: var(--surface-2); }
.job summary { cursor: pointer; padding: .4rem 0; }
.job .log { max-height: 16rem; overflow: auto; font-size: .75rem; background: var(--code-bg); color: var(--code-fg); padding: .75rem; border-radius: var(--radius-sm); }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem; }

/* ---------------------------------------------------------------- cookie notice & banner
   The same markup the store engine renders (apps/legal templates mirror store/apps/core's),
   wearing this side's tokens. Kept here rather than in a stylesheet of its own because the
   footer link is on every page and app.css is what every page already loads. */
.ck-page { max-width: 52rem; }
.ck-lead { color: var(--text-2); margin-bottom: 1.5rem; }
.legal-doc h2 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; }
.legal-doc p, .legal-doc li { line-height: 1.6; }
.legal-doc ul { padding-left: 1.25rem; }
.legal-doc table { margin-bottom: 1rem; }
.legal-nav { margin-bottom: 1rem; color: var(--text-2); }
.legal-nav a[aria-current="page"] { font-weight: 600; }
.ck-group { margin-bottom: 2rem; }
.ck-group-title { margin: 0 0 0.2rem; }
.ck-group-note { margin: 0 0 0.75rem; color: var(--text-2); font-size: 0.9rem; }
.ck-rows { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.ck-row {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) 2fr minmax(7rem, auto);
  gap: 1rem; padding: 0.75rem 1rem; border-top: 1px solid var(--border);
  font-size: 0.92rem; align-items: start;
}
.ck-row:first-child { border-top: 0; }
.ck-row-head { background: var(--surface-2); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.ck-what { display: flex; flex-direction: column; gap: 0.2rem; }
.ck-provider { color: var(--text-2); font-size: 0.85rem; }
.ck-duration { color: var(--text-2); }
.ck-badge { align-self: start; font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.45rem; border-radius: var(--radius-sm); background: var(--brand-50); color: var(--ink); }
.ck-badge-quiet { background: transparent; border: 1px solid var(--border); color: var(--muted); font-weight: 400; }
@media (max-width: 700px) {
  .ck-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .ck-row-head { display: none; }
}
.ck-choice { border-top: 1px solid var(--border); padding-top: 1.25rem; margin-top: 1rem; }
.ck-choice p { margin: 0 0 0.9rem; }
.ck-browser { margin-top: 2rem; color: var(--text-2); font-size: 0.9rem; }

/* Not a modal: it does not trap focus or cover the page, and the two buttons carry equal
   weight. Silent today — nothing on this side is gated — but styled so it is right when it
   is not. */
.ck-banner {
  position: fixed; inset: auto 0 0 0; z-index: 60;
  background: var(--surface); color: var(--text);
  border-top: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); padding: 1rem;
}
.ck-banner-inner { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.ck-banner-text { flex: 1 1 24rem; }
.ck-banner-title { margin: 0 0 0.35rem; font-size: 1.05rem; }
.ck-banner-text p { margin: 0; font-size: 0.95rem; }
.ck-banner-list { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; color: var(--text-2); }
.ck-banner-more { margin-top: 0.5rem; font-size: 0.9rem; }
.ck-banner-actions form { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------- OAuth consent (apps/oauth)
   The screen where a merchant decides what an AI agent may do to their shop. It is deliberately
   plain: an application's own name and icon are attacker-controlled strings, so nothing here
   renders a logo or styles the client's name to look endorsed. The permissions are the loudest
   thing on the page, and the ones that write are marked as such. */
.consent { max-width: 34rem; margin: 3rem auto; }
.consent-head { text-align: center; margin-bottom: 1.5rem; }
.consent-head h1 { font-size: 1.35rem; margin: 0 0 0.4rem; }
.consent-client { font-weight: 600; }
.consent-target { display: block; margin-top: 0.75rem; font-size: 0.95rem; color: var(--text-2); }
.consent-scopes { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.consent-scopes li { display: flex; gap: 0.75rem; padding: 0.8rem 1rem; border-top: 1px solid var(--border); align-items: start; }
.consent-scopes li:first-child { border-top: 0; }
.consent-scope-mark { flex: 0 0 1.25rem; line-height: 1.5; color: var(--muted); }
.consent-scope-write .consent-scope-mark { color: var(--warn, var(--text)); }
.consent-scope-text { display: flex; flex-direction: column; gap: 0.15rem; }
.consent-scope-name { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.consent-dropped { margin-top: 1rem; font-size: 0.9rem; color: var(--text-2); }
.consent-redirect { margin-top: 1.25rem; font-size: 0.85rem; color: var(--text-2); word-break: break-all; }
.consent-redirect code { font-size: 0.85rem; }
.consent-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.consent-actions form { flex: 1; }
.conn-list { display: flex; flex-direction: column; gap: 1rem; }
.conn-scopes { list-style: none; margin: 0.6rem 0 0; padding: 0; font-size: 0.9rem; color: var(--text-2); }
.conn-scopes li { padding: 0.1rem 0; }

/* Creating a shop, a step to a screen (`templates/tenants/create/`). */
.wizard { max-width: 40rem; margin: 0 auto; padding: 2rem; }
.wizard-wide { max-width: 64rem; }
.wizard-rail { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; list-style: none; margin: 0 0 1.5rem; padding: 0; font-size: .9rem; color: var(--muted); }
.wizard-rail li { display: flex; align-items: center; gap: .5rem; }
.wizard-rail .glyph { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--border-strong); font-size: .8rem; font-weight: 600; }
.wizard-rail .current { color: var(--ink); font-weight: 600; }
.wizard-rail .current .glyph { background: var(--brand-600); border-color: var(--brand-600); color: var(--on-brand); }
.wizard-rail .done .glyph { border-color: var(--brand-600); color: var(--brand-ink); }
.wizard-foot { margin: 1.5rem 0 0; }
.wizard fieldset { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.wizard legend { padding: 0; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; color: var(--ink); }
@media (max-width: 800px) { .wizard { padding: 1.25rem; } }

/* "What will you sell": each answer is a tick-box with its name and the sentence that says what
   it means, since the names alone ("Appointments", "Tables, rooms and seats") are a guess. */
.preset-grid { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
/* `.preset-grid .preset-option`, two classes: `.form label` (a class and an element) would
   otherwise make each card a bold block with its tick-box on a line of its own. */
.preset-grid .preset-option { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.7rem 0.85rem; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 400; font-size: 1rem; }
.preset-option input { width: auto; margin-top: .2rem; flex: none; }
.preset-text { display: block; min-width: 0; }
.preset-text strong { display: block; color: var(--ink); font-weight: 600; font-size: .95rem; }
.preset-blurb { display: block; font-size: .85rem; color: var(--muted); margin-top: .1rem; }
.preset-option:hover { border-color: var(--border-strong); }
.preset-option:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); }
.preset-option:has(input:focus-visible) { outline: 2px solid var(--brand-600); outline-offset: 2px; }

/* /operator/translations/ — English, the catalogue's wording, and a person's, side by side. */
.tr-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.tr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 1rem; align-items: start; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.tr-row p { margin: 0 0 .35rem; overflow-wrap: anywhere; }
.tr-row textarea { width: 100%; resize: vertical; }
.tr-corrected { border-color: var(--brand-600); }
.tr-label { display: block; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .25rem; }
.tr-stale { margin-bottom: 1.25rem; }
.tr-stale .tr-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
@media (max-width: 800px) { .tr-row, .tr-stale .tr-row { grid-template-columns: minmax(0, 1fr); } }


/* ---------------------------------------------------------------- operator shell
   A rail of three groups and a panel of their screens, the store admin's shape
   (docs/design-system.md, "Admin shell"): wide, a 64px rail and a 236px panel; under 900px the panel
   is an overlay; under 640px the rail is the bottom tab bar and the panel the bottom sheet. Drawn by
   `{% operator_shell %}`; `static/js/shell.js` builds the button that opens it. */
.table-wrap { overflow-x: auto; }
.op-shell { display: flex; min-height: 100vh; }
.op-rail {
  width: var(--rail-w); flex: none; background: var(--rail-bg);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0;
  position: sticky; top: 0; height: 100vh; z-index: 35;
}
.op-rail-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; margin-bottom: 10px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: var(--on-brand); font-weight: 700; font-size: .95rem;
  text-decoration: none; box-shadow: var(--shadow-sm);
}
.op-rail-mark:hover { color: var(--on-brand); text-decoration: none; }
.op-rail-item {
  position: relative; width: 56px; height: 54px; border-radius: 12px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--rail-ink); font-size: .625rem; font-weight: 500; line-height: 1.2; text-decoration: none; text-align: center;
}
.op-rail-item .icon { width: 20px; height: 20px; }
.op-rail-item:hover { color: var(--rail-on-ink); text-decoration: none; background: var(--rail-on-bg); }
.op-rail-item.active { background: var(--rail-on-bg); color: var(--rail-on-ink); font-weight: 600; }
.op-rail-item.active::before { content: ""; position: absolute; left: -4px; top: 15px; width: 3px; height: 24px; border-radius: 2px; background: var(--rail-bar); }
.op-rail-dot { position: absolute; top: 9px; right: 11px; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); border: 2px solid var(--rail-bg); box-sizing: content-box; }

.op-panel {
  width: var(--panel-w); flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30;
}
.op-panel-grab { display: none; }
.op-panel-brand { display: flex; align-items: center; gap: .5rem; padding: 1rem 1rem .25rem; }
.op-panel-brand a { color: var(--ink); font-weight: 700; font-size: .95rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: .5rem .75rem 1rem; }
.op-panel-title { padding: .5rem .6rem; margin: 0; font-size: .95rem; font-weight: 700; }
.op-panel-entries { display: flex; flex-direction: column; gap: 1px; }
.op-panel-entry {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 500; font-size: .925rem; text-decoration: none;
}
.op-panel-entry .icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.op-panel-entry:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.op-panel-entry.active { color: var(--brand-ink); font-weight: 600; background: var(--brand-50); }
.op-panel-entry.active .icon { color: var(--brand-ink); }
.op-panel-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* The open shop's own screens, under its name, below the group's (account pages only). */
.op-panel-sub { margin: 1rem 0 0; padding: .5rem .6rem .35rem; border-top: 1px solid var(--border); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
/* What is waiting: a small number at the right of an entry, and a dot on the rail for a group that
   is not the one you are in. Said in words for a screen reader ("Waiting: 3"). */
.op-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; margin-left: auto; border-radius: 999px; font-size: .75rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; flex: none; }
.op-count-warn { background: var(--warn-bg); color: var(--warn-fg); }
.op-count-info { background: var(--info-bg); color: var(--info-fg); }
.op-panel-foot { padding: .75rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: .25rem; }
.op-panel-link { display: flex; align-items: center; gap: .7rem; padding: .45rem .6rem; border-radius: var(--radius-sm); color: var(--text-2); font-size: .875rem; font-weight: 500; text-decoration: none; }
.op-panel-link .icon { width: 18px; height: 18px; color: var(--muted); }
.op-panel-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.avatar { width: 28px; height: 28px; border-radius: 999px; background: var(--brand-100); color: var(--brand-ink); display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex: none; }
.op-user { display: flex; align-items: center; gap: .6rem; padding: .4rem .6rem; flex-wrap: wrap; }
.op-user-who { min-width: 0; flex: 1; font-size: .8rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-user form { margin: 0; flex-basis: 100%; padding-left: calc(28px + .6rem); }
.op-user .link { color: var(--muted); font-size: .8rem; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: .8rem; }
.op-user .link:hover { color: var(--ink); text-decoration: underline; }
.op-backdrop { display: none; position: fixed; inset: 0 0 0 var(--rail-w); background: var(--overlay); z-index: 38; }

.op-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.op-topbar {
  display: flex; align-items: center; gap: 1rem; height: var(--op-topbar-h); padding: 0 var(--gutter);
  background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.op-crumb { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.op-topbar .topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.op-topbar-end { display: flex; align-items: center; }
/* Sign out for the widths where the panel (its usual home) is a drawer. */
.op-topbar-signout { display: none; margin: 0; }
.op-topbar-signout-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-2); cursor: pointer; }
.op-topbar-signout-btn:hover { color: var(--ink); background: var(--surface-2); }
.op-topbar-signout-btn:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.op-topbar .btn { margin-left: 0; }
/* Full width of whatever the rail and panel leave: the operator's tables are wide. */
.op-page { padding: var(--gutter) var(--gutter) 3rem; width: 100%; }
.op-page .page-header { margin-bottom: 1.25rem; }
/* The account pages in the shell: a shop owner's screens were drawn for a 72rem column, so they
   keep it, beside the panel rather than centred. Their legal links stay at the foot. */
.app-page { max-width: calc(72rem + 2 * var(--gutter)); }
.op-content > .app-footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: auto; padding: 1.5rem var(--gutter); }
/* Tablet and phone: where you are, and the way to the rest of the section. */
.section-picker { display: none; }

@media (max-width: 900px) {
  .op-panel {
    position: fixed; inset: 0 auto 0 var(--rail-w); height: 100vh; z-index: 40;
    transform: translateX(calc(-100% - var(--rail-w))); transition: transform .2s ease;
  }
  .op-panel.open { transform: none; box-shadow: var(--shadow-lg); }
  .op-topbar-signout { display: block; }
  .op-backdrop.open { display: block; }
  .section-picker {
    display: flex; align-items: center; gap: .5rem; width: 100%; margin: 0 0 1rem;
    padding: .6rem .9rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
    color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer;
  }
  .section-picker .icon { margin-left: auto; width: 18px; height: 18px; color: var(--muted); }
}
/* Phone: the rail is the bottom tab bar, the panel is the bottom sheet over it. */
@media (max-width: 640px) {
  .op-shell { display: block; }
  .op-rail {
    position: fixed; inset: auto 0 0 0; width: auto; height: calc(64px + env(safe-area-inset-bottom, 0px));
    flex-direction: row; justify-content: space-around; align-items: stretch; gap: 0; padding: 0 .25rem env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--rail-on-bg); z-index: 45;
  }
  .op-rail-mark { display: none; }
  .op-rail-item { flex: 1 1 0; width: auto; height: auto; min-width: 0; border-radius: 0; font-size: .6875rem; }
  .op-rail-item:hover, .op-rail-item.active { background: transparent; }
  .op-rail-item.active::before { left: 22%; right: 22%; top: 0; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .op-page { padding-bottom: calc(3rem + 72px + env(safe-area-inset-bottom, 0px)); }
  .op-page.app-page { padding-bottom: 2rem; }
  .op-content > .app-footer { padding-bottom: calc(1.5rem + 72px + env(safe-area-inset-bottom, 0px)); }
  .op-backdrop { inset: 0; z-index: 48; }
  .op-panel {
    inset: auto 0 0 0; width: auto; height: auto; max-height: 80vh; z-index: 50; border-right: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; transform: translateY(105%);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .op-panel.open { transform: none; }
  .op-panel-brand { display: none; }
  .op-panel-grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: .6rem auto .25rem; flex: none; }
  .op-panel-entry { padding: .75rem .6rem; font-size: 1rem; }
  .lang-current { display: none; }
  .op-topbar { gap: .5rem; }
}

/* A list table is a list of cards on a phone, so nothing scrolls sideways. `table_cards.js` marks
   a list `data-cards="on"` at 640px and under and copies each column's heading onto its cells as
   `data-label`; with it blocked the table scrolls inside its `.table-wrap`, as it always did. The
   header row is hidden visually rather than `display: none`, so a screen reader still hears
   columns. The same script and the same rules as the store admin's. */
@media (max-width: 640px) {
  html.js-table-cards .table-wrap:has(> .table[data-cards="on"]) { overflow: visible; }
  html.js-table-cards .table[data-cards="on"],
  html.js-table-cards .table[data-cards="on"] tbody { display: block; width: 100%; }
  html.js-table-cards .table[data-cards="on"] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html.js-table-cards .table[data-cards="on"] tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; row-gap: .45rem; padding: .9rem .25rem; border-bottom: 1px solid var(--border); }
  html.js-table-cards .table[data-cards="on"] tbody tr:hover td { background: none; }
  html.js-table-cards .table[data-cards="on"] tbody tr:last-child { border-bottom: 0; }
  html.js-table-cards .table[data-cards="on"] td { display: block; min-width: 0; padding: 0; border: 0; text-align: start; white-space: normal; overflow-wrap: anywhere; }
  html.js-table-cards .table[data-cards="on"] td:has(> .btn + .btn) { display: flex; flex-wrap: wrap; gap: .5rem; grid-column: 1 / -1; }
  html.js-table-cards .table[data-cards="on"] td[hidden] { display: none; }
  html.js-table-cards .table[data-cards="on"] td::before { content: attr(data-label); display: block; margin-bottom: .1rem; font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
  html.js-table-cards .table[data-cards="on"] td[data-card-empty],
  html.js-table-cards .table[data-cards="on"] td[data-card="hide"] { display: none; }
  html.js-table-cards .table[data-cards="on"] td:is([data-card="title"], [data-card="end"], [data-card-wide]) { grid-column: 1 / -1; }
  html.js-table-cards .table[data-cards="on"] td:is([data-card="title"], [data-card="end"], [data-card="status"], [data-card="quiet"])::before,
  html.js-table-cards .table[data-cards="on"] td:not([data-label])::before { display: none; }
  html.js-table-cards .table[data-cards="on"] td[data-card="title"] { font-weight: 600; font-size: 1rem; }
  html.js-table-cards .table[data-cards="on"] td[data-card="quiet"] { font-size: .8rem; color: var(--muted); }
  html.js-table-cards .table[data-cards="on"] td[data-card="end"] { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem .75rem; white-space: normal; }
}


/* ---------------------------------------------------------------- support requests
   One conversation (`templates/support/_thread.html`), drawn the same for the owner and the
   operator; an internal note is the warning tone so it can never be mistaken for a reply. */
.support-tabs { margin-bottom: 1rem; }
.support-form { max-width: 46rem; }
.support-kinds { display: grid; gap: .5rem; }
.form .support-kind { display: flex; gap: .65rem; align-items: flex-start; margin: 0; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-weight: 400; cursor: pointer; }
.support-kind:has(input:checked) { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.support-kind input { margin-top: .25rem; flex: none; }
.support-kind strong { display: block; color: var(--ink); }
.support-kind .hint { display: block; margin-top: .15rem; font-size: .85rem; color: var(--text-2); }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.thread-msg { padding: .85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.thread-msg.is-staff { background: var(--brand-50); border-color: var(--brand-100); }
.thread-msg.is-note { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-fg); }
.thread-msg.is-system { padding: .4rem 1rem; background: var(--surface-2); font-size: .85rem; color: var(--text-2); }
.thread-msg-head { display: flex; flex-wrap: wrap; gap: .5rem .6rem; align-items: baseline; margin-bottom: .35rem; }
.thread-msg-head time { font-size: .8rem; margin-left: auto; }
.thread-msg.is-system .thread-msg-head { margin-bottom: .1rem; }
.thread-msg-body { overflow-wrap: anywhere; }
.thread-files { list-style: none; margin: .75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.thread-files img { display: block; max-width: 10rem; max-height: 10rem; width: auto; height: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.thread-msg-error { margin: .5rem 0 0; font-size: .85rem; }
.support-context dd { overflow-wrap: anywhere; }
