:root {
  color-scheme: dark;
  --topbar-height: 68px;
  --sectorbar-height: 86px;
  --bg: #080c12;
  --panel: #111827;
  --panel-2: #0f172a;
  --panel-3: #0b1220;
  --surface: #0b1220;
  --surface-2: #08111f;
  --surface-3: #020617;
  --muted: #94a3b8;
  --text: #e5edf6;
  --line: #243244;
  --field-bg: #08111f;
  --field-bg-strong: #0b1626;
  --field-border: #39536e;
  --field-border-strong: #4d7192;
  --field-focus: #38d5ff;
  --field-placeholder: #8ea8c2;
  --menu-bg: #08121f;
  --accent: #38bdf8;
  --accent-strong: #0e7490;
  --accent-border: #0891b2;
  --accent-soft: #082f49;
  --accent-contrast: #f8fbff;
  --button-bg: #111a28;
  --topbar-bg: #0b111b;
  --menu-surface: #07111d;
  --input-text: #f8fbff;
  --shadow: 0 18px 48px rgba(0, 0, 0, .48);
  --topbar-text: #f8fbff;
  --topbar-muted: #9fb2cb;
  --topbar-card-bg: #101827;
  --topbar-card-border: #31445f;
  --topbar-logo-bg: #06101d;
  --topbar-logo-text: #38d5ff;
  --topbar-nav-bg: #f8fbff;
  --topbar-nav-text: #0f172a;
  --topbar-nav-border: #d5e0ec;
  --timing-rail-bg: #152235;
  --timing-rail-text: #dbe7f5;
  --timing-rail-muted: #aebfd3;
  --timing-rail-item-bg: #1f3048;
  --timing-rail-item-border: #334965;
  --timing-rail-active-bg: #0f8176;
  --timing-rail-active-border: #16b5a6;
  --flag-control-bg: #0d1624;
  --flag-control-text: #f8fbff;
  --flag-control-muted: #9fb2cb;
  --ok: #22c55e;
  --warn: #facc15;
  --danger: #fb7185;
  --error: #f97316;
}

:root[data-theme="timing-light"] {
  color-scheme: light;
  --bg: #edf2f7;
  --panel: #ffffff;
  --panel-2: #f7fafc;
  --panel-3: #eef4f8;
  --surface: #ffffff;
  --surface-2: #f4f8fb;
  --surface-3: #e7edf4;
  --muted: #526174;
  --text: #172033;
  --line: #d2dee9;
  --field-bg: #ffffff;
  --field-bg-strong: #f8fbfd;
  --field-border: #b8c8d9;
  --field-border-strong: #7f96ad;
  --field-focus: #0b7285;
  --field-placeholder: #8292a6;
  --menu-bg: #ffffff;
  --accent: #0b7285;
  --accent-strong: #0b6f80;
  --accent-border: #075e6d;
  --accent-soft: #d9f2f6;
  --accent-contrast: #ffffff;
  --button-bg: #f8fbfd;
  --topbar-bg: #172033;
  --menu-surface: #ffffff;
  --input-text: #172033;
  --shadow: 0 18px 42px rgba(23, 32, 51, .12);
  --ok: #188556;
  --warn: #c18a08;
  --danger: #c53030;
  --error: #b84d11;
}

:root[data-theme="paddock-pro"] {
  color-scheme: light;
  --bg: #eef3f0;
  --panel: #ffffff;
  --panel-2: #f8faf8;
  --panel-3: #e4ebe7;
  --surface: #ffffff;
  --surface-2: #f4f7f5;
  --surface-3: #dde7e1;
  --muted: #53635b;
  --text: #17231d;
  --line: #cbd9d1;
  --field-bg: #ffffff;
  --field-bg-strong: #f7faf8;
  --field-border: #b3c5bb;
  --field-border-strong: #789285;
  --field-focus: #16806b;
  --field-placeholder: #7f9188;
  --menu-bg: #ffffff;
  --accent: #16806b;
  --accent-strong: #106f5d;
  --accent-border: #0a5f50;
  --accent-soft: #d9eee8;
  --accent-contrast: #ffffff;
  --button-bg: #f8faf8;
  --topbar-bg: #1b2520;
  --menu-surface: #ffffff;
  --input-text: #17231d;
  --shadow: 0 18px 42px rgba(24, 42, 32, .12);
  --topbar-text: #f8fbf9;
  --topbar-muted: #b8c9c1;
  --topbar-card-bg: #111b17;
  --topbar-card-border: #365148;
  --topbar-logo-bg: #07130f;
  --topbar-logo-text: #5ee0bd;
  --topbar-nav-bg: #f8fbf9;
  --topbar-nav-text: #14201a;
  --topbar-nav-border: #d5e2dc;
  --timing-rail-bg: #1d2a24;
  --timing-rail-text: #e7f3ee;
  --timing-rail-muted: #b6c9c0;
  --timing-rail-item-bg: #283b33;
  --timing-rail-item-border: #3f5b50;
  --timing-rail-active-bg: #106f5d;
  --timing-rail-active-border: #2bc4a4;
  --flag-control-bg: #14201a;
  --flag-control-text: #f8fbf9;
  --flag-control-muted: #b8c9c1;
  --ok: #1f8a5b;
  --warn: #a87608;
  --danger: #b83232;
  --error: #a84811;
}

:root[data-theme="pit-wall"] {
  color-scheme: dark;
  --bg: #0b0f12;
  --panel: #141a1f;
  --panel-2: #10161b;
  --panel-3: #0c1217;
  --surface: #151d23;
  --surface-2: #11181e;
  --surface-3: #070b0f;
  --muted: #a5b0b8;
  --text: #f1f5f8;
  --line: #32404a;
  --field-bg: #0d1419;
  --field-bg-strong: #121b22;
  --field-border: #43545f;
  --field-border-strong: #6b818e;
  --field-focus: #2dd4bf;
  --field-placeholder: #94a3ad;
  --menu-bg: #0d1419;
  --accent: #2dd4bf;
  --accent-strong: #0f766e;
  --accent-border: #14b8a6;
  --accent-soft: #123b37;
  --accent-contrast: #f8fbff;
  --button-bg: #182128;
  --topbar-bg: #080c0f;
  --menu-surface: #0d1419;
  --input-text: #f8fbff;
  --shadow: 0 18px 48px rgba(0, 0, 0, .52);
  --topbar-text: #f8fbff;
  --topbar-muted: #a7b8c2;
  --topbar-card-bg: #11191f;
  --topbar-card-border: #344753;
  --topbar-logo-bg: #061013;
  --topbar-logo-text: #2dd4bf;
  --topbar-nav-bg: #f4f8fb;
  --topbar-nav-text: #101820;
  --topbar-nav-border: #c9d5de;
  --timing-rail-bg: #101820;
  --timing-rail-text: #eef6f8;
  --timing-rail-muted: #a7b8c2;
  --timing-rail-item-bg: #1a252e;
  --timing-rail-item-border: #354b58;
  --timing-rail-active-bg: #0f766e;
  --timing-rail-active-border: #2dd4bf;
  --flag-control-bg: #101820;
  --flag-control-text: #f8fbff;
  --flag-control-muted: #a7b8c2;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --error: #fb923c;
}

:root[data-theme="endurance-night"] {
  color-scheme: dark;
  --bg: #050b0a;
  --panel: #0d1815;
  --panel-2: #111f1b;
  --panel-3: #09110f;
  --surface: #10201b;
  --surface-2: #0b1713;
  --surface-3: #030806;
  --muted: #a6beb4;
  --text: #effaf5;
  --line: #25453a;
  --field-bg: #07120f;
  --field-bg-strong: #0d1c17;
  --field-border: #376356;
  --field-border-strong: #5f8f80;
  --field-focus: #84cc16;
  --field-placeholder: #94aba2;
  --menu-bg: #07120f;
  --accent: #84cc16;
  --accent-strong: #4d7c0f;
  --accent-border: #a3e635;
  --accent-soft: #1d3510;
  --accent-contrast: #f8fbff;
  --button-bg: #11241e;
  --topbar-bg: #030806;
  --menu-surface: #07120f;
  --input-text: #f8fbff;
  --shadow: 0 18px 48px rgba(0, 0, 0, .58);
  --topbar-text: #f8fff8;
  --topbar-muted: #b2c9bf;
  --topbar-card-bg: #0a1511;
  --topbar-card-border: #2a4a3f;
  --topbar-logo-bg: #020605;
  --topbar-logo-text: #a3e635;
  --topbar-nav-bg: #f4f8f4;
  --topbar-nav-text: #102015;
  --topbar-nav-border: #cbd9cf;
  --timing-rail-bg: #09120f;
  --timing-rail-text: #effaf5;
  --timing-rail-muted: #a6beb4;
  --timing-rail-item-bg: #12261f;
  --timing-rail-item-border: #2f5448;
  --timing-rail-active-bg: #3f6212;
  --timing-rail-active-border: #84cc16;
  --flag-control-bg: #09120f;
  --flag-control-text: #effaf5;
  --flag-control-muted: #a6beb4;
  --ok: #22c55e;
  --warn: #eab308;
  --danger: #fb7185;
  --error: #f97316;
}

:root[data-theme="high-contrast"] {
  color-scheme: dark;
  --bg: #000000;
  --panel: #050505;
  --panel-2: #0a0a0a;
  --panel-3: #111111;
  --surface: #050505;
  --surface-2: #0a0a0a;
  --surface-3: #000000;
  --muted: #d8dee9;
  --text: #ffffff;
  --line: #ffffff;
  --field-bg: #000000;
  --field-bg-strong: #050505;
  --field-border: #ffffff;
  --field-border-strong: #facc15;
  --field-focus: #facc15;
  --field-placeholder: #d8dee9;
  --menu-bg: #000000;
  --accent: #facc15;
  --accent-strong: #facc15;
  --accent-border: #ffffff;
  --accent-soft: #3a3000;
  --accent-contrast: #000000;
  --button-bg: #0a0a0a;
  --topbar-bg: #000000;
  --menu-surface: #000000;
  --input-text: #ffffff;
  --shadow: none;
  --topbar-text: #ffffff;
  --topbar-muted: #ffffff;
  --topbar-card-bg: #000000;
  --topbar-card-border: #ffffff;
  --topbar-logo-bg: #000000;
  --topbar-logo-text: #facc15;
  --topbar-nav-bg: #000000;
  --topbar-nav-text: #ffffff;
  --topbar-nav-border: #ffffff;
  --timing-rail-bg: #000000;
  --timing-rail-text: #ffffff;
  --timing-rail-muted: #ffffff;
  --timing-rail-item-bg: #000000;
  --timing-rail-item-border: #ffffff;
  --timing-rail-active-bg: #facc15;
  --timing-rail-active-border: #ffffff;
  --flag-control-bg: #000000;
  --flag-control-text: #ffffff;
  --flag-control-muted: #ffffff;
  --ok: #4ade80;
  --warn: #fde047;
  --danger: #fb7185;
  --error: #fdba74;
}

:root[data-theme="tv-speaker"] {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #0f1d2e;
  --panel-2: #13263c;
  --panel-3: #0b1728;
  --surface: #0d1b2d;
  --surface-2: #091525;
  --surface-3: #050b16;
  --muted: #b9c5d4;
  --text: #f7fbff;
  --line: #31506f;
  --field-bg: #0b1728;
  --field-bg-strong: #0f2238;
  --field-border: #51708e;
  --field-border-strong: #7ba1c5;
  --field-focus: #f59e0b;
  --field-placeholder: #a8b6c7;
  --menu-bg: #07111f;
  --accent: #f59e0b;
  --accent-strong: #d97706;
  --accent-border: #facc15;
  --accent-soft: #3b2608;
  --accent-contrast: #111827;
  --button-bg: #14243a;
  --topbar-bg: #06101d;
  --menu-surface: #091525;
  --input-text: #f8fbff;
  --shadow: 0 18px 48px rgba(0, 0, 0, .5);
  --topbar-text: #f7fbff;
  --topbar-muted: #b9c5d4;
  --topbar-card-bg: #0b1728;
  --topbar-card-border: #31506f;
  --topbar-logo-bg: #050b16;
  --topbar-logo-text: #facc15;
  --topbar-nav-bg: #f8fbff;
  --topbar-nav-text: #111827;
  --topbar-nav-border: #cfd8e3;
  --timing-rail-bg: #0b1728;
  --timing-rail-text: #f7fbff;
  --timing-rail-muted: #b9c5d4;
  --timing-rail-item-bg: #14243a;
  --timing-rail-item-border: #31506f;
  --timing-rail-active-bg: #d97706;
  --timing-rail-active-border: #facc15;
  --flag-control-bg: #091525;
  --flag-control-text: #f7fbff;
  --flag-control-muted: #b9c5d4;
}

.timing-page {
  overflow: auto;
}

.timing-shell {
  position: relative;
  isolation: isolate;
  padding: 10px;
  display: grid;
  gap: 10px;
  grid-template-rows: minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-height));
}

.span-2 {
  grid-column: 1 / -1;
}

.live-feed-links {
  display: grid;
  grid-template-columns: repeat(2, max-content) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.live-feed-links code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  background: rgba(20, 26, 34, 0.06);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.timing-public-page {
  min-height: 100vh;
  background: #f5f7fb;
  color: #162033;
}

.public-live-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.public-live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px clamp(16px, 4vw, 44px);
  background: #ffffff;
  border-bottom: 1px solid #dce2ea;
}

.public-live-brand {
  min-width: 0;
}

.public-live-brand h1 {
  margin: 0;
  font-size: 1.15rem;
}

.public-live-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.public-live-board {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: clamp(14px, 3vw, 28px);
}

.public-live-card {
  background: #ffffff;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(22, 32, 51, 0.08);
  overflow: hidden;
}

.public-live-overview {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
}

.public-live-overview h2,
.speaker-hero h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
}

.public-live-overview span,
.public-live-overview strong {
  display: block;
  color: #526071;
  margin-top: 4px;
}

.public-live-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.public-live-tabs button {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #162033;
  border-radius: 6px;
  padding: 9px 12px;
  font: inherit;
  cursor: pointer;
}

.public-live-tabs button.active {
  background: #16324f;
  border-color: #16324f;
  color: #ffffff;
}

.public-live-data {
  min-height: 320px;
}

.public-live-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.86rem, 1.2vw, 1rem);
}

.public-live-table th,
.public-live-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #e5ebf2;
  white-space: nowrap;
}

.public-live-table th {
  color: #526071;
  background: #f8fafc;
  font-weight: 700;
}

.public-announcements {
  display: grid;
  gap: 10px;
}

.public-announcement {
  display: grid;
  gap: 4px;
  background: #fff7df;
  border: 1px solid #e7c35f;
  border-left: 5px solid #c69214;
  border-radius: 8px;
  padding: 12px 14px;
}

.public-announcement.alert,
.public-announcement.warning {
  background: #fff0f0;
  border-color: #ee9b9b;
  border-left-color: #c93535;
}

.public-class-block {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.public-class-block h3,
.speaker-grid h3 {
  margin: 0;
  padding: 0 0 4px;
  font-size: 1rem;
}

.speaker-board {
  gap: 16px;
}

.speaker-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 22px;
  background: #162033;
  color: #ffffff;
}

.speaker-hero span {
  color: #a8b4c4;
}

.speaker-hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 10px;
}

.speaker-hero-metrics strong {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  padding: 10px 12px;
}

.speaker-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.speaker-grid .public-live-card {
  padding: 14px;
}

.public-alert {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e7c35f;
  background: #fff7df;
  border-radius: 6px;
}

.public-portal-page {
  min-height: 100vh;
  background: #eef2f7;
  color: #162033;
}

.public-portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.public-portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: #ffffff;
  border-bottom: 1px solid #d7e0eb;
}

.public-portal-brand h1 {
  margin: 0;
  font-size: 1.16rem;
}

.public-portal-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.public-portal-board {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: clamp(14px, 3vw, 28px);
}

.public-portal-loading {
  padding: 18px 20px;
}

.public-portal-loading h2 {
  margin: 0 0 6px;
}

.public-portal-overview {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  padding: 18px 20px;
}

.public-portal-title {
  display: grid;
  gap: 3px;
}

.public-portal-title span,
.public-portal-title small,
.public-portal-kpis span {
  color: #526071;
}

.public-portal-title h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1.08;
}

.public-portal-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(116px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.public-portal-kpis div {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid #d7e0eb;
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px 12px;
}

.public-portal-kpis strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-session-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.public-session-strip a {
  display: grid;
  gap: 2px;
  min-width: 180px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #162033;
  padding: 10px 12px;
  text-decoration: none;
}

.public-session-strip a.active {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.public-session-strip span {
  color: #526071;
  font-size: .86rem;
}

.public-portal-content {
  min-height: 360px;
}

.public-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.public-trackers-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  min-height: 460px;
}

.public-tracker-controls {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  border-right: 1px solid #dce2ea;
  background: #f8fafc;
  padding: 14px;
}

.public-tracker-controls > div:first-child {
  display: grid;
  gap: 3px;
}

.public-tracker-controls span,
.public-tracker-switch small {
  color: #526071;
}

.public-tracker-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
}

.public-tracker-switch {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 54px;
  border: 1px solid #d7e0eb;
  border-radius: 7px;
  background: #ffffff;
  padding: 9px 10px;
}

.public-tracker-switch input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.public-tracker-switch span {
  display: grid;
  min-width: 0;
}

.public-tracker-switch strong,
.public-tracker-switch small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-tracker-stage {
  min-width: 0;
  padding: 14px;
}

.public-tracker-map {
  display: block;
  width: 100%;
  min-height: 430px;
  aspect-ratio: 1000 / 620;
  border: 1px solid #d7e0eb;
  border-radius: 8px;
  background: #eef4f8;
}

.public-tracker-map.empty {
  display: grid;
  place-items: center;
  padding: 20px;
}

@media (max-width: 820px) {
  .live-feed-links {
    grid-template-columns: 1fr;
  }

  .public-live-header,
  .public-portal-header,
  .public-live-overview {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-portal-overview,
  .public-trackers-layout {
    grid-template-columns: 1fr;
  }

  .public-portal-kpis {
    grid-template-columns: 1fr;
  }

  .public-tracker-controls {
    border-right: 0;
    border-bottom: 1px solid #dce2ea;
  }

  .public-tracker-list {
    max-height: 260px;
  }

  .public-live-table {
    display: block;
    overflow-x: auto;
  }

  .speaker-hero,
  .speaker-grid {
    grid-template-columns: 1fr;
  }

  .speaker-hero-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .public-live-table {
    display: block;
    overflow: visible;
    min-width: 0;
  }

  .public-live-table thead {
    display: none;
  }

  .public-live-table tbody,
  .public-live-table tr,
  .public-live-table td {
    display: block;
    width: 100%;
  }

  .public-live-table tr {
    margin: 10px 0;
    border: 1px solid #dce2ea;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
  }

  .public-live-table td {
    display: grid;
    grid-template-columns: minmax(92px, .38fr) minmax(0, 1fr);
    gap: 10px;
    padding: 9px 12px;
    white-space: normal;
  }

  .public-live-table td::before {
    content: attr(data-label);
    color: #526071;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
  }
}

.timing-shell::before {
  content: "";
  position: absolute;
  inset: 10px;
  background: url("/static/assets/logos/software/rtm_timing_transparent.png") center / min(88%, 1120px) auto no-repeat;
  opacity: .025;
  filter: saturate(.88) contrast(1.08);
  pointer-events: none;
  z-index: 3;
}

body.data-alert-visible .timing-shell {
  min-height: calc(100vh - var(--topbar-height) - 74px);
}

.timing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
}

.timing-hero-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.timing-hero-copy p {
  margin: 0;
}

.timing-hero-side {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.timing-archive-actions {
  padding: 0;
  white-space: nowrap;
}

.timing-action-menu-toggle {
  min-width: 88px;
}

.timing-action-menu-toggle.icon-btn {
  min-width: 42px;
}

.timing-action-menu .config-action-menu-list {
  left: auto;
  right: 0;
  min-width: 170px;
  max-width: min(220px, calc(100vw - 24px));
  z-index: 80;
}

.timing-command-bar {
  overflow: visible;
}

.timing-workspace-main {
  overflow: visible;
}

.timing-workspace-layout {
  overflow: hidden;
}

.timing-hero h2,
.timing-panel h2 {
  margin: 0;
}

.timing-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 5px;
  min-width: 0;
}

.timing-kpi {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b1220;
  padding: 4px 6px;
  min-width: 0;
}

.timing-kpi strong {
  display: block;
  font-size: 14px;
  color: #bae6fd;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-kpi span {
  color: var(--muted);
  font-size: 10px;
}

.timing-command-bar {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
}

.timing-command-kpis {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}

.timing-command-kpis .timing-kpi {
  min-width: 98px;
  padding: 7px 10px;
}

.timing-command-title {
  min-width: 0;
}

.timing-command-title h2,
.timing-command-title p {
  margin: 0;
}

.timing-command-title h2 {
  font-size: 1rem;
  line-height: 1.16;
}

.timing-command-title p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.timing-config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  min-height: 0;
}

.timing-data-banner {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.82);
}

.timing-data-banner span,
.timing-data-banner small {
  color: var(--muted);
}

.timing-data-banner.error {
  border-color: rgba(248, 113, 113, 0.72);
  background: rgba(69, 10, 10, 0.36);
}

.timing-data-banner.error strong {
  color: #fecaca;
}

.timing-filter-bar {
  display: grid;
  grid-template-columns: minmax(190px, 320px) minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
}

.timing-filter-bar .field {
  margin: 0;
}

.timing-filter-bar .muted {
  padding-bottom: 9px;
  min-width: 0;
}

.scoped-loader {
  pointer-events: none;
  display: inline-grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 74px;
  border: 1px solid rgba(56, 189, 248, .3);
  border-radius: 8px;
  background: rgba(8, 17, 31, .78);
  padding: 12px;
  color: var(--text);
}

.scoped-loader-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #020617;
  border: 1px solid rgba(56, 189, 248, .35);
  overflow: hidden;
}

.scoped-loader-mark::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  background: conic-gradient(from 0deg, transparent, rgba(56, 189, 248, .95), transparent 70%);
  animation: scoped-loader-spin .9s linear infinite;
}

.scoped-loader-mark img {
  position: relative;
  z-index: 1;
  max-width: 32px;
  max-height: 32px;
  object-fit: contain;
  animation: scoped-loader-pulse 1.2s ease-in-out infinite;
}

.scoped-loader strong,
.scoped-loader small {
  display: block;
}

.scoped-loader strong {
  color: #e0f2fe;
}

.scoped-loader small {
  margin-top: 3px;
  color: var(--muted);
}

@keyframes scoped-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scoped-loader-pulse {
  0%,
  100% {
    opacity: .72;
    transform: scale(.94);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.timing-nav-panel,
.timing-context-panel,
.timing-detail-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.timing-detail-panel {
  position: relative;
  isolation: isolate;
  overflow: auto;
}

.timing-detail-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/static/assets/logos/software/rtm_timing_transparent.png") center / min(82%, 980px) auto no-repeat;
  opacity: .055;
  filter: saturate(.88) contrast(1.08);
  pointer-events: none;
  z-index: 0;
}

.timing-detail-panel > * {
  position: relative;
  z-index: 1;
}

.timing-section-tabs {
  display: flex;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 1px 2px;
  border-bottom: 1px solid var(--line);
  scrollbar-gutter: stable;
}

.timing-section-tab {
  display: grid;
  grid-template-columns: 20px minmax(42px, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-width: 84px;
  max-width: 118px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #0b1220;
  color: var(--text);
  padding: 3px 5px;
  cursor: pointer;
  text-align: left;
  min-height: 30px;
}

.timing-section-tab:hover,
.timing-section-tab.selected {
  border-color: var(--accent);
  background: #082f49;
}

.timing-section-tab-text {
  display: block;
  min-width: 0;
}

.timing-section-tab-text strong,
.timing-section-tab-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-section-tab-text small {
  display: none;
}

.timing-section-tab .config-list-thumb {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 8px;
}

.timing-refactor-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.timing-refactor-shell.rail-collapsed {
  grid-template-columns: 58px minmax(0, 1fr);
}

.timing-workspace-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
  overflow: hidden;
}

.timing-workspace-rail-items {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  min-width: 0;
}

.timing-primary-nav-button,
.timing-secondary-menu-toggle,
.timing-secondary-menu-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.timing-primary-nav-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 70px;
  padding: 9px 8px;
}

.timing-primary-nav-button .timing-count {
  justify-self: end;
  align-self: end;
}

.timing-primary-nav-button .config-list-thumb {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.timing-primary-nav-button:hover,
.timing-primary-nav-button.selected,
.timing-secondary-menu-toggle:hover,
.timing-secondary-dropdown[open] .timing-secondary-menu-toggle,
.timing-secondary-menu-item:hover,
.timing-secondary-menu-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.timing-primary-nav-button strong,
.timing-primary-nav-button small,
.timing-secondary-menu-toggle strong,
.timing-secondary-menu-toggle small,
.timing-secondary-menu-item strong,
.timing-secondary-menu-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-primary-nav-button small,
.timing-secondary-menu-toggle small,
.timing-secondary-menu-item small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.timing-primary-nav-button strong,
.timing-primary-nav-button small {
  white-space: normal;
}

.timing-rail-toggle {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  padding: 7px 8px;
  text-align: left;
}

.timing-rail-toggle span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: var(--accent);
  background: #020617;
  font-size: 12px;
}

.timing-rail-toggle strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-refactor-shell.rail-collapsed .timing-workspace-rail {
  padding: 7px;
}

.timing-refactor-shell.rail-collapsed .timing-primary-nav-button {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 44px;
  padding: 5px;
}

.timing-refactor-shell.rail-collapsed .timing-primary-nav-button > span:not(.config-list-thumb),
.timing-refactor-shell.rail-collapsed .timing-primary-nav-button .timing-count {
  display: none;
}

.timing-refactor-shell.rail-collapsed .timing-primary-nav-button .config-list-thumb {
  width: 34px;
  height: 34px;
}

.timing-refactor-shell.rail-collapsed .timing-rail-toggle {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 5px;
}

.timing-refactor-shell.rail-collapsed .timing-rail-toggle strong {
  display: none;
}

.timing-workspace-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.timing-workspace-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.timing-workspace-topline h2,
.timing-workspace-topline p {
  margin: 0;
}

.timing-workspace-topline h2 {
  font-size: 1.05rem;
  line-height: 1.2;
}

.timing-workspace-topline p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.timing-workspace-topline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.timing-workspace-layout {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  gap: 10px;
  height: clamp(500px, calc(100vh - var(--topbar-height) - 104px), 920px);
  min-height: 0;
  overflow: hidden;
}

.timing-workspace-layout-v2 {
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) minmax(260px, 340px);
  height: clamp(560px, calc(100vh - var(--topbar-height) - 96px), 980px);
}

.timing-secondary-nav {
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.timing-secondary-dropdown {
  position: relative;
  z-index: 3;
}

.timing-secondary-dropdown summary {
  list-style: none;
}

.timing-secondary-dropdown summary::-webkit-details-marker {
  display: none;
}

.timing-secondary-menu-toggle,
.timing-secondary-menu-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 46px;
  padding: 7px;
}

.timing-secondary-menu-toggle {
  grid-template-columns: 30px minmax(0, 1fr) auto 20px;
}

.timing-menu-caret {
  display: grid;
  place-items: center;
  color: var(--accent);
  transition: transform .16s ease;
}

.timing-secondary-dropdown[open] .timing-menu-caret {
  transform: rotate(180deg);
}

.timing-secondary-menu-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, #020617);
  box-shadow: 0 16px 32px rgba(2, 6, 23, .36);
}

.timing-secondary-menu-item {
  background: var(--surface-2);
}

.timing-list-title {
  align-content: start;
}

.timing-list-title strong {
  display: block;
}

.timing-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.timing-list-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.timing-list-head .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.timing-context-panel .field {
  margin: 0;
}

.timing-primary-list,
.timing-context-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.timing-mobile-actions {
  display: none;
  gap: 8px;
  justify-content: flex-end;
}

.timing-action-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
}

.timing-action-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.timing-action-card strong,
.timing-action-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-action-card small {
  color: var(--muted);
}

.timing-action-eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.timing-action-buttons,
.timing-action-links {
  gap: 8px;
}

.timing-action-buttons .btn,
.timing-action-links .btn {
  justify-content: center;
  text-align: center;
}

