/*
 * Air One admin UI: design system on top of the bundled Bootstrap 4 (grid helpers and modal JS only).
 * Look: Fluent-style operator console (navy rail, white top bar, light content, flat white panels)
 * in Tech Vista colours. Brand tokens come from the Tech Vista site (techvista_web
 * lib/theme/app_colors.dart, app_theme.dart); console tokens from the owner's mockups.
 * Every colour is defined once in the token block and used by name.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  /* block, not swap: with the preload in base.html and a long cache the font is there
     before first paint, so text never appears in a fallback face and then changes */
  font-display: block;
  src: url("../fonts/InterVariable.woff2?v=1") format("woff2");
}

:root {
  /* brand (AppColors) */
  --tv-navy: #003756;
  --tv-navy-deep: #002640;
  --tv-navy-light: #1a5570;
  --tv-surface-navy: #004b73;
  --tv-rail-active: #0a4a6b;
  --tv-border-navy: #0d3d57;
  --tv-teal: #00b4d8;
  --tv-teal-light: #48cae4;
  --tv-sky: #4fc3f7;
  --tv-red: #e1262d;
  --tv-white: #ffffff;
  --tv-text-on-navy-2: #b0c4d8;
  --tv-text-rail: #d5e3ee;
  --tv-text-on-navy-3: #a0bacf;
  /* console (owner mockups) */
  --tv-ink: #0b2233;
  --tv-muted: #4a6072;
  --tv-link: #005f8a;
  --tv-page: #f5f7f9;
  --tv-border: #dde3e9;
  --tv-divider: #e6ecf1;
  --tv-btn-border: #b8c6d2;
  --tv-input-border: #6b7f90; /* darker than the mockup's #B8C6D2: 3:1 against white is required for controls */
  --tv-red-dark: #b71c22;
  /* status pills: tinted background, dark text, dot (never colour alone) */
  --tv-pill-info-bg: #ddf1fa;
  --tv-pill-info-fg: #00405e;
  --tv-pill-info-dot: #0078a8;
  --tv-pill-warn-bg: #ffefd2;
  --tv-pill-warn-fg: #6b4300;
  --tv-pill-warn-dot: #b26b00;
  --tv-pill-ok-bg: #dff5e6;
  --tv-pill-ok-fg: #0f4f26;
  --tv-pill-ok-dot: #1e8e3e;
  --tv-pill-bad-bg: #fde4e4;
  --tv-pill-bad-fg: #7a1218;
  --tv-pill-bad-dot: #c62828;
  --tv-pill-off-bg: #e6ecf1;
  --tv-pill-off-fg: #2b4256;
  --tv-pill-off-dot: #6b7f90;
  --tv-brand-glow: rgba(0, 55, 86, 0.08);
  /* share bars (dashboard): one hue; the track is a lighter step of the same blue */
  --tv-bar-fill: #0078a8; /* 4.8:1 on white */
  --tv-bar-track: #ddf1fa;
  /* Admins and access: the selected account row, the switch track when off */
  --tv-row-selected: #eef6fb;
  --tv-switch-off: #6b7f90;
  /* Broadcast (phase 8): the phone preview, its app icon and the image drop zone */
  --tv-phone: var(--tv-navy-deep);
  --tv-phone-note: var(--tv-text-on-navy-2);
  --tv-card-radius: 14px;
  --tv-icon-bg: #e3f6fb;
  --tv-drop-border: #8ca0b0;
  --tv-card-text: #23394a;

  /* type */
  --tv-font: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  --tv-font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* radius */
  --tv-radius-btn: 6px;
  --tv-radius-input: 8px;
  --tv-radius-panel: 8px;
  --tv-radius-dialog: 16px;
  --tv-radius-chip: 4px;

  /* spacing scale (4, 8, 16, 24, 32, 48) */
  --tv-space-1: 4px;
  --tv-space-2: 8px;
  --tv-space-3: 16px;
  --tv-space-4: 24px;
  --tv-space-5: 32px;
  --tv-space-6: 48px;

  --tv-rail-width: 232px;
  --tv-control: 40px;
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--tv-page);
  color: var(--tv-ink);
  font-family: var(--tv-font);
  font-size: 15px;
  line-height: 1.5;
}
h1,
h2,
h3 {
  color: var(--tv-ink);
  font-weight: 600;
  margin: 0 0 var(--tv-space-2);
}
h1 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 16px;
  line-height: 1.3;
}
h3 {
  font-size: 15px;
}
p {
  margin: 0 0 var(--tv-space-3);
}
a {
  color: var(--tv-link);
}
a:hover {
  color: var(--tv-navy);
}
code {
  font-family: var(--tv-font-mono);
  font-size: 13px;
  color: var(--tv-ink);
  background: var(--tv-page);
  border: 1px solid var(--tv-divider);
  border-radius: var(--tv-radius-chip);
  padding: 1px 6px;
  overflow-wrap: anywhere;
}
hr {
  border: 0;
  border-top: 1px solid var(--tv-border);
  margin: var(--tv-space-4) 0;
}
.text-muted,
.form-text,
small {
  color: var(--tv-muted) !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.text-break {
  overflow-wrap: anywhere;
}

/* ---------- focus ---------- */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--tv-navy);
  outline-offset: 2px;
}
.rail :focus-visible,
.auth-brand-panel :focus-visible {
  outline-color: var(--tv-teal);
}
.skip-link {
  position: absolute;
  left: var(--tv-space-3);
  top: -100px;
  z-index: 2000;
  background: var(--tv-white);
  color: var(--tv-navy);
  padding: var(--tv-space-2) var(--tv-space-3);
  border-radius: var(--tv-radius-btn);
  border: 2px solid var(--tv-navy);
  font-weight: 600;
}
.skip-link:focus {
  top: var(--tv-space-2);
}

/* ---------- shell: navy rail + white top bar + light content ---------- */
.shell {
  display: flex;
  min-height: 100vh;
}
.rail {
  flex: 0 0 var(--tv-rail-width);
  width: var(--tv-rail-width);
  background: var(--tv-navy-deep);
  color: var(--tv-text-rail);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  color: var(--tv-white);
  text-decoration: none;
}
.rail-brand:hover {
  color: var(--tv-white);
}
.rail-mark {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--tv-radius-input);
  background: var(--tv-white);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rail-mark img {
  width: 24px;
  height: 24px;
  display: block;
}
.rail-name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.rail-name strong {
  font-size: 16px;
  font-weight: 700;
}
.rail-name span {
  font-size: 12px;
  color: var(--tv-text-on-navy-2);
}
.rail ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail-group-title {
  margin: 0 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tv-text-on-navy-3);
}
.rail-group + .rail-group,
.rail-sections > * + *,
.rail-sections {
  margin-top: var(--tv-space-3);
}
.rail a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tv-control);
  padding: 0 10px;
  border-radius: var(--tv-radius-btn);
  color: var(--tv-text-rail);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
  border-left: 3px solid transparent;
}
.rail a:hover {
  background: var(--tv-rail-active);
  color: var(--tv-white);
}
.rail a[aria-current="page"] {
  background: var(--tv-rail-active);
  color: var(--tv-white);
  font-weight: 600;
  border-left-color: var(--tv-teal);
}
/* "you are in this section" (aria-current=true) is quieter when a page item below is current */
.rail a[aria-current="true"] {
  color: var(--tv-white);
  font-weight: 600;
}
.rail:not(:has(.rail-sections a[aria-current="page"])) a[aria-current="true"] {
  background: var(--tv-rail-active);
  border-left-color: var(--tv-teal);
}
.rail svg {
  flex: none;
}
.content-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: var(--tv-white);
  border-bottom: 1px solid var(--tv-border);
  padding: 8px 28px;
  min-height: 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tv-space-2) var(--tv-space-3);
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
  color: var(--tv-muted);
  min-width: 0;
}
.crumbs li {
  overflow-wrap: anywhere;
}
.crumbs li + li::before {
  content: "/";
  margin-right: 4px;
  color: var(--tv-muted);
}
.crumbs [aria-current="page"] {
  color: var(--tv-ink);
  font-weight: 600;
}
.account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.account form {
  margin: 0;
}
.account-email {
  font-size: 14px;
  color: var(--tv-muted);
  overflow-wrap: anywhere;
}
.avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tv-navy);
  color: var(--tv-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.main {
  flex: 1 0 auto;
  padding: 28px;
}
.main:focus {
  outline: none;
}
.site-footer {
  border-top: 1px solid var(--tv-border);
  background: var(--tv-white);
  color: var(--tv-muted);
  font-size: 13px;
  padding: var(--tv-space-3) 28px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--tv-space-2) var(--tv-space-4);
}
.site-footer p {
  margin: 0;
}

