/* ============================================================
   Admin theme layer (2026-10-07). Loaded LAST (after admin.css, admin-saas.css, booking.css).
   Shell, responsive navigation, the stats bar and shared components. Colours come only from
   the theme tokens in admin.css. Spec: docs/superpowers/specs/2026-10-07-admin-themes-dashboard-design.md
   ============================================================ */

/* ---- Header ---- */
header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0 var(--space-md);
  gap: 14px;
}
.nav-toggle { width: 44px; height: 44px; flex: none; border-color: var(--border-secondary); }
.header-mark { height: 22px; width: auto; display: block; flex: none; }
.header-divider { width: 1px; height: 24px; background: var(--border-secondary); flex: none; }
#title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 1.35em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#logo { flex: none; }

/* ---- Sidebar ---- */
#sidebar-nav {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.nav-menu { padding: var(--space-xs) var(--space-sm) var(--space-md); }
.nav-group-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: var(--space-md) 12px 6px;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item {
  border-left: 0;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  min-height: 40px;
  gap: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-tint);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-item.active i { color: var(--accent-text); }
#sidebar-nav.collapsed .nav-group-label { font-size: 0; padding: 0; margin: 10px 14px; border-top: 1px solid var(--border-primary); }
#sidebar-nav.collapsed .nav-soon-badge { display: none; }
.nav-footer { border-top-color: var(--border-primary); }
.footer-btn { min-height: 40px; border-color: var(--border-secondary); }

/* ---- Content area ---- */
#main-content { padding: var(--space-lg) var(--space-xl); }

/* ---- Stats bar (kept; owner 2026-10-07) ---- */
footer {
  height: var(--footer-height);
  min-height: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0 var(--space-lg);
  gap: var(--space-lg);
}
.footer-stats { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.footer-live, .footer-inventory { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.footer-divider { width: 1px; height: 22px; background: var(--border-secondary); }
footer .stat-item { flex-direction: row; align-items: baseline; gap: 7px; }
footer .stat-value {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 1.45em;
  line-height: 1;
  letter-spacing: 0.01em;
}
footer .stat-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  margin: 0;
  color: var(--text-muted);
}
.footer-brand { flex: none; }
.footer-brand img { height: 26px; opacity: 0.9; }

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.live-chip[hidden] { display: none; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
html[data-theme="livery"] .live-chip { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }

/* ---- Login ---- */
#login-overlay { background: var(--bg-primary); }
.login-container {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-heavy);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  width: min(380px, calc(100vw - 32px));
}
.login-title { font-family: var(--font-display); font-weight: var(--display-weight); text-transform: uppercase; letter-spacing: 0.04em; font-size: 1.9em; }
.login-field input { background: var(--bg-input); border-color: var(--border-secondary); }
.login-field input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.login-btn {
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--btn-font);
  font-weight: var(--btn-weight);
  text-transform: var(--btn-case);
  letter-spacing: var(--btn-tracking);
  border-radius: var(--radius-sm);
  min-height: 48px;
}

/* ---- Responsive navigation ---- */
.nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 1050; }

/* Tablet: icon rail; the toggle opens the full menu over the page. */
@media (min-width: 768px) and (max-width: 1199.98px) {
  #sidebar-nav, #sidebar-nav.collapsed { width: var(--sidebar-collapsed); }
  .app-container, body.sidebar-collapsed .app-container { left: var(--sidebar-collapsed); }
  #sidebar-nav .nav-item span, #sidebar-nav .footer-btn span { opacity: 0; width: 0; overflow: hidden; }
  #sidebar-nav .nav-item { justify-content: center; padding: 0; }
  #sidebar-nav .nav-group-label { font-size: 0; padding: 0; margin: 10px 14px; border-top: 1px solid var(--border-primary); }
  body:not(.nav-open) #sidebar-nav .nav-soon-badge { display: none; }
  body.nav-open #sidebar-nav { width: var(--sidebar-width); z-index: 1100; box-shadow: var(--shadow-heavy); }
  body.nav-open #sidebar-nav .nav-item span, body.nav-open #sidebar-nav .footer-btn span { opacity: 1; width: auto; }
  body.nav-open #sidebar-nav .nav-item { justify-content: flex-start; padding: 0 12px; }
  body.nav-open #sidebar-nav .nav-group-label { font-size: 10.5px; padding: var(--space-md) 12px 6px; margin: 0; border-top: 0; }
  body.nav-open .nav-backdrop { display: block; }
  #main-content { padding: var(--space-lg); }
}

/* Phone: the sidebar is a drawer; the stats bar takes two rows. */
@media (max-width: 767.98px) {
  :root { --header-height: 56px; --footer-height: 84px; }
  header { padding: 0 var(--space-sm) 0 6px; gap: 8px; }
  .header-mark, .header-divider { display: none; }
  #title { font-size: 1.15em; }
  #sidebar-nav, #sidebar-nav.collapsed {
    width: min(86vw, 300px);
    bottom: 0;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: 1100;
  }
  body.nav-open #sidebar-nav { transform: none; box-shadow: var(--shadow-heavy); }
  body.nav-open .nav-backdrop { display: block; }
  #sidebar-nav.collapsed .nav-item span, #sidebar-nav.collapsed .footer-btn span { opacity: 1; width: auto; }
  #sidebar-nav.collapsed .nav-item { justify-content: flex-start; padding: 0 12px; }
  #sidebar-nav.collapsed .nav-group-label { font-size: 10.5px; padding: var(--space-md) 12px 6px; margin: 0; border-top: 0; }
  #sidebar-nav.collapsed .nav-soon-badge { display: inline-block; }
  .nav-item { min-height: 44px; }
  .app-container, body.sidebar-collapsed .app-container { left: 0; }
  #main-content { padding: var(--space-md); }

  /* Two rows: live stats + the logo, then the venue totals across the full width. */
  footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "live brand" "inv inv";
    align-items: center;
    padding: 6px var(--space-md);
    gap: 6px 12px;
  }
  .footer-stats { display: contents; }
  .footer-live { grid-area: live; }
  .footer-inventory { grid-area: inv; justify-content: space-between; }
  .footer-brand { grid-area: brand; }
  .footer-live, .footer-inventory { gap: 4px 12px; flex-wrap: nowrap; min-width: 0; }
  .footer-divider { display: none; }
  footer .stat-value { font-size: 1.15em; }
  footer .stat-label { font-size: 9.5px; letter-spacing: 0.1em; }
  .footer-brand img { height: 20px; }
}

/* ---- Page furniture ---- */
/* Page titles: the dashboard's .page-title, and the h2 at the top of Launcher / Groups / Reports / Leagues. */
.launcher-header h2, .groups-header h2, .reports-header h2, .leagues-header h2, .ch-head-main h2, .cs-head h2 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 2.2em;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}
.launcher-header h2 i, .groups-header h2 i, .reports-header h2 i, .leagues-header h2 i, .ch-head-main h2 i, .cs-head h2 i { display: none; }
@media (max-width: 767.98px) {
  .launcher-header h2, .groups-header h2, .reports-header h2, .leagues-header h2, .ch-head-main h2, .cs-head h2 { font-size: 1.8em; }
}
.page-title, .kicker-title, .section-header h2, .section-header h3, .modal-card h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.page-title { font-size: 2.4em; line-height: 1; margin: 0; }
.section {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.section-header { background: transparent; border-bottom: 1px solid var(--border-primary); flex-wrap: wrap; gap: var(--space-sm); }
.section-header h2, .section-header h3, .kicker-title { font-size: 1.25em; gap: 10px; display: flex; align-items: center; }
.section-header h2::before, .section-header h3::before, .kicker-title::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--kicker);
  flex: none;
}
.section-header h2 > i:first-child, .section-header h3 > i:first-child { display: none; }