.timing-section-row {
  grid-template-columns: 32px minmax(0, 1fr) minmax(30px, auto);
}

.timing-count {
  min-width: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  background: #020617;
}

.timing-detail-card {
  min-height: 100%;
  align-content: start;
}

.timing-detail-body {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.config-list-thumb.image-thumb img {
  object-fit: cover;
}

.driver-profile-summary {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.driver-photo-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  aspect-ratio: 1;
  border: 1px solid rgba(56, 189, 248, .42);
  border-radius: 8px;
  background: #020617;
  overflow: hidden;
}

.driver-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.driver-photo-preview.empty,
.driver-photo-preview.missing {
  border-style: dashed;
  color: var(--muted);
}

.driver-photo-preview.missing img {
  display: none;
}

.driver-photo-empty,
.driver-photo-preview.missing::after {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.driver-photo-preview.missing::after {
  content: "Introuvable";
}

.driver-profile-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.driver-account-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.driver-account-summary > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-account-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: #e5edf6;
  background: #111827;
  font-size: 11px;
  font-weight: 800;
}

.driver-account-badge.active {
  border-color: rgba(34, 197, 94, .58);
  background: rgba(22, 101, 52, .58);
}

.driver-account-badge.inactive,
.driver-account-badge.missing {
  border-color: rgba(250, 204, 21, .48);
  background: rgba(113, 63, 18, .46);
}

.driver-photo-field {
  margin: 0;
}

.driver-photo-picker {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.driver-reset-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
}

.driver-reset-status.success {
  color: #86efac;
}

.driver-reset-status.error {
  color: #fecaca;
}

.timing-session-filter {
  max-width: 360px;
}

.ranking-official-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.ranking-classes {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.ranking-class-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  overflow: hidden;
}

.ranking-class-block h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: #bfdbfe;
  font-size: 14px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 12px;
  color: var(--muted);
}

.timing-readout {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  padding: 12px;
  color: var(--muted);
}

.timing-readout strong {
  color: var(--text);
}

.timing-mode-notice {
  display: grid;
  gap: 4px;
  margin: 0 12px;
  border: 1px solid rgba(34, 211, 238, .34);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(8, 47, 73, .62), rgba(8, 13, 24, .78));
  color: var(--muted);
  padding: 10px 12px;
}

.timing-mode-notice strong {
  color: var(--text);
}

.timing-participants-panel {
  display: grid;
  gap: 10px;
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, #020617);
  padding: 12px;
}

.timing-participants-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  align-items: start;
  gap: 10px;
}

.timing-participants-head > div {
  display: grid;
  gap: 3px;
}

.timing-participants-head strong {
  color: var(--text);
}

.timing-participants-head small {
  color: var(--muted);
  line-height: 1.35;
}

.timing-participants-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}

.timing-participant-row {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  padding: 8px;
  cursor: pointer;
}

.timing-participant-row:hover,
.timing-participant-row.selected,
.timing-participant-row:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.timing-participant-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.timing-participant-row strong,
.timing-participant-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-participant-row small {
  color: var(--muted);
}

.timing-live-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.timing-live-control,
.timing-live-tabs,
.timing-live-tab-panel {
  grid-column: 1 / -1;
}

.timing-live-panel,
.timing-live-control {
  min-width: 0;
  align-content: start;
}

.timing-live-overview-card {
  display: grid;
  gap: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 14%, rgba(34, 211, 238, .17), transparent 31%),
    linear-gradient(135deg, rgba(8, 47, 73, .86), rgba(8, 17, 31, .96) 48%, rgba(5, 11, 22, .99)),
    var(--surface);
}

.timing-live-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 310px);
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.timing-live-stage-main {
  display: grid;
  align-content: start;
  gap: 13px;
  min-width: 0;
}

.timing-live-hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 14px;
  align-items: end;
}

.timing-live-title-block {
  min-width: 0;
}

.timing-live-title-block h3,
.timing-live-title-block p {
  margin: 0;
}

.timing-live-title-block h3 {
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1.12;
}

.timing-live-title-block p {
  color: var(--muted);
  font-size: 15px;
  margin-top: 5px;
}

.timing-live-session-field {
  margin: 0;
}

.timing-live-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timing-live-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, .84);
  color: var(--text);
  padding: 5px 11px;
  font-weight: 800;
  font-size: 13px;
}

.timing-live-chip.online,
.timing-live-chip.running,
.timing-live-chip.opened,
.timing-live-chip.warmup,
.timing-live-chip.assigned {
  border-color: rgba(34, 197, 94, .54);
  background: rgba(20, 83, 45, .3);
  color: #bbf7d0;
}

.timing-live-chip.offline,
.timing-live-chip.stopped,
.timing-live-chip.faulty,
.timing-live-chip.error,
.timing-live-chip.flag-red,
.timing-live-chip.flag-stop {
  border-color: rgba(248, 113, 113, .68);
  background: rgba(127, 29, 29, .44);
  color: #fecaca;
}

.timing-live-chip.flag-yellow,
.timing-live-chip.flag-yellow_not_counting,
.timing-live-chip.finish_flag,
.timing-live-chip.flag-finish {
  border-color: rgba(250, 204, 21, .62);
  background: rgba(113, 63, 18, .32);
  color: #fde68a;
}

.timing-live-phase-strip {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(56, 189, 248, .24);
  border-radius: 8px;
  background: rgba(2, 6, 23, .42);
  overflow: hidden;
}

.timing-live-phase-strip::before,
.timing-live-phase-strip::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 25px;
  height: 2px;
  border-radius: 999px;
}

.timing-live-phase-strip::before {
  background: rgba(148, 163, 184, .2);
}

.timing-live-phase-strip::after {
  right: auto;
  width: calc((100% - 44px) * var(--timing-live-progress, 0) / 100);
  background: linear-gradient(90deg, #0891b2, #22d3ee);
  box-shadow: 0 0 18px rgba(34, 211, 238, .28);
}

.timing-live-step {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-live-step i {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(148, 163, 184, .4);
  border-radius: 999px;
  background: #020617;
  box-shadow: 0 0 0 4px rgba(2, 6, 23, .96);
}

.timing-live-step.done {
  color: #bae6fd;
}

.timing-live-step.done i {
  border-color: rgba(56, 189, 248, .74);
  background: rgba(8, 145, 178, .62);
}

.timing-live-step.current {
  color: var(--text);
}

.timing-live-step.current i {
  border-color: #22d3ee;
  background: #22d3ee;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, .16);
}

.timing-live-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.timing-live-metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 8px;
  background: rgba(2, 6, 23, .5);
  padding: 11px 12px;
}

.timing-live-metric span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.timing-live-metric strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 1.08rem;
}

.timing-live-metric.emphasis {
  border-color: rgba(56, 189, 248, .5);
  background: rgba(8, 47, 73, .42);
}

.timing-live-metric.warning {
  border-color: rgba(250, 204, 21, .5);
  background: rgba(113, 63, 18, .26);
}

.timing-live-metric.wide {
  grid-column: span 2;
}

.timing-live-track-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(160px, 1fr) auto;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 47, 73, .5), rgba(2, 6, 23, .84)),
    rgba(2, 6, 23, .62);
  overflow: hidden;
}

.timing-live-track-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(125, 211, 252, .12);
  border-radius: 8px;
  pointer-events: none;
}

.timing-live-track-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 164px;
  padding: 14px;
  overflow: hidden;
}

.timing-live-track-media::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    linear-gradient(rgba(125, 211, 252, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, .055) 1px, transparent 1px);
  background-size: 22px 22px;
  transform: rotate(-8deg);
}

.timing-live-track-media img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(34, 211, 238, .2));
}

.timing-live-track-card.missing .timing-live-track-media img {
  display: none;
}

.timing-live-track-card.missing .timing-live-track-media::after {
  content: attr(data-track-label);
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.timing-track-scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .08), transparent);
  opacity: .55;
  pointer-events: none;
}

.timing-live-track-card figcaption {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(56, 189, 248, .16);
  background: rgba(2, 6, 23, .54);
}

.timing-live-track-card figcaption strong,
.timing-live-track-card figcaption small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-live-track-card figcaption strong {
  color: var(--text);
  font-size: 1rem;
}

.timing-live-track-card figcaption small {
  color: var(--muted);
}

.timing-track-thumbnail-preview {
  display: grid;
  place-items: center;
  min-height: 84px;
  background:
    linear-gradient(135deg, rgba(8, 47, 73, .18), rgba(2, 6, 23, .06)),
    var(--surface-2);
}

.timing-track-thumbnail-preview img {
  width: 100%;
  height: 100%;
  max-height: 108px;
  object-fit: contain;
  padding: 6px;
}

.timing-ui-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 6px;
  background: rgba(8, 47, 73, .44);
  color: currentColor;
}

.timing-ui-icon::before,
.timing-ui-icon::after {
  content: "";
  display: block;
}

.timing-icon-start::before,
.timing-icon-open::before {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
  transform: translateX(1px);
}

.timing-icon-warmup::before,
.timing-icon-refresh::before {
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 999px;
}

.timing-icon-stop::before {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
}

.timing-icon-flag::before {
  width: 2px;
  height: 12px;
  background: currentColor;
  box-shadow: 6px 1px 0 2px currentColor;
  transform: translateX(-3px);
}

.timing-icon-finish::before,
.timing-icon-grid::before {
  width: 11px;
  height: 11px;
  background:
    linear-gradient(45deg, currentColor 25%, transparent 25% 50%, currentColor 50% 75%, transparent 75%),
    linear-gradient(-45deg, currentColor 25%, transparent 25% 50%, currentColor 50% 75%, transparent 75%);
  background-size: 6px 6px;
  opacity: .9;
}

.timing-icon-lock::before {
  width: 10px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  transform: translateY(2px);
}

.timing-icon-lock::after {
  position: absolute;
  top: 3px;
  width: 8px;
  height: 7px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.timing-icon-save::before {
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 2px;
  box-shadow: inset 0 4px 0 rgba(2, 6, 23, .9);
}

.timing-icon-plus::before,
.timing-icon-plus::after {
  position: absolute;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.timing-icon-plus::after {
  transform: rotate(90deg);
}

.timing-icon-state::before,
.timing-icon-signal::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, .12);
}

.timing-icon-podium::before {
  width: 12px;
  height: 10px;
  background: linear-gradient(90deg, currentColor 0 3px, transparent 3px 5px, currentColor 5px 8px, transparent 8px 10px, currentColor 10px 12px);
  clip-path: polygon(0 45%, 25% 45%, 25% 0, 66% 0, 66% 25%, 100% 25%, 100% 100%, 0 100%);
}

.timing-icon-loop::before {
  width: 11px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.timing-icon-alert::before {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 11px solid currentColor;
}

.timing-live-status {
  display: grid;
  grid-template-columns: minmax(190px, 270px) minmax(220px, .7fr) minmax(220px, 1fr);
  gap: 8px;
  align-items: stretch;
}

.timing-live-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 1px 4px;
  scrollbar-gutter: stable;
}

.timing-live-tab {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 138px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1220;
  color: var(--text);
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
}

.timing-live-tab:hover,
.timing-live-tab.selected {
  border-color: var(--accent);
  background: #082f49;
}

.timing-live-tab strong,
.timing-live-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-live-tab span {
  min-width: 26px;
  border: 1px solid rgba(148, 163, 184, .34);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.live-alerts {
  display: grid;
  gap: 8px;
}

.live-alert {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(250, 204, 21, .38);
  border-radius: 8px;
  background: rgba(113, 63, 18, .24);
  padding: 10px;
}

.live-alert.ok {
  border-color: rgba(34, 197, 94, .36);
  background: rgba(20, 83, 45, .22);
}

.live-alert.info {
  border-color: rgba(56, 189, 248, .34);
  background: rgba(8, 47, 73, .28);
}

.live-alert strong {
  color: var(--text);
}

.live-alert span,
.live-alert small {
  color: var(--muted);
  font-size: 12px;
}

.timing-live-command-panel {
  gap: 12px;
}

.timing-live-command-summary {
  background: linear-gradient(135deg, rgba(8, 47, 73, .58), rgba(8, 17, 31, .94));
}

.timing-live-command-summary strong {
  font-size: 1.08rem;
}

.timing-live-command-buttons {
  gap: 7px;
}

.timing-live-command-buttons .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  font-weight: 800;
}

.timing-action-buttons .btn .timing-ui-icon {
  color: currentColor;
}

.compact-btn {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.leader-row td:first-child {
  color: #facc15;
  font-weight: 700;
}

.lap-chart-table th:first-child {
  min-width: 170px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #0b1220;
}

.lap-chart-table th:first-child span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #bfdbfe;
}

.lap-cell {
  display: inline-grid;
  place-items: center;
  min-width: 78px;
  min-height: 32px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 6px;
  background: #0f172a;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.lap-cell.empty {
  background: transparent;
}

.lap-cell.best {
  border-color: rgba(34, 197, 94, .8);
  background: rgba(20, 83, 45, .45);
}

.lap-cell.manual {
  border-style: dashed;
}

.lap-cell.yellow,
.lap-cell.yellow_not_counting {
  background: rgba(113, 63, 18, .44);
}

.lap-cell.red {
  background: rgba(127, 29, 29, .44);
}

.lap-cell.finish,
.lap-cell.stop {
  background: rgba(30, 41, 59, .82);
}

.lap-cell.deleted,
.lap-cell.invalidated {
  opacity: .58;
  text-decoration: line-through;
}

.track-chart {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.track-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  padding: 10px;
}

.track-card.leader {
  border-color: rgba(250, 204, 21, .6);
}

.track-card.late {
  border-color: rgba(248, 113, 113, .7);
}

.track-card strong {
  display: flex;
  gap: 8px;
  align-items: center;
}

.track-card strong span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #bfdbfe;
}

.track-card small,
.track-card-meta {
  color: var(--muted);
}

.track-card-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 12px;
}

.timing-panel {
  min-height: 0;
  overflow: hidden;
}

.compact-form {
  padding: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.timing-list {
  display: grid;
  gap: 6px;
  padding: 8px;
  max-height: 360px;
  overflow: auto;
}

.timing-row {
  display: grid;
  gap: 3px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1220;
  color: var(--text);
  padding: 10px;
}

button.timing-row {
  cursor: pointer;
}

.timing-row.active {
  border-color: #0891b2;
  background: #083344;
}

.timing-row.warning {
  border-color: #f97316;
  background: #2f1708;
}

.timing-row span {
  color: var(--muted);
  font-size: 12px;
}

.timing-table {
  padding: 8px;
  overflow: auto;
  max-height: 520px;
}

.timing-table:has(.timing-result-table-scroll) {
  padding: 0;
  overflow: hidden;
  max-height: none;
}

.timing-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.timing-table th,
.timing-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 7px;
  text-align: left;
  white-space: nowrap;
}

.timing-table th {
  color: #bfdbfe;
  background: #0b1220;
  position: sticky;
  top: 0;
  z-index: 1;
}

.timing-table-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
  align-items: end;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #08111f;
}

.timing-table-toolbar > strong {
  align-self: center;
  color: var(--text);
  font-size: 13px;
}

.timing-table-toolbar label,
.timing-column-menu label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.timing-table-toolbar input,
.timing-table-toolbar select {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #020617;
  color: var(--text);
  padding: 5px 8px;
}

.timing-column-menu {
  position: relative;
}

.timing-column-menu summary {
  min-height: 32px;
  display: grid;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #020617;
  color: var(--text);
  padding: 5px 8px;
  cursor: pointer;
}

.timing-column-menu div {
  position: absolute;
  right: 0;
  z-index: 8;
  display: grid;
  gap: 8px;
  min-width: 240px;
  max-height: 320px;
  overflow: auto;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #020617;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .38);
}

.timing-column-menu input {
  min-height: auto;
}

.timing-result-table-scroll {
  overflow: auto;
  max-height: 620px;
  width: 100%;
  min-width: 0;
  scrollbar-gutter: stable;
}

.timing-result-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.timing-result-table th,
.timing-result-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 7px;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  background: #050b16;
}

.timing-result-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #0b1220;
  color: #dbeafe;
}

.timing-result-table .sticky-identity {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #0b1220;
}

.timing-result-table td.sticky-identity {
  background: #050b16;
}

.timing-result-table .sticky-identity-2 {
  position: sticky;
  left: 64px;
  z-index: 4;
  background: #0b1220;
}

.timing-result-table td.sticky-identity-2 {
  background: #050b16;
}

.timing-result-table tr.selected-row td {
  background: #102a3c;
  outline: 1px solid rgba(125, 211, 252, .44);
}

.timing-result-table tr:hover td {
  background: #0b1728;
}

.table-sort-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.table-sort-button span {
  color: #fef08a;
  font-size: 11px;
}

.density-compact .timing-result-table th,
.density-compact .timing-result-table td {
  padding: 4px 6px;
  font-size: 12px;
}

.density-compact .timing-driver-cell {
  gap: 6px;
  min-width: 146px;
}

.density-compact .timing-driver-cell img,
.density-compact .driver-initials {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  border-radius: 5px;
}

.density-compact .timing-result-badge {
  padding: 1px 5px;
  font-size: 10px;
}

.density-tv {
  max-height: min(72vh, 860px);
}

.density-tv .timing-result-table {
  min-width: 1100px;
}

.density-tv .timing-result-table th,
.density-tv .timing-result-table td {
  padding: 12px 10px;
  font-size: 18px;
}

.density-tv .timing-driver-cell {
  min-width: 230px;
}

.density-tv .timing-driver-cell img,
.density-tv .driver-initials {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.density-tv .timing-result-badge {
  padding: 4px 9px;
  font-size: 13px;
}

.changed-cell {
  animation: timing-cell-change 2.4s ease-out;
}

@keyframes timing-cell-change {
  0% {
    background: #fef3c7;
    color: #111827;
  }
  100% {
    background: inherit;
    color: inherit;
  }
}

.timing-driver-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
}

.timing-driver-cell img,
.driver-initials {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(148, 163, 184, .5);
  border-radius: 7px;
  object-fit: cover;
  background: #111827;
}

.driver-initials {
  display: inline-grid;
  place-items: center;
  color: #e0f2fe;
  font-weight: 700;
  font-size: 12px;
}

.timing-driver-cell strong,
.timing-driver-cell small {
  display: block;
}

.timing-driver-cell small {
  color: var(--muted);
  font-size: 11px;
}

.timing-badge-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.timing-result-badge {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  background: #111827;
  color: #f8fafc;
  padding: 2px 7px;
  font-size: 11px;
  line-height: 1.35;
}

.timing-result-badge strong {
  font-size: 11px;
}

.timing-result-badge span {
  color: inherit;
}

.badge-pb {
  border-color: #60a5fa;
  background: #0f2f55;
}

.badge-best {
  border-color: #fde047;
  background: #42360b;
}

.badge-class {
  border-color: #86efac;
  background: #113d25;
}

.badge-nv {
  border-color: #fca5a5;
  background: #4a1717;
}

.badge-man {
  border-color: #c4b5fd;
  background: #30245f;
}

.badge-corr {
  border-color: #67e8f9;
  background: #164e63;
}

.badge-pen {
  border-color: #fdba74;
  background: #4b2a10;
}

.sector-chip-list {
  display: inline-flex;
  gap: 6px;
  align-items: stretch;
}

.sector-chip {
  display: grid;
  gap: 3px;
  min-width: 86px;
  border: 1px solid rgba(148, 163, 184, .42);
  border-radius: 7px;
  background: #0b1220;
  padding: 5px 7px;
}

.sector-chip > strong {
  color: #dbeafe;
  font-size: 11px;
}

.sector-chip > span {
  color: var(--text);
  font-size: 12px;
}

.status-text {
  display: inline-flex;
  border: 1px solid rgba(148, 163, 184, .5);
  border-radius: 999px;
  background: #111827;
  color: #f8fafc;
  padding: 3px 8px;
  font-size: 12px;
}

.status-invalidated,
.status-deleted,
.status-duplicate_detection,
.status-lap_too_short,
.status-missing_sector {
  border-color: #fca5a5;
  background: #4a1717;
}

.status-manual,
.status-corrected {
  border-color: #67e8f9;
  background: #164e63;
}

.penalty-cell {
  color: #fed7aa;
  font-weight: 700;
}

.ranking-panel {
  min-height: 360px;
}

.security-list {
  max-height: 420px;
}

.pilot-shell {
  grid-template-rows: auto minmax(0, 1fr);
}

