/* ════════════════════════════════════════════════════════════════════════
   Now I See It — Customer Portal styles (Phase 2 scaffolding)

   Mobile-first. Theme tokens at :root + per-theme overrides. Switch theme
   via [data-theme="dark|light|dyslexia|hc"] on <html>. Dark is default.

   Reduced motion: when [data-motion="reduced"] is set on <html> by
   user_preferences.js (in response to prefers-reduced-motion: reduce),
   all CSS transitions + animations short-circuit to instant. Browsers
   already do this themselves at the OS layer; we double-down by setting
   the attribute so JS-driven animations can also gate on it.
   ════════════════════════════════════════════════════════════════════════ */

/* ─── Reduced motion — honour OS-level user preference ─────────────────
   When user_preferences.js detects prefers-reduced-motion (or the user
   override()s it), every transition/animation becomes instant. We use
   the attribute selector (not @media) so the user can override even when
   their OS isn't set, and so JS-driven scrolls/animations can read the
   same attribute. */
:root[data-motion="reduced"] *,
:root[data-motion="reduced"] *::before,
:root[data-motion="reduced"] *::after {
  animation-duration: 0.001ms !important;
  animation-delay:    0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  transition-delay:    0.001ms !important;
  scroll-behavior: auto !important;
}



/* ─── Theme tokens ──────────────────────────────────────────────────── */

:root,
:root[data-theme="dark"] {
  /* color-scheme tells the browser "this page is dark" so native form
     controls (select dropdowns, scrollbars, checkboxes, date pickers)
     style themselves to match. Without this, <select>'s native dropdown
     options render with light-mode backgrounds even though the page is
     dark — Gary spotted this on the site-switcher 2026-05-16. */
  color-scheme: dark;
  /* Dark (default) — matches the family Dark palette */
  --bg:               #0f1115;
  --bg-elevated:      #15191f;
  --card-bg:          #1a1d23;
  --fg:               #e6e8eb;
  --fg-muted:         #8a929b;
  --label-fg:         #c5cad1;
  --border:           #2c3138;
  --input-bg:         #1a1d23;
  --input-border:     #3a414a;
  --accent:           #3565b5;
  --accent-bg:        #1a2a44;
  --accent-fg:        #ffffff;
  --primary-fg:       #ffffff;
  --error:            #ff8080;
  --success:          #6fbf6f;
  --warn:             #f0c060;
  --shadow:           0 4px 12px rgba(0, 0, 0, 0.4);
  --font-body:        -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg:               #f7f8fa;
  --bg-elevated:      #ffffff;
  --card-bg:          #ffffff;
  --fg:               #1a1d23;
  --fg-muted:         #5a6068;
  --label-fg:         #2c3138;
  --border:           #d8dce0;
  --input-bg:         #ffffff;
  --input-border:     #c5cad1;
  --accent:           #2c5fa4;
  --accent-bg:        #e8f0fa;
  --accent-fg:        #ffffff;
  --primary-fg:       #ffffff;
  --error:            #c33;
  --success:          #2d7a2d;
  --warn:             #a06a00;
  --shadow:           0 4px 12px rgba(0, 0, 0, 0.08);
}

:root[data-theme="dyslexia"] {
  color-scheme: light;   /* cream-on-warm-paper; light-mode controls match */
  --bg:               #fdf6e3;
  --bg-elevated:      #fff8e7;
  --card-bg:          #fff8e7;
  --fg:               #2a2a2a;
  --fg-muted:         #5a5a5a;
  --label-fg:         #2a2a2a;
  --border:           #c8b070;
  --input-bg:         #fff8e7;
  --input-border:     #b89a55;
  --accent:           #4a5d7f;
  --accent-bg:        #ede0c0;
  --accent-fg:        #ffffff;
  --primary-fg:       #ffffff;
  --error:            #a02020;
  --success:          #2d6a2d;
  --warn:             #8a5a00;
  --shadow:           0 4px 12px rgba(0, 0, 0, 0.1);
  --font-body:        "OpenDyslexic", "Comic Sans MS", "Segoe UI", sans-serif;
}