/* ---- Buttons ---- */
.btn {
  font-family: var(--btn-font);
  font-weight: var(--btn-weight);
  text-transform: var(--btn-case);
  letter-spacing: var(--btn-tracking);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}
.btn:hover { background: var(--bg-tertiary); border-color: var(--accent); }
a.btn { text-decoration: none; }  /* a link styled as a button (Open, the boards table's screen link) is not underlined */
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); box-shadow: none; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-tint); border-color: var(--danger); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---- Forms ---- */
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="url"], input[type="tel"], input[type="date"],
input[type="time"], input[type="datetime-local"], select, textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.form-group label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.form-group .hint, .section-description { color: var(--text-muted); }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }

/* ---- Tables ---- */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border-bottom: 1px solid var(--border-secondary);
}
td { border-bottom: 1px solid var(--border-primary); }
tbody tr:hover > td { background: var(--bg-tertiary); }

/* ---- Tabs ---- */
.mode-tabs .mode-tab-btn { font-family: var(--btn-font); font-weight: var(--btn-weight); text-transform: var(--btn-case); letter-spacing: var(--btn-tracking); border-radius: var(--radius-sm); }
.mode-tabs .mode-tab-btn.active { background: var(--accent-tint); color: var(--text-primary); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---- Badges / pills ---- */
.badge { border-radius: var(--radius-pill); font-family: var(--font-mono); letter-spacing: 0.08em; }
.badge-success { background: var(--success-tint); color: var(--success); }
.badge-warning { background: var(--warning-tint); color: var(--warning); }
.badge-danger { background: var(--danger-tint); color: var(--danger); }
.badge-live { background: var(--accent-tint); color: var(--accent-text); box-shadow: none; }
html[data-theme="livery"] .badge { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }

/* ---- Modals, toasts, empty states ---- */
.modal-overlay { background: rgba(0,0,0,0.65); }
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--shadow-heavy);
}
.toast { background: var(--bg-tertiary); border: 1px solid var(--border-secondary); border-radius: var(--radius-md); backdrop-filter: none; }
.empty-state { color: var(--text-muted); }

/* ---- Phone ---- */
@media (max-width: 767.98px) {
  .page-title { font-size: 1.9em; }
  .section-header { padding: var(--space-sm) var(--space-md); }
  .section-content { padding: var(--space-md); }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .btn { min-height: 44px; }
  .modal-overlay .modal-card {
    width: 100vw;
    max-width: none !important;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    margin: 0;
  }
  .modal-actions { flex-wrap: wrap; }
}

/* ---- Dashboard (2026-10-07) ---- */
.dash { display: flex; flex-direction: column; gap: 20px; max-width: 1600px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.dash-head-title { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dash-chequer {
  width: 48px; height: 8px; opacity: 0.85;
  background-image: repeating-conic-gradient(var(--text-primary) 0 25%, transparent 0 50%);
  background-size: 8px 8px;
}
.dash-head-sub { color: var(--text-secondary); }
.dash-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dash-head-actions .btn { min-height: 44px; }
.dash-head-actions .live-chip { height: 40px; padding: 0 14px; font-size: 11px; }

.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.dash-tile {
  background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: var(--radius-lg);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
html[data-theme="livery"] .dash-tile { border-top: 2px solid var(--kicker); }
.dash-tile[hidden] { display: none; }
.dash-tile-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-secondary); }
.dash-tile-value { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 2.6em; line-height: 1.05; }
.dash-tile--lap .dash-tile-value { font-family: var(--font-mono); font-weight: 600; font-size: 1.9em; line-height: 1.45; color: var(--accent-text); }
.dash-tile-sub { font-size: 0.9em; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.dash-main { flex: 2 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.dash-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.dash-main > .dash-panel:last-child { flex: 1; }
.dash-global-panel { flex: 1; display: flex; flex-direction: column; }
#dash-global-feed { flex: 1; display: flex; flex-direction: column; }
.dash-panel { background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: var(--radius-lg); padding: 18px 20px; min-width: 0; }
.dash-panel[hidden] { display: none; }
.dash-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 12px; }
.dash-panel-head .kicker-title { margin: 0; }
.dash-panel-link, .dash-panel-note { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); text-decoration: none; padding: 12px 0; }
.dash-panel-link:hover { color: var(--accent-text); }
.dash-empty { color: var(--text-muted); padding: var(--space-md) 0; }
.dash-muted { color: var(--text-secondary); }
.dash-strong { font-weight: 600; color: var(--text-primary); }
.dash-mono { font-family: var(--font-mono); font-weight: 600; }

.dash-rigs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.dash-rig {
  background: var(--bg-tertiary); border: 1px solid var(--border-primary); border-radius: var(--radius-md);
  padding: 14px; display: flex; flex-direction: column; gap: 4px; min-height: 120px; min-width: 0;
  color: inherit; text-decoration: none;
}
.dash-rig:hover { border-color: var(--accent); }
.dash-rig-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; min-width: 0; }
.dash-rig-name { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.3em; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dash-rig-line1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-rig-line2 { font-size: 0.9em; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
.dash-rig-time { margin-top: auto; align-self: flex-end; font-family: var(--font-mono); font-size: 0.85em; color: var(--text-primary); }

.dash-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; flex: none;
  border-radius: var(--radius-pill); font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  color: var(--text-muted); background: var(--neutral-tint);
}
.dash-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dash-pill.is-live, .dash-pill.is-now { color: var(--accent-text); background: var(--accent-tint); }
.dash-pill.is-live .dash-pill-dot { background: var(--accent); animation: livePulse 1.6s ease-in-out infinite; }
.dash-pill.is-ok { color: var(--success); background: var(--success-tint); }
.dash-pill.is-warn { color: var(--warning); background: var(--warning-tint); }
.dash-pill.is-next { color: var(--text-primary); background: var(--bg-tertiary); }
html[data-theme="livery"] .dash-pill { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }

.dash-hours { display: flex; align-items: stretch; gap: 4px; height: 160px; border-bottom: 1px solid var(--border-secondary); }
.dash-hour { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; position: relative; padding-bottom: 20px; outline: none; }
.dash-hour-n { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-secondary); }
.dash-hour-bar { width: 100%; max-width: 40px; background: var(--accent); border-radius: min(var(--radius-sm), 4px) min(var(--radius-sm), 4px) 0 0; }
.dash-hour.is-now .dash-hour-bar { background: repeating-linear-gradient(135deg, var(--accent) 0 4px, transparent 4px 7px), var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.dash-hour.is-future .dash-hour-bar { background: var(--border-secondary); }
.dash-hour:hover .dash-hour-bar, .dash-hour:focus-visible .dash-hour-bar { filter: brightness(1.25); }
.dash-hour-label { position: absolute; bottom: 0; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); }

.dash-laps { width: 100%; min-width: 560px; }
.dash-laps td { white-space: nowrap; }
.dash-tags { text-align: right; }
.dash-tags .badge-game { margin-left: 6px; }