.pilot-shell .timing-grid.lower {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.pilot-selector {
  min-width: 260px;
}

.padded {
  padding: 12px;
}

@media (max-width: 1300px) {
  .timing-workspace-layout {
    grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  }

  .timing-refactor-shell {
    grid-template-columns: 1fr;
  }

  .timing-workspace-rail {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .timing-workspace-rail-items {
    display: flex;
    flex: 1 1 auto;
    min-width: max-content;
  }

  .timing-primary-nav-button {
    width: 190px;
  }

  .timing-rail-toggle {
    flex: 0 0 auto;
    margin-top: 0;
    min-width: 46px;
  }

  .timing-refactor-shell.rail-collapsed {
    grid-template-columns: 1fr;
  }

  .timing-refactor-shell.rail-collapsed .timing-workspace-rail-items {
    min-width: auto;
  }

  .timing-refactor-shell.rail-collapsed .timing-primary-nav-button {
    width: 46px;
  }

  .timing-workspace-layout-v2 {
    grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  }

  .timing-action-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    max-height: 220px;
  }

  .timing-live-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .timing-hero {
    grid-template-columns: 1fr;
  }

  .timing-kpis,
  .timing-config-layout,
  .timing-workspace-layout,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .timing-refactor-shell,
  .timing-workspace-main,
  .timing-workspace-layout-v2 {
    grid-template-columns: 1fr;
  }

  .timing-workspace-rail {
    flex-direction: row;
    overflow-x: auto;
  }

  .timing-command-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .timing-command-kpis {
    flex-wrap: wrap;
  }

  .timing-command-kpis .timing-kpi {
    flex: 1 1 120px;
  }

  .timing-live-stage,
  .timing-live-hero-head,
  .timing-live-metric-grid {
    grid-template-columns: 1fr;
  }

  .timing-live-metric.wide {
    grid-column: auto;
  }

  .timing-live-phase-strip {
    grid-template-columns: 1fr;
  }

  .timing-workspace-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .timing-workspace-topline-actions {
    justify-content: flex-start;
  }

  .timing-action-panel {
    grid-column: auto;
    grid-template-columns: 1fr;
    max-height: none;
  }

  .timing-primary-nav-button {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }

  .timing-hero-side {
    justify-items: stretch;
    grid-template-columns: 1fr;
  }

  .timing-primary-list,
  .timing-context-list {
    max-height: none;
  }

  .timing-detail-body {
    grid-template-columns: 1fr;
  }

  .driver-profile-summary {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .driver-photo-preview {
    width: 72px;
  }

  .driver-photo-picker {
    grid-template-columns: 1fr;
  }

  .ranking-official-tools {
    grid-template-columns: 1fr;
  }

  .timing-live-status,
  .track-card-meta {
    grid-template-columns: 1fr;
  }

  .timing-live-control .panel-config-header {
    align-items: stretch;
  }

  .pilot-shell .timing-grid.lower {
    grid-template-columns: 1fr;
  }

  .pilot-selector {
    min-width: 0;
  }

  .timing-filter-bar {
    grid-template-columns: 1fr;
  }

  .timing-filter-bar .muted {
    padding-bottom: 0;
  }

  .timing-table-toolbar {
    grid-template-columns: 1fr;
  }

  .timing-result-table {
    min-width: 760px;
  }

  .density-tv .timing-result-table th,
  .density-tv .timing-result-table td {
    font-size: 15px;
  }

  .timing-result-table-scroll {
    max-height: none;
  }

  .timing-section-tabs {
    padding-bottom: 6px;
  }

  .timing-section-tab {
    min-width: 146px;
  }

  .timing-workspace-layout,
  .timing-context-panel,
  .timing-detail-panel {
    height: auto;
    overflow: visible;
  }

  .timing-mobile-actions {
    display: none;
  }

  .organization-user-summary,
  .organization-user-edit {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 620px) {
  .timing-table:has(.timing-result-table-scroll) {
    overflow: visible;
  }

  .timing-result-table-scroll {
    overflow: visible;
    max-height: none;
  }

  .timing-result-table {
    display: block;
    min-width: 0;
    width: 100%;
    border-spacing: 0;
  }

  .timing-result-table thead {
    display: none;
  }

  .timing-result-table tbody,
  .timing-result-table tr,
  .timing-result-table td {
    display: block;
    width: 100%;
  }

  .timing-result-table tr {
    margin: 10px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #050b16;
  }

  .timing-result-table td {
    display: grid;
    grid-template-columns: minmax(92px, .38fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-height: 38px;
    padding: 8px 10px;
    white-space: normal;
  }

  .timing-result-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .timing-result-table .sticky-identity,
  .timing-result-table .sticky-identity-2,
  .timing-result-table td.sticky-identity,
  .timing-result-table td.sticky-identity-2 {
    position: static;
    left: auto;
    z-index: auto;
    background: #050b16;
  }

  .timing-driver-cell {
    min-width: 0;
    max-width: 100%;
  }

  .timing-driver-cell > span:last-child {
    min-width: 0;
  }

  .timing-driver-cell strong,
  .timing-driver-cell small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .sector-chip-list,
  .timing-badge-list {
    white-space: normal;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(240px, auto) minmax(330px, 1fr) auto;
  gap: 8px;
  align-items: center;
  height: var(--topbar-height);
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: #0b111b;
  position: sticky;
  top: 0;
  z-index: 30;
  overflow: visible;
}

.topbar.topbar-main,
body:not([data-map-mode="control"]) .topbar.topbar-main {
  grid-template-columns: minmax(220px, 250px) minmax(170px, 210px) minmax(330px, 1fr) auto;
}

body[data-map-mode="control"] .topbar.topbar-main {
  grid-template-columns: minmax(220px, 250px) minmax(170px, 210px) minmax(270px, 1fr) auto;
}

.topbar.topbar-main.has-topbar-notification,
body:not([data-map-mode="control"]) .topbar.topbar-main.has-topbar-notification {
  grid-template-columns: minmax(220px, 250px) minmax(170px, 210px) auto minmax(330px, 1fr) auto;
}

body[data-map-mode="control"] .topbar.topbar-main.has-topbar-notification {
  grid-template-columns: minmax(220px, 250px) minmax(170px, 210px) auto minmax(270px, 1fr) auto;
}

body[data-map-mode="control"] .topbar {
  grid-template-columns: minmax(220px, 250px) minmax(330px, 1fr) auto;
}

.timing-page .topbar {
  grid-template-columns: minmax(220px, 250px) minmax(330px, 1fr) auto;
}

.timing-page .topbar.has-organizer-readonly {
  grid-template-columns: minmax(220px, 250px) auto minmax(320px, 1fr) max-content auto;
}

.topbar.has-organizer-readonly {
  grid-template-columns: minmax(200px, 250px) minmax(220px, auto) minmax(300px, 1fr) auto;
}

.topbar.topbar-main.has-organizer-readonly,
body[data-map-mode="control"] .topbar.topbar-main.has-organizer-readonly {
  grid-template-columns: minmax(200px, 250px) minmax(170px, 210px) auto minmax(300px, 1fr) auto;
}

.topbar-readonly-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 6px;
  align-items: center;
}

.timing-page .topbar-readonly-summary {
  width: max-content;
  grid-template-columns: max-content max-content;
  justify-self: end;
}

.topbar:has(#notificationButton) .topbar-readonly-summary {
  grid-template-columns: repeat(2, minmax(112px, 1fr));
}

.topbar-readonly-chip {
  min-width: 0;
  height: 42px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1220;
  color: var(--text);
  padding: 4px 7px;
}

button.topbar-readonly-chip {
  font: inherit;
  text-align: left;
  cursor: default;
}

button.topbar-readonly-chip.weather {
  cursor: pointer;
}

button.topbar-readonly-chip.weather:focus-visible {
  outline: 2px solid rgba(14, 165, 233, .95);
  outline-offset: 2px;
}

.timing-page .topbar-readonly-chip:not(.weather) {
  width: 230px;
  height: 50px;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-color: rgba(59, 130, 246, .32);
  border-radius: 8px;
  background: #0b1220;
  padding: 7px 10px;
}

.timing-page .topbar-readonly-chip:not(.weather) .topbar-readonly-code {
  width: 28px;
  height: 28px;
}

.timing-page .topbar-readonly-chip:not(.weather) .topbar-readonly-copy strong {
  font-size: 14px;
  line-height: 1.05;
}

.topbar-readonly-chip.ok {
  border-color: rgba(34, 197, 94, .55);
}

.topbar-readonly-chip.weather {
  border-color: rgba(148, 163, 184, .2);
  background: rgba(15, 23, 42, .62);
}

.topbar-readonly-chip.warn {
  border-color: rgba(250, 204, 21, .72);
  background: #241b04;
}

.topbar-readonly-chip.active {
  border-color: rgba(56, 189, 248, .58);
  background: #082f49;
}

.topbar-readonly-chip.muted {
  color: var(--muted);
}

.topbar-readonly-code {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, .72);
  border-radius: 5px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
}

.topbar-readonly-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.topbar-readonly-copy strong,
.topbar-readonly-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-readonly-copy strong {
  color: #e0f2fe;
  font-size: 13px;
}

.topbar-readonly-copy small {
  color: var(--muted);
  font-size: 10px;
}

.topbar-readonly-chip.weather,
.topbar-readonly-chip.weather.warn,
.topbar-readonly-chip.weather.muted,
:root[data-theme] .topbar-readonly-chip.weather,
:root[data-theme] .topbar-readonly-chip.weather.warn,
:root[data-theme] .topbar-readonly-chip.weather.muted {
  height: 42px;
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  grid-template-columns: 28px minmax(0, auto);
  gap: 8px;
  border-color: rgba(254, 202, 202, .95);
  border-radius: 8px;
  background: linear-gradient(135deg, #ff9aa2 0%, #f17882 100%);
  color: #0f172a;
  padding: 6px 8px;
  box-shadow: none;
}

.topbar-readonly-chip.weather .topbar-readonly-code {
  position: relative;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: #ffe4e6;
  color: transparent;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .42);
}

.topbar-readonly-chip.weather .topbar-readonly-code::before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 0 3px #fb923c, 0 0 12px rgba(249, 115, 22, .28);
}

.topbar-readonly-chip.weather .topbar-readonly-copy strong,
:root[data-theme] .topbar-readonly-chip.weather .topbar-readonly-copy strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.topbar-readonly-chip.weather .topbar-readonly-copy small {
  display: none;
}

.timing-page .topbar-readonly-summary {
  width: auto;
  justify-self: end;
  grid-template-columns: max-content max-content;
  align-items: center;
}

.timing-page .topbar-readonly-chip:not(.weather) {
  width: 220px;
  height: 42px;
  min-height: 42px;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 9px;
}

.timing-page .topbar-readonly-chip:not(.weather) .topbar-readonly-code {
  width: 26px;
  height: 26px;
}

.timing-page .topbar-readonly-chip.weather,
.timing-page .topbar-readonly-chip.weather.warn,
.timing-page .topbar-readonly-chip.weather.muted,
:root[data-theme] .timing-page .topbar-readonly-chip.weather,
:root[data-theme] .timing-page .topbar-readonly-chip.weather.warn,
:root[data-theme] .timing-page .topbar-readonly-chip.weather.muted {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  height: 42px;
  min-height: 42px;
  grid-template-columns: 28px minmax(0, auto);
  gap: 8px;
  padding: 6px 8px;
  box-shadow: none;
}

.timing-page .topbar-readonly-chip.weather .topbar-readonly-code {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.timing-page .topbar-readonly-chip.weather .topbar-readonly-code::before {
  width: 15px;
  height: 15px;
  box-shadow: 0 0 0 3px #fb923c, 0 0 12px rgba(249, 115, 22, .28);
}

.timing-page .topbar-readonly-chip.weather .topbar-readonly-copy strong,
:root[data-theme] .timing-page .topbar-readonly-chip.weather .topbar-readonly-copy strong {
  font-size: 16px;
}

.timing-assistant-backdrop {
  z-index: 140;
  place-items: center;
  padding: 18px;
}

.timing-assistant-modal {
  width: min(1360px, 100%);
  max-height: min(820px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-color: #31506f;
  background: #08111d;
  color: var(--text);
}

.timing-assistant-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  background: #080f1d;
  border-bottom-color: var(--line);
  padding: 12px 14px;
}

.timing-assistant-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.timing-assistant-head .modal-close {
  color: var(--text);
}

.timing-assistant-head-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.timing-assistant-head-badges span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0b1728;
  color: #dbeafe;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.timing-assistant-modal .field input,
.timing-assistant-modal .field select,
.timing-assistant-modal .field textarea {
  background: #0b1220;
  color: var(--text);
  border-color: var(--line);
}

.timing-assistant-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 280px;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.timing-assistant-sidebar,
.timing-assistant-main,
.timing-assistant-summary {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1624;
  padding: 10px;
  overflow: auto;
}

.timing-assistant-main {
  background: transparent;
  border: 0;
  padding: 0;
}

.timing-assistant-card {
  flex: 0 0 auto;
  display: grid;
  gap: 10px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1624;
  padding: 10px;
}

.timing-assistant-preview-card {
  flex: 1 1 auto;
  overflow: hidden;
}

.timing-assistant-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.timing-assistant-step > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(14, 165, 233, .78);
  border-radius: 8px;
  background: #092438;
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.timing-assistant-step strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-assistant-template-list {
  display: grid;
  gap: 8px;
}

.timing-assistant-template {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1220;
  color: var(--text);
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.timing-assistant-template span {
  font-weight: 900;
}

.timing-assistant-template.selected,
.timing-assistant-template:hover {
  border-color: var(--accent);
  background: #083d5f;
}

.timing-assistant-template small {
  color: var(--muted);
}

.timing-assistant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
}

.timing-assistant-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1728;
  padding: 8px;
}

.timing-assistant-status {
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timing-assistant-preview {
  min-height: 0;
  overflow: auto;
}

.timing-assistant-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1728;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.timing-assistant-preview-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.timing-assistant-preview-head strong,
.timing-assistant-preview-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-assistant-preview-head span {
  color: var(--muted);
  font-size: 12px;
}

.timing-assistant-empty {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 160px;
  border: 1px dashed #31506f;
  border-radius: 8px;
  background: #0b1220;
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.timing-assistant-empty.compact {
  min-height: 112px;
  padding: 12px;
}

.timing-assistant-empty strong {
  color: var(--text);
}

.timing-assistant-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.timing-assistant-counts span {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1220;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

.timing-assistant-counts b {
  color: var(--text);
  font-size: 20px;
}

.timing-assistant-table {
  max-height: 360px;
  overflow: auto;
}

.timing-assistant-source {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1220;
  padding: 10px;
}

.timing-assistant-source span {
  color: var(--muted);
}

.timing-assistant-source b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .timing-assistant-body {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .timing-assistant-summary {
    display: none;
  }

  .timing-assistant-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .timing-assistant-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .timing-assistant-head-badges {
    display: none;
  }
}

@media (max-width: 760px) {
  .timing-assistant-backdrop {
    padding: 6px;
  }

  .timing-assistant-modal {
    max-height: calc(100vh - 12px);
  }

  .timing-assistant-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .timing-assistant-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .timing-assistant-sidebar,
  .timing-assistant-main {
    overflow: visible;
  }

  .timing-assistant-grid,
  .timing-assistant-counts {
    grid-template-columns: 1fr;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand.auth-brand {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  gap: 7px;
  align-items: center;
  min-width: 220px;
  max-width: 250px;
  min-height: 46px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  cursor: default;
}

.logo {
  width: 38px;
  height: 38px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 800;
  overflow: hidden;
  background: #020617;
  padding: 3px;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-brand .logo {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.auth-brand-avatar img.custom-avatar {
  object-fit: contain;
}

.auth-brand-avatar img.default-avatar {
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand span,
.clock,
.muted {
  color: var(--muted);
}

.brand span {
  font-size: 11px;
}

.brand > div:not(.logo) {
  min-width: 0;
}

.nav {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: nowrap;
  min-width: 0;
}

.nav a,
.btn {
  border: 1px solid var(--line);
  background: #111a28;
  color: var(--text);
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  line-height: 1.15;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.nav a[data-nav-icon]::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 1px solid rgba(125, 211, 252, .5);
  border-radius: 4px;
  background: rgba(8, 47, 73, .62);
}

.nav a[data-nav-icon="piste"]::before {
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 0 35%, #7dd3fc 35% 45%, transparent 45%),
    linear-gradient(135deg, transparent 0 42%, #38bdf8 42% 58%, transparent 58%),
    rgba(8, 47, 73, .62);
}

.nav a[data-nav-icon="track"]::before {
  border-radius: 999px;
  box-shadow: inset 0 0 0 4px #0f172a, inset 0 0 0 6px #38bdf8;
}

.nav a[data-nav-icon="timing"]::before {
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, #38bdf8 0 2px, transparent 3px),
    linear-gradient(90deg, transparent 0 48%, #38bdf8 48% 56%, transparent 56%),
    rgba(8, 47, 73, .62);
}

.nav a[data-nav-icon="sessions"]::before {
  background:
    linear-gradient(#38bdf8 0 0) 3px 4px / 10px 2px no-repeat,
    linear-gradient(#38bdf8 0 0) 3px 8px / 10px 2px no-repeat,
    linear-gradient(#38bdf8 0 0) 3px 12px / 7px 2px no-repeat,
    rgba(8, 47, 73, .62);
}

.nav-group {
  position: relative;
  display: inline-flex;
}

.nav-group > a::after {
  content: " ▾";
  color: var(--muted);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  display: none;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b111b;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.nav-group:hover .nav-menu,
.nav-group:focus-within .nav-menu {
  display: grid;
}

.nav-group.active > a {
  background: #0e7490;
  border-color: #0891b2;
}

.nav a.active,
.btn.primary {
  background: #0e7490;
  border-color: #0891b2;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn.danger {
  background: #7f1d1d;
  border-color: #b91c1c;
}

.btn.with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ui-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid rgba(125, 211, 252, .36);
  border-radius: 5px;
  background: rgba(8, 47, 73, .58);
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.ui-icon::before {
  display: block;
}

.icon-parent::before {
  content: "↑";
}

.icon-folder-plus::before {
  content: "+";
}

.icon-rename::before {
  content: "✎";
}

.icon-download::before {
  content: "↓";
}

.icon-upload::before {
  content: "↑";
}

.icon-delete::before {
  content: "×";
}

.icon-report::before {
  content: "PDF";
  font-size: 8px;
}

.icon-open::before {
  content: "↵";
}

.icon-select::before {
  content: "✓";
}

.session {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .timing-page {
    --topbar-height: 156px;
  }

  .timing-page .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    min-height: var(--topbar-height);
    align-items: start;
    padding: 10px;
  }

  .timing-page .topbar-tools {
    justify-self: end;
  }

  .timing-topbar-filter {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
  }

  .timing-page .nav,
  .timing-page .session {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .timing-page .nav {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .timing-page .session {
    flex-wrap: wrap;
    white-space: normal;
  }
}

.weather-widget {
  display: grid;
  grid-template-columns: 28px auto;
  align-items: center;
  gap: 6px;
  min-width: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #0f172a;
  color: var(--text);
}

.weather-widget:hover {
  border-color: var(--accent);
  background: #082f49;
}

.track-status-weather {
  pointer-events: auto;
  min-height: 52px;
  border-color: rgba(148, 163, 184, .2);
  background: rgba(15, 23, 42, .62);
  text-shadow: 0 2px 8px rgba(2, 6, 23, .72);
}

.track-status-weather.weather-alert-level-1 {
  border-color: #facc15;
  background: linear-gradient(135deg, rgba(254, 240, 138, .96), rgba(250, 204, 21, .86));
  color: #422006;
  text-shadow: none;
  box-shadow: 0 8px 24px rgba(250, 204, 21, .22);
}

.track-status-weather.weather-alert-level-2 {
  border-color: #fb923c;
  background: linear-gradient(135deg, rgba(254, 215, 170, .98), rgba(251, 146, 60, .88));
  color: #431407;
  text-shadow: none;
  box-shadow: 0 8px 24px rgba(251, 146, 60, .24);
}

.track-status-weather.weather-alert-level-3 {
  border-color: #ef4444;
  background: linear-gradient(135deg, rgba(254, 202, 202, .98), rgba(248, 113, 113, .9));
  color: #450a0a;
  text-shadow: none;
  box-shadow: 0 8px 24px rgba(239, 68, 68, .24);
}

.track-status-weather #weatherTemp {
  color: #ffffff;
  font-weight: 800;
}

.track-status-weather.weather-alert-level-1 #weatherTemp,
.track-status-weather.weather-alert-level-2 #weatherTemp,
.track-status-weather.weather-alert-level-3 #weatherTemp {
  color: #111827;
}

.weather-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 21px;
  font-weight: 800;
}

.weather-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.weather-icon .weather-visual-icon {
  font-size: 24px;
}

.track-status-weather.weather-alert-level-1 .weather-icon,
.track-status-weather.weather-alert-level-2 .weather-icon,
.track-status-weather.weather-alert-level-3 .weather-icon {
  border-radius: 7px;
  background: rgba(255, 255, 255, .72);
}

.weather-temp-tile,
.track-status-weather.weather-temp-tile,
.track-status-weather.weather-temp-tile.weather-alert-level-1,
.track-status-weather.weather-temp-tile.weather-alert-level-2,
.track-status-weather.weather-temp-tile.weather-alert-level-3 {
  grid-template-columns: 28px minmax(0, auto);
  gap: 8px;
  align-items: center;
  justify-content: start;
  min-width: 118px;
  min-height: 42px;
  border: 1px solid rgba(254, 202, 202, .95);
  border-radius: 8px;
  background: linear-gradient(135deg, #ff9aa2 0%, #f17882 100%);
  color: #0f172a;
  padding: 6px 8px;
  text-shadow: none;
  box-shadow: none;
}

.weather-temp-tile:hover,
.track-status-weather.weather-temp-tile:hover {
  border-color: #fecdd3;
  background: linear-gradient(135deg, #ff9aa2 0%, #f17882 100%);
  color: #0f172a;
}

.track-status-weather.weather-temp-tile #weatherTemp,
.track-status-weather.weather-temp-tile.weather-alert-level-1 #weatherTemp,
.track-status-weather.weather-temp-tile.weather-alert-level-2 #weatherTemp,
.track-status-weather.weather-temp-tile.weather-alert-level-3 #weatherTemp {
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.weather-temp-tile .weather-icon,
.track-status-weather.weather-temp-tile .weather-icon,
.track-status-weather.weather-temp-tile.weather-alert-level-1 .weather-icon,
.track-status-weather.weather-temp-tile.weather-alert-level-2 .weather-icon,
.track-status-weather.weather-temp-tile.weather-alert-level-3 .weather-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #ffe4e6;
  color: #f97316;
  font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .42);
}

.weather-temp-tile .weather-icon .weather-visual-icon {
  font-size: 19px;
}

.clock {
  display: grid;
  gap: 1px;
  text-align: right;
  line-height: 1.1;
}

.clock-date {
  color: #bfdbfe;
  font-size: 12px;
  text-transform: capitalize;
}

.clock-time {
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
}

.session-split {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
}

.session-split .session-main {
  border-radius: 7px 0 0 7px;
}

.session-split .session-arrow {
  width: 34px;
  border-left: 0;
  border-radius: 0 7px 7px 0;
  padding-left: 0;
  padding-right: 0;
}

.organizer-chip {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: var(--text);
  min-height: 46px;
  padding: 5px 7px;
  cursor: pointer;
  text-align: left;
  min-width: 170px;
  max-width: 210px;
}

.auth-slot {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 230px;
  max-width: 250px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: var(--text);
  padding: 6px 8px;
}

.auth-slot[hidden] {
  display: none;
}

.auth-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #0ea5e9;
  border-radius: 999px;
  background: #0e7490;
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
  overflow: hidden;
}

.auth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.auth-identity small,
.auth-identity strong,
.auth-role-badge {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-identity small {
  color: var(--muted);
  font-size: 11px;
}

.auth-identity strong {
  color: var(--text);
  font-size: 14px;
}

.auth-role-badge {
  max-width: 134px;
  border: 1px solid #10b981;
  border-radius: 5px;
  background: #047857;
  color: #d1fae5;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1;
}

.topbar-tools {
  position: relative;
  flex: 0 0 auto;
}

.brand.auth-brand .topbar-tools,
.topbar-tools.topbar-tools-integrated {
  justify-self: end;
  align-self: center;
}

.topbar-tools-integrated .topbar-menu-button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
}

.topbar-menu-button[aria-expanded="true"] {
  border-color: #38bdf8;
  background: #082f49;
}

.topbar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 292px;
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #31506f;
  border-radius: 8px;
  background: #07111d;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .48);
}

body[data-map-mode="control"] .topbar-menu {
  left: 0;
  right: auto;
}

.topbar-tools-integrated .topbar-menu {
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  left: 0;
  right: auto;
}

.topbar-notification-button {
  justify-self: start;
}

.topbar-menu[hidden] {
  display: none;
}

.topbar-menu-title {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  gap: 2px;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--line);
}

.topbar-menu-title::before {
  content: "";
  width: 32px;
  height: 32px;
  grid-row: span 2;
  border: 1px solid rgba(14, 165, 233, .85);
  border-radius: 8px;
  background: #092438 url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%237dd3fc'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%2015.5a3.5%203.5%200%201%200%200-7%203.5%203.5%200%200%200%200%207Z'/%3E%3Cpath%20d='M19.4%2015a1.7%201.7%200%200%200%20.3%201.9l.1.1a2%202%200%201%201-2.8%202.8l-.1-.1a1.7%201.7%200%200%200-1.9-.3%201.7%201.7%200%200%200-1%201.5V21a2%202%200%201%201-4%200v-.1a1.7%201.7%200%200%200-1-1.5%201.7%201.7%200%200%200-1.9.3l-.1.1A2%202%200%201%201%204.2%2017l.1-.1a1.7%201.7%200%200%200%20.3-1.9%201.7%201.7%200%200%200-1.5-1H3a2%202%200%201%201%200-4h.1a1.7%201.7%200%200%200%201.5-1%201.7%201.7%200%200%200-.3-1.9l-.1-.1A2%202%200%201%201%207%204.2l.1.1a1.7%201.7%200%200%200%201.9.3h.1A1.7%201.7%200%200%200%2010%203.1V3a2%202%200%201%201%204%200v.1a1.7%201.7%200%200%200%201%201.5%201.7%201.7%200%200%200%201.9-.3l.1-.1A2%202%200%201%201%2019.8%207l-.1.1a1.7%201.7%200%200%200-.3%201.9v.1a1.7%201.7%200%200%200%201.5%201H21a2%202%200%201%201%200%204h-.1a1.7%201.7%200%200%200-1.5%201Z'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
}

.topbar-menu-title strong {
  color: var(--text);
}

.topbar-menu-title small {
  color: var(--muted);
  font-size: 11px;
}

.topbar-menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
}

.topbar-menu-item:hover,
.topbar-menu-item:focus-visible,
.topbar-menu-item.active {
  outline: none;
  background: #0a2940;
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .65);
}

.topbar-menu-icon {
  --topbar-menu-icon-color: #7dd3fc;
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border: 1px solid rgba(14, 165, 233, .8);
  border-radius: 9px;
  background: #092438;
  color: transparent;
  font-size: 0 !important;
  font-weight: 900;
  line-height: 0;
  text-indent: -999px;
}

.topbar-menu-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  margin: auto;
  background-color: var(--topbar-menu-icon-color);
  -webkit-mask: var(--menu-icon) center / contain no-repeat;
  mask: var(--menu-icon) center / contain no-repeat;
}

.topbar-menu-item[href="/settings"] {
  order: 1;
}

.topbar-menu-item#layoutSettingsButton {
  order: 2;
}

.topbar-menu-item[href="/settings#users"] {
  order: 3;
}

.topbar-menu-item[href="/admin-console"] {
  order: 4;
}

.topbar-menu-item[href="/logs"] {
  order: 5;
}

.topbar-menu-item#aboutButton {
  order: 6;
}

.topbar-menu-item[data-auth-logout] {
  order: 9;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  padding-top: 11px;
}

.topbar-menu-item[data-auth-logout] .topbar-menu-icon {
  border-color: rgba(248, 113, 113, .85);
  background: rgba(127, 29, 29, .42);
  --topbar-menu-icon-color: #fb923c;
}

.topbar-menu-item[href="/settings"] .topbar-menu-icon {
  --menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cline%20x1='4'%20x2='20'%20y1='6'%20y2='6'/%3E%3Cline%20x1='4'%20x2='20'%20y1='12'%20y2='12'/%3E%3Cline%20x1='4'%20x2='20'%20y1='18'%20y2='18'/%3E%3Ccircle%20cx='9'%20cy='6'%20r='2'/%3E%3Ccircle%20cx='15'%20cy='12'%20r='2'/%3E%3Ccircle%20cx='11'%20cy='18'%20r='2'/%3E%3C/svg%3E");
}

.topbar-menu-item#layoutSettingsButton .topbar-menu-icon {
  --menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='4'%20width='18'%20height='16'%20rx='2'/%3E%3Cline%20x1='9'%20x2='9'%20y1='4'%20y2='20'/%3E%3Cline%20x1='3'%20x2='21'%20y1='10'%20y2='10'/%3E%3C/svg%3E");
}

.topbar-menu-item[href="/settings#users"] .topbar-menu-icon {
  --menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M16%2021v-2a4%204%200%200%200-4-4H6a4%204%200%200%200-4%204v2'/%3E%3Ccircle%20cx='9'%20cy='7'%20r='4'/%3E%3Cpath%20d='M22%2021v-2a4%204%200%200%200-3-3.87'/%3E%3Cpath%20d='M16%203.13a4%204%200%200%201%200%207.75'/%3E%3C/svg%3E");
}

.topbar-menu-item[href="/admin-console"] .topbar-menu-icon {
  --menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='4'%20width='18'%20height='14'%20rx='2'/%3E%3Cpath%20d='M8%208l3%203-3%203'/%3E%3Cpath%20d='M13%2014h3'/%3E%3Cpath%20d='M8%2020h8'/%3E%3Cpath%20d='M12%2018v2'/%3E%3C/svg%3E");
}

.topbar-menu-item[href="/logs"] .topbar-menu-icon {
  --menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M14%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V8z'/%3E%3Cpath%20d='M14%202v6h6'/%3E%3Cpath%20d='M8%2013h8'/%3E%3Cpath%20d='M8%2017h8'/%3E%3C/svg%3E");
}

.topbar-menu-item#aboutButton .topbar-menu-icon {
  --menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='10'/%3E%3Cpath%20d='M12%2016v-4'/%3E%3Cpath%20d='M12%208h.01'/%3E%3C/svg%3E");
}

.topbar-menu-item[data-auth-logout] .topbar-menu-icon {
  --menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M9%2021H5a2%202%200%200%201-2-2V5a2%202%200%200%201%202-2h4'/%3E%3Cpath%20d='M16%2017l5-5-5-5'/%3E%3Cpath%20d='M21%2012H9'/%3E%3C/svg%3E");
}

.topbar-menu-item[href="/timing/pilot"] .topbar-menu-icon {
  --menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%202a4%204%200%200%201%204%204c0%202.5-4%206-4%206S8%208.5%208%206a4%204%200%200%201%204-4Z'/%3E%3Cpath%20d='M10%2014l-2%207'/%3E%3Cpath%20d='M14%2014l2%207'/%3E%3Cpath%20d='M6%2021h12'/%3E%3C/svg%3E");
}

.topbar-menu-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.topbar-menu-label strong,
.topbar-menu-label small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-menu-label small {
  color: var(--muted);
  font-size: 11px;
}

.organizer-chip:hover {
  border-color: var(--accent);
  background: #082f49;
}

.organizer-chip small,
.organizer-choice small {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organizer-chip strong,
.organizer-choice strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organizer-mini-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #0ea5e9;
  display: grid;
  place-items: center;
  color: #7dd3fc;
  background: #020617;
  font-weight: 900;
  overflow: hidden;
}

.organizer-mini-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 14px;
}

.status-pill.active {
  color: #bbf7d0;
  border-color: #15803d;
  background: #052e16;
}

.status-pill.expired {
  color: #f8fafc;
  border-color: #facc15;
  background: #991b1b;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, .35), 0 0 22px rgba(239, 68, 68, .45);
  animation: chronoExpiredPulse 900ms infinite;
}

.session-main.session-countdown,
.session-main.session-starting {
  color: #020617;
  border-color: #facc15;
  background: #facc15;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, .4), 0 0 24px rgba(250, 204, 21, .48);
  animation: sessionStartPulse 900ms infinite;
}

.session-main.session-countdown:disabled,
.session-main.session-starting:disabled {
  opacity: 1;
  cursor: wait;
}

.app-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(320px, 1fr) minmax(230px, 280px);
  gap: 14px;
  padding: 14px;
  height: calc(100vh - var(--topbar-height) - var(--sectorbar-height));
  min-height: 0;
  overflow: hidden;
}

.app-shell > aside.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-shell > aside.panel .log-list,
.app-shell > aside.panel .palette {
  flex: 1 1 auto;
}

body.hide-bottom .app-shell {
  height: calc(100vh - var(--topbar-height));
}

body.data-alert-visible .app-shell {
  height: calc(100vh - var(--topbar-height) - var(--sectorbar-height) - 74px);
}

body.data-alert-visible.hide-bottom .app-shell {
  height: calc(100vh - var(--topbar-height) - 74px);
}

body[data-logbook-size="compact"] .app-shell {
  grid-template-columns: 230px minmax(320px, 1fr) minmax(230px, 280px);
}

body[data-logbook-size="large"] .app-shell {
  grid-template-columns: 380px minmax(320px, 1fr) minmax(230px, 280px);
}

body.hide-logbook .app-shell {
  grid-template-columns: minmax(320px, 1fr) minmax(230px, 280px);
}

body.hide-palette .app-shell {
  grid-template-columns: minmax(240px, 300px) minmax(320px, 1fr);
}

body[data-module-flags="off"] .app-shell {
  grid-template-columns: minmax(240px, 300px) minmax(320px, 1fr);
}

body.hide-logbook.hide-palette .app-shell {
  grid-template-columns: 1fr;
}

body.hide-logbook[data-module-flags="off"] .app-shell {
  grid-template-columns: 1fr;
}

body.hide-logbook .app-shell > aside:first-child,
body.hide-palette .app-shell > aside:last-child,
body.hide-bottom .bottom-tabs {
  display: none;
}

body[data-module-flags="off"] .app-shell > aside:last-child,
[data-module][hidden] {
  display: none !important;
}

.page {
  padding: 18px;
  max-width: 1280px;
  margin: 0 auto;
}

.global-data-alert {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid rgba(239, 68, 68, .45);
  border-bottom: 1px solid rgba(239, 68, 68, .55);
  background: #2a0710;
  color: #fecaca;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .22);
}

.global-data-alert[hidden] {
  display: none !important;
}

.global-data-alert strong {
  color: #fee2e2;
}

.global-data-alert span,
.global-data-alert small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.global-data-alert small {
  color: #fde68a;
}

.logs-page-content {
  position: relative;
  isolation: isolate;
  height: calc(100vh - var(--topbar-height));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.logs-page-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/static/assets/logos/software/rtm_race_track_manager_transparent.png") center / min(86%, 1080px) auto no-repeat;
  opacity: .05;
  filter: saturate(.86) contrast(1.08);
  pointer-events: none;
  z-index: 3;
}

body.data-alert-visible .logs-page-content {
  height: calc(100vh - var(--topbar-height) - 74px);
}

.logs-panel {
  min-height: 0;
  overflow: hidden;
}

.logs-panel .log-list {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.system-log-page {
  max-width: 1500px;
}

.system-log-filters,
.system-log-panel {
  min-width: 0;
}

.system-log-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) minmax(90px, auto);
  gap: 10px;
  align-items: end;
  padding: 12px;
}

.system-log-list {
  height: 100%;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
}

.system-log-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid #38bdf8;
  border-radius: 8px;
  background: #0b1220;
  padding: 10px;
  min-width: 0;
}

.system-log-row.warning {
  border-left-color: #f59e0b;
}

.system-log-row.error,
.system-log-row.critical {
  border-left-color: #ef4444;
}

.system-log-time,
.system-log-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.system-log-time span,
.system-log-line,
.system-log-main p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.system-log-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.system-log-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #075985;
  border-radius: 999px;
  color: #bae6fd;
  background: #082f49;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.system-log-badge.warning {
  color: #fde68a;
  border-color: #92400e;
  background: #451a03;
}

