/* Quantistride UI kit. Shared by the customer dashboard and the owner admin console (WS7A).
   Brand: navy #081426, cyan #04AEF3, white. Dark theme. Text and controls meet WCAG 2.2 AA
   contrast (checked by platform/ui/test/contrast.test.ts); focus is always visible; targets
   are at least 24px; motion stops when the user asks for reduced motion. */
:root {
  --navy: #081426;
  --navy-2: #0b1b33;
  --navy-3: #10264a;
  --cyan: #04aef3;
  --cyan-bright: #5fd0ff;
  --violet: #7c6cff;
  --bg: var(--navy);
  --surface: rgba(16, 38, 74, 0.55);
  --surface-solid: #0e2140;
  --surface-2: rgba(4, 174, 243, 0.08);
  --border: rgba(95, 208, 255, 0.16);
  --border-strong: rgba(95, 208, 255, 0.38);
  --text: #e8f1fb;
  --text-muted: #9db3cc;
  --primary: var(--cyan);
  --on-primary: #04101f;
  --danger: #ff7a7a;
  --success: #3ee6a8;
  --warn: #ffc457;
  --info: var(--cyan-bright);
  --emulation-bg: #b4470d;
  --focus: #ffd166;
  --radius: 0.875rem;
  --glow: 0 0 0 1px rgba(4, 174, 243, 0.35), 0 0.5rem 2rem rgba(4, 174, 243, 0.18);
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
  /* One scale for the whole dashboard and admin console. Every length below is in rem, so this single number sizes text, spacing and controls together
     (0.9 = 10% smaller than the old 16px root). Media queries stay in px: they follow the screen, not the scale. Touch-target floors are px (see the end of the file). */
  --ui-scale: 0.9;
}

* { box-sizing: border-box; }
html { font-size: calc(var(--ui-scale) * 100%); }
html, body { margin: 0; }
body {
  color: var(--text);
  font: 1rem/1.55 var(--font);
  background-color: var(--bg);
  background-image:
    radial-gradient(75rem 37.5rem at 10% -10%, rgba(4, 174, 243, 0.22), transparent 60%),
    radial-gradient(56.25rem 31.25rem at 110% 10%, rgba(124, 108, 255, 0.16), transparent 60%),
    linear-gradient(rgba(95, 208, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 208, 255, 0.045) 1px, transparent 1px);
  background-size: auto, auto, 2.5rem 2.5rem, 2.5rem 2.5rem;
  background-attachment: fixed;
  min-height: 100vh;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--cyan-bright); }