.dash-attention { display: flex; flex-direction: column; gap: 8px; }
.dash-attention .dash-attention-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px; box-sizing: border-box;
  border: 0; border-radius: var(--radius-md); background: var(--bg-tertiary);
  color: var(--text-primary); font-weight: 600; text-decoration: none;
}
.dash-attention .dash-attention-link:hover { background: var(--bg-tertiary); box-shadow: inset 0 0 0 1px var(--accent); }
/* The email / Discord items (dashEmailAttention, dashDiscordAttention) are bare links: give them the warning mark. */
.dash-attention .dash-attention-link:not(.dash-att)::before {
  content: "!"; width: 30px; height: 30px; flex: none; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  color: var(--warning); background: var(--warning-tint);
}
.dash-att-icon { width: 30px; height: 30px; flex: none; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-secondary); background: var(--neutral-tint); }
.dash-att.is-warn .dash-att-icon { color: var(--warning); background: var(--warning-tint); }
.dash-att-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-att-hint { font-weight: 400; font-size: 0.85em; color: var(--text-secondary); }
.dash-clear { color: var(--success); }
.dash-failures:not(:empty) { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 0.9em; }
.dash-failure .fa-times-circle { color: var(--danger); margin-right: 6px; }

.dash-booking { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--border-primary); }
.dash-booking-time { font-family: var(--font-mono); font-weight: 600; width: 48px; flex: none; }
.dash-booking.done .dash-booking-time { color: var(--text-muted); }
.dash-booking-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dash-booking-who > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-system { display: flex; flex-direction: column; }
.dash-sys-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-primary); color: var(--text-primary); text-decoration: none; min-height: 44px; }
.dash-sys-row:first-child { border-top: 0; }
.dash-sys-row > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.dash-sys-row:hover > span:last-child { color: var(--accent-text); }
.dash-system .dash-dot { width: 8px; height: 8px; margin: 0; flex: none; }

@media (max-width: 767.98px) {
  .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-tile--lap { grid-column: 1 / -1; }
  .dash-tile-value { font-size: 2.1em; }
  .dash-panel { padding: 14px 16px; }
  .dash-head-actions { width: 100%; }
  .dash-head-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* Small phones: the live chip keeps only its dot, labels tighten, so row one fits beside the logo. */
@media (max-width: 400px) {
  footer .live-chip { font-size: 0; gap: 0; padding: 0 8px; }
  footer .stat-label { letter-spacing: 0.04em; }
  .footer-live, .footer-inventory { gap: 4px 9px; }
  .footer-brand img { height: 18px; }
}

/* ---- Settings: Admin theme swatches (each button is scoped to its own theme) ---- */
.admin-theme-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.admin-theme-option {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  padding: 14px; min-height: 44px; min-width: 0; border-radius: var(--radius-lg);
  font-size: 14px; line-height: 1.5;
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border-secondary); font-family: var(--font-body);
}
.admin-theme-option:hover { border-color: var(--accent); }
.admin-theme-option.is-current { box-shadow: 0 0 0 2px var(--accent); border-color: var(--accent); }
.admin-theme-option:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent), var(--focus-ring); }
.admin-theme-swatch {
  display: flex; flex-direction: column; gap: 8px; padding: 14px; min-height: 110px; width: 100%; box-sizing: border-box;
  background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: var(--radius-md);
}
.sw-title { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.3em; line-height: 1.2; text-transform: var(--heading-case); color: var(--text-primary); }
.sw-detail { color: var(--text-secondary); font-family: var(--font-body); font-size: 13px; }
.sw-bar { width: 60%; height: 8px; background: var(--accent); border-radius: var(--radius-sm); }
.admin-theme-name { font-family: var(--font-display); font-weight: var(--display-weight); text-transform: var(--heading-case); letter-spacing: var(--heading-tracking); font-size: 1.15em; }
.admin-theme-blurb { color: var(--text-secondary); font-size: 14px; }
.admin-theme-current { color: var(--accent-text); font-size: 13px; font-weight: 600; margin-top: auto; padding-top: 6px; }
.admin-theme-current[hidden] { display: none; }

/* ============================================================
   Page fixes for phones (responsive pass 2026-10-07)
   ============================================================ */
@media (max-width: 767.98px) {
  /* Every page: section toolbars and inline flex rows wrap instead of running off the right edge;
     fields shrink to fit; long code (paths, keys) breaks. */
  .section-header .actions { flex-wrap: wrap; width: 100%; }
  .section-header .actions .inline-input { flex: 1 1 140px; width: auto !important; min-width: 0; }
  #main-content [style*="display:flex"], #main-content [style*="display: flex"] { flex-wrap: wrap; }
  #main-content input, #main-content select, #main-content textarea { min-width: 0; max-width: 100%; }
  #main-content code { overflow-wrap: anywhere; word-break: break-word; }

  /* Email -> Setup: the status checklist stacks (mark | label, then the row's content under it). */
  #page-email table:has(#email-mark-sender) tr { display: grid; grid-template-columns: 28px minmax(0, 1fr); }
  #page-email table:has(#email-mark-sender) th { width: auto !important; padding-bottom: 0 !important; }
  #page-email table:has(#email-mark-sender) td:last-child { grid-column: 2; }
}

/* ============================================================
   Polish (deferred review minors, 2026-10-07)
   ============================================================ */

/* Rig cards: time-left bar above the "MM:SS left" text. */
.dash-rig-bar { display: block; margin-top: auto; height: 4px; border-radius: 4px; background: var(--border-secondary); overflow: hidden; }
.dash-rig-bar > span { display: block; height: 100%; background: var(--accent); }
.dash-rig-bar + .dash-rig-time { margin-top: 6px; }

/* A row that must never wrap on a phone opts out of the generic phone flex-wrap rule. */
@media (max-width: 767.98px) {
  #main-content .keep-row { flex-wrap: nowrap !important; }

  /* The closed drawer leaves the keyboard tab order (it is only slid off-screen otherwise). */
  #sidebar-nav { visibility: hidden; transition: transform var(--transition-normal), visibility 0s linear var(--transition-normal); }
  body.nav-open #sidebar-nav { visibility: visible; transition: transform var(--transition-normal), visibility 0s; }

  /* Stats bar: a venue with very large totals scrolls the totals row instead of clipping it. */
  .footer-inventory { overflow-x: auto; scrollbar-width: none; }
  .footer-inventory .stat-item { flex: 0 0 auto; }
  .footer-inventory .stat-value { max-width: none; overflow: visible; }
  .footer-inventory::-webkit-scrollbar { display: none; }
}

/* A long day (more than 14 hours) on a small screen: label every other hour. */
@media (max-width: 480px) {
  .dash-hours--dense .dash-hour:nth-child(even) .dash-hour-label { visibility: hidden; }
}

/* ============================================================
   Launcher page (redesign 2026-10-07): a rig's open panel reads top to bottom as
   Session (driver, time, end) -> Game -> Assetto Corsa setup -> actions.
   Plain sections with kicker headers; the theme accent marks only the chosen game and Launch.
   ============================================================ */
.launcher-header-bar { align-items: center; }
.launcher-header-bar .btn-danger { flex: none; }

.lx-panel { display: flex; flex-direction: column; gap: 12px; }
.lx-section {
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 12px 14px 14px;
  min-width: 0;
}
.lx-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.lx-kicker::before { content: ''; width: 14px; height: 2px; background: var(--kicker); flex: none; }

.lx-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lx-field + .lx-field, .lx-pair + .lx-field { margin-top: 10px; }
.lx-field > label, .lx-label, .lx-timer-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.lx-field > select, .lx-field > input { width: 100%; min-height: 38px; }
.lx-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lx-pair .lx-field + .lx-field { margin-top: 0; }
.lx-note { font-size: 0.86em; color: var(--text-muted); line-height: 1.4; }
.lx-note a { color: var(--accent-text); }