.system-log-badge.error,
.system-log-badge.critical {
  color: #fecaca;
  border-color: #991b1b;
  background: #450a0a;
}

.system-log-main p {
  margin: 0;
  color: var(--text);
}

.system-log-main details {
  color: var(--muted);
}

.system-log-main pre {
  max-height: 220px;
  overflow: auto;
  margin: 6px 0 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #08111f;
  padding: 8px;
  color: #cbd5e1;
}

.sessions-page-content {
  position: relative;
  isolation: isolate;
  max-width: none;
  height: calc(100vh - var(--topbar-height) - 36px);
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.sessions-page-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/static/assets/logos/software/rtm_flags_transparent.png") center / min(88%, 1080px) auto no-repeat;
  opacity: .055;
  filter: saturate(.88) contrast(1.08);
  pointer-events: none;
  z-index: 3;
}

.sessions-list-panel,
.session-detail-panel {
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sessions-table,
.session-log-list {
  min-height: 0;
  overflow: auto;
}

.sessions-table {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 6px;
  padding: 12px;
  flex: 1 1 0;
  height: 100%;
  max-height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #64748b #0b1220;
}

.sessions-table::-webkit-scrollbar {
  width: 12px;
}

.sessions-table::-webkit-scrollbar-track {
  background: #0b1220;
  border-left: 1px solid var(--line);
}

.sessions-table::-webkit-scrollbar-thumb {
  background: #64748b;
  border: 3px solid #0b1220;
  border-radius: 999px;
}

.sessions-table::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.session-filter-bar {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.session-filter-bar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.session-filter-bar input {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1220;
  color: var(--text);
  padding: 8px 10px;
}

.session-archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  color: var(--text);
  padding: 0;
  text-align: left;
  overflow: hidden;
}

.session-archive-row:hover,
.session-archive-row.selected {
  border-color: var(--accent);
  background: #082f49;
}

.session-archive-main {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 7px 10px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}

.session-archive-title {
  min-width: 68px;
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-archive-period {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-archive-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px 8px;
  border-left: 1px solid var(--line);
  flex-wrap: nowrap;
  white-space: nowrap;
}

.session-row-status {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.session-row-status.online {
  color: #bbf7d0;
  border-color: #166534;
  background: #052e16;
}

.session-row-status.offline {
  color: #fecaca;
  border-color: #991b1b;
  background: #450a0a;
}

.session-row-download {
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.session-pdf-pending {
  font-size: 12px;
  white-space: nowrap;
}

.session-detail-help {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.log-lock {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  min-height: 0;
}

.panel h2,
.panel h3,
.page h2 {
  margin: 0;
}

.panel-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: none;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  min-width: 0;
  align-content: flex-start;
}

.log-item {
  border-left: 3px solid var(--accent);
  background: #0b1220;
  padding: 9px;
  border-radius: 6px;
  font-size: 13px;
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 0 0 auto;
  overflow: hidden;
  line-height: 1.25;
}

.log-item.error {
  border-left-color: var(--error);
}

.log-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.log-item-head > div,
.log-item .muted {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.log-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.log-main-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.log-signal {
  color: #d9f99d;
  font-weight: 800;
}

.log-detail {
  display: block;
}

.track-wrap {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.track-status-strip {
  position: absolute;
  z-index: 6;
  top: 14px;
  bottom: 14px;
  left: 14px;
  display: grid;
  align-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.track-status-kpis {
  display: grid;
  grid-template-columns: minmax(176px, 214px);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(2, 6, 23, .66), rgba(2, 6, 23, .28));
  box-shadow: 0 18px 44px rgba(2, 6, 23, .28);
  backdrop-filter: blur(6px);
}

.track-status-strip.track-status-freeform {
  inset: 0;
  align-content: initial;
  pointer-events: none;
}

.track-status-strip.track-status-freeform .track-status-kpis {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
}

.track-status-strip.track-status-freeform .track-status-metric {
  position: absolute;
  left: var(--bubble-x, 14px);
  top: var(--bubble-y, 14px);
  width: min(214px, calc(100% - 20px));
}

.track-status-strip.track-status-freeform .track-status-weather {
  position: absolute;
  left: var(--bubble-x, 14px);
  top: var(--bubble-y, 14px);
  width: min(126px, calc(100% - 20px));
}

.track-status-strip.track-status-editing {
  z-index: 14;
  pointer-events: auto;
}

.track-status-strip.track-status-editing .track-status-kpis,
.track-status-strip.track-status-editing .track-status-metric,
.track-status-strip.track-status-editing .track-status-weather {
  pointer-events: auto;
}

.track-status-strip.track-status-editing .track-status-metric,
.track-status-strip.track-status-editing .track-status-weather {
  cursor: grab;
  outline: 2px dashed rgba(125, 211, 252, .82);
  outline-offset: 3px;
}

.track-status-strip.track-status-editing .track-status-metric.dragging,
.track-status-strip.track-status-editing .track-status-weather.dragging {
  cursor: grabbing;
  outline-color: #facc15;
  z-index: 2;
}

.track-status-metric {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 52px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 6px;
  background: rgba(15, 23, 42, .44);
  padding: 8px 10px 8px 8px;
  color: #f8fafc;
  text-shadow: 0 2px 8px rgba(2, 6, 23, .72);
}

.track-status-metric.alert {
  border-color: rgba(248, 113, 113, .46);
  background: rgba(69, 10, 10, .46);
}

.track-status-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid rgba(125, 211, 252, .26);
  background: rgba(8, 47, 73, .58);
}

.track-status-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #bae6fd;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track-status-metric.alert .track-status-icon {
  border-color: rgba(252, 165, 165, .4);
  background: rgba(127, 29, 29, .58);
}

.track-status-metric.alert .track-status-icon svg {
  stroke: #fecaca;
}

.track-status-copy {
  min-width: 0;
}

.track-status-kpis strong {
  display: block;
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-status-kpis small {
  display: block;
  color: #e2e8f0;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.2;
}

.track-status-move-toolbar {
  position: fixed;
  z-index: 130;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(125, 211, 252, .42);
  border-radius: 8px;
  background: #020617;
  color: var(--text);
  box-shadow: 0 18px 44px rgba(2, 6, 23, .42);
  padding: 10px 12px;
}

.track-status-move-toolbar[hidden] {
  display: none;
}

.track-status-move-toolbar strong {
  font-size: 13px;
  white-space: nowrap;
}

.track-map {
  position: relative;
  min-height: 0;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 30%, rgba(56, 189, 248, 0.12), transparent 20%),
    radial-gradient(circle at 80% 70%, rgba(34, 197, 94, 0.12), transparent 25%),
    #07111d;
}

.track-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.track-line {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 16;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}

.track-inner {
  fill: none;
  stroke: #0f172a;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 118px;
  min-height: 66px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #101827;
  padding: 8px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.panel-marker .lamp {
  width: 100%;
  height: 22px;
  border-radius: 5px;
  background: #334155;
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 6px;
}

.panel-marker strong {
  display: block;
  font-size: 12px;
}

.panel-marker small {
  color: var(--muted);
}

.panel-marker.offline {
  border-color: #475569;
  opacity: 0.72;
}

.panel-marker.online {
  border-color: var(--ok);
}

.panel-marker.command_sent {
  border-color: var(--accent);
}

.panel-marker.error {
  border-color: var(--error);
}

.panel-marker.active {
  border-color: var(--warn);
}

.blink {
  animation: blink 900ms infinite;
}

@keyframes blink {
  50% { opacity: 0.35; }
}

@keyframes sessionStartPulse {
  0%, 100% {
    background: #facc15;
    border-color: #fde047;
    color: #020617;
  }
  50% {
    background: #16a34a;
    border-color: #86efac;
    color: #f8fafc;
  }
}

@keyframes chronoExpiredPulse {
  0%, 100% {
    background: #991b1b;
    border-color: #facc15;
    color: #f8fafc;
  }
  50% {
    background: #facc15;
    border-color: #ef4444;
    color: #111827;
  }
}

.palette {
  padding: 12px;
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.flag-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #0b1220;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}

.flag-card.selected {
  border-color: var(--accent);
  background: #082f49;
}

.flag-card.editing {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

.flag-preview {
  width: 42px;
  height: 30px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  color: #111827;
  font-weight: 800;
}

.flag-config-preview {
  height: 100%;
  min-height: 154px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07111d;
  padding: 12px;
  color: var(--muted);
}

.flag-config-preview > span {
  color: var(--text);
  font-weight: 700;
}

.flag-config-visual {
  width: 132px;
  height: 88px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  color: #111827;
  font-size: 28px;
  font-weight: 900;
  overflow: hidden;
}

.flag-config-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.checkered {
  background:
    linear-gradient(45deg, #111 25%, transparent 25%),
    linear-gradient(-45deg, #111 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #111 75%),
    linear-gradient(-45deg, transparent 75%, #111 75%),
    #fff;
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.bottom-tabs {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 0;
  z-index: 12;
  height: var(--sectorbar-height);
  display: flex;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(11, 17, 27, 0.97);
  box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.4);
}

.mini-group {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.sector-command-btn {
  flex: 0 0 180px;
  display: grid;
  gap: 2px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
}

.sector-command-btn small {
  color: var(--muted);
}

.sector-command-btn:hover,
body.flag-edit-mode .sector-command-btn {
  border-color: var(--accent);
  background: #082f49;
}

.sector-command-btn.all-track {
  flex-basis: 210px;
  background: #0e7490;
  border-color: #0891b2;
}

.edit-mode-hint {
  flex: 1 1 280px;
  min-width: 240px;
  color: #bae6fd;
  border: 1px dashed #0ea5e9;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(8, 47, 73, 0.65);
}

.data-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.data-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.data-row.sector {
  grid-template-columns: 1fr 2fr auto;
}

.data-row.flag {
  grid-template-columns: 48px minmax(180px, .9fr) minmax(260px, 1fr) minmax(220px, .8fr) minmax(180px, 240px);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 18px;
  margin-top: 18px;
}

.config-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  height: calc(100vh - var(--topbar-height));
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

body.data-alert-visible .config-shell {
  height: calc(100vh - var(--topbar-height) - 74px);
}

.config-nav {
  align-self: stretch;
  padding: 10px;
  display: grid !important;
  align-content: start;
  gap: 8px;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - var(--topbar-height) - 36px);
  overflow: auto;
}

.config-tab {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1220;
  color: var(--text);
  text-align: left;
  padding: 12px;
  cursor: pointer;
}

.config-tab.active {
  background: #0e7490;
  border-color: #0891b2;
}

.config-content {
  --config-watermark-logo: url("/static/assets/logos/software/rtm_race_track_manager_transparent.png");
  position: relative;
  isolation: isolate;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.config-content[data-config-logo="flags"] {
  --config-watermark-logo: url("/static/assets/logos/software/rtm_flags_transparent.png");
}

.config-content[data-config-logo="timing"] {
  --config-watermark-logo: url("/static/assets/logos/software/rtm_timing_transparent.png");
}

.config-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--config-watermark-logo) center / min(92%, 1180px) auto no-repeat;
  opacity: .06;
  filter: saturate(.86) contrast(1.08);
  pointer-events: none;
  z-index: 3;
}

.config-section {
  display: none;
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.config-section.active {
  display: block;
}

.config-section[hidden] {
  display: none !important;
}

.config-help {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.config-help[hidden] {
  display: none !important;
}

.config-panel-head {
  min-height: 58px;
}

.config-title-actions {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: nowrap;
  column-gap: 10px;
  row-gap: 4px;
  align-items: center;
  min-width: 0;
}

.config-title-actions h2 {
  order: 1;
  flex: 0 0 auto;
  white-space: nowrap;
}

.config-head-summary {
  order: 3;
  flex: 1 1 auto;
  min-width: 140px;
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-action-menu {
  order: 2;
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.config-action-menu-toggle {
  width: 42px;
  height: 42px;
  min-height: 42px;
  font-size: 20px;
}

.config-action-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  display: none;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .42);
}

.config-action-menu.open .config-action-menu-list {
  display: grid;
}

.config-action-menu-item {
  display: block;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.config-action-menu-item:hover,
.config-action-menu-item:focus-visible {
  background: #111a28;
  outline: none;
}

.config-head-help-button {
  flex: 0 0 34px;
}

.help-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0b1220;
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.help-button:hover,
.help-button:focus-visible {
  border-color: var(--accent);
  background: #082f49;
  outline: none;
}

.config-section > .data-grid,
.config-section > .discovery-panel + .data-grid,
.config-section > .field {
  padding: 14px;
  margin-top: 0;
  overflow: visible;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 14px;
}

.config-row {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  align-items: start;
  gap: 14px;
}

.data-row.flag.config-row {
  grid-template-columns: 48px minmax(180px, .9fr) minmax(260px, 1fr) minmax(220px, .8fr) minmax(180px, 240px);
}

.config-row > .panel-actions,
.config-row > div:last-child {
  grid-column: 1 / -1;
}

.data-row.flag.config-row > div:last-child {
  grid-column: auto;
}

.discovery-panel {
  margin-top: 16px;
}

.discovery-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px;
}

.panel-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.panel-actions-split {
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.panel-actions-left,
.panel-actions-right {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.panel-actions-right {
  margin-left: auto;
}

.compact-actions {
  flex: 0 0 auto;
  margin-top: 0;
  justify-content: flex-end;
}

.action-status {
  min-width: min(360px, 100%);
}

.action-status:empty {
  display: none;
}

.panel-config {
  display: grid;
  gap: 8px;
}

.panel-config select,
.panel-config input,
.discovery-controls input {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 32px;
  padding: 6px 8px;
  background: #0b1220;
  color: var(--text);
}

.field.compact {
  margin-bottom: 6px;
  font-size: 12px;
}

.map-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
  padding: 14px;
  box-sizing: border-box;
  height: calc(100vh - var(--topbar-height));
  height: calc(100dvh - var(--topbar-height));
  min-height: 0;
  overflow: hidden;
}

.map-sidebar {
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.map-editor-mode-tabs,
.map-editor-tool-group {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.map-editor-mode-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.map-editor-tool-group {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.map-editor-mode-tabs .btn,
.map-editor-tool-group .btn {
  min-width: 0;
  padding-inline: 8px;
  white-space: nowrap;
}

.map-editor-mode-tabs .btn.active,
.map-editor-tool-group .btn.active {
  border-color: rgba(56, 189, 248, .82);
  background: rgba(14, 116, 144, .52);
  color: #f8fafc;
}

.map-editor-section[hidden] {
  display: none;
}

.map-editor-summary {
  display: grid;
  gap: 8px;
  padding: 0 14px 12px;
}

.map-editor-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 14px 14px;
  border-bottom: 1px solid var(--line);
}

.map-editor-quick-actions .btn {
  min-width: 0;
  padding-inline: 8px;
  white-space: normal;
}

.map-editor-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
}

.map-editor-summary-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-editor-summary-row span,
.map-diagnostic-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.map-editor-summary-row .ok,
.map-diagnostic-header.ok strong,
.map-diagnostic-row.ok strong {
  color: var(--ok);
}

.map-editor-summary-row .error,
.map-diagnostic-header.error strong,
.map-diagnostic-row.error strong {
  color: var(--error);
}

.map-editor-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.map-editor-summary-grid span {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 8px;
  background: rgba(2, 6, 23, .34);
  color: var(--muted);
  font-size: 12px;
}

.map-panel {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.map-editor-toolbar {
  position: absolute;
  z-index: 6;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.map-editor-toolbar .map-editor-tool-group {
  width: min(520px, calc(100% - 90px));
  padding: 0;
  pointer-events: auto;
}

.map-editor-toolbar #mapEditorModeHint {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  background: rgba(2, 6, 23, .72);
  color: var(--text);
  font-weight: 800;
  pointer-events: none;
}

.map-loader {
  pointer-events: none;
  position: absolute;
  z-index: 5;
  inset: 58px auto auto 16px;
  width: min(360px, calc(100% - 32px));
}

.home-map-panel {
  min-height: 0;
}

.rtm-map-svg {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  touch-action: none;
  cursor: grab;
}

.rtm-map-svg:active {
  cursor: grabbing;
}

.map-panel-marker {
  cursor: default;
}

.map-panel-marker text {
  fill: #e5edf6;
  stroke: #07111d;
  stroke-width: 3;
  paint-order: stroke;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}

.map-panel-marker .map-panel-halo {
  fill: #0b1220;
  stroke: var(--line);
  stroke-width: 2;
  opacity: .92;
}

.map-panel-marker.online .map-panel-halo {
  stroke: var(--ok);
}

.map-panel-marker.active .map-panel-halo {
  stroke: var(--warn);
}

.map-panel-marker.error .map-panel-halo {
  stroke: var(--error);
}

.map-panel-marker.selected .map-panel-halo {
  stroke: var(--accent);
  stroke-width: 4;
}

.map-track-line {
  cursor: pointer;
}

.map-track-line-stroke {
  stroke: #38bdf8;
  stroke-width: 7;
  stroke-linecap: round;
  opacity: .96;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .55));
}

.map-track-line.sector .map-track-line-stroke {
  stroke: #f59e0b;
  stroke-dasharray: 14 8;
}

.map-track-line.selected .map-track-line-stroke {
  stroke-width: 10;
}

.map-track-line text {
  fill: #f8fafc;
  stroke: #07111d;
  stroke-width: 3;
  paint-order: stroke;
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
}

.map-start-finish-marker {
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .55));
}

.map-start-finish-marker .checker-light {
  fill: #f8fafc;
}

.map-start-finish-marker .checker-dark {
  fill: #020617;
}

.map-start-finish-marker .checker-outline {
  fill: none;
  stroke: #f8fafc;
  stroke-width: 1.4;
}

.map-sector-flag-overlay text {
  fill: #f8fafc;
  stroke: #07111d;
  stroke-width: 3;
  paint-order: stroke;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.map-line-handle {
  fill: #07111d;
  stroke: #f8fafc;
  stroke-width: 3;
  cursor: grab;
}

.map-line-handle:active {
  cursor: grabbing;
}

.map-track-line-draft {
  stroke: #22c55e;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 10 8;
  opacity: .95;
}

.map-profile-object {
  cursor: pointer;
}

.map-profile-object-line {
  fill: none;
  stroke: #a7f3d0;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .82;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .5));
}

.map-profile-object.track .map-profile-object-line {
  stroke: #f8fafc;
  stroke-width: 8;
}

.map-profile-object.pitlane .map-profile-object-line {
  stroke: #38bdf8;
  stroke-width: 5;
}

.map-profile-object.sector_line .map-profile-object-line,
.map-profile-object.start_finish .map-profile-object-line {
  stroke: #f59e0b;
  stroke-dasharray: 12 8;
}

.map-profile-object.gravel_trap .map-profile-object-line {
  fill: rgba(214, 179, 90, .35);
  stroke: #facc15;
  stroke-width: 2.4;
}

.map-profile-object.runoff_area .map-profile-object-line {
  fill: rgba(148, 163, 184, .22);
  stroke: #94a3b8;
  stroke-width: 2.4;
  stroke-dasharray: 8 5;
}

.map-profile-object-point {
  fill: #0f172a;
  stroke: #a7f3d0;
  stroke-width: 3;
}

.map-profile-object.sector .map-profile-object-point {
  fill: #f59e0b;
}

.map-profile-object.light .map-profile-object-point {
  fill: #ef4444;
}

.map-profile-object.selected .map-profile-object-line,
.map-profile-object.selected .map-profile-object-point {
  stroke: #22c55e;
  stroke-width: 4;
}

.map-profile-object text {
  fill: #f8fafc;
  stroke: #07111d;
  stroke-width: 3;
  paint-order: stroke;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.map-profile-object-handle {
  fill: #07111d;
  stroke: #22c55e;
  stroke-width: 3;
  cursor: grab;
}

.map-profile-object-handle:active {
  cursor: grabbing;
}

.map-profile-object-draft polyline,
.map-profile-object-draft polygon {
  fill: none;
  stroke: #22c55e;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 9 7;
}

.map-profile-object-draft polygon {
  fill: rgba(34, 197, 94, .18);
  stroke-width: 3;
}

.map-profile-object-draft circle {
  fill: #22c55e;
  stroke: white;
  stroke-width: 2;
}

body[data-map-mode="configure"] .map-panel-marker {
  cursor: move;
}

.map-layer-list,
.map-note,
.map-gps-test {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.map-diagnostics {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.map-diagnostic-header,
.map-diagnostic-row {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(15, 23, 42, .68);
}

.map-diagnostic-row.warning strong {
  color: var(--warn);
}

.map-diagnostic-row span {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.map-diagnostic-row .btn {
  justify-self: start;
  margin-top: 2px;
  padding: 7px 10px;
}

.track-line-editor {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.track-map-profile-editor,
.track-map-object-editor {
  border-bottom: 1px solid var(--line);
}

.map-profile-list {
  display: grid;
  gap: 8px;
}

.map-profile-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .72);
}

.map-profile-card.active {
  border-color: rgba(34, 197, 94, .72);
  background: rgba(5, 46, 22, .36);
}

.map-profile-card strong,
.map-profile-card small {
  display: block;
}

.map-profile-card small {
  color: var(--muted);
  margin-top: 3px;
}

.map-profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.map-line-type-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
}

.map-editor-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.map-layer-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

@media (max-width: 980px) {
  .map-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(240px, 42vh) minmax(420px, 1fr);
    height: auto;
    min-height: calc(100dvh - var(--topbar-height));
    overflow: visible;
  }

  .map-sidebar {
    max-height: 42vh;
  }

  .map-panel {
    min-height: 420px;
  }

  .map-editor-toolbar {
    align-items: flex-start;
  }

  .map-editor-toolbar .map-editor-tool-group {
    width: min(420px, calc(100% - 88px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.map-gps-test input {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #0b1220;
  color: var(--text);
}

.field {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  min-height: 36px;
  padding: 7px 10px;
  background:
    linear-gradient(180deg, rgba(13, 25, 42, .98), rgba(7, 14, 25, .98)),
    var(--field-bg);
  color: #f8fbff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .035),
    inset 0 8px 18px rgba(0, 0, 0, .16);
}

.log-add {
  flex: 0 0 auto;
  min-width: 72px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #082f49;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

body.flag-edit-mode,
body.flag-edit-mode button,
body.flag-edit-mode .rtm-map-svg,
body.flag-edit-mode .map-panel-marker {
  cursor: inherit !important;
}

body.flag-edit-mode .map-panel-marker .map-panel-halo {
  stroke: var(--accent);
  stroke-width: 4;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(620px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #020617;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 0;
}

.modal.timing-assistant-modal {
  width: min(1360px, calc(100vw - 36px));
  background: #08111d;
  color: var(--text);
}

.modal .field input {
  background: white;
  color: #020617;
  border-color: #cbd5e1;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #cbd5e1;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  border: 0;
  background: transparent;
  font-size: 28px;
  cursor: pointer;
  color: #020617;
}

.modal .field {
  padding: 18px 22px 0;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 18px 22px 20px;
}

#layoutModal .modal-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

#moveTrackStatusBubbles {
  margin-right: auto;
}

.about-modal {
  width: min(900px, 100%);
}

.about-body {
  display: grid;
  gap: 16px;
  padding: 18px 22px 0;
}

.about-product-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
}

.about-product-card img {
  width: 100%;
  max-height: 86px;
  object-fit: contain;
}

.about-product-card strong {
  display: block;
  color: #0f172a;
  font-size: 20px;
}

.about-product-card span {
  display: block;
  margin-top: 4px;
  color: #475569;
  font-size: 14px;
}

.about-body p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.about-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.about-info-card,
.about-license-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d6e0ea;
  border-radius: 7px;
  background: #ffffff;
}

.about-info-card h3,
.about-license-card h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 15px;
}

.about-field {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid #edf2f7;
}

.about-field:first-of-type {
  border-top: 0;
}

.about-field span {
  color: #64748b;
  font-size: 12px;
}

.about-field strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1e293b;
  font-size: 13px;
}

.about-license-card pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: #334155;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.about-body .about-legal {
  font-size: 13px;
  color: #475569;
}

@media (max-width: 760px) {
  .about-product-card,
  .about-info-grid {
    grid-template-columns: 1fr;
  }

  .about-field {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.weather-modal {
  width: min(1080px, 96vw);
}

.weather-modal .modal-head small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.weather-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #cbd5e1;
  background: #eef2f7;
}

.weather-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #0f172a;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}

.weather-tab-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: #e0f2fe;
  color: #075985;
  font-size: 14px;
}

.weather-tab-icon.clock,
.weather-tab-icon.calendar {
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 900;
}

.weather-visual-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 1em;
  height: 1em;
  font-size: inherit;
}

.weather-visual-icon i,
.weather-visual-icon b,
.weather-visual-icon em {
  position: absolute;
  display: block;
  content: "";
  font-style: normal;
}

.weather-visual-icon.sun i {
  width: .68em;
  height: .68em;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 0 .12em #fb923c, 0 0 .35em #f97316;
}

.weather-visual-icon.partly i,
.weather-visual-icon.cloud i,
.weather-visual-icon.rain i,
.weather-visual-icon.snow i,
.weather-visual-icon.storm i,
.weather-visual-icon.fog i {
  width: .72em;
  height: .42em;
  left: .17em;
  bottom: .18em;
  border-radius: .28em;
  background: #94a3b8;
}

.weather-visual-icon.partly i::before,
.weather-visual-icon.cloud i::before,
.weather-visual-icon.rain i::before,
.weather-visual-icon.snow i::before,
.weather-visual-icon.storm i::before,
.weather-visual-icon.fog i::before,
.weather-visual-icon.partly i::after,
.weather-visual-icon.cloud i::after,
.weather-visual-icon.rain i::after,
.weather-visual-icon.snow i::after,
.weather-visual-icon.storm i::after,
.weather-visual-icon.fog i::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  background: inherit;
}

.weather-visual-icon.partly i::before,
.weather-visual-icon.cloud i::before,
.weather-visual-icon.rain i::before,
.weather-visual-icon.snow i::before,
.weather-visual-icon.storm i::before,
.weather-visual-icon.fog i::before {
  width: .38em;
  height: .38em;
  left: .08em;
  top: -.18em;
}

.weather-visual-icon.partly i::after,
.weather-visual-icon.cloud i::after,
.weather-visual-icon.rain i::after,
.weather-visual-icon.snow i::after,
.weather-visual-icon.storm i::after,
.weather-visual-icon.fog i::after {
  width: .5em;
  height: .5em;
  right: .08em;
  top: -.25em;
}

.weather-visual-icon.partly b {
  width: .54em;
  height: .54em;
  left: .02em;
  top: .04em;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 0 .1em #fb923c;
}

.weather-visual-icon.rain i {
  background: #60a5fa;
}

.weather-visual-icon.rain b,
.weather-visual-icon.rain em {
  width: .1em;
  height: .24em;
  bottom: -.04em;
  border-radius: 999px;
  background: #0284c7;
  transform: rotate(18deg);
}

.weather-visual-icon.rain b {
  left: .34em;
}

.weather-visual-icon.rain em {
  right: .28em;
}

.weather-visual-icon.storm i {
  background: #64748b;
}

.weather-visual-icon.storm b {
  width: .22em;
  height: .42em;
  bottom: -.1em;
  background: #facc15;
  clip-path: polygon(55% 0, 100% 0, 62% 44%, 100% 44%, 35% 100%, 48% 56%, 12% 56%);
}

.weather-visual-icon.snow i {
  background: #bae6fd;
}

.weather-visual-icon.snow b {
  color: #0284c7;
  font-size: .55em;
  line-height: 1;
}

.weather-visual-icon.snow b::before {
  content: "*";
}

.weather-visual-icon.fog i {
  background: #cbd5e1;
}

.weather-visual-icon.fog b,
.weather-visual-icon.fog em {
  width: .8em;
  height: .07em;
  left: .1em;
  border-radius: 999px;
  background: #94a3b8;
}

.weather-visual-icon.fog b {
  bottom: .02em;
}

.weather-visual-icon.fog em {
  bottom: -.12em;
}

.weather-mini-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
}

.weather-mini-icon.temp {
  background: #fee2e2;
  color: #dc2626;
}

.weather-mini-icon.rain,
.weather-mini-icon.humidity {
  background: #dbeafe;
}

.weather-mini-icon.rain::before,
.weather-mini-icon.humidity::before {
  content: "";
  width: 9px;
  height: 13px;
  border-radius: 9px 9px 9px 2px;
  background: #0ea5e9;
  transform: rotate(45deg);
}

.weather-mini-icon.wind {
  background: #dcfce7;
}

.weather-mini-icon.wind::before,
.weather-mini-icon.wind::after {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: #16a34a;
  box-shadow: 4px 6px 0 #22c55e;
}

.weather-mini-icon.cloud {
  background: #e2e8f0;
}

.weather-mini-icon.cloud::before {
  content: "";
  width: 15px;
  height: 9px;
  border-radius: 999px;
  background: #64748b;
}

.weather-mini-icon.visibility,
.weather-mini-icon.info {
  background: #fef3c7;
  color: #a16207;
}

.weather-tabs button.active,
.weather-tabs button:hover {
  border-color: #0284c7;
  background: #e0f2fe;
  color: #075985;
}

.weather-modal-body {
  display: grid;
  gap: 16px;
  max-height: min(620px, 68vh);
  overflow: auto;
  padding: 16px;
}

.weather-tab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 16px;
}

.weather-tab-layout h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.weather-now-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 16px;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.weather-now-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #e0f2fe;
  color: #075985;
  font-size: 44px;
}

.weather-now-card strong {
  display: block;
  color: #0f172a;
  font-size: 20px;
}

.weather-now-card span {
  display: block;
  margin-top: 2px;
  color: #075985;
  font-size: 30px;
  font-weight: 800;
}

.weather-now-card small {
  display: block;
  margin-top: 6px;
  color: #475569;
}

.weather-security,
.weather-alert-card {
  display: grid;
  gap: 4px;
  border: 1px solid #cbd5e1;
  border-left-width: 6px;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.weather-security strong,
.weather-alert-card strong {
  font-size: 15px;
}

.weather-security small,
.weather-alert-card small,
.weather-message,
.weather-empty {
  color: #64748b;
  line-height: 1.4;
}

.weather-security.level-0,
.weather-alert-card.level-0 {
  border-color: #86efac;
  background: #f0fdf4;
}

.weather-security.level-1,
.weather-alert-card.level-1 {
  border-color: #eab308;
  background: #fef08a;
  box-shadow: inset 0 0 0 1px rgba(234, 179, 8, .18);
}

.weather-security.level-2,
.weather-alert-card.level-2 {
  border-color: #f97316;
  background: #fed7aa;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, .2);
}

.weather-security.level-3,
.weather-alert-card.level-3 {
  border-color: #fca5a5;
  background: #fef2f2;
}

.weather-security.level-1 strong,
.weather-alert-card.level-1 strong,
.weather-security.level-1 span,
.weather-alert-card.level-1 span,
.weather-security.level-1 small,
.weather-alert-card.level-1 small {
  color: #422006;
}

.weather-security.level-2 strong,
.weather-alert-card.level-2 strong,
.weather-security.level-2 span,
.weather-alert-card.level-2 span,
.weather-security.level-2 small,
.weather-alert-card.level-2 small {
  color: #431407;
}

.weather-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.weather-metric,
.weather-period {
  display: grid;
  gap: 4px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #ffffff;
  padding: 10px;
}

.weather-metric {
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
}

.weather-metric-icon {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e0f2fe;
  color: #075985;
  font-size: 18px;
}

.weather-metric-label {
  min-width: 0;
}

.weather-metric span,
.weather-period span {
  color: #64748b;
  font-size: 12px;
}

.weather-metric strong,
.weather-period strong {
  color: #0f172a;
}

.weather-metric .weather-metric-icon {
  color: #075985;
  font-size: 18px;
}

.weather-metric .weather-metric-label {
  color: #64748b;
  font-size: 12px;
}

.weather-period-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.weather-hourly-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(184px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.weather-hour-card,
.weather-day-card {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.weather-hour-card header,
.weather-day-card header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.weather-hour-card .weather-visual-icon,
.weather-day-card .weather-visual-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: #eff6ff;
  font-size: 34px;
}

.weather-hour-card header strong,
.weather-day-card header strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
}

.weather-hour-card header span,
.weather-day-card header span {
  display: block;
  color: #64748b;
  font-size: 12px;
}

.weather-hour-temp {
  color: #075985;
  font-size: 28px;
  font-weight: 900;
}

.weather-hour-metrics,
.weather-day-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.weather-hour-metrics span,
.weather-day-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 6px;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
}

.weather-daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.weather-day-card.has-alert {
  border-color: #f59e0b;
  background: #fef3c7;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .16);
}

.weather-day-card.has-alert.level-2 {
  border-color: #f97316;
  background: #ffedd5;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, .2);
}

.weather-day-card.has-alert.level-3 {
  border-color: #dc2626;
  background: #fee2e2;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .22);
}

.weather-day-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.weather-day-range div {
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #f8fafc;
  padding: 8px;
}

.weather-day-range b,
.weather-day-range small {
  display: block;
}

.weather-day-range b {
  color: #0f172a;
  font-size: 20px;
}

.weather-day-range small {
  color: #64748b;
  font-size: 11px;
}

.weather-day-alert,
.weather-day-ok {
  border-radius: 7px;
  padding: 8px;
  font-size: 12px;
  font-weight: 800;
}

.weather-day-alert {
  border: 1px solid #d97706;
  background: #fde68a;
  color: #78350f;
}

.weather-day-alert.level-2 {
  border-color: #c2410c;
  background: #fed7aa;
  color: #431407;
}

.weather-day-alert.level-3 {
  border-color: #b91c1c;
  background: #fecaca;
  color: #450a0a;
}

.weather-day-ok {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.human-weather-period {
  gap: 10px;
}

.weather-period-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.weather-period-head span {
  display: block;
}

.weather-period-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #e0f2fe;
  color: #075985;
  font-size: 28px;
}

.human-weather-period .weather-metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.human-weather-period .weather-metric {
  padding: 7px;
}

.weather-forecast-dashboard {
  display: grid;
  gap: 14px;
}

.weather-forecast-hero {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(160px, .55fr) minmax(150px, .45fr);
  align-items: center;
  gap: 14px;
}

.weather-forecast-main {
  display: grid;
  grid-template-columns: 62px auto;
  align-items: center;
  column-gap: 12px;
}

.weather-forecast-main-icon,
.weather-forecast-day-icon {
  display: grid;
  place-items: center;
  background: #fff3bf;
  color: #d97706;
  border-radius: 999px;
}

.weather-forecast-main-icon {
  grid-row: span 2;
  width: 58px;
  height: 58px;
  font-size: 34px;
}

.weather-forecast-main strong {
  color: #111827;
  font-size: 36px;
  line-height: 1;
}

.weather-forecast-main small {
  color: #334155;
  font-size: 14px;
}

.weather-forecast-kpis {
  display: grid;
  gap: 4px;
  color: #334155;
  font-size: 13px;
}

.weather-forecast-title {
  display: grid;
  justify-items: end;
  color: #334155;
  text-align: right;
}

.weather-forecast-title strong {
  color: #0f172a;
  font-size: 22px;
}

.weather-forecast-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid #dbe3ef;
  color: #0f172a;
}

.weather-forecast-mode span {
  padding: 0 0 8px;
  border-bottom: 3px solid transparent;
}

.weather-forecast-mode .active {
  border-color: #f5b700;
}

.weather-forecast-trend {
  display: grid;
  gap: 8px;
}

.weather-forecast-chart {
  width: 100%;
  height: 132px;
  border-bottom: 1px solid #dbe3ef;
}

.weather-forecast-axis {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(72px, 1fr);
  gap: 8px;
  overflow-x: auto;
  color: #475569;
  font-size: 12px;
}

.weather-forecast-axis span,
.weather-forecast-day {
  min-width: 0;
}

.weather-forecast-axis strong,
.weather-forecast-axis small {
  display: block;
}

.weather-forecast-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(96px, 1fr);
  gap: 8px;
  overflow-x: auto;
}

.weather-forecast-day {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 7px;
  background: #f8fafc;
}

.weather-forecast-day-icon {
  width: 36px;
  height: 36px;
  font-size: 22px;
}

.weather-forecast-day strong,
.weather-forecast-day b {
  color: #0f172a;
}

.weather-forecast-day small,
.weather-forecast-day em {
  color: #475569;
  font-size: 11px;
  font-style: normal;
  text-align: center;
}

.weather-radar-frame {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
}

.weather-radar-track-frame {
  margin-top: 12px;
}

.weather-radar-summary {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 14px;
  background: #eff6ff;
}

.weather-radar-main {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.weather-radar-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #dbeafe;
  color: #075985;
  font-size: 34px;
}

.weather-radar-main strong {
  display: block;
  color: #0f172a;
  font-size: 18px;
}

.weather-radar-main small {
  display: block;
  margin-top: 4px;
  color: #475569;
}

.weather-radar-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.weather-radar-stats div {
  display: grid;
  gap: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px;
  background: white;
}

.weather-radar-stats span {
  color: #0284c7;
  font-size: 20px;
}

.weather-radar-stats strong {
  color: #0f172a;
}

.weather-radar-stats small {
  color: #64748b;
}

.weather-radar-summary.radar-fort {
  border-color: #fca5a5;
  background: #fef2f2;
}

.weather-radar-summary.radar-modere {
  border-color: #fdba74;
  background: #fff7ed;
}

.weather-radar-summary.radar-faible {
  border-color: #7dd3fc;
  background: #f0f9ff;
}

@media (max-width: 760px) {
  .weather-radar-summary {
    grid-template-columns: 1fr;
  }

  .weather-radar-stats {
    grid-template-columns: 1fr;
  }
}

.weather-radar-frame img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.help-modal {
  width: min(760px, 100%);
}

.help-modal-body {
  display: grid;
  gap: 14px;
  max-height: min(640px, 72vh);
  overflow: auto;
  padding: 18px 22px 0;
}

.help-modal-body p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.help-doc-list {
  display: grid;
  gap: 10px;
}

.help-doc-item {
  display: grid;
  grid-template-columns: minmax(140px, .6fr) minmax(220px, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: white;
}

.help-doc-item strong {
  color: #020617;
}

.help-doc-item span {
  color: #475569;
  line-height: 1.35;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 18px;
}

.file-manager-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.alert-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 78px;
  min-height: 40px;
  padding: 7px 12px;
  border-color: #166534;
  background: #14532d;
  color: white;
  font-weight: 900;
  line-height: 1;
}

.alert-btn[hidden] {
  display: none;
}

.alert-btn.unread {
  border-color: #ef4444;
  background: #991b1b;
  color: #ffffff;
  animation: trackAlertFlash 760ms steps(2, end) infinite;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, .14), 0 0 20px rgba(239, 68, 68, .48);
}

.alert-btn.track-unread {
  border-color: #ef4444;
  background: #991b1b;
  color: #ffffff;
  animation: trackAlertFlash 760ms steps(2, end) infinite;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, .14), 0 0 20px rgba(239, 68, 68, .48);
}

.alert-btn.clear {
  border-color: #166534;
  background: #14532d;
  animation: none;
}

.alert-icon {
  font-size: 18px;
  line-height: 1;
}

.alert-label {
  font-size: 13px;
}

.alert-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  background: #ef4444;
  color: white;
  border: 2px solid #0b111b;
  font-size: 11px;
}

@keyframes alertPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

@keyframes trackAlertFlash {
  0%, 49% {
    background: #991b1b;
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, .24), 0 0 22px rgba(239, 68, 68, .55);
  }
  50%, 100% {
    background: #78350f;
    border-color: #facc15;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(250, 204, 21, .26), 0 0 24px rgba(250, 204, 21, .55);
  }
}

.notification-modal {
  width: min(760px, 100%);
}

.clear-logs-modal {
  width: min(540px, 100%);
}

.clear-logs-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.clear-logs-body p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.confirm-line {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 700;
  padding: 10px 12px;
}

.confirm-line input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: #0f7ea2;
}