/* phones: the rail stacks on top and the sections menu collapses */
@media (max-width: 767.98px) {
  .shell {
    flex-direction: column;
  }
  .rail {
    flex: none;
    width: 100%;
    padding: 10px 12px;
    gap: 8px;
  }
  .rail-brand {
    padding: 0 8px;
  }
  .rail-toggle summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--tv-white);
    border-radius: var(--tv-radius-btn);
    border: 1px solid var(--tv-border-navy);
  }
  .rail-toggle summary:hover {
    background: var(--tv-rail-active);
  }
  .rail-toggle[open] summary {
    margin-bottom: var(--tv-space-2);
  }
  .rail a {
    min-height: 44px;
  }
  .topbar,
  .site-footer {
    padding-left: var(--tv-space-3);
    padding-right: var(--tv-space-3);
  }
  .account {
    margin-left: 0;
  }
  .main {
    padding: var(--tv-space-4) var(--tv-space-3);
  }
  h1 {
    font-size: 22px;
  }
}
@media (max-width: 575.98px) {
  .account-email {
    display: none;
  }
}
@media (min-width: 768px) {
  /* always open on wide screens, whatever the details state */
  .rail-toggle > summary {
    display: none;
  }
}

/* ---------- page parts ---------- */
.page-head {
  margin-bottom: var(--tv-space-4);
}
.page-head h1 {
  margin-bottom: var(--tv-space-1);
}
.page-head p {
  color: var(--tv-muted);
  font-size: 14px;
  margin: 0;
}
.panel {
  background: var(--tv-white);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-panel);
  margin-bottom: var(--tv-space-4);
  overflow: hidden;
}
.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--tv-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.panel-head h2 {
  margin: 0;
  flex-grow: 1;
}
.panel-body {
  padding: 18px;
}
.panel-body > :last-child {
  margin-bottom: 0;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tv-space-2);
  margin-bottom: var(--tv-space-3);
}
.app-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0 0 var(--tv-space-4);
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--tv-border);
}
.app-tabs a {
  display: flex;
  align-items: center;
  min-height: var(--tv-control);
  padding: 0 14px;
  color: var(--tv-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.app-tabs a:hover {
  color: var(--tv-navy);
  background: var(--tv-white);
}
.app-tabs a[aria-current="page"] {
  color: var(--tv-navy);
  font-weight: 600;
  border-bottom-color: var(--tv-navy);
}
.app-tabs a.tab-danger {
  color: var(--tv-red-dark);
}
.app-tabs a.tab-danger[aria-current="page"] {
  border-bottom-color: var(--tv-red-dark);
}
.app-title {
  margin-bottom: var(--tv-space-3);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tv-space-2);
  min-height: var(--tv-control);
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--tv-radius-btn);
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--tv-navy);
  border-color: var(--tv-navy);
  color: var(--tv-white);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--tv-navy-deep);
  border-color: var(--tv-navy-deep);
  color: var(--tv-white);
}
.btn-secondary,
.btn:not([class*="btn-"]) {
  background: var(--tv-white);
  border-color: var(--tv-btn-border);
  color: var(--tv-ink);
  font-weight: 500;
}
.btn-secondary:hover,
.btn:not([class*="btn-"]):hover {
  background: var(--tv-page);
  border-color: var(--tv-muted);
  color: var(--tv-ink);
}
.btn-danger {
  background: var(--tv-red);
  border-color: var(--tv-red);
  color: var(--tv-white);
}
.btn-danger:hover,
.btn-danger:focus {
  background: var(--tv-red-dark);
  border-color: var(--tv-red-dark);
  color: var(--tv-white);
}
.btn-outline-danger {
  background: var(--tv-white);
  border-color: var(--tv-btn-border);
  color: var(--tv-red-dark);
}
.btn-outline-danger:hover {
  background: var(--tv-pill-bad-bg);
  border-color: var(--tv-red-dark);
  color: var(--tv-red-dark);
}
.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}
/* A small button with no colour variant is a secondary button. The rule above,
   .btn:not([class*="btn-"]), never matched it ("btn-sm" contains "btn-"), so it had no
   border or background and read as bold text ("Check again", "Sign out"). */
.btn.btn-sm:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-outline-danger):not(.btn-quiet):not(.btn-action) {
  background: var(--tv-white);
  border-color: var(--tv-btn-border);
  color: var(--tv-ink);
}
.btn.btn-sm:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-outline-danger):not(.btn-quiet):not(.btn-action):hover {
  background: var(--tv-page);
  border-color: var(--tv-muted);
  color: var(--tv-ink);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
@media (pointer: coarse) {
  .btn {
    min-height: 44px;
  }
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tv-space-2);
  align-items: center;
}
td form {
  margin: 0;
  display: inline-block;
}

/* ---------- forms ---------- */
label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  color: var(--tv-ink);
  margin-bottom: 6px;
}
fieldset {
  border: 0;
  margin: 0 0 var(--tv-space-3);
  padding: 0;
  min-width: 0;
}
legend {
  float: none;
  width: auto;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}
.form-group {
  margin-bottom: var(--tv-space-3);
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--tv-space-4);
  margin: 0 0 var(--tv-space-3);
}
.form-row > .col {
  flex: 1 1 18rem;
  min-width: 0;
  padding: 0;
  margin-bottom: var(--tv-space-3);
}
.form-control {
  display: block;
  width: 100%;
  min-height: var(--tv-control);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  color: var(--tv-ink);
  background: var(--tv-white);
  border: 1px solid var(--tv-input-border);
  border-radius: var(--tv-radius-input);
}
textarea.form-control {
  min-height: 6rem;
  resize: vertical;
}
.form-control::placeholder {
  color: var(--tv-muted);
  opacity: 1;
}
.form-control:hover {
  border-color: var(--tv-navy);
}
.form-control:focus {
  border-color: var(--tv-navy);
  outline: 2px solid var(--tv-navy);
  outline-offset: 1px;
  box-shadow: none;
}
.form-control[readonly] {
  background: var(--tv-page);
}
.form-control:disabled {
  background: var(--tv-page);
  color: var(--tv-muted);
}
.help-block,
.form-text {
  display: block;
  font-size: 13px;
  margin: 6px 0 0;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: var(--tv-control);
  padding: 8px 0;
  margin: 0;
  font-weight: 400;
  font-size: 15px;
}
.check input[type="checkbox"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--tv-navy);
}
.form-actions {
  margin-top: var(--tv-space-3);
}