/* Session: driver | time left + seat time | add time (End session sits with the action buttons) */
.lx-session-grid {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto auto;
  align-items: end;
  gap: 12px 24px;
}
.lx-timers { display: flex; gap: 24px; }
.lx-timer { display: flex; flex-direction: column; gap: 4px; }
.lx-timer-value {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 2.1em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.lx-timer-value.seat-timer { color: var(--text-secondary); }
.sim-row.is-time-low .lx-timer:first-child .lx-timer-value { color: var(--danger); }
.lx-extend { display: flex; flex-direction: column; gap: 5px; }
.lx-extend .extend-segment { background: var(--bg-input); border-color: var(--border-secondary); flex-wrap: nowrap; }
.lx-extend .extend-btn {
  flex-direction: row;
  min-width: 48px;
  min-height: 36px;
  justify-content: center;
  font-weight: 600;
  color: var(--text-primary);
  border-right-color: var(--border-secondary);
}
.lx-extend .extend-custom { border-left-color: var(--border-secondary); }
.lx-extend .extend-custom input[type="number"] { width: 60px; min-height: 36px; }
.lx-extend .extend-btn-confirm { border-left-color: var(--border-secondary); min-width: 40px; }

/* Game: one tile per launchable game; the picked one wears the accent */
.lx-game-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.lx-game-tile {
  min-width: 150px;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-family: var(--btn-font);
  font-weight: 600;
  font-size: 0.95em;
  text-transform: var(--btn-case);
  letter-spacing: var(--btn-tracking);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}
.lx-game-tile:hover { border-color: var(--accent); color: var(--text-primary); }
.lx-game-tile.is-selected {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.lx-game-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.lx-game-tile.is-unset { opacity: 0.5; cursor: not-allowed; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.lx-game-tile.is-unset:hover { border-color: var(--border-secondary); color: var(--text-secondary); }
.lx-game-sub { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.lx-game-tiles + .lx-note { margin-top: 10px; }
.lx-game[hidden] { display: none; }

/* The live session's game, with "Change" opening the tiles */
.lx-game-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-primary);
}
.lx-game-line strong { color: var(--text-primary); font-weight: 600; }
.lx-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.88em;
  color: var(--accent-text);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lx-link:hover { color: var(--text-primary); }
.lx-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

/* Assetto Corsa setup */
.lx-ac-setup { display: flex; flex-direction: column; gap: 12px; }
.lx-ac-setup[hidden] { display: none; }
.lx-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Track / Car: the picker's search bar and the list side by side on one line */
.lx-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); column-gap: 8px; row-gap: 5px; }
.lx-pick > label { grid-column: 1 / -1; }
.lx-pick > .cp-bar { margin: 0; display: flex; flex-wrap: nowrap; gap: 6px; min-width: 0; }
.lx-pick > .cp-bar > .cp-search, .lx-pick > .cp-bar > .cp-filter { min-height: 38px; }
.lx-pick > .cp-bar > .cp-search { flex: 1 1 auto; width: auto; min-width: 0; }
.lx-pick > .cp-bar > .cp-filter { flex: 0 1 auto; max-width: 48%; }
.lx-pick > .cp-bar > .cp-status { display: none; }
.lx-skins { margin-top: 10px; }

/* Rules: mode | sim mode | Autogrid */
.lx-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 10px 12px; align-items: end; }
.lx-rules .lx-field + .lx-field { margin-top: 0; }
.lx-autogrid .assist-toggle-modern { flex-direction: row; padding: 0; min-width: 0; min-height: 38px; align-items: center; }
.lx-autogrid .assist-toggle-modern:hover:not(.disabled) { background: none; }
.lx-autogrid .assist-label { display: none; }
.lx-autogrid .toggle-switch { flex-direction: row; gap: 8px; }
.lx-autogrid .toggle-status { font-size: 0.72rem; }
.lx-section .mode-extras:not(:empty) { margin-top: 12px; }

/* Actions: Launch first and filled; rig tools to the right as quiet text buttons */
.lx-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.lx-actions-main, .lx-actions-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lx-actions-tools { gap: 2px; margin-left: auto; }
.lx-actions-main .btn { min-height: 40px; }
.lx-actions-main .btn-launch { padding-left: 22px; padding-right: 22px; }
.lx-actions-tools .btn-ghost { border-color: transparent; color: var(--text-secondary); }
.lx-actions-tools .btn-ghost:hover:not([disabled]) { border-color: var(--border-secondary); color: var(--text-primary); }
.lx-actions-tools .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.lx-actions > .lx-note { flex: 1 1 280px; }

/* Idle rig: driver, then game, then time (a time starts it); the custom-minutes Start button shows once a value is typed */
.lx-login > .lx-field ~ .lx-field { margin-top: 14px; }
.lx-login-driver { max-width: 560px; }
.lx-panel .time-limit-row .time-pill { min-height: 38px; padding: 6px 16px; }
.lx-panel .time-limit-row input[type="number"] { width: 128px; min-height: 38px; }
.lx-panel .custom-time-confirm { display: none; }
.lx-panel .custom-time-confirm.show { display: inline-flex; min-height: 38px; }

@media (max-width: 1199.98px) {
  .lx-session-grid { grid-template-columns: auto 1fr; }
  .lx-session-grid .lx-driver { grid-column: 1 / -1; }
  .lx-session-grid .lx-extend { justify-self: end; }
}
@media (max-width: 899.98px) {
  .lx-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
  .lx-session-grid { grid-template-columns: minmax(0, 1fr); }
  .lx-session-grid .lx-extend { justify-self: stretch; }
  .lx-extend .extend-segment { width: 100%; }
  .lx-extend .extend-btn { flex: 1 1 0; }
  .lx-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lx-autogrid { grid-column: 1 / -1; }
  .lx-pick { grid-template-columns: minmax(0, 1fr); }
  .lx-game-tile { flex: 1 1 140px; min-width: 0; }
  .lx-actions-main { width: 100%; }
  .lx-actions-main .btn { flex: 1 1 auto; justify-content: center; }
  .lx-actions-tools { margin-left: 0; }
}
@media (max-width: 479.98px) {
  .lx-pair { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   Drivers page (admin pages cleanup 2026-10-07): the Laps-style toolbar (search, filters,
   chips, pager) over the driver table. Name | Email | Organizations | Laps | Last seen |
   Registered; birthdate and social sit in the expanded row and the full-width edit row.
   ============================================================ */
.drivers-toolbar .drivers-check {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 0.9em; color: var(--text-secondary); cursor: pointer;
}
.drivers-toolbar .drivers-check input { flex: none; min-width: 0; margin: 0; }
.drivers-table th .laps-sort { text-transform: inherit; letter-spacing: inherit; }
.drivers-table th[aria-sort="ascending"], .drivers-table th[aria-sort="descending"] { color: var(--text-primary); }
.drivers-table th .laps-sort i { color: var(--accent-text); }
.drivers-row { cursor: pointer; }
.drivers-row-open > td { background: var(--bg-tertiary); }
.drivers-name { font-weight: 600; color: var(--text-primary); }
.drivers-chevron { display: inline; font-size: 0.7em; opacity: 0.45; margin-left: 2px; }
.drivers-table .drivers-col-name { min-width: 150px; }
.drivers-table .drivers-col-email { min-width: 220px; }
.drivers-sub { display: none; }
.drivers-email { overflow-wrap: anywhere; }
.drivers-none { color: var(--text-faint); }
.drivers-col-num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.drivers-col-seen, .drivers-col-reg { white-space: nowrap; }
.drivers-actions { display: flex; gap: 4px; justify-content: flex-end; }
.drivers-col-actions { width: 1%; white-space: nowrap; }
.drivers-detail-cell { padding: 0 !important; background: var(--bg-tertiary); }
.drivers-detail-actions { display: none; gap: var(--space-sm); padding: var(--space-md) 16px 0; }
.drivers-facts {
  display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg);
  margin: 0; padding: var(--space-md) 16px 0;
}
.drivers-facts dt { font-size: 0.8em; color: var(--text-muted); }
.drivers-facts dd { margin: 0; color: var(--text-primary); overflow-wrap: anywhere; }
.drivers-edit-cell { background: var(--bg-tertiary); }
.drivers-edit-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--space-sm) var(--space-md); align-items: start;
}
.drivers-edit-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.8em; color: var(--text-muted);
}
tr.editing-row .drivers-edit-grid .inline-input, tr.editing-row .drivers-edit-grid select {
  width: 100%; min-width: 0; padding: 6px 10px; font-size: 0.9rem; color: var(--text-primary);
}
.drivers-edit-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-sm); }