.notification-list {
  display: grid;
  gap: 10px;
  max-height: min(520px, 62vh);
  overflow: auto;
  padding: 18px 22px 4px;
}

.notification-item {
  display: grid;
  gap: 6px;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #ef4444;
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.notification-item.read {
  border-left-color: #94a3b8;
  opacity: 0.72;
}

.notification-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #020617;
}

.notification-title span {
  color: #64748b;
  font-size: 13px;
}

.notification-item p {
  margin: 0;
  color: #1e293b;
  overflow-wrap: anywhere;
}

.notification-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.notification-empty {
  color: #475569;
  padding: 12px;
}

.layout-options {
  display: grid;
  gap: 12px;
  padding: 18px 22px 4px;
}

.layout-options label {
  display: grid;
  gap: 6px;
}

.layout-options select {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: white;
  color: #020617;
  padding: 8px;
}

.session-choice-list {
  display: grid;
  gap: 10px;
  padding: 18px 22px 4px;
}

.session-choice-section {
  display: grid;
  gap: 10px;
}

.session-choice-section + .session-choice-section {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid #cbd5e1;
}

.session-choice-section h3 {
  margin: 0;
  color: #020617;
  font-size: 14px;
}

.session-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: #020617;
  padding: 14px;
  cursor: pointer;
}

.session-choice:hover {
  border-color: #0e7490;
  background: #ecfeff;
}

.session-choice.selected {
  border-color: #0e7490;
  background: #cffafe;
  box-shadow: inset 4px 0 0 #0e7490;
}

.organizer-modal {
  width: min(720px, 100%);
}

.file-picker-modal {
  width: min(980px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto auto auto minmax(260px, 1fr) auto;
}

.file-picker-toolbar,
.file-picker-path {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 18px 0;
}

.file-picker-path input {
  flex: 1 1 280px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: white;
  color: #020617;
  padding: 9px 10px;
}

.file-picker-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(240px, 330px);
  gap: 12px;
  min-height: 360px;
  max-height: min(560px, 58vh);
  overflow: hidden;
  padding: 14px 18px 0;
}

.file-picker-modal .file-explorer-list,
.file-picker-modal .file-explorer-details {
  background: #f8fafc;
  color: #020617;
  border-color: #cbd5e1;
}

.file-picker-modal .file-browser-item {
  background: white;
  color: #020617;
  border-color: #cbd5e1;
}

.file-picker-modal .file-browser-item.selected,
.file-picker-modal .file-browser-item:hover {
  background: #ecfeff;
  border-color: #0e7490;
}

.organizer-search {
  padding: 0 4px;
}

.organizer-choice-list {
  display: grid;
  gap: 10px;
  max-height: min(460px, 55vh);
  overflow-y: auto;
  padding: 8px 22px 4px;
}

.organizer-choice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: #020617;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.organizer-choice:hover {
  border-color: #0e7490;
  background: #ecfeff;
}

.log-description {
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
  background: #111827;
  color: #dbeafe;
}

.field textarea {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.settings-card {
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.settings-card h3 {
  margin: 0 0 12px;
}

.module-settings-card {
  background: rgba(15, 23, 42, 0.28);
}

.module-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.module-toggle-card {
  display: grid;
  grid-template-columns: auto 74px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
}

.module-toggle-card input {
  width: 18px;
  height: 18px;
}

.module-lock {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #14532d;
  color: #bbf7d0;
  font-size: 12px;
  font-weight: 800;
}

.module-toggle-card strong,
.module-toggle-card small {
  display: block;
}

.module-toggle-card small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.3;
}

.module-logo-wrap {
  display: grid;
  place-items: center;
  width: 74px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #020617;
  overflow: hidden;
}

.module-logo-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.weather-settings-stack {
  display: grid;
  gap: 0;
}

.weather-settings-layout {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  height: calc(100% - 80px);
  min-height: 520px;
  overflow: hidden;
}

body.data-alert-visible .sessions-page-content {
  height: calc(100vh - var(--topbar-height) - 110px);
}

.weather-settings-menu {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  scrollbar-gutter: stable;
}

.weather-menu-row {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  color: var(--text);
  padding: 11px;
  text-align: left;
  cursor: pointer;
}

.weather-menu-row small {
  color: var(--muted);
  line-height: 1.25;
}

.weather-menu-row:hover,
.weather-menu-row.active {
  border-color: var(--accent);
  background: #082f49;
}

.weather-settings-detail {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.weather-detail-panel {
  height: 100%;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
}

.weather-detail-panel[hidden],
.weather-menu-row[hidden] {
  display: none !important;
}

.weather-settings-card {
  border-bottom: 0;
  padding-bottom: 18px;
}

.weather-detail-panel .weather-settings-card {
  min-height: 100%;
}

.field-help,
.field-error,
.field-warning {
  font-size: 12px;
  line-height: 1.35;
}

.field-help {
  color: var(--muted);
}

.field-error {
  color: #fecaca;
}

.field-warning {
  color: #fde68a;
}

.field.is-invalid input,
.field.is-invalid select {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.secret-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.secret-input-row .btn {
  min-height: 38px;
}

.settings-card-help {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.weather-actions {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.weather-test-result {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  background: #0b1220;
}

.weather-test-result strong {
  color: var(--text);
}

.weather-test-result small {
  display: block;
  margin-top: 4px;
}

.weather-test-result.success {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(22, 101, 52, 0.18);
}

.weather-test-result.error {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(127, 29, 29, 0.22);
}

.weather-diagnostics {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.weather-diagnostics h3 {
  margin: 0;
  font-size: 14px;
}

.weather-diagnostic-row {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.55);
}

.weather-diagnostic-row strong {
  color: var(--text);
}

.weather-diagnostic-row.ok strong {
  color: #86efac;
}

.weather-diagnostic-row.vide strong,
.weather-diagnostic-row.non-implemente strong {
  color: #fde68a;
}

.weather-diagnostic-row.erreur strong {
  color: #fecaca;
}

.weather-key-status {
  display: block;
  min-height: 16px;
}

.weather-key-status.ok {
  color: #86efac;
}

.weather-key-status.error {
  color: #fecaca;
}

.weather-service-test-table {
  overflow-x: auto;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.weather-service-test-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.weather-service-test-table th,
.weather-service-test-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.weather-service-test-table th {
  color: var(--muted);
  background: rgba(15, 23, 42, 0.75);
}

.weather-service-test-table tr:last-child td {
  border-bottom: 0;
}

.weather-diagnostic-row code {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-actions.padded {
  padding: 0 14px 14px;
}

.checkbox-field {
  align-content: end;
}

.toggle-field {
  align-content: end;
}

.toggle-chip {
  position: relative;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 38px;
  cursor: pointer;
  user-select: none;
}

.toggle-field .toggle-chip {
  width: 100%;
}

.toggle-chip input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.toggle-chip-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--button-bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.toggle-chip input:focus-visible + .toggle-chip-label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggle-chip .when-on {
  display: none;
}

.toggle-chip input:checked + .toggle-chip-label .when-on {
  display: inline;
}

.toggle-chip input:checked + .toggle-chip-label .when-off {
  display: none;
}

.toggle-chip.soft .toggle-chip-label {
  color: var(--text);
  background: var(--surface);
}

.toggle-chip.soft input:checked + .toggle-chip-label {
  color: var(--accent-contrast);
  border-color: var(--accent-border);
  background: var(--accent-strong);
}

.toggle-chip.stateful input:checked + .toggle-chip-label {
  color: #dcfce7;
  border-color: #15803d;
  background: #166534;
  box-shadow: inset 0 0 0 1px rgba(187, 247, 208, .12);
}

.toggle-chip.stateful input:not(:checked) + .toggle-chip-label {
  color: #fee2e2;
  border-color: #b91c1c;
  background: #991b1b;
  box-shadow: inset 0 0 0 1px rgba(254, 202, 202, .1);
}

.asset-field {
  grid-column: span 2;
}

.asset-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.asset-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px 14px;
}

.asset-preview {
  min-width: 140px;
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #0b1220;
  overflow: hidden;
}

.asset-preview img,
.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#companyLogoPreview {
  box-sizing: border-box;
  width: 210px;
  height: 150px;
  min-width: 210px;
  min-height: 150px;
  max-width: min(100%, 260px);
  max-height: 180px;
  padding: 10px;
}

#companyLogoPreview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#companyLogoPreview.logo-preview-wide {
  width: 260px;
  height: 120px;
}

#companyLogoPreview.logo-preview-square {
  width: 154px;
  height: 154px;
  min-width: 154px;
  min-height: 154px;
}

#companyLogoPreview.logo-preview-tall {
  width: 132px;
  height: 180px;
  min-width: 132px;
  min-height: 180px;
}

#companyLogoPreview.logo-preview-empty {
  width: 160px;
  height: 72px;
  min-width: 160px;
  min-height: 72px;
}

.panel-card-grid {
  display: grid;
  gap: 10px;
  padding: 7px 8px;
}

#organizersGrid {
  height: calc(100% - 116px);
  min-height: 520px;
  overflow: hidden;
}

.panel-config-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.panel-config-header,
.panel-config-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-config-header > div {
  display: grid;
  gap: 2px;
}

.panel-config-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 10px;
}

.session-template-row {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
}

.session-template-row .panel-actions {
  justify-content: flex-start;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.organizer-preview-row {
  padding: 0;
  align-items: center;
  flex-wrap: wrap;
}

.organizer-preview-row .asset-preview {
  box-sizing: border-box;
  width: 220px;
  height: 132px;
  min-width: 220px;
  min-height: 132px;
  max-width: min(100%, 280px);
  max-height: 180px;
  padding: 10px;
}

.organizer-preview-row .asset-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.organizer-preview-row .organizer-logo-preview.logo-preview-wide {
  width: 280px;
  height: 118px;
}

.organizer-preview-row .organizer-logo-preview.logo-preview-square {
  width: 154px;
  height: 154px;
  min-width: 154px;
  min-height: 154px;
}

.organizer-preview-row .organizer-logo-preview.logo-preview-tall {
  width: 124px;
  height: 180px;
  min-width: 124px;
  min-height: 180px;
}

.organizer-preview-row .organizer-logo-preview.logo-preview-empty {
  width: 160px;
  height: 72px;
  min-width: 160px;
  min-height: 72px;
}

.organizer-config-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.organizer-list-panel,
.organizer-detail-panel {
  min-width: 0;
  min-height: 0;
}

.organizer-list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.organizer-list-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.organizer-config-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 8px;
  scrollbar-gutter: stable;
}

.organizer-list-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

.organizer-list-row:hover,
.organizer-list-row.selected {
  border-color: var(--accent);
  background: #082f49;
}

.organizer-list-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.organizer-list-main strong,
.organizer-list-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organizer-list-main small {
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #64748b;
}

.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}

.status-dot.offline {
  background: #ef4444;
}

.organizer-detail-card {
  min-height: 100%;
  align-content: start;
}

.organizer-detail-body {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.organizer-detail-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 18, 32, .9);
  overflow: hidden;
}

.organizer-detail-shell {
  display: grid;
  grid-template-columns: minmax(520px, 1.35fr) minmax(360px, .85fr);
  gap: 10px;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
}

.organizer-main-column,
.organizer-auth-panel {
  min-width: 0;
  min-height: 0;
}

.organizer-main-column {
  display: grid;
  grid-template-rows: auto auto minmax(0, auto);
  align-content: start;
  gap: 8px;
  overflow: hidden;
}

.organizer-detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(59, 76, 103, .72);
}

.organizer-detail-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.organizer-title-logo {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #061426;
  color: var(--accent);
  font-size: 17px;
  font-weight: 900;
}

.organizer-title-logo img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 5px;
  object-fit: contain;
}

.organizer-detail-title-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.organizer-detail-summary strong {
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organizer-detail-summary span:not(.status-badge):not(.status-light) {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organizer-section-card,
.organizer-side-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 17, 31, .92);
  padding: 7px 8px;
}

.organizer-section-card h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 15px;
}

.organizer-detail-panel .field {
  gap: 4px;
  margin-bottom: 0;
}

.organizer-detail-panel .field input,
.organizer-detail-panel .field select {
  min-height: 32px;
  padding: 6px 10px;
}

.organizer-main-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 6px 10px;
}

.organizer-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 6px 10px;
}

.organizer-logo-card {
  display: grid;
  gap: 6px;
}

.organizer-preview-row {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 10px;
  padding: 0;
  align-items: center;
}

.organizer-preview-row .asset-preview {
  width: 100%;
  height: 50px;
  min-width: 0;
  min-height: 50px;
  max-width: none;
  max-height: 58px;
  padding: 6px;
}

.organizer-preview-row .organizer-logo-preview.logo-preview-wide,
.organizer-preview-row .organizer-logo-preview.logo-preview-square,
.organizer-preview-row .organizer-logo-preview.logo-preview-tall,
.organizer-preview-row .organizer-logo-preview.logo-preview-empty,
.organizer-preview-row .organizer-logo-preview.logo-preview-standard {
  width: 100%;
  height: 50px;
  min-width: 0;
  min-height: 50px;
}

.organizer-logo-field {
  min-width: 0;
}

.organizer-logo-field .asset-picker {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.organizer-auth-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.organizer-auth-panel > .scoped-loader {
  align-self: start;
}

.organizer-side-card {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.organizer-side-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.organizer-side-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.organizer-side-head strong {
  color: var(--text);
}

.organizer-side-head span:not(.status-badge):not(.status-light) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.organizer-side-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 6px 10px;
}

.organizer-side-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.organizer-users-card {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.organization-user-create {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
}

.organization-user-create > .btn {
  grid-column: 1 / -1;
  min-height: 32px;
  padding-inline: 12px;
  font-size: 14px;
}

.organizer-auth-panel .organization-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.organization-user-create-drawer,
.organization-user-create-roles-drawer {
  border-top: 1px solid rgba(59, 76, 103, .55);
  padding-top: 6px;
}

.organization-user-create-drawer > summary,
.organization-user-create-roles-drawer > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.organization-user-create-drawer > summary:focus-visible,
.organization-user-create-roles-drawer > summary:focus-visible {
  border-radius: 5px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.organization-user-create-drawer[open] {
  max-height: 220px;
  overflow: auto;
}

.organization-user-create-drawer[open] .organization-user-create {
  margin-top: 7px;
}

.organizer-actions {
  align-self: start;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.organizer-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1;
}

.organization-user-list {
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 0;
  scrollbar-gutter: stable;
}

.organization-user-row {
  grid-template-columns: 1fr;
  align-items: stretch;
  cursor: default;
  padding: 7px;
}

.organization-user-row:hover {
  border-color: var(--line);
  background: #08111f;
}

.organization-user-summary {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.organization-user-summary .config-list-thumb {
  width: 28px;
  height: 28px;
}

.organization-user-summary .status-badge {
  gap: 6px;
  padding: 5px 8px;
  font-size: 13px;
}

.organization-user-summary .status-light {
  width: 9px;
  height: 9px;
}

.organization-user-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 10px;
}

.organization-user-edit-drawer {
  margin-top: 2px;
  border-top: 0;
  padding-top: 0;
}

.organization-user-edit-drawer > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin-left: 40px;
  line-height: 1.1;
}

.organization-user-edit-drawer > summary:focus-visible {
  border-radius: 5px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.organizer-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border-top: 1px solid var(--line);
  background: rgba(8, 17, 31, .96);
}

.organizer-action-bar > .muted {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.organizer-action-buttons {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.organizer-action-buttons .btn {
  min-height: 34px;
  padding: 7px 10px;
}

@media (max-width: 1500px) {
  .organizer-detail-shell {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .organizer-auth-panel {
    overflow: visible;
  }
}

.config-list-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.config-list-panel,
.config-detail-panel {
  min-width: 0;
}

.config-list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  overflow: hidden;
}

.config-list-tools {
  display: grid;
  gap: 8px;
  padding: 9px;
  border-bottom: 1px solid var(--line);
}

.config-list-tools.two-fields {
  grid-template-columns: minmax(0, 1fr) 118px;
}

.config-list {
  display: grid;
  gap: 5px;
  max-height: calc(100vh - var(--topbar-height) - 250px);
  overflow: auto;
  padding: 7px;
}

.config-list-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

.config-list-row:hover,
.config-list-row.selected {
  border-color: var(--accent);
  background: #082f49;
}

.config-list-thumb {
  width: 28px;
  height: 28px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  background: #020617;
}

.config-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.flag-list-thumb .flag-preview {
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  border-radius: 5px;
}

.config-list-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.config-list-main strong,
.config-list-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-list-main small {
  color: var(--muted);
}

.organization-user-list .organization-user-row {
  grid-template-columns: 1fr;
  padding: 7px;
}

.organization-user-list .organization-user-summary {
  grid-template-columns: 32px minmax(0, 1fr) auto;
}

.config-detail-card {
  min-height: 100%;
  align-content: start;
}

.config-detail-body {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.config-detail-actions {
  align-self: start;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.config-detail-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1;
}

.config-associated-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 7px;
}

.config-associated-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  background: #08111f;
}

.backup-settings-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  height: calc(100% - 80px);
  min-height: 520px;
  overflow: hidden;
}

[data-config-panel="backup"] .panel-head {
  align-items: center;
}

[data-config-panel="backup"] .panel-head .compact-actions {
  min-width: 0;
}

.backup-list-panel,
.backup-detail-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
}

.backup-list-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.backup-list-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  color: var(--text);
  padding: 9px;
  text-align: left;
  cursor: pointer;
}