/* ---------- alerts and status pills ---------- */
.alert {
  background: var(--tv-white);
  color: var(--tv-ink);
  border: 1px solid var(--tv-border);
  border-left: 4px solid var(--tv-pill-info-dot);
  border-radius: var(--tv-radius-panel);
  padding: 12px 16px;
  margin-bottom: var(--tv-space-3);
  overflow-wrap: anywhere;
}
.alert-success {
  border-left-color: var(--tv-pill-ok-dot);
}
.alert-warning {
  border-left-color: var(--tv-pill-warn-dot);
}
.alert-danger {
  border-left-color: var(--tv-pill-bad-dot);
}
.alert-danger::before {
  content: "Error: ";
  font-weight: 700;
}
.alert-warning::before {
  content: "Notice: ";
  font-weight: 700;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--tv-radius-chip);
  background: var(--tv-pill-off-bg);
  color: var(--tv-pill-off-fg);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.badge::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tv-pill-off-dot);
}
.badge-info,
.badge-debug {
  background: var(--tv-pill-info-bg);
  color: var(--tv-pill-info-fg);
}
.badge-info::before,
.badge-debug::before {
  background: var(--tv-pill-info-dot);
}
.badge-success {
  background: var(--tv-pill-ok-bg);
  color: var(--tv-pill-ok-fg);
}
.badge-success::before {
  background: var(--tv-pill-ok-dot);
}
.badge-warning {
  background: var(--tv-pill-warn-bg);
  color: var(--tv-pill-warn-fg);
}
.badge-warning::before {
  background: var(--tv-pill-warn-dot);
}
.badge-danger,
.badge-error,
.badge-important {
  background: var(--tv-pill-bad-bg);
  color: var(--tv-pill-bad-fg);
}
.badge-danger::before,
.badge-error::before,
.badge-important::before {
  background: var(--tv-pill-bad-dot);
}

/* ---------- tables: scroll inside their own box ---------- */
.table-scroll {
  position: relative; /* contains .sr-only spans so they do not widen the page */
  overflow-x: auto;
}
.table-scroll:focus-visible {
  outline-offset: -2px;
}
.table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 14px;
}
.table th,
.table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--tv-divider);
}
.table thead th {
  background: var(--tv-page);
  border-top: 0;
  padding-top: 11px;
  padding-bottom: 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tv-muted);
  white-space: nowrap;
}
.table tbody tr:first-child td,
.table tbody tr:first-child th {
  border-top: 0;
}
.table tbody th {
  font-weight: 600;
}
.table .col-actions {
  white-space: nowrap;
}
.table .cell-mono {
  font-family: var(--tv-font-mono);
  font-size: 13px;
}
.table td .btn + .btn,
.table td .btn + form,
.table td form + .btn {
  margin-left: 6px;
}
.table-empty {
  padding: var(--tv-space-4);
  color: var(--tv-muted);
  text-align: center;
}
.perm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}
.pager {
  display: flex;
  gap: var(--tv-space-2);
  padding: 12px 18px;
  border-top: 1px solid var(--tv-border);
}
.log-detail summary {
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
  color: var(--tv-link);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.log-detail summary::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-right: 10px;
  border-right: 2px solid var(--tv-muted);
  border-bottom: 2px solid var(--tv-muted);
  transform: rotate(-45deg);
}
.log-detail[open] summary::before {
  transform: rotate(45deg);
}
.log-detail summary::-webkit-details-marker {
  display: none;
}
.log-detail summary {
  list-style: none;
}
.log-detail .log-full {
  margin: var(--tv-space-2) 0 0;
}
.log-detail code {
  display: block;
  white-space: pre-wrap;
  padding: var(--tv-space-2);
}
.dl-grid {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr);
  gap: var(--tv-space-2) var(--tv-space-3);
  margin: 0;
}
.dl-grid dt {
  font-weight: 600;
  color: var(--tv-muted);
}
.dl-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 575.98px) {
  .table {
    font-size: 15px;
  }
  .dl-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .dl-grid dd {
    margin-bottom: var(--tv-space-2);
  }
}

/* ---------- modal (Bootstrap JS) ---------- */
.modal-content {
  border: 0;
  border-radius: var(--tv-radius-dialog);
  background: var(--tv-white);
  color: var(--tv-ink);
}
.modal-header {
  border-bottom: 1px solid var(--tv-border);
  align-items: center;
  padding: 14px 18px;
}
.modal-header .modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.modal-body {
  padding: 18px;
}
.modal-footer {
  border-top: 1px solid var(--tv-border);
  padding: 12px 18px;
  gap: var(--tv-space-2);
}
.modal-header .close {
  min-width: 44px;
  min-height: 44px;
  margin: -8px -8px -8px auto;
  padding: 0;
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: var(--tv-ink);
  opacity: 1;
  cursor: pointer;
}

/* ---------- sign-in: navy brand panel left, form card right ---------- */
.auth {
  display: flex;
  flex-wrap: wrap;
  min-height: 100vh;
  background: var(--tv-white);
}
.auth-brand-panel {
  flex: 1 1 520px;
  background: var(--tv-navy);
  color: var(--tv-white);
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  justify-content: space-between;
}
.auth-logo {
  width: 240px;
  max-width: 100%;
  height: auto;
  display: block;
}
.auth-brand-copy {
  max-width: 520px;
}
.auth-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tv-teal-light);
}
.auth-kicker-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--tv-radius-btn);
  background: var(--tv-white);
}
.auth-kicker-icon img {
  display: block;
  width: 20px;
  height: 20px;
}
.auth-brand-copy h1 {
  color: var(--tv-white);
  font-size: 64px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.auth-brand-copy p {
  font-size: 20px;
  line-height: 1.5;
  color: var(--tv-text-on-navy-2);
  margin: 0;
}
.auth-brand-foot {
  font-size: 13px;
  color: var(--tv-text-on-navy-2);
  margin: 0;
}
.auth-form-panel {
  flex: 1 1 440px;
  padding: 56px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tv-page);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--tv-white);
  border: 1px solid var(--tv-border);
  border-radius: 14px;
  padding: 40px;
  box-shadow: 0 12px 32px var(--tv-brand-glow);
}
.auth-card h2 {
  font-size: 28px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.auth-card .lead {
  color: var(--tv-muted);
  margin-bottom: var(--tv-space-4);
}
.auth-card .form-control {
  min-height: 48px;
  font-size: 16px;
}
.auth-card .btn {
  width: 100%;
  min-height: 50px;
  font-size: 16px;
  border-radius: var(--tv-radius-input);
}
@media (max-width: 767.98px) {
  .auth-brand-panel {
    padding: 28px var(--tv-space-3);
    gap: var(--tv-space-4);
  }
  .auth-brand-copy h1 {
    font-size: 40px;
  }
  .auth-brand-copy p {
    font-size: 16px;
  }
  .auth-form-panel {
    padding: var(--tv-space-4) var(--tv-space-3);
  }
  .auth-card {
    padding: var(--tv-space-4) 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  .btn,
  .form-control {
    border: 1px solid ButtonText;
  }
  .badge::before {
    background: CanvasText;
  }
}

/* Applications list: toolbar, numeric columns, pager details */
.page-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--tv-space-3);
}
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tv-space-2);
  padding: 12px 18px;
  border-bottom: 1px solid var(--tv-border);
}
.table-toolbar .form-control {
  flex: 1 1 260px;
  max-width: 460px;
}
.table .col-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table .cell-note {
  margin-top: 2px;
  font-weight: 400;
  font-size: 13px;
  color: var(--tv-muted);
}
.pager {
  flex-wrap: wrap;
  align-items: center;
}
.pager-info {
  font-size: 13px;
  color: var(--tv-muted);
}
.pager-info:first-child {
  margin-right: auto;
}

/* Footer link to techvista.io: readable on the navy sign-in panel too */
.auth-brand-foot a {
  color: inherit;
  text-decoration: underline;
}
.auth-brand-foot a:hover,
.auth-brand-foot a:focus-visible {
  color: var(--tv-white);
}