:root[data-theme="hc"] {
  color-scheme: dark;
  /* High contrast — for visually-impaired users (Universal Access v1) */
  --bg:               #000000;
  --bg-elevated:      #000000;
  --card-bg:          #000000;
  --fg:               #ffffff;
  --fg-muted:         #e0e0e0;
  --label-fg:         #ffffff;
  --border:           #ffffff;
  --input-bg:         #000000;
  --input-border:     #ffffff;
  --accent:           #ffff00;
  --accent-bg:        #003300;
  --accent-fg:        #000000;
  --primary-fg:       #000000;
  --error:            #ff5555;
  --success:          #55ff55;
  --warn:             #ffff55;
  --shadow:           none;
}


/* ─── Base ──────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

html {
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  /* 1.15× default per Universal Access lock 2026-04-27 */
  font-size: calc(16px * 1.15);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app {
  display: flex;
  flex-direction: column;
  flex: 1;
  /* Phase 6a desktop fix (Gary 2026-05-16): admins use this on laptops +
     desktops, not just phones. 720px column on a 1920px monitor felt
     cramped. 1200px gives breathing room for the tile grid + drill-ins
     while still being centred on ultra-wide displays. Sign-in form
     constrains itself separately below — it stays readable. */
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
}

/* Sign-in surfaces stay narrow + centred — a 1200px-wide sign-in card
   looks wrong. Constrain just these two. */
.welcome,
#signin-form {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover,
a:focus {
  text-decoration-thickness: 2px;
}


/* ─── Header ────────────────────────────────────────────────────────── */

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.app-header__logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex-shrink: 0;
}

.app-header__titles {
  flex: 1;
  min-width: 0;
}

