/* Inter, served from this site (fonts/), as marketing.css has it: no font host sees who visits. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
	--bg: #0b0e14;
	--surface: #11151e;
	--text: #e6eaf2;
	--muted: #8a93a6;
	--accent: #3ddbff;
}

@media (prefers-color-scheme: light) {
	:root {
		--bg: #f4f6fa;
		--surface: #ffffff;
		--text: #161b26;
		--muted: #5f687a;
		--accent: #0a84c6;
	}
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.nav { padding: 16px 24px; background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a { color: var(--text); text-decoration: none; }
form.inline { display: inline; }
.brand { display: flex; }
.brand img { display: block; border-radius: 7px; }
main { max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.wide { max-width: none; padding: 0; }
.hero { padding: 96px 0; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin: 0 0 16px; }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 640px; line-height: 1.6; }
.footer { color: var(--muted); text-align: center; padding: 48px 16px; font-size: 0.85rem; }

/* Account pages: one card with a form. */
:root { --line: #232a3a; --danger: #ff6b6b; --ok: #4ade80; --warn: #f5b84b; --info: #6ea8ff; }
@media (prefers-color-scheme: light) { :root { --line: #d8dee9; --danger: #c0392b; --ok: #15803d; --warn: #a15c00; --info: #1d5fd1; } }
/* Chart series, in a fixed order (checked for colour blindness and contrast on each surface): cost, then margin. */
:root { --series-1: #3987e5; --series-2: #d95926; }
@media (prefers-color-scheme: light) { :root { --series-1: #2a78d6; --series-2: #eb6834; } }

a { color: var(--accent); }
.card { max-width: 440px; margin: 48px auto; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.card h1 { margin: 0 0 16px; font-size: 1.6rem; }
.card h2 { margin: 32px 0 8px; font-size: 1.1rem; }
.card > h2:first-child { margin-top: 0; }
.card h3 { margin: 24px 0 6px; font-size: 1rem; }
.card.wide { max-width: 760px; }
.card form { display: grid; gap: 6px; }
.card label { margin-top: 10px; font-weight: 600; font-size: 0.9rem; }
.card label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.card input:not([type="checkbox"]) { font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.card input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, .button { font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 8px; padding: 10px 18px; background: var(--button-bg, var(--accent)); color: var(--button-text, var(--bg)); text-decoration: none; display: inline-block; }
.card form button { margin-top: 18px; }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.link { background: none; padding: 0; color: var(--text); font-weight: 400; }
.button.small { padding: 6px 12px; font-size: 0.9rem; }
.hint, .aside { color: var(--muted); font-size: 0.9rem; margin: 2px 0 0; }
.aside { margin-top: 24px; }
.errors ul { margin: 0; padding: 10px 14px; list-style: none; border-radius: 8px; border: 1px solid var(--danger); color: var(--danger); }
.errors.validation-summary-valid { display: none; }
.field-error { color: var(--danger); font-size: 0.85rem; }
.notice { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--ok); color: var(--ok); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* The legal documents (/legal/...): long text, readable line length, the documents as tabs on top. */
.legal { max-width: 820px; line-height: 1.6; }
.legal h1 { font-size: 1.8rem; margin: 20px 0 8px; }
.legal h2 { margin: 32px 0 8px; font-size: 1.15rem; }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.92rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.legal-nav { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.legal-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.legal-nav a:hover { color: var(--text); background: var(--bg); }
.legal-nav a[aria-current="page"] { color: var(--text); background: var(--bg); box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 720px) { .legal table { display: block; overflow-x: auto; } }

/* Two-factor set-up. */
.steps { padding-left: 20px; display: grid; gap: 12px; }
.qr { width: 196px; margin: 10px 0 6px; padding: 8px; background: #fff; border-radius: 8px; }
.qr svg { display: block; width: 100%; height: auto; }
code.key, .codes code { font-family: Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace; }
.codes { columns: 2; padding-left: 24px; }

/* Back office: wider pages with tables. */
.page { max-width: 1100px; margin: 32px auto; }
.page h1 { margin: 16px 0 8px; font-size: 1.8rem; }
.page h2 { margin: 32px 0 10px; font-size: 1.15rem; }
/* The back office: a grouped menu on the left that stays in view, the page beside it (Pages/Staff/_StaffLayout). */
.staff-shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 36px; padding: 0 24px; align-items: start; }
.staff-main > .page { max-width: none; margin: 32px 0; }
.staff-nav { position: sticky; top: 16px; margin-top: 32px; display: grid; gap: 16px; }
.staff-nav-group { display: grid; gap: 2px; }
.staff-nav-title { margin: 0 0 4px; padding: 0 10px; color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.staff-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.staff-nav a:hover { color: var(--text); background: var(--surface); }
.staff-nav a[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 820px) {
	.staff-shell { display: block; padding: 0 16px; }
	.staff-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
	.staff-nav-group { display: contents; }
	.staff-nav-title { display: none; }
}
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 24px; }
.tile { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.tile span { color: var(--muted); font-size: 0.92rem; }
.tile:hover { border-color: var(--muted); }
.panel { margin-top: 32px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; max-width: 640px; }
.panel h2 { margin-top: 0; }
.panel.danger { border-color: var(--danger); }
.stack { display: grid; gap: 6px; max-width: 640px; }
.stack label:not(.check):not(.limit) { margin-top: 10px; font-weight: 600; font-size: 0.9rem; }
.stack button { justify-self: start; margin-top: 16px; }
input, select { font: inherit; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
/* A long option (an invoice's description) or value never makes a control wider than its column. */
input, select, textarea { max-width: 100%; min-width: 0; }
input[type="checkbox"] { padding: 0; }
input.narrow { width: 5em; padding: 4px 8px; }
label.check { display: flex; align-items: baseline; gap: 8px; font-weight: 400; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 14px 0 0; display: grid; gap: 8px; }
legend { font-weight: 600; padding: 0 6px; }
.permission { display: grid; gap: 4px; }
label.limit { display: flex; align-items: center; gap: 8px; margin-left: 26px; color: var(--muted); font-size: 0.9rem; }
label.limit input { width: 110px; padding: 5px 8px; }
.row-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin: 12px 0 16px; }
.inline-form { margin-top: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; }
table.data td.actions { text-align: right; }
table.data td.details { font-family: Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace; font-size: 0.8rem; color: var(--muted); word-break: break-all; max-width: 420px; }
.nowrap { white-space: nowrap; }
.badge { display: inline-block; padding: 2px 8px; margin: 0 4px 4px 0; border-radius: 999px; border: 1px solid var(--line); font-size: 0.8rem; }
.badge.warn { border-color: var(--danger); color: var(--danger); }
button.small { padding: 5px 10px; font-size: 0.85rem; }
.error-notice { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--danger); color: var(--danger); }
@media (max-width: 720px) { table.data { display: block; overflow-x: auto; } }

/* The download (account page): a box per platform, side by side, wrapping on a narrow screen */
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.platform { display: grid; gap: 8px; align-content: start; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.platform h3 { margin: 0; font-size: 1.1rem; }
.platform .hint { margin: 0; }
.platform .button { justify-self: start; }
.platform .label { margin: 8px 0 0; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.platforms.yours { grid-template-columns: minmax(0, 420px); }
details.other-downloads { margin-top: 16px; }
details.other-downloads > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.platform code.hash { font-family: Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace; font-size: 0.8rem; line-height: 1.5; word-break: break-all; }

/* Questions (FAQ) */
.faq pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.footer a { color: inherit; }

/* A six-digit code as six boxes (js/code-input.js). The real input lies on top, transparent, and takes every key,
   paste and autofill; the boxes show its digits. Without JavaScript the input is shown as it is. */
.code-input { position: relative; }
.code-input.enhanced { width: min(100%, 344px); }
.card .code-input.enhanced input, .code-input.enhanced input {
	position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; outline: 0;
	background: transparent; color: transparent; caret-color: transparent; font-size: 16px; /* 16px: no zoom on iPhone */
}
.code-input.enhanced input::selection { background: transparent; }
.code-boxes { display: grid; grid-template-columns: repeat(3, 1fr) 10px repeat(3, 1fr); gap: 8px; pointer-events: none; }
.code-boxes span:nth-child(4) { grid-column: 5; } /* 123 456: a little space in the middle, as the apps show it */
.code-boxes span {
	height: 54px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px;
	background: var(--bg); color: var(--text); font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.code-boxes span.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.code-boxes span.current:empty::after { content: ""; width: 2px; height: 1.4em; background: var(--text); animation: code-caret 1s steps(1) infinite; }
@keyframes code-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .code-boxes span.current:empty::after { animation: none; } }

/* Back office panels: one card per service or subject, with its state as a badge (Back office › Settings). */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-top: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* A panel's title is an h3 where the panels sit under a group's heading (Settings), an h2 elsewhere: both look the same. */
.panel > header :is(h2, h3) { margin: 0; font-size: 1.15rem; }
.panel > header :is(h2, h3) small { color: var(--muted); font-weight: 400; font-size: 0.85rem; margin-left: 6px; }
.panel .stack { max-width: none; }
.panel .facts { margin: 12px 0 0; }
/* Settings, grouped by what the settings are for: each group's heading, then its panels. auto-fill keeps a group of one
   panel at a column's width, as wide as the others, rather than stretched across the page. scroll-margin leaves a gap
   above a heading reached from the links on top. */
.settings-group { margin-top: 28px; scroll-margin-top: 16px; }
.settings-group > h2 { margin: 0; }
.settings-group > .panels { margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.badge { font-size: 0.8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.bad { color: var(--danger); border-color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions form { margin: 0; }
button.danger { color: var(--danger); border-color: var(--danger); }
/* Support tickets (/support and Back office › Tickets): the conversation, staff's notes, and what changed. */
.ticket-history { display: grid; gap: 10px; margin: 16px 0; }
.ticket-entry { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); margin: 0; }
.ticket-entry header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; color: var(--muted); font-size: 0.85rem; margin-bottom: 6px; }
.ticket-entry header span { min-width: 0; overflow-wrap: anywhere; }
.ticket-entry header time { white-space: nowrap; }
.ticket-entry p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-entry.reply { border-color: var(--accent); }
.ticket-entry.note { border-color: #d4a017; background: color-mix(in srgb, #d4a017 10%, var(--surface)); }
.ticket-entry.change { border: 0; background: none; padding: 0 14px; color: var(--muted); font-size: 0.85rem; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.ticket-side { display: grid; gap: 16px; min-width: 0; }
.ticket-side .panel, .facts dd { min-width: 0; overflow-wrap: anywhere; }
.ticket-side .panel { margin-top: 0; max-width: none; }
.ticket-facts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.composer { max-width: none; }
.overdue { color: var(--danger); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
@media (max-width: 1000px) { .ticket-layout { grid-template-columns: minmax(0, 1fr); } }

/* A customer's page and money (Back office › Customers, a ticket's side panels, Approvals). */
.customer-layout { grid-template-columns: minmax(0, 1fr) 340px; }
.customer-layout > div > section { scroll-margin-top: 16px; }
.customer-layout > div > section > h2:first-child { margin-top: 8px; }
.customer-layout > div > section + section { margin-top: 36px; }
.customer-layout section > table.data { margin-top: 8px; }
.customer-layout section > table.data + .hint { margin-top: 10px; }
.customer-layout .row-form { margin: 4px 0 12px; }
.jump-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 4px 0 20px; font-size: 0.93rem; }
.jump-links a { color: var(--muted); text-decoration: none; }
.jump-links a:hover { color: var(--text); text-decoration: underline; }
h2 .badge { vertical-align: middle; margin-left: 6px; font-size: 0.75rem; }
.heading-figure { margin-left: 8px; color: var(--muted); font-size: 0.95rem; font-weight: 400; }
/* A table cell with the row's buttons stays a cell (.actions elsewhere is a flex row). */
table.data td.actions { display: table-cell; margin: 0; white-space: nowrap; }
table.data td.actions form { display: inline-block; }
.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data th.money { text-align: right; }
.ledger .money { font-weight: 600; }
.request { margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--accent); border-radius: 10px; background: var(--surface); }
.request header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; }
.request p { margin: 8px 0 0; overflow-wrap: anywhere; }
.request .facts { margin-top: 10px; }
.request .actions { align-items: center; }
.request .row-form { margin-top: 0; }
table.data th.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.total td { font-weight: 600; }
table.data.prices td.num { white-space: nowrap; }
table.data.prices input { width: 6em; text-align: right; }
table.data.prices .cost { display: block; margin-top: 2px; font-size: 0.8rem; color: var(--muted); }
.meter-card { margin: 8px 0 24px; }
.meter { height: 10px; max-width: 560px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 8px 0; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.meter > span.tone-warn { background: var(--warn); }
.meter > span.tone-bad { background: var(--danger); }
figure.chart { margin: 8px 0 16px; }
figure.chart svg { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart text.axis { fill: var(--muted); font-size: 11px; }
.chart .cost { fill: var(--series-1); }
.chart .margin { fill: var(--series-2); }
.chart .estimate { fill: url(#estimate-hatch); }
.chart .hatch-ground { fill: color-mix(in srgb, var(--series-1) 30%, transparent); }
.chart .hatch-line { fill: var(--series-1); }
.chart .loss { stroke: var(--danger); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .column:hover path { opacity: 0.85; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 0 0 8px; font-size: 0.85rem; color: var(--muted); }
.chart .swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.chart .swatch.cost { background: var(--series-1); }
.chart .swatch.margin { background: var(--series-2); }
.chart .swatch.estimate { background: repeating-linear-gradient(45deg, var(--series-1) 0 2px, color-mix(in srgb, var(--series-1) 30%, transparent) 2px 5px); }
.report pre.report-text { max-height: 420px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 0.8rem; white-space: pre-wrap; word-break: break-word; }
.report p.multiline { white-space: pre-wrap; }
details.instructions { margin-top: 8px; }
details.instructions > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.instructions pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; font-size: 0.85rem; }
details.action-form { margin-top: 16px; }
details.action-form > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.action-form[open] > summary { margin-bottom: 4px; }
.note-form { margin-bottom: 12px; }
.note-form textarea { width: 100%; box-sizing: border-box; }
.ticket-history.notes { margin: 0; }

/* Back office, as established tools do it: the same colour for the same kind of state (Staff/StatusBadges.cs), counts
   beside the menu, one search, rows that light up, and a row's own actions in a dialog. */
.badge.tone-info { color: var(--info); border-color: color-mix(in srgb, var(--info) 55%, transparent); background: color-mix(in srgb, var(--info) 10%, transparent); }
.badge.tone-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.badge.tone-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.badge.tone-bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.badge.tone-muted { opacity: 0.75; }
.staff-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.staff-nav .count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: 0.75rem; font-weight: 700; line-height: 18px; text-align: center; }
.staff-search { position: relative; }
.staff-search input { width: 100%; padding: 7px 28px 7px 10px; font-size: 0.9rem; background: var(--surface); }
.staff-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font: 0.75rem/16px Inter, system-ui, sans-serif; pointer-events: none; }
.staff-search input:focus + kbd { display: none; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
table.data td .badge { margin: 0; }
td .ref, .ref { color: var(--muted); font-variant-numeric: tabular-nums; }
.subject-link { color: var(--text); font-weight: 600; text-decoration: none; }
.subject-link:hover { text-decoration: underline; }
dialog.form-dialog { width: calc(100% - 32px); max-width: 480px; padding: 24px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; }
dialog.form-dialog::backdrop { background: rgb(0 0 0 / 0.6); }
dialog.form-dialog h2 { margin: 0; font-size: 1.15rem; }
dialog.form-dialog .stack { max-width: none; }
dialog.form-dialog .dialog-actions { justify-content: flex-end; }
dialog.form-dialog .dialog-actions button { margin-top: 0; }
button.link.small { font-size: 0.85rem; color: var(--accent); }
/* A customer's figures at a glance, on top of their page (as Linear's and Stripe's customer pages open). */
.stats { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 8px 0 18px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.stats div { display: grid; gap: 2px; min-width: 0; }
.stats dt { color: var(--muted); font-size: 0.8rem; }
.stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ticket-entry .internal { margin: 0 0 0 6px; padding: 0 7px; font-size: 0.72rem; }
.ticket-entry header strong { color: var(--text); font-weight: 600; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; }
.label-row label { margin-top: 0 !important; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { display: grid; gap: 2px; padding-left: 14px; border-left: 2px solid var(--line); }
.timeline li a { color: var(--text); }

/* Computers signed in to the app (the account page; a customer's back office page). */
ul.computers { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
ul.computers li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
ul.computers li > div { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
ul.computers li .hint { margin: 0; }
ul.computers.compact li { padding: 10px 12px; }

/* A question before something that matters changes (wwwroot/js/confirm.js). */
dialog.confirm { width: calc(100% - 32px); max-width: 440px; padding: 24px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; }
dialog.confirm::backdrop { background: rgb(0 0 0 / 0.6); }
dialog.confirm h2 { margin: 0 0 8px; font-size: 1.15rem; }
dialog.confirm p { margin: 0; line-height: 1.5; color: var(--muted); }
dialog.confirm .actions { justify-content: flex-end; margin-top: 20px; }
dialog.confirm .changes { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 14px 0 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 0.85rem; }
dialog.confirm .changes dt { color: var(--muted); }
dialog.confirm .changes dd { margin: 0; font-family: Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace; overflow-wrap: anywhere; }
dialog.confirm .word { display: grid; gap: 6px; margin-top: 16px; font-size: 0.9rem; }
dialog.confirm .word strong { font-family: Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace; }
dialog.confirm button:disabled { opacity: 0.45; cursor: not-allowed; }
.errors-inline { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--danger); color: var(--danger); }

/* A row of choices on top and what's chosen below, as wide as the window allows (Back office › Email templates). */
.toc { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 20px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.toc a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: 0.93rem; }
.toc a:hover { background: var(--bg); }
.toc a[aria-current="page"] { background: var(--bg); box-shadow: inset 0 -2px 0 var(--accent); }
.panel.wide { max-width: none; margin-top: 16px; }
/* The editor and the preview side by side when both get an email's width (600px), one above the other otherwise. */
.editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 600px), 1fr)); gap: 24px; align-items: start; }
.editor .preview h3 { margin-top: 10px; }
textarea { font: inherit; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); resize: vertical; }
textarea.code, pre.plain { font-family: Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace; font-size: 0.85rem; line-height: 1.5; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.tokens code { font-size: 0.8rem; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; cursor: help; }
.email-preview { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 8px; background: #0b0e14; }
pre.plain { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.panel h3 { margin: 24px 0 6px; font-size: 1rem; }
.panel.attention { border-color: var(--danger); margin-top: 20px; }
.panel.attention ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.tiles.compact { margin-top: 12px; grid-template-columns: 1fr; gap: 8px; }
.tiles.compact .tile { background: var(--bg); padding: 12px 14px; }

/* The account's tabs (Pages/Shared/_AccountTabs.cshtml): one strip on top of each of its pages, the same width for all. */
.account { margin: 32px 0 48px; }
.account .card { max-width: none; margin: 16px 0; }
.account .card form > button { justify-self: start; }
/* The line under the tabs is drawn inside the strip, so the current tab's underline covers it without sticking out:
   the strip scrolls sideways on a phone, never up and down, and shows no scrollbar of its own. */
.tabs { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; box-shadow: inset 0 -1px 0 var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .count { min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: 0.75rem; font-weight: 600; text-align: center; line-height: 18px; }

/* Writing on a ticket: a roomy box, and images (Pages/Shared/_ImagePicker.cshtml, _TicketImages.cshtml). */
.ticket-form textarea, .composer textarea { width: 100%; box-sizing: border-box; min-height: 14em; line-height: 1.5; }
.ticket-form input[type="file"], .composer input[type="file"] { font: inherit; font-size: 0.9rem; }
.image-picker { display: grid; gap: 6px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; }
.image-picker.dropping { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.image-picker label { margin-top: 0; }
.image-picker .hint { margin: 0; }
.picker-error { margin: 0; color: var(--danger, #d14343); font-size: 0.9rem; }
.picked { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.picked li { display: grid; gap: 2px; justify-items: start; max-width: 140px; font-size: 0.8rem; color: var(--muted); }
.picked li span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked img { width: 140px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); }
.ticket-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ticket-images a { flex: 0 0 auto; display: block; line-height: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.ticket-images img { display: block; width: auto; height: auto; max-width: 260px; max-height: 180px; }
/* A problem report's images: thumbnails twice as sharp as shown (ReportImages.ThumbnailWidth), each opening full size. */
.report-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.report-images a { flex: 0 0 auto; display: block; line-height: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.report-images img { display: block; width: auto; height: auto; max-width: 240px; max-height: 160px; }

/* Text for screen readers only: a table's actions column has a header they can read and sighted people don't need. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* An organisation's members (/org/{slug}): forms sit inside the cells (a role, a seat, remove), in a line. */
.card table.members form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.card table.members form button { margin-top: 0; }
.card table.members select { padding: 5px 8px; font-size: 0.9rem; }
.card table.members td.actions form + form { margin-left: 6px; }
@media (max-width: 640px) {
	.card table.members, .card table.members tbody { display: block; }
	.card table.members thead { display: none; }
	.card table.members td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
	.card table.members tr { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
	.card table.members td { border: 0; padding: 2px 0; }
	.card table.members td.actions { text-align: left; white-space: normal; }
}

/* Who you invited (Account › Invitations): a table, a waiting invitation's actions side by side in its last cell. */
.card table.invited td:first-child { overflow-wrap: anywhere; }
.card table.invited td.actions { white-space: nowrap; }
.card table.invited td.actions form { display: inline-block; margin: 0 0 0 6px; }
.card table.invited td.actions form button { margin-top: 0; }
.card table.invited td .hint { margin: 0; }

/* An organisation's domains (/org/{slug}/domains): one block per domain, its record to copy. */
.card .domain { padding: 14px 0; border-bottom: 1px solid var(--line); }
.card .domain h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 8px; }
.card .domain .facts.record code { word-break: break-all; }
.card .domain .actions form { display: inline-block; }
.card .domain .actions form button { margin-top: 0; }

/* Single sign-on's settings (/org/{slug}/sso): the redirect address to copy, and the owners to choose. */
.card code.copy { display: block; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); word-break: break-all; user-select: all; }
.card fieldset.choices { border: 0; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.card fieldset.choices legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }

/* The order form (/buy/pro): the team's fields only while "A team" is chosen (no script needed). */
.order:has(#for-me:checked) .team-only { display: none; }

/* Account › Labs: the features on for them (or that joining turns on), one per line with its description. */
.labs-features { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }

/* A list of people as rows: who on the left, their status and actions on the right (Account › Invitations). */
ul.people { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
ul.people li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.people .who { display: grid; gap: 2px; min-width: 0; }
ul.people .who > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.people .actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; flex-shrink: 0; margin: 0; } /* not the site's .actions margin */
ul.people .actions form { display: block; margin: 0; }
ul.people .actions button { margin-top: 0; } /* not .card form button's */
ul.people .who .hint { margin: 0; }
ul.people .badge { margin: 0; }
button.secondary.small { padding: 5px 12px; font-size: 0.85rem; }
nav.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }

/* A campaign on the order form: the original price struck through, the new one, and what the campaign is. */
s.was { color: var(--muted); text-decoration-thickness: 2px; }
label.check .campaign { display: block; margin-left: 26px; color: var(--accent); font-size: 0.85rem; }

/* Website analytics (Back office › Website › Analytics): page views as columns, visitors as a line over them, and lists
   with each line's share of the visitors as a bar behind it. */
.chart .views { fill: var(--series-1); }
.chart polyline.visitors { fill: none; stroke: var(--series-2); stroke-width: 2; stroke-linejoin: round; }
.chart circle.visitors { fill: var(--series-2); stroke: var(--surface); stroke-width: 2; }
.chart .swatch.views { background: var(--series-1); }
.chart .swatch.visitors { background: var(--series-2); height: 3px; vertical-align: 3px; }
.filters a.current { font-weight: 600; color: var(--text); }
.filters .chip { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.85rem; }
.analytics-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 8px 28px; }
.analytics-lists section { min-width: 0; }
table.shares td.key { position: relative; overflow-wrap: anywhere; }
table.shares td.key > :not(.share) { position: relative; }
table.shares .share { position: absolute; left: 0; top: 4px; bottom: 4px; border-radius: 4px; background: color-mix(in srgb, var(--series-1) 16%, transparent); }

/* The audit log: filters in one wrapping row, a heading for each day, rows shaded alternately within a day, and an
   entry's details folded away. */
.audit-filters { display: grid; gap: 10px; margin: 8px 0 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.audit-filters .filters { margin: 0; }
.audit-filters .fields { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; }
.audit-filters label { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.audit-filters input { min-width: 0; width: 11rem; }
.audit-filters input[type="date"] { width: auto; }
.table-scroll { overflow-x: auto; }
table.data.audit tr.day th { padding-top: 18px; color: var(--text); font-size: 0.85rem; background: var(--bg); border-bottom: 1px solid var(--line); }
table.data.audit tbody tr.shade td { background: color-mix(in srgb, var(--text) 4%, transparent); }
table.data.audit td { vertical-align: top; }
table.data.audit a.action { font-size: 0.8rem; color: var(--muted); text-decoration: none; }
table.data.audit a.action:hover code { text-decoration: underline; }
.audit-details summary { cursor: pointer; font-size: 0.8rem; color: var(--muted); }
.audit-details pre { margin: 6px 0 0; padding: 8px 10px; max-width: 560px; overflow-x: auto; font-size: 0.78rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.pager { display: flex; gap: 16px; margin: 16px 0; }

/* Back office › Website › Map: countries shaded by their computers, in one hue rising evenly in lightness (measured in
   OKLab, its own steps on each theme; --map-0 is land without computers), the smallest countries as dots, and a pulse
   where a computer comes online. The wall screen is dark whatever the system's setting: it hangs in a room. */
:root { --map-0: #1b2130; --map-1: #173a66; --map-2: #1d5296; --map-3: #2f6ec4; --map-4: #4c8ff0; --map-5: #9cc8ff; }
@media (prefers-color-scheme: light) {
	:root { --map-0: #dde3ec; --map-1: #a9cbf3; --map-2: #78aeeb; --map-3: #4f95e2; --map-4: #2a78d6; --map-5: #1b559c; }
	:root.wall {
		color-scheme: dark;
		--bg: #0b0e14; --surface: #11151e; --text: #e6eaf2; --muted: #8a93a6; --accent: #3ddbff;
		--line: #232a3a; --danger: #ff6b6b; --ok: #4ade80; --warn: #f5b84b; --info: #6ea8ff;
		--map-0: #1b2130; --map-1: #173a66; --map-2: #1d5296; --map-3: #2f6ec4; --map-4: #4c8ff0; --map-5: #9cc8ff;
	}
}
.map-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; }
.button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
figure.world { margin: 8px 0 16px; }
.world-key { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.world .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; padding: 0; margin: 0; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.world .swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.world-zoom { display: flex; gap: 6px; }
.world-map { display: block; width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: grab; user-select: none; }
.world-map.dragging { cursor: grabbing; }
.world-map .countries path { stroke: var(--surface); stroke-width: 0.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.world-map .dots circle { stroke: var(--surface); stroke-width: 0.8; vector-effect: non-scaling-stroke; }
.world-map .countries path:hover, .world-map .dots circle:hover { stroke: var(--text); stroke-width: 1.2; }
.world-map .dots .s0 { display: none; }
/* Cities with 3 or more computers: dots of the second series colour over the shaded countries, sized by their count. */
.world-map .cities circle { fill: color-mix(in srgb, var(--series-2) 85%, transparent); stroke: var(--surface); stroke-width: 1; vector-effect: non-scaling-stroke; }
.world-map .cities circle:hover { stroke: var(--text); stroke-width: 1.5; }
.world .swatch.city { background: var(--series-2); border-radius: 50%; }
.wall .world-map .cities circle { stroke: var(--bg); }
.world .s0 { fill: var(--map-0); background: var(--map-0); }
.world .s1 { fill: var(--map-1); background: var(--map-1); }
.world .s2 { fill: var(--map-2); background: var(--map-2); }
.world .s3 { fill: var(--map-3); background: var(--map-3); }
.world .s4 { fill: var(--map-4); background: var(--map-4); }
.world .s5 { fill: var(--map-5); background: var(--map-5); }
.world-map .pulse { fill: color-mix(in srgb, var(--text) 16%, transparent); stroke: var(--text); stroke-width: 2.5; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; animation: world-pulse 2.4s ease-out forwards; pointer-events: none; }
@keyframes world-pulse { from { transform: scale(0.15); opacity: 1; } to { transform: scale(1); opacity: 0; } }
@keyframes world-fade { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .world-map .pulse { animation-name: world-fade; } }

/* The wall screen: the numbers along the top, the map filling the rest, plans and versions at the foot. */
html.wall, body.wall { height: 100%; }
body.wall { display: flex; flex-direction: column; overflow: hidden; }
.wall-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 48px; padding: 20px 32px 4px; }
.wall-title { display: flex; align-items: center; gap: 14px; margin-right: auto; }
.wall-title img { display: block; border-radius: 8px; }
.wall-title h1 { margin: 0; font-size: 1.5rem; }
.wall-title [data-updated].stale { color: var(--warn); }
.wall-stats { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 0; }
.wall-stats div { display: grid; gap: 2px; }
.wall-stats dt { color: var(--muted); font-size: 0.95rem; }
.wall-stats dd { margin: 0; font-size: clamp(1.8rem, 3.2vw, 3.2rem); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
:fullscreen .wall-fullscreen { display: none; }
.wall .world { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0; padding: 4px 24px 0; }
.wall .world-key { order: 2; justify-content: flex-end; margin: 6px 8px 0; }
.wall .world-map { flex: 1; min-height: 0; height: 100%; background: transparent; border: 0; border-radius: 0; cursor: default; }
.wall .world-map .countries path, .wall .world-map .dots circle { stroke: var(--bg); }
.wall-foot { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 8px 32px 18px; color: var(--muted); }
.wall-foot-title { margin-right: 4px; }
.wall-foot .chip { display: inline-block; padding: 3px 10px; margin: 2px 4px 2px 0; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 0.9rem; }
.wall-foot .chip b { margin-left: 4px; font-variant-numeric: tabular-nums; }

/* The back office's look (owner, 21 Oct 2026: the pages ran together and the colours were too sharp). Softer contrast
   than the website, a calm blue for actions instead of the brand's bright cyan, Inter at a working size, and every
   table, section and list a card of its own with its title on top. Only back office pages: _StaffLayout sets
   "BackOffice" and _Layout puts the class on <html>. */
:root.back-office {
	--bg: #101319; --surface: #161a22; --surface-2: #1c212b; --line: #282e3a; --line-soft: #1f242e;
	--text: #d3d8e1; --strong: #eef0f4; --muted: #8b93a2; --accent: #7aa7f5;
	--button-bg: #3a6bd1; --button-text: #ffffff;
	--ok: #5cc48a; --warn: #dcb25e; --danger: #ec7b7b; --info: #7aa7f5;
	--shadow: 0 1px 2px rgb(0 0 0 / 0.3);
	font-size: 15px;
}
@media (prefers-color-scheme: light) {
	:root.back-office {
		--bg: #f3f4f7; --surface: #ffffff; --surface-2: #f7f8fa; --line: #dfe3e9; --line-soft: #eceef2;
		--text: #2b313c; --strong: #121620; --muted: #687182; --accent: #2d5fc2;
		--button-bg: #2f62cc; --button-text: #ffffff;
		--ok: #1d8049; --warn: #94600a; --danger: #bf3b3b; --info: #2d5fc2;
		--shadow: 0 1px 2px rgb(16 24 40 / 0.06);
	}
}
.back-office body { line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
.back-office .nav { padding: 12px 24px; border-bottom: 1px solid var(--line); }
.back-office .nav-links a { color: var(--text); }
.back-office .footer { padding: 32px 16px; }

/* Words: headings in the strongest ink, explanations muted and kept to a readable width, links without underlines
   until pointed at. */
.back-office .page h1 { margin: 8px 0 6px; font-size: 1.6rem; font-weight: 650; letter-spacing: -0.01em; color: var(--strong); }
.back-office .page h2 { font-size: 1.07rem; font-weight: 600; color: var(--strong); }
.back-office .page h3 { font-size: 0.95rem; font-weight: 600; color: var(--strong); }
.back-office .lead { font-size: 0.98rem; line-height: 1.55; max-width: 76ch; margin: 0 0 4px; }
.back-office .hint { line-height: 1.5; }
.back-office p.hint, .back-office .aside { max-width: 90ch; }
/* :where keeps these as weak as a plain "a", so buttons, tabs and lists styled as such keep their own look. */
:where(.back-office .staff-main) a:where(:not(.button, .badge)) { text-decoration: none; }
:where(.back-office .staff-main) a:where(:not(.button, .badge)):hover { text-decoration: underline; }
.back-office code { font-size: 0.88em; }

/* The menu: the pages in ordinary ink, the group titles quieter, the current page marked. */
.back-office .staff-shell { gap: 32px; }
.back-office .staff-nav { gap: 20px; margin-top: 24px; }
.back-office .staff-nav-title { margin-bottom: 2px; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.back-office .staff-nav a { color: var(--text); padding: 5px 10px; font-size: 0.93rem; }
.back-office .staff-nav a:hover { background: var(--surface-2); color: var(--strong); }
.back-office .staff-nav a[aria-current="page"] { background: var(--surface); color: var(--strong); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent), 0 0 0 1px var(--line); }
.back-office .staff-nav .count { background: var(--button-bg); color: var(--button-text); }
.back-office .staff-main > .page { margin: 24px 0 32px; }

/* Controls: one height for buttons and fields, the main action filled, the others outlined. */
.back-office :where(button:not(.link), .button) { padding: 7px 14px; font-size: 0.9rem; border-radius: 8px; box-shadow: var(--shadow); }
.back-office button:not(.link):hover, .back-office .button:hover { filter: brightness(1.08); text-decoration: none; }
.back-office button.secondary, .back-office .button.secondary { background: var(--surface); color: var(--strong); border: 1px solid var(--line); }
.back-office button.secondary:hover, .back-office .button.secondary:hover { background: var(--surface-2); filter: none; }
.back-office button.danger { background: var(--surface); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 50%, var(--line)); }
.back-office button.small, .back-office .button.small { padding: 4px 10px; font-size: 0.84rem; }
.back-office button.link { box-shadow: none; }
.back-office :where(input:not([type="checkbox"], [type="radio"]), select, textarea) { padding: 7px 10px; font-size: 0.93rem; border-color: var(--line); color: var(--strong); }
.back-office input:focus-visible, .back-office select:focus-visible, .back-office textarea:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 1px; }
.back-office .stack > input:not([type="checkbox"]), .back-office .stack > select { max-width: 420px; }
.back-office .stack label:not(.check):not(.limit) { color: var(--strong); font-weight: 600; font-size: 0.88rem; }
.back-office details > summary { color: var(--accent); }

/* State: small rounded labels, each tone on a faint wash of its colour. */
.back-office :where(.badge) { padding: 2px 8px; border-radius: 6px; font-size: 0.76rem; font-weight: 600; color: var(--text); background: var(--surface-2); border-color: var(--line); }
.back-office .badge.tone-muted { opacity: 1; color: var(--muted); }
.back-office .notice { color: var(--strong); background: color-mix(in srgb, var(--ok) 9%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.back-office .errors-inline, .back-office .error-notice { color: var(--strong); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.back-office .errors ul { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }

/* Tables: a card of their own, the column names on a darker band, rows parted by a faint line. */
.back-office table.data { border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); font-size: 0.92rem; }
.back-office table.data th { padding: 8px 12px; background: var(--surface-2); color: var(--muted); font-size: 0.8rem; font-weight: 600; border-bottom: 1px solid var(--line); }
.back-office table.data thead th:first-child { border-top-left-radius: 10px; }
.back-office table.data thead th:last-child { border-top-right-radius: 10px; }
/* A long address or reference wraps inside its cell rather than pushing the table past the page. */
.back-office table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.back-office table.data tbody tr:last-child td { border-bottom: 0; }
.back-office table.data tbody tr:last-child td:first-child { border-bottom-left-radius: 10px; }
.back-office table.data tbody tr:last-child td:last-child { border-bottom-right-radius: 10px; }
.back-office table.data tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.back-office table.data tr.total td { background: var(--surface-2); color: var(--strong); }
.back-office table.data td.details { font-size: 0.76rem; word-break: normal; overflow-wrap: anywhere; }
.back-office table.data td input[type="number"] { width: 8em; }
.back-office table.data code.model-id { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.back-office .page > table.data, .back-office .page > .table-scroll { margin-top: 12px; }

/* A section as a card: its title (and what goes with it) on a band on top, then its content; a table runs to the
   card's edges. */
.blocks { display: grid; gap: 20px; min-width: 0; }
.block { min-width: 0; margin-top: 20px; padding: 0 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.blocks > .block { margin-top: 0; }
.block > header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 -18px 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.page .block > header h2 { margin: 0; font-size: 1rem; }
.block > header .heading-figure { margin-left: 0; font-size: 0.88rem; }
.block > header .badge { margin: 0; }
.block > table.data, .block > .table-scroll { width: calc(100% + 36px); max-width: none; margin: 0 -18px 12px; border: 0; border-radius: 0; box-shadow: none; }
.block > header + table.data, .block > header + .table-scroll { margin-top: -14px; }
.block > table.data:last-child { margin-bottom: -16px; }
.block > table.data thead th { border-radius: 0; }
.block > table.data tbody tr:last-child td { border-radius: 0; }
.block > :is(p, form, details, .row-form, .request, dl):first-child { margin-top: 0; }
.block > p { margin: 8px 0; }
.block > h3 { margin: 18px 0 8px; }
.block > .stats { margin: 0 0 14px; box-shadow: none; }
.block > details.action-form { margin: 12px 0 0; }
.block .stack { max-width: none; }
@media (max-width: 720px) { .block > table.data { display: block; overflow-x: auto; } }

/* The overview: the menu's four groups two by two, each page a tile. */
.back-office .panels > .panel { margin-top: 0; max-width: none; }
.panels.overview { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.panels.overview .tiles.compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.back-office .tile { align-content: start; }
.back-office .panel.attention { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

/* Cards side by side as the window allows (a plan: what it grants, its prices), a short form's card kept narrow, and a
   long form's fields in a grid instead of one tall column (Campaigns). */
.block-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; align-items: start; margin-top: 20px; }
.block-grid > .block { margin-top: 0; }
.block.narrow-block { max-width: 640px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px 18px; align-items: start; }
.form-grid .field { display: grid; gap: 6px; min-width: 0; }
.form-grid .field > label { color: var(--strong); font-size: 0.88rem; font-weight: 600; }
.form-grid .field > input, .form-grid .field > select { width: 100%; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .hint { margin: 0; }
/* A long label stays beside its box and wraps there, rather than dropping below it. */
.back-office label.check { flex-wrap: nowrap; }
.back-office label.check > input { flex-shrink: 0; }
/* A ticket: the reply box a card like the conversation's, and the side's payments as a list without bullets. */
.back-office .composer { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.back-office .ticket-side .plain-list.ledger { list-style: none; padding: 0; gap: 0; }
.back-office .ticket-side .plain-list.ledger li { padding: 8px 0; }
.back-office .ticket-side .plain-list.ledger li + li { border-top: 1px solid var(--line-soft); }

/* Side panels (a customer's details, a ticket's) match the cards. */
.back-office .panel { border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.back-office .panel > header :is(h2, h3) { font-size: 1rem; }
.back-office .facts { gap: 6px 16px; }
.back-office .facts dd { color: var(--strong); }

/* Figures at a glance: one strip, each figure parted from the next. */
.back-office .stats { gap: 0; padding: 0; box-shadow: var(--shadow); }
.back-office .stats div { padding: 12px 20px; border-right: 1px solid var(--line-soft); }
.back-office .stats div:last-child { border-right: 0; }
.back-office .stats dt { font-size: 0.8rem; }
.back-office .stats dd { font-size: 1.05rem; color: var(--strong); }

/* Choices that filter a page, as buttons: a row of outlined ones (.filters), or one joined control (.segmented, and
   the tabs of .toc). The chosen one stands out. */
.back-office .filters { gap: 6px; }
.back-office .filters > a, .back-office .filters > .chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 0.86rem; font-weight: 500; text-decoration: none; }
.back-office .filters > a:hover { background: var(--surface-2); color: var(--strong); text-decoration: none; }
.back-office .filters > a[aria-current="page"], .back-office .filters > a.current { color: var(--strong); background: color-mix(in srgb, var(--accent) 13%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); font-weight: 600; }
.back-office .filters label { color: var(--muted); font-size: 0.88rem; }
.segmented, .back-office .toc { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.segmented a, .back-office .toc a { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 7px; color: var(--muted); font-size: 0.88rem; font-weight: 500; text-decoration: none; }
.segmented a:hover, .back-office .toc a:hover { color: var(--strong); background: transparent; text-decoration: none; }
.segmented a[aria-current="page"], .back-office .toc a[aria-current="page"] { color: var(--strong); background: var(--surface); font-weight: 600; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.segmented .n { min-width: 1.4em; color: var(--muted); font-size: 0.8rem; font-weight: 500; font-variant-numeric: tabular-nums; text-align: center; }
.back-office .toc { margin-top: 16px; }
.back-office .jump-links { gap: 4px; margin: 0 0 18px; }
.back-office .jump-links a { padding: 4px 10px; border-radius: 7px; color: var(--text); font-size: 0.9rem; }
.back-office .jump-links a:hover { background: var(--surface-2); color: var(--strong); }

/* Problem reports: switching them on in one line, the filters as buttons, an inbox of reports (what happened in
   words; its type, version, sender and time below), and the chosen report beside the list. */
.intake { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 18px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.intake .badge { margin: 0; }
.intake p { flex: 1 1 320px; margin: 0; color: var(--muted); font-size: 0.9rem; }
.intake form { margin: 0; }
.intake details { flex-basis: 100%; font-size: 0.88rem; }
.intake summary { cursor: pointer; }
.intake details .hint { margin-top: 6px; }
.report-filters { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.reports.with-detail { display: grid; grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr); gap: 20px; align-items: start; }
.report-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.report-list li + li { border-top: 1px solid var(--line-soft); }
.report-list a { display: grid; grid-template-columns: 4.9rem minmax(0, 1fr) auto; grid-template-areas: "kind title flags" "kind meta flags"; gap: 3px 12px; padding: 12px 16px; color: var(--text); text-decoration: none; }
.back-office .staff-main .report-list a:hover { background: var(--surface-2); text-decoration: none; }
.report-list a[aria-current="true"] { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: inset 3px 0 0 var(--accent); }
.report-kind { grid-area: kind; padding-top: 1px; }
.report-kind .badge { margin: 0; }
.report-title { grid-area: title; min-width: 0; color: var(--strong); font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.report-list li.unread .report-title { font-weight: 650; }
.report-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 0 14px; min-width: 0; color: var(--muted); font-size: 0.83rem; }
.report-meta code { color: var(--text); font-size: 0.8rem; }
.report-flags { grid-area: flags; display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; gap: 6px; }
.report-flags .badge { margin: 0; }
.reports.with-detail .report-list a { grid-template-columns: 4.9rem minmax(0, 1fr); grid-template-areas: "kind title" "kind meta" "kind flags"; }
.reports.with-detail .report-flags { justify-content: flex-start; }
.reports.with-detail .report-flags:empty { display: none; }
.report-detail { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; min-width: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.report-detail > header { display: grid; gap: 8px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.report-detail .report-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.report-detail .report-line .badge { margin: 0; }
.page .report-detail h2 { margin: 0; font-size: 1.15rem; line-height: 1.35; overflow-wrap: anywhere; }
.report-detail .actions { margin: 4px 0 0; align-items: center; }
/* Its GitHub issue by hand: one line, the field as tall as the small buttons beside it. */
.report-detail .issue-link { margin: 0; }
.report-detail .issue-link label { color: var(--muted); font-size: 0.86rem; }
.report-detail .issue-link input { flex: 1 1 14rem; padding: 4px 10px; font-size: 0.86rem; }
.report-detail .facts { grid-template-columns: max-content minmax(0, 1fr); font-size: 0.9rem; }
.page .report-detail h3 { margin: 18px 0 6px; font-size: 0.9rem; }
.report-detail pre.report-text { max-height: 360px; overflow: auto; margin: 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 0.78rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
blockquote.their-words { margin: 0; padding: 10px 14px; background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.reports .empty { margin: 0; padding: 32px 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; }
@media (max-width: 1180px) {
	.reports.with-detail { grid-template-columns: minmax(0, 1fr); }
	.report-detail { order: -1; position: static; max-height: none; }
}
@media (max-width: 640px) {
	.report-list a { grid-template-columns: minmax(0, 1fr); grid-template-areas: "kind" "title" "meta" "flags"; }
	.report-flags { justify-content: flex-start; }
}

/* The back office assistant (Support › Ask the assistant): the questions on the right, the answers on the left, the box
   for the next question below; and its summary on a ticket. */
.ask-turns { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.ask-question { justify-self: end; max-width: 80%; padding: 10px 14px; color: var(--strong); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 12px 12px 4px 12px; }
.ask-question p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-answer, .assist-summary { max-width: 92%; padding: 12px 16px; line-height: 1.55; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; overflow-wrap: anywhere; }
.ask-answer > :first-child, .assist-summary > :first-child { margin-top: 0; }
.ask-answer > :last-child, .assist-summary > :last-child { margin-bottom: 0; }
.ask-answer ul, .ask-answer ol, .assist-summary ul, .assist-summary ol { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; }
.ask-form textarea { width: 100%; }
.ask .filters > a { text-align: left; }
.assist { margin: 0 0 16px; }
.assist .row-form { margin: 0; }
.assist-summary { max-width: none; margin-top: 12px; border-radius: 10px; }