/* ---------- dashboard ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--tv-space-3);
  margin: 0 0 var(--tv-space-4);
}
.tile {
  background: var(--tv-white);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-panel);
  padding: var(--tv-space-3) 18px;
}
.tile dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--tv-muted);
}
.tile dd {
  margin: var(--tv-space-1) 0 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.tile .tile-note {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
}
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--tv-space-4);
}
@media (min-width: 992px) {
  .tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .dash-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: start;
  }
}
.panel-meta {
  font-size: 13px;
  color: var(--tv-muted);
}
.panel-foot {
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--tv-divider);
  font-size: 13px;
  color: var(--tv-muted);
}
.table .col-share {
  width: 38%;
  min-width: 150px;
}
.share {
  display: flex;
  align-items: center;
  gap: 10px;
}
.share-value {
  flex: none;
  min-width: 4.5em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.share-bar {
  display: block;
  flex: 1 1 auto;
  min-width: 48px;
  width: 100%;
}
.share-track {
  fill: var(--tv-bar-track);
}
.share-fill {
  fill: var(--tv-bar-fill);
}
.attention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.attention-group {
  padding: var(--tv-space-3) 18px;
  border-top: 1px solid var(--tv-divider);
  margin-top: -1px;
}
.attention-group h3 {
  display: flex;
  align-items: center;
  gap: var(--tv-space-2);
  margin-bottom: var(--tv-space-1);
}
.attention-note,
.attention-more,
.attention-none {
  font-size: 13px;
  color: var(--tv-muted);
  margin-bottom: var(--tv-space-2);
}
.attention-list {
  list-style: none;
  margin: 0 0 var(--tv-space-2);
  padding: 0;
  font-size: 14px;
}
.attention-list li {
  padding: 6px 0;
  border-top: 1px solid var(--tv-divider);
  overflow-wrap: anywhere;
}
.attention-list li:first-child {
  border-top: 0;
}
.attention-list code {
  margin-left: var(--tv-space-1);
}
.empty-state {
  padding: var(--tv-space-5) var(--tv-space-4);
  text-align: center;
}
.empty-state p {
  color: var(--tv-muted);
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}
/* phones: the percentage stays, the bar goes, so names and short names keep their room */
@media (max-width: 575.98px) {
  .tiles {
    gap: var(--tv-space-2);
  }
  .tile {
    padding: 12px 14px;
  }
  .tile dd {
    font-size: 24px;
  }
  .table .col-share {
    width: auto;
    min-width: 0;
  }
  .share-bar {
    display: none;
  }
  .share-value {
    min-width: 0;
  }
  .dash-table .table th,
  .dash-table .table td {
    padding-left: 12px;
    padding-right: 12px;
  }
}
@media (forced-colors: active) {
  .share-track {
    fill: Canvas;
    stroke: CanvasText;
  }
  .share-fill {
    fill: CanvasText;
  }
}

/* Live lists: rows of one height, so paging never moves the pager or the page */
.live-region {
  transition: opacity 120ms ease;
}
.live-region[aria-busy="true"] {
  opacity: 0.55;
}
.live-region .table tbody tr {
  height: 60px;
}
.live-region .table tbody th,
.live-region .table tbody td {
  padding-top: 8px;
  padding-bottom: 8px;
  vertical-align: middle;
}
.live-region .table .cell-title {
  display: block;
  max-width: 44ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-region .table .cell-note {
  max-width: 60ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-region .table .cell-note:empty {
  display: none;
}
.live-region .table .row-filler td {
  border-top-color: transparent;
}
.table-toolbar [hidden] {
  display: none;
}
.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--tv-link);
}

/* Pager: range on the left, numbered pages on the right, controls never move */
.pager {
  justify-content: space-between;
  min-height: 56px;
  box-sizing: border-box;
}
.pager .pager-info {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.pager-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pager-btn,
.pager-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  box-sizing: border-box;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--tv-radius-btn);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--tv-ink);
  text-decoration: none;
}
.pager-gap {
  color: var(--tv-muted);
}
a.pager-btn:hover {
  background: var(--tv-page);
  border-color: var(--tv-border);
  color: var(--tv-ink);
  text-decoration: none;
}
.pager-btn.is-current,
a.pager-btn.is-current:hover {
  background: var(--tv-navy);
  border-color: var(--tv-navy);
  color: var(--tv-white);
  font-weight: 600;
}
.pager-btn.is-disabled {
  color: var(--tv-btn-border);
}
@media (prefers-reduced-motion: reduce) {
  .live-region {
    transition: none;
  }
}

/* Applications table: ID first, then name, then comments */
.table .col-id {
  width: 1%;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--tv-muted);
}
.live-region .table td .cell-note {
  margin-top: 0;
  font-size: 14px;
  max-width: 48ch;
}
.live-region .table .cell-title {
  max-width: 32ch;
}

/* Row actions: real buttons with an icon, not text links */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  box-sizing: border-box;
  padding: 0 10px;
  border: 1px solid var(--tv-btn-border);
  border-radius: var(--tv-radius-btn);
  background: var(--tv-white);
  color: var(--tv-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 1px rgba(11, 34, 51, 0.06);
}
.btn-action svg {
  flex: none;
  color: var(--tv-navy);
}
.btn-action:hover,
.btn-action:focus-visible {
  border-color: var(--tv-navy);
  background: var(--tv-page);
  color: var(--tv-navy);
  text-decoration: none;
}
.btn-action + .btn-action {
  margin-left: 6px;
}
@media (pointer: coarse) {
  .btn-action {
    height: 44px;
  }
}

/* Comments cell: one line by default; click or tap to read the whole comment */
.cell-note-toggle {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--tv-muted);
  text-align: left;
  cursor: default;
}
.cell-note-toggle.is-truncated {
  cursor: pointer;
}
.cell-note-toggle.is-truncated:hover {
  color: var(--tv-ink);
}
.live-region .table .cell-note-toggle[aria-expanded="true"] {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--tv-ink);
}

/* Settings: a number field with its label and unit on one line */
.form-group-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tv-space-2);
  margin-top: var(--tv-space-3);
}
.form-group-inline label {
  margin: 0;
}
.form-control-narrow {
  width: 96px;
}
fieldset.form-group {
  min-width: 0;
  margin-left: 0;
  margin-right: 0;
  padding: 0;
  border: 0;
}
fieldset.form-group legend {
  padding: 0;
  font-size: 14px;
  font-weight: 600;
}

/* Air One logo: the light-lettering version, straight on the navy */
.rail-brand-logo {
  display: block;
  padding: 6px 10px 2px;
}
.rail-brand-logo img {
  display: block;
  width: 100%;
  max-width: 188px;
  height: auto;
}
.auth-logo {
  width: 280px;
}

/* ---------- Admins and access: account table with a detail panel ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--tv-space-4);
  align-items: start;
}
@media (min-width: 1100px) {
  .split-detail {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  }
}
.split > .panel {
  margin-bottom: 0;
}
.table tr.is-selected > * {
  background: var(--tv-row-selected);
}
.detail-panel .panel-head {
  display: block;
}
.detail-panel .panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tv-space-2);
  margin: var(--tv-space-1) 0 0;
}
.detail-panel form + form,
.detail-panel form + p,
.detail-actions {
  margin-top: var(--tv-space-3);
}
.detail-actions {
  padding-top: var(--tv-space-3);
  border-top: 1px solid var(--tv-divider);
}
.detail-actions .form-group-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tv-space-2);
  margin-bottom: var(--tv-space-3);
}
.detail-actions .form-group-inline label {
  margin: 0;
}
.detail-actions .form-group-inline .form-control {
  width: auto;
  flex: 1 1 140px;
}
.checklist {
  max-height: 360px;
  overflow-y: auto;
  padding: 0 12px;
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-input);
}
.checklist .check {
  border-bottom: 1px solid var(--tv-divider);
}
.checklist .check:last-child {
  border-bottom: 0;
}
.checklist .cell-note {
  display: block;
  font-size: 13px;
  color: var(--tv-muted);
}
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tv-space-3);
  min-height: var(--tv-control);
  margin: 0 0 var(--tv-space-3);
  font-weight: 600;
  cursor: pointer;
}
.switch input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
  margin: 0;
  border-radius: 12px;
  background: var(--tv-switch-off);
  cursor: pointer;
}
.switch input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--tv-white);
  transition: transform 0.15s ease;
}
.switch input[type="checkbox"]:checked {
  background: var(--tv-navy);
}
.switch input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}
@media (forced-colors: active) {
  .switch input[type="checkbox"] {
    -webkit-appearance: auto;
    appearance: auto;
    width: 20px;
    height: 20px;
  }
  .switch input[type="checkbox"]::before {
    content: none;
  }
}
.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
a.account-email {
  color: var(--tv-muted);
}

.detail-panel .form-text + .btn-row {
  margin-top: var(--tv-space-2);
}

/* ---------- readability pass ----------
   Regular text was Inter at weight 400 and mostly 13-14px, which reads thin on a
   light background. Everything steps up half a weight and one size, secondary text
   gets darker, and links look like links. */
