/* Aurestride 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: 14px;
  --glow: 0 0 0 1px rgba(4, 174, 243, 0.35), 0 8px 32px 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;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--text);
  font: 16px/1.55 var(--font);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(4, 174, 243, 0.22), transparent 60%),
    radial-gradient(900px 500px 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, 40px 40px, 40px 40px;
  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: 8px; top: -48px; background: var(--surface-solid); color: var(--text); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 8px; }

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

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

/* Shell */
.shell { display: grid; grid-template-columns: 260px 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(12px); }
.nav-scroll { flex: 1 0 auto; padding: 22px 14px 8px; }
.shell-nav[hidden] { display: none; }
.brand { display: block; padding: 2px 8px 18px; margin-bottom: 4px; }
.brand img { display: block; width: 100%; max-width: 220px; height: auto; }
.nav-sections { display: grid; gap: 14px; margin-top: 10px; }
.nav-heading { margin: 0 0 4px; padding: 0 12px; font-family: var(--mono); font-size: 0.72rem; 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: 12px; padding: 0 12px; border-radius: 10px; color: var(--text-muted); text-decoration: none; min-height: 40px; 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: 7px; height: 7px; 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 10px 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: 22px; height: 22px; display: block; }
.nav-mono { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-strong); font-family: var(--mono); font-size: 0.72rem; 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: 10px 14px 16px; background: linear-gradient(180deg, transparent, var(--navy-2) 40%); }
.nav-toggle { width: 40px; height: 40px; min-width: 40px; min-height: 40px; 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 14px; border-radius: 10px; }
.rail-mark img { display: block; width: 40px; height: 40px; }
.shell-collapsed { grid-template-columns: 88px 1fr; }
.shell-collapsed .shell-nav { margin: 10px 0 10px 10px; top: calc(var(--banner-h, 0px) + 10px); height: calc(100vh - var(--banner-h, 0px) - 20px); border: 1px solid var(--border); border-radius: 24px; }
.shell-collapsed .nav-scroll { padding: 16px 8px 8px; }
.shell-collapsed .nav-dock { justify-content: center; padding: 10px 0 14px; border-radius: 0 0 24px 24px; }
.shell-collapsed .nav-sections { gap: 0; margin-top: 0; }
.shell-collapsed .nav-section + .nav-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.shell-collapsed .nav-list { gap: 4px; justify-items: stretch; }
.shell-collapsed .nav-list a { justify-content: center; padding: 0; min-height: 44px; border-radius: 16px; }
.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: 24px; padding: 12px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); margin-right: 8px; 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: 14px 36px; border-bottom: 1px solid var(--border); background: rgba(8, 20, 38, 0.72); backdrop-filter: blur(14px); gap: 12px; flex-wrap: wrap; }
.topbar-who { color: var(--text-muted); font-size: 0.95rem; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; 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: 32px 36px 56px; max-width: 1180px; }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; 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: 22px; backdrop-filter: blur(10px); 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: 18px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
ul.grid { list-style: none; margin: 0; padding: 0; }
.stack { display: grid; gap: 18px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.section-gap { margin-top: 32px; }

.hero { padding: 28px; margin-bottom: 22px; 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: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; border: 2px solid rgba(95, 208, 255, 0.35); box-shadow: 0 0 60px rgba(4, 174, 243, 0.35), inset 0 0 60px 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(10px) rotate(0deg); } to { transform: rotate(360deg) translateX(10px) rotate(-360deg); } }

.stat-card .stat { font-size: 2.6rem; font-weight: 750; line-height: 1.1; margin: 8px 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: 12px; }
.app-card > .row:last-child { margin-top: auto; }
.app-head { display: flex; gap: 14px; align-items: center; }
.app-head h2 { margin: 0; }
.app-icon { width: 48px; height: 48px; flex: none; border-radius: 12px; 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 6px 18px 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: 8px; min-height: 42px; padding: 9px 18px; border-radius: 10px; 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 4px 18px rgba(4, 174, 243, 0.35); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(95, 208, 255, 0.6), 0 6px 26px 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: 4px; min-height: 24px; font-weight: 500; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.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: 10px 12px; border: 1px solid rgba(157, 179, 204, 0.55); border-radius: 10px; background: rgba(4, 16, 31, 0.6); color: var(--text); min-height: 44px; 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: 150px; 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 16px; }
.radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px; }
.radio:has(input:checked) { border-color: var(--border-strong); background: var(--surface-2); }
.radio input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--cyan); }