a:hover { color: #9fe3ff; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1:focus { outline: none; }
::selection { background: rgba(4, 174, 243, 0.4); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Plain links get a little vertical room for touch. :where() keeps this rule at zero specificity: written as a:not(.btn):not(.skip-link)
   it outranked every one-class rule (.nav-list a), so the sidebar links lost display:flex and their padding and the selected item's
   pill was drawn around inline-block text with the min-height spilling out below it. */
a:where(:not(.btn):not(.skip-link)) { display: inline-block; padding-block: 2px; }

.skip-link { position: absolute; left: 0.5rem; top: -3rem; background: var(--surface-solid); color: var(--text); padding: 0.5rem 0.75rem; border-radius: 0.5rem; z-index: 100; }
.skip-link:focus { top: 0.5rem; }

.eyebrow { font-family: var(--mono); font-size: max(0.78rem, 12px); letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan-bright); margin: 0 0 0.375rem; }

.emulation-banner { position: sticky; top: 0; z-index: 50; background: repeating-linear-gradient(-45deg, var(--emulation-bg), var(--emulation-bg) 0.875rem, #a03f0b 0.875rem, #a03f0b 1.75rem); color: #fff; padding: 0.625rem 1rem; font-weight: 600; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }

/* Shell */
.shell { display: grid; grid-template-columns: 16.25rem 1fr; min-height: 100vh; }
.shell-top { display: contents; }
.mobile-bar { display: none; }
.shell-nav { background: linear-gradient(180deg, rgba(8, 20, 38, 0.92), rgba(11, 27, 51, 0.92)); border-right: 1px solid var(--border); position: sticky; top: var(--banner-h, 0px); height: calc(100vh - var(--banner-h, 0px)); display: flex; flex-direction: column; overflow-y: auto; backdrop-filter: blur(0.75rem); }
.nav-scroll { flex: 1 0 auto; padding: 1.375rem 0.875rem 0.5rem; }
.shell-nav[hidden] { display: none; }
.brand { display: block; padding: 2px 0.5rem 1.125rem; margin-bottom: 0.25rem; }
.brand img { display: block; width: 100%; max-width: 13.75rem; height: auto; }
.nav-sections { display: grid; gap: 0.875rem; margin-top: 0.625rem; }
.nav-heading { margin: 0 0 0.25rem; padding: 0 0.75rem; font-family: var(--mono); font-size: max(0.72rem, 12px); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); line-height: 1.4; }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-list a { display: flex; align-items: center; gap: 0.75rem; padding: 0 0.75rem; border-radius: 0.625rem; color: var(--text-muted); text-decoration: none; min-height: 2.5rem; line-height: 1.25; border: 1px solid transparent; transition: background 0.15s, color 0.15s, border-color 0.15s; position: relative; }
.nav-list a::before { content: ""; width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: currentColor; opacity: 0.45; flex: none; }
.nav-list a:hover { background: var(--surface-2); color: var(--text); }
.nav-list a[aria-current="page"] { background: linear-gradient(90deg, rgba(4, 174, 243, 0.22), rgba(4, 174, 243, 0.04)); color: #fff; border-color: var(--border-strong); font-weight: 600; }
.nav-list a[aria-current="page"]::before { opacity: 1; background: var(--cyan); box-shadow: 0 0 0.625rem var(--cyan); }
.nav-list a:focus-visible, .menu-btn:focus-visible, .mobile-logo:focus-visible, .rail-mark:focus-visible, .brand:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.nav-icon { flex: none; width: 1.375rem; height: 1.375rem; display: block; }
.nav-mono { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 0.5rem; border: 1px solid var(--border-strong); font-family: var(--mono); font-size: max(0.72rem, 12px); font-weight: 700; letter-spacing: 0; line-height: 1; }
/* The collapse / expand control: a round button pinned to the bottom of the sidebar. The dock is sticky inside the scrolling nav, so it stays
   put on short screens and long menus; the tint is the existing cyan over the rail, nothing new. */
.nav-dock { position: sticky; bottom: 0; z-index: 2; margin-top: auto; display: flex; justify-content: flex-start; padding: 0.625rem 0.875rem 1rem; background: linear-gradient(180deg, transparent, var(--navy-2) 40%); }
.nav-toggle { width: 2.5rem; height: 2.5rem; min-width: 2.5rem; min-height: 2.5rem; padding: 0; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--text); background: color-mix(in srgb, var(--cyan) 14%, var(--navy-3)); border: 1px solid var(--border-strong); transition: background 0.15s, border-color 0.15s; }
.nav-toggle:hover { background: color-mix(in srgb, var(--cyan) 26%, var(--navy-3)); border-color: var(--cyan); color: #fff; }
.nav-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.nav-chevrons { display: block; transition: transform 0.2s ease; }
.nav-toggle.is-collapsed .nav-chevrons { transform: rotate(180deg); }
.rail-mark { display: block; padding: 2px; width: fit-content; margin: 0 auto 0.875rem; border-radius: 0.625rem; }
.rail-mark img { display: block; width: 2.5rem; height: 2.5rem; }
.shell-collapsed { grid-template-columns: 5.5rem 1fr; }
.shell-collapsed .shell-nav { margin: 0.625rem 0 0.625rem 0.625rem; top: calc(var(--banner-h, 0px) + 0.625rem); height: calc(100vh - var(--banner-h, 0px) - 1.25rem); border: 1px solid var(--border); border-radius: 1.5rem; }
.shell-collapsed .nav-scroll { padding: 1rem 0.5rem 0.5rem; }
.shell-collapsed .nav-dock { justify-content: center; padding: 0.625rem 0 0.875rem; border-radius: 0 0 1.5rem 1.5rem; }
.shell-collapsed .nav-sections { gap: 0; margin-top: 0; }
.shell-collapsed .nav-section + .nav-section { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.shell-collapsed .nav-list { gap: 0.25rem; justify-items: stretch; }
.shell-collapsed .nav-list a { justify-content: center; padding: 0; min-height: 2.75rem; border-radius: 1rem; }
.shell-collapsed .nav-list a::before { display: none; }
.shell-collapsed .nav-list a[aria-current="page"] { background: color-mix(in srgb, var(--cyan) 24%, transparent); }
.nav-account { display: none; }
.nav-footer { white-space: nowrap; margin-top: 1.5rem; padding: 0.75rem; border-top: 1px solid var(--border); font-family: var(--mono); font-size: max(0.75rem, 12px); color: var(--text-muted); }
.status-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--success); box-shadow: 0 0 0.5rem var(--success); margin-right: 0.5rem; vertical-align: middle; }

.shell-main { min-width: 0; }
.topbar { position: sticky; top: var(--banner-h, 0px); z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 0.875rem 2.25rem; border-bottom: 1px solid var(--border); background: rgba(8, 20, 38, 0.72); backdrop-filter: blur(0.875rem); gap: 0.75rem; flex-wrap: wrap; }
.topbar-who { color: var(--text-muted); font-size: 0.95rem; display: flex; align-items: center; gap: 0.625rem; }
.avatar { width: 2.125rem; height: 2.125rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--on-primary); background: linear-gradient(135deg, var(--cyan), var(--violet)); }
.content { padding: 2rem 2.25rem 3.5rem; max-width: 73.75rem; }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.625rem; flex-wrap: wrap; }
.page-header p { color: var(--text-muted); margin: 0; max-width: 62ch; }
.page-header > div { min-width: 0; }
.page-header h1 { overflow-wrap: anywhere; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.375rem; backdrop-filter: blur(0.625rem); position: relative; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s; }
.card-interactive:hover { border-color: var(--border-strong); box-shadow: var(--glow); transform: translateY(-2px); }
.grid { display: grid; gap: 1.125rem; grid-template-columns: repeat(auto-fill, minmax(16.875rem, 1fr)); }
ul.grid { list-style: none; margin: 0; padding: 0; }
.stack { display: grid; gap: 1.125rem; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.section-gap { margin-top: 2rem; }

.hero { padding: 1.75rem; margin-bottom: 1.375rem; overflow: hidden; background: linear-gradient(120deg, rgba(4, 174, 243, 0.2), rgba(124, 108, 255, 0.14) 60%, rgba(16, 38, 74, 0.6)); border-color: var(--border-strong); }
.hero::after { content: ""; position: absolute; right: -5rem; top: -5rem; width: 20rem; height: 20rem; border-radius: 50%; border: 2px solid rgba(95, 208, 255, 0.35); box-shadow: 0 0 3.75rem rgba(4, 174, 243, 0.35), inset 0 0 3.75rem rgba(4, 174, 243, 0.2); animation: orbit 14s linear infinite; pointer-events: none; }
.hero h1 { font-size: 2.2rem; }
@keyframes orbit { from { transform: rotate(0deg) translateX(0.625rem) rotate(0deg); } to { transform: rotate(360deg) translateX(0.625rem) rotate(-360deg); } }

.stat-card .stat { font-size: 2.6rem; font-weight: 750; line-height: 1.1; margin: 0.5rem 0 2px; background: linear-gradient(90deg, #fff, var(--cyan-bright)); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.stat { font-size: 2rem; font-weight: 700; }

/* App tiles */
.app-card { display: flex; flex-direction: column; gap: 0.75rem; }
.app-card > .row:last-child { margin-top: auto; }
.app-head { display: flex; gap: 0.875rem; align-items: center; }
.app-head h2 { margin: 0; }
.app-icon { width: 3rem; height: 3rem; flex: none; border-radius: 0.75rem; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 0.375rem 1.125rem rgba(4, 174, 243, 0.25); }
.app-icon-0 { background: linear-gradient(135deg, #04aef3, #2563eb); }
.app-icon-1 { background: linear-gradient(135deg, #7c6cff, #04aef3); }
.app-icon-2 { background: linear-gradient(135deg, #14b8a6, #0ea5e9); }
.app-icon-3 { background: linear-gradient(135deg, #f472b6, #7c6cff); }
.app-icon-4 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.price { font-family: var(--mono); color: var(--text); }
.price span { color: var(--text-muted); }

/* Buttons */
.btn { font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.625rem; padding: 0.5625rem 1.125rem; border-radius: 0.625rem; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: box-shadow 0.15s, background 0.15s, transform 0.1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--cyan), #3cc3ff); color: var(--on-primary); box-shadow: 0 0.25rem 1.125rem rgba(4, 174, 243, 0.35); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(95, 208, 255, 0.6), 0 0.375rem 1.625rem rgba(4, 174, 243, 0.55); }
.btn-secondary { background: rgba(255, 255, 255, 0.04); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: #fff; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(255, 122, 122, 0.55); }
.btn-danger:hover { background: rgba(255, 122, 122, 0.1); }
.btn-link { background: none; border: none; color: var(--cyan-bright); text-decoration: underline; padding: 0.25rem; min-height: 32px; font-weight: 500; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* Forms */
.field { display: grid; gap: 0.375rem; margin-bottom: 1rem; }
.field label, .field legend { font-weight: 600; }
.field .hint { color: var(--text-muted); font-size: 0.9rem; }
.field .error { color: var(--danger); font-size: 0.95rem; font-weight: 600; }
.field input, .field textarea, .field select { font: inherit; padding: 0.625rem 0.75rem; border: 1px solid rgba(157, 179, 204, 0.55); border-radius: 0.625rem; background: rgba(4, 16, 31, 0.6); color: var(--text); min-height: 2.75rem; width: 100%; transition: border-color 0.15s, box-shadow 0.15s; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(4, 174, 243, 0.25); outline: none; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.field textarea { min-height: 9.375rem; resize: vertical; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.field select option { background: var(--navy-2); }
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; }
.radio { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem; border-radius: 0.625rem; border: 1px solid var(--border); margin-bottom: 0.5rem; }
.radio:has(input:checked) { border-color: var(--border-strong); background: var(--surface-2); }
.radio input { width: 1.25rem; height: 1.25rem; margin-top: 3px; accent-color: var(--cyan); }

/* Feedback */
.alert { border-radius: 0.625rem; padding: 0.75rem 0.875rem; margin-bottom: 1.125rem; border: 1px solid; border-left-width: 0.25rem; }
.alert-error { background: rgba(255, 122, 122, 0.1); color: #ffd0d0; border-color: rgba(255, 122, 122, 0.6); }
.alert-success { background: rgba(62, 230, 168, 0.1); color: #c9f9e6; border-color: rgba(62, 230, 168, 0.6); }
.alert-info { background: rgba(4, 174, 243, 0.1); color: #cdeeff; border-color: rgba(95, 208, 255, 0.6); }
.alert-warn { background: rgba(255, 196, 87, 0.1); color: #ffe7b8; border-color: rgba(255, 196, 87, 0.6); }

.badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 3px 0.625rem; border-radius: 999px; font-size: max(0.78rem, 12px); font-weight: 650; letter-spacing: 0.02em; background: rgba(255, 255, 255, 0.05); color: var(--text); border: 1px solid var(--border-strong); }
.badge-success { color: var(--success); border-color: rgba(62, 230, 168, 0.5); background: rgba(62, 230, 168, 0.08); }
.badge-success::before { content: ""; width: 0.375rem; height: 0.375rem; border-radius: 50%; background: var(--success); box-shadow: 0 0 0.375rem var(--success); }
.badge-warn { color: var(--warn); border-color: rgba(255, 196, 87, 0.5); background: rgba(255, 196, 87, 0.08); }
.badge-info { color: var(--cyan-bright); border-color: rgba(95, 208, 255, 0.5); background: rgba(4, 174, 243, 0.1); }
.badge-danger { color: var(--danger); border-color: rgba(255, 122, 122, 0.55); background: rgba(255, 122, 122, 0.08); }
.badge-emulation { background: var(--emulation-bg); color: #fff; border-color: transparent; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); backdrop-filter: blur(0.625rem); }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; font-weight: 600; padding: 0 0 0.5rem; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(4, 174, 243, 0.05); }
th { font-family: var(--mono); font-size: max(0.74rem, 12px); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; background: rgba(4, 16, 31, 0.5); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.card .table-wrap { background: transparent; }
/* A row that opens a panel directly under itself (Your files). The panel sits in a full-width cell of its own, tinted so it reads as part of the row above it. */
tbody tr.row-open td { background: var(--surface-2); border-bottom-color: transparent; }
tbody tr.row-panel:hover { background: none; }
tbody tr.row-panel td { padding: 0 1rem 1rem; background: var(--surface-2); }
tbody tr.row-open:hover { background: none; }
.file-panel { border-top: 1px solid var(--border); padding-top: 0.875rem; min-width: 0; }
.file-panel h3:first-child { margin-top: 0; overflow-wrap: anywhere; }
.file-panel:focus { outline: none; }
.file-reason { display: block; color: var(--text-muted); overflow-wrap: anywhere; max-width: 42ch; }
.link-button { font: inherit; font-weight: 600; color: var(--cyan-bright); background: none; border: 0; padding: 0.125rem 0; margin: 0; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; min-height: 1.5rem; }
.link-button:hover { color: var(--text); }
.link-button[aria-expanded="true"] { text-decoration-thickness: 3px; color: var(--text); }
/* "Your files": the Show filter (a row of toggle buttons that wraps on a phone) and the one-line explanation of the order. The pressed one has a bar under it as well as a colour. */
.show-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.5rem 0 0.25rem; }
.show-label { font-family: var(--mono); font-size: max(0.74rem, 12px); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.show-chip { padding: 0.375rem 0.875rem; min-height: 2.25rem; }
.show-chip[aria-pressed="true"] { background: var(--surface-2); border-color: var(--cyan-bright); color: #fff; box-shadow: inset 0 -0.1875rem 0 var(--cyan-bright); }
.sort-line { margin: 0.25rem 0 0.75rem; }

/* Auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 28.75rem; }
.auth-card .card { padding: 1.875rem; box-shadow: 0 1.875rem 5rem rgba(0, 0, 0, 0.45), var(--glow); }
.auth-logo { display: block; width: 15rem; max-width: 80%; height: auto; margin: 0 auto 1.125rem; filter: drop-shadow(0 0 1.5rem rgba(4, 174, 243, 0.35)); }
.auth-card .brand { display: none; }
/* Public screens (log in, sign up, the pages around them). The same top bar, card, type and buttons as the public website,
   which is built from the same tokens (apps/landing/src/styles/site.css, night surface). */
.public-page { min-height: 100vh; display: flex; flex-direction: column; font-size: 1.0625rem; line-height: 1.6; }
.public-bar-inner { width: min(100% - 2.5rem, 70rem); margin-inline: auto; min-height: 4.5rem; display: flex; align-items: center; }
.public-page a.public-logo, .public-page span.public-logo { display: inline-block; padding-block: 0.25rem; }
.public-logo img { display: block; width: 8.125rem; height: auto; }
.public-page .auth-wrap { flex: 1; min-height: 0; place-items: start center; padding: 1.5rem 1.25rem 4rem; }
.public-page .auth-card .card { padding: 1.5rem; background: var(--surface-solid); box-shadow: none; backdrop-filter: none; }
.public-page .page-header h1 { font-size: clamp(1.75rem, 1.4rem + 1.26vw, 2.25rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.public-page .page-header p { color: var(--text-muted); }
.public-page .btn:not(.btn-link) { min-height: 3rem; padding: 0.75rem 1.375rem; font-size: 1rem; line-height: 1.2; }
.public-page .btn-primary { background: var(--cyan); box-shadow: none; }
.public-page .btn-primary:hover { background: #3cc3ff; box-shadow: var(--glow); }
.public-page .btn-secondary { background: transparent; }
.public-page .btn-secondary:hover { background: var(--surface-2); }
.public-page .btn[disabled]:hover { box-shadow: none; }
.public-page .field input { min-height: 3rem; background: var(--navy); }
.public-page .field .hint { font-size: 0.9375rem; }
.public-page a.back-home { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.75rem; margin: -0.5rem 0 0.25rem -0.25rem; padding: 0 0.25rem; font-weight: 600; text-decoration: none; }
.public-page a.back-home:hover { text-decoration: underline; }
.public-page .btn-link { padding-block: 0.375rem; }
.public-page .auth-links > .btn-link { margin-left: -0.25rem; }
.public-page .auth-links { display: flex; flex-wrap: wrap; column-gap: 0.75rem; }
.public-page form + .muted { margin-top: 1.25rem; }
@media (max-width: 639px) { .public-page .row > .btn:not(.btn-link) { flex: 1 1 100%; } }
@media (min-width: 400px) { .public-logo img { width: 9.375rem; } }
@media (min-width: 640px) { .public-bar-inner { width: min(100% - 4rem, 70rem); } .public-page .auth-wrap { padding: 2.5rem 2rem 4rem; } .public-page .auth-card .card { padding: 2rem; } }
@media (min-width: 900px) { .public-logo img { width: 11.25rem; } }
@media (min-width: 1024px) { .public-bar-inner { width: min(100% - 5rem, 70rem); } }
.secret { font-family: var(--mono); font-size: 1.05rem; letter-spacing: 0.05em; overflow-wrap: anywhere; background: rgba(4, 16, 31, 0.7); border: 1px solid var(--border); padding: 0.625rem 0.75rem; border-radius: 0.625rem; }
.empty { text-align: center; padding: 2.25rem 1rem; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

.qr-wrap { display: flex; justify-content: center; margin: 0.5rem 0 1rem; }
.qr { display: block; max-width: 100%; height: auto; border-radius: 0.75rem; box-shadow: 0 0 0 0.25rem rgba(4, 174, 243, 0.35), 0 0 2.5rem rgba(4, 174, 243, 0.35); }
.qr-fallback { margin-bottom: 1rem; }
.qr-fallback summary { cursor: pointer; color: var(--cyan-bright); text-decoration: underline; min-height: 32px; padding: 2px 0; }

hr { border: 0; border-top: 1px solid var(--border); margin: 1.375rem 0; }
ol { padding-left: 1.3rem; }
details > summary { list-style-position: outside; }

/* Dialog and status panel */
.dialog { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-solid); color: var(--text); padding: 0; width: min(35rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); box-shadow: 0 1.875rem 5rem rgba(0, 0, 0, 0.6), var(--glow); }
.dialog::backdrop { background: rgba(4, 10, 20, 0.72); }
.dialog-body { padding: 1.5rem; }
.dialog-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; margin-top: 0.5rem; }
/* A long dialog scrolls inside the viewport and its buttons stay reachable at the bottom (review L: the Retire dialog's buttons were off-screen at 390 px). */
.dialog { overflow-y: auto; max-height: calc(100dvh - 2rem); }
.dialog-actions { position: sticky; bottom: 0; background: var(--surface-solid); padding: 0.75rem 0 0; }
.status-panel { text-align: center; padding: 2.5rem 1.25rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.status-panel-error { border-color: rgba(255, 122, 122, 0.6); }
.status-panel-actions { justify-content: center; margin-top: 1rem; }

/* Staff console */
.staff-banner { position: sticky; top: 0; z-index: 60; background: #0a2a4d; border-bottom: 2px solid var(--cyan); color: #fff; padding: 0.5rem 1rem; font-weight: 650; font-size: 0.92rem; letter-spacing: 0.04em; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.staff-banner .badge { background: rgba(255, 255, 255, 0.12); }
.stat-row { display: grid; gap: 1.125rem; grid-template-columns: repeat(auto-fit, minmax(11.875rem, 1fr)); margin-bottom: 1.375rem; }
.link-cell { font-weight: 600; }
.actions-cell { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.actions-cell .btn { min-height: 2.25rem; padding: 0.3125rem 0.75rem; }
.pager { margin-top: 1rem; }

/* Phones and narrow windows: a compact bar (logo mark, page title, Menu) and the links in one column in a panel. Keep 860px in step with
   NARROW_QUERY in navState.ts. */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; min-height: 0; }
  .shell-top { display: block; position: sticky; top: 0; z-index: 60; }
  .shell-top .staff-banner, .shell-top .emulation-banner { position: static; }
  .mobile-bar { display: flex; align-items: center; gap: 0.75rem; min-height: 56px; padding: 0.375rem 1rem; border-bottom: 1px solid var(--border); background: rgba(8, 20, 38, 0.96); backdrop-filter: blur(0.875rem); }
  .mobile-logo { display: block; flex: none; padding: 0; line-height: 0; border-radius: 0.5rem; }
  .mobile-logo img { display: block; width: 36px; height: 36px; }
  .mobile-title { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-btn { min-height: 2.75rem; padding: 0.5rem 1.125rem; }
  .nav-scroll { padding: 1rem 1rem 1.5rem; }
  .nav-dock { display: none; }
  .shell-nav { position: fixed; left: 0; right: 0; bottom: 0; top: 56px; height: auto; z-index: 55; border-right: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--navy-2); backdrop-filter: none; animation: nav-in 0.16s ease-out; }
  .shell-nav[hidden] { display: none; }
  .shell-nav .brand { display: none; }
  .nav-sections { margin-top: 0; gap: 1rem; }
  .nav-list a { min-height: 3rem; }
  .nav-account { display: grid; gap: 0.75rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
  .nav-account .topbar-who { align-items: center; overflow-wrap: anywhere; }
  .nav-account .btn { justify-self: start; }
  .nav-footer { display: none; }
  .content { padding-left: 1rem; padding-right: 1rem; padding-top: 1.25rem; }
  .hero h1 { font-size: 1.7rem; }
}
@keyframes nav-in { from { opacity: 0; transform: translateY(-0.375rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::after { transition: none !important; animation: none !important; } }
dl.summary { display: grid; gap: 0.75rem; margin: 0; }
dl.summary > div { display: grid; grid-template-columns: 10rem 1fr; gap: 0.75rem; }
dl.summary dt { color: var(--text-muted); font-weight: 600; }
dl.summary dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { dl.summary > div { grid-template-columns: 1fr; gap: 2px; } }
.stack > * { min-width: 0; }
dl.summary, dl.summary > div { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 601px) { dl.summary > div { grid-template-columns: 10rem minmax(0, 1fr); } }

/* Spend strip (staff console, every page) */
.spend-strip { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; padding: 0.625rem 1rem; margin: 0 0 1.25rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.spend-strip-stopped { border-color: rgba(255, 122, 122, 0.7); }
.spend-strip-restricted { border-color: rgba(255, 196, 87, 0.7); }
.spend-strip .strip-item { display: flex; gap: 0.5rem; align-items: center; min-width: 0; }
.spend-strip .strip-label { color: var(--text-muted); font-size: 0.85rem; }
.spend-strip .strip-reason { flex-basis: 100%; margin: 0; font-size: 0.92rem; overflow-wrap: anywhere; }
.meter { display: block; width: 10rem; max-width: 100%; height: 0.625rem; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; border: 1px solid var(--border-strong); }
.meter > span { display: block; height: 100%; background: var(--cyan-bright); }
.meter-warn > span { background: var(--warn); }
.meter-danger > span { background: var(--danger); }
.limit-grid { display: grid; gap: 0.875rem; grid-template-columns: repeat(auto-fit, minmax(16.25rem, 1fr)); }
.limit-grid fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 0.875rem 0.25rem; margin: 0; min-width: 0; }
.limit-grid legend { padding: 0 0.375rem; font-weight: 650; }
.token-box { font-family: var(--mono); overflow-wrap: anywhere; }
@media (max-width: 600px) { .spend-strip { padding: 0.625rem 0.75rem; } .meter { width: 7.5rem; } }

/* Your files: adding several files at once (drop zone, upload queue, confirm for all) */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 1.125rem; margin: 0.75rem 0; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover { border-color: var(--cyan-bright); background: var(--surface-2); }
.dropzone:focus-within { border-color: var(--focus); border-style: solid; background: var(--surface-2); }
.dropzone-over { border-color: var(--cyan-bright); border-style: solid; background: rgba(4, 174, 243, 0.18); }
.dropzone-busy { opacity: 0.6; }
.dropzone-text { font-weight: 600; margin: 0 0 0.625rem; }
.dropzone input[type="file"] { max-width: 100%; font: inherit; color: var(--text); }
.dropzone input[type="file"]::file-selector-button { font: inherit; font-weight: 600; min-height: 2.625rem; padding: 0.5625rem 1.125rem; margin-right: 0.75rem; border-radius: 0.625rem; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.04); color: var(--text); cursor: pointer; }
.dropzone input[type="file"]::file-selector-button:hover { background: var(--surface-2); }
.uq-list, .ca-list { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.uq-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 0.75rem; align-items: center; padding: 0.625rem 0; border-bottom: 1px solid var(--border); }
.uq-item:last-child { border-bottom: 0; }
.uq-name { font-weight: 600; overflow-wrap: anywhere; }
.uq-size { text-align: right; white-space: nowrap; }
.uq-state { overflow-wrap: anywhere; }
.uq-item:not(:has(.btn)) .uq-state { grid-column: 1 / -1; }
.uq-item .btn { grid-column: 2; grid-row: 2; justify-self: end; min-height: 2.25rem; padding: 0.25rem 0.875rem; }
.uq-st-done { color: var(--success); }
.uq-st-failed { color: var(--danger); }
.uq-st-skipped { color: var(--warn); }
.uq-st-uploading { color: var(--cyan-bright); }
.uq-st-waiting { color: var(--text-muted); }
.uq-summary { font-weight: 600; margin: 0; }
.ca-list li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.375rem 0; flex-wrap: wrap; }
.ca-name { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 600px) { .dropzone { padding: 0.75rem; } .dropzone input[type="file"]::file-selector-button { margin-bottom: 0.5rem; } }
/* Apps page (staff console): one row per app with its pipeline, one next action, and the reason it is waiting. No hidden columns on a phone. */
.app-list { list-style: none; margin: 0 0 1.125rem; padding: 0; display: grid; gap: 0.75rem; }
.app-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 1fr); gap: 0.625rem 1.125rem; align-items: start; padding: 1rem 1.125rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.app-row h3 { margin: 0 0 0.25rem; font-size: 1.05rem; overflow-wrap: anywhere; }
.app-row p { margin: 0 0 0.25rem; overflow-wrap: anywhere; }
.app-row-details { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.app-row-action { display: grid; gap: 0.375rem; justify-items: start; }
.app-row-action .btn { max-width: 100%; }
.pipe { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pipe-step { display: inline-flex; align-items: center; gap: 0.375rem; padding: 3px 0.625rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; border: 1px solid var(--border-strong); color: var(--text-muted); background: rgba(255, 255, 255, 0.03); }
.pipe-step .glyph { font-weight: 800; }
.pipe-done { color: var(--success); border-color: rgba(62, 230, 168, 0.5); background: rgba(62, 230, 168, 0.08); }
.pipe-current { color: var(--cyan-bright); border-color: rgba(95, 208, 255, 0.6); background: rgba(4, 174, 243, 0.12); }
.pipe-blocked { color: var(--danger); border-color: rgba(255, 122, 122, 0.55); background: rgba(255, 122, 122, 0.08); }
.pipe-not_enforced, .pipe-unchecked { color: var(--warn); border-color: rgba(255, 196, 87, 0.5); background: rgba(255, 196, 87, 0.08); }
.pipe-later { color: var(--text-muted); border-style: dashed; opacity: 0.85; }
.pipe-note { font-size: 0.88rem; margin-top: 0.375rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.pick-list { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.25rem; max-height: 13.75rem; overflow-y: auto; }
.pick-list label { display: flex; gap: 0.625rem; align-items: center; min-height: 2.25rem; }
.pick-list label { justify-content: flex-start; font-weight: 400; width: 100%; }
.pick-list input[type="checkbox"] { width: 1.25rem; height: 1.25rem; flex: none; margin: 0; }
.review-group { border: 1px solid var(--border); border-radius: 0.625rem; padding: 0.75rem 0.875rem; margin: 0 0 0.875rem; }
.review-group h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.625rem; }
.review-list li { display: grid; gap: 2px; }
.auto-tag { display: inline-block; font-size: max(0.78rem, 12px); font-weight: 700; padding: 1px 0.5rem; border-radius: 999px; color: var(--cyan-bright); border: 1px solid rgba(95, 208, 255, 0.5); background: rgba(4, 174, 243, 0.1); margin-left: 0.375rem; }
.dialog-wide { width: min(45rem, calc(100vw - 2rem)); }
@media (max-width: 900px) { .app-row { grid-template-columns: minmax(0, 1fr); } .app-row-action { justify-items: stretch; } .app-row-action .btn { width: 100%; } }

/* A link drawn as a button that cannot be pressed (the row's action is blocked). The reason sits under it as text. */
.btn-disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; filter: grayscale(0.4); }

/* Touch-target floors, in px on purpose so the scale cannot take them below the minimum (32px on desktop, 44px at phone and narrow-window widths).
   The 56px mobile bar, its menu panel offset and the 36px logo link are px for the same reason: the Menu button inside is held at 44px. */
@media (max-width: 860px) {
  .btn, .actions-cell .btn, .uq-item .btn, .menu-btn, .field input, .field select, .public-page .btn:not(.btn-link), .public-page .field input,
  .public-page a.back-home, .nav-list a, .pick-list label, .dropzone input[type="file"]::file-selector-button { min-height: 44px; }
  .btn-link, .qr-fallback summary, .link-button, .show-chip { min-height: 44px; }
}

/* Sites: the approval view of a waiting version (design note 20.6). The preview frame has no scripts and no origin; its height is in rem so it follows the page scale. */
.review-pages { list-style: none; margin: 0.75rem 0; padding: 0; display: grid; gap: 0.5rem; }
.review-page { border: 1px solid var(--border); border-radius: 0.625rem; padding: 0.5rem 0.75rem; }
.review-page .row { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; }
.review-page code { overflow-wrap: anywhere; }
.review-text { border: 1px solid var(--border); border-radius: 0.625rem; padding: 0.5rem 0.75rem; margin: 0.75rem 0; }
.review-text ul { margin: 0.25rem 0 0.5rem; padding-left: 1.25rem; }
.review-text li { overflow-wrap: anywhere; }
.review-add::marker { content: "+ "; font-weight: 700; } .review-del::marker { content: "\2212 "; font-weight: 700; }
.review-frame iframe { width: 100%; height: 32rem; border: 1px solid var(--border); border-radius: 0.625rem; background: #fff; }
.review-need { font-weight: 700; }
@media (max-width: 40rem) { .review-frame iframe { height: 26rem; } }

/* "Your files": an archive that is opened into separate files. The card where it is chosen, and the members shown under it (a rule on the left and an indent, so they read as one group). */
.archive-card { border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; min-width: 0; }
.archive-card h2, .archive-card h3 { margin-top: 0; overflow-wrap: anywhere; }
.archive-reasons { margin: 0.25rem 0 0.75rem; padding-left: 1.25rem; }
.archive-figures p { margin: 0.375rem 0; }
.archive-skipped { max-height: 18rem; overflow: auto; border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.5rem 0.75rem; margin: 0.5rem 0; }
.archive-skipped table { width: 100%; border-collapse: collapse; }
.archive-skipped th, .archive-skipped td { text-align: left; padding: 0.25rem 0.5rem 0.25rem 0; vertical-align: top; }
.archive-path { font-family: var(--mono); overflow-wrap: anywhere; }
.archive-actions { margin-top: 0.75rem; }
.archive-progress { margin: 0.5rem 0; }
.archive-child { display: block; padding-left: 1rem; border-left: 3px solid var(--border-strong); min-width: 0; }
.archive-parent-note { display: block; color: var(--text-muted); overflow-wrap: anywhere; max-width: 42ch; }