/* Tablet: Organizations, Registered and Actions step out; the row's buttons move into its expanded row. */
@media (max-width: 1099.98px) {
  .drivers-table .drivers-col-org, .drivers-table .drivers-col-reg, .drivers-table .drivers-col-actions { display: none; }
  .drivers-detail-actions { display: flex; }
  .drivers-table .drivers-col-email { min-width: 180px; }
}
/* Phone: email moves under the name; laps step out too, so the row is Name | Last seen | actions. */
@media (max-width: 767.98px) {
  .drivers-table .drivers-col-email, .drivers-table .drivers-col-laps { display: none; }
  .drivers-table .drivers-col-name { min-width: 0; }
  .drivers-sub {
    display: block; max-width: 46vw; font-size: 0.8em; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .drivers-toolbar { padding: var(--space-sm) var(--space-md) 0; }
  .drivers-toolbar .laps-search { flex: 1 1 100%; }
  .drivers-toolbar select.inline-input { flex: 1 1 140px; max-width: none; min-width: 0; }
  .drivers-table td, .drivers-table th { padding-left: 8px; padding-right: 8px; }
  .drivers-edit-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   Admin pages cleanup (2026-10-07): Cars & Tracks filter toolbar and the
   Leaderboard Boards tab's times table. The toolbar reuses the Laps page
   classes (laps-toolbar, laps-chips, laps-pager, laps-popover).
   ============================================================ */
.md-filterbar { margin-bottom: var(--space-sm); }
.md-filterbar .laps-search { flex: 1 1 240px; }
.md-filterbar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.md-table .inline-input { min-width: 150px; }
.md-table td.md-folder { font-family: var(--font-mono); font-size: 0.78em; color: var(--text-secondary); min-width: 130px; max-width: 220px; overflow-wrap: anywhere; }
.md-table .track-traffic-profile select { font-size: 0.85em; padding-top: 4px; padding-bottom: 4px; }
.md-table td.md-country { white-space: nowrap; }
.md-table .track-traffic-profile label { white-space: nowrap; }
.md-multi > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 34px; cursor: pointer; }
.md-multi > summary::-webkit-details-marker { display: none; }
.md-multi > summary::after { content: '\f107'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 0.85em; opacity: 0.6; }
.md-multi[open] > summary { border-color: var(--accent); }
.md-multi-menu { max-height: 320px; overflow-y: auto; min-width: 220px; }
.md-multi-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 0.9em; cursor: pointer; white-space: nowrap;
}
.md-multi-item:hover { background: var(--bg-tertiary); }
.md-multi-item input[type="checkbox"] { flex: none; width: 18px; min-width: 0; margin: 0; }
.md-multi-item input[type="checkbox"]:checked::after { border-color: var(--accent-contrast); }
.md-review-btn { color: var(--warning); border-color: var(--warning); }
.md-review-btn:hover { border-color: var(--warning); }
.md-review-btn.active { background: var(--warning-tint); }
.md-review-btn[hidden] { display: none; }
.md-table td { vertical-align: middle; }
.md-col-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.md-col-num { padding-right: 26px; }
@media (max-width: 767.98px) {
  .md-filterbar .laps-search { flex-basis: 100%; }
  .md-filterbar select.inline-input, .md-filterbar .md-multi { flex: 1 1 140px; min-width: 0; max-width: none; }
  .md-filterbar .md-multi > summary { width: 100%; justify-content: space-between; }
  .md-filterbar-end { margin-left: 0; width: 100%; justify-content: space-between; }
  /* The table scrolls sideways inside .table-container rather than squeezing its fields. */
  #main-content .md-table .inline-input { min-width: 150px; }
  #main-content .md-table .md-select { min-width: 130px; }
  .md-table td.md-folder { min-width: 120px; max-width: 160px; }
}

/* Leaderboard -> Boards: the Live TV card (live_tv_admin.js). A settings form (idle slides, two
   short number fields, Save) and, below a rule, the preview picker and frame. Groups are a
   --space-lg apart; the option rows read as body text, only the group headings use the label style. */
.ltv-admin > .form-group { margin-bottom: var(--space-lg); }
.ltv-admin-checks { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-sm); margin-top: var(--space-sm); }
.form-group label.ltv-admin-check {
  display: flex; align-items: center; gap: var(--space-sm); margin: 0; cursor: pointer;
  font-family: var(--font-body); font-size: 0.9em; font-weight: 400; letter-spacing: normal;
  text-transform: none; color: var(--text-primary);
}
.form-group .ltv-admin-check input[type="checkbox"] { margin: 0; padding: 0; }
.ltv-admin-times { display: flex; flex-wrap: wrap; gap: var(--space-md) var(--space-xl); margin-bottom: var(--space-lg); }
.ltv-admin-times .form-group { margin-bottom: 0; }
.ltv-admin-times .form-group input { width: 8rem; max-width: 100%; }
.ltv-admin-save { margin-bottom: var(--space-lg); }
.ltv-admin > .ltv-admin-preview { margin-bottom: 0; padding-top: var(--space-lg); border-top: 1px solid var(--border-primary); }
.ltv-admin-preview-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.ltv-admin-preview-row select { flex: 1 1 12rem; width: auto; min-width: 0; max-width: 20rem; }
#ltv-preview:not(:empty) { margin-top: var(--space-md); }
/* The preview frame's own toolbar (board_preview.js): the card already pads it. */
.ltv-admin .bp-toolbar { padding: 0 0 var(--space-sm); }

/* Leaderboard -> Boards: on a phone or tablet each board is a card (name + actions, then type,
   game, track, class, date and scroll on wrapping lines) instead of an eight-column table whose
   actions scroll off the right edge. */
@media (max-width: 1023.98px) {
  .lb-boards-table thead { display: none; }
  .lb-boards-table, .lb-boards-table tbody { display: block; width: 100%; }
  .lb-boards-table tbody tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 12px 14px; border-bottom: 1px solid var(--border-primary);
  }
  .lb-boards-table tbody tr:last-child { border-bottom: 0; }
  /* The line break between the name row and the details. */
  .lb-boards-table tbody tr::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
  .lb-boards-table tbody td { display: block; padding: 0; border: 0; background: none; }
  .lb-boards-table td.lb-bt-name { order: 0; flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
  .lb-boards-table td.lb-bt-actions { order: 0; flex: none; }
  .lb-boards-table td.lb-bt-meta { order: 2; font-size: 0.85em; color: var(--text-secondary); }
  .lb-boards-table td.lb-bt-meta[data-label]::before {
    content: attr(data-label) " "; font-family: var(--font-mono); font-size: 0.85em;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
  }
  .lb-boards-table td.lb-bt-none { display: none; }
  .lb-boards-table td.empty-state { flex-basis: 100%; padding: var(--space-md); }
  .lb-boards-table .board-actions { flex-wrap: nowrap; }
  .lb-boards-table .board-actions .btn { padding: 6px 9px; }
}