:root {
  --tv-muted: #3a4f61; /* was #4a6072: 8.4:1 on white */
  --tv-link: #004f75;  /* was #005f8a: 8.6:1 on white */
}
body {
  font-size: 16px;
  font-weight: 450;
}
strong,
b {
  font-weight: 650;
}
h1,
h2,
h3 {
  font-weight: 650;
}
a {
  font-weight: 550;
  text-underline-offset: 2px;
}
.table {
  font-size: 15px;
}
.table thead th {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--tv-ink);
}
.table tbody th,
.table .cell-title {
  font-weight: 650;
}
.table .col-id {
  color: var(--tv-ink);
}
code {
  font-size: 13.5px;
}
.form-text,
.pager .pager-info,
.pager-info,
.cell-note,
.cell-note-toggle,
.live-region .table td .cell-note {
  font-size: 14px;
}
label,
legend {
  font-weight: 600;
}
.form-control {
  font-size: 15px;
  font-weight: 450;
}

/* Buttons and button-like links: heavier text, visible outline */
.btn {
  font-size: 15px;
  font-weight: 650;
}
.btn-sm,
.btn-action {
  font-size: 14px;
  font-weight: 650;
}
.btn-action {
  border-color: var(--tv-input-border);
  color: var(--tv-navy);
}
.btn-quiet {
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pager-btn {
  font-size: 15px;
  font-weight: 600;
  border-color: var(--tv-border);
  background: var(--tv-white);
}
.pager-btn.is-disabled {
  background: transparent;
  border-color: transparent;
  color: var(--tv-input-border);
}

/* Navigation rail, tabs and breadcrumb */
.rail a,
.rail summary {
  font-size: 15px;
  font-weight: 550;
}
.rail a[aria-current] {
  font-weight: 650;
}
.rail-group-title {
  font-weight: 650;
}
.crumbs {
  font-size: 15px;
}
.account-email {
  font-weight: 550;
}
.app-tabs a {
  font-size: 15px;
  font-weight: 600;
}
.app-tabs a[aria-current] {
  font-weight: 650;
}

/* ---------- smooth, flicker-free navigation ----------
   Pages are separate documents. These rules make moving between them look like one
   application: the page colour is there from the first frame, the scrollbar never
   shifts the layout, and the browser cross-fades only the content area while the
   navigation rail and top bar stay still. */
html {
  background: var(--tv-page);
  scrollbar-gutter: stable;
}
@view-transition {
  navigation: auto;
}
.rail {
  view-transition-name: tv-rail;
}
.topbar {
  view-transition-name: tv-topbar;
}
.site-footer {
  view-transition-name: tv-footer;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 140ms;
  animation-timing-function: ease-out;
}
::view-transition-group(tv-rail),
::view-transition-group(tv-topbar),
::view-transition-group(tv-footer) {
  animation: none;
}
::view-transition-old(tv-rail),
::view-transition-old(tv-topbar),
::view-transition-old(tv-footer) {
  display: none;
}
::view-transition-new(tv-rail),
::view-transition-new(tv-topbar),
::view-transition-new(tv-footer) {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}
/* Buttons, links and rows change colour softly instead of snapping */
.btn,
.btn-action,
.pager-btn,
.rail a,
.app-tabs a,
.table tbody tr {
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.table tbody tr:hover {
  background: var(--tv-page);
}
.table tbody tr.row-filler:hover {
  background: transparent;
}
@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn-action,
  .pager-btn,
  .rail a,
  .app-tabs a,
  .table tbody tr {
    transition: none;
  }
}

/* ---------- Email screen: the email preview sits in a sandboxed iframe ---------- */
.email-frame {
  padding: 0;
}
.email-frame iframe {
  display: block;
  width: 100%;
  height: 820px;
  border: 0;
  border-radius: 0 0 var(--tv-radius-panel) var(--tv-radius-panel);
  background: var(--tv-page);
}
.email-text {
  margin: 0;
  padding: var(--tv-space-3);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--tv-font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--tv-ink);
  background: var(--tv-page);
  border: 1px solid var(--tv-divider);
  border-radius: var(--tv-radius-input);
}

/* ---------- public account pages (landing, sign-up, emailed links): same auth layout ---------- */
.auth-logo-link {
  display: inline-block;
  align-self: flex-start;
}
.auth-brand-foot a + a,
.auth-brand-foot span {
  margin-left: 6px;
}
.auth-form-panel-wide .auth-card-wide {
  max-width: 560px;
}
/* Terms of Service and Privacy Notice (templates/legal/*.txt), 2026-11-23.
   Reading layout (2026-11-24): navy logo band, one centred 720px column. */