.backup-list-panel > .backup-list-row {
  margin: 10px;
  width: calc(100% - 20px);
}

.backup-list-row:hover,
.backup-list-row.selected {
  border-color: var(--accent);
  background: #082f49;
}

.backup-list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.backup-list-title strong {
  color: var(--text);
}

.backup-list-title span {
  min-width: 32px;
  border: 1px solid #166534;
  border-radius: 999px;
  padding: 4px 8px;
  color: #bbf7d0;
  background: #052e16;
  text-align: center;
  font-weight: 800;
}

.backup-archive-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  padding: 6px;
  scrollbar-gutter: stable;
}

.backup-empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: rgba(8, 17, 31, .72);
}

.backup-detail-panel {
  overflow: auto;
}

.backup-detail-shell {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 100%;
  padding: 16px;
}

.backup-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.backup-detail-head h3,
.backup-detail-head p {
  margin: 0;
}

.backup-detail-head p {
  margin-top: 4px;
  color: var(--muted);
}

.backup-status {
  min-height: 24px;
}

.backup-form-grid,
.backup-detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.backup-toggle-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

.backup-selected-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.backup-selected-items span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  background: #08111f;
}

.backup-detail-meta > div,
.backup-restore-warning {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #08111f;
}

.backup-detail-meta span,
.backup-restore-warning span {
  color: var(--muted);
}

.backup-detail-meta strong,
.backup-detail-meta code {
  overflow-wrap: anywhere;
}

.backup-restore-warning {
  border-color: #991b1b;
  background: #450a0a;
  color: #fecaca;
}

.backup-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.map-settings-layout {
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  height: calc(100% - 80px);
  min-height: 520px;
  overflow: hidden;
}

.map-settings-menu,
.map-settings-detail {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
}

.map-settings-menu {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.map-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.map-list-head span {
  color: var(--muted);
}

.map-list-scroll {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #64748b #0b1220;
}

.map-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  color: var(--text);
  padding: 11px;
  text-align: left;
  cursor: pointer;
}

.map-list-row strong,
.map-list-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-list-row small {
  color: var(--muted);
  margin-top: 3px;
}

.map-list-row em {
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.map-list-row em.online {
  border-color: #16a34a;
  background: #052e1a;
  color: #bbf7d0;
}

.map-list-row em.offline {
  border-color: #991b1b;
  background: #450a0a;
  color: #fecaca;
}

.map-list-row:hover,
.map-list-row.active {
  border-color: var(--accent);
  background: #082f49;
}

.map-settings-detail {
  min-width: 0;
  overflow: auto;
  padding: 14px;
}

.map-detail-card {
  display: grid;
  gap: 14px;
}

.map-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.map-detail-head h3 {
  margin: 0;
}

.map-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 480px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.map-preview {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07111d;
  overflow: hidden;
}

.map-preview img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: contain;
  display: block;
}

.map-detail-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-content: start;
}

.map-detail-metrics div,
.map-layer-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  padding: 12px;
}

.map-detail-metrics strong {
  display: block;
  color: #bae6fd;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.map-detail-metrics span,
.map-layer-summary span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.osm-map-modal {
  width: min(1240px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
}

.osm-map-modal .modal-head small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.osm-map-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 12px;
  min-height: 560px;
}

.osm-map-tools {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.osm-tool-group {
  display: grid;
  gap: 7px;
}

.osm-line-counts {
  display: grid;
  gap: 7px;
}

.osm-line-counts div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  padding: 8px;
}

.osm-line-counts span {
  color: var(--muted);
  overflow-wrap: anywhere;
  text-align: right;
}

.osm-map-stage {
  min-width: 0;
  min-height: 0;
}

.osm-selection-map {
  width: 100%;
  height: 560px;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #07111d;
}

.osm-map-unavailable {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 20px;
  color: #fecaca;
  text-align: center;
}

.toggle-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.database-settings-layout {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  height: calc(100% - 80px);
  min-height: 520px;
  overflow: hidden;
}

.database-settings-menu {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  scrollbar-gutter: stable;
}

.database-menu-row {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  color: var(--text);
  padding: 11px;
  text-align: left;
  cursor: pointer;
}

.database-menu-row small {
  color: var(--muted);
  line-height: 1.25;
}

.database-menu-row:hover,
.database-menu-row.active {
  border-color: var(--accent);
  background: #082f49;
}

.database-settings-detail {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.database-detail-panel {
  height: 100%;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
}

.database-detail-panel[hidden] {
  display: none !important;
}

.database-info-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.database-status-card,
.database-migration-target {
  margin: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  padding: 14px;
}

.database-status-card {
  display: grid;
  gap: 8px;
}

.database-status-card h3,
.database-migration-target h3 {
  margin: 0;
}

.database-status-card.success {
  border-color: rgba(34, 197, 94, .55);
  background: rgba(22, 101, 52, .16);
}

.database-status-card.error {
  border-color: rgba(239, 68, 68, .55);
  background: rgba(127, 29, 29, .2);
}

.database-status-card.loading {
  border-color: rgba(56, 189, 248, .35);
  background: rgba(8, 17, 31, .72);
}

.database-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.database-status-line code,
.database-table-row code {
  color: #cbd5e1;
  overflow-wrap: anywhere;
}

.database-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.database-metric {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  padding: 12px;
}

.database-metric strong {
  font-size: 21px;
  color: #bae6fd;
}

.database-metric span {
  color: var(--muted);
  font-size: 12px;
}

.database-metric.loading strong {
  animation: scoped-loader-pulse 1.2s ease-in-out infinite;
}

.database-table-list {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.database-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 110px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08111f;
  padding: 10px;
}

.database-table-row strong,
.database-table-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.database-table-row span {
  color: var(--muted);
}

.database-form-grid {
  margin-top: 0;
}

.database-migration-grid {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.database-migration-target {
  min-width: 0;
}

.compact-form-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  padding-left: 0;
  padding-right: 0;
}

.database-migration-actions {
  padding-left: 0;
  padding-right: 0;
}

.database-migration-result {
  display: grid;
  gap: 8px;
  min-height: 40px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  padding: 10px;
  color: var(--muted);
}

.database-migration-result.success {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, .55);
  background: rgba(22, 101, 52, .16);
}

.database-migration-result.error {
  color: #fecaca;
  border-color: rgba(239, 68, 68, .55);
  background: rgba(127, 29, 29, .2);
}

.database-message-list {
  display: grid;
  gap: 6px;
}

.auth-new-profile,
.auth-user-profile {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.auth-new-profile {
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--line);
}

.auth-new-profile-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.auth-new-profile-copy span,
.auth-user-identity span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.auth-user-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.auth-user-identity strong {
  overflow-wrap: anywhere;
}

.auth-avatar {
  display: grid;
  gap: 7px;
  justify-items: center;
  width: 126px;
  flex: 0 0 126px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.auth-avatar-image {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
}

.auth-avatar-image.default-logo {
  width: 112px;
  height: 66px;
  padding: 5px;
}

.auth-user-card .auth-avatar,
.auth-new-card .auth-avatar {
  height: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.auth-user-card .auth-avatar-image.default-logo,
.auth-new-card .auth-avatar-image.default-logo {
  width: 118px;
  height: 78px;
}

.auth-avatar-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-avatar-image.custom-avatar img {
  object-fit: contain;
}

.auth-user-head .auth-avatar small {
  display: none;
}

.auth-avatar-image.empty span {
  font-weight: 800;
  color: var(--muted);
}

.auth-avatar-field {
  grid-column: span 2;
}

.auth-user-grid,
.auth-role-grid {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.auth-user-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.auth-user-card {
  display: grid;
  grid-template-rows: auto auto auto auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  overflow: hidden;
}

.auth-config-layout {
  min-height: min(620px, calc(100vh - var(--topbar-height) - 230px));
}

.auth-access-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-detail-panel {
  min-width: 0;
}

.auth-list-panel .config-list {
  max-height: calc(100vh - var(--topbar-height) - 300px);
}

.auth-list-new .config-list-thumb {
  font-size: 18px;
  line-height: 1;
}

.auth-list-thumb {
  color: var(--text);
}

.auth-list-thumb img {
  object-fit: contain;
}

.auth-list-status {
  gap: 5px;
  padding: 5px 7px;
  font-size: 11px;
  white-space: nowrap;
}

.auth-list-status .status-light {
  width: 7px;
  height: 7px;
}

.auth-detail-body {
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 12px;
  padding: 16px 14px 8px;
}

.auth-role-detail-body {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.auth-role-description {
  grid-column: span 3;
}

.auth-role-description textarea {
  min-height: 74px;
  resize: vertical;
}

.auth-detail-roles {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  padding: 0;
}

.auth-new-card .auth-user-head {
  border-bottom: 1px solid var(--line);
}

.auth-user-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(8, 47, 73, .24), rgba(15, 23, 42, .08));
}

.auth-user-identity strong,
.auth-user-identity span {
  display: block;
}

.auth-user-identity span {
  color: var(--muted);
  font-size: 12px;
}

.auth-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.auth-status-pill .status-light {
  width: 8px;
  height: 8px;
}

.auth-status-pill.online {
  color: #bbf7d0;
  border-color: rgba(22, 101, 52, .8);
  background: rgba(5, 46, 22, .82);
}

.auth-status-pill.offline {
  color: #fecaca;
  border-color: rgba(153, 27, 27, .8);
  background: rgba(69, 10, 10, .82);
}

.auth-detail-section {
  display: grid;
  gap: 8px;
  padding: 10px 14px 0;
}

.auth-section-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.auth-role-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.auth-role-choice {
  align-items: start;
  width: 100%;
  max-width: none;
}

.auth-role-choice .toggle-chip-label {
  display: grid;
  justify-content: stretch;
  align-items: start;
  gap: 4px;
  min-height: 64px;
  text-align: left;
}

.auth-role-choice .toggle-chip-label > span {
  overflow-wrap: normal;
  word-break: normal;
}

.auth-role-choice small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.auth-role-card {
  border: 1px solid var(--line);
}

.auth-role-letter {
  font-weight: 900;
}

.auth-permission-list {
  display: grid;
  gap: 12px;
}

.auth-permission-domain {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.auth-permission-domain h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.auth-permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.auth-permission-choice {
  align-items: stretch;
  width: 100%;
  max-width: none;
}

.auth-permission-choice .toggle-chip-label {
  display: grid;
  justify-content: stretch;
  gap: 4px;
  min-height: 54px;
  text-align: left;
}

.auth-permission-choice.critical .toggle-chip-label {
  border-color: rgba(245, 158, 11, .5);
}

.auth-permission-choice small {
  color: var(--muted);
  font-size: 11px;
}

.auth-audit-card {
  display: grid;
  gap: 12px;
}

.auth-audit-list {
  display: grid;
  gap: 8px;
}

.auth-audit-row {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.auth-audit-row span,
.auth-audit-row small {
  color: var(--muted);
}

.auth-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.auth-state-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-state-toggle .toggle-chip {
  min-height: 32px;
}

.auth-state-toggle .toggle-chip-label {
  min-height: 32px;
  padding: 7px 11px;
  font-size: 13px;
}

.auth-state-hint {
  color: var(--muted);
  font-size: 12px;
}

.auth-footer-actions {
  margin-top: 0;
  margin-left: auto;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 700;
}

.status-light {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.75);
}

.status-badge.online {
  color: #bbf7d0;
  border-color: #166534;
  background: #052e16;
}

.status-badge.online .status-light {
  background: var(--ok);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
}

.status-badge.offline {
  color: #fecaca;
  border-color: #991b1b;
  background: #450a0a;
}

.status-badge.muted {
  color: var(--muted);
  border-color: #475569;
  background: #111827;
}

.status-badge.muted .status-light {
  background: #64748b;
  box-shadow: 0 0 10px rgba(100, 116, 139, .65);
}

.track-dashboard {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - var(--topbar-height));
  padding: 14px;
  overflow: hidden;
}

body.data-alert-visible .track-dashboard {
  height: calc(100vh - var(--topbar-height) - 74px);
}

.track-dashboard::before {
  content: "";
  position: absolute;
  inset: 14px;
  background: url("/static/assets/logos/software/rtm_track_transparent.png") center / min(88%, 1120px) auto no-repeat;
  opacity: .055;
  filter: saturate(.9) contrast(1.08);
  pointer-events: none;
  z-index: 3;
}

.tracker-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.vehicle-count-panel {
  display: grid;
  gap: 14px;
}

.vehicle-count-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.vehicle-count-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.vehicle-count-config {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.vehicle-line-list {
  display: grid;
  gap: 10px;
}

.vehicle-line-row {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(150px, 1fr) minmax(120px, .7fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
}

.vehicle-alert-list {
  display: grid;
  gap: 8px;
}

.tracker-kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  padding: 12px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tracker-kpi strong {
  font-size: 24px;
  line-height: 1;
  color: var(--text);
}

.tracker-kpi span {
  color: var(--muted);
  font-size: 12px;
}

.tracker-kpi.online {
  border-color: rgba(34, 197, 94, .48);
  background: #052e16;
}

.tracker-kpi.offline {
  border-color: rgba(239, 68, 68, .48);
  background: #450a0a;
}

.tracker-kpi.warning,
.track-status-metric.warning {
  border-color: rgba(245, 158, 11, .5);
  background: #451a03;
}

.tracker-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.tracker-list-panel,
.tracker-detail-panel {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tracker-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  overflow: auto;
}

.tracker-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) minmax(80px, auto);
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  color: var(--text);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.tracker-row:hover,
.tracker-row.selected {
  border-color: var(--accent);
  background: #082f49;
}

.tracker-row strong,
.tracker-row small,
.tracker-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracker-row small,
.tracker-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.tracker-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #64748b;
  box-shadow: 0 0 0 4px rgba(100, 116, 139, .18);
}

.tracker-status-dot.online {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .18);
}

.tracker-status-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .18);
}

.tracker-detail-panel {
  padding: 0;
}

.tracker-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.tracker-detail-head h2 {
  margin: 0 0 4px;
}

.tracker-detail-head span {
  color: var(--muted);
}

.tracker-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.tracker-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  padding: 14px;
}

.tracker-detail-grid div,
.tracker-detail-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  color: var(--text);
  padding: 10px;
  text-align: left;
  font: inherit;
}

.tracker-detail-grid div.wide,
.tracker-detail-card.wide {
  grid-column: span 2;
}

.tracker-detail-grid strong,
.tracker-detail-grid span,
.tracker-detail-card strong,
.tracker-detail-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracker-detail-grid span,
.tracker-detail-card span {
  color: var(--muted);
  font-size: 12px;
}

.tracker-position-card {
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.tracker-position-card:hover:not(:disabled),
.tracker-position-card:focus-visible {
  border-color: var(--accent);
  background: #082f49;
  outline: none;
  transform: translateY(-1px);
}

.tracker-position-card:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.tracker-provisioning {
  margin: 0 14px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.tracker-provisioning-qr {
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  place-items: center;
  min-height: 200px;
}

.tracker-provisioning-qr svg {
  width: 100%;
  max-width: 190px;
  height: auto;
  display: block;
}

.tracker-provisioning-data {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.tracker-provisioning-data > span {
  color: var(--muted);
  font-size: 13px;
}

.tracker-provisioning-data input {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.tracker-transponder-settings {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.tracker-settings-card,
.transponder-settings-card {
  display: grid;
  gap: 14px;
}

.tracker-config-layout {
  min-height: 520px;
}

.tracker-device-list {
  max-height: min(62vh, 640px);
  overflow: auto;
}

.config-row-badge {
  justify-self: end;
  max-width: 110px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.config-row-badge.online {
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.tracker-config-detail .track-detail-list {
  margin: 0 12px 12px;
}

.tracker-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) minmax(220px, auto);
  align-items: end;
  gap: 10px;
  min-width: 0;
}

.tracker-create-form .btn {
  min-height: 42px;
}

.tracker-config-list {
  display: grid;
  gap: 10px;
}

.tracker-config-row {
  display: grid;
  grid-template-columns: 44px minmax(180px, 1fr) minmax(130px, auto) minmax(110px, auto) minmax(220px, auto);
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  padding: 10px;
}

.tracker-config-main,
.tracker-config-state,
.tracker-config-actions {
  min-width: 0;
}

.tracker-config-main {
  display: grid;
  gap: 3px;
}

.tracker-config-main strong,
.tracker-config-main small,
.tracker-config-state span,
.tracker-config-key {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracker-config-main small,
.tracker-config-state span,
.tracker-config-key {
  color: var(--muted);
  font-size: 12px;
}

.tracker-config-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tracker-config-key.online {
  color: #86efac;
}

.tracker-config-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.tracker-config-row .tracker-provisioning {
  grid-column: 1 / -1;
  margin: 0;
}

@media (max-width: 1100px) {
  .tracker-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tracker-create-form .btn {
    grid-column: 1 / -1;
  }

  .tracker-config-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .tracker-config-state,
  .tracker-config-key,
  .tracker-config-actions,
  .tracker-config-row .tracker-provisioning {
    grid-column: 1 / -1;
  }

  .tracker-config-actions {
    justify-content: stretch;
  }

  .tracker-config-actions .btn {
    flex: 1 1 150px;
  }
}

.alarm-condition-list {
  display: grid;
  gap: 10px;
}

.alarm-condition-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(150px, 1fr) minmax(110px, 0.6fr) minmax(120px, 0.7fr) auto;
}

@media (max-width: 920px) {
  .alarm-condition-row {
    grid-template-columns: 1fr;
  }
}

.tracker-telemetry-section {
  min-height: 0;
  padding: 0 14px 14px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.tracker-telemetry-toolbar {
  gap: 12px;
  align-items: end;
}

.tracker-telemetry-toolbar > div {
  display: grid;
  gap: 8px;
}

.tracker-telemetry-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(74px, auto));
  gap: 4px;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #020617;
  padding: 4px;
}

.tracker-telemetry-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 7px 12px;
  font-weight: 800;
  cursor: pointer;
}

.tracker-telemetry-tabs button:hover,
.tracker-telemetry-tabs button.active {
  color: #e0f2fe;
  background: #0c4a6e;
}

.tracker-telemetry-table {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
}

.tracker-telemetry-head,
.tracker-telemetry-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(190px, 1.4fr) minmax(90px, .8fr) minmax(110px, .8fr);
  gap: 10px;
  padding: 9px 10px;
  align-items: center;
}

.tracker-telemetry-head {
  position: sticky;
  top: 0;
  background: #111827;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  z-index: 1;
}

.tracker-telemetry-row {
  border-top: 1px solid rgba(36, 50, 68, .8);
}

.tracker-telemetry-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracker-map-layout {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  gap: 10px;
}

.tracker-map-stage {
  position: relative;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07111d;
  overflow: hidden;
}

.tracker-telemetry-map {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: block;
}

.tracker-map-fallback-frame {
  fill: rgba(15, 23, 42, .42);
  stroke: rgba(148, 163, 184, .45);
  stroke-width: 2;
  stroke-dasharray: 12 10;
}

.tracker-map-path {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .86;
}

.tracker-map-point {
  fill: #bae6fd;
  stroke: #082f49;
  stroke-width: 3;
  opacity: .76;
}

.tracker-map-point.selected {
  fill: #22c55e;
  stroke: #dcfce7;
  stroke-width: 4;
  opacity: 1;
}

.tracker-map-current circle {
  fill: rgba(34, 197, 94, .16);
  stroke: rgba(187, 247, 208, .72);
  stroke-width: 3;
}

.tracker-map-current path {
  fill: #22c55e;
  stroke: #dcfce7;
  stroke-width: 2;
}

.tracker-map-readout {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: grid;
  gap: 2px;
  max-width: min(420px, calc(100% - 24px));
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 8px;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(6px);
  padding: 10px 12px;
}

.tracker-map-readout strong,
.tracker-map-readout span,
.tracker-map-readout small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracker-map-readout span,
.tracker-map-readout small {
  color: var(--muted);
}

.tracker-map-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  padding: 10px 12px;
}

.tracker-map-range {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tracker-map-range input {
  width: 100%;
  accent-color: var(--accent);
}

.tracker-map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  white-space: nowrap;
}

.tracker-map-toggle input {
  accent-color: var(--accent);
}

.tracker-empty {
  align-self: start;
  max-width: 760px;
  padding: 18px;
  display: grid;
  gap: 10px;
}

.tracker-empty h2,
.tracker-empty p {
  margin: 0;
}

.track-page .session {
  gap: 12px;
}

.track-page .session .weather-temp-tile {
  position: static;
  width: 132px;
  height: 44px;
  min-height: 44px;
  padding: 7px 10px;
  flex: 0 0 auto;
}

.track-page .session .weather-temp-tile .weather-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
}

.track-page .session .weather-temp-tile #weatherTemp {
  font-size: 17px;
}

.track-page .track-dashboard {
  display: block;
  height: calc(100vh - var(--topbar-height));
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 8%, rgba(14, 165, 233, .16), transparent 32%),
    linear-gradient(145deg, #050a12 0%, #07111d 48%, #02060d 100%);
}

.track-page .track-dashboard::before {
  display: none;
}

.track-live-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 420px;
  height: 100%;
  min-height: 0;
  border-top: 1px solid rgba(51, 65, 85, .72);
  color: #e5f2ff;
}

.track-tracker-sidebar,
.track-live-detail {
  min-width: 0;
  min-height: 0;
  background: rgba(8, 15, 27, .94);
  border-color: rgba(51, 65, 85, .82);
}

.track-tracker-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border-right: 1px solid rgba(51, 65, 85, .82);
}

.track-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
}

.track-search-field {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  height: 46px;
  border: 1px solid rgba(56, 189, 248, .24);
  border-radius: 8px;
  background: rgba(2, 6, 23, .74);
  color: #9fb4ca;
  padding: 0 12px;
}

.track-search-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e5f2ff;
  font: inherit;
}

.track-search-field input::placeholder {
  color: #8aa3bc;
}

.track-icon-button {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(56, 189, 248, .35);
  border-radius: 8px;
  background: #07111f;
  color: #dff6ff;
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.track-icon-button:hover,
.track-icon-button:focus-visible {
  border-color: #22d3ee;
  background: #083344;
  outline: none;
}

.track-filter-row,
.track-bottom-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.track-filter-row button,
.track-bottom-segmented button {
  min-width: 0;
  border: 1px solid rgba(51, 65, 85, .9);
  border-radius: 8px;
  background: rgba(15, 23, 42, .72);
  color: #c6d8ea;
  padding: 10px 9px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 3px;
}

.track-filter-row button em {
  font-style: normal;
  color: #8ea7bf;
  font-size: 12px;
}

.track-filter-row button.active,
.track-bottom-segmented button.active {
  color: #effbff;
  border-color: #06b6d4;
  background: linear-gradient(135deg, rgba(8, 145, 178, .88), rgba(13, 148, 136, .76));
  box-shadow: inset 0 0 0 1px rgba(103, 232, 249, .16);
}

.track-tracker-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 2px;
}

.track-tracker-row {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(51, 65, 85, .86);
  border-radius: 8px;
  background: rgba(9, 15, 27, .82);
  color: #e5f2ff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.track-tracker-row:hover,
.track-tracker-row.selected {
  border-color: #06b6d4;
  background: linear-gradient(135deg, rgba(8, 75, 104, .96), rgba(5, 116, 119, .82));
  box-shadow: 0 12px 34px rgba(6, 182, 212, .11);
}

.track-row-code {
  width: 48px;
  height: 48px;
  border: 1px solid #06b6d4;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #38d5ff;
  background: #06101d;
  font-weight: 900;
  font-size: 18px;
}

.track-row-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.track-row-main strong,
.track-row-main small,
.track-row-side em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-row-main strong {
  font-size: 18px;
}

.track-row-main small {
  color: #9fb4ca;
  font-size: 12px;
}

.track-row-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.track-row-side i {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #64748b;
  box-shadow: 0 0 0 4px rgba(100, 116, 139, .16);
}

.track-row-side i.online {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .16);
}

.track-row-side i.offline {
  background: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .16);
}

.track-row-side em {
  max-width: 84px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 8px;
  background: #07111f;
  color: #dcecff;
  font-style: normal;
  font-size: 12px;
  padding: 5px 7px;
}

.track-list-empty,
.track-empty-state {
  border: 1px solid rgba(51, 65, 85, .82);
  border-radius: 8px;
  background: rgba(8, 15, 27, .88);
  color: #9fb4ca;
  padding: 18px;
}

.track-empty-state {
  margin: 18px;
  max-width: 760px;
  display: grid;
  gap: 10px;
}

.track-sidebar-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(51, 65, 85, .82);
  color: #9fb4ca;
  padding-top: 10px;
  font-size: 13px;
}

.track-map-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 82px;
  background: #06101d;
}

.track-live-map {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid rgba(51, 65, 85, .82);
}

.track-live-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.track-live-grid-bg {
  fill: #07111d;
}

.track-live-grid-lines path {
  stroke: rgba(56, 189, 248, .08);
  stroke-width: 1;
}

.track-live-line-shadow {
  fill: none;
  stroke: rgba(148, 163, 184, .24);
  stroke-width: 50;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track-live-line {
  fill: none;
  stroke: url(#trackRail);
  stroke-width: 36;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track-live-sector {
  fill: none;
  stroke-width: 18;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .9;
}

.track-live-sector.sector-a {
  stroke: #0ea5e9;
}

.track-live-sector.sector-b {
  stroke: #f59e0b;
}

.track-live-sector.sector-c {
  stroke: #22c55e;
}

.track-sector-label {
  fill: #06b6d4;
  font-size: 28px;
  font-weight: 900;
}

.track-finish-line rect {
  fill: #f8fafc;
}

.track-finish-line rect:nth-child(even) {
  fill: #020617;
}

.track-map-tracker {
  filter: url(#trackerGlow);
  will-change: transform;
}

.track-map-trail {
  fill: none;
  stroke: rgba(34, 211, 238, .38);
  stroke-width: 8;
  stroke-linecap: round;
}

.track-map-tracker.moto .track-map-trail {
  stroke: rgba(244, 114, 182, .42);
}

.track-map-pulse {
  fill: rgba(6, 182, 212, .14);
  stroke: rgba(103, 232, 249, .45);
  stroke-width: 2;
}

.track-map-tracker.moto .track-map-pulse {
  fill: rgba(217, 70, 239, .14);
  stroke: rgba(244, 114, 182, .55);
}

.track-map-dot {
  fill: #07111f;
  stroke: #22d3ee;
  stroke-width: 4;
}

.track-map-tracker.moto .track-map-dot {
  stroke: #f472b6;
}

.track-map-tracker.selected .track-map-pulse {
  fill: rgba(6, 182, 212, .28);
  stroke-width: 4;
}

.track-map-tracker text {
  fill: #f8fafc;
  text-anchor: middle;
  font-size: 20px;
  font-weight: 900;
}

.track-map-selected-card {
  position: absolute;
  z-index: 3;
  min-width: 104px;
  border: 1px solid #06b6d4;
  border-radius: 8px;
  background: rgba(3, 14, 25, .92);
  box-shadow: 0 16px 42px rgba(6, 182, 212, .22);
  padding: 9px 11px;
  pointer-events: none;
}

.track-map-selected-card strong,
.track-map-selected-card span {
  display: block;
}

.track-map-selected-card span {
  color: #38d5ff;
  font-weight: 900;
}

.track-map-compass {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 999px;
  background: rgba(2, 6, 23, .68);
  display: grid;
  place-items: center;
  color: #dbeafe;
  font-weight: 900;
}

.track-map-compass::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 24px solid #cbd5e1;
  transform: translateY(8px);
}

.track-map-compass span {
  position: absolute;
  top: 10px;
}

.track-live-bottom-bar {
  min-width: 0;
  display: grid;
  grid-template-columns: 278px repeat(4, minmax(110px, 1fr)) minmax(150px, auto);
  align-items: center;
  gap: 14px;
  border-top: 1px solid rgba(51, 65, 85, .86);
  border-right: 1px solid rgba(51, 65, 85, .82);
  background: rgba(4, 10, 18, .96);
  padding: 10px 18px;
}

.track-bottom-segmented {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-right: 12px;
  border-right: 1px solid rgba(51, 65, 85, .82);
}

.track-bottom-segmented button {
  grid-template-columns: 24px auto;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
}

.track-bottom-segmented svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track-bottom-stat {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: #9fb4ca;
}

.track-bottom-stat strong {
  color: #f8fbff;
  font-size: 20px;
}

.track-bottom-stat span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-bottom-icons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  color: #7f95ad;
  font-size: 22px;
}

.track-bottom-icons .online {
  color: #22c55e;
}

.track-bottom-icons .warning {
  color: #f59e0b;
}

.track-live-detail {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, auto);
  gap: 14px;
  padding: 22px;
  border-left: 1px solid rgba(51, 65, 85, .82);
  overflow: auto;
}

.track-detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 12px;
  align-items: start;
}