/* Kiosk devices: the pairing code, readable across a counter. */
.kiosk-code { font-family: var(--font-mono, monospace); font-size: 2.6em; letter-spacing: 0.25em;
  color: var(--text-primary); padding: var(--space-md) 0; }
/* "Open kiosk" is a link in the footer, styled like the Sign Out button beside it. */
a.footer-btn { text-decoration: none; margin-bottom: var(--space-sm); box-sizing: border-box; }

/* Reading preferences belong to the palette, including its Settings preview. */
#title, .login-title, .page-title, .kicker-title, .section-header h2, .section-header h3,
.modal-card h3, .launcher-header h2, .groups-header h2, .reports-header h2,
.leagues-header h2, .ch-head-main h2, .cs-head h2, .dash-rig-name {
  text-transform: var(--heading-case);
  letter-spacing: var(--heading-tracking);
  line-height: 1.2;
}
.nav-group-label, footer .stat-label, .form-group label, th, .dash-tile-label,
.dash-hour-label, .dash-hour-n, .dash-pill, .live-chip {
  font-size: var(--label-size);
  letter-spacing: var(--label-tracking);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }

/* Visible focus works on links, tiles and native controls, not just .btn elements. */
:is(button, a, input, select, textarea, [tabindex], [role="button"]):focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}
html[data-theme="contrast"] :is(.btn, .nav-item, .footer-btn, .form-group input:not([type="checkbox"]):not([type="radio"]), .form-group select) {
  min-height: 44px;
}
html[data-theme="contrast"] input[type="checkbox"] { border-color: var(--border-secondary); }
html[data-theme="contrast"] .live-dot,
html[data-theme="contrast"] .dash-pill.is-live .dash-pill-dot { animation: none; }

/* The bundled wordmark is white; a monochrome version stays visible on Race Day. */
html[data-theme="raceday"] :is(.header-mark, .footer-brand img) { filter: brightness(0); }
html[data-theme="raceday"] input[type="checkbox"]:not(:checked) { border-color: var(--border-secondary); }
html[data-theme="raceday"] :is(.section-vehicle .section-label i, .group-session-title i) { color: var(--best-lap); }

/* Honour the operating system's motion preference across all admin themes. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Global VenueLaps feed: uses the current dashboard theme on every venue. */
/* Community calendar: editorial date blocks, complete flyers and the active theme's accent. */
.dash-events { border: 1px solid var(--border-primary); border-top: 3px solid var(--accent); border-radius: var(--radius-lg); background: var(--bg-card); overflow: hidden; }
.dash-events-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; }
.dash-events-eyebrow { display: block; color: var(--accent-text); font: 600 10px var(--font-mono); text-transform: uppercase; letter-spacing: .16em; line-height: 1.6; }
.dash-events-head h2 { margin: 3px 0 0; color: var(--text-primary); font-family: var(--font-display); font-size: 2em; font-weight: var(--display-weight); text-transform: var(--heading-case); letter-spacing: var(--heading-tracking); }
.dash-events-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.dash-events-actions .btn { min-height: 44px; text-decoration: none; }
.dash-events-text-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--accent-text); font-weight: 600; text-decoration: none; }
.dash-events-text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
#dash-events-feed > .dash-empty { padding: 0 24px 24px; margin: 0; }
.dash-events-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: 14px; padding: 0 24px 24px; }
.dash-event-card { display: flex; flex-direction: column; min-width: 0; color: var(--text-primary); text-decoration: none; background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: var(--radius-md); overflow: hidden; transition: border-color .15s ease, transform .15s ease; }
.dash-event-card:hover { color: var(--text-primary); border-color: var(--accent); transform: translateY(-2px); }
.dash-event-card:focus-visible, .dash-events-text-link:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.dash-event-art { position: relative; display: grid; place-items: center; height: 150px; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-primary); overflow: hidden; }
.dash-event-art > img { width: 100%; height: 100%; object-fit: contain; }
.dash-event-art > i { color: var(--text-faint); font-size: 42px; }
.dash-event-game { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); padding: 6px 9px; border: 1px solid var(--border-secondary); border-radius: var(--radius-sm); color: var(--text-primary); background: var(--bg-card); font: 600 10px var(--font-mono); letter-spacing: .06em; }
.dash-event-body { display: flex; align-items: flex-start; gap: 14px; padding: 18px 16px; flex: 1; }
.dash-event-date { display: flex; flex-direction: column; align-items: center; flex: 0 0 44px; padding-right: 12px; border-right: 1px solid var(--border-primary); color: var(--accent-text); }
.dash-event-date span { font: 600 10px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.dash-event-date strong { font: 700 34px/1.15 var(--font-display); }
.dash-event-copy { min-width: 0; overflow-wrap: anywhere; }
.dash-event-venue { margin: 0 0 5px; color: var(--text-secondary); font-size: .8em; }
.dash-event-copy h3 { margin: 0 0 8px; font: var(--display-weight) 1.45em/1.15 var(--font-display); color: var(--text-primary); }
.dash-event-when { color: var(--text-secondary); font-size: .78em; line-height: 1.5; margin: 0; }
.dash-event-summary { color: var(--text-muted); font-size: .85em; line-height: 1.5; margin: 10px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dash-event-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-primary); font-size: .75em; color: var(--text-secondary); }
.dash-event-foot > span:last-child { font-weight: 600; color: var(--accent-text); }
.dash-events-empty { display: flex; align-items: center; gap: 28px; border-top: 1px solid var(--border-primary); padding: 28px; background: var(--bg-secondary); }
.dash-events-ticket { flex: 0 0 130px; min-height: 125px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; border: 1px solid var(--border-secondary); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); color: var(--accent-text); background: var(--bg-card); transform: rotate(-4deg); }
.dash-events-ticket i { font-size: 34px; }
.dash-events-ticket span { color: var(--text-muted); font: 500 8px var(--font-mono); letter-spacing: .12em; }
.dash-events-empty h3 { margin: 5px 0 8px; font: var(--display-weight) 1.65em/1.2 var(--font-display); color: var(--text-primary); }
.dash-events-empty p { margin: 0; color: var(--text-secondary); max-width: 60ch; font-size: .93em; line-height: 1.6; }
.dash-events-empty .dash-events-text-link { margin-top: 8px; }
@media (max-width: 600px) { .dash-events-head { padding: 18px; } .dash-events-cards { grid-template-columns: 1fr; padding: 0 18px 18px; } .dash-events-empty { padding: 22px 18px; gap: 18px; align-items: flex-start; } .dash-events-ticket { flex-basis: 60px; min-height: 78px; } .dash-events-ticket i { font-size: 24px; } .dash-events-ticket span { display: none; } .dash-event-art { height: 175px; } }
@media (prefers-reduced-motion: reduce) { .dash-event-card { transition: none; } .dash-event-card:hover { transform: none; } }