/* Feedback */
.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; border: 1px solid; border-left-width: 4px; }
.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: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; 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: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px 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(10px); }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; font-weight: 600; padding: 0 0 8px; }
th, td { text-align: left; padding: 12px 16px; 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: 0.74rem; 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; }

/* Auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card .card { padding: 30px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), var(--glow); }
.auth-logo { display: block; width: 240px; max-width: 80%; height: auto; margin: 0 auto 18px; filter: drop-shadow(0 0 24px 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% - 40px, 1120px); margin-inline: auto; min-height: 72px; display: flex; align-items: center; }
.public-page a.public-logo, .public-page span.public-logo { display: inline-block; padding-block: 4px; }
.public-logo img { display: block; width: 130px; height: auto; }
.public-page .auth-wrap { flex: 1; min-height: 0; place-items: start center; padding: 24px 20px 64px; }
.public-page .auth-card .card { padding: 24px; background: var(--surface-solid); box-shadow: none; backdrop-filter: none; }
.public-page .page-header h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 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: 48px; padding: 12px 22px; 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: 48px; background: var(--navy); }
.public-page .field .hint { font-size: 0.9375rem; }
.public-page a.back-home { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -8px 0 4px -4px; padding: 0 4px; font-weight: 600; text-decoration: none; }
.public-page a.back-home:hover { text-decoration: underline; }
.public-page .btn-link { padding-block: 6px; }
.public-page .auth-links > .btn-link { margin-left: -4px; }
.public-page .auth-links { display: flex; flex-wrap: wrap; column-gap: 12px; }
.public-page form + .muted { margin-top: 20px; }
@media (max-width: 639px) { .public-page .row > .btn:not(.btn-link) { flex: 1 1 100%; } }
@media (min-width: 400px) { .public-logo img { width: 150px; } }
@media (min-width: 640px) { .public-bar-inner { width: min(100% - 64px, 1120px); } .public-page .auth-wrap { padding: 40px 32px 64px; } .public-page .auth-card .card { padding: 32px; } }
@media (min-width: 900px) { .public-logo img { width: 180px; } }
@media (min-width: 1024px) { .public-bar-inner { width: min(100% - 80px, 1120px); } }
.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: 10px 12px; border-radius: 10px; }
.empty { text-align: center; padding: 36px 16px; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

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

hr { border: 0; border-top: 1px solid var(--border); margin: 22px 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(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), var(--glow); }
.dialog::backdrop { background: rgba(4, 10, 20, 0.72); }
.dialog-body { padding: 24px; }
.dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 8px; }
/* 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 - 32px); }
.dialog-actions { position: sticky; bottom: 0; background: var(--surface-solid); padding: 12px 0 0; }
.status-panel { text-align: center; padding: 40px 20px; 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: 16px; }

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

/* 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: 12px; min-height: 56px; padding: 6px 16px; border-bottom: 1px solid var(--border); background: rgba(8, 20, 38, 0.96); backdrop-filter: blur(14px); }
  .mobile-logo { display: block; flex: none; padding: 0; line-height: 0; border-radius: 8px; }
  .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: 44px; padding: 8px 18px; }
  .nav-scroll { padding: 16px 16px 24px; }
  .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: 16px; }
  .nav-list a { min-height: 48px; }
  .nav-account { display: grid; gap: 12px; margin-top: 24px; padding-top: 16px; 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: 16px; padding-right: 16px; padding-top: 20px; }
  .hero h1 { font-size: 1.7rem; }
}
@keyframes nav-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::after { transition: none !important; animation: none !important; } }
dl.summary { display: grid; gap: 12px; margin: 0; }
dl.summary > div { display: grid; grid-template-columns: 160px 1fr; gap: 12px; }
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: 160px minmax(0, 1fr); } }

/* Spend strip (staff console, every page) */
.spend-strip { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; padding: 10px 16px; margin: 0 0 20px; 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: 8px; 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: 160px; max-width: 100%; height: 10px; 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: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.limit-grid fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 4px; margin: 0; min-width: 0; }
.limit-grid legend { padding: 0 6px; font-weight: 650; }
.token-box { font-family: var(--mono); overflow-wrap: anywhere; }
@media (max-width: 600px) { .spend-strip { padding: 10px 12px; } .meter { width: 120px; } }

/* 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: 18px; margin: 12px 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 10px; }
.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: 42px; padding: 9px 18px; margin-right: 12px; border-radius: 10px; 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 12px; padding: 0; }
.uq-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 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: 36px; padding: 4px 14px; }
.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: 12px; padding: 6px 0; flex-wrap: wrap; }
.ca-name { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 600px) { .dropzone { padding: 12px; } .dropzone input[type="file"]::file-selector-button { margin-bottom: 8px; } }