.track-detail-top h2 {
  margin: 0 0 7px;
  font-size: 25px;
}

.track-detail-top p {
  margin: 0 0 5px;
  color: #dcecff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-detail-top small {
  color: #9fb4ca;
}

.track-detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.track-live-metric {
  min-width: 0;
  min-height: 112px;
  border: 1px solid rgba(51, 65, 85, .86);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(15, 23, 42, .84), rgba(7, 17, 31, .95));
  padding: 13px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.track-live-metric span {
  color: #b8c8db;
  font-size: 13px;
}

.track-live-metric strong {
  color: #f8fbff;
  font-size: 28px;
  line-height: 1;
}

.track-live-metric small {
  color: #8fa5bd;
}

.track-live-metric svg {
  width: 100%;
  height: 42px;
  align-self: end;
}

.track-live-metric svg path {
  fill: none;
  stroke: #0ea5e9;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tracker-bearing-graph {
  position: relative;
  width: min(112px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  align-self: end;
  border: 1px solid rgba(56, 189, 248, .38);
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(56, 189, 248, .22) 0 9px, transparent 10px),
    radial-gradient(circle at center, rgba(15, 23, 42, .9) 0 58%, rgba(8, 15, 27, .95) 59% 100%);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .08), 0 0 22px rgba(14, 165, 233, .1);
}

.tracker-bearing-graph i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 40%;
  border-radius: 999px 999px 4px 4px;
  transform: translate(-50%, -100%) rotate(var(--bearing, 0deg));
  transform-origin: 50% 100%;
  background: linear-gradient(180deg, #38bdf8, #67e8f9);
  box-shadow: 0 0 16px rgba(56, 189, 248, .55);
  transition: transform .2s ease-out;
}

.tracker-bearing-graph span {
  position: absolute;
  left: 50%;
  top: 50%;
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(103, 232, 249, .7);
  border-radius: 999px;
  background: rgba(7, 17, 31, .94);
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 900;
}

.tracker-bearing-graph b {
  position: absolute;
  color: #7dd3fc;
  font-size: 10px;
  line-height: 1;
}

.tracker-bearing-graph b:nth-child(1) {
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
}

.tracker-bearing-graph b:nth-child(2) {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.tracker-bearing-graph b:nth-child(3) {
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
}

.tracker-bearing-graph b:nth-child(4) {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.tracker-accel-graph {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px;
  gap: 10px;
  min-height: 76px;
  align-items: stretch;
}

.tracker-accel-plane {
  position: relative;
  min-height: 76px;
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at var(--accel-x, 50%) var(--accel-y, 50%), rgba(103, 232, 249, .16), transparent 30%),
    linear-gradient(rgba(56, 189, 248, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, .08) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px, 24px 24px;
}

.tracker-accel-plane::before,
.tracker-accel-plane::after {
  content: "";
  position: absolute;
  background: rgba(148, 163, 184, .22);
}

.tracker-accel-plane::before {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
}

.tracker-accel-plane::after {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}

.tracker-accel-plane span {
  position: absolute;
  left: var(--accel-x, 50%);
  top: var(--accel-y, 50%);
  width: 18px;
  height: 18px;
  border: 2px solid #cffafe;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: #22d3ee;
  box-shadow: 0 0 0 7px rgba(34, 211, 238, .18), 0 0 22px rgba(34, 211, 238, .45);
  transition: left .16s ease-out, top .16s ease-out;
}

.tracker-accel-z {
  position: relative;
  border-radius: 999px;
  background: rgba(51, 65, 85, .72);
  overflow: hidden;
}

.tracker-accel-z i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--accel-z, 0%);
  border-radius: inherit;
  background: linear-gradient(180deg, #67e8f9, #22c55e);
  transition: height .16s ease-out;
}

.track-live-metric.acceleration strong,
.track-live-metric.bearing strong {
  color: #e0f2fe;
}

.track-live-metric.battery strong,
.track-live-metric.signal strong {
  color: #86efac;
}

.track-detail-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(51, 65, 85, .9);
  overflow: hidden;
}

.track-detail-bar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #67e8f9);
}

.track-detail-list {
  border: 1px solid rgba(51, 65, 85, .86);
  border-radius: 8px;
  background: rgba(8, 15, 27, .78);
  overflow: hidden;
}

.track-detail-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 11px 12px;
  border-top: 1px solid rgba(51, 65, 85, .72);
}

.track-detail-list div:first-child {
  border-top: 0;
}

.track-detail-list span,
.track-detail-list strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-detail-list span {
  color: #9fb4ca;
}

.track-detail-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.track-detail-actions .btn {
  min-width: 0;
}

.track-detail-actions .btn:not(.primary) {
  background: rgba(9, 15, 27, .92);
  border-color: rgba(51, 65, 85, .9);
  color: #e5f2ff;
}

.track-detail-actions .btn:not(.primary):hover,
.track-detail-actions .btn:not(.primary):focus-visible {
  border-color: #06b6d4;
  background: #082f49;
}

.track-live-detail .tracker-provisioning {
  margin: 0;
  grid-template-columns: 1fr;
  max-height: 320px;
  overflow: auto;
}

.track-live-detail .tracker-provisioning-qr {
  min-height: 160px;
}

@media (max-width: 1320px) {
  .track-live-shell {
    grid-template-columns: 310px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .track-live-detail {
    grid-column: 1 / -1;
    grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr) minmax(240px, .8fr);
    grid-template-rows: auto;
    align-items: start;
    max-height: 280px;
    border-left: 0;
    border-top: 1px solid rgba(51, 65, 85, .82);
  }

  .track-detail-top,
  .track-detail-metrics,
  .track-detail-list,
  .track-detail-actions,
  .track-live-detail .tracker-provisioning {
    min-width: 0;
  }

  .track-detail-actions {
    grid-template-columns: 1fr;
  }

  .track-live-bottom-bar {
    grid-template-columns: 246px repeat(3, minmax(95px, 1fr)) minmax(120px, auto);
  }

  .track-live-bottom-bar .track-bottom-stat:nth-of-type(4) {
    display: none;
  }
}

@media (max-width: 980px) {
  .track-page .track-dashboard {
    height: auto;
    min-height: calc(100vh - var(--topbar-height));
    overflow: visible;
  }

  .track-live-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .track-tracker-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(51, 65, 85, .82);
  }

  .track-tracker-list {
    max-height: 360px;
  }

  .track-map-column {
    grid-template-rows: minmax(420px, 62vh) auto;
  }

  .track-live-bottom-bar {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .track-bottom-segmented {
    grid-column: 1 / -1;
    border-right: 0;
    padding-right: 0;
  }

  .track-bottom-icons {
    justify-content: flex-start;
  }

  .track-live-detail {
    grid-column: auto;
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
  }
}

.file-explorer-shell {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.file-explorer-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.file-explorer-path {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
}

.file-explorer-toolbar input,
.file-explorer-path input {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  background: #0b1220;
  color: var(--text);
}

.file-transfer-status[hidden] {
  display: none !important;
}

.file-transfer-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  border: 1px solid rgba(56, 189, 248, .3);
  border-radius: 8px;
  background: rgba(8, 17, 31, .78);
  padding: 12px;
}

.file-transfer-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.file-transfer-copy strong {
  color: #e0f2fe;
}

.file-transfer-copy small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-progress {
  display: block;
  height: 8px;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: 999px;
  background: #020617;
  overflow: hidden;
}

.file-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width .16s ease;
}

.file-transfer-card.indeterminate .file-progress span {
  width: 42% !important;
  animation: file-progress-indeterminate 1.1s ease-in-out infinite;
}

.file-progress-value {
  min-width: 42px;
  color: #bae6fd;
  font-weight: 800;
  text-align: right;
}

@keyframes file-progress-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(240%);
  }
}

.file-explorer-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 360px);
  gap: 14px;
  min-height: 420px;
  max-height: min(620px, 62vh);
  overflow: hidden;
}

.file-explorer-list,
.file-explorer-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  padding: 10px;
  overflow: auto;
}

.file-explorer-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.file-browser-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111827;
  color: var(--text);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.file-item-main,
.file-detail-title {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-item-main strong,
.file-detail-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-type-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 8px;
  background: #0f172a;
  overflow: hidden;
  color: #e2e8f0;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.file-type-icon span {
  position: relative;
  z-index: 2;
}

.file-type-icon.folder {
  border-color: rgba(251, 191, 36, .42);
  background: rgba(120, 53, 15, .4);
}

.file-type-icon.folder::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 5px;
  bottom: 7px;
  height: 18px;
  border-radius: 4px;
  background: #f59e0b;
  box-shadow: inset 0 -6px 0 rgba(146, 64, 14, .35);
}

.file-type-icon.folder::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 7px;
  width: 13px;
  height: 7px;
  border-radius: 4px 4px 0 0;
  background: #fbbf24;
}

.file-type-icon.file::before,
.file-type-icon.document::before,
.file-type-icon.image::before,
.file-type-icon.pdf::before,
.file-type-icon.archive::before,
.file-type-icon.database::before {
  content: "";
  position: absolute;
  inset: 6px 8px 5px;
  border-radius: 4px;
  background: #cbd5e1;
}

.file-type-icon.file::after,
.file-type-icon.document::after,
.file-type-icon.image::after,
.file-type-icon.pdf::after,
.file-type-icon.archive::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 6px;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #64748b 50%, transparent 50%);
}

.file-type-icon.document::before {
  background: #93c5fd;
}

.file-type-icon.image::before {
  background: linear-gradient(160deg, #bbf7d0 0 55%, #16a34a 56% 100%);
}

.file-type-icon.pdf::before {
  background: #f87171;
}

.file-type-icon.archive::before {
  background: #facc15;
}

.file-type-icon.database::before {
  border-radius: 50% / 18%;
  background: linear-gradient(#67e8f9 0 32%, #0891b2 33% 100%);
}

.file-browser-item.selected,
.file-browser-item:hover {
  border-color: var(--accent);
  background: #082f49;
}

.panel-image-preview {
  grid-row: span 2;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
}

.panel-image-preview img {
  width: 100%;
  height: 100%;
  max-height: 140px;
  object-fit: contain;
}

.panel-active-toggle {
  justify-content: center;
  min-height: 38px;
  font-weight: 800;
}

.panel-active-toggle.active {
  color: #dcfce7;
  border-color: #15803d;
  background: #166534;
}

.panel-active-toggle.inactive {
  color: #fee2e2;
  border-color: #b91c1c;
  background: #991b1b;
}

.file-explorer-details {
  display: grid;
  align-content: start;
  gap: 10px;
}

.file-explorer-details code,
.file-explorer-details small {
  overflow-wrap: anywhere;
}

.file-preview-image,
.file-preview-frame {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.file-preview-image {
  max-height: 320px;
  object-fit: contain;
}

.file-preview-frame {
  min-height: 360px;
}

.raw-field {
  padding: 14px;
}

body:not(.timing-public-page):not(.public-portal-page) input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body:not(.timing-public-page):not(.public-portal-page) select,
body:not(.timing-public-page):not(.public-portal-page) textarea {
  border-color: var(--field-border);
  background:
    linear-gradient(180deg, rgba(13, 25, 42, .98), rgba(7, 14, 25, .98)),
    var(--field-bg);
  color: #f8fbff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .035),
    inset 0 8px 18px rgba(0, 0, 0, .16);
}

body:not(.timing-public-page):not(.public-portal-page) input:not([type="checkbox"]):not([type="radio"]):not([type="file"])::placeholder,
body:not(.timing-public-page):not(.public-portal-page) textarea::placeholder {
  color: var(--field-placeholder);
  opacity: 1;
}

body:not(.timing-public-page):not(.public-portal-page) input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
body:not(.timing-public-page):not(.public-portal-page) select:hover,
body:not(.timing-public-page):not(.public-portal-page) textarea:hover {
  border-color: var(--field-border-strong);
}

body:not(.timing-public-page):not(.public-portal-page) input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
body:not(.timing-public-page):not(.public-portal-page) select:focus,
body:not(.timing-public-page):not(.public-portal-page) textarea:focus {
  border-color: var(--field-focus);
  outline: none;
  box-shadow:
    0 0 0 1px rgba(56, 213, 255, .36),
    0 0 0 4px rgba(56, 189, 248, .12),
    inset 0 0 0 1px rgba(255, 255, 255, .04);
}

body:not(.timing-public-page):not(.public-portal-page) .field {
  color: #f7fbff;
  font-weight: 750;
}

body:not(.timing-public-page):not(.public-portal-page) .field input,
body:not(.timing-public-page):not(.public-portal-page) .field select,
body:not(.timing-public-page):not(.public-portal-page) .field textarea {
  font-weight: 500;
}

body:not(.timing-public-page):not(.public-portal-page) .topbar-menu,
body:not(.timing-public-page):not(.public-portal-page) .nav-menu,
body:not(.timing-public-page):not(.public-portal-page) .config-action-menu-list,
body:not(.timing-public-page):not(.public-portal-page) .timing-column-menu div {
  border-color: #34516f;
  background: linear-gradient(180deg, rgba(11, 23, 39, .98), rgba(6, 13, 23, .98));
  box-shadow: 0 18px 48px rgba(0, 0, 0, .48), inset 0 0 0 1px rgba(255, 255, 255, .025);
}

body:not(.timing-public-page):not(.public-portal-page) .config-action-menu-item:hover,
body:not(.timing-public-page):not(.public-portal-page) .config-action-menu-item:focus-visible,
body:not(.timing-public-page):not(.public-portal-page) .topbar-menu-item:hover,
body:not(.timing-public-page):not(.public-portal-page) .topbar-menu-item:focus-visible,
body:not(.timing-public-page):not(.public-portal-page) .topbar-menu-item.active {
  background: #0a3048;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .52);
}

.file-manager-btn {
  border-color: var(--field-border);
  background:
    linear-gradient(180deg, rgba(13, 25, 42, .98), rgba(7, 14, 25, .98)),
    var(--field-bg);
  color: #ffc84e;
}

.file-manager-btn:hover,
.file-manager-btn:focus-visible {
  border-color: #facc15;
  background: #1f2937;
  outline: none;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, .12);
}

.nav-group > a::after {
  content: " ▾";
}

@media (max-width: 1180px) {
  :root {
    --topbar-height: 126px;
  }

  .topbar,
  .topbar.topbar-main,
  body[data-map-mode="control"] .topbar,
  body[data-map-mode="control"] .topbar.topbar-main {
    grid-template-columns: minmax(190px, auto) minmax(190px, auto) minmax(0, 1fr);
    height: auto;
    min-height: var(--topbar-height);
  }

  .session {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .topbar-readonly-summary {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .track-status-strip {
    top: 12px;
    bottom: 12px;
    left: 12px;
  }

  .track-status-kpis {
    grid-template-columns: minmax(166px, 198px);
  }

  .module-toggle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-log-filter-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .system-log-row {
    grid-template-columns: 1fr;
  }

  .tracker-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vehicle-count-grid,
  .vehicle-count-config,
  .vehicle-line-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tracker-dashboard-grid {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  }

  .tracker-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-detail-grid,
  .osm-map-layout {
    grid-template-columns: 1fr;
  }

  .osm-selection-map {
    height: 420px;
    min-height: 420px;
  }
}

@media (max-width: 980px) {
  :root {
    --topbar-height: 260px;
  }

  .track-status-strip {
    top: 10px;
    bottom: auto;
    left: 10px;
    align-content: start;
  }

  .track-status-kpis {
    grid-template-columns: minmax(148px, 174px);
    gap: 6px;
    padding: 6px;
  }

  .track-status-metric {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 7px;
    min-height: 44px;
    padding: 6px 8px 6px 6px;
  }

  .track-status-icon {
    width: 30px;
    height: 30px;
  }

  .track-status-icon svg {
    width: 19px;
    height: 19px;
  }

  .track-status-kpis strong {
    font-size: 20px;
  }

  .track-status-kpis small {
    font-size: 10px;
  }

  .topbar {
    height: auto;
    min-height: var(--topbar-height);
    align-content: start;
    overflow: visible;
  }

  .organizer-chip {
    width: 100%;
    min-width: 0;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .session {
    flex-wrap: wrap;
  }

  .topbar-readonly-summary,
  .topbar:has(#notificationButton) .topbar-readonly-summary {
    grid-template-columns: 1fr;
  }

  .system-log-filter-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .topbar.topbar-main,
  body[data-map-mode="control"] .topbar,
  body[data-map-mode="control"] .topbar.topbar-main,
  .app-shell,
  .tracker-dashboard-grid,
  .settings-grid,
  .sessions-page-content,
  .config-shell,
  .form-grid,
  .module-toggle-grid {
    grid-template-columns: 1fr;
  }

  .nav,
  .session {
    justify-content: flex-start;
  }

  .session {
    width: 100%;
    max-width: 100%;
    white-space: normal;
  }

  .session-split {
    max-width: 100%;
  }

  .session-split .session-main {
    min-width: 0;
  }

  .auth-slot,
  .organizer-chip {
    width: 100%;
    max-width: none;
  }

  .nav {
    flex-wrap: wrap;
  }

  .topbar-menu {
    left: 0;
    right: auto;
  }

  .track-map {
    min-height: 430px;
  }

  .track-dashboard {
    height: auto;
    min-height: calc(100vh - var(--topbar-height));
    overflow: visible;
  }

  .tracker-list-panel,
  .tracker-detail-panel {
    overflow: visible;
  }

  .tracker-overview,
  .vehicle-count-grid,
  .vehicle-count-config,
  .vehicle-line-row,
  .tracker-detail-grid,
  .tracker-detail-head {
    grid-template-columns: 1fr;
  }

  .tracker-detail-grid div.wide,
  .tracker-detail-card.wide {
    grid-column: auto;
  }

  .tracker-telemetry-section {
    overflow: visible;
  }

  .tracker-map-layout {
    grid-template-rows: minmax(320px, auto) auto;
  }

  .tracker-map-controls {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .tracker-map-toggle {
    white-space: normal;
  }

  .tracker-telemetry-table {
    overflow-x: auto;
  }

  .tracker-telemetry-head,
  .tracker-telemetry-row {
    min-width: 620px;
  }

  .data-row,
  .data-row.sector,
  .data-row.flag,
  .session-archive-row,
  .session-archive-main,
  .file-explorer-toolbar,
  .file-explorer-path,
  .file-explorer-layout,
  .file-picker-layout,
  .asset-picker,
  .help-doc-item {
    grid-template-columns: 1fr;
  }

  .file-explorer-layout,
  .file-picker-layout {
    max-height: none;
  }

  .organizer-config-layout,
  .organizer-detail-shell,
  .organizer-main-grid,
  .organizer-contact-grid,
  .organizer-side-grid,
  .organization-user-create,
  .config-list-layout,
  .organizer-list-tools,
  .organization-user-summary,
  .organization-user-edit,
  .map-settings-layout,
    .database-settings-layout,
    .database-migration-grid,
    .weather-settings-layout,
    .backup-settings-layout,
    .backup-form-grid,
    .backup-detail-meta,
    .backup-toggle-row,
    .compact-form-grid {
    grid-template-columns: 1fr;
  }

  .auth-avatar-field {
    grid-column: auto;
  }

  .auth-detail-body {
    grid-template-columns: 1fr;
  }

  .auth-config-layout .config-list-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .auth-list-status {
    grid-column: 2;
    justify-self: start;
  }

  .auth-user-head,
  .auth-new-profile,
  .auth-user-profile {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .auth-user-head .auth-avatar {
    justify-self: start;
  }

  .weather-settings-layout {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .backup-settings-layout {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  [data-config-panel="backup"] .panel-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  [data-config-panel="general"] .config-panel-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  [data-config-panel="general"] .config-title-actions,
  [data-config-panel="general"] .panel-actions.compact-actions {
    justify-content: space-between;
  }

  [data-config-panel="backup"] .panel-head .compact-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    width: 100%;
  }

  [data-config-panel="backup"] .panel-head .btn {
    width: 100%;
  }

  .backup-archive-list {
    max-height: 280px;
  }

  .backup-detail-panel {
    overflow: visible;
  }

  .backup-detail-shell {
    min-height: 0;
  }

  .backup-detail-head,
  .backup-detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .map-settings-layout {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .map-list-scroll {
    max-height: 280px;
  }

  .map-settings-detail {
    overflow: visible;
  }

  .weather-settings-menu {
    max-height: 260px;
  }

  .weather-settings-detail {
    overflow: visible;
  }

  .weather-detail-panel {
    height: auto;
    max-height: none;
  }

  .database-settings-layout {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .database-settings-menu {
    max-height: 260px;
  }

  .database-settings-detail {
    overflow: visible;
  }

  .database-detail-panel {
    height: auto;
    max-height: none;
  }

  .database-table-row {
    grid-template-columns: 1fr;
  }

  .config-list-tools.two-fields {
    grid-template-columns: 1fr;
  }

  .organizer-config-list {
    max-height: 320px;
  }

  #organizersGrid {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .organizer-config-layout,
  .organizer-detail-panel,
  .organizer-detail-shell,
  .organizer-main-column,
  .organizer-auth-panel,
  .organizer-section-card,
  .organizer-side-card {
    height: auto;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .organizer-detail-panel {
    grid-template-rows: auto auto;
  }

  .organizer-detail-shell {
    box-sizing: border-box;
    padding: 12px;
  }

  .organizer-side-head,
  .organizer-detail-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .organizer-preview-row {
    grid-template-columns: 1fr;
  }

  .organizer-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .organizer-action-buttons {
    display: grid;
    grid-template-columns: 1fr;
    flex-wrap: wrap;
  }

  .config-list {
    max-height: 320px;
  }

  .organizer-detail-body,
  .config-detail-body {
    grid-template-columns: 1fr;
  }

  .file-explorer-list,
  .file-explorer-details {
    max-height: 46vh;
  }

  .asset-field {
    grid-column: auto;
  }

  .session-filter-bar {
    align-items: stretch;
  }

  .session-filter-bar label,
  .session-filter-bar input {
    width: 100%;
  }

  .session-archive-actions {
    justify-content: flex-start;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .weather-forecast-hero {
    grid-template-columns: 1fr;
  }

  .weather-forecast-title {
    justify-items: start;
    text-align: left;
  }
}

:root[data-theme] .topbar,
:root[data-theme] body[data-map-mode="control"] .topbar {
  background: var(--topbar-bg);
  color: var(--topbar-text);
}

:root[data-theme] .topbar .brand h1,
:root[data-theme] .topbar .brand.auth-brand h1,
:root[data-theme] .topbar .brand.auth-brand strong,
:root[data-theme] .topbar .organizer-chip strong,
:root[data-theme] .topbar .auth-identity strong,
:root[data-theme] .topbar .clock-time {
  color: var(--topbar-text);
}

:root[data-theme] .topbar .brand span,
:root[data-theme] .topbar .brand.auth-brand span,
:root[data-theme] .topbar .brand.auth-brand small,
:root[data-theme] .topbar .organizer-chip small,
:root[data-theme] .topbar .auth-identity small,
:root[data-theme] .topbar .clock-date {
  color: var(--topbar-muted);
}

:root[data-theme] .topbar .brand.auth-brand,
:root[data-theme] .topbar .organizer-chip,
:root[data-theme] .topbar .auth-slot {
  background: var(--topbar-card-bg);
  border-color: var(--topbar-card-border);
  color: var(--topbar-text);
}

:root[data-theme] .topbar .logo,
:root[data-theme] .topbar .organizer-mini-logo,
:root[data-theme] .topbar .auth-avatar {
  background: var(--topbar-logo-bg);
  color: var(--topbar-logo-text);
}

:root[data-theme] .nav a,
:root[data-theme] .btn:not(.primary):not(.danger),
:root[data-theme] .config-tab,
:root[data-theme] .panel-config-card,
:root[data-theme] .config-list-panel,
:root[data-theme] .config-detail-panel,
:root[data-theme] .timing-kpi,
:root[data-theme] .timing-context-panel,
:root[data-theme] .timing-detail-panel,
:root[data-theme] .topbar-readonly-chip,
:root[data-theme] .settings-card,
:root[data-theme] .public-live-card,
:root[data-theme] .pilot-portal-card {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme] .topbar .nav a:not(.active) {
  background: var(--topbar-nav-bg);
  border-color: var(--topbar-nav-border);
  color: var(--topbar-nav-text);
}

:root[data-theme] .topbar .status-pill:not(.active):not(.expired) {
  background: var(--topbar-nav-bg);
  border-color: var(--topbar-nav-border);
  color: var(--topbar-nav-text);
}

:root[data-theme] .nav a.active,
:root[data-theme] .nav-group.active > a,
:root[data-theme] .btn.primary,
:root[data-theme] .config-tab.active {
  background: var(--accent-strong);
  border-color: var(--accent-border);
  color: var(--accent-contrast);
}

:root[data-theme] .timing-workspace-rail {
  background: var(--timing-rail-bg);
  border-color: var(--timing-rail-item-border);
  color: var(--timing-rail-text);
}

:root[data-theme] .timing-primary-nav-button {
  background: var(--timing-rail-item-bg);
  border-color: var(--timing-rail-item-border);
  color: var(--timing-rail-text);
}

:root[data-theme] .timing-primary-nav-button small,
:root[data-theme] .timing-primary-nav-button .timing-count {
  color: var(--timing-rail-muted);
}

:root[data-theme] .timing-primary-nav-button:hover,
:root[data-theme] .timing-primary-nav-button.selected {
  background: var(--timing-rail-active-bg);
  border-color: var(--timing-rail-active-border);
  color: var(--accent-contrast);
}

:root[data-theme] .timing-primary-nav-button:hover small,
:root[data-theme] .timing-primary-nav-button.selected small,
:root[data-theme] .timing-primary-nav-button:hover .timing-count,
:root[data-theme] .timing-primary-nav-button.selected .timing-count {
  color: var(--accent-contrast);
}

:root[data-theme] .flag-card,
:root[data-theme] .sector-command-btn {
  background: var(--flag-control-bg);
  border-color: var(--timing-rail-item-border);
  color: var(--flag-control-text);
}

:root[data-theme] .flag-card strong,
:root[data-theme] .flag-card span,
:root[data-theme] .sector-command-btn strong,
:root[data-theme] .sector-command-btn span {
  color: var(--flag-control-text);
}

:root[data-theme] .flag-card small,
:root[data-theme] .sector-command-btn small {
  color: var(--flag-control-muted);
}

:root[data-theme] .config-list-row.selected {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text);
}

:root[data-theme] .nav-menu,
:root[data-theme] .topbar-menu,
:root[data-theme] .config-action-menu-list,
:root[data-theme] .timing-column-menu div {
  background: var(--menu-surface);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

:root[data-theme] .topbar-menu-item:hover,
:root[data-theme] .topbar-menu-item:focus-visible,
:root[data-theme] .topbar-menu-item.active,
:root[data-theme] .config-action-menu-item:hover,
:root[data-theme] .config-action-menu-item:focus-visible,
:root[data-theme] .timing-section-tab:hover,
:root[data-theme] .timing-section-tab.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
}

:root[data-theme] body:not(.timing-public-page):not(.public-portal-page) input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
:root[data-theme] body:not(.timing-public-page):not(.public-portal-page) select,
:root[data-theme] body:not(.timing-public-page):not(.public-portal-page) textarea {
  background: var(--field-bg);
  color: var(--input-text);
  border-color: var(--field-border);
  box-shadow: inset 0 0 0 1px rgba(127, 150, 173, .12);
}

:root[data-theme] body:not(.timing-public-page):not(.public-portal-page) .field {
  color: var(--text);
}

:root[data-theme] body {
  background: var(--bg);
}

:root[data-theme] .timing-public-page,
:root[data-theme] .public-portal-page {
  background: var(--bg);
  color: var(--text);
}

:root[data-theme] .public-live-header,
:root[data-theme] .public-portal-header,
:root[data-theme] .public-live-table th {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme] .speaker-hero {
  background: var(--topbar-bg);
  color: var(--text);
}

:root[data-theme] .public-live-table th,
:root[data-theme] .public-live-table td {
  border-color: var(--line);
}

:root[data-theme] .public-live-overview span,
:root[data-theme] .public-live-overview strong,
:root[data-theme] .speaker-hero span,
:root[data-theme] .public-portal-meta,
:root[data-theme] .public-live-meta {
  color: var(--muted);
}

:root[data-theme] .public-live-tabs button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme] .public-live-tabs button.active {
  background: var(--accent-strong);
  border-color: var(--accent-border);
  color: var(--accent-contrast);
}

:root[data-theme] .modal,
:root[data-theme] .modal.timing-assistant-modal,
:root[data-theme] .about-product-card,
:root[data-theme] .about-info-card,
:root[data-theme] .about-license-card,
:root[data-theme] .notification-item,
:root[data-theme] .session-choice,
:root[data-theme] .organizer-choice {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme] .modal-head,
:root[data-theme] .modal-actions {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme] .modal-head h2,
:root[data-theme] .modal-close,
:root[data-theme] .about-product-card strong,
:root[data-theme] .about-info-card h3,
:root[data-theme] .about-license-card h3,
:root[data-theme] .about-field strong,
:root[data-theme] .notification-title,
:root[data-theme] .notification-item p,
:root[data-theme] .session-choice-section h3,
:root[data-theme] .session-choice strong,
:root[data-theme] .organizer-choice strong {
  color: var(--text);
}

:root[data-theme] .about-product-card span,
:root[data-theme] .about-body p,
:root[data-theme] .about-field span,
:root[data-theme] .about-license-card pre,
:root[data-theme] .about-body .about-legal,
:root[data-theme] .notification-title span,
:root[data-theme] .session-choice small,
:root[data-theme] .organizer-choice small {
  color: var(--muted);
}

:root[data-theme] .session-choice:hover,
:root[data-theme] .session-choice.selected,
:root[data-theme] .organizer-choice:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text);
}

:root[data-theme] .modal .field input,
:root[data-theme] .modal .field select,
:root[data-theme] .modal .field textarea,
:root[data-theme] select option,
:root[data-theme] select optgroup {
  background: var(--field-bg);
  color: var(--input-text);
  border-color: var(--field-border);
}

:root[data-theme] .btn.danger {
  color: #fff;
}

:root[data-theme] .help-button {
  background: var(--menu-surface);
  color: var(--accent-strong);
  border-color: var(--line);
}

:root[data-theme] .help-button:hover,
:root[data-theme] .help-button:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text);
}

:root[data-theme] #weatherModal .weather-modal,
:root[data-theme] #weatherModal .weather-modal .modal-head,
:root[data-theme] #weatherModal .weather-modal .modal-actions,
#weatherModal .weather-modal,
#weatherModal .weather-modal .modal-head,
#weatherModal .weather-modal .modal-actions {
  background: #ffffff;
  color: #0f172a;
  border-color: #dbe3ef;
}

:root[data-theme] #weatherModal .weather-modal .modal-head h2,
:root[data-theme] #weatherModal .weather-modal .modal-close,
#weatherModal .weather-modal .modal-head h2,
#weatherModal .weather-modal .modal-close {
  color: #0f172a;
}

:root[data-theme] #weatherModal .weather-modal .modal-head small,
#weatherModal .weather-modal .modal-head small {
  color: #64748b;
}

:root[data-theme] #weatherModal .weather-modal-body,
#weatherModal .weather-modal-body {
  background: #ffffff;
  color: #0f172a;
}

:root[data-theme] #weatherModal .weather-tabs,
#weatherModal .weather-tabs {
  background: #eef2f7;
  border-color: #cbd5e1;
}

:root[data-theme] #weatherModal .weather-tabs button,
#weatherModal .weather-tabs button {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

:root[data-theme] #weatherModal .weather-tabs button.active,
:root[data-theme] #weatherModal .weather-tabs button:hover,
#weatherModal .weather-tabs button.active,
#weatherModal .weather-tabs button:hover {
  background: #e0f2fe;
  color: #075985;
  border-color: #0284c7;
}