.reading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--tv-page);
}
.reading-head {
  background: var(--tv-navy);
  color: var(--tv-white);
}
.reading-head-inner,
.reading-foot {
  max-width: 752px; /* the 720px column plus its 16px gutters */
  margin: 0 auto;
  padding: 16px;
  width: 100%;
}
.reading-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.reading-logo-link {
  display: block;
  flex: none;
}
.reading-logo {
  display: block;
  width: 160px;
  height: 44px; /* 436 x 120 scaled: fixed, so nothing shifts */
}
.reading-nav a {
  color: var(--tv-white);
  margin-left: 16px;
  text-decoration: none;
}
.reading-nav a:hover,
.reading-nav a:focus-visible,
.reading-nav a[aria-current="page"] {
  text-decoration: underline;
}
.reading-nav a:first-child {
  margin-left: 0;
}
.reading-main {
  flex: 1 0 auto;
  width: 100%;
  padding: 32px 16px;
}
.reading-doc {
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.7;
  font-size: 16px;
  color: var(--tv-ink);
  background: var(--tv-white);
  border: 1px solid var(--tv-border);
  border-radius: 14px;
  padding: 40px 48px;
  overflow-wrap: break-word;
}
.reading-doc h1 {
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 8px;
}
.reading-doc .legal-draft {
  margin-bottom: 24px;
}
.reading-links {
  margin: 32px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--tv-border);
}
.reading-foot {
  color: var(--tv-muted);
  font-size: 14px;
  padding-bottom: 32px;
}
.reading-foot a + a,
.reading-foot span {
  margin-left: 6px;
}
@media (max-width: 575.98px) {
  .reading-main {
    padding: 16px;
  }
  .reading-doc {
    padding: 24px 16px;
    border-radius: 10px;
  }
  .reading-doc h1 {
    font-size: 24px;
  }
}
.legal-updated {
  color: var(--tv-muted);
  font-size: 14px;
  margin-top: -4px;
}
.legal-heading {
  font-size: 17px;
  font-weight: 600;
  margin: var(--tv-space-4, 24px) 0 var(--tv-space-2, 8px);
}
.legal-points {
  margin: 0 0 var(--tv-space-2, 12px);
  padding-left: 20px;
}
.legal-points li {
  margin-bottom: 6px;
}
.legal-marker {
  background: #fff1b8;
  color: #3d2e00;
  outline: 1px dashed #8a6d00;
  padding: 0 2px;
  border-radius: 2px;
}
.check-terms a {
  text-decoration: underline;
}
.auth-card .auth-actions {
  display: flex;
  flex-direction: column;
  gap: var(--tv-space-2);
  margin-top: var(--tv-space-4);
}
.auth-card .btn-secondary {
  background: var(--tv-white);
  border-color: var(--tv-input-border);
  color: var(--tv-navy);
}
.auth-card .btn-secondary:hover,
.auth-card .btn-secondary:focus {
  background: var(--tv-page);
  border-color: var(--tv-navy);
  color: var(--tv-navy);
}
.auth-links {
  margin: var(--tv-space-3) 0 0;
  font-size: 15px;
  text-align: center;
}
.auth-links span {
  margin: 0 6px;
  color: var(--tv-muted);
}
.auth-note {
  margin: var(--tv-space-3) 0 0;
  color: var(--tv-muted);
  text-align: center;
}
.auth-secondary-form {
  margin-top: var(--tv-space-2);
}
.auth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 0 var(--tv-space-3);
  border-radius: 50%;
  background: var(--tv-pill-info-bg);
  color: var(--tv-pill-info-fg);
}
.auth-icon-ok {
  background: var(--tv-pill-ok-bg);
  color: var(--tv-pill-ok-fg);
}
.auth-icon-alert {
  background: var(--tv-pill-warn-bg);
  color: var(--tv-pill-warn-fg);
}
.auth-icon svg {
  display: block;
}
.auth-card .check {
  margin: var(--tv-space-2) 0 var(--tv-space-4);
}
.label-optional {
  font-weight: 450;
  color: var(--tv-muted);
}
.error-list {
  margin: 0;
  padding-left: 18px;
}
/* Honeypot: off-screen for people, still in the form for bots. No inline style. */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Three numbered steps: landing card (stacked) and the customer welcome (a row) */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--tv-space-3);
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  min-height: 34px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tv-navy);
  color: var(--tv-white);
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps h3 {
  font-size: 16px;
  margin: 5px 0 4px;
}
.steps p {
  margin: 0;
  color: var(--tv-muted);
}
.welcome .panel-body {
  padding: var(--tv-space-5) var(--tv-space-4);
}
.welcome h2 {
  font-size: 22px;
}
.welcome-lead {
  color: var(--tv-muted);
  max-width: 62ch;
  margin-bottom: var(--tv-space-4);
}
.welcome-note {
  margin: var(--tv-space-4) 0 0;
  padding: 12px 16px;
  border-radius: var(--tv-radius-panel);
  background: var(--tv-pill-info-bg);
  color: var(--tv-pill-info-fg);
}
@media (min-width: 900px) {
  .steps-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--tv-space-4);
  }
}

/* My account: profile, email and password side by side on wide screens */
.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--tv-space-4);
  align-items: start;
}
.account-grid .panel {
  margin: 0;
}
@media (min-width: 1200px) {
  .account-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Subscriptions (phase 5) ---------- */
/* Two columns on wide screens, one below; panels inside keep the page rhythm. */
.split-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--tv-space-4);
  align-items: start;
  margin-bottom: var(--tv-space-4);
}
.split-2 > .panel,
.split-2 > .stack > .panel {
  margin: 0;
}
.stack {
  display: grid;
  gap: var(--tv-space-4);
}
@media (min-width: 1100px) {
  .split-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.sub-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tv-space-2) var(--tv-space-3);
  margin: 0 0 var(--tv-space-3);
}
.sub-head-meta {
  color: var(--tv-muted);
  font-size: 14px;
}
.inline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tv-space-2);
  align-items: center;
}
.inline-controls .form-control {
  flex: 1 1 14rem;
  min-width: 0;
}
.form-row > .col.col-narrow {
  flex: 0 1 8rem;
}
.form-control-date {
  max-width: 14rem;
}
.check-warning {
  color: var(--tv-pill-warn-fg);
  font-weight: 600;
}
.price-figure {
  margin: 0 0 var(--tv-space-1);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.price-form {
  margin-top: var(--tv-space-4);
  padding-top: var(--tv-space-3);
  border-top: 1px solid var(--tv-divider);
}
.sub-preview {
  display: block;
  width: 100%;
  height: 560px;
  margin-top: var(--tv-space-3);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-panel);
  background: var(--tv-page);
}
.subhead {
  margin: var(--tv-space-3) 0 var(--tv-space-2);
  font-size: 15px;
}
.soon-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tv-space-2);
}

/* Tiles in fours (subscriptions at a glance); smaller figures inside a panel */
.tiles.tiles-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 1100px) {
  .tiles.tiles-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.tiles-compact {
  margin-bottom: var(--tv-space-3);
}
.tiles-compact .tile dd {
  font-size: 24px;
}
.tile dd a {
  color: inherit;
  text-decoration: none;
}
.tile dd a:hover,
.tile dd a:focus-visible {
  color: var(--tv-link);
  text-decoration: underline;
}

/* Filter chips (inside the live region, so they update in place with the list) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tv-space-2);
  padding: 12px 18px;
  border-bottom: 1px solid var(--tv-border);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--tv-btn-border);
  border-radius: 999px;
  background: var(--tv-white);
  color: var(--tv-ink);
  font-size: 14px;
  text-decoration: none;
}
.chip:hover {
  border-color: var(--tv-navy);
}
.chip[aria-current="true"] {
  border-color: var(--tv-navy);
  background: var(--tv-navy);
  color: var(--tv-white);
}
.chip-count {
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}
@media (forced-colors: active) {
  .chip[aria-current="true"] {
    border-width: 3px;
  }
}

/* Applications table: status and expiry keep their width, so paging never jumps */
.table .col-status {
  width: 9.5rem;
  white-space: nowrap;
}
.table .col-date {
  width: 9.5rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge-link {
  text-decoration: none;
}
.badge-link:hover .badge,
.badge-link:focus-visible .badge {
  text-decoration: underline;
}
.table-toolbar .toolbar-select {
  flex: 0 1 13rem;
}

/* App cards (customer dashboard and billing): status pill, expiry, devices */
.section-title {
  margin: 0 0 var(--tv-space-3);
  font-size: 18px;
}
.section-note {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 400;
  color: var(--tv-muted);
}
.app-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--tv-space-3);
  margin: 0 0 var(--tv-space-4);
  padding: 0;
  list-style: none;
}
@media (min-width: 900px) {
  .app-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.app-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--tv-space-2);
  padding: var(--tv-space-3) 18px;
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-panel);
  background: var(--tv-white);
}
.app-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--tv-space-2);
  width: 100%;
}
.app-card-title {
  margin: 0;
  font-size: 17px;
}
.app-card-short {
  margin: 0;
  color: var(--tv-muted);
}
.app-card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tv-space-2) var(--tv-space-5);
  margin: var(--tv-space-1) 0 var(--tv-space-2);
}
.app-card-facts dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--tv-muted);
}
.app-card-facts dd {
  margin: 2px 0 0;
  font-weight: 600;
}
.renew-facts {
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0 0 var(--tv-space-3);
}