/* Shared Events UI: editor, roster, registration and runtime all use this surface. */
.ev-panel { min-width: 0; padding: 28px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-card); scroll-margin-top: 24px; }
.ev-panel-head { margin-bottom: 26px; }
.ev-panel-head h2 { margin: 5px 0 8px; font: var(--display-weight) 1.65em/1.2 var(--font-display); color: var(--text-primary); }
.ev-panel-head p, .ev-help, .ev-context p { margin: 0; color: var(--text-secondary); line-height: 1.65; max-width: 85ch; overflow-wrap: anywhere; }
.ev-context { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; }
.ev-context h2 { margin: 0; font: var(--display-weight) 1.5em/1.3 var(--font-display); color: var(--text-primary); overflow-wrap: anywhere; }
.ev-context p { font-size: .9em; white-space: pre-line; }
.ev-section-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-section-nav button { padding: 10px 14px; min-height: 44px; border: 1px solid var(--border-primary); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-secondary); font: inherit; cursor: pointer; }
.ev-section-nav button:hover { color: var(--accent-text); border-color: var(--accent); }
.ev-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 24px; align-items: start; }
.ev-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ev-field > label { display: block; color: var(--text-primary); font-size: .9em; font-weight: 600; line-height: 1.45; margin: 0; }
.ev-field > input, .ev-field > textarea, .ev-field > select { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; margin: 0; min-height: 46px; padding: 11px 13px; border: 1px solid var(--border-secondary); border-radius: var(--radius-sm); background-color: var(--bg-input); color: var(--text-primary); font: inherit; line-height: 1.45; }
.ev-field > textarea { min-height: 124px; resize: vertical; }
.ev-field > select { padding-right: 32px; }
.ev-field > select[multiple] { min-height: 156px; padding: 8px; background-image: none; }
.ev-field > select[multiple] option { padding: 8px; border-radius: var(--radius-sm); }
.ev-field > input:focus, .ev-field > textarea:focus, .ev-field > select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.ev-field small, .ev-upload small { display: block; margin: 0; color: var(--text-muted); font-size: .8em; line-height: 1.55; }
.ev-span-all { grid-column: 1 / -1; }
.ev-check { display: flex; align-items: flex-start; gap: 10px; min-height: 46px; margin: 0; padding: 12px 14px; border: 1px solid var(--border-primary); border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--text-secondary); font-size: .9em; line-height: 1.5; cursor: pointer; }
.ev-check input[type="checkbox"] { flex: 0 0 20px; width: 20px; height: 20px; margin: 0; }
.ev-check span { min-width: 0; overflow-wrap: anywhere; }
.ev-stack { display: flex; flex-direction: column; gap: 20px; }
.ev-stack:empty, #ev-preview:empty, #ev-join:empty { display: none; }
.ev-repeat { box-sizing: border-box; min-width: 0; margin: 0; padding: 22px; border: 1px solid var(--border-secondary); border-radius: var(--radius-md); background: var(--bg-secondary); }
.ev-repeat legend { padding: 0 8px; color: var(--text-primary); font-weight: 600; font-size: .9em; }
.ev-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ev-panel > .ev-actions, .ev-repeat > .ev-actions, .ev-subsection > .ev-actions { margin-top: 22px; }
.ev-page .btn { min-height: 44px; white-space: normal; text-align: center; line-height: 1.4; }
.ev-panel > .ev-help { margin: 20px 0; }
.ev-inline-empty { margin: 0; padding: 18px 20px; border: 1px dashed var(--border-secondary); border-radius: var(--radius-sm); color: var(--text-muted); font-size: .9em; line-height: 1.6; }
.ev-upload { display: flex; flex-direction: column; gap: 12px; padding: 24px; min-width: 0; border: 1px dashed var(--border-secondary); border-radius: var(--radius-md); background: var(--bg-secondary); color: var(--text-primary); }
.ev-upload > span { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.ev-upload i { color: var(--accent-text); }
.ev-upload input { width: 100%; min-width: 0; color: var(--text-secondary); font: inherit; font-size: .85em; }
.ev-upload input::file-selector-button { margin-right: 12px; padding: 10px 12px; min-height: 44px; background: var(--bg-card); border: 1px solid var(--border-secondary); border-radius: var(--radius-sm); color: var(--text-primary); font: inherit; cursor: pointer; }
.ev-artwork { display: grid; grid-template-columns: minmax(0,280px) minmax(0,1fr); gap: 24px; align-items: center; margin: 24px 0; }
.ev-artwork > img, .ev-gallery-thumb { display: block; width: 100%; max-height: 320px; object-fit: contain; border: 1px solid var(--border-primary); border-radius: var(--radius-sm); background: var(--bg-secondary); }
.ev-gallery-thumb { max-width: 220px; margin-bottom: 18px; }
.ev-save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 24px; padding: 20px 24px; background: var(--bg-secondary); border: 1px solid var(--border-secondary); border-top: 3px solid var(--accent); border-radius: var(--radius-md); }
.ev-save-bar strong { color: var(--text-primary); }
.ev-save-bar p { margin: 6px 0 0; font-size: .82em; line-height: 1.6; color: var(--text-secondary); }
.ev-checklist { list-style: none; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 0; margin: 20px 0 0; }
.ev-checklist li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: var(--radius-sm); font-size: .85em; }
.ev-checklist strong { margin-left: auto; font-size: .85em; }
.ev-checklist .is-ready i, .ev-checklist .is-ready strong { color: var(--success); }
.ev-checklist .is-needed i, .ev-checklist .is-needed strong { color: var(--warning); }
.ev-panel-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; margin-top: 24px; border-top: 1px solid var(--border-primary); }
.ev-panel-footer p { margin: 0; color: var(--text-secondary); font-size: .9em; line-height: 1.6; }
.ev-table-wrap { overflow-x: auto; min-width: 0; border: 1px solid var(--border-primary); border-radius: var(--radius-md); }
.ev-table-wrap table { width: 100%; min-width: 560px; border-collapse: collapse; margin: 0; }
.ev-table-wrap th { background: var(--bg-secondary); color: var(--text-muted); font: 600 10px/1.5 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; text-align: left; }
.ev-table-wrap th, .ev-table-wrap td { padding: 14px 16px; border-bottom: 1px solid var(--border-primary); }
.ev-table-wrap td { color: var(--text-secondary); font-size: .9em; }
.ev-table-wrap tr:last-child td { border-bottom: 0; }
.ev-table-empty { text-align: center; padding: 32px 20px !important; }
.ev-badge { display: inline-block; padding: 4px 9px; border-radius: var(--radius-sm); background: var(--accent-tint); color: var(--accent-text); font-size: .8em; font-weight: 600; }
.ev-status-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),1fr)); gap: 12px; margin-bottom: 20px; }
.ev-status-grid > div { min-width: 0; padding: 18px; background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: var(--radius-md); }
.ev-status-grid span { display: block; margin-bottom: 9px; color: var(--text-muted); font-size: .8em; }
.ev-status-grid strong, .ev-status-grid code { color: var(--text-primary); overflow-wrap: anywhere; }
.ev-status-grid strong { font: var(--display-weight) 1.4em/1.3 var(--font-display); }
.ev-error { border-left: 3px solid var(--danger); padding: 14px 18px; background: var(--danger-tint); color: var(--text-primary); line-height: 1.6; overflow-wrap: anywhere; }
.ev-control-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); gap: 12px; }
.ev-control-grid .btn { justify-content: flex-start; padding: 16px; }
.ev-danger-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: 24px; padding: 20px; border: 1px solid var(--border-secondary); border-left: 3px solid var(--danger); border-radius: var(--radius-sm); }
.ev-danger-row strong { color: var(--text-primary); }
.ev-danger-row p { color: var(--text-secondary); font-size: .85em; line-height: 1.6; margin: 6px 0 0; }
.ev-review-link { display: inline-flex; gap: 10px; align-items: center; margin: 0 0 22px; min-height: 44px; color: var(--accent-text); font-weight: 600; line-height: 1.6; }
.ev-join-details { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-primary); }
.ev-subsection { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border-primary); }
.ev-subsection h3 { margin: 0 0 10px; color: var(--text-primary); }
.ev-rig-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),1fr)); gap: 10px; margin-top: 18px; }
.ev-link-list { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.ev-link-list a { color: var(--accent-text); padding: 12px; background: var(--bg-secondary); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .ev-panel { padding: 22px 18px; }
  .ev-form-grid, .ev-checklist, .ev-artwork { grid-template-columns: 1fr; }
  .ev-repeat { padding: 18px 14px; }
  .ev-save-bar { position: static; padding: 18px; }
  .ev-save-bar .ev-actions { width: 100%; }
  .ev-save-bar .btn { flex: 1 1 120px; }
  .ev-upload { padding: 18px; }
}

/* Events workspace: consistent page rhythm and a useful first-run state. */
.ev-page { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.ev-page-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 4px 0 0; }
.ev-eyebrow { color: var(--accent-text); font: 600 10px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: .14em; }
.ev-page-head .page-title { margin: 6px 0 10px; }
.ev-page-head p { margin: 0; color: var(--text-secondary); line-height: 1.6; max-width: 64ch; }
.ev-page-head > .btn { flex: none; min-height: 44px; }
.ev-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border-primary); }
.ev-tab { appearance: none; background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--text-secondary); font: inherit; font-weight: 600; padding: 14px 2px; min-height: 48px; cursor: pointer; }
.ev-tab:hover { color: var(--text-primary); }
.ev-tab.is-active { color: var(--accent-text); border-bottom-color: var(--accent); }
.ev-tab:focus-visible, .ev-link:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.ev-message { margin: 0; padding: 14px 18px; color: var(--text-secondary); background: var(--bg-secondary); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); line-height: 1.6; }
.ev-message:empty { display: none; }
.ev-body { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ev-empty { background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: var(--radius-lg); overflow: hidden; }
.ev-empty-main { display: flex; align-items: center; gap: clamp(24px,4vw,48px); padding: clamp(28px,5vw,64px); min-height: 300px; }
.ev-empty-icon { display: grid; place-items: center; flex: 0 0 100px; height: 100px; border: 1px solid var(--border-secondary); border-radius: var(--radius-lg); color: var(--accent-text); background: var(--accent-tint); font-size: 36px; }
.ev-empty-copy { min-width: 0; max-width: 64ch; }
.ev-empty-copy h2 { font: var(--display-weight) clamp(26px,3vw,38px)/1.15 var(--font-display); color: var(--text-primary); margin: 8px 0 14px; }
.ev-empty-copy p { color: var(--text-secondary); margin: 0; line-height: 1.7; }
.ev-empty-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 24px; }
.ev-empty-actions .btn { min-height: 44px; }
.ev-link { appearance: none; background: none; border: 0; padding: 10px 0; min-height: 44px; color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; }
.ev-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.ev-empty-note { display: flex; align-items: flex-start; gap: 10px; padding: 18px 28px; border-top: 1px solid var(--border-primary); background: var(--bg-secondary); color: var(--text-secondary); font-size: .85em; line-height: 1.6; }
.ev-empty-note i { margin-top: 4px; color: var(--accent-text); }
.ev-event-card { padding: 24px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-card); }
.ev-event-card h3 { margin: 0 0 8px; color: var(--text-primary); }
.ev-event-card > p { margin: 0 0 20px; color: var(--text-secondary); }
.ev-card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ev-list-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 240px; padding: 28px; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: var(--radius-lg); }
.ev-list-state p { margin: 0; }
@media (max-width: 600px) {
  .ev-page { gap: 20px; }
  .ev-page-head { align-items: flex-start; flex-direction: column; gap: 18px; }
  .ev-tabs { gap: 0; }
  .ev-tab { flex: 1; font-size: .85em; padding: 12px 4px; }
  .ev-empty-main { flex-direction: column; align-items: flex-start; padding: 28px 22px; gap: 24px; min-height: 0; }
  .ev-empty-icon { flex-basis: auto; width: 64px; height: 64px; font-size: 26px; }
  .ev-empty-note { padding: 18px 22px; }
}