:root[data-theme] #weatherModal .weather-now-card,
:root[data-theme] #weatherModal .weather-metric,
:root[data-theme] #weatherModal .weather-period,
:root[data-theme] #weatherModal .weather-hour-card,
:root[data-theme] #weatherModal .weather-day-card,
:root[data-theme] #weatherModal .weather-radar-summary,
#weatherModal .weather-now-card,
#weatherModal .weather-metric,
#weatherModal .weather-period,
#weatherModal .weather-hour-card,
#weatherModal .weather-day-card,
#weatherModal .weather-radar-summary {
  background: #ffffff;
  color: #0f172a;
  border-color: #dbe3ef;
}

:root[data-theme] #weatherModal .weather-now-card,
#weatherModal .weather-now-card {
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  border-color: #bae6fd;
}

:root[data-theme] #weatherModal .weather-message,
:root[data-theme] #weatherModal .weather-empty,
:root[data-theme] #weatherModal .weather-metric span,
:root[data-theme] #weatherModal .weather-period span,
#weatherModal .weather-message,
#weatherModal .weather-empty,
#weatherModal .weather-metric span,
#weatherModal .weather-period span {
  color: #64748b;
}

:root[data-theme] #weatherModal .weather-modal,
#weatherModal .weather-modal {
  background: #f8fafc;
}

:root[data-theme] #weatherModal .weather-modal-body,
#weatherModal .weather-modal-body {
  background: #f8fafc;
  scrollbar-color: #8b8f97 #1f2937;
  scrollbar-width: auto;
}

:root[data-theme] #weatherModal .weather-tab-icon,
#weatherModal .weather-tab-icon {
  background: #e0f2fe;
  color: #075985;
}

:root[data-theme] #weatherModal .weather-tab-icon.clock,
:root[data-theme] #weatherModal .weather-tab-icon.calendar,
#weatherModal .weather-tab-icon.clock,
#weatherModal .weather-tab-icon.calendar {
  background: #dcfce7;
  color: #166534;
}

:root[data-theme] #weatherModal .weather-metric .weather-metric-icon,
#weatherModal .weather-metric .weather-metric-icon {
  color: #075985;
}

:root[data-theme] #weatherModal .weather-metric .weather-mini-icon.temp,
#weatherModal .weather-metric .weather-mini-icon.temp {
  background: #fee2e2;
  color: #dc2626;
}

:root[data-theme] #weatherModal .weather-metric .weather-mini-icon.visibility,
:root[data-theme] #weatherModal .weather-metric .weather-mini-icon.info,
#weatherModal .weather-metric .weather-mini-icon.visibility,
#weatherModal .weather-metric .weather-mini-icon.info {
  background: #fef3c7;
  color: #a16207;
}

:root[data-theme] #weatherModal .weather-day-card.has-alert,
#weatherModal .weather-day-card.has-alert {
  border-color: #f59e0b;
  background: #fff4bf;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .18);
}

:root[data-theme] #weatherModal .weather-day-card.has-alert.level-2,
#weatherModal .weather-day-card.has-alert.level-2 {
  border-color: #f97316;
  background: #ffedb3;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, .22);
}

:root[data-theme] #weatherModal .weather-day-card.has-alert.level-3,
#weatherModal .weather-day-card.has-alert.level-3 {
  border-color: #f97316;
  background: #ffe9a3;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, .24);
}

:root[data-theme] #weatherModal .weather-day-alert,
#weatherModal .weather-day-alert {
  border-color: #d97706;
  background: #fde68a;
  color: #78350f;
}

:root[data-theme] #weatherModal .weather-day-alert.level-2,
:root[data-theme] #weatherModal .weather-day-alert.level-3,
#weatherModal .weather-day-alert.level-2,
#weatherModal .weather-day-alert.level-3 {
  border-color: #f59e0b;
  background: #fde68a;
  color: #78350f;
}

:root[data-theme] #weatherModal .weather-radar-summary.radar-fort,
#weatherModal .weather-radar-summary.radar-fort {
  border-color: #fca5a5;
  background: #fef2f2;
}

:root[data-theme] #weatherModal .weather-radar-summary.radar-modere,
#weatherModal .weather-radar-summary.radar-modere {
  border-color: #fdba74;
  background: #fff7ed;
}

:root[data-theme] #weatherModal .weather-radar-summary.radar-faible,
#weatherModal .weather-radar-summary.radar-faible {
  border-color: #7dd3fc;
  background: #f0f9ff;
}

:root[data-theme] .module-settings-card,
:root[data-theme] .module-toggle-card,
:root[data-theme] .weather-settings-menu,
:root[data-theme] .weather-detail-panel,
:root[data-theme] .database-settings-menu,
:root[data-theme] .database-detail-panel,
:root[data-theme] .backup-list-panel,
:root[data-theme] .backup-detail-panel,
:root[data-theme] .map-settings-menu,
:root[data-theme] .map-settings-detail,
:root[data-theme] .organizer-list-panel,
:root[data-theme] .organizer-detail-panel,
:root[data-theme] .file-explorer-list,
:root[data-theme] .file-explorer-details,
:root[data-theme] .timing-action-menu .config-action-menu-list {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

body:not(.timing-public-page):not(.public-portal-page) .timing-action-menu .config-action-menu-list,
:root[data-theme] .timing-action-menu .config-action-menu-list {
  left: auto;
  right: 0;
  transform-origin: top right;
}

:root[data-theme] .module-toggle-card,
:root[data-theme] .weather-menu-row,
:root[data-theme] .database-menu-row,
:root[data-theme] .database-status-card,
:root[data-theme] .database-migration-target,
:root[data-theme] .database-metric,
:root[data-theme] .database-table-row,
:root[data-theme] .database-migration-result,
:root[data-theme] .backup-list-row,
:root[data-theme] .backup-empty-state,
:root[data-theme] .backup-selected-items span,
:root[data-theme] .backup-detail-meta > div,
:root[data-theme] .backup-restore-warning,
:root[data-theme] .map-list-row,
:root[data-theme] .map-detail-metrics div,
:root[data-theme] .map-layer-summary,
:root[data-theme] .osm-line-counts div,
:root[data-theme] .organizer-list-row,
:root[data-theme] .organizer-section-card,
:root[data-theme] .organizer-side-card,
:root[data-theme] .organizer-detail-summary,
:root[data-theme] .organizer-action-bar,
:root[data-theme] .config-associated-list span,
:root[data-theme] .file-transfer-card,
:root[data-theme] .file-browser-item,
:root[data-theme] .asset-preview,
:root[data-theme] .image-preview,
:root[data-theme] .panel-image-preview,
:root[data-theme] .tracker-map-controls {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme] .config-action-menu-item,
:root[data-theme] .weather-menu-row strong,
:root[data-theme] .database-menu-row strong,
:root[data-theme] .backup-list-row strong,
:root[data-theme] .map-list-row strong,
:root[data-theme] .organizer-list-row strong,
:root[data-theme] .file-browser-item strong,
:root[data-theme] .module-toggle-card strong,
:root[data-theme] .module-toggle-card label,
:root[data-theme] .timing-kpi strong,
:root[data-theme] .organizer-section-card h3,
:root[data-theme] .organizer-side-card h3,
:root[data-theme] .database-status-card h3,
:root[data-theme] .database-migration-target h3,
:root[data-theme] .organizer-action-bar > .muted,
:root[data-theme] .file-transfer-copy strong {
  color: var(--text);
}

:root[data-theme] .weather-menu-row small,
:root[data-theme] .database-menu-row small,
:root[data-theme] .database-status-card p,
:root[data-theme] .database-migration-target p,
:root[data-theme] .database-status-line code,
:root[data-theme] .database-table-row code,
:root[data-theme] .database-table-row span,
:root[data-theme] .backup-empty-state,
:root[data-theme] .backup-detail-head p,
:root[data-theme] .backup-detail-meta span,
:root[data-theme] .backup-detail-meta code,
:root[data-theme] .backup-selected-items span,
:root[data-theme] .backup-list-row small,
:root[data-theme] .map-list-row small,
:root[data-theme] .map-list-row em,
:root[data-theme] .map-layer-summary span,
:root[data-theme] .osm-line-counts span,
:root[data-theme] .organizer-list-row small,
:root[data-theme] .organizer-detail-summary span:not(.status-badge):not(.status-light),
:root[data-theme] .organizer-section-card p,
:root[data-theme] .organizer-side-card p,
:root[data-theme] .config-associated-list span,
:root[data-theme] .asset-preview.logo-preview-empty,
:root[data-theme] .image-preview.logo-preview-empty,
:root[data-theme] .file-transfer-copy small,
:root[data-theme] .file-explorer-details code,
:root[data-theme] .file-explorer-details small,
:root[data-theme] .notification-empty,
:root[data-theme] .timing-kpi span,
:root[data-theme] .module-toggle-card small {
  color: var(--muted);
}

:root[data-theme] .config-action-menu-item:hover,
:root[data-theme] .config-action-menu-item:focus-visible,
:root[data-theme] .weather-menu-row:hover,
:root[data-theme] .weather-menu-row.active,
:root[data-theme] .database-menu-row:hover,
:root[data-theme] .database-menu-row.active,
:root[data-theme] .backup-list-row:hover,
:root[data-theme] .backup-list-row.selected,
:root[data-theme] .map-list-row:hover,
:root[data-theme] .map-list-row.active,
:root[data-theme] .organizer-list-row:hover,
:root[data-theme] .organizer-list-row.selected,
:root[data-theme] .organization-user-row:hover,
:root[data-theme] .file-browser-item:hover,
:root[data-theme] .file-browser-item.selected {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text);
}

:root[data-theme] .module-logo-wrap,
:root[data-theme] .organizer-title-logo,
:root[data-theme] .config-list-thumb {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent-border);
}

:root[data-theme] .organization-user-create-drawer > summary,
:root[data-theme] .organization-user-create-roles-drawer > summary,
:root[data-theme] .organization-user-edit-drawer > summary {
  color: var(--accent);
}

:root[data-theme] .map-list-row em.online {
  background: rgba(34, 197, 94, .14);
  border-color: var(--ok);
  color: var(--text);
}

:root[data-theme] .map-list-row em.offline {
  background: rgba(239, 68, 68, .12);
  border-color: var(--danger);
  color: var(--text);
}

:root[data-theme] .map-detail-metrics strong,
:root[data-theme] .database-metric strong,
:root[data-theme] .file-progress-value {
  color: var(--accent-strong);
}

:root[data-theme] .timing-kpi strong {
  color: var(--accent);
}

:root[data-theme] .file-progress {
  background: var(--surface);
  border-color: var(--line);
}

:root[data-theme] .field-error {
  color: var(--danger);
}

:root[data-theme] .field-warning {
  color: var(--warn);
}

:root[data-theme] .backup-restore-warning {
  border-color: var(--danger);
  background: rgba(239, 68, 68, .12);
  color: var(--text);
}

:root[data-theme] .database-status-card.success {
  border-color: var(--ok);
  background: rgba(34, 197, 94, .12);
}

:root[data-theme] .database-status-card.error,
:root[data-theme] .database-migration-result.error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, .12);
}

:root[data-theme] .database-status-card.loading {
  border-color: var(--accent-border);
  background: var(--surface-2);
}

:root[data-theme] .tracker-kpi,
:root[data-theme] .vehicle-line-row {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme] .tracker-kpi strong,
:root[data-theme] .vehicle-line-row .field,
:root[data-theme] .vehicle-line-row label,
:root[data-theme] .vehicle-line-row span {
  color: var(--text);
}

:root[data-theme] .tracker-kpi span {
  color: var(--muted);
}

:root[data-theme] .tracker-kpi.online {
  background: rgba(34, 197, 94, .12);
  border-color: var(--ok);
}

:root[data-theme] .tracker-kpi.offline {
  background: rgba(239, 68, 68, .12);
  border-color: var(--danger);
}

:root[data-theme] .tracker-kpi.warning,
:root[data-theme] .track-status-metric.warning {
  background: rgba(245, 158, 11, .14);
  border-color: var(--warn);
}

:root[data-theme] .timing-assistant-head,
:root[data-theme] .timing-assistant-sidebar,
:root[data-theme] .timing-assistant-summary,
:root[data-theme] .timing-assistant-card,
:root[data-theme] .timing-assistant-actions,
:root[data-theme] .timing-assistant-preview-head,
:root[data-theme] .timing-assistant-empty,
:root[data-theme] .timing-assistant-counts span,
:root[data-theme] .timing-assistant-source,
:root[data-theme] .timing-assistant-template,
:root[data-theme] .timing-assistant-head-badges span {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme] .timing-assistant-main {
  background: transparent;
  color: var(--text);
}

:root[data-theme] .timing-assistant-step strong,
:root[data-theme] .timing-assistant-template span,
:root[data-theme] .timing-assistant-empty strong,
:root[data-theme] .timing-assistant-counts b,
:root[data-theme] .timing-assistant-source b,
:root[data-theme] .timing-assistant-preview-head strong {
  color: var(--text);
}

:root[data-theme] .timing-assistant-head small,
:root[data-theme] .timing-assistant-template small,
:root[data-theme] .timing-assistant-status,
:root[data-theme] .timing-assistant-preview-head span,
:root[data-theme] .timing-assistant-empty,
:root[data-theme] .timing-assistant-counts span,
:root[data-theme] .timing-assistant-source span {
  color: var(--muted);
}

:root[data-theme] .timing-assistant-step > span {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

:root[data-theme] .timing-assistant-template.selected,
:root[data-theme] .timing-assistant-template:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text);
}

:root[data-theme] .timing-assistant-modal .field input,
:root[data-theme] .timing-assistant-modal .field select,
:root[data-theme] .timing-assistant-modal .field textarea {
  background: var(--field-bg);
  color: var(--input-text);
  border-color: var(--field-border);
}

:root[data-theme="paddock-pro"] .organization-user-create-drawer > summary,
:root[data-theme="paddock-pro"] .organization-user-create-roles-drawer > summary,
:root[data-theme="paddock-pro"] .organization-user-edit-drawer > summary {
  color: var(--accent-strong);
}

:root[data-theme="high-contrast"] .topbar .btn.alert-btn.unread,
:root[data-theme="high-contrast"] .topbar .btn.alert-btn.track-unread {
  animation: none;
  background: var(--accent-strong);
  border-color: var(--accent-border);
  color: var(--accent-contrast);
}

:root[data-theme="high-contrast"] .topbar .btn.alert-btn.unread .alert-icon,
:root[data-theme="high-contrast"] .topbar .btn.alert-btn.unread .alert-label,
:root[data-theme="high-contrast"] .topbar .btn.alert-btn.track-unread .alert-icon,
:root[data-theme="high-contrast"] .topbar .btn.alert-btn.track-unread .alert-label {
  color: var(--accent-contrast);
}

.appearance-settings-layout {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.theme-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.theme-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.theme-card:hover,
.theme-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.theme-card strong,
.theme-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-card small {
  color: var(--muted);
  margin-top: 3px;
}

.theme-card-swatch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px;
  background: #0b1220;
}

.theme-card-swatch i {
  border-radius: 4px;
  min-width: 0;
}

.theme-card-swatch.dark {
  background: #080c12;
}

.theme-card-swatch.dark i:nth-child(1) { background: #111827; }
.theme-card-swatch.dark i:nth-child(2) { background: #38bdf8; }
.theme-card-swatch.dark i:nth-child(3) { background: #94a3b8; }

.theme-card-swatch.timing-light {
  background: #edf2f7;
}

.theme-card-swatch.timing-light i:nth-child(1) { background: #ffffff; }
.theme-card-swatch.timing-light i:nth-child(2) { background: #0f8fa3; }
.theme-card-swatch.timing-light i:nth-child(3) { background: #172033; }

.theme-card-swatch.paddock-pro {
  background: #eef3f0;
}

.theme-card-swatch.paddock-pro i:nth-child(1) { background: #ffffff; }
.theme-card-swatch.paddock-pro i:nth-child(2) { background: #16806b; }
.theme-card-swatch.paddock-pro i:nth-child(3) { background: #1b2520; }

.theme-card-swatch.pit-wall {
  background: #0b0f12;
}

.theme-card-swatch.pit-wall i:nth-child(1) { background: #151d23; }
.theme-card-swatch.pit-wall i:nth-child(2) { background: #2dd4bf; }
.theme-card-swatch.pit-wall i:nth-child(3) { background: #a5b0b8; }

.theme-card-swatch.endurance-night {
  background: #050b0a;
}

.theme-card-swatch.endurance-night i:nth-child(1) { background: #10201b; }
.theme-card-swatch.endurance-night i:nth-child(2) { background: #84cc16; }
.theme-card-swatch.endurance-night i:nth-child(3) { background: #a6beb4; }

.theme-card-swatch.high-contrast {
  background: #000000;
}

.theme-card-swatch.high-contrast i:nth-child(1) { background: #ffffff; }
.theme-card-swatch.high-contrast i:nth-child(2) { background: #facc15; }
.theme-card-swatch.high-contrast i:nth-child(3) { background: #000000; border: 1px solid #ffffff; }

.theme-card-swatch.tv-speaker {
  background: #07111f;
}

.theme-card-swatch.tv-speaker i:nth-child(1) { background: #0f1d2e; }
.theme-card-swatch.tv-speaker i:nth-child(2) { background: #f59e0b; }
.theme-card-swatch.tv-speaker i:nth-child(3) { background: #b9c5d4; }

.theme-card-swatch.custom {
  background: linear-gradient(135deg, var(--bg), var(--panel));
}

.theme-card-swatch.custom i:nth-child(1) { background: var(--panel); }
.theme-card-swatch.custom i:nth-child(2) { background: var(--accent-strong); }
.theme-card-swatch.custom i:nth-child(3) { background: var(--text); }

.appearance-color-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

:root[data-theme="timing-light"] .topbar,
:root[data-theme="timing-light"] body[data-map-mode="control"] .topbar {
  background: #141d2c;
  color: #f8fbff;
}

:root[data-theme="timing-light"] .topbar .brand h1,
:root[data-theme="timing-light"] .topbar .brand.auth-brand h1,
:root[data-theme="timing-light"] .topbar .brand.auth-brand strong,
:root[data-theme="timing-light"] .topbar .organizer-chip strong,
:root[data-theme="timing-light"] .topbar .auth-identity strong,
:root[data-theme="timing-light"] .topbar .clock-time {
  color: #f8fbff;
}

:root[data-theme="timing-light"] .topbar .brand span,
:root[data-theme="timing-light"] .topbar .brand.auth-brand span,
:root[data-theme="timing-light"] .topbar .brand.auth-brand small,
:root[data-theme="timing-light"] .topbar .organizer-chip small,
:root[data-theme="timing-light"] .topbar .auth-identity small,
:root[data-theme="timing-light"] .topbar .clock-date {
  color: #9fb2cb;
}

:root[data-theme="timing-light"] .topbar .brand.auth-brand,
:root[data-theme="timing-light"] .topbar .organizer-chip,
:root[data-theme="timing-light"] .topbar .auth-slot {
  background: #101827;
  border-color: #31445f;
  color: #f8fbff;
}

:root[data-theme="timing-light"] .topbar .logo,
:root[data-theme="timing-light"] .topbar .organizer-mini-logo,
:root[data-theme="timing-light"] .topbar .auth-avatar {
  background: #06101d;
  color: #38d5ff;
}

:root[data-theme="timing-light"] .topbar .nav a:not(.active) {
  background: #f8fbff;
  border-color: #d5e0ec;
  color: #0f172a;
}

:root[data-theme="timing-light"] .topbar .nav a.active,
:root[data-theme="timing-light"] .topbar .btn.primary {
  background: var(--accent-strong);
  border-color: var(--accent-border);
  color: #ffffff;
}

:root[data-theme="timing-light"] .topbar .status-pill:not(.active):not(.expired) {
  background: #eaf1f8;
  border-color: #a9bad0;
  color: #40536b;
}

:root[data-theme="timing-light"] .timing-shell {
  background: #eff4f8;
}

:root[data-theme="timing-light"] .timing-kpi {
  background: #ffffff;
  border-color: #cedbea;
  box-shadow: 0 6px 16px rgba(23, 32, 51, .05);
}

:root[data-theme="timing-light"] .timing-kpi strong {
  color: #0f172a;
}

:root[data-theme="timing-light"] .timing-kpi span {
  color: #607084;
}

:root[data-theme="timing-light"] .timing-data-banner,
:root[data-theme="timing-light"] .timing-filter-bar {
  background: #ffffff;
  border-color: #cedbea;
  color: #172033;
}

:root[data-theme="timing-light"] .timing-refactor-shell {
  gap: 18px;
}

:root[data-theme="timing-light"] .timing-workspace-rail {
  background: #152235;
  border: 1px solid #24364d;
  color: #dbe7f5;
  margin: 0;
  padding: 8px;
}

:root[data-theme="timing-light"] .timing-primary-nav-button {
  background: #1f3048;
  border-color: #334965;
  color: #dbe7f5;
}

:root[data-theme="timing-light"] .timing-primary-nav-button small,
:root[data-theme="timing-light"] .timing-primary-nav-button .timing-count {
  color: #aebfd3;
}

:root[data-theme="timing-light"] .timing-primary-nav-button:hover,
:root[data-theme="timing-light"] .timing-primary-nav-button.selected {
  background: #0f8176;
  border-color: #16b5a6;
  color: #ffffff;
}

:root[data-theme="timing-light"] .timing-primary-nav-button:hover small,
:root[data-theme="timing-light"] .timing-primary-nav-button.selected small,
:root[data-theme="timing-light"] .timing-primary-nav-button:hover .timing-count,
:root[data-theme="timing-light"] .timing-primary-nav-button.selected .timing-count {
  color: #ffffff;
}

:root[data-theme="timing-light"] .timing-command-bar,
:root[data-theme="timing-light"] .timing-workspace-topline,
:root[data-theme="timing-light"] .timing-context-panel,
:root[data-theme="timing-light"] .timing-detail-panel,
:root[data-theme="timing-light"] .timing-action-card,
:root[data-theme="timing-light"] .timing-action-panel .btn:not(.primary):not(.danger) {
  background: #ffffff;
  border-color: #cedbea;
  color: #172033;
}

:root[data-theme="timing-light"] .timing-rail-toggle {
  background: #1f3048;
  border-color: #334965;
  color: #dbe7f5;
}

:root[data-theme="timing-light"] .timing-live-overview-card {
  color: #f8fafc;
}

:root[data-theme="timing-light"] .timing-live-track-card,
:root[data-theme="timing-light"] .timing-live-phase-strip,
:root[data-theme="timing-light"] .timing-live-metric {
  border-color: rgba(14, 116, 144, .28);
}

:root[data-theme="timing-light"] .config-list-row {
  background: #ffffff;
  border-color: #d5e0ec;
  color: #172033;
}

:root[data-theme="timing-light"] .config-list-row.selected {
  background: #e4f5f3;
  border-color: #0f8176;
}

:root[data-theme="timing-light"] .flag-card,
:root[data-theme="timing-light"] .sector-command-btn {
  background: #0d1624;
  border-color: #24364d;
  color: #f8fbff;
}

:root[data-theme="timing-light"] .flag-card strong,
:root[data-theme="timing-light"] .flag-card span,
:root[data-theme="timing-light"] .sector-command-btn strong,
:root[data-theme="timing-light"] .sector-command-btn span {
  color: #f8fbff;
}

:root[data-theme="timing-light"] .flag-card small,
:root[data-theme="timing-light"] .sector-command-btn small {
  color: #9fb2cb;
}

:root[data-theme="timing-light"] .flag-card.selected,
:root[data-theme="timing-light"] .sector-command-btn.active {
  background: #06465a;
  border-color: #0f8fa3;
  color: #ffffff;
}

:root[data-theme="timing-light"] .track-card,
:root[data-theme="timing-light"] .panel-marker,
:root[data-theme="timing-light"] .flag-config-preview {
  background: #ffffff;
  border-color: #cedbea;
  color: #172033;
}