.app-header__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.app-header__subtitle {
  margin: 2px 0 0;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

.app-header__controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.app-header__email {
  display: inline-block;
  padding: 6px 12px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--accent);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Phase 9 fix (Gary 2026-05-16): explicit option styling so dropdowns
   render with the page's theme colours instead of the browser's native
   light-mode fallback. color-scheme on :root handles most browsers; this
   is the belt-and-braces for the rest + for older Chromium. */
select option {
  background: var(--card-bg);
  color: var(--fg);
}

.lang-picker__select,
.theme-picker__select {
  appearance: none;
  background: var(--bg-elevated);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 28px 8px 12px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.lang-picker__select:focus,
.theme-picker__select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ─── Main ──────────────────────────────────────────────────────────── */

.app-main {
  flex: 1;
}

.welcome {
  text-align: center;
  margin-bottom: 24px;
}

.welcome__hero {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.welcome__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.welcome__subtitle {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin: 0;
}


/* ─── Card ──────────────────────────────────────────────────────────── */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin: 0 0 16px;
  box-shadow: var(--shadow);
}

.card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.card__subtitle {
  margin: 0 0 16px;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.card--info {
  border-left: 4px solid var(--accent);
}


/* ─── Form ──────────────────────────────────────────────────────────── */

.field {
  margin-bottom: 16px;
}

.field__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--label-fg);
  margin-bottom: 6px;
}

.field__input {
  width: 100%;
  padding: 10px 12px;
  background: var(--input-bg);
  color: var(--fg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font: inherit;
  font-size: 1rem;
}

.field__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.field__row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.field__row .field__input {
  flex: 1;
}

.field__hint {
  margin: 6px 0 0;
  color: var(--fg-muted);
  font-size: 0.8rem;
}


/* ─── Buttons ───────────────────────────────────────────────────────── */

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg);
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn:hover {
  border-color: var(--accent);
}

.btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.btn--primary:hover {
  filter: brightness(1.1);
}

.btn--block {
  width: 100%;
}

.btn--small {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.forgot-row {
  text-align: center;
  margin: 16px 0 0;
  font-size: 0.9rem;
}


/* ─── Status messages ──────────────────────────────────────────────── */

.status {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin: 12px 0;
}

.status--muted   { background: var(--bg-elevated); color: var(--fg-muted); }
.status--error   { background: var(--bg-elevated); color: var(--error); border: 1px solid var(--error); }
.status--success { background: var(--bg-elevated); color: var(--success); border: 1px solid var(--success); }
.status--warn    { background: var(--bg-elevated); color: var(--warn); border: 1px solid var(--warn); }


/* ─── Footer ────────────────────────────────────────────────────────── */

.app-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.app-footer__icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.app-footer__copy {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.app-footer__sep {
  color: var(--fg-muted);
}


/* ─── Phase banner (removed after Phase 3 wires Auth) ──────────────── */

.phase-banner {
  text-align: center;
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px dashed var(--warn);
  border-radius: 8px;
  color: var(--warn);
  font-size: 0.85rem;
}


/* ─── Utility ──────────────────────────────────────────────────────── */

.muted { color: var(--fg-muted); }

[hidden] { display: none !important; }


/* ─── Phase 4 — Greeting strip ─────────────────────────────────────── */

.greeting-strip {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}

.greeting-strip__hi {
  font-size: 1.15rem;
  font-weight: 600;
}

.greeting-strip__date {
  color: var(--fg-muted);
  font-size: 0.9rem;
}


/* ─── Phase 4 — Recently-visited strip ─────────────────────────────── */

.recent-strip-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.recent-strip__title {
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.recent-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.recent-strip__empty {
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.recent-strip__chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.recent-strip__chip:hover {
  border-color: var(--accent);
}

.recent-strip__chip-icon {
  font-size: 0.95rem;
}


/* ─── Phase 4 — Tile grid ──────────────────────────────────────────── */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.tile {
  appearance: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 110px;
  font: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.tile:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tile__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tile__icon {
  font-size: 1.2rem;
}

.tile__label {
  font-weight: 700;
  font-size: 1rem;
}

.tile__metric {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

.tile__note {
  color: var(--fg-muted);
  font-size: 0.85rem;
  line-height: 1.3;
}


/* ─── Visible-locked tile pattern (capability-gated) ─────────────────
 *
 * Capability tiles the customer's licence hasn't granted stay VISIBLE so
 * they know the capability exists — discoverability through visibility,
 * mirroring the main app's module-carousel locked-state pattern. The lock
 * badge + muted metric + dimmed look mark them as not active. They stay
 * clickable; the drill-in explains what the capability does and how to
 * add it to the licence. Captured Gary 2026-05-19; rules #15 + #109 +
 * "discoverability through visibility, gating through visual marking".
 */

.tile.tile--locked {
  opacity: 0.72;
  border-style: dashed;
}

.tile.tile--locked:hover {
  opacity: 0.92;
  border-style: solid;
  border-color: var(--fg-muted);
  transform: translateY(-1px);
}

.tile.tile--locked .tile__metric {
  color: var(--fg-muted);
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 600;
}

.tile__lock {
  margin-left: auto;
  font-size: 0.95rem;
  opacity: 0.7;
}


/* ─── Phase 4 — Drill-in view ──────────────────────────────────────── */

.drill-back {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.drill-back:hover {
  text-decoration: underline;
}

.drill-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.drill-body {
  margin-bottom: 16px;
}


/* ─── Phase 4 — Overview snapshot mini-cards ───────────────────────── */

.overview-snapshot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.snapshot-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: help;
}

.snapshot-card__label {
  color: var(--fg-muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.snapshot-card__value {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.snapshot-card__note {
  color: var(--fg-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.overview-whatsnew {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.overview-whatsnew h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
}


/* ═══ Phase 5a — Seats drill-in ═════════════════════════════════════ */

/* ─── Pill semantics (shared with HQ patterns: ok/warn/bad) ────────── */

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted);
}
.pill--ok   { border-color: #2b5a3a; color: #bfffd2; background: rgba(43, 90, 58, 0.15); }
.pill--warn { border-color: #5a4b2b; color: #ffe8b6; background: rgba(90, 75, 43, 0.15); }
.pill--bad  { border-color: #5a2b2b; color: #ffb6b6; background: rgba(90, 43, 43, 0.15); }

/* ─── Summary card (top of seats drill-in) ─────────────────────────── */

.seats-summary {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.seats-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.seats-summary__count {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.seats-summary__big {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.seats-summary__of {
  color: var(--fg-muted);
  font-size: 0.95rem;
}
.seats-summary__sub {
  margin-top: 8px;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

/* ─── Over-limit banner ───────────────────────────────────────────── */

.seats-overlimit-banner {
  background: rgba(90, 43, 43, 0.2);
  border: 1px solid #5a2b2b;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  color: #ffb6b6;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ─── Per-institution section ─────────────────────────────────────── */

.institution-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.institution-section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.institution-section__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
  min-width: 200px;
}
.institution-section__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.institution-section__expiry {
  color: var(--fg-muted);
  font-size: 0.8rem;
  cursor: help;
}

/* ─── Modules-as-chips ────────────────────────────────────────────── */

.modules-section {
  margin-bottom: 14px;
}
.modules-section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.modules-section__title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}
.modules-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.module-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: help;
}

/* ─── Activations table (the "seats") ─────────────────────────────── */

.seats-table {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.seats-table__head {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}
.seats-table__row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  align-items: center;
}
.seats-table__row:last-child {
  border-bottom: none;
}
.seats-table__row[data-status="deactivated"] {
  opacity: 0.55;
}
.seats-table__name {
  font-weight: 600;
}
.seats-table__machine {
  color: var(--fg-muted);
  font-family: ui-monospace, "Consolas", "Menlo", monospace;
  font-size: 0.82rem;
  cursor: help;
}
.seats-table__when {
  color: var(--fg-muted);
  cursor: help;
}
.seats-table__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Inline button used in modules-section + table-actions + institution-actions */
.link-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  border-radius: 6px;
  padding: 3px 9px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.link-btn:not(:disabled):hover {
  border-color: var(--accent);
}
.link-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.link-btn--danger:not(:disabled) {
  color: #ffb6b6;
  border-color: #5a2b2b;
}

/* ─── Per-institution actions ─────────────────────────────────────── */

.institution-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── Phase-5b honest note at bottom ──────────────────────────────── */

.phase5b-note {
  margin: 20px 0 8px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px dashed var(--warn);
  border-radius: 10px;
  color: var(--fg-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}
.phase5b-note strong {
  color: var(--warn);
}

/* ─── Mobile: stack table rows vertically ─────────────────────────── */

@media (max-width: 560px) {
  .seats-table__head {
    display: none;
  }
  .seats-table__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .seats-table__row > span {
    padding: 0;
  }
  .seats-table__name {
    font-size: 1rem;
  }
}


/* ═══ Phase 6a — Settings drill-in + Branding wizard ═══════════════ */

.settings-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.settings-section__head {
  margin-bottom: 14px;
}
.settings-section__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
}
.settings-section__sub {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}


/* Phase 9 — Scope banner above the branding wizard. Names whether
   the wizard's edits apply contract-wide or to a single site. */
.branding-scope-banner {
  background: var(--accent-bg, rgba(90, 138, 204, 0.15));
  border: 1px solid var(--accent, #3565b5);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--fg);
}
.branding-scope-banner strong {
  color: var(--accent);
  font-weight: 700;
}


/* ─── Branding wizard ────────────────────────────────────────────── */

.branding-wizard {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* The drop zone for the logo */
.brand-logo-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  cursor: pointer;
  background: var(--bg-elevated);
  transition: border-color 0.15s, background-color 0.15s;
  position: relative;
}
.brand-logo-zone:hover {
  border-color: var(--accent);
}
.brand-logo-zone--drag {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.brand-logo-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--fg-muted);
  pointer-events: none;
}
.brand-logo-prompt__icon {
  font-size: 1.6rem;
  color: var(--accent);
}
.brand-logo-prompt__label {
  font-weight: 600;
  color: var(--fg);
}
.brand-logo-prompt__hint {
  font-size: 0.8rem;
}
.brand-logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo-preview img {
  max-width: 128px;
  max-height: 128px;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: var(--shadow);
}


/* ─── Accent picker ─────────────────────────────────────────────── */

.accent-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.accent-preset {
  appearance: none;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
}
.accent-preset:hover {
  border-color: var(--accent);
}
.accent-preset--active {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.accent-preset__swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.accent-preset__name {
  flex: 1;
  font-weight: 500;
}

.accent-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.accent-custom__label {
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.accent-custom__input {
  appearance: none;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  width: 48px;
  height: 32px;
  cursor: pointer;
  padding: 2px;
  background: transparent;
}
.accent-custom__hex {
  font-family: ui-monospace, "Consolas", "Menlo", monospace;
  font-size: 0.85rem;
  color: var(--fg-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

/* WCAG AA contrast chip — live feedback as the user picks an accent.
   White-text-on-accent is the load-bearing surface (primary buttons,
   accent-coloured badges); the ratio is reported live so the user
   doesn't have to hit Save to discover their pick is unreadable. */
.accent-wcag-chip {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  background: var(--bg-elevated);
  white-space: nowrap;
}
.accent-wcag-chip[data-status="pass"] {
  color: var(--success);
  border-color: var(--success);
  background: rgba(111, 191, 111, 0.08);
}
.accent-wcag-chip[data-status="warn"] {
  color: var(--warn);
  border-color: var(--warn);
  background: rgba(240, 192, 96, 0.08);
}
.accent-wcag-chip[data-status="fail"] {
  color: var(--error);
  border-color: var(--error);
  background: rgba(255, 128, 128, 0.08);
}
.accent-wcag-chip:empty { display: none; }


/* ─── Other-settings placeholder grid ───────────────────────────── */

.settings-other-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.settings-other-card {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: help;
}
.settings-other-card strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.settings-other-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.4;
}
.settings-other-card em {
  color: var(--warn);
  font-style: normal;
  font-weight: 600;
}


/* ═══ Phase 7a — Push drill-in ═════════════════════════════════════ */

/* ─── Tabs ─────────────────────────────────────────────────────────── */

.push-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}
.push-tab {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;   /* overlap the divider so active tab sits flush */
  white-space: nowrap;
}
.push-tab:hover {
  color: var(--fg);
}
.push-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}


/* ─── Compose layout: form left, phone preview right ───────────────── */

.push-compose-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 880px) {
  .push-compose-layout {
    grid-template-columns: 1fr;
  }
}

.push-compose-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field__char-count {
  float: right;
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.field__input--textarea {
  resize: vertical;
  font-family: inherit;
  min-height: 80px;
}

.field__input--datetime {
  font-family: inherit;
}

.push-action-row,
.push-when-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.push-action-opt,
.push-when-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  cursor: pointer;
}
.push-action-opt:hover,
.push-when-row label:hover {
  border-color: var(--accent);
}

.push-when-row input[type="datetime-local"]:disabled {
  opacity: 0.5;
}


/* ─── Phone-frame preview ──────────────────────────────────────────── */

.push-preview {
  position: sticky;
  top: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.push-preview__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  align-self: flex-start;
}

.phone-frame {
  width: 260px;
  height: 460px;
  background: #000;
  border-radius: 32px;
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  position: relative;
  border: 2px solid #1a1a1a;
}
.phone-frame__notch {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 18px;
  background: #000;
  border-radius: 0 0 10px 10px;
  z-index: 2;
}
.phone-frame__screen {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #1a3052 0%, #0f1a2c 100%);
  border-radius: 24px;
  padding: 36px 12px 12px;
  overflow: hidden;
  position: relative;
}

.phone-notification {
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  border-radius: 14px;
  padding: 10px 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12.5px;
  line-height: 1.35;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
}
.phone-notification__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 11px;
}
.phone-notification__icon {
  font-size: 14px;
}
.phone-notification__app {
  flex: 1;
  font-weight: 600;
  color: #5a5a5a;
}
.phone-notification__time {
  color: #8a8a8a;
}
.phone-notification__title {
  font-weight: 700;
  margin-bottom: 2px;
  word-wrap: break-word;
}
.phone-notification__body {
  color: #2a2a2a;
  word-wrap: break-word;
  max-height: 200px;
  overflow: hidden;
}
.phone-notification__placeholder {
  color: #aaa;
  font-style: italic;
  font-weight: 400;
}
.phone-notification__actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.phone-notification__btn {
  appearance: none;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #1a3052;
  cursor: default;
}
.phone-notification__btn--primary {
  background: #1a3052;
  color: #fff;
  width: 100%;
}

.push-preview__note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-align: center;
  line-height: 1.4;
}


/* ─── Audience tab ─────────────────────────────────────────────────── */

.audience-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.audience-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: help;
}
.audience-row__label {
  font-weight: 600;
  font-size: 0.9rem;
}
.audience-row__reach {
  color: var(--fg-muted);
  font-size: 0.85rem;
}


/* ─── Sent log tab ─────────────────────────────────────────────────── */

.push-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.push-log__row {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.push-log__row:hover {
  border-color: var(--accent);
}
.push-log__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 0.8rem;
}
.push-log__time {
  color: var(--fg-muted);
}
.push-log__audience {
  color: var(--fg-muted);
  font-weight: 600;
}
.push-log__title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.push-log__body {
  color: var(--fg-muted);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 6px;
}
.push-log__stats {
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-family: ui-monospace, "Consolas", "Menlo", monospace;
}


/* ═══ Phase 10a — Role toggle + facilitator drill-ins ═════════════ */

/* ─── Role toggle pill (segmented control in header) ───────────────── */

.role-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  background: var(--bg-elevated);
}
.role-toggle__opt {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  padding: 5px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.role-toggle__opt:hover {
  color: var(--fg);
}
.role-toggle__opt--active {
  background: var(--accent);
  color: var(--accent-fg);
}

/* ─── Inbox cards (facilitator) ────────────────────────────────────── */

.inbox-list,
.classes-list,
.help-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inbox-card,
.class-card,
.help-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.inbox-card__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.inbox-card__from { font-weight: 600; }
.inbox-card__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}
.inbox-card__body {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--fg);
  line-height: 1.45;
}
.inbox-card__rsvp {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

/* ─── Today's classes cards ───────────────────────────────────────── */

.class-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
}
.class-card:hover {
  border-color: var(--accent);
}
.class-card__time {
  font-size: 0.95rem;
  white-space: nowrap;
}
.class-card__label {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.class-card__room {
  font-size: 0.85rem;
}

/* ─── Need-help cards ─────────────────────────────────────────────── */

.help-card__title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}
.help-card__body {
  margin: 0;
  font-size: 0.88rem;
  color: var(--fg);
  line-height: 1.45;
}

/* ─── My profile (key/value grid) ─────────────────────────────────── */

.profile-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
}
@media (max-width: 480px) {
  .profile-row {
    grid-template-columns: 1fr;
  }
}
.profile-row__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
}
.profile-row__value input,
.profile-row__value select {
  width: 100%;
}


/* ═══ Phase 11c — Settings → Resolution sub-section ══════════════ */

.resolution-tab__intro {
  margin: 0 0 12px;
  color: var(--fg-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.resolution-last {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.resolution-discipline {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  color: var(--fg-muted);
}
.resolution-discipline p {
  margin: 8px 0 4px;
}
.resolution-discipline p:first-child {
  margin-top: 0;
}
.resolution-discipline strong {
  color: var(--fg);
}
.resolution-discipline ul {
  margin: 0 0 8px;
  padding-left: 20px;
}
.resolution-discipline li {
  margin: 3px 0;
}
.resolution-discipline code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}

.resolution-access-beta-banner {
  background: rgba(90, 75, 43, 0.15);
  border: 1px solid #5a4b2b;
  color: #ffe8b6;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.resolution-access-beta-banner code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}

.resolution-section__sub {
  margin: 14px 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

.resolution-access-can,
.resolution-access-cannot {
  margin: 0 0 10px;
  padding-left: 22px;
  font-size: 0.88rem;
  line-height: 1.55;
}
.resolution-access-can li {
  color: var(--success, #6fbf6f);
}
.resolution-access-cannot li {
  color: var(--fg-muted);
}

.resolution-access-form {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-top: 14px;
  opacity: 0.7;
}


/* ═══ Phase 9a — Site switcher + multi-site banners ═══════════════ */

.site-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
}
.site-switcher__icon {
  font-size: 0.9rem;
}
.site-switcher__select {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0 14px 0 2px;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%),
                    linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - 5px) 50%, calc(100% - 1px) 50%;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}
.site-switcher__select:focus {
  outline: none;
}
.site-switcher--static {
  cursor: default;
  color: var(--fg-muted);
}

/* All-sites read-only banner (top of Seats drill-in) */
.seats-aggregate-banner {
  background: rgba(90, 75, 43, 0.15);
  border: 1px solid #5a4b2b;
  color: #ffe8b6;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
}


/* ═══ Phase 11a — AI key + Downloads + Receipts ═══════════════════ */

/* ─── AI key summary card ──────────────────────────────────────────── */

.ai-key-summary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-key-summary__row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  font-size: 0.88rem;
  align-items: center;
}
.ai-key-summary__row strong {
  font-weight: 600;
  color: var(--fg-muted);
}

/* Rotate / Clear disclosure */
.ai-key-rotate {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}
.ai-key-rotate__summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.9rem;
  user-select: none;
}
.ai-key-rotate__summary:hover {
  background: rgba(255, 255, 255, 0.03);
}
.ai-key-rotate__summary--danger {
  color: #ffb6b6;
}
.ai-key-rotate__body {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}


/* ─── Downloads grid ──────────────────────────────────────────────── */

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.installer-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.installer-card--pwa {
  border-left: 3px solid var(--accent);
}
.installer-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.installer-card__icon {
  font-size: 1.4rem;
}
.installer-card__label {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
}
.installer-card__version {
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-family: ui-monospace, "Consolas", "Menlo", monospace;
}
.installer-card__desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.45;
}
.installer-card__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

/* btn--small reuse + variants for the installer download buttons */
.btn--small {
  padding: 5px 10px;
  font-size: 0.8rem;
}


/* ─── Receipts table ──────────────────────────────────────────────── */

.receipts-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.receipts-table__head {
  display: grid;
  grid-template-columns: 100px 1.8fr 110px 90px 70px;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}
.receipts-table__row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.receipts-table__row:last-child {
  border-bottom: none;
}
.receipts-table__row[open] {
  background: var(--bg-elevated);
}
.receipts-table__summary {
  display: grid;
  grid-template-columns: 100px 1.8fr 110px 90px 70px;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  align-items: center;
  font-size: 0.88rem;
  list-style: none;
}
.receipts-table__summary::-webkit-details-marker {
  display: none;
}
.receipts-table__summary:hover {
  background: rgba(255, 255, 255, 0.03);
}
.receipts-table__date {
  font-family: ui-monospace, "Consolas", "Menlo", monospace;
  color: var(--fg-muted);
  font-size: 0.82rem;
}
.receipts-table__desc {
  font-weight: 500;
}
.receipts-table__amount {
  font-family: ui-monospace, "Consolas", "Menlo", monospace;
  font-weight: 700;
  text-align: right;
}
.receipts-table__detail {
  padding: 0 14px 14px;
}
.receipts-line-items {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.receipts-line-items th,
.receipts-line-items td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.receipts-line-items th {
  text-align: left;
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.receipts-line-items__amount {
  text-align: right;
  font-family: ui-monospace, "Consolas", "Menlo", monospace;
}
.receipts-line-items__total td {
  border-bottom: none;
  padding-top: 10px;
}
.receipts-detail__meta {
  display: flex;
  gap: 18px;
  font-size: 0.8rem;
  color: var(--fg-muted);
  flex-wrap: wrap;
}
.receipts-detail__meta code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Mobile: stack receipts table */
@media (max-width: 640px) {
  .receipts-table__head { display: none; }
  .receipts-table__summary {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .receipts-table__amount {
    text-align: left;
  }
}


/* ═══ Phase 11b — Templates section ═══════════════════════════════ */

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.template-slot {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.template-slot--custom {
  border-left: 3px solid var(--accent);
}

.template-slot__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.template-slot__icon {
  font-size: 1.3rem;
}
.template-slot__label {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
  min-width: 120px;
}
.template-slot__desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.45;
}

.template-slot__current {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.template-slot__filename {
  font-weight: 600;
  word-break: break-word;
}
.template-slot__meta {
  color: var(--fg-muted);
  font-size: 0.75rem;
  cursor: help;
}

.template-slot__variables {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--fg-muted);
  cursor: help;
}
.template-slot__variables strong {
  color: var(--fg);
  display: block;
  margin-bottom: 2px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.template-slot__variables code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.82em;
  font-family: ui-monospace, "Consolas", "Menlo", monospace;
  white-space: nowrap;
}

.template-slot__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

/* Make the file-upload label look like a button */
.template-slot__actions label.btn {
  cursor: pointer;
}


/* ─── Phase 4 — Placeholder for unbuilt tiles ──────────────────────── */

.placeholder {
  background: var(--bg-elevated);
  border: 1px dashed var(--warn);
  border-radius: 10px;
  padding: 16px 18px;
}

.placeholder h3 {
  margin: 0 0 8px;
  color: var(--warn);
  font-size: 1rem;
}


/* ─── Status-pill mount in header ──────────────────────────────────── */

#status-pill-mount {
  display: inline-flex;
  align-items: center;
}


/* ─── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .app { padding: 12px; }
  .app-header { flex-direction: column; align-items: flex-start; }
  .app-header__controls { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .welcome__title { font-size: 1.3rem; }
  .tile-grid { grid-template-columns: 1fr; }
  .overview-snapshot { grid-template-columns: repeat(2, 1fr); }
}