/* ---------- Onboarding (phase 6) ---------- */
/* Count of entries waiting on the super admin, at the end of the rail link. */
.rail-count {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--tv-teal);
  color: var(--tv-navy-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
/* Five steps in a row (a column on narrow screens); fixed sizes, so nothing moves
   between the wizard's steps: only the classes of the boxes change. */
.progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--tv-space-2);
}
@media (min-width: 1000px) {
  .progress-steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
.progress-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-panel);
  background: var(--tv-white);
  min-height: 64px;
}
.progress-step-mark {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--tv-btn-border);
  color: var(--tv-muted);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.progress-step-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.progress-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--tv-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.progress-step-title {
  font-weight: 600;
  color: var(--tv-ink);
}
.progress-step.is-done .progress-step-mark {
  border-color: var(--tv-pill-ok-dot);
  background: var(--tv-pill-ok-bg);
  color: var(--tv-pill-ok-fg);
}
.progress-step.is-current {
  border-color: var(--tv-pill-info-dot);
  background: var(--tv-pill-info-bg);
}
.progress-step.is-current .progress-step-mark {
  border-color: var(--tv-navy);
  background: var(--tv-navy);
  color: var(--tv-white);
}
.progress-step.is-current .progress-step-label {
  color: var(--tv-pill-info-fg);
}
.onb-wait,
.onb-invited {
  margin: var(--tv-space-3) 0 0;
  padding: 10px 14px;
  border-radius: var(--tv-radius-panel);
  background: var(--tv-pill-off-bg);
  color: var(--tv-pill-off-fg);
}
/* The Firebase guide */
.guide-step + .guide-step {
  margin-top: var(--tv-space-3);
}
.guide-step h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  margin: 0 0 6px;
}
.guide-number {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tv-navy);
  color: var(--tv-white);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guide-step ul {
  margin: 0;
  padding-left: 58px;
}
.guide-step li + li {
  margin-top: 4px;
}
/* Forms and lists of the queue and the entry */
.mono {
  font-family: var(--tv-font-mono);
}
.form-row-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 var(--tv-space-3);
}
@media (min-width: 700px) {
  .form-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.form-inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tv-space-2);
  margin-bottom: var(--tv-space-3);
}
.form-inline-row .form-control {
  flex: 1 1 200px;
  width: auto;
}
.form-inline-row .form-text {
  margin: 0;
}
.form-error {
  margin: 6px 0 0;
  color: var(--tv-pill-bad-fg);
  font-weight: 600;
}
.note-list {
  list-style: none;
  margin: var(--tv-space-3) 0 0;
  padding: 0;
}
.note-list li {
  padding: 8px 0;
  border-top: 1px solid var(--tv-divider);
}
.note-meta {
  display: block;
  font-size: 13px;
  color: var(--tv-muted);
}
.note-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
/* The access key: one line, selectable; the hidden state keeps the same box size. */
.key-box {
  margin: 0 0 var(--tv-space-2);
  padding: 10px 12px;
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-input);
  background: var(--tv-page);
  font-size: 15px;
  overflow-wrap: anywhere;
  user-select: all;
}
.key-hidden {
  color: var(--tv-muted);
  user-select: none;
}
.moodle-steps {
  margin: 0 0 var(--tv-space-3);
  padding-left: 20px;
}
.moodle-steps li + li {
  margin-top: 4px;
}
.moodle-fields {
  margin-bottom: var(--tv-space-3);
}
/* Customer dashboard: an app being set up spans the card grid */
.app-card-wide {
  grid-column: 1 / -1;
  align-items: stretch;
}
.app-card-wide .progress-steps {
  width: 100%;
}
.app-card-wide > .btn {
  align-self: flex-start;
}
.app-card-next {
  margin: 0;
  color: var(--tv-ink);
}

/* ---------- broadcast (phase 8) ---------- */
.bc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--tv-space-4);
  align-items: start;
  margin-bottom: var(--tv-space-4);
}
@media (min-width: 1100px) {
  .bc-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}
.bc-main,
.bc-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--tv-space-3);
}
.bc-main > .panel,
.bc-side > .panel {
  margin: 0;
}
.bc-switch-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tv-space-2) var(--tv-space-3);
}
.bc-switch-body label {
  margin: 0;
  font-weight: 600;
}
.bc-switch-body .form-control {
  flex: 1 1 240px;
  width: auto;
}
.bc-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}
.bc-app-line {
  margin: 0;
}
.bc-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--tv-space-3);
}
.bc-counter {
  font-size: 13px;
  color: var(--tv-muted);
  font-variant-numeric: tabular-nums;
}
.bc-counter.is-over {
  color: var(--tv-pill-bad-fg);
  font-weight: 600;
}
.bc-textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.5;
}
.bc-drop {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px dashed var(--tv-drop-border);
  border-radius: var(--tv-radius-btn);
  background: var(--tv-page);
  color: var(--tv-navy);
}
.bc-drop-text {
  flex: 1 1 220px;
  color: var(--tv-card-text);
  font-size: 14px;
}
.bc-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.bc-file:focus-visible + .bc-file-btn,
.bc-file-btn:focus-within {
  outline: 2px solid var(--tv-link);
  outline-offset: 2px;
}
.bc-file-btn {
  margin: 0;
  cursor: pointer;
}
.bc-schedule > summary,
.bc-test > summary {
  cursor: pointer;
}
.bc-schedule > summary {
  color: var(--tv-link);
  font-weight: 600;
  margin-bottom: var(--tv-space-2);
}
.bc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.bc-test {
  display: contents;
}
.bc-test > summary {
  list-style: none;
}
.bc-test > summary::-webkit-details-marker {
  display: none;
}
.bc-test[open] > summary {
  border-color: var(--tv-navy);
}
.bc-test-body {
  order: 10;
  flex: 1 1 100%;
  padding: var(--tv-space-3);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-panel);
  background: var(--tv-page);
}
.bc-test-body fieldset {
  margin: 0 0 var(--tv-space-3);
  padding: 0;
  border: 0;
}
.bc-test-body legend {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--tv-space-2);
}
.bc-allowance {
  font-size: 13px;
  color: var(--tv-muted);
}
.bc-side-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.bc-phone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 16px;
  border-radius: 20px;
  background: var(--tv-phone);
}
.bc-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-radius: var(--tv-card-radius);
  background: var(--tv-white);
  color: var(--tv-ink);
}
.bc-card-head {
  display: flex;
  align-items: center;
  gap: var(--tv-space-2);
  margin-bottom: 4px;
}
.bc-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--tv-radius-btn);
  background: var(--tv-icon-bg);
  color: var(--tv-navy);
  font-size: 10px;
  font-weight: 700;
}
.bc-card-app {
  font-size: 12px;
  color: var(--tv-muted);
}
.bc-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.bc-card-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--tv-card-text);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.bc-card-title.is-empty,
.bc-card-body.is-empty {
  color: var(--tv-muted);
}
.bc-card-image,
.bc-report-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-top: 6px;
  border-radius: 10px;
  background: var(--tv-border);
  object-fit: cover;
}
.bc-card-image[hidden] {
  display: none;
}
.bc-report-image {
  max-width: 320px;
  margin-top: 0;
}
.bc-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 2 / 1;
  margin-top: 6px;
  border-radius: 10px;
  background: var(--tv-border);
  color: var(--tv-muted);
  font-size: 13px;
}
.bc-card-placeholder[hidden] {
  display: none;
}
.bc-phone-note {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--tv-phone-note);
}
.bc-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 var(--tv-space-2);
}
.bc-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bc-stats dd {
  order: -1; /* the number first, aligned across the three columns however the labels wrap */
}
.bc-stats dt {
  font-size: 13px;
  font-weight: 400;
  color: var(--tv-muted);
}
.bc-stats dd {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.bc-meta .badge {
  margin-right: 6px;
}
.bc-report-link {
  font-weight: 600;
}
.bc-pre {
  white-space: pre-line;
}
/* History mode (log storage off: counts only), 2026-11-23 */
.bc-history-note {
  margin: 0;
}
.panel-body .bc-history-note + * {
  margin-top: var(--tv-space-2, 12px);
}
.cell-muted {
  color: var(--tv-muted);
  font-style: italic;
  font-weight: 400;
}
.bc-progress {
  display: block;
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 5px;
  background: var(--tv-bar-track);
  color: var(--tv-bar-fill);
  appearance: none;
  overflow: hidden;
}
.bc-progress::-webkit-progress-bar {
  background: var(--tv-bar-track);
  border-radius: 5px;
}
.bc-progress::-webkit-progress-value {
  background: var(--tv-bar-fill);
  border-radius: 5px;
  transition: width 0.4s ease;
}
.bc-progress::-moz-progress-bar {
  background: var(--tv-bar-fill);
  border-radius: 5px;
}
.bc-progress-text {
  margin: var(--tv-space-2) 0 0;
  font-variant-numeric: tabular-nums;
}
.tile dd[data-bc-field] {
  font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) {
  .bc-progress::-webkit-progress-value {
    transition: none;
  }
}
@media (forced-colors: active) {
  .bc-progress {
    border: 1px solid CanvasText;
  }
}

/* ---------- PayPal (phase 7): pay options, receipts, the super admin's block ---------- */
.pay-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--tv-space-3);
  margin-bottom: var(--tv-space-2);
}
@media (min-width: 700px) {
  .pay-options {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}
.pay-option {
  display: flex;
  flex-direction: column;
  gap: var(--tv-space-2);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-panel);
  padding: var(--tv-space-3);
  background: var(--tv-white);
}
.pay-option .btn {
  margin-top: auto;
  align-self: flex-start;
}
.pay-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--tv-ink);
}
.pay-amount {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--tv-navy);
  font-variant-numeric: tabular-nums;
}
.pay-period {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--tv-muted);
}
.pay-text {
  margin: 0;
  color: var(--tv-card-text);
}
.pay-note {
  margin-top: 0;
}
.pay-check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tv-space-2) var(--tv-space-3);
  margin-bottom: var(--tv-space-3);
}
.pay-check p {
  margin: 0;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tv-space-2);
  margin-top: var(--tv-space-3);
}
.split-plain {
  margin-bottom: 0;
}
.table-caption {
  caption-side: top;
  text-align: left;
  padding: var(--tv-space-2) var(--tv-space-3);
  color: var(--tv-muted);
  font-size: 13px;
}
.receipt {
  max-width: 760px;
}
.receipt-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--tv-space-3);
  flex-wrap: wrap;
}
.receipt-total {
  font-size: 22px;
  font-weight: 700;
  color: var(--tv-navy);
  font-variant-numeric: tabular-nums;
}
.receipt-logo {
  height: 32px;
  width: auto;
}
@media print {
  .rail,
  .topbar,
  .site-footer,
  .skip-link,
  .no-print {
    display: none !important;
  }
  .shell,
  .content-col,
  .main {
    display: block;
    margin: 0;
    padding: 0;
    background: var(--tv-white);
  }
  .panel {
    border: 0;
    box-shadow: none;
  }
}