.dash-global-intro { color: var(--text-muted); font-size: .9em; margin: 0 0 14px; }
.dash-global-list { list-style: none; padding: 0; margin: 0; flex: 1; display: flex; flex-direction: column; }
.dash-global-list li { flex: 1; display: flex; flex-direction: column; }
.dash-global-list .dash-global-lap { flex: 1; justify-content: center; }
.dash-global-list li + li { border-top: 1px solid var(--border-primary); }
.dash-global-lap, .dash-global-venue { display: flex; flex-direction: column; gap: 5px; color: var(--text-primary); text-decoration: none; overflow-wrap: anywhere; padding: 13px 0; }
.dash-global-lap:hover, .dash-global-venue:hover { color: var(--accent-text); }
.dash-global-lap:focus-visible, .dash-global-venue:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: var(--radius-sm); }
.dash-global-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.dash-global-time { font-family: var(--font-mono); font-weight: 600; color: var(--accent-text); white-space: nowrap; }
.dash-global-car { font-size: .88em; }
.dash-global-meta, .dash-global-status { font-size: .8em; color: var(--text-muted); }
.dash-global-venue { padding: 12px 14px; margin-bottom: 4px; border: 1px solid var(--border-primary); border-left: 3px solid var(--accent-text); border-radius: var(--radius-sm); font-size: .9em; }
.dash-global-label { font-family: var(--font-mono); font-size: .75em; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-text); }

/* Dashboard participation: keep traffic and game usage visible alongside lap results. */
.dash-play-note { color: var(--text-secondary); font-size: 12px; line-height: 1.5; margin: 0 0 16px; }
.dash-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 18px; }
.dash-game-summary { display: flex; flex-direction: column; gap: 5px; padding: 13px; border: 1px solid var(--border-secondary); border-radius: var(--radius-sm); }
.dash-game-summary span { font-size: 12px; color: var(--text-secondary); }
.dash-player-scroll { max-height: 340px; overflow: auto; }
.dash-play-table small, #dash-play-recent small { display: block; color: var(--text-secondary); font-size: 11px; margin-top: 4px; }
.dash-hour-control { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-secondary); }
.dash-hour-control select { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-secondary); border-radius: var(--radius-sm); padding: 5px 8px; }
.dash-panel-head:has(.dash-hour-control) { flex-wrap: wrap; gap: 10px; }

/* Dashboard preferences: separate from feature-driven [hidden] (e.g. bookings). */
.dash-widget-hidden { display: none !important; }
.dash-layout-status { margin: 0; color: var(--text-secondary); }
.dash-layout-status:empty { display: none; }
.dash-layout-actions [hidden], .dash-layout-editor[hidden], #dash-layout-empty[hidden] { display: none; }
.dash-layout-editor h2 { margin: 0 0 8px; font-size: 1.2rem; }
.dash-layout-editor p { color: var(--text-secondary); line-height: 1.5; }
.dash-layout-fields { border: 0; padding: 0; margin: 16px 0; min-width: 0; }
.dash-layout-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dash-layout-group { border: 1px solid var(--border-primary); border-radius: var(--radius-md); padding: 12px; min-width: 0; }
.dash-layout-group legend { font-weight: 700; padding: 0 6px; }
.dash-layout-choice { display: flex; align-items: center; gap: 10px; padding: 8px 4px; cursor: pointer; }
.dash-layout-choice input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--primary-color); }
.dash-layout-metric { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.dash-layout-metric select { width: auto; max-width: 100%; }
.dash-layout-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 600px) { .dash-layout-groups { grid-template-columns: 1fr; gap: 12px; } }