/* Email entry: the links of a stored message */
.link-list {
  margin: 0 0 var(--tv-space-2);
  padding-left: 18px;
}
.link-list li + li {
  margin-top: 6px;
}

/* ---------- PayPal: a page waiting for a payment to be recorded (pay_result.html) ---------- */
.pay-wait {
  display: flex;
  align-items: flex-start;
  gap: var(--tv-space-3);
  background: var(--tv-white);
  color: var(--tv-ink);
  border: 1px solid var(--tv-border);
  border-left: 4px solid var(--tv-pill-info-dot);
  border-radius: var(--tv-radius-panel);
  padding: 12px 16px;
  margin-bottom: var(--tv-space-3);
}
.pay-wait-mark {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--tv-bar-track);
  border-top-color: var(--tv-pill-info-dot);
}
.pay-wait.is-polling .pay-wait-mark {
  animation: pay-wait-turn 0.9s linear infinite;
}
@keyframes pay-wait-turn {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pay-wait.is-polling .pay-wait-mark {
    animation: none;
  }
}
.pay-wait-body p {
  margin: 0;
}
.pay-wait-title {
  font-weight: 600;
}
.pay-wait-text {
  color: var(--tv-card-text);
}
/* "Check again" keeps its place while the page polls, so nothing moves when it appears. */
.pay-later {
  visibility: hidden;
}

/* ---------- onboarding: request cards and notices ---------- */
.app-card-date {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--tv-muted);
}
.app-card-actions {
  margin-top: var(--tv-space-1);
}
.notice-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--tv-space-2) var(--tv-space-3);
}
.notice-row p,
.notice-action {
  margin: 0;
}
.withdraw {
  margin-top: var(--tv-space-2);
}
.withdraw > summary {
  list-style: none;
  padding-left: 0;
  min-height: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.withdraw > summary::-webkit-details-marker {
  display: none;
}
.withdraw-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tv-space-2) var(--tv-space-3);
  margin-top: var(--tv-space-2);
}
.withdraw-form p {
  margin: 0;
  color: var(--tv-card-text);
}

/* Super admin dashboard: paid apps waiting for the set-up. */
.setup-waiting { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.setup-waiting p { margin: 0; }

/* ---------- onboarding wizard (spec 06): one step at a time ---------- */
.wizard-step #step-title:focus {
  outline: none; /* moved here by script after a step; the heading is not interactive */
}
.wizard-step #step-title:focus-visible {
  outline: 2px solid var(--tv-navy);
  outline-offset: 4px;
}
.wizard-step-number {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--tv-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.wizard-form {
  max-width: 40rem;
}
.wizard-intro {
  margin-top: 0;
}
.wizard-buy {
  font-size: 16px;
}
.wizard-quiet {
  margin: 0 0 var(--tv-space-3);
}
.wizard-invite {
  margin-top: var(--tv-space-4);
  padding-top: var(--tv-space-3);
  border-top: 1px solid var(--tv-divider);
}
.wizard-actions {
  margin-top: var(--tv-space-3);
}
.wizard-summary .dl-grid dd .form-text {
  display: inline;
  margin: 0 0 0 6px;
}

/* One way to pay: a single card, not stretched across the page. */
.pay-options > .pay-option:only-child { max-width: 520px; }

/* Firebase guide: bullet points and small grey notes (templates/onboarding_guide.txt). */
.guide-points { margin: 0 0 var(--tv-space-2); padding-left: 20px; }
.guide-points li { margin-bottom: 6px; }
.guide-note { color: var(--tv-muted, #5f6b7a); font-size: 14px; }

/* Apple push key panel (onboarding steps 3 and 4): its own form below the guide. */
.wizard-apns {
  margin-top: var(--tv-space-4);
  padding-top: var(--tv-space-3);
  border-top: 1px solid var(--tv-divider);
}
.wizard-apns .subhead { margin-top: 0; }
.apns-received-title { margin: 0 0 var(--tv-space-2); }
.apns-received .dl-grid { max-width: 28rem; }
.apns-received .btn-row { margin-top: var(--tv-space-3); }
.apns-optional { margin: 0 0 var(--tv-space-3); }
.inline-form { display: inline-flex; margin: 0; }
.apns-id { max-width: 14rem; text-transform: uppercase; }
.apns-id::placeholder { text-transform: none; }
/* A file field reads as a field with a real button in it, not as bare text. */
.file-input { height: auto; padding: 6px; }
.file-input::file-selector-button {
  margin-right: var(--tv-space-3);
  min-height: 32px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--tv-ink);
  background: var(--tv-white);
  border: 1px solid var(--tv-btn-border);
  border-radius: var(--tv-radius-btn);
  cursor: pointer;
}
.file-input::file-selector-button:hover { background: var(--tv-page); border-color: var(--tv-muted); }
.apns-download { margin: var(--tv-space-3) 0 0; }

/* "Configuration complete": the optional APNs (iPhone app) section. */
.apns-complete { margin: var(--tv-space-3) 0; padding-top: var(--tv-space-3); border-top: 1px solid var(--tv-divider); }
.apns-complete > summary { cursor: pointer; }
.apns-complete > summary .subhead { display: inline; margin: 0; }
.apns-source { margin: 0 0 var(--tv-space-2); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--tv-space-3); }
@media (max-width: 575.98px) { .form-row-2 { grid-template-columns: 1fr; } }
