:root {
  color-scheme: dark;
  --dark: #070b10;
  --dark-2: #0d131a;
  --dark-3: #141b24;
  --surface: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #fbfcfd;
  --line: #e6e8ed;
  --line-dark: #232c37;
  --text: #111820;
  --muted: #6f7782;
  --red: #ef2f32;
  --green: #18a844;
  --blue: #3447ff;
  --yellow: #ffb21c;
  --shadow: 0 14px 42px rgba(10, 16, 24, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  background: var(--dark);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-loading {
  display: grid;
  place-items: center;
  min-height: 100vh;
  color: #fff;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  align-items: start;
  background: var(--surface);
}

.app-shell.corner-shell,
.corner-shell .page {
  background: #050a0f;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--dark), var(--dark-2));
  color: #fff;
  border-right: 1px solid #17202a;
}

.brand {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.brand-logo {
  display: block;
  width: 176px;
  max-width: 100%;
  height: 62px;
  object-fit: cover;
  object-position: center;
}

.brand-icon {
  display: none;
  width: 48px;
  height: 48px;
  object-fit: cover;
  object-position: center;
  transform: scale(1.28);
}

.brand-mark {
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark span {
  color: var(--red);
}

.brand-sub {
  margin-top: 3px;
  color: #e3e7ed;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav-button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 4px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: #d7dee8;
  padding: 0 14px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
}

.nav-button:hover,
.nav-button.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(239, 47, 50, 0.28), rgba(239, 47, 50, 0));
  border-left-color: var(--red);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #303c49;
  border-radius: 6px;
  color: inherit;
  font-size: 11px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px;
  min-height: 74px;
  border-top: 1px solid #17202a;
}

.user-chip {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  min-height: 42px;
}

.user-chip > div:not(.avatar) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 35%, #fff, #c7ccd3 26%, #242b35 27%, #111923 70%);
  border: 1px solid #404a57;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 18px var(--driver-glow, transparent);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 49% 46%;
}

.user-name {
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  min-width: 0;
  color: #aab3bf;
  font-size: 11px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page {
  min-width: 0;
  min-height: 100vh;
  padding: 18px;
  overflow: hidden auto;
}

.page-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.page-title h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.page-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.soft-button,
.danger-button {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
  font-weight: 800;
}

.icon-button {
  min-width: 38px;
  padding: 0;
}

.danger-button {
  border-color: #f7b5b5;
  background: linear-gradient(180deg, #ff4a4d, #e52d30);
  color: #fff;
  box-shadow: 0 8px 22px rgba(239, 47, 50, 0.24);
}

.select,
.search {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
}

.search {
  min-width: 260px;
}

.grid-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi {
  min-height: 142px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.kpi-label {
  color: #1b222b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.kpi-value {
  align-self: center;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.kpi-note {
  color: var(--muted);
  font-size: 12px;
}

.spark {
  width: 100%;
  height: 26px;
  margin-top: 8px;
}

.donut-wrap {
  display: grid;
  place-items: center;
  gap: 4px;
}

.donut {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, #fff 0 52%, transparent 53%),
    conic-gradient(var(--red) 0 78%, #d9dde4 78% 100%);
  font-size: 18px;
  font-weight: 900;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
}

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

.panel-body {
  padding: 16px 18px;
}

.track-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
}

.track-visual {
  min-height: 300px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.track-visual svg {
  width: 100%;
  height: 100%;
  min-height: 280px;
}

.track-map-image {
  width: 100%;
  height: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 7px;
  background: #020407;
}

.report-map .track-map-image {
  max-height: 300px;
}

.loss-label {
  position: absolute;
  min-width: 86px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(10, 16, 24, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.loss-label strong {
  display: block;
  margin-top: 4px;
  color: var(--red);
}

.loss-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.loss-list h3 {
  margin: 0;
  padding: 12px;
  font-size: 12px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.loss-row,
.mini-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.loss-row:last-child,
.mini-row:last-child {
  border-bottom: 0;
}

.screen-tabs {
  display: flex;
  gap: 28px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.tab {
  border: 0;
  background: transparent;
  padding: 13px 0;
  color: var(--muted);
  font-weight: 800;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--red);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table th,
.table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.table tbody tr {
  cursor: pointer;
}

.table tbody tr:hover {
  background: var(--panel-soft);
}

.delta-bar-wrap {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.bar-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #edf0f4;
  overflow: hidden;
}

.bar {
  position: absolute;
  top: 0;
  bottom: 0;
}

.bar.loss {
  left: 50%;
  background: var(--red);
}

.bar.gain {
  right: 50%;
  background: var(--green);
}

.driver-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 14px;
}

.segment-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(430px, 1fr);
  gap: 14px;
}

.map-card {
  overflow: hidden;
}

.segment-map,
.overview-map {
  position: relative;
  min-height: 470px;
  background: #0f151c;
}

.overview-map {
  min-height: 360px;
}

.overview-map-shell {
  position: relative;
  min-height: 356px;
  overflow: hidden;
  border-radius: 7px;
  background: #0f151c;
}

.driver-layout .overview-map-shell {
  min-height: 430px;
}

.overview-map-shell .overview-map,
.overview-map-shell .map-fallback,
.overview-label-layer {
  position: absolute;
  inset: 0;
}

.overview-label-layer {
  z-index: 3;
  pointer-events: none;
}

.map-loss-banner {
  position: absolute;
  min-width: 46px;
  transform: translate(7px, -95%);
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
  color: var(--text);
  padding: 4px 6px;
  text-align: left;
  font-size: 9px;
  font-weight: 900;
  pointer-events: auto;
}

.map-loss-banner::before {
  content: "";
  position: absolute;
  left: -11px;
  bottom: -10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.85),
    0 0 0 6px rgba(239, 47, 50, 0.22);
}

.map-loss-banner.is-gain::before {
  background: var(--green);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.85),
    0 0 0 6px rgba(24, 168, 68, 0.22);
}

.map-loss-banner::after {
  content: "";
  position: absolute;
  left: -4px;
  bottom: -5px;
  width: 13px;
  height: 1px;
  transform: rotate(-32deg);
  transform-origin: left center;
  background: rgba(255, 255, 255, 0.72);
}

.map-loss-banner span,
.map-loss-banner strong {
  display: block;
}

.map-loss-banner strong {
  color: var(--red);
  margin-top: 4px;
}

.map-loss-banner.is-gain strong {
  color: var(--green);
}

.map-canvas {
  position: absolute;
  inset: 0;
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: #fff;
  background: #111820;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  background: var(--panel);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.line-swatch {
  width: 26px;
  height: 3px;
  border-radius: 999px;
}

.dot-swatch {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.reference {
  background: var(--reference-color, var(--blue));
}

.comparison {
  background: var(--comparison-color, var(--red));
}

.brake {
  background: var(--red);
}

.apex {
  background: #fff;
  border: 1px solid #b9c1ca;
}

.exit {
  background: var(--green);
}

.chart-grid {
  display: grid;
  gap: 14px;
}

.telemetry-stack {
  display: grid;
  gap: 12px;
}

.chart-box {
  min-height: 192px;
  padding: 14px;
}

.report-chart-box {
  min-height: 172px;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

canvas {
  width: 100%;
  height: 150px;
  display: block;
}

.insight-card {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.insight-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-weight: 800;
}

.report-page {
  max-width: 1160px;
  margin: 0 auto;
}

.report-sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.report-top {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.report-summary {
  display: grid;
  gap: 10px;
}

.summary-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.summary-box h3 {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 11px;
  text-transform: uppercase;
}

.report-map {
  min-height: 300px;
  display: grid;
  place-items: center;
}

.report-config {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.report-config h3 {
  margin: 0 0 5px;
  font-size: 12px;
  text-transform: uppercase;
}

.channel-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.channel-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
}

.channel-toggle span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-toggle small {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.channel-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

.channel-toggle.disabled {
  opacity: 0.46;
}

.channel-section-title {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.raw-channel-list {
  max-height: 300px;
  overflow: hidden auto;
  padding-right: 4px;
}

.empty-channel-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.empty-note {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.report-charts {
  padding: 18px;
}

.engineer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 14px;
}

.driver-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) 200px;
  gap: 12px;
  margin-bottom: 14px;
}

.driver-card {
  padding: 14px;
  min-height: 78px;
}

.driver-card.active {
  background: #05070a;
  color: #fff;
}

.upload-card {
  display: grid;
  place-items: center;
  border: 1px dashed #cdd3dc;
  background: #fbfcfd;
  font-weight: 900;
}

.info-grid {
  display: grid;
  gap: 14px;
}

.info-list {
  display: grid;
  gap: 10px;
  font-size: 12px;
}

.info-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.weather-icons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  text-align: center;
}

.weather-icons strong {
  display: block;
  margin-top: 7px;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

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

.setup-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: #080c11;
}

.setup-panel {
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid #262d36;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.setup-brand-logo {
  display: block;
  width: min(300px, 78%);
  height: auto;
  margin-bottom: 4px;
}

.setup-panel h1 {
  margin: 4px 0 0;
  font-size: 28px;
}

.setup-panel p {
  margin: 0;
  line-height: 1.55;
}

.setup-panel code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #f0f2f5;
  font-size: 12px;
}

.setup-storage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  border: 1px solid #d8dee5;
  border-radius: 6px;
  background: #f5f7f9;
  color: #26313c;
  padding: 10px 12px;
}

.setup-storage span {
  color: #687480;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.setup-storage strong {
  font-size: 12px;
}

.setup-storage small {
  grid-column: 1 / -1;
  color: #a16f17;
  font-size: 10px;
}

.setup-storage.critical small,
.setup-storage.full small {
  color: #c52327;
}

.select-label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.upload-action {
  display: inline-grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.upload-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.compare-pair-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 52px minmax(280px, 1.25fr) 220px;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 14px;
}

.compare-session-card {
  min-height: 98px;
  display: grid;
  grid-template-columns: auto 56px minmax(0, 1fr) minmax(220px, 0.75fr);
  align-items: center;
  gap: 14px;
  padding: 16px;
  overflow: hidden;
}

.compare-session-card.active {
  border-color: #cfe0ff;
  background: linear-gradient(90deg, #f8fbff, #fff);
}

.session-rail {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.compare-session-card h2,
.compare-session-card p {
  margin: 0;
}

.compare-session-card h2 {
  font-size: 15px;
  margin-bottom: 8px;
}

.helmet-avatar {
  width: 56px;
  height: 56px;
  background: #090d12;
  border-color: var(--driver-color, #404a57);
}

.helmet-avatar.blue {
  background: #090d12;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.red-dot {
  background: var(--red);
}

.blue-dot {
  background: #1168ff;
}

.versus-pill {
  align-self: center;
  justify-self: center;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
}

.add-session-card {
  min-height: 98px;
  display: grid;
  place-items: center;
  border-style: dashed;
  box-shadow: none;
}

.compare-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.compare-metric {
  min-height: 108px;
  display: grid;
  gap: 10px;
  padding: 16px 18px;
}

.compare-metric span {
  color: #394452;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.compare-metric strong {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.compare-metric small {
  color: var(--muted);
  font-weight: 800;
}

.blue-text {
  color: #1168ff;
}

.compare-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(300px, 0.8fr) minmax(360px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.sector-table tbody tr {
  cursor: pointer;
}

.mini-chart {
  height: 100px;
  margin-top: 10px;
}

.lap-comparison-card {
  overflow: hidden;
}

.corner-report-page {
  min-height: calc(100vh - 36px);
  margin: -18px;
  padding: 22px;
  background: #061017;
  color: #f5f7fb;
}

.corner-report-page .card,
.corner-report-page .soft-button,
.corner-report-page .select,
.corner-report-page .report-config {
  background: #0b141d;
  border-color: #22313f;
  color: #f5f7fb;
  box-shadow: none;
}

.corner-report-page .muted,
.corner-report-page .chart-head,
.corner-report-page .report-config p {
  color: #9ca9b7;
}

.corner-topbar {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) 190px 44px 190px 150px minmax(260px, auto);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.corner-topbar p,
.corner-topbar h1 {
  margin: 0;
}

.corner-topbar p {
  color: #b0bbc8;
  text-transform: uppercase;
  font-size: 12px;
}

.corner-topbar h1 {
  margin-top: 6px;
  font-size: 21px;
}

.corner-driver-card {
  min-height: 70px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
  border: 1px solid var(--driver-color, #22313f);
  border-radius: 8px;
  background: radial-gradient(circle at 0 0, var(--driver-glow, rgba(255, 255, 255, 0.08)), #0b141d 70%);
}

.corner-driver-helmet {
  width: 38px;
  height: 38px;
  border-radius: 7px;
}

.corner-driver-card span {
  color: #d6dde6;
  font-size: 13px;
}

.corner-driver-card strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.red-card {
  border-left: 3px solid var(--driver-color, var(--red));
}

.blue-card {
  border-left: 3px solid var(--driver-color, #3974ff);
}

.vs-dot {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #2b3947;
  border-radius: 50%;
  color: #dbe4ee;
  font-size: 11px;
  font-weight: 900;
}

.time-loss {
  display: grid;
  gap: 3px;
  border-left: 1px solid #263644;
  padding-left: 20px;
}

.time-loss span,
.time-loss small {
  color: #aab6c4;
}

.time-loss strong {
  font-size: 27px;
}

.corner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.corner-report-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  gap: 14px;
}

.corner-left {
  display: grid;
  gap: 14px;
  align-self: start;
  align-content: start;
}

.corner-map-card {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  border: 1px solid #22313f;
  border-radius: 8px;
  background: #0b141d;
}

.corner-map-canvas {
  position: absolute;
  inset: 0;
}

.map-mode-tabs {
  position: absolute;
  z-index: 4;
  top: 16px;
  left: 16px;
  display: flex;
  overflow: hidden;
  border: 1px solid #22313f;
  border-radius: 7px;
}

.map-mode-tabs button,
.corner-tabs button {
  min-height: 36px;
  border: 0;
  background: rgba(10, 18, 27, 0.86);
  color: #c8d1dd;
  padding: 0 14px;
  font-weight: 800;
}

.map-mode-tabs .active,
.corner-tabs .active {
  background: #121d28;
  color: #fff;
  border-bottom: 2px solid var(--red);
}

.corner-info,
.corner-legend {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(6, 14, 22, 0.9);
  padding: 16px 18px;
}

.corner-info {
  top: 16px;
  right: 16px;
}

.corner-info span {
  color: #c8d2de;
  font-size: 13px;
}

.corner-legend {
  left: 16px;
  bottom: 16px;
  min-width: 220px;
}

.corner-legend span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.corner-bottom-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid #22313f;
  border-radius: 8px;
  background: #22313f;
}

.corner-bottom-card div {
  display: grid;
  gap: 8px;
  padding: 22px;
  background: #0b141d;
}

.corner-bottom-card span,
.corner-bottom-card small {
  color: #aab6c4;
}

.corner-bottom-card strong {
  font-size: 22px;
}

.corner-graphs-card {
  border: 1px solid #22313f;
  border-radius: 8px;
  background: #0b141d;
  overflow: hidden;
}

.corner-tabs {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid #22313f;
}

.corner-tabs .soft-button {
  margin-left: auto;
}

.corner-graph-toolbar {
  display: grid;
  grid-template-columns: 180px 180px minmax(220px, 1fr);
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid #22313f;
}

.corner-graph-toolbar label {
  display: grid;
  gap: 4px;
  color: #aab6c4;
  font-size: 12px;
  font-weight: 800;
}

.corner-graph-toolbar input {
  accent-color: var(--red);
}

.cursor-readout {
  align-self: center;
  color: #dbe3ed;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.corner-channel-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.corner-report-page .chart-box {
  background: #0b141d;
  border-color: #22313f;
}

.corner-report-page canvas {
  height: 132px;
}

.app-shell.immersive-shell {
  grid-template-columns: 1fr;
  background: #050a0f;
}

.immersive-shell .page {
  min-height: 100vh;
  padding: 0;
  overflow: hidden auto;
}

.corner-report-page {
  min-height: 100vh;
  margin: 0;
  padding: 24px 22px 36px;
  background:
    radial-gradient(circle at 48% -18%, rgba(28, 47, 62, 0.36), transparent 28%),
    linear-gradient(180deg, #071017 0%, #050a0f 100%);
  color: #f4f7fb;
}

.corner-topbar {
  grid-template-columns: 142px minmax(190px, 0.7fr) minmax(330px, 0.92fr) minmax(150px, 0.42fr) minmax(390px, auto);
  gap: 18px;
  margin-bottom: 22px;
}

.corner-topbar > * {
  min-width: 0;
}

.app-shell:not(.immersive-shell) .corner-brand {
  display: none;
}

.app-shell:not(.immersive-shell) .corner-report-page {
  min-height: calc(100vh - 36px);
  padding: 16px;
  border-radius: 8px;
}

.app-shell:not(.immersive-shell) .corner-topbar {
  grid-template-columns: minmax(170px, 0.58fr) minmax(300px, 0.95fr) minmax(126px, 0.35fr) minmax(280px, auto);
  gap: 12px;
  margin-bottom: 14px;
}

.corner-brand-logo {
  display: block;
  width: 160px;
  max-width: 100%;
  height: 56px;
  object-fit: cover;
  object-position: center;
}

.corner-title-block p {
  color: #aeb8c4;
  font-size: 12px;
}

.corner-title-block h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 24px;
}

.corner-back {
  width: max-content;
  border: 0;
  background: transparent;
  color: #dce5ef;
  padding: 0 0 5px;
  font-size: 12px;
  font-weight: 900;
}

.corner-scoreboard {
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  align-items: center;
  gap: 0;
  border: 1px solid #182431;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 32, 42, 0.92), rgba(11, 18, 25, 0.92));
  overflow: hidden;
}

.corner-score-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 16px 20px;
  background: radial-gradient(circle at 12% 0, var(--driver-glow, rgba(255, 255, 255, 0.08)), transparent 58%);
}

.corner-score-card span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #d8e0e9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corner-score-card span i,
.role-dot {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  display: inline-block;
  border-radius: 50%;
  background: var(--marker-color, var(--driver-color, var(--red)));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.role-dot.rethrottle-dot {
  box-shadow: 0 0 0 2px #ffffff;
}

.corner-score-card strong {
  color: #fff;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.corner-scoreboard .vs-dot {
  width: 34px;
  height: 34px;
  justify-self: center;
  border-radius: 50%;
  background: #0a1119;
  font-size: 11px;
  position: relative;
  z-index: 1;
}

.time-loss {
  min-height: 78px;
  align-content: center;
  border-left: 1px solid #263644;
  padding-left: 24px;
}

.corner-actions {
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: wrap;
}

.corner-actions .soft-button {
  min-height: 52px;
  padding: 0 24px;
  font-size: 14px;
  white-space: nowrap;
}

.corner-stepper {
  min-height: 52px;
  display: grid;
  grid-template-columns: 44px minmax(112px, 1fr) 44px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #22313f;
  border-radius: 8px;
  background: #0b141d;
}

.corner-stepper button,
.corner-stepper select {
  border: 0;
  background: transparent;
  color: #f4f7fb;
  font-size: 13px;
  font-weight: 900;
}

.corner-stepper button:hover {
  background: #101d29;
}

.corner-stepper select {
  min-width: 0;
  appearance: none;
  text-align: center;
  text-align-last: center;
  padding: 0 4px;
}

.corner-report-grid {
  grid-template-columns: minmax(450px, 0.88fr) minmax(620px, 1.12fr);
  gap: 16px;
  align-items: stretch;
}

.corner-map-card {
  min-height: clamp(500px, calc(100vh - 270px), 675px);
  border-color: #1d2b38;
  background: #09121a;
}

.map-mode-tabs {
  top: 18px;
  left: 18px;
  border-color: #1d2b38;
  background: rgba(6, 11, 17, 0.78);
}

.corner-info {
  display: none;
  top: 18px;
  right: 18px;
  min-width: 160px;
  max-width: 210px;
}

.corner-info,
.corner-legend {
  border-color: rgba(255, 255, 255, 0.08);
  gap: 7px;
  background: rgba(5, 12, 18, 0.76);
  padding: 10px 11px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(2px);
}

.corner-legend {
  left: 12px;
  bottom: 12px;
  min-width: 0;
  width: min(172px, calc(100% - 24px));
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px 7px;
  padding: 7px 8px;
  background: rgba(5, 12, 18, 0.62);
}

.corner-legend span {
  min-width: 0;
  color: #edf2f7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9.5px;
  gap: 5px;
}

.corner-legend b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 800;
}

.corner-legend .line-swatch {
  width: 15px;
  height: 2px;
  flex: 0 0 15px;
}

.corner-legend .role-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
}

.corner-info strong {
  font-size: 12px;
}

.corner-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.corner-legend i {
  flex: 0 0 auto;
}

.corner-bottom-card {
  min-height: 150px;
  grid-template-columns: 1fr 1fr;
  border-color: #1d2b38;
  background: #1d2b38;
}

.corner-event-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px 28px;
  background: linear-gradient(180deg, rgba(14, 24, 33, 0.96), rgba(9, 17, 24, 0.96));
}

.corner-bottom-card .corner-event-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px 28px;
  background: linear-gradient(180deg, rgba(14, 24, 33, 0.96), rgba(9, 17, 24, 0.96));
}

.corner-event-card > div {
  display: grid;
  gap: 12px;
  padding: 0;
  background: transparent;
}

.corner-bottom-card .corner-event-card > div {
  padding: 0;
  background: transparent;
}

.corner-event-card span {
  color: #c8d2de;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.corner-event-card p {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) max-content;
  gap: 7px;
  align-items: center;
  margin: 0;
  color: #e8eef5;
  white-space: nowrap;
  font-size: 13px;
}

.corner-event-card .event-driver-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  font-weight: 800;
}

.driver-name-tight .event-driver-name {
  font-size: 11.5px;
}

.driver-name-tightest .event-driver-name {
  font-size: 10px;
}

.corner-event-card p strong {
  justify-self: end;
  white-space: nowrap;
  font-size: 15px;
}

.corner-event-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid #253645;
  background: #0d1720;
}

.corner-event-icon::before {
  font-size: 24px;
  font-weight: 900;
}

.brake-icon::before {
  content: "B";
  color: var(--comparison-color, var(--red));
}

.throttle-icon::before {
  content: "T";
  color: var(--green);
}

.corner-graphs-card {
  min-height: clamp(650px, calc(100vh - 150px), 900px);
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
  align-self: start;
  border-color: #1d2b38;
  background: rgba(6, 14, 20, 0.86);
}

.corner-tabs {
  min-height: 76px;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom-color: #1d2b38;
  min-width: 0;
}

.corner-tab-list {
  display: flex;
  align-items: stretch;
  gap: 30px;
  height: 100%;
}

.corner-tab-list button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #aeb8c4;
  padding: 0;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.corner-tab-list .active {
  color: #fff;
  border-bottom-color: var(--red);
}

.corner-customize {
  position: relative;
  flex: 0 0 auto;
}

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

.zone-interest-toggle {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #263747;
  border-radius: 7px;
  background: #0b141d;
  color: #cbd5e1;
  padding: 0 12px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.zone-interest-toggle strong {
  color: #7f8a98;
  font-size: 10px;
}

.zone-interest-toggle.is-on {
  border-color: rgba(255, 196, 46, 0.45);
  color: #fff4ce;
}

.zone-interest-toggle.is-on strong {
  color: #ffce55;
}

.zone-toggle-track {
  width: 34px;
  height: 18px;
  flex: 0 0 34px;
  position: relative;
  border-radius: 999px;
  background: #34414d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.zone-toggle-track i {
  width: 12px;
  height: 12px;
  position: absolute;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #9eabb7;
  transition: transform 140ms ease, background 140ms ease;
}

.zone-interest-toggle.is-on .zone-toggle-track {
  background: rgba(255, 184, 28, 0.34);
}

.zone-interest-toggle.is-on .zone-toggle-track i {
  background: #ffca45;
  transform: translateX(16px);
}

.corner-customize summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  border: 1px solid #263747;
  border-radius: 7px;
  background: #0b141d;
  color: #dbe3ed;
  padding: 0 15px;
  font-weight: 800;
  cursor: pointer;
}

.corner-customize summary::-webkit-details-marker {
  display: none;
}

.corner-customize summary span {
  color: #9ea9b5;
  font-size: 11px;
}

.corner-customize .report-config {
  position: absolute;
  top: 54px;
  right: 0;
  z-index: 12;
  width: min(360px, calc(100vw - 120px));
  max-height: min(620px, calc(100vh - 150px));
  overflow: hidden auto;
  background: #0b141d;
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.4);
}

.corner-graph-stack {
  display: grid;
  grid-auto-rows: minmax(132px, 1fr);
  padding: 0 26px 24px;
}

.corner-graph-row {
  min-height: 132px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 150px;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid #1d2b38;
}

.corner-graph-row:last-child {
  border-bottom: 0;
}

.corner-graph-label {
  display: grid;
  gap: 6px;
  color: #cfd8e2;
  font-weight: 900;
  text-transform: uppercase;
}

.corner-graph-label span {
  color: #a6b1bd;
  text-transform: none;
}

.corner-graph-canvas {
  min-width: 0;
  height: calc(100% - 22px);
  cursor: crosshair;
}

.corner-graph-canvas canvas {
  height: 100%;
  min-height: 112px;
}

.corner-graph-side {
  display: grid;
  gap: 6px;
  align-content: center;
  color: #c8d2de;
  font-size: 13px;
  font-weight: 800;
  min-width: 0;
}

.corner-graph-side span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corner-graph-side strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.zone-graph-summary {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 2px 6px;
  color: #ffe5a1;
  font-size: 11px;
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.zone-graph-summary i {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border: 1px solid rgba(255, 222, 126, 0.8);
  background: rgba(255, 196, 46, 0.32);
}

.zone-graph-summary b,
.zone-graph-summary strong {
  grid-column: 2;
  min-width: 0;
  color: #ffe5a1;
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;
}

.zone-graph-summary strong {
  color: #ffca45;
  font-variant-numeric: tabular-nums;
}

.graph-side-placeholder,
.graph-side-distance {
  color: #94a3b2;
  font-size: 11px;
  text-transform: uppercase;
}

.graph-side-driver {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) max-content;
  gap: 5px;
  align-items: center;
}

.graph-side-driver i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--side-color, #fff);
}

.graph-side-driver b {
  min-width: 0;
  overflow: hidden;
  color: #dbe5ef;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.graph-side-driver strong {
  color: var(--side-color, #fff);
  font-size: 12px;
  white-space: nowrap;
}

.legend-line {
  width: 28px;
  height: 3px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 999px;
  background: var(--legend-color, #fff);
}

.legend-line.dashed {
  height: 0;
  border-top: 2px dashed var(--legend-color, #fff);
  background: transparent;
}

@media (max-width: 1440px) and (min-width: 901px) {
  .corner-report-page {
    padding: 16px;
  }

  .app-shell:not(.immersive-shell) .corner-report-page {
    padding: 12px;
  }

  .corner-topbar {
    grid-template-columns: 96px minmax(170px, 0.62fr) minmax(300px, 0.9fr) minmax(128px, 0.35fr) minmax(320px, auto);
    gap: 12px;
    margin-bottom: 14px;
  }

  .app-shell:not(.immersive-shell) .corner-topbar {
    grid-template-columns: minmax(150px, 0.54fr) minmax(275px, 0.94fr) minmax(110px, 0.32fr) minmax(240px, auto);
    gap: 10px;
    margin-bottom: 12px;
  }

  .corner-brand .brand-mark {
    font-size: 20px;
  }

  .corner-title-block h1 {
    font-size: 20px;
  }

  .corner-title-block p,
  .corner-back {
    font-size: 11px;
  }

  .corner-scoreboard {
    min-height: 70px;
  }

  .corner-score-card {
    gap: 5px;
    padding: 12px 14px;
  }

  .corner-score-card strong {
    font-size: 20px;
  }

  .corner-score-card span {
    font-size: 12px;
  }

  .time-loss {
    min-height: 64px;
    padding-left: 14px;
  }

  .time-loss strong {
    font-size: 22px;
  }

  .corner-actions .soft-button,
  .corner-stepper {
    min-height: 46px;
  }

  .app-shell:not(.immersive-shell) .corner-actions .soft-button,
  .app-shell:not(.immersive-shell) .corner-stepper {
    min-height: 42px;
    font-size: 12px;
  }

  .app-shell:not(.immersive-shell) .corner-actions .soft-button {
    padding: 0 14px;
  }

  .app-shell:not(.immersive-shell) .corner-stepper {
    grid-template-columns: 36px minmax(86px, 1fr) 36px;
  }

  .corner-actions {
    gap: 8px;
  }

  .corner-report-grid {
    grid-template-columns: minmax(390px, 0.86fr) minmax(560px, 1.14fr);
    gap: 12px;
  }

  .app-shell:not(.immersive-shell) .corner-report-grid {
    grid-template-columns: minmax(330px, 0.78fr) minmax(500px, 1.22fr);
    gap: 10px;
  }

  .corner-map-card {
    min-height: 455px;
  }

  .app-shell:not(.immersive-shell) .corner-map-card {
    min-height: 420px;
  }

  .corner-bottom-card {
    min-height: 118px;
  }

  .app-shell:not(.immersive-shell) .corner-bottom-card {
    min-height: 110px;
  }

  .corner-event-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 18px;
  }

  .corner-bottom-card .corner-event-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 18px;
  }

  .app-shell:not(.immersive-shell) .corner-event-card,
  .app-shell:not(.immersive-shell) .corner-bottom-card .corner-event-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 14px;
  }

  .app-shell:not(.immersive-shell) .corner-event-icon {
    display: none;
  }

  .corner-event-card > div {
    gap: 8px;
  }

  .corner-event-card span {
    white-space: nowrap;
    font-size: 11px;
  }

  .corner-event-card p {
    grid-template-columns: 14px minmax(0, 1fr) max-content;
    gap: 5px;
    font-size: 11.5px;
  }

  .app-shell:not(.immersive-shell) .corner-event-card p {
    grid-template-columns: 12px minmax(0, 1fr) max-content;
    font-size: 10.8px;
  }

  .driver-name-tight .event-driver-name {
    font-size: 10px;
  }

  .driver-name-tightest .event-driver-name {
    font-size: 9px;
  }

  .corner-event-card p strong {
    font-size: 12px;
  }

  .corner-event-card .role-dot {
    width: 10px;
    height: 10px;
    flex-basis: 10px;
  }

  .corner-graphs-card {
    min-height: 0;
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .corner-tabs {
    min-height: 58px;
    padding: 0 16px;
    gap: 12px;
  }

  .corner-tab-list {
    gap: 18px;
  }

  .corner-tab-list button {
    font-size: 12px;
  }

  .corner-customize summary {
    min-height: 42px;
    padding: 0 12px;
    font-size: 12px;
  }

  .zone-interest-toggle {
    min-height: 42px;
    padding: 0 10px;
    font-size: 11px;
  }

  .zone-interest-toggle strong {
    display: none;
  }

  .corner-graph-stack {
    grid-auto-rows: 135px;
    padding: 0 18px 16px;
  }

  .app-shell:not(.immersive-shell) .corner-graph-stack {
    grid-auto-rows: 125px;
    padding: 0 14px 12px;
  }

  .corner-graph-row {
    height: 135px;
    min-height: 0;
    grid-template-columns: 92px minmax(0, 1fr) 132px;
    gap: 12px;
  }

  .app-shell:not(.immersive-shell) .corner-graph-row {
    height: 125px;
    grid-template-columns: 74px minmax(0, 1fr) 98px;
    gap: 9px;
  }

  .corner-graph-canvas {
    align-self: center;
    height: 106px;
    overflow: hidden;
  }

  .corner-graph-canvas canvas {
    height: 106px;
    min-height: 0;
  }

  .app-shell:not(.immersive-shell) .corner-graph-canvas,
  .app-shell:not(.immersive-shell) .corner-graph-canvas canvas {
    height: 98px;
  }

  .corner-graph-label {
    font-size: 11px;
  }

  .corner-graph-label span,
  .corner-graph-side {
    font-size: 10px;
  }

  .corner-graph-side strong {
    font-size: 22px;
  }

  .app-shell:not(.immersive-shell) .corner-graph-side strong {
    font-size: 18px;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .brand-sub,
  .nav-label,
  .sidebar-footer {
    display: none;
  }

  .brand {
    padding: 0 12px;
  }

  .brand-mark {
    font-size: 18px;
  }

  .nav-button {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }
}

@media (max-width: 900px) {
  .grid-kpis,
  .two-col,
  .driver-layout,
  .segment-layout,
  .engineer-grid,
  .driver-cards,
  .report-top,
  .compare-pair-row,
  .compare-metrics-row,
  .compare-dashboard-grid,
  .corner-topbar,
  .corner-report-grid,
  .corner-channel-layout,
  .corner-graph-toolbar {
    grid-template-columns: 1fr;
  }

  .compare-session-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .compare-session-card .select,
  .session-rail,
  .versus-pill {
    grid-column: 1 / -1;
  }

  .corner-report-page {
    margin: -18px;
    padding: 14px;
  }

  .corner-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .corner-map-card {
    min-height: 460px;
  }

  .search {
    min-width: 0;
    width: 100%;
  }

  .page-header,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.comparison-analysis-head {
  min-width: 0;
  flex-wrap: wrap;
}

.sector-panel-actions,
.sector-driver-legend,
.sector-selector-card,
.sector-graph-metric {
  display: flex;
  align-items: center;
}

.sector-panel-actions {
  min-width: 0;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.sector-driver-legend {
  gap: 6px;
  color: #d5dde6;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.sector-driver-legend i {
  width: 18px;
  height: 2px;
  display: inline-block;
  background: var(--legend-color);
}

.sector-source-badge {
  border: 1px solid rgba(43, 140, 255, 0.42);
  border-radius: 4px;
  background: rgba(31, 110, 219, 0.12);
  color: #9cc9ff !important;
  padding: 4px 7px;
  font-size: 9px !important;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.sector-source-badge.estimated {
  border-color: rgba(255, 178, 28, 0.46);
  background: rgba(255, 178, 28, 0.1);
  color: #ffd27b !important;
}

.sector-corner-action {
  min-height: 34px;
  border: 1px solid #2b7eff;
  border-radius: 6px;
  background: #1769e8;
  color: #fff;
  padding: 0 12px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.sector-corner-action b {
  margin-left: 7px;
  font-size: 15px;
}

.sector-analysis-widget {
  min-height: 420px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #080f15;
}

.sector-selector-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid #202a34;
  background: #090f15;
}

.sector-selector-card {
  position: relative;
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-content: center;
  column-gap: 7px;
  border: 1px solid #1f2934;
  border-radius: 5px;
  background: #0a1117;
  color: #f0f4f8;
  padding: 7px 9px;
  text-align: left;
}

.sector-selector-card:hover {
  border-color: #31516f;
  background: #0d1822;
}

.sector-selector-card.active {
  border-color: #1f7cff;
  background: linear-gradient(180deg, rgba(14, 72, 137, 0.58), rgba(8, 31, 54, 0.82));
  box-shadow: inset 0 0 0 1px rgba(50, 145, 255, 0.14);
}

.sector-selector-card i {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 7px;
  height: 7px;
  align-self: start;
  margin-top: 4px;
  border-right: 1px solid #74808c;
  border-bottom: 1px solid #74808c;
  transform: rotate(45deg);
}

.sector-selector-card.active i {
  border-color: #43a1ff;
}

.sector-selector-card span,
.sector-selector-card small,
.sector-selector-card strong {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sector-selector-card span {
  color: #f4f7fb;
  font-size: 11px;
  font-weight: 900;
}

.sector-selector-card small {
  color: #a6b1bc;
  font-size: 9px;
}

.sector-selector-card strong {
  margin-top: 2px;
  color: #cbd4dd;
  font-size: 9px;
  font-weight: 700;
}

.sector-telemetry-stack {
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(4, minmax(70px, 1fr));
  padding: 6px 8px 0;
}

.sector-graph-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 88px;
  align-items: stretch;
  border-bottom: 1px solid #1b2630;
}

.sector-graph-row:last-child {
  border-bottom: 0;
}

.sector-graph-label {
  align-self: center;
  display: grid;
  gap: 2px;
  color: #f0f4f8;
  font-size: 9px;
  text-transform: uppercase;
}

.sector-graph-label strong {
  font-size: 10px;
}

.sector-graph-label span {
  color: #a7b3bf;
  font-size: 8px;
}

.sector-graph-row:nth-child(3) .sector-graph-label strong {
  color: #43d56b;
}

.sector-graph-canvas {
  min-width: 0;
  min-height: 0;
}

.sector-graph-canvas canvas {
  width: 100%;
  height: 100%;
  min-height: 70px;
  display: block;
}

.sector-graph-metric {
  min-width: 0;
  align-content: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  border-left: 1px solid #17212a;
  padding: 4px 6px;
  text-align: center;
}

.sector-graph-metric strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sector-graph-metric span {
  color: #aeb8c3;
  font-size: 8px;
  font-weight: 800;
}

.sector-distance-caption {
  color: #aeb8c3;
  padding: 2px 96px 8px 80px;
  font-size: 8px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

@media (min-width: 1600px) {
  .sector-analysis-widget {
    min-height: 440px;
  }

  .sector-selector-card {
    min-height: 74px;
  }

  .sector-graph-row {
    grid-template-columns: 84px minmax(0, 1fr) 102px;
  }
}

@media (max-width: 1360px) {
  .sector-panel-actions {
    gap: 8px;
  }

  .sector-driver-legend,
  .sector-source-badge {
    display: none;
  }
}

@media (max-width: 760px) {
  .comparison-analysis-head {
    align-items: flex-start;
  }

  .session-tabs {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .sector-panel-actions {
    width: 100%;
  }

  .sector-selector-strip {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 142px;
    overflow-x: auto;
  }

  .sector-graph-row {
    grid-template-columns: 62px minmax(240px, 1fr) 72px;
  }

  .sector-telemetry-stack {
    overflow-x: auto;
  }

  .sector-distance-caption {
    min-width: 374px;
    padding-right: 78px;
    padding-left: 68px;
  }
}

/* Account settings */
.settings-page {
  min-height: calc(100vh - 36px);
  margin: -18px;
  padding: 26px 30px 30px;
  background:
    linear-gradient(135deg, rgba(10, 17, 24, 0.98), rgba(4, 8, 12, 0.99)),
    #060a0e;
  color: #f2f5f8;
}

.settings-topbar,
.settings-context,
.settings-panel-head,
.settings-form-actions,
.settings-secondary-button,
.settings-status-field strong {
  display: flex;
  align-items: center;
}

.settings-topbar {
  min-height: 64px;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.settings-topbar h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.settings-topbar p,
.settings-panel-head p {
  margin: 6px 0 0;
  color: #9ca7b3;
}

.settings-context {
  gap: 10px;
}

.settings-context > span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #27313c;
  border-radius: 7px;
  background: #0c1319;
  color: #c9d1da;
  padding: 0 12px;
  font-size: 12px;
  white-space: nowrap;
}

.settings-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  color: currentColor;
}

.settings-notice {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  border: 1px solid rgba(36, 188, 91, 0.34);
  border-radius: 7px;
  background: rgba(20, 122, 57, 0.12);
  color: #72dc97;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 800;
}

.settings-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.settings-section-nav,
.settings-panel {
  border: 1px solid #242e39;
  border-radius: 8px;
  background: rgba(13, 20, 27, 0.96);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.22);
}

.settings-section-nav {
  min-height: 690px;
  align-content: start;
  display: grid;
  gap: 4px;
  padding: 16px;
}

.settings-section-nav button {
  min-width: 0;
  min-height: 70px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #c8d0d9;
  padding: 10px 14px;
  text-align: left;
}

.settings-section-nav button:hover {
  background: #111a23;
  color: #fff;
}

.settings-section-nav button.active {
  border-left-color: var(--red);
  background: linear-gradient(90deg, rgba(239, 47, 50, 0.13), rgba(21, 29, 38, 0.94));
  color: var(--red);
}

.settings-section-nav button > span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.settings-section-nav strong {
  color: inherit;
  font-size: 14px;
}

.settings-section-nav small {
  color: #929da9;
  font-size: 12px;
}

.settings-panel {
  min-width: 0;
  min-height: 690px;
  padding: 30px 34px;
}

.settings-panel-head {
  min-height: 58px;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.settings-panel-head h2 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  letter-spacing: 0;
}

.settings-save-button,
.settings-secondary-button,
.settings-security-list button {
  min-height: 42px;
  border: 1px solid #303b47;
  border-radius: 7px;
  background: #0c131a;
  color: #f4f6f8;
  padding: 0 16px;
  font-weight: 800;
}

.settings-save-button {
  border-color: rgba(239, 47, 50, 0.64);
  color: #ff5558;
}

.settings-save-button:hover,
.settings-secondary-button:hover {
  border-color: var(--red);
  background: rgba(239, 47, 50, 0.1);
}

.settings-profile-lead {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.settings-avatar {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 1px solid #394552;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #17212b, #0a1016 68%);
  color: #fff;
  font-size: 36px;
  font-weight: 400;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.01);
}

.settings-lead-fields {
  display: grid;
  gap: 16px;
}

.settings-divider {
  height: 1px;
  margin: 26px 0;
  background: #222d37;
}

.settings-profile-form h3 {
  margin: 0 0 22px;
  color: #e8edf2;
  font-size: 14px;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.settings-field,
.settings-status-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: #b5bec8;
  font-size: 12px;
}

.settings-field.wide {
  grid-column: 1 / -1;
}

.settings-field input,
.settings-field select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid #2b3540;
  border-radius: 6px;
  outline: 0;
  background: #0b1218;
  color: #f0f3f6;
  padding: 0 12px;
}

.settings-field input:focus,
.settings-field select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(239, 47, 50, 0.1);
}

.settings-field small {
  color: #7f8b97;
  font-size: 11px;
}

.settings-stats,
.settings-data-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
  border: 1px solid #29343f;
  border-radius: 7px;
  background: #0a1117;
}

.settings-stats > div,
.settings-data-summary > div {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-right: 1px solid #29343f;
}

.settings-stats > div:last-child,
.settings-data-summary > div:last-child {
  border-right: 0;
}

.settings-stats span,
.settings-data-summary span {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.settings-stats small,
.settings-data-summary small {
  color: #99a4af;
  font-size: 11px;
}

.settings-stats strong,
.settings-data-summary strong {
  color: #f5f7f9;
  font-size: 14px;
}

.settings-account-form {
  display: grid;
  gap: 26px;
}

.settings-status-field strong {
  min-height: 42px;
  gap: 9px;
  border: 1px solid #2b3540;
  border-radius: 6px;
  background: #0b1218;
  color: #d7dee6;
  padding: 0 12px;
}

.settings-status-field .settings-icon {
  width: 17px;
  height: 17px;
}

.settings-security-list,
.settings-detail-list {
  display: grid;
  border-top: 1px solid #27323d;
}

.settings-security-list > div,
.settings-detail-list > div {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #27323d;
  color: #dce2e8;
  padding: 12px 4px;
}

.settings-security-list > div > span {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 3px 10px;
}

.settings-security-list > div > span .settings-icon {
  grid-row: 1 / 3;
}

.settings-security-list small {
  color: #8f9aa6;
}

.settings-security-list button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.settings-status-badge {
  border: 1px solid rgba(32, 196, 92, 0.34);
  border-radius: 999px;
  background: rgba(24, 168, 68, 0.1);
  color: #69d88f;
  padding: 6px 10px;
  font-size: 11px;
}

.settings-form-actions {
  justify-content: flex-end;
  gap: 10px;
}

.settings-notification-form {
  display: grid;
}

.settings-toggle-row {
  position: relative;
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #27323d;
  cursor: pointer;
}

.settings-toggle-row > span {
  display: grid;
  gap: 7px;
}

.settings-toggle-row strong {
  color: #edf1f5;
  font-size: 14px;
}

.settings-toggle-row small {
  color: #8e99a5;
  font-size: 12px;
}

.settings-toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-toggle-row > i {
  position: relative;
  width: 44px;
  height: 24px;
  border: 1px solid #394551;
  border-radius: 999px;
  background: #111921;
  transition: 160ms ease;
}

.settings-toggle-row > i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #89949f;
  transition: 160ms ease;
}

.settings-toggle-row input:checked + i {
  border-color: var(--red);
  background: rgba(239, 47, 50, 0.3);
}

.settings-toggle-row input:checked + i::after {
  left: 23px;
  background: #fff;
}

.settings-theme-field {
  width: min(520px, 100%);
  display: grid;
  gap: 10px;
}

.settings-theme-field > span {
  color: #b5bec8;
  font-size: 12px;
}

.settings-theme-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid #2b3540;
  border-radius: 8px;
  background: #0a1117;
  padding: 4px;
}

.settings-theme-option {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #929da9;
  font-weight: 800;
}

.settings-theme-option .settings-icon {
  width: 20px;
  height: 20px;
}

.settings-theme-option:hover {
  color: #f4f7fb;
  background: #111a23;
}

.settings-theme-option.active {
  border-color: #394652;
  background: #17212a;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.settings-data-summary {
  margin: 0 0 28px;
}

.settings-detail-list > div > span {
  color: #9da8b3;
}

.settings-detail-list > .settings-storage-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
}

.settings-storage-meter {
  grid-column: 1 / -1;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: #26313b;
}

.settings-storage-meter b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
}

.privacy-actions {
  margin-top: 24px;
}

.settings-secondary-button {
  gap: 9px;
}

.settings-secondary-button .settings-icon {
  width: 17px;
  height: 17px;
}

.settings-about-brand {
  min-height: 160px;
  display: grid;
  place-content: center;
  margin-bottom: 24px;
  border: 1px solid #29343f;
  border-radius: 7px;
  background: radial-gradient(circle at center, rgba(239, 47, 50, 0.08), transparent 62%), #0a1117;
  text-align: center;
}

.settings-about-logo {
  display: block;
  width: min(400px, 82%);
  height: 132px;
  object-fit: cover;
  object-position: center;
  margin: 0 auto;
}

.settings-about-brand .brand-mark {
  font-size: 34px;
}

.settings-about-brand .brand-sub {
  font-size: 12px;
}

@media (max-width: 1600px) {
  .settings-page {
    padding: 22px 24px 26px;
  }

  .settings-layout {
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .settings-section-nav,
  .settings-panel {
    min-height: 620px;
  }

  .settings-panel {
    padding: 24px 28px;
  }

  .settings-section-nav button {
    min-height: 62px;
  }
}

@media (max-width: 1180px) {
  .settings-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .settings-section-nav {
    padding: 10px;
  }

  .settings-section-nav button {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 9px;
  }

  .settings-section-nav small {
    display: none;
  }

  .settings-profile-lead {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 20px;
  }

  .settings-avatar {
    width: 104px;
    height: 104px;
    font-size: 29px;
  }

  .settings-stats > div,
  .settings-data-summary > div {
    padding: 15px;
  }
}

@media (max-width: 900px) {
  .settings-page {
    margin: -18px;
    padding: 18px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-section-nav {
    min-height: 0;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    grid-template-columns: none;
    overflow-x: auto;
  }

  .settings-section-nav button {
    min-height: 58px;
  }

  .settings-panel {
    min-height: 560px;
  }
}

@media (max-width: 700px) {
  .settings-topbar,
  .settings-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-context {
    width: 100%;
    overflow-x: auto;
  }

  .settings-panel {
    padding: 20px;
  }

  .settings-profile-lead,
  .settings-form-grid,
  .settings-stats,
  .settings-data-summary {
    grid-template-columns: 1fr;
  }

  .settings-avatar {
    justify-self: start;
  }

  .settings-stats > div,
  .settings-data-summary > div {
    border-right: 0;
    border-bottom: 1px solid #29343f;
  }

  .settings-stats > div:last-child,
  .settings-data-summary > div:last-child {
    border-bottom: 0;
  }
}

/* The generic helmet avatar is 56px; the sidebar profile uses a compact fixed size. */
.sidebar-footer {
  min-height: 64px;
  padding: 11px 10px;
}

.user-chip {
  width: 100%;
  min-height: 40px;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
}

.user-chip .sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 7px;
}

.user-chip > div:not(.avatar) {
  gap: 3px;
  align-content: center;
}

.user-chip .user-name {
  font-size: 11px;
  line-height: 1.15;
}

.user-chip .user-role {
  font-size: 10px;
  line-height: 1.15;
}

@media (max-width: 1600px) and (min-width: 901px) {
  .session-hero-card.session-a {
    grid-column: 1;
  }

  .session-vs {
    grid-column: 2;
  }

  .session-hero-card.session-b {
    grid-column: 3;
  }
}

.overview-page {
  min-height: calc(100vh - 36px);
  margin: -18px;
  padding: 22px 28px;
  color: #f4f7fb;
  background:
    linear-gradient(180deg, rgba(17, 28, 34, 0.96), rgba(6, 10, 14, 0.98)),
    #070b10;
}

.overview-topbar,
.overview-actions,
.overview-panel-head,
.overview-tabs,
.recent-session-grid {
  display: flex;
  align-items: center;
}

.overview-topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.overview-topbar p {
  margin: 0 0 6px;
  color: #a5acb6;
}

.overview-topbar h1 {
  margin: 0;
  font-size: 24px;
}

.overview-actions {
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.overview-select,
.overview-panel-head select {
  min-height: 42px;
  min-width: 190px;
  border: 1px solid #25313d;
  border-radius: 7px;
  background: #0f171d;
  color: #f5f7fa;
  padding: 0 14px;
  font-weight: 800;
}

.overview-menu {
  width: 36px;
  height: 42px;
  border: 0;
  background: transparent;
  color: #aeb6c0;
  font-size: 20px;
}

.overview-kpis {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(220px, 1.25fr) minmax(260px, 1.55fr);
  gap: 12px;
  margin-bottom: 12px;
}

.overview-card {
  border: 1px solid #202a34;
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    #0b1217;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.overview-kpi {
  min-height: 132px;
  padding: 18px;
  display: grid;
  gap: 8px;
}

.overview-kpi span,
.overview-session-stats span,
.overview-panel-head h2 {
  color: #c9d0d8;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-kpi strong {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
}

.overview-kpi small,
.overview-best-lap em {
  color: #c0c7cf;
  font-style: normal;
}

.overview-best-lap {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.overview-best-lap span,
.overview-best-lap small {
  grid-column: 1 / -1;
}

.overview-session-stats {
  padding: 12px 22px;
  display: grid;
}

.overview-session-stats div {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #202a34;
}

.overview-session-stats div:last-child {
  border-bottom: 0;
}

.overview-session-stats strong {
  font-size: 18px;
}

.overview-main-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(260px, 0.72fr) minmax(420px, 1.45fr);
  gap: 12px;
  margin-bottom: 12px;
}

.overview-panel-head {
  min-height: 52px;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #202a34;
}

.overview-panel-head h2 {
  margin: 0;
}

.overview-page .soft-button {
  border-color: #293440;
  background: #101820;
  color: #f2f5f8;
  box-shadow: none;
}

.overview-track-card {
  overflow: hidden;
}

.overview-track-card .overview-map-shell {
  min-height: 420px;
  border-radius: 0;
}

.overview-delta-card {
  min-height: 472px;
}

.overview-bars {
  padding: 14px 16px 18px;
}

.overview-bars .bar-row {
  min-height: 34px;
  color: #f1f4f7;
}

.overview-bars .bar-track {
  background: #18222b;
}

.overview-graphs-card {
  overflow: hidden;
}

.overview-tabs {
  gap: 22px;
}

.overview-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #aeb7c2;
  padding: 10px 0;
  font-weight: 900;
}

.overview-tabs .active {
  color: #fff;
  border-bottom-color: var(--red);
}

.overview-graph-stack {
  padding: 14px 18px 18px;
  display: grid;
  gap: 10px;
}

.overview-graph-stack canvas {
  width: 100%;
  height: 92px;
  border-bottom: 1px solid #202a34;
}

.overview-graph-stack canvas:last-child {
  border-bottom: 0;
}

.recent-sessions-panel {
  padding-bottom: 16px;
}

.recent-session-grid {
  gap: 12px;
  padding: 0 16px;
  overflow-x: auto;
}

.recent-session-card {
  min-width: 190px;
  min-height: 86px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  align-content: center;
  border: 1px solid #26323d;
  border-radius: 8px;
  background: #10181f;
  color: #eef3f7;
  padding: 14px;
  text-align: left;
}

.recent-session-card.active {
  border-color: var(--red);
}

.recent-session-card strong,
.recent-session-card span,
.recent-session-card small {
  grid-column: 1;
}

.recent-session-card span,
.recent-session-card small {
  color: #aeb6c0;
}

.recent-session-card em {
  grid-row: 2 / 4;
  grid-column: 2;
  align-self: end;
  color: var(--red);
  font-style: normal;
  font-size: 18px;
}

.recent-session-card.add {
  min-width: 190px;
  place-items: center;
  grid-template-columns: 1fr;
  border-style: dashed;
  text-align: center;
}

.recent-session-card.add b {
  font-size: 30px;
  line-height: 1;
  font-weight: 300;
}

.overview-page {
  background:
    radial-gradient(circle at 22% 8%, rgba(35, 88, 100, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(8, 15, 20, 0.99), rgba(4, 7, 10, 0.99)),
    #05080c;
}

.overview-topbar h1 {
  font-size: 28px;
}

.overview-location-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c1c9d4;
  font-size: 13px;
}

.overview-location-chip .overview-icon {
  width: 18px;
  height: 18px;
}

.overview-page .icon-button {
  width: 38px;
  height: 38px;
  border-color: #293440;
  background: #101820;
  color: #f2f5f8;
}

.overview-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(280px, 1.28fr);
  gap: 16px;
  margin-bottom: 18px;
}

.overview-kpi-card {
  min-height: 154px;
  position: relative;
  padding: 22px;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: hidden;
}

.overview-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f2f6fa;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-card-title .overview-icon {
  width: 26px;
  height: 26px;
}

.overview-icon {
  width: 24px;
  height: 24px;
}

.overview-kpi-card strong {
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.overview-kpi-card small {
  color: #aeb8c3;
  line-height: 1.4;
}

.overview-kpi-card.has-spark {
  padding-bottom: 48px;
}

.overview-kpi-spark {
  position: absolute;
  right: 22px;
  bottom: 13px;
  left: 22px;
  width: auto;
  height: 24px;
  margin: 0;
  opacity: 0.92;
}

.overview-performance-card {
  min-height: 154px;
  padding: 18px 20px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.overview-performance-card .overview-card-title {
  font-size: 12px;
}

.overview-performance-card .overview-card-title .overview-icon {
  width: 22px;
  height: 22px;
}

.overview-score-list {
  min-height: 0;
  display: grid;
  align-content: space-between;
  gap: 5px;
}

.overview-score-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(88px, 0.9fr) minmax(54px, 1fr) 34px 12px;
  gap: 7px;
  align-items: center;
  color: #dce3ea;
  font-size: 10px;
}

.overview-score-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-score-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #26313a;
}

.overview-score-track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #ef2f32;
}

.overview-score-row strong {
  color: #f3f6f9;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.overview-score-row em {
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.overview-score-row em.up {
  color: #2fd36b;
}

.overview-score-row em.down {
  color: #ef2f32;
}

.overview-score-row em.unknown {
  color: #84909c;
}

.overview-track-mini {
  position: absolute;
  right: 20px;
  bottom: 18px;
  width: 116px;
  height: 82px;
  opacity: 0.9;
}

.track-asset-mini {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.track-asset-mini .library-track-svg,
.track-asset-mini .track-layout-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.overview-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.6fr) minmax(360px, 0.9fr);
  gap: 18px;
}

.overview-trend-card {
  min-height: 318px;
  overflow: hidden;
}

.overview-trend-card canvas {
  width: 100%;
  height: 254px;
  display: block;
}

.overview-panel-actions {
  display: flex;
  gap: 10px;
}

.overview-panel-actions select {
  min-height: 36px;
  min-width: 150px;
  border: 1px solid #26323d;
  border-radius: 7px;
  background: #101820;
  color: #f2f5f8;
  padding: 0 12px;
}

.overview-weather-card {
  min-height: 318px;
}

.weather-body {
  display: grid;
  grid-template-columns: minmax(170px, 0.86fr) minmax(180px, 1fr);
  gap: 24px;
  padding: 22px 24px 10px;
}

.weather-main {
  display: grid;
  align-content: start;
  gap: 6px;
  border-right: 1px solid #283440;
  padding-right: 22px;
}

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

.weather-actions .soft-button {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.weather-location {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 900;
}

.weather-location .overview-icon {
  width: 18px;
  height: 18px;
}

.weather-main small,
.weather-main em,
.weather-metric span,
.weather-source {
  color: #9ea9b5;
  font-style: normal;
}

.weather-main strong {
  margin-top: 18px;
  font-size: 58px;
  line-height: 0.95;
  font-weight: 300;
  letter-spacing: 0;
}

.weather-main > span {
  font-size: 18px;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 18px;
}

.weather-metric {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
}

.weather-metric .overview-icon {
  grid-row: 1 / 3;
  width: 24px;
  height: 24px;
}

.weather-metric strong {
  font-size: 16px;
  font-weight: 900;
}

.weather-source {
  margin: 0;
  padding: 0 24px 16px;
  text-align: right;
  font-size: 11px;
}

.overview-recent-card,
.overview-quick-card {
  min-height: 326px;
}

.overview-recent-card {
  min-width: 0;
  overflow: hidden;
}

.overview-recent-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.overview-recent-actions .soft-button {
  min-height: 34px;
  padding: 0 13px;
}

.overview-recent-nav {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #293440;
  border-radius: 6px;
  background: #101820;
  color: #dce3ea;
  padding: 0;
}

.overview-recent-nav span {
  margin-top: -2px;
  font-size: 24px;
  line-height: 1;
}

.overview-recent-nav:hover:not(:disabled) {
  border-color: #53606d;
  background: #17212a;
  color: #fff;
}

.overview-recent-nav:disabled {
  cursor: default;
  opacity: 0.34;
}

.overview-recent-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 12px 12px 16px;
}

.overview-recent-carousel::-webkit-scrollbar {
  display: none;
}

.overview-recent-session-card {
  position: relative;
  flex: 0 0 clamp(148px, calc((100% - 48px) / 5), 190px);
  min-width: 0;
  min-height: 244px;
  display: grid;
  grid-template-rows: 82px auto auto auto auto auto 1fr;
  align-content: start;
  scroll-snap-align: start;
  overflow: hidden;
  border: 1px solid #293541;
  border-radius: 7px;
  background:
    radial-gradient(circle at 88% 108%, rgba(239, 47, 50, 0.22), transparent 42%),
    linear-gradient(160deg, rgba(19, 29, 38, 0.98), rgba(9, 15, 21, 0.99));
  color: #f2f5f8;
  padding: 9px 10px 0;
  text-align: left;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  transition:
    border-color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.overview-recent-session-card:hover {
  border-color: #556371;
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
}

.overview-recent-session-card:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.overview-recent-track-art {
  position: relative;
  min-width: 0;
  height: 68px;
  display: grid;
  place-items: center;
  padding: 2px 6px 5px;
}

.overview-recent-track-art img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  display: block;
  object-fit: contain;
  filter:
    brightness(0)
    invert(1)
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.55))
    drop-shadow(0 5px 8px rgba(0, 0, 0, 0.36));
  opacity: 0.88;
}

.overview-recent-track-fallback {
  display: none;
  place-items: center;
}

.overview-recent-track-art.fallback .overview-recent-track-fallback,
.overview-recent-session-card > .overview-recent-track-fallback {
  display: grid;
}

.overview-recent-track-fallback .overview-icon {
  width: 48px;
  height: 48px;
  opacity: 0.65;
}

.overview-recent-track-name,
.overview-recent-driver,
.overview-recent-car {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-recent-track-name {
  margin-top: 2px;
  color: #f5f7f9;
  font-size: 12px;
  font-weight: 900;
}

.overview-recent-driver {
  margin-top: 5px;
  color: #9faab5;
  font-size: 10px;
}

.overview-recent-best-lap {
  margin-top: 5px;
  color: #fff;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.05;
}

.overview-recent-car {
  margin-top: 5px;
  color: #aab4be;
  font-size: 10px;
}

.overview-recent-type {
  width: max-content;
  max-width: 100%;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(128, 139, 151, 0.18);
  color: #cbd3dc;
  padding: 4px 8px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-recent-type.race {
  background: rgba(239, 47, 50, 0.22);
  color: #ff898b;
}

.overview-recent-type.qualifying {
  background: rgba(45, 125, 255, 0.2);
  color: #83b6ff;
}

.overview-recent-type.practice {
  background: rgba(139, 148, 158, 0.2);
  color: #d0d6dd;
}

.overview-recent-type.test {
  background: rgba(24, 168, 68, 0.2);
  color: #78db94;
}

.overview-recent-date {
  min-width: 0;
  align-self: end;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 5px;
  margin: 9px -10px 0;
  border-top: 1px solid rgba(113, 126, 139, 0.18);
  color: #b9c2cc;
  padding: 8px 9px;
  font-size: 8px;
  white-space: nowrap;
}

.overview-recent-calendar {
  width: 12px;
  height: 12px;
  opacity: 0.86;
}

.overview-recent-date > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-recent-date > i {
  color: #edf2f6;
  font-size: 17px;
  font-style: normal;
  line-height: 1;
  text-align: right;
}

@media (max-width: 760px) {
  .overview-recent-actions {
    gap: 6px;
  }

  .overview-recent-actions .soft-button {
    min-width: 0;
    padding-inline: 10px;
  }

  .overview-recent-nav {
    width: 32px;
    height: 32px;
  }

  .overview-recent-carousel {
    padding-inline: 10px;
  }

  .overview-recent-session-card {
    flex-basis: min(68vw, 190px);
  }
}

.overview-quick-card {
  padding-bottom: 20px;
}

.overview-primary-action,
.overview-action-tile {
  border: 1px solid #26323d;
  border-radius: 8px;
  background: #101820;
  color: #f2f5f8;
}

.overview-primary-action {
  width: calc(100% - 40px);
  min-height: 100px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 18px;
  margin: 16px 20px 18px;
  padding: 18px 22px;
  text-align: left;
}

.overview-primary-action .overview-icon {
  width: 42px;
  height: 42px;
}

.overview-primary-action strong {
  display: block;
  margin-bottom: 5px;
  font-size: 17px;
}

.overview-primary-action small {
  color: #aeb8c3;
}

.overview-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0 20px;
}

.overview-action-tile {
  min-height: 112px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 14px;
}

.overview-action-tile .overview-icon {
  width: 34px;
  height: 34px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

.upload-modal {
  width: min(1080px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid #2a3540;
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    #11181f;
  color: #f4f7fb;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.56);
  padding: 22px 30px 24px;
}

.upload-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.upload-modal h2,
.upload-modal h3 {
  margin: 0;
}

.upload-modal-head h2 {
  font-size: 26px;
}

.upload-modal-head p {
  margin: 6px 0 0;
  color: #c2ccd7;
  font-size: 15px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #f4f7fb;
  font-size: 24px;
}

.upload-landscape-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.76fr) minmax(600px, 1.24fr);
  gap: 24px;
  align-items: stretch;
}

.upload-file-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(250px, 1fr) auto;
  gap: 18px;
  padding-right: 24px;
  border-right: 1px solid #273440;
}

.upload-drop-zone {
  min-height: 218px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px dashed #4b5662;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  text-align: center;
}

.upload-drop-zone strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.upload-drop-zone em {
  min-width: 150px;
  border: 1px solid #33404c;
  border-radius: 7px;
  color: #fff;
  padding: 13px 18px;
  font-style: normal;
  font-weight: 900;
}

.upload-drop-zone.is-dragging {
  border-color: var(--red);
  background: rgba(239, 47, 50, 0.1);
}

.upload-drop-zone input {
  display: none;
}

.upload-drop-zone span,
.upload-drop-zone small,
.detected-note {
  color: #b7c0ca;
  font-size: 12px;
}

.detected-note {
  margin: 14px 0;
}

.upload-error {
  margin-bottom: 16px;
  border: 1px solid rgba(239, 47, 50, 0.38);
  border-radius: 7px;
  background: rgba(239, 47, 50, 0.12);
  color: #ff9a9d;
  padding: 10px 12px;
  font-size: 13px;
}

.metadata-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
}

.metadata-panel {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.metadata-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.metadata-panel-head h3 {
  font-size: 14px;
  text-transform: uppercase;
}

.metadata-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px 14px;
}

.metadata-field > span {
  display: block;
  margin-bottom: 6px;
  color: #d5dbe2;
  font-size: 13px;
}

.metadata-input {
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #33404c;
  border-radius: 7px;
  background: #151d24;
  padding: 0 10px;
}

.metadata-input i {
  color: #c4ccd5;
  font-style: normal;
  font-weight: 900;
}

.metadata-input input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
}

.metadata-input em {
  border-radius: 4px;
  background: rgba(24, 168, 68, 0.18);
  color: #84d37d;
  padding: 3px 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.switch-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 4px 10px;
  align-items: center;
  margin-top: 0;
}

.switch-row input {
  display: none;
}

.switch-row span {
  grid-row: 1 / 3;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #33404c;
  position: relative;
}

.switch-row span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.switch-row input:checked + span {
  background: var(--red);
}

.switch-row input:checked + span::after {
  transform: translateX(18px);
}

.switch-row small {
  color: #aab4be;
}

.summary-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(255, 176, 178, 0.26);
  border-radius: 999px;
  background: rgba(239, 47, 50, 0.09);
  padding: 0 12px;
  color: #ffb0b2;
}

.summary-status.ok {
  color: #84d37d;
}

.upload-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.upload-modal-actions .soft-button,
.upload-modal-actions .danger-button {
  min-width: 140px;
  min-height: 44px;
}

.danger-button:disabled,
.soft-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 1150px) {
  .overview-kpis,
  .overview-main-grid,
  .overview-layout {
    grid-template-columns: 1fr 1fr;
  }

  .overview-graphs-card,
  .overview-track-card,
  .overview-trend-card,
  .overview-recent-card {
    grid-column: 1 / -1;
  }

  .overview-session-row {
    grid-template-columns: 44px minmax(160px, 1fr) 90px 78px 18px;
  }

  .overview-session-row > span {
    display: none;
  }

  .weather-body {
    grid-template-columns: 1fr;
  }

  .weather-main {
    border-right: 0;
    border-bottom: 1px solid #283440;
    padding: 0 0 18px;
  }

  .upload-modal {
    overflow: auto;
  }

  .upload-landscape-layout {
    grid-template-columns: 1fr;
  }

  .upload-file-panel {
    grid-template-rows: auto auto;
    padding-right: 0;
    padding-bottom: 20px;
    border-right: 0;
    border-bottom: 1px solid #273440;
  }

  .upload-drop-zone {
    min-height: 180px;
  }
}

@media (max-width: 760px) {
  .overview-page {
    padding: 18px;
  }

  .overview-topbar,
  .overview-actions,
  .metadata-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .overview-kpis,
  .overview-main-grid,
  .overview-layout,
  .overview-action-grid {
    grid-template-columns: 1fr;
  }

  .overview-panel-actions,
  .weather-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .metadata-form {
    grid-template-columns: 1fr;
  }

  .metadata-field:nth-child(9) {
    grid-column: auto;
  }

  .metadata-panel-head {
    display: grid;
  }

  .overview-session-row {
    grid-template-columns: 42px minmax(0, 1fr) 18px;
  }

  .overview-session-row em,
  .overview-best-cell {
    display: none;
  }
}

/* The compact shell uses the icon lockup while full-width layouts retain the wordmark. */
@media (max-width: 1600px) {
  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand-logo {
    display: none;
  }

  .brand-icon {
    display: block;
  }
}

.session-compare-page {
  min-height: calc(100vh - 36px);
  margin: -18px;
  padding: 22px 28px;
  color: #f4f7fb;
  background:
    linear-gradient(180deg, rgba(7, 13, 18, 0.98), rgba(4, 7, 10, 0.98)),
    #05080c;
}

.session-compare-topbar,
.session-compare-actions,
.session-hero-row,
.session-metric-row,
.session-main-grid,
.session-bottom-grid,
.session-panel-head,
.session-tabs,
.compare-map-legend {
  display: flex;
  align-items: center;
}

.session-compare-topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.session-compare-topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.session-compare-topbar p {
  margin: 8px 0 0;
  color: #a7b0bb;
}

.session-compare-topbar p span {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid #3a4652;
}

.session-compare-actions {
  gap: 10px;
}

.session-compare-page .soft-button,
.session-compare-page .icon-button,
.session-compare-page .select {
  border-color: #27333f;
  background: #0e151c;
  color: #f4f7fb;
  box-shadow: none;
}

.session-hero-row {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 74px minmax(360px, 1fr);
  gap: 18px;
  margin-bottom: 14px;
}

.session-hero-card {
  min-height: 226px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(126px, 0.28fr);
  grid-template-rows: auto 1fr auto;
  gap: 10px 20px;
  min-width: 0;
  border: 1px solid var(--driver-color, #2169d8);
  border-radius: 8px;
  background: radial-gradient(circle at 0 0, var(--driver-glow, rgba(30, 112, 255, 0.18)), rgba(15, 23, 31, 0.96) 44%, #0b1117);
  padding: 16px;
}

.session-hero-card.session-b {
  border-color: var(--driver-color, #e63b3e);
  background: radial-gradient(circle at 0 0, var(--driver-glow, rgba(239, 47, 50, 0.2)), rgba(25, 15, 17, 0.96) 44%, #0b1117);
}

.session-hero-label {
  grid-column: 1;
  justify-self: start;
  border-radius: 6px;
  background: var(--driver-color, #1e76ff);
  color: #fff;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.session-b .session-hero-label {
  background: var(--driver-color, #df3336);
}

.session-hero-card .avatar {
  grid-column: 1;
  grid-row: 2;
  width: 74px;
  height: 74px;
  border-radius: 8px;
}

.session-driver-helmet img {
  object-position: 47% 45%;
}

.comparison-session-placeholder {
  grid-column: 1;
  grid-row: 2;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--driver-color) 65%, #65717d);
  border-radius: 8px;
  background: color-mix(in srgb, var(--driver-color) 10%, #0b1117);
  color: var(--driver-color);
  font-size: 24px;
  font-weight: 900;
}

.session-hero-card.awaiting-selection .session-hero-main strong {
  color: #c0c9d3;
  font-weight: 700;
}

.comparison-selection-hint {
  max-width: 38ch;
  line-height: 1.45;
  white-space: normal;
}

.session-hero-main {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.session-hero-main h2 {
  margin: 0;
  font-size: 20px;
}

.session-hero-main strong {
  color: var(--driver-color, #2b8cff);
  line-height: 1.35;
  overflow-wrap: anywhere;
  min-width: 0;
}

.session-b .session-hero-main strong {
  color: var(--driver-color, #ff484b);
}

.session-hero-main span,
.session-hero-best small {
  color: #c0c9d3;
  font-size: 13px;
}

.session-meta-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  line-height: 1.25;
}

.session-meta-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-icon {
  display: block;
  object-fit: contain;
  filter: invert(89%) sepia(9%) saturate(171%) hue-rotate(176deg) brightness(90%) contrast(88%);
  opacity: 0.86;
}

.session-meta-icon {
  width: 16px;
  height: 16px;
}

.session-hero-best {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
  min-width: 0;
  border-left: 1px solid #293540;
  padding-left: 18px;
}

.session-hero-best span {
  display: block;
  color: var(--driver-color, #2b8cff);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.session-b .session-hero-best span {
  color: var(--driver-color, #ff484b);
}

.session-hero-best strong {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(20px, 1.45vw, 25px);
  letter-spacing: 0;
  white-space: nowrap;
}

.session-hero-card .select {
  min-height: 34px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-pickers {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(128px, 0.55fr);
  gap: 10px;
  align-items: end;
  border-top: 1px solid #293540;
  padding-top: 12px;
  min-width: 0;
}

.session-pickers label,
.comparison-session-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.session-pickers label > span,
.comparison-session-field > span {
  color: #aeb7c2;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.comparison-session-picker {
  position: relative;
  min-width: 0;
}

.session-picker-trigger {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  border: 1px solid #27333f;
  border-radius: 7px;
  background: #0e151c;
  color: #f4f7fb;
  padding: 7px 10px;
  text-align: left;
}

.session-picker-trigger:hover,
.comparison-session-picker.open .session-picker-trigger {
  border-color: var(--driver-color, #58718b);
  background: #111b24;
}

.session-picker-trigger:disabled {
  border-style: dashed;
  border-color: #27333f;
  background: #0b1218;
  color: #75818d;
  cursor: not-allowed;
  opacity: 0.74;
}

.session-picker-trigger:disabled .session-picker-chevron {
  opacity: 0.4;
}

.session-picker-trigger-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

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

.session-picker-trigger-copy strong {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #f3f6fa;
  font-size: 12px;
}

.session-picker-trigger-copy small {
  color: #8f9aa6;
  font-size: 10px;
}

.session-picker-trigger-icon,
.session-picker-track-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.session-picker-chevron {
  width: 7px;
  height: 7px;
  justify-self: center;
  border-right: 1px solid #bdc6d0;
  border-bottom: 1px solid #bdc6d0;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 140ms ease;
}

.comparison-session-picker.open .session-picker-chevron {
  transform: rotate(225deg) translate(-2px, -1px);
}

.session-picker-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 90;
  width: min(540px, 72vw);
  min-width: 100%;
  display: none;
  border: 1px solid #31404d;
  border-radius: 7px;
  background: #091016;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}

.session-b .session-picker-menu {
  right: 0;
  left: auto;
}

.comparison-session-picker.open .session-picker-menu {
  display: block;
}

.session-picker-search {
  position: relative;
  padding: 10px 10px 8px;
}

.session-picker-search::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 19px;
  width: 8px;
  height: 8px;
  border: 1px solid #778492;
  border-radius: 50%;
}

.session-picker-search::after {
  content: "";
  position: absolute;
  left: 29px;
  top: 28px;
  width: 5px;
  border-top: 1px solid #778492;
  transform: rotate(45deg);
  transform-origin: left center;
}

.session-picker-search input {
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  border: 1px solid #24313d;
  border-radius: 6px;
  outline: none;
  background: #0c141b;
  color: #eef3f8;
  padding: 0 12px 0 33px;
}

.session-picker-search input:focus {
  border-color: var(--driver-color, #2d7dff);
}

.session-picker-search input::placeholder {
  color: #687581;
}

.session-picker-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 36px;
  gap: 8px;
  padding: 0 10px 9px;
  border-bottom: 1px solid #202b35;
}

.session-picker-filters select,
.session-picker-locked-track,
.session-picker-favorites-only {
  min-width: 0;
  min-height: 30px;
  border: 1px solid #27343f;
  border-radius: 6px;
  background: #101820;
  color: #cbd3dc;
  padding: 0 8px;
  font-size: 10px;
}

.session-picker-locked-track {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: #d5dce4;
}

.session-picker-locked-track span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-picker-filter-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.session-picker-favorites-only {
  display: grid;
  place-items: center;
  color: #9da8b4;
  padding: 0;
  font-size: 17px;
}

.session-picker-favorites-only.active {
  border-color: #e7b321;
  color: #ffd13d;
  background: rgba(231, 179, 33, 0.1);
}

.session-picker-results {
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #687582 #101820;
  scrollbar-width: thin;
}

.session-picker-track-group + .session-picker-track-group {
  border-top: 1px solid #202b35;
}

.session-picker-track-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #0c141b;
  color: #f2f5f8;
  padding: 0 10px;
}

.session-picker-track-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.session-picker-track-head span {
  min-width: 20px;
  border-radius: 4px;
  background: #202b35;
  color: #aeb8c2;
  padding: 2px 6px;
  font-size: 9px;
  text-align: center;
}

.session-picker-option {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: stretch;
  border-top: 1px solid rgba(37, 49, 60, 0.72);
  background: #091016;
}

.session-picker-option:hover {
  background: #101a23;
}

.session-picker-option.selected {
  background: color-mix(in srgb, var(--driver-color) 72%, #101820);
}

.session-picker-option-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: #dfe5eb;
  padding: 6px 4px 6px 18px;
  text-align: left;
}

.session-picker-option-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.session-picker-option-copy strong,
.session-picker-option-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-picker-option-copy strong {
  font-size: 10px;
  font-weight: 700;
}

.session-picker-option-copy small {
  color: #75828f;
  font-size: 9px;
}

.session-picker-option.selected .session-picker-option-copy small {
  color: rgba(255, 255, 255, 0.74);
}

.session-picker-option-copy i {
  color: #5f6d7a;
  font-style: normal;
}

.session-picker-lap {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.session-picker-lap small,
.session-picker-lap strong {
  border-radius: 3px;
  background: #17212a;
  color: #b9c3cd;
  padding: 3px 5px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.session-picker-option.selected .session-picker-lap small,
.session-picker-option.selected .session-picker-lap strong {
  background: rgba(0, 0, 0, 0.24);
  color: #fff;
}

.session-picker-favorite {
  border: 0;
  background: transparent;
  color: #667380;
  font-size: 17px;
}

.session-picker-favorite:hover,
.session-picker-favorite.active {
  color: #ffd13d;
}

.session-picker-empty {
  color: #8e9aa6;
  padding: 28px 18px;
  font-size: 11px;
  text-align: center;
}

.session-vs {
  width: 60px;
  height: 60px;
  place-self: center;
  display: grid;
  place-items: center;
  border: 1px solid #3a4652;
  border-radius: 50%;
  background: #101820;
  color: #f4f7fb;
  font-size: 22px;
  font-weight: 900;
}

.session-metric-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 1px;
  margin-bottom: 14px;
  border: 1px solid #202a34;
  border-radius: 8px;
  overflow: hidden;
  background: #202a34;
}

.session-metric-card {
  min-height: 78px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px;
  column-gap: 12px;
  align-items: center;
  padding: 14px 18px;
  background: #0c131a;
}

.metric-card-icon {
  width: 32px;
  height: 32px;
  justify-self: center;
}

.session-metric-card > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.session-metric-card span,
.session-panel-head h2,
.sector-summary-table th {
  color: #c5ced8;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.session-metric-card strong {
  font-size: 24px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.session-metric-card small,
.session-panel-head span {
  color: #9ea9b5;
}

.session-metric-card small {
  display: block;
}

.session-main-grid {
  display: grid;
  grid-template-columns: minmax(430px, 0.88fr) minmax(520px, 1.12fr);
  gap: 12px;
  margin-bottom: 12px;
}

.session-bottom-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  gap: 12px;
}

.session-panel {
  border: 1px solid #202a34;
  border-radius: 8px;
  background: #0b1217;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.session-panel-head {
  min-height: 48px;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #202a34;
}

.session-panel-head h2 {
  margin: 0;
}

.session-map-panel {
  position: relative;
}

.session-map-panel .overview-map-shell {
  min-height: 420px;
  border-radius: 0;
}

.comparison-waiting-grid .session-panel {
  min-height: 420px;
}

.comparison-panel-status {
  min-height: 370px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: #aeb8c3;
  padding: 32px;
  text-align: center;
}

.comparison-panel-status > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid #35424f;
  border-radius: 50%;
  background: #101820;
  color: #d5dde6;
  font-size: 26px;
  font-weight: 500;
}

.comparison-panel-status strong {
  max-width: 440px;
  color: #d8dfe7;
  font-size: 15px;
  line-height: 1.55;
}

.comparison-panel-status.is-warning > span {
  border-color: rgba(239, 47, 50, 0.72);
  background: rgba(239, 47, 50, 0.1);
  color: #ff5558;
}

.comparison-panel-status.is-warning strong {
  color: #f2f5f8;
}

.sector-number-layer {
  z-index: 4;
}

.map-sector-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 0;
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(5, 8, 12, 0.9);
  color: #fff;
  font-weight: 900;
  padding: 0 7px;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.28);
}

.map-sector-marker strong {
  color: #fff;
  font-size: 10px;
}

.map-sector-marker span {
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.map-sector-marker.is-loss {
  border-color: rgba(239, 47, 50, 0.72);
}

.map-sector-marker.is-gain {
  border-color: rgba(24, 168, 68, 0.72);
}

.compare-map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 5;
  display: grid;
  gap: 8px;
  align-items: start;
  border-radius: 8px;
  background: rgba(5, 9, 13, 0.88);
  color: #e9eef4;
  padding: 12px 14px;
  font-size: 12px;
}

.compare-map-legend span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sector-line-swatch {
  width: 28px;
  height: 0;
  border-top: 1px dashed #d7dee8;
}

.session-tabs {
  gap: 24px;
}

.session-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #aeb7c2;
  padding: 10px 0;
  font-weight: 900;
}

.session-tabs .active {
  color: #fff;
  border-bottom-color: var(--red);
}

.compare-graph-stack {
  padding: 14px 18px 18px;
  display: grid;
  gap: 10px;
}

.compare-graph-stack canvas {
  width: 100%;
  height: 78px;
  border-bottom: 1px solid #202a34;
}

.compare-graph-stack canvas:last-child {
  border-bottom: 0;
}

.sector-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sector-summary-table th,
.sector-summary-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #202a34;
  text-align: left;
}

.sector-summary-table small {
  color: #9faab6;
}

.sector-delta-bar {
  display: block;
  height: 8px;
  max-width: 96px;
  border-radius: 999px;
}

.sector-delta-bar.loss {
  background: var(--red);
}

.sector-delta-bar.gain {
  margin-left: auto;
  background: var(--green);
}

.total-row td {
  font-weight: 900;
}

.compare-insight-list {
  list-style: none;
  margin: 0;
  padding: 14px 18px 18px;
  display: grid;
  gap: 13px;
}

.compare-insight-list li {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  color: #dbe3eb;
  font-size: 13px;
}

.compare-insight-list i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid currentColor;
}

.compare-insight-list .positive {
  color: #8edc83;
}

.compare-insight-list .negative {
  color: #ff787b;
}

.session-library-page {
  min-height: calc(100vh - 36px);
  margin: -18px;
  padding: 28px 34px 76px;
  color: #f4f7fb;
  background:
    linear-gradient(180deg, rgba(9, 18, 23, 0.98), rgba(4, 8, 11, 0.98)),
    #05080c;
}

.library-topbar,
.track-session-topbar,
.library-actions,
.library-search-row,
.session-list-head,
.compare-selection-bar {
  display: flex;
  align-items: center;
}

.library-topbar,
.track-session-topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.library-topbar h1,
.track-session-topbar h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
}

.library-topbar p,
.track-session-topbar p {
  margin: 6px 0 0;
  color: #aeb7c2;
  font-size: 17px;
}

.library-actions {
  gap: 12px;
}

.session-library-page .soft-button,
.session-library-page .library-select,
.session-library-page .library-search-input {
  border-color: #26323d;
  background: #0e151b;
  color: #f4f7fb;
  box-shadow: none;
}

.library-filter-panel {
  border: 1px solid #202a34;
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    #0b1217;
  padding: 14px;
  margin-bottom: 22px;
}

.library-filter-panel.compact {
  margin-bottom: 12px;
}

.library-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.library-filter {
  min-height: 70px;
  display: grid;
  gap: 6px;
  border: 1px solid #26323d;
  border-radius: 8px;
  background: #111920;
  padding: 12px 14px;
}

.library-filter span {
  color: #b7c0ca;
  font-size: 12px;
}

.library-select {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-weight: 800;
}

.library-search-row {
  gap: 14px;
  margin-top: 14px;
}

.library-search-input {
  min-height: 42px;
  flex: 1;
  border: 1px solid #26323d;
  border-radius: 8px;
  padding: 0 16px;
}

.track-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}

.track-library-card {
  position: relative;
  min-height: 260px;
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 20px;
  border: 1px solid #202a34;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 100%, rgba(239, 47, 50, 0.1), transparent 35%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    #0b1217;
  padding: 50px 22px 26px;
  cursor: pointer;
  overflow: hidden;
}

.track-library-card:hover {
  border-color: #3b4855;
}

.track-session-count {
  position: absolute;
  top: 18px;
  left: 18px;
  right: auto;
  border: 1px solid #27333f;
  border-radius: 7px;
  background: #101820;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.track-session-count i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--red);
}

.track-card-art,
.track-detail-art {
  display: grid;
  place-items: center;
  min-width: 0;
}

.track-asset {
  position: relative;
  width: 100%;
  max-width: 210px;
  aspect-ratio: 1.28;
  display: grid;
  place-items: center;
}

.library-track-svg {
  width: 100%;
  max-width: 190px;
  height: auto;
  opacity: 0.94;
}

.track-asset .library-track-svg {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
}

.track-layout-img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.92))
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.16))
    drop-shadow(0 12px 20px rgba(0, 0, 0, 0.34));
}

.track-logo-img {
  position: absolute;
  right: -8px;
  bottom: -2px;
  z-index: 2;
  max-width: 74px;
  max-height: 38px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(5, 9, 12, 0.72);
  padding: 5px;
}

.track-asset-detail {
  max-width: 230px;
}

.track-asset-detail .track-logo-img {
  right: -8px;
  left: auto;
  bottom: -2px;
}

.track-card-logo {
  position: absolute;
  left: 18px;
  bottom: 24px;
  z-index: 2;
  max-width: 82px;
  max-height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(5, 9, 12, 0.78);
  padding: 5px;
}

.track-card-copy {
  align-self: stretch;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
}

.track-card-copy h2 {
  margin: 0;
  font-size: 22px;
}

.track-card-copy p,
.track-card-copy span {
  margin: 0;
  color: #b7c0ca;
}

.track-card-copy strong {
  font-size: 17px;
}

.track-tags {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  margin-top: 4px;
}

.track-tags em {
  border: 1px solid #303b46;
  border-radius: 5px;
  color: #d7dee8;
  padding: 7px 10px;
  font-style: normal;
  font-size: 12px;
}

.track-view-button {
  align-self: end;
  justify-self: end;
  border: 0;
  background: transparent;
  color: var(--red);
  font-weight: 900;
}

.track-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.track-pagination span {
  color: #c4ced8;
  font-size: 13px;
  font-weight: 800;
}

.track-empty-note {
  grid-column: 1 / -1;
}

.back-link {
  border: 0;
  background: transparent;
  color: #f4f7fb;
  font-size: 30px;
}

.track-detail-hero {
  min-height: 130px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 230px 230px;
  gap: 26px;
  align-items: center;
  border: 1px solid #202a34;
  border-radius: 8px;
  background: #0b1217;
  padding: 18px 28px;
  margin-bottom: 12px;
}

.track-detail-copy h2,
.track-detail-copy p {
  margin: 0;
}

.track-detail-copy p {
  margin-top: 8px;
  color: #c3ccd6;
  line-height: 1.5;
}

.track-detail-stat {
  border-left: 1px solid #28333e;
  padding-left: 28px;
}

.track-detail-stat span {
  display: block;
  color: #aeb7c2;
  font-size: 12px;
  text-transform: uppercase;
}

.track-detail-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.session-list-head {
  justify-content: space-between;
  margin: 12px 0;
  color: #dbe3eb;
}

.session-list-head span {
  color: #b0bac5;
}

.session-library-list {
  display: grid;
  gap: 8px;
  padding-bottom: 118px;
}

.session-library-row {
  min-height: 78px;
  display: grid;
  grid-template-columns: 28px 34px minmax(170px, 1.1fr) repeat(4, minmax(110px, 0.7fr)) 114px 114px 92px;
  gap: 14px;
  align-items: center;
  border: 1px solid #202a34;
  border-radius: 8px;
  background: #0d141a;
  padding: 12px 18px;
}

.session-library-row.selected-a {
  border-color: #2d7dff;
  box-shadow: inset 0 0 0 1px rgba(45, 125, 255, 0.32);
}

.session-library-row.selected-b {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(239, 47, 50, 0.32);
}

.session-row-check {
  width: 28px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #3b4652;
  border-radius: 5px;
  color: #fff;
  background: #111920;
  font-size: 10px;
  font-weight: 900;
}

.selected-a .session-row-check {
  background: #2d7dff;
  border-color: #2d7dff;
}

.selected-b .session-row-check {
  background: var(--red);
  border-color: var(--red);
}

.session-row-number {
  color: #c4ccd6;
  font-size: 22px;
}

.session-row-title h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.session-row-title span,
.session-library-row small {
  color: #aeb7c2;
}

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

.session-row-driver > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-driver-helmet {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 7px;
}

.session-library-row small {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  text-transform: uppercase;
}

.session-library-row b {
  color: #2d7dff;
  font-size: 18px;
}

.red-outline {
  border-color: rgba(239, 47, 50, 0.68) !important;
  color: #ff777a !important;
}

.delete-session-button {
  border-color: rgba(239, 47, 50, 0.45) !important;
  color: #ff8c8f !important;
}

.compare-selection-bar {
  position: fixed;
  left: 184px;
  right: 0;
  bottom: 0;
  z-index: 20;
  gap: 16px;
  border-top: 1px solid #26323d;
  background: rgba(13, 20, 26, 0.96);
  backdrop-filter: blur(8px);
  padding: 18px 28px;
}

.compare-selection-bar > div:first-child {
  min-width: 170px;
  display: grid;
  gap: 6px;
}

.compare-selection-bar span {
  color: #b4bec9;
}

.compare-selection-card {
  min-height: 64px;
  flex: 1;
  display: grid;
  align-content: center;
  border: 1px solid var(--driver-color, #2d7dff);
  border-radius: 8px;
  color: #f4f7fb;
  background: radial-gradient(circle at 0 0, var(--driver-glow, rgba(45, 125, 255, 0.16)), transparent 72%);
  padding: 12px 16px;
  font-weight: 900;
}

.compare-selection-card.red {
  border-color: var(--driver-color, var(--red));
}

.selection-vs {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #3a4652;
  border-radius: 50%;
}

@media (max-width: 1440px) and (min-width: 901px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .brand {
    height: 76px;
    padding: 0 12px;
  }

  .brand-mark {
    font-size: 18px;
  }

  .brand-sub,
  .nav-label,
  .sidebar-footer {
    display: none;
  }

  .nav-button {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 46px;
    padding: 0;
  }

  .session-compare-page {
    min-height: 100vh;
    margin: -18px;
    padding: 14px 16px 18px;
  }

  .session-compare-topbar {
    min-height: 42px;
    gap: 12px;
    margin-bottom: 10px;
  }

  .session-compare-topbar h1 {
    font-size: 21px;
  }

  .session-compare-topbar p {
    margin-top: 5px;
    font-size: 13px;
  }

  .session-compare-actions {
    gap: 8px;
  }

  .session-compare-page .soft-button,
  .session-compare-page .icon-button,
  .session-compare-page .select {
    min-height: 32px;
    border-radius: 6px;
  }

  .session-hero-row {
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 10px;
  }

  .session-hero-card {
    min-height: 232px;
    grid-template-columns: 70px minmax(0, 1fr) minmax(96px, 0.28fr);
    gap: 8px 14px;
    padding: 12px 14px;
  }

  .session-hero-label {
    padding: 5px 10px;
    font-size: 10px;
  }

  .session-hero-card .avatar {
    width: 58px;
    height: 58px;
  }

  .comparison-session-placeholder {
    width: 58px;
    height: 58px;
  }

  .session-hero-main {
    gap: 4px;
  }

  .session-hero-main h2 {
    font-size: 17px;
  }

  .session-hero-main span,
  .session-hero-best small {
    font-size: 12px;
  }

  .session-hero-best {
    padding-left: 14px;
  }

  .session-hero-best strong {
    margin: 5px 0 3px;
    font-size: 21px;
  }

  .session-vs {
    width: 48px;
    height: 48px;
    font-size: 17px;
  }

  .session-pickers {
    grid-template-columns: minmax(0, 1.65fr) minmax(104px, 0.5fr);
    gap: 8px;
    padding-top: 8px;
  }

  .session-pickers label {
    min-width: 0;
  }

  .session-pickers label > span {
    font-size: 10px;
  }

  .session-picker-trigger,
  .session-pickers .select {
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 0 9px;
  }

  .session-metric-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 10px;
  }

  .session-metric-card {
    min-height: 64px;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 9px;
    padding: 9px 12px;
  }

  .metric-card-icon {
    width: 26px;
    height: 26px;
  }

  .session-meta-icon {
    width: 14px;
    height: 14px;
  }

  .session-metric-card span,
  .session-panel-head h2,
  .sector-summary-table th {
    font-size: 10px;
  }

  .session-metric-card strong {
    font-size: 19px;
  }

  .session-metric-card small,
  .session-panel-head span {
    font-size: 11px;
  }

  .session-main-grid,
  .session-bottom-grid {
    gap: 10px;
  }

  .session-main-grid {
    grid-template-columns: minmax(360px, 0.9fr) minmax(430px, 1.1fr);
    margin-bottom: 10px;
  }

  .session-bottom-grid {
    grid-template-columns: minmax(360px, 0.95fr) minmax(360px, 1.05fr);
  }

  .session-panel-head {
    min-height: 40px;
    padding: 8px 12px;
  }

  .session-map-panel .overview-map-shell {
    min-height: 318px;
  }

  .compare-graph-stack {
    gap: 7px;
    padding: 10px 12px 12px;
  }

  .compare-graph-stack canvas {
    height: 58px;
  }

  .sector-summary-table th,
  .sector-summary-table td {
    padding: 9px 12px;
  }

  .compare-insight-list {
    gap: 9px;
    padding: 10px 12px 12px;
  }

  .compare-selection-bar {
    left: 76px;
  }
}

@media (max-width: 1180px) {
  .session-hero-row,
  .session-main-grid,
  .session-bottom-grid {
    grid-template-columns: 1fr;
  }

  .session-vs {
    display: none;
  }

  .session-metric-row {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .compare-selection-bar {
    left: 76px;
  }
}

@media (max-width: 760px) {
  .session-compare-page {
    padding: 18px;
  }

  .session-compare-topbar,
  .session-compare-actions,
  .session-hero-card,
  .session-metric-row {
    grid-template-columns: 1fr;
  }

  .session-hero-best {
    grid-column: 1;
    grid-row: auto;
    border-left: 0;
    border-top: 1px solid #293540;
    padding: 12px 0 0;
  }

  .session-hero-main,
  .session-hero-card .avatar,
  .comparison-session-placeholder,
  .session-hero-card .select,
  .session-pickers {
    grid-column: 1;
    grid-row: auto;
  }

  .session-pickers {
    grid-template-columns: 1fr;
  }

  .compare-selection-bar {
    left: 0;
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Responsive pass mapped to practical viewport widths for 10.2", 13", 15", 17", 24" and 27" screens. */
@media (max-width: 2100px) and (min-width: 1601px) {
  .session-compare-page {
    padding: 18px 24px;
  }

  .session-compare-topbar {
    margin-bottom: 14px;
  }

  .session-hero-card {
    min-height: 214px;
    grid-template-columns: 84px minmax(0, 1fr) minmax(116px, 0.26fr);
    gap: 8px 16px;
    padding: 14px 16px;
  }

  .session-hero-card .avatar {
    width: 66px;
    height: 66px;
  }

  .comparison-session-placeholder {
    width: 66px;
    height: 66px;
  }

  .session-pickers {
    gap: 8px;
    padding-top: 9px;
  }

  .session-metric-card {
    min-height: 72px;
    padding: 10px 14px;
  }

  .session-metric-card strong {
    font-size: 21px;
  }

  .session-main-grid,
  .session-bottom-grid {
    gap: 10px;
  }

  .session-map-panel .overview-map-shell {
    min-height: 354px;
  }

  .compare-graph-stack {
    gap: 7px;
    padding: 11px 14px 13px;
  }

  .compare-graph-stack canvas {
    height: 64px;
  }

  .sector-summary-table th,
  .sector-summary-table td {
    padding: 10px 14px;
  }

  .compare-insight-list {
    gap: 10px;
    padding: 12px 14px 14px;
  }
}

@media (max-width: 1600px) and (min-width: 901px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .brand {
    height: 76px;
    padding: 0 12px;
  }

  .brand-mark {
    font-size: 18px;
  }

  .brand-sub,
  .nav-label,
  .sidebar-footer {
    display: none;
  }

  .nav-button {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 46px;
    padding: 0;
  }

  .overview-page {
    padding: 18px 22px;
  }

  .overview-topbar {
    margin-bottom: 16px;
  }

  .overview-topbar h1 {
    font-size: 25px;
  }

  .overview-kpis {
    gap: 12px;
    margin-bottom: 14px;
  }

  .overview-kpi-card {
    min-height: 140px;
    padding: 18px;
  }

  .overview-kpi-card strong {
    font-size: 29px;
  }

  .overview-track-mini {
    right: 16px;
    bottom: 14px;
    width: 92px;
    height: 64px;
    opacity: 0.72;
  }

  .overview-layout {
    grid-template-columns: minmax(0, 1.38fr) minmax(330px, 0.82fr);
    gap: 14px;
  }

  .overview-panel-head {
    min-height: 48px;
    padding: 10px 14px;
  }

  .overview-trend-card canvas {
    height: 236px;
  }

  .weather-body {
    grid-template-columns: minmax(140px, 0.74fr) minmax(150px, 1fr);
    gap: 14px;
    padding: 18px 18px 8px;
  }

  .weather-main {
    padding-right: 14px;
  }

  .weather-main strong {
    font-size: 48px;
  }

  .weather-grid {
    gap: 16px 10px;
  }

  .weather-metric {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 8px;
  }

  .weather-metric strong {
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  .weather-actions .soft-button {
    max-width: 154px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .overview-session-row {
    grid-template-columns: 42px minmax(145px, 1fr) minmax(118px, 0.58fr) 78px 82px 14px;
    gap: 12px;
  }

  .session-library-page {
    padding: 22px 24px 78px;
  }

  .library-topbar,
  .track-session-topbar {
    margin-bottom: 16px;
  }

  .library-topbar h1,
  .track-session-topbar h1 {
    font-size: 30px;
  }

  .library-topbar p,
  .track-session-topbar p {
    font-size: 15px;
  }

  .library-filter-grid {
    grid-template-columns: repeat(5, minmax(118px, 1fr));
    gap: 10px;
  }

  .library-filter {
    padding: 10px 12px;
  }

  .track-card-grid {
    gap: 12px;
  }

  .track-library-card {
    min-height: 232px;
    grid-template-columns: minmax(126px, 0.74fr) minmax(0, 1fr);
    gap: 16px;
    padding: 44px 18px 22px;
  }

  .track-asset {
    max-width: 168px;
  }

  .track-card-copy {
    gap: 8px;
  }

  .track-card-copy h2 {
    font-size: 19px;
  }

  .track-tags em {
    padding: 6px 8px;
  }

  .track-detail-hero {
    grid-template-columns: 170px minmax(0, 1fr) 150px 150px;
    gap: 18px;
    padding: 16px 20px;
  }

  .track-detail-stat {
    padding-left: 20px;
  }

  .session-library-row {
    grid-template-columns: 24px 28px minmax(140px, 1.05fr) minmax(112px, 0.72fr) minmax(112px, 0.72fr) minmax(100px, 0.66fr) minmax(88px, 0.54fr) 100px 100px 78px;
    gap: 10px;
    padding: 10px 12px;
  }

  .session-row-title h3 {
    font-size: 15px;
  }

  .session-library-row b {
    font-size: 16px;
  }

  .compare-selection-bar {
    left: 76px;
    gap: 12px;
    padding: 14px 18px;
  }

  .compare-selection-card {
    min-height: 56px;
    padding: 10px 14px;
  }

  .session-compare-page {
    min-height: 100vh;
    padding: 14px 16px 18px;
  }

  .session-compare-topbar {
    min-height: 42px;
    gap: 12px;
    margin-bottom: 10px;
  }

  .session-compare-topbar h1 {
    font-size: 21px;
  }

  .session-compare-topbar p {
    margin-top: 5px;
    font-size: 13px;
  }

  .session-hero-row {
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 10px;
  }

  .session-hero-card {
    min-height: 232px;
    grid-template-columns: 70px minmax(0, 1fr) minmax(96px, 0.28fr);
    gap: 8px 14px;
    padding: 12px 14px;
  }

  .session-hero-card .avatar {
    width: 58px;
    height: 58px;
  }

  .session-hero-main h2 {
    font-size: 17px;
  }

  .session-hero-best strong {
    margin: 5px 0 3px;
    font-size: 21px;
  }

  .session-vs {
    width: 48px;
    height: 48px;
    font-size: 17px;
  }

  .session-pickers {
    grid-template-columns: minmax(0, 1.65fr) minmax(104px, 0.5fr);
    gap: 8px;
    padding-top: 8px;
  }

  .session-picker-trigger,
  .session-pickers .select {
    min-height: 30px;
    padding: 0 9px;
  }

  .session-metric-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 10px;
  }

  .session-metric-card {
    min-height: 64px;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 9px;
    padding: 9px 12px;
  }

  .metric-card-icon {
    width: 26px;
    height: 26px;
  }

  .session-metric-card span,
  .session-panel-head h2,
  .sector-summary-table th {
    font-size: 10px;
  }

  .session-metric-card strong {
    font-size: 19px;
  }

  .session-main-grid,
  .session-bottom-grid {
    gap: 10px;
  }

  .session-main-grid {
    grid-template-columns: minmax(360px, 0.9fr) minmax(430px, 1.1fr);
    margin-bottom: 10px;
  }

  .session-bottom-grid {
    grid-template-columns: minmax(360px, 0.95fr) minmax(360px, 1.05fr);
  }

  .session-panel-head {
    min-height: 40px;
    padding: 8px 12px;
  }

  .session-map-panel .overview-map-shell {
    min-height: 318px;
  }

  .compare-graph-stack {
    gap: 7px;
    padding: 10px 12px 12px;
  }

  .compare-graph-stack canvas {
    height: 58px;
  }

  .sector-summary-table th,
  .sector-summary-table td {
    padding: 9px 12px;
  }

  .compare-insight-list {
    gap: 9px;
    padding: 10px 12px 12px;
  }
}

@media (max-width: 1180px) {
  .session-library-page {
    padding: 22px 22px 110px;
  }

  .library-topbar,
  .track-session-topbar,
  .library-actions {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .library-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-search-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .track-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .track-library-card {
    min-height: 218px;
    grid-template-columns: 116px minmax(0, 1fr);
    padding: 42px 16px 20px;
  }

  .track-card-copy h2 {
    font-size: 18px;
  }

  .track-detail-hero {
    grid-template-columns: 138px minmax(0, 1fr) minmax(120px, 0.55fr) minmax(120px, 0.55fr);
    gap: 14px;
    padding: 14px 16px;
  }

  .track-detail-stat {
    padding-left: 16px;
  }

  .session-library-list {
    overflow-x: auto;
  }

  .session-library-row {
    min-width: 1050px;
  }
}

@media (max-width: 900px) {
  .session-library-page,
  .overview-page,
  .session-compare-page {
    margin: -18px;
    padding: 18px;
  }

  .library-filter-grid,
  .track-card-grid,
  .track-detail-hero {
    grid-template-columns: 1fr;
  }

  .track-library-card {
    grid-template-columns: 126px minmax(0, 1fr);
  }

  .track-detail-stat {
    border-left: 0;
    border-top: 1px solid #28333e;
    padding: 14px 0 0;
  }
}

/* Keep both comparison graph modes in the same wide telemetry frame as the track map. */
.session-main-grid {
  align-items: stretch;
}

.session-graph-panel {
  min-width: 0;
}

.sector-analysis-widget,
.overview-analysis-widget {
  height: 420px;
  min-height: 0;
  overflow: hidden;
  background: #080f15;
}

.overview-analysis-widget {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.sector-telemetry-stack {
  grid-template-rows: repeat(4, minmax(0, 1fr));
}

.sector-graph-row,
.sector-graph-canvas,
.sector-graph-canvas canvas {
  min-height: 0;
}

.sector-graph-canvas {
  height: 100%;
  overflow: hidden;
}

.sector-graph-canvas canvas {
  height: 100%;
}

.overview-telemetry-stack {
  padding-top: 6px;
}

.comparison-overview-actions {
  flex-wrap: nowrap;
}

@media (max-width: 2100px) and (min-width: 1601px) {
  .sector-analysis-widget,
  .overview-analysis-widget {
    height: 354px;
  }
}

@media (max-width: 1600px) {
  .sector-analysis-widget,
  .overview-analysis-widget {
    height: 318px;
  }

  .sector-selector-card {
    min-height: 58px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .sector-distance-caption {
    padding-bottom: 5px;
  }
}

@media (max-width: 760px) {
  .sector-analysis-widget,
  .overview-analysis-widget {
    height: 360px;
  }

  .comparison-overview-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Local authentication prototype. Production access will replace this browser-local layer. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

body.auth-active {
  min-height: 100dvh;
  overflow-x: hidden;
  background: #05090e;
}

.auth-screen {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  display: flex;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 34px 24px;
  background:
    linear-gradient(115deg, rgba(17, 25, 35, 0.42), transparent 42%),
    linear-gradient(180deg, #080d14 0%, #05090e 100%);
  color: #f4f6f8;
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}

.auth-panel {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  display: grid;
  margin: auto;
  border: 1px solid #37414d;
  border-radius: 8px;
  background: rgba(13, 19, 27, 0.97);
  padding: 48px 58px 42px;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.auth-brand {
  position: relative;
  width: min(500px, 92%);
  justify-self: center;
  margin-bottom: 30px;
}

.auth-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.auth-brand > span {
  position: absolute;
  top: 22%;
  bottom: 22%;
  left: 40.5%;
  width: 2px;
  background: var(--red);
  box-shadow: 0 0 12px rgba(239, 47, 50, 0.25);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid #2a333e;
  margin-bottom: 30px;
}

.auth-tabs button {
  position: relative;
  min-height: 52px;
  border: 0;
  background: transparent;
  color: #737c88;
  font-size: 19px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-tabs button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
}

.auth-tabs button:hover {
  color: #d8dde3;
}

.auth-tabs button.active {
  color: #fff;
}

.auth-tabs button.active::after {
  background: var(--red);
}

.auth-form {
  display: grid;
  gap: 22px;
}

.auth-field {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.auth-field > span {
  color: #bac2cc;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-input-shell {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px solid #38424e;
  border-radius: 8px;
  background: #0b1118;
  padding: 0 17px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.auth-input-shell:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239, 47, 50, 0.1);
}

.auth-input-shell input {
  width: 100%;
  min-width: 0;
  height: 54px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f5f7f9;
  font-size: 16px;
}

.auth-input-shell input::placeholder {
  color: #67717d;
}

.auth-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
}

.auth-input-icon {
  color: #8d97a3;
}

.auth-password-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9ca6b2;
  padding: 0;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  background: #151e27;
  color: #fff;
}

.auth-form-options {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #c4cbd3;
  cursor: pointer;
}

.auth-remember input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-remember > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid #4a5561;
  border-radius: 6px;
  background: #0b1117;
  color: transparent;
}

.auth-remember .auth-icon {
  width: 16px;
  height: 16px;
}

.auth-remember input:focus-visible + span {
  outline: 2px solid rgba(239, 47, 50, 0.65);
  outline-offset: 2px;
}

.auth-remember input:checked + span {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.auth-remember b {
  font-size: 14px;
  font-weight: 500;
}

.auth-text-button {
  border: 0;
  background: transparent;
  color: #ff3437;
  padding: 4px 0;
  font-weight: 700;
}

.auth-text-button:hover,
.auth-text-button:focus-visible {
  color: #ff686a;
  text-decoration: underline;
}

.auth-message {
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
}

.auth-message.error {
  border-color: rgba(239, 47, 50, 0.46);
  background: rgba(239, 47, 50, 0.09);
  color: #ff8b8d;
}

.auth-message.notice {
  border-color: rgba(66, 153, 225, 0.38);
  background: rgba(42, 108, 165, 0.1);
  color: #a9cff5;
}

.auth-submit {
  min-height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #ff4144;
  border-radius: 8px;
  background: #ef2f32;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 12px 30px rgba(239, 47, 50, 0.18);
}

.auth-submit:hover {
  background: #ff383b;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 700ms linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-footer-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
  border-top: 1px solid #2b343f;
  padding-top: 30px;
  color: #b7bfc8;
  font-size: 15px;
}

.auth-dot-grid {
  position: absolute;
  z-index: -1;
  width: 122px;
  height: 122px;
  opacity: 0.38;
  background-image: radial-gradient(circle, #77818d 1px, transparent 1.5px);
  background-size: 18px 18px;
}

.auth-dot-grid-top {
  top: 38px;
  right: 38px;
}

.auth-dot-grid-bottom {
  bottom: 28px;
  left: 28px;
}

.auth-corner-lines {
  position: absolute;
  z-index: -1;
  width: 320px;
  height: 390px;
  border: 1px solid rgba(129, 140, 153, 0.24);
  border-radius: 46%;
  box-shadow:
    0 0 0 12px rgba(129, 140, 153, 0.11),
    0 0 0 24px rgba(129, 140, 153, 0.08),
    0 0 0 36px rgba(239, 47, 50, 0.1),
    0 0 0 48px rgba(129, 140, 153, 0.06);
}

.auth-corner-lines-left {
  top: 46%;
  left: -286px;
  transform: rotate(-18deg);
}

.auth-corner-lines-right {
  right: -286px;
  bottom: -12%;
  transform: rotate(20deg);
}

.settings-signout-row {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid #27323d;
  padding-top: 20px;
}

.settings-signout-row > span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.settings-signout-row strong {
  color: #edf1f5;
  font-size: 14px;
}

.settings-signout-row small {
  color: #8f9aa6;
  font-size: 12px;
}

.settings-signout-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(239, 47, 50, 0.58);
  border-radius: 7px;
  background: rgba(239, 47, 50, 0.08);
  color: #ff6668;
  padding: 0 16px;
  font-weight: 800;
  white-space: nowrap;
}

.settings-signout-button:hover {
  border-color: var(--red);
  background: rgba(239, 47, 50, 0.16);
  color: #fff;
}

.settings-signout-button .settings-icon {
  width: 17px;
  height: 17px;
}

@media (max-height: 850px) and (min-width: 701px) {
  .auth-screen {
    padding-block: 18px;
  }

  .auth-panel {
    padding: 28px 48px 26px;
  }

  .auth-brand {
    width: 390px;
    margin-bottom: 18px;
  }

  .auth-tabs {
    margin-bottom: 20px;
  }

  .auth-tabs button {
    min-height: 44px;
    font-size: 17px;
  }

  .auth-form {
    gap: 14px;
  }

  .auth-field {
    gap: 6px;
  }

  .auth-input-shell {
    min-height: 50px;
  }

  .auth-input-shell input {
    height: 46px;
  }

  .auth-submit {
    min-height: 52px;
  }

  .auth-footer-switch {
    margin-top: 22px;
    padding-top: 20px;
  }
}

@media (max-width: 700px) {
  .auth-screen {
    padding: 18px 14px;
  }

  .auth-panel {
    margin: 0 auto;
    padding: 30px 22px 26px;
  }

  .auth-brand {
    width: min(380px, 100%);
    margin-bottom: 20px;
  }

  .auth-tabs {
    margin-bottom: 24px;
  }

  .auth-tabs button {
    min-height: 46px;
    font-size: 16px;
  }

  .auth-form {
    gap: 17px;
  }

  .auth-input-shell {
    min-height: 54px;
    padding-inline: 14px;
  }

  .auth-input-shell input {
    height: 50px;
    font-size: 15px;
  }

  .auth-form-options,
  .settings-signout-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-submit {
    min-height: 56px;
  }

  .auth-footer-switch {
    flex-wrap: wrap;
    margin-top: 26px;
    padding-top: 24px;
  }

  .auth-dot-grid,
  .auth-corner-lines {
    display: none;
  }
}

@media (max-width: 420px) {
  .auth-panel {
    padding-inline: 17px;
  }

  .auth-brand > span {
    width: 1px;
  }

  .auth-input-shell {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 11px;
  }

  .auth-remember b,
  .auth-text-button {
    font-size: 13px;
  }
}

/* Keep the primary analysis workspaces inside short landscape viewports. */
@media (min-width: 901px) and (max-height: 900px) {
  .overview-page {
    height: 100vh;
    min-height: 0;
    display: grid;
    grid-template-rows: auto 136px minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
    padding: 12px 20px;
  }

  .overview-topbar,
  .overview-kpis {
    margin-bottom: 0;
  }

  .overview-topbar {
    min-height: 48px;
  }

  .overview-topbar p {
    margin-bottom: 3px;
    font-size: 11px;
  }

  .overview-topbar h1 {
    font-size: 24px;
  }

  .overview-select {
    min-height: 36px;
  }

  .overview-kpis {
    height: 136px;
    min-height: 0;
    gap: 10px;
  }

  .overview-kpi-card,
  .overview-performance-card {
    height: 100%;
    min-height: 0;
    padding: 12px 14px;
    gap: 6px;
  }

  .overview-kpi-card.has-spark {
    padding-bottom: 34px;
  }

  .overview-card-title {
    gap: 8px;
    font-size: 11px;
  }

  .overview-card-title .overview-icon {
    width: 21px;
    height: 21px;
  }

  .overview-kpi-card strong {
    font-size: 27px;
  }

  .overview-kpi-card small {
    font-size: 10px;
    line-height: 1.2;
  }

  .overview-kpi-spark {
    right: 14px;
    bottom: 8px;
    left: 14px;
    height: 19px;
  }

  .overview-performance-card .overview-card-title {
    font-size: 10px;
  }

  .overview-performance-card .overview-card-title .overview-icon {
    width: 19px;
    height: 19px;
  }

  .overview-score-list {
    gap: 1px;
  }

  .overview-score-row {
    height: 14px;
    min-height: 0;
    font-size: 9px;
    line-height: 1;
  }

  .overview-score-track {
    height: 4px;
  }

  .overview-score-row strong {
    font-size: 8px;
    line-height: 1;
  }

  .overview-score-row em {
    font-size: 10px;
    line-height: 1;
  }

  .overview-layout {
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1.04fr) minmax(0, 1fr);
    gap: 10px;
  }

  .overview-trend-card,
  .overview-recent-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .overview-trend-card,
  .overview-weather-card,
  .overview-recent-card,
  .overview-quick-card {
    min-height: 0;
  }

  .overview-weather-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .overview-panel-head {
    min-height: 44px;
    padding: 7px 13px;
  }

  .overview-trend-card canvas {
    height: 100%;
    min-height: 0;
  }

  .weather-body {
    height: 100%;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 3px;
  }

  .weather-main {
    height: 100%;
    align-content: center;
    gap: 3px;
    padding-right: 12px;
  }

  .weather-main strong {
    margin-top: 4px;
    font-size: 52px;
  }

  .weather-main > span {
    font-size: 17px;
  }

  .weather-main small,
  .weather-main em,
  .weather-metric span {
    font-size: 11px;
  }

  .weather-location {
    font-size: 17px;
  }

  .weather-grid {
    height: 100%;
    align-content: center;
    gap: 8px 10px;
  }

  .weather-metric {
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 2px 7px;
  }

  .weather-metric .overview-icon {
    width: 24px;
    height: 24px;
  }

  .weather-metric strong {
    font-size: 16px;
  }

  .weather-source {
    padding: 0 16px 5px;
    font-size: 9px;
  }

  .overview-recent-carousel {
    height: 100%;
    min-height: 0;
    padding: 6px 10px 8px;
  }

  .overview-recent-session-card {
    flex-basis: clamp(168px, calc((100% - 36px) / 4), 205px);
    min-height: 0;
    grid-template-rows: 68px auto auto auto auto auto 1fr;
  }

  .overview-recent-track-art {
    height: 68px;
    padding: 0 2px 4px;
  }

  .overview-recent-driver,
  .overview-recent-best-lap,
  .overview-recent-car {
    margin-top: 3px;
  }

  .overview-recent-type {
    margin-top: 5px;
  }

  .overview-recent-date {
    margin-top: 5px;
    padding-block: 6px;
  }

  @media (min-height: 800px) {
    .overview-layout {
      grid-template-rows: minmax(0, 0.98fr) minmax(0, 1.06fr);
    }

    .overview-recent-session-card {
      flex-basis: clamp(205px, calc((100% - 36px) / 4), 230px);
      grid-template-rows: 132px auto auto auto auto auto minmax(0, 1fr);
    }

    .overview-recent-track-art {
      height: 122px;
      padding: 0 2px 4px;
    }
  }

  .overview-quick-card {
    display: grid;
    grid-template-rows: auto minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 10px;
    padding-bottom: 10px;
  }

  .overview-primary-action {
    width: calc(100% - 24px);
    height: 100%;
    min-height: 0;
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    gap: 14px;
    margin: 0 12px;
    padding: 12px 17px;
  }

  .overview-primary-action .overview-icon {
    width: 38px;
    height: 38px;
  }

  .overview-primary-action strong {
    margin-bottom: 3px;
    font-size: 16px;
  }

  .overview-primary-action small {
    font-size: 11px;
  }

  .overview-action-grid {
    height: 100%;
    gap: 10px;
    padding: 0 12px;
  }

  .overview-action-tile {
    height: 100%;
    min-height: 0;
    gap: 8px;
    padding: 12px;
    font-size: 12px;
  }

  .overview-action-tile .overview-icon {
    width: 32px;
    height: 32px;
  }

  .app-shell:not(.immersive-shell) .corner-report-page {
    height: calc(100vh - 36px);
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    padding: 12px;
  }

  .app-shell:not(.immersive-shell) .corner-topbar {
    gap: 10px;
    margin-bottom: 10px;
  }

  .app-shell:not(.immersive-shell) .corner-scoreboard {
    min-height: 70px;
  }

  .app-shell:not(.immersive-shell) .corner-score-card {
    gap: 5px;
    padding: 11px 14px;
  }

  .app-shell:not(.immersive-shell) .corner-score-card strong {
    font-size: 20px;
  }

  .app-shell:not(.immersive-shell) .time-loss {
    min-height: 64px;
    padding-left: 14px;
  }

  .app-shell:not(.immersive-shell) .time-loss strong {
    font-size: 22px;
  }

  .app-shell:not(.immersive-shell) .corner-actions .soft-button,
  .app-shell:not(.immersive-shell) .corner-stepper {
    min-height: 42px;
    font-size: 12px;
  }

  .app-shell:not(.immersive-shell) .corner-actions .soft-button {
    padding: 0 14px;
  }

  .app-shell:not(.immersive-shell) .corner-stepper {
    grid-template-columns: 36px minmax(86px, 1fr) 36px;
  }

  .app-shell:not(.immersive-shell) .corner-report-grid {
    height: 100%;
    min-height: 0;
    gap: 10px;
  }

  .app-shell:not(.immersive-shell) .corner-left {
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) 110px;
    gap: 10px;
    align-self: stretch;
  }

  .app-shell:not(.immersive-shell) .corner-map-card,
  .app-shell:not(.immersive-shell) .corner-bottom-card {
    min-height: 0;
  }

  .app-shell:not(.immersive-shell) .corner-bottom-card {
    height: 110px;
  }

  .app-shell:not(.immersive-shell) .corner-event-card,
  .app-shell:not(.immersive-shell) .corner-bottom-card .corner-event-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 11px 13px;
  }

  .app-shell:not(.immersive-shell) .corner-event-icon {
    display: none;
  }

  .app-shell:not(.immersive-shell) .corner-graphs-card {
    height: 100%;
    min-height: 0;
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .app-shell:not(.immersive-shell) .corner-tabs {
    min-height: 58px;
    padding: 0 16px;
  }

  .app-shell:not(.immersive-shell) .corner-graph-stack {
    min-height: 0;
    grid-auto-rows: minmax(0, 1fr);
    overflow: hidden auto;
    padding: 0 14px 10px;
  }

  .app-shell:not(.immersive-shell) .corner-graph-row {
    height: auto;
    min-height: 0;
  }

  .app-shell:not(.immersive-shell) .corner-graph-canvas,
  .app-shell:not(.immersive-shell) .corner-graph-canvas canvas {
    height: calc(100% - 14px);
    min-height: 0;
  }
}

@media (min-width: 901px) and (max-width: 1150px) and (max-height: 900px) {
  .overview-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .overview-score-row {
    grid-template-columns: minmax(52px, 0.9fr) minmax(38px, 1fr) 28px 10px;
    gap: 4px;
  }

  .overview-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.85fr);
  }

  .overview-trend-card,
  .overview-recent-card {
    grid-column: auto;
  }

  .weather-body {
    grid-template-columns: minmax(120px, 0.75fr) minmax(140px, 1fr);
  }

  .weather-main {
    border-right: 1px solid #283440;
    border-bottom: 0;
    padding-bottom: 0;
  }
}

@media (min-width: 901px) and (max-height: 1000px) {
  .session-library-page:not(.track-session-page) {
    height: 100vh;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 10px;
    overflow: hidden;
    padding: 12px 18px;
  }

  .session-library-page:not(.track-session-page) .library-topbar,
  .session-library-page:not(.track-session-page) .library-filter-panel,
  .session-library-page:not(.track-session-page) .track-pagination {
    margin: 0;
  }

  .session-library-page:not(.track-session-page) .library-filter-panel {
    padding: 10px;
  }

  .session-library-page:not(.track-session-page) .library-filter {
    min-height: 56px;
    gap: 3px;
    padding: 8px 11px;
  }

  .session-library-page:not(.track-session-page) .library-search-row {
    gap: 10px;
    margin-top: 8px;
  }

  .session-library-page:not(.track-session-page) .library-search-input {
    min-height: 36px;
  }

  .session-library-page:not(.track-session-page) .track-card-grid {
    min-height: 0;
    grid-auto-rows: minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
  }

  .session-library-page:not(.track-session-page) .track-library-card {
    height: 100%;
    min-height: 0;
    gap: 14px;
    padding: 42px 16px 16px;
  }

  .session-library-page:not(.track-session-page) .track-session-count {
    top: 12px;
    left: 12px;
    padding: 5px 9px;
  }

  .session-library-page:not(.track-session-page) .track-card-copy {
    gap: 6px;
  }

  .session-library-page:not(.track-session-page) .track-tags em {
    padding: 5px 7px;
    font-size: 11px;
  }

  .session-library-page:not(.track-session-page) .track-pagination {
    min-height: 32px;
  }
}

@media (min-width: 901px) and (max-width: 1150px) and (max-height: 1000px) {
  .session-library-page:not(.track-session-page) .library-filter-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .session-library-page:not(.track-session-page) .track-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .session-library-page:not(.track-session-page) .track-library-card {
    grid-template-columns: minmax(92px, 0.65fr) minmax(0, 1fr);
    gap: 10px;
    padding-inline: 12px;
  }

  .session-library-page:not(.track-session-page) .library-filter span,
  .session-library-page:not(.track-session-page) .library-select {
    font-size: 10px;
  }
}

/* Compact laptops need readable density and vertical scrolling, not viewport clipping. */
@media (min-width: 901px) and (max-height: 1000px) {
  .overview-page {
    height: auto;
    min-height: calc(100vh - 36px);
    display: block;
    overflow: visible;
    padding: 16px 20px 24px;
  }

  .overview-topbar {
    margin-bottom: 14px;
  }

  .overview-kpis {
    height: auto;
    margin-bottom: 14px;
  }

  .overview-kpi-card,
  .overview-performance-card {
    height: auto;
    min-height: 136px;
  }

  .overview-layout {
    height: auto;
    grid-template-rows: auto auto;
  }

  .overview-trend-card,
  .overview-weather-card {
    min-height: 300px;
  }

  .overview-trend-card canvas {
    height: 236px;
  }

  .overview-recent-card,
  .overview-quick-card {
    min-height: 280px;
  }

  .overview-recent-carousel {
    height: auto;
    min-height: 0;
  }

  .weather-actions .soft-button {
    max-width: none;
    padding-inline: 8px;
    font-size: 11px;
  }

  .session-library-page:not(.track-session-page) {
    height: auto;
    min-height: calc(100vh - 36px);
    display: block;
    overflow: visible;
    padding: 16px 18px 72px;
  }

  .session-library-page:not(.track-session-page) .library-topbar {
    margin-bottom: 14px;
  }

  .session-library-page:not(.track-session-page) .library-filter-panel {
    margin-bottom: 14px;
  }

  .session-library-page:not(.track-session-page) .track-card-grid {
    grid-auto-rows: auto;
    overflow: visible;
  }

  .session-library-page:not(.track-session-page) .track-library-card {
    height: auto;
    min-height: 230px;
  }

  .session-library-page:not(.track-session-page) .track-pagination {
    margin-top: 14px;
  }

  .app-shell:not(.immersive-shell) .corner-report-page {
    height: auto;
    min-height: calc(100vh - 36px);
    overflow: visible;
  }

  .app-shell:not(.immersive-shell) .corner-report-grid {
    height: auto;
    min-height: 620px;
  }

  .app-shell:not(.immersive-shell) .corner-left,
  .app-shell:not(.immersive-shell) .corner-graphs-card {
    height: auto;
    min-height: 620px;
  }

  .app-shell:not(.immersive-shell) .corner-graph-stack {
    overflow: visible;
  }

  .app-shell:not(.immersive-shell) .corner-graph-row {
    min-height: 118px;
    grid-template-columns: 62px minmax(0, 1fr) 142px;
    gap: 7px;
  }

  .app-shell:not(.immersive-shell) .corner-graph-canvas,
  .app-shell:not(.immersive-shell) .corner-graph-canvas canvas {
    height: 104px;
  }

  .app-shell:not(.immersive-shell) .corner-title-block h1 {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    font-size: 18px;
    line-height: 1.12;
  }

  .app-shell:not(.immersive-shell) .corner-graph-label,
  .app-shell:not(.immersive-shell) .corner-graph-side {
    font-size: 9px;
  }

  .app-shell:not(.immersive-shell) .corner-graph-side .legend-line {
    width: 20px;
    margin-right: 5px;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.8fr);
    grid-template-rows: auto auto;
  }

  .overview-trend-card,
  .overview-recent-card {
    grid-column: auto;
  }

  .weather-body {
    grid-template-columns: 1fr;
  }

  .weather-main {
    border-right: 0;
    border-bottom: 1px solid #283440;
    padding: 0 0 14px;
  }

  .session-library-page:not(.track-session-page) .library-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .session-library-page:not(.track-session-page) .track-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session-library-page:not(.track-session-page) .track-library-card {
    grid-template-columns: minmax(116px, 0.68fr) minmax(0, 1fr);
    gap: 14px;
    padding: 44px 16px 20px;
  }

  .settings-topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .settings-context {
    max-width: 100%;
    flex-wrap: wrap;
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  .overview-recent-session-card {
    flex-basis: 168px;
  }
}

.folder-import-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 auto;
}

.folder-import-icon.is-spinning {
  animation: folder-import-spin 0.9s linear infinite;
}

@keyframes folder-import-spin {
  to {
    transform: rotate(360deg);
  }
}

.folder-sync-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 14px 20px;
  margin-bottom: 18px;
  border: 1px solid #283540;
  border-left: 3px solid #ef2f32;
  border-radius: 7px;
  background: #0b1319;
  padding: 14px 16px;
}

.folder-sync-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.folder-sync-symbol {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #33424e;
  border-radius: 7px;
  background: #111c24;
  color: #ff5d60;
}

.folder-sync-symbol .folder-import-icon {
  width: 22px;
  height: 22px;
}

.folder-sync-identity strong,
.folder-sync-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-sync-identity strong {
  font-size: 14px;
}

.folder-sync-identity small {
  margin-top: 4px;
  color: #9eabb7;
  font-size: 11px;
}

.folder-sync-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(56px, auto));
  align-items: center;
}

.folder-sync-summary > span {
  min-width: 64px;
  border-left: 1px solid #283540;
  padding: 0 14px;
}

.folder-sync-summary small,
.folder-sync-summary strong {
  display: block;
}

.folder-sync-summary small {
  color: #8f9ba7;
  font-size: 9px;
  text-transform: uppercase;
}

.folder-sync-summary strong {
  margin-top: 3px;
  font-size: 16px;
}

.folder-sync-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.folder-sync-actions .soft-button,
.folder-sync-actions .danger-button,
.setup-actions .soft-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-inline: 12px;
  white-space: nowrap;
}

.folder-sync-actions .icon-button {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
}

.folder-directory-picker {
  cursor: pointer;
}

.folder-directory-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  inset: auto auto 0 0;
}

.folder-sync-message,
.folder-sync-error {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  border-top: 1px solid #25313b;
  padding-top: 9px;
  font-size: 11px;
}

.folder-sync-message {
  color: #8bd99a;
}

.folder-sync-error {
  color: #ff9698;
}

.setup-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.folder-review-modal {
  width: min(1180px, calc(100vw - 40px));
  max-height: min(800px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #33414d;
  border-radius: 8px;
  background: #0c141b;
  color: #f4f7fb;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
}

.folder-review-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #283540;
  padding: 18px 22px;
}

.folder-review-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.folder-review-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #aab6c2;
  font-size: 11px;
}

.folder-review-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.folder-review-progress span {
  color: #aab6c2;
  font-size: 11px;
}

.folder-review-progress strong {
  min-width: 64px;
  border: 1px solid #3b4853;
  border-radius: 6px;
  padding: 7px 9px;
  text-align: center;
  font-size: 12px;
}

.folder-review-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.folder-review-queue {
  min-height: 0;
  overflow: hidden auto;
  border-right: 1px solid #283540;
  background: #081017;
  padding: 8px;
}

.folder-queue-item {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #e9eef3;
  padding: 9px;
  text-align: left;
}

.folder-queue-item + .folder-queue-item {
  margin-top: 4px;
}

.folder-queue-item:hover:not(:disabled),
.folder-queue-item.active {
  border-color: #3a4854;
  background: #131d25;
}

.folder-queue-item.active {
  border-left-color: #ef2f32;
}

.folder-queue-item:disabled {
  cursor: default;
  opacity: 0.72;
}

.folder-queue-item > span:nth-child(2) {
  min-width: 0;
}

.folder-queue-item strong,
.folder-queue-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-queue-item strong {
  font-size: 11px;
}

.folder-queue-item small {
  margin-top: 4px;
  color: #84919d;
  font-size: 9px;
}

.folder-queue-item em {
  color: #9ba7b2;
  font-size: 8px;
  font-style: normal;
  white-space: nowrap;
}

.folder-queue-status {
  display: grid;
  place-items: center;
  color: #768592;
}

.folder-queue-item.ready .folder-queue-status,
.folder-queue-item.imported .folder-queue-status {
  color: #42c36a;
}

.folder-queue-item.error .folder-queue-status {
  color: #ff696c;
}

.folder-review-workspace {
  min-width: 0;
  min-height: 0;
  overflow: hidden auto;
  padding: 18px 22px 22px;
}

.folder-current-file {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #283540;
  padding-bottom: 14px;
}

.folder-current-file-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #35434e;
  border-radius: 7px;
  background: #111c24;
  color: #ff5d60;
}

.folder-current-file strong,
.folder-current-file small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-current-file strong {
  font-size: 14px;
}

.folder-current-file small {
  margin-top: 4px;
  color: #96a3af;
  font-size: 10px;
}

.folder-current-file > em {
  border: 1px solid #3a4854;
  border-radius: 5px;
  color: #b8c2cc;
  padding: 6px 8px;
  font-size: 9px;
  font-style: normal;
}

.folder-current-file > em.ready {
  border-color: rgba(66, 195, 106, 0.45);
  color: #79d993;
}

.folder-current-file > em.error {
  border-color: rgba(239, 47, 50, 0.48);
  color: #ff8b8e;
}

.folder-preview-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.folder-preview-facts > span {
  min-width: 0;
  border-left: 2px solid #33424e;
  padding: 4px 9px;
}

.folder-preview-facts small,
.folder-preview-facts strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-preview-facts small {
  color: #8f9ba7;
  font-size: 9px;
  text-transform: uppercase;
}

.folder-preview-facts strong {
  margin-top: 5px;
  font-size: 12px;
}

.folder-metadata-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
}

.folder-metadata-head h3 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
}

.folder-metadata-head span {
  color: #91cc9e;
  font-size: 10px;
}

.folder-metadata-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.folder-review-loading,
.folder-review-complete {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #afbac5;
  text-align: center;
}

.folder-review-loading .folder-import-icon,
.folder-review-complete .folder-import-icon {
  width: 34px;
  height: 34px;
  color: #ef2f32;
}

.folder-review-complete h3,
.folder-review-complete p {
  margin: 0;
}

.folder-review-complete h3 {
  color: #f4f7fb;
  font-size: 20px;
}

.folder-review-actions {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #283540;
  padding: 12px 22px;
}

.folder-review-actions .soft-button,
.folder-review-actions .danger-button {
  min-width: 122px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

@media (max-width: 1180px) {
  .folder-sync-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .folder-sync-summary {
    justify-content: start;
  }

  .folder-sync-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .folder-review-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .folder-review-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .folder-metadata-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .folder-preview-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .folder-sync-summary {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .folder-sync-summary > span {
    padding-inline: 9px;
  }

  .folder-sync-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .folder-sync-actions .soft-button,
  .folder-sync-actions .danger-button,
  .folder-sync-actions .icon-button {
    min-width: 0;
    width: 100%;
    padding-inline: 6px;
    font-size: 10px;
  }

  .folder-sync-actions .folder-import-icon {
    width: 15px;
    height: 15px;
  }

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

  .folder-review-head {
    grid-template-columns: minmax(0, 1fr) 32px;
    padding: 14px;
  }

  .folder-review-progress {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
  }

  .folder-review-layout {
    display: block;
    overflow: hidden auto;
  }

  .folder-review-queue {
    max-height: 150px;
    border-right: 0;
    border-bottom: 1px solid #283540;
  }

  .folder-review-workspace {
    overflow: visible;
    padding: 14px;
  }

  .folder-metadata-form,
  .folder-preview-facts {
    grid-template-columns: 1fr;
  }

  .folder-review-actions {
    flex-wrap: wrap;
    padding: 10px 14px;
  }

  .folder-review-actions .soft-button,
  .folder-review-actions .danger-button {
    min-width: 0;
    flex: 1 1 120px;
  }
}

/* Internal user administration and storage quota feedback. */
.admin-page {
  min-height: calc(100vh - 36px);
  margin: -18px;
  padding: 26px 30px 30px;
  background:
    linear-gradient(135deg, rgba(10, 17, 24, 0.98), rgba(4, 8, 12, 0.99)),
    #060a0e;
  color: #f2f5f8;
}

.admin-topbar,
.admin-panel-head,
.admin-row-actions,
.admin-notice,
.admin-error,
.admin-modal header,
.admin-modal footer,
.access-denied-icon {
  display: flex;
  align-items: center;
}

.admin-topbar {
  min-height: 64px;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.admin-topbar h1,
.admin-panel-head h2,
.admin-modal h2 {
  margin: 0;
  letter-spacing: 0;
}

.admin-topbar h1 {
  font-size: 26px;
}

.admin-topbar p,
.admin-panel-head p,
.admin-modal header p {
  margin: 6px 0 0;
  color: #9ca7b3;
}

.admin-topbar .danger-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-topbar .settings-icon,
.admin-refresh-button .settings-icon,
.admin-icon-button .settings-icon,
.admin-status-button .settings-icon,
.admin-modal-close .settings-icon {
  width: 17px;
  height: 17px;
}

.admin-notice,
.admin-error {
  min-height: 42px;
  gap: 9px;
  margin-bottom: 12px;
  border: 1px solid rgba(36, 188, 91, 0.34);
  border-radius: 7px;
  background: rgba(20, 122, 57, 0.12);
  color: #72dc97;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 800;
}

.admin-error {
  border-color: rgba(239, 47, 50, 0.42);
  background: rgba(239, 47, 50, 0.1);
  color: #ff8083;
}

.admin-notice .settings-icon,
.admin-error .settings-icon {
  width: 18px;
  height: 18px;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-summary > div {
  min-width: 0;
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid #242e39;
  border-radius: 7px;
  background: #0d141b;
  padding: 16px 18px;
}

.admin-summary span {
  color: #929da9;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-summary strong {
  color: #f4f7fa;
  font-size: 24px;
}

.admin-user-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #242e39;
  border-radius: 8px;
  background: rgba(13, 20, 27, 0.96);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.22);
}

.admin-panel-head {
  min-height: 74px;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #27313c;
  padding: 14px 18px;
}

.admin-panel-head h2 {
  font-size: 16px;
}

.admin-panel-head p {
  font-size: 11px;
}

.admin-refresh-button,
.admin-icon-button,
.admin-status-button,
.admin-modal-close {
  border: 1px solid #303b47;
  border-radius: 6px;
  background: #0c131a;
  color: #d8e0e8;
}

.admin-refresh-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 800;
}

.admin-refresh-button:hover,
.admin-icon-button:hover {
  border-color: #52606e;
  background: #131e27;
  color: #fff;
}

.admin-table-scroll {
  max-width: 100%;
  overflow: auto;
}

.admin-user-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
}

.admin-user-table th,
.admin-user-table td {
  border-bottom: 1px solid #222d37;
  padding: 13px 12px;
  text-align: left;
  vertical-align: middle;
}

.admin-user-table th {
  height: 42px;
  background: #0a1117;
  color: #8f9ba7;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-user-table th:nth-child(1) { width: 150px; }
.admin-user-table th:nth-child(2) { width: 190px; }
.admin-user-table th:nth-child(3) { width: 100px; }
.admin-user-table th:nth-child(4) { width: 82px; }
.admin-user-table th:nth-child(5),
.admin-user-table th:nth-child(6) { width: 95px; }
.admin-user-table th:nth-child(7) { width: 130px; }
.admin-user-table th:nth-child(8) { width: 100px; }
.admin-user-table th:nth-child(9) { width: 178px; }

.admin-user-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.admin-user-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-user-name {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.admin-user-name i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #394552;
  border-radius: 50%;
  background: #111a22;
  color: #eef2f6;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.admin-user-name strong,
.admin-user-email,
.admin-created-date {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-name strong {
  font-size: 12px;
}

.admin-user-email,
.admin-created-date {
  display: block;
  color: #aab4bf;
  font-size: 11px;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid #34414d;
  border-radius: 4px;
  background: #111a22;
  color: #c9d2da;
  padding: 0 8px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-badge.role-admin {
  border-color: rgba(45, 125, 255, 0.38);
  background: rgba(45, 125, 255, 0.1);
  color: #6ca6ff;
}

.admin-badge.status-active {
  border-color: rgba(36, 188, 91, 0.35);
  background: rgba(24, 168, 68, 0.1);
  color: #68d88d;
}

.admin-badge.status-pending {
  border-color: rgba(227, 163, 38, 0.38);
  background: rgba(227, 163, 38, 0.1);
  color: #e7bd58;
}

.admin-badge.status-disabled {
  border-color: rgba(239, 47, 50, 0.38);
  background: rgba(239, 47, 50, 0.1);
  color: #ff777a;
}

.admin-usage {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) 42px;
  align-items: center;
  gap: 7px;
}

.admin-usage > span {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: #26313b;
}

.admin-usage > span i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #28ae58;
}

.admin-usage strong {
  color: #b9c3cc;
  font-size: 10px;
  text-align: right;
}

.admin-usage.warning > span i { background: #e3a326; }
.admin-usage.critical > span i,
.admin-usage.full > span i { background: var(--red); }
.admin-usage.warning strong { color: #e7bd58; }
.admin-usage.critical strong,
.admin-usage.full strong { color: #ff6f72; }

.admin-row-actions {
  gap: 6px;
}

.admin-icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
}

.admin-status-button {
  min-width: 68px;
  min-height: 32px;
  border-color: rgba(239, 47, 50, 0.42);
  color: #ff7477;
  padding: 0 9px;
  font-size: 9px;
  font-weight: 900;
}

.admin-status-button.enable {
  border-color: rgba(36, 188, 91, 0.38);
  color: #6bdc91;
}

.admin-status-button:hover {
  background: rgba(239, 47, 50, 0.1);
}

.admin-status-button.enable:hover {
  background: rgba(24, 168, 68, 0.1);
}

.admin-empty {
  height: 132px;
  color: #8f9aa6;
  text-align: center !important;
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 9, 0.76);
  padding: 18px;
}

.admin-modal {
  width: min(530px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid #34404c;
  border-radius: 8px;
  background: #0e151c;
  color: #f2f5f8;
  box-shadow: 0 30px 84px rgba(0, 0, 0, 0.48);
}

.admin-modal header {
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #27323d;
  padding: 20px 22px;
}

.admin-modal h2 {
  font-size: 18px;
}

.admin-modal header p {
  font-size: 11px;
}

.admin-modal-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
}

.admin-form-error {
  margin: 14px 22px 0;
  border: 1px solid rgba(239, 47, 50, 0.38);
  border-radius: 6px;
  background: rgba(239, 47, 50, 0.09);
  color: #ff7b7e;
  padding: 10px 12px;
  font-size: 11px;
}

.admin-user-form {
  display: grid;
  gap: 15px;
  padding: 20px 22px 22px;
}

.admin-user-form > label {
  display: grid;
  gap: 7px;
  color: #b6c0c9;
  font-size: 11px;
}

.admin-user-form input,
.admin-user-form select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid #2e3944;
  border-radius: 6px;
  outline: 0;
  background: #0a1117;
  color: #f2f5f8;
  padding: 0 12px;
}

.admin-user-form input:focus,
.admin-user-form select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(239, 47, 50, 0.1);
}

.admin-user-form label small,
.admin-quota-user small {
  color: #7f8b97;
  font-size: 10px;
}

.admin-user-form footer {
  justify-content: flex-end;
  gap: 9px;
  margin-top: 5px;
}

.admin-quota-user {
  display: grid;
  gap: 5px;
  border-left: 2px solid var(--red);
  background: rgba(255, 255, 255, 0.025);
  padding: 10px 12px;
}

.admin-quota-user span {
  font-weight: 900;
}

.admin-quota-user strong {
  color: #aeb8c2;
  font-size: 11px;
}

.upload-quota-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.upload-quota-details span {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(239, 47, 50, 0.26);
  border-radius: 5px;
  padding: 7px;
}

.upload-quota-details small {
  color: #c99294;
  font-size: 8px;
  text-transform: uppercase;
}

.upload-quota-details b {
  font-size: 10px;
}

.settings-storage-warning {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e7bd58;
  font-size: 10px;
}

.settings-storage-warning.critical,
.settings-storage-warning.full {
  color: #ff7477;
}

.settings-storage-warning .settings-icon {
  width: 15px;
  height: 15px;
}

.settings-storage-meter.warning b { background: #e3a326; }
.settings-storage-meter.critical b,
.settings-storage-meter.full b { background: var(--red); }

.auth-local-heading {
  display: grid;
  gap: 7px;
  border-bottom: 1px solid #303843;
  padding: 0 0 20px;
  text-align: center;
}

.auth-local-heading strong {
  color: #f4f7fb;
  font-size: 20px;
  text-transform: uppercase;
}

.auth-local-heading span {
  color: #8f99a5;
  font-size: 12px;
}

.auth-footer-switch > span {
  text-align: center;
}

.access-denied-screen {
  display: grid;
  place-items: center;
  padding: 24px;
}

.access-denied-panel {
  width: min(520px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  border: 1px solid #3a444f;
  border-radius: 8px;
  background: rgba(14, 20, 27, 0.98);
  padding: 36px;
  color: #f3f6f9;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.access-denied-logo {
  width: min(300px, 88%);
  height: 92px;
  object-fit: contain;
  margin-bottom: 2px;
}

.access-denied-icon {
  width: 48px;
  height: 48px;
  justify-content: center;
  border: 1px solid rgba(239, 47, 50, 0.42);
  border-radius: 50%;
  background: rgba(239, 47, 50, 0.1);
  color: #ff5f62;
}

.access-denied-icon .auth-icon {
  width: 23px;
  height: 23px;
}

.access-denied-panel h1,
.access-denied-panel p {
  margin: 0;
}

.access-denied-panel h1 {
  font-size: 22px;
}

.access-denied-panel p {
  max-width: 390px;
  color: #aab4bf;
  line-height: 1.55;
}

.access-denied-panel > small {
  color: #717d89;
  font-size: 9px;
}

.access-denied-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

@media (max-width: 1180px) {
  .admin-page {
    padding: 22px;
  }

  .admin-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .admin-page {
    padding: 18px;
  }

  .admin-topbar,
  .admin-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-topbar .danger-button,
  .admin-refresh-button {
    width: 100%;
    justify-content: center;
  }

  .admin-summary {
    grid-template-columns: 1fr 1fr;
  }

  .admin-summary > div {
    min-height: 78px;
    padding: 12px;
  }

  .admin-summary strong {
    font-size: 19px;
  }

  .admin-modal-backdrop {
    padding: 8px;
  }

  .upload-quota-details {
    grid-template-columns: 1fr;
  }
}

/* Light theme changes color only. Layout, spacing, telemetry colors, and map content stay shared. */
html[data-theme="light"] {
  color-scheme: light;
  --dark: #f4f6f8;
  --dark-2: #ffffff;
  --dark-3: #e9edf2;
  --surface: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #d9e0e7;
  --line-dark: #cbd4de;
  --text: #111820;
  --muted: #64707d;
  --shadow: 0 14px 38px rgba(24, 35, 48, 0.09);
}

html[data-theme="light"] body,
html[data-theme="light"] .app-shell,
html[data-theme="light"] .page,
html[data-theme="light"] .app-shell.corner-shell,
html[data-theme="light"] .corner-shell .page,
html[data-theme="light"] .app-shell.immersive-shell {
  background: #f4f6f8;
  color: #111820;
}

html[data-theme="light"] .app-loading {
  color: #111820;
}

html[data-theme="light"] .sidebar {
  border-right-color: #d9e0e7;
  background: linear-gradient(180deg, #ffffff, #f5f7fa);
  color: #111820;
}

html[data-theme="light"] .nav-button {
  color: #4f5c69;
}

html[data-theme="light"] .nav-button:hover,
html[data-theme="light"] .nav-button.active {
  border-left-color: var(--red);
  background: linear-gradient(90deg, rgba(239, 47, 50, 0.13), rgba(239, 47, 50, 0));
  color: #111820;
}

html[data-theme="light"] .nav-icon,
html[data-theme="light"] .sidebar-footer {
  border-color: #d8dfe7;
}

html[data-theme="light"] .user-role {
  color: #6d7884;
}

html[data-theme="light"] .icon-button,
html[data-theme="light"] .soft-button,
html[data-theme="light"] .select,
html[data-theme="light"] .search,
html[data-theme="light"] .card,
html[data-theme="light"] .report-sheet,
html[data-theme="light"] .report-config {
  border-color: #d9e0e7;
  background: #ffffff;
  color: #111820;
}

html[data-theme="light"] .compare-icon,
html[data-theme="light"] .overview-icon {
  filter: none;
  opacity: 0.78;
}

html[data-theme="light"] .overview-page,
html[data-theme="light"] .session-compare-page,
html[data-theme="light"] .session-library-page,
html[data-theme="light"] .settings-page,
html[data-theme="light"] .corner-report-page {
  background: #f4f6f8;
  color: #111820;
}

html[data-theme="light"] .overview-topbar p,
html[data-theme="light"] .overview-location-chip,
html[data-theme="light"] .overview-kpi-card small,
html[data-theme="light"] .overview-kpi small,
html[data-theme="light"] .overview-best-lap em,
html[data-theme="light"] .weather-main small,
html[data-theme="light"] .weather-main em,
html[data-theme="light"] .weather-metric span,
html[data-theme="light"] .weather-source,
html[data-theme="light"] .overview-primary-action small,
html[data-theme="light"] .overview-recent-driver,
html[data-theme="light"] .overview-recent-car,
html[data-theme="light"] .overview-recent-date {
  color: #66727f;
}

html[data-theme="light"] .overview-card,
html[data-theme="light"] .overview-recent-session-card,
html[data-theme="light"] .overview-primary-action,
html[data-theme="light"] .overview-action-tile {
  border-color: #d9e0e7;
  background: #ffffff;
  color: #111820;
  box-shadow: 0 12px 30px rgba(24, 35, 48, 0.08);
}

html[data-theme="light"] .overview-recent-session-card {
  background:
    radial-gradient(circle at 88% 108%, rgba(239, 47, 50, 0.11), transparent 42%),
    #ffffff;
}

html[data-theme="light"] .overview-recent-session-card:hover {
  border-color: #aeb9c5;
  box-shadow: 0 16px 30px rgba(24, 35, 48, 0.12);
}

html[data-theme="light"] .overview-card-title,
html[data-theme="light"] .overview-kpi span,
html[data-theme="light"] .overview-session-stats span,
html[data-theme="light"] .overview-panel-head h2,
html[data-theme="light"] .overview-score-row,
html[data-theme="light"] .overview-score-row strong,
html[data-theme="light"] .overview-recent-track-name,
html[data-theme="light"] .overview-recent-best-lap,
html[data-theme="light"] .overview-recent-date > i {
  color: #17212b;
}

html[data-theme="light"] .overview-score-track,
html[data-theme="light"] .overview-bars .bar-track {
  background: #e5eaf0;
}

html[data-theme="light"] .overview-panel-head,
html[data-theme="light"] .overview-session-stats div,
html[data-theme="light"] .overview-graph-stack canvas,
html[data-theme="light"] .overview-recent-date,
html[data-theme="light"] .weather-main {
  border-color: #dce2e8;
}

html[data-theme="light"] .overview-page .soft-button,
html[data-theme="light"] .overview-page .icon-button,
html[data-theme="light"] .overview-select,
html[data-theme="light"] .overview-panel-head select,
html[data-theme="light"] .overview-panel-actions select,
html[data-theme="light"] .overview-recent-nav {
  border-color: #d6dde5;
  background: #ffffff;
  color: #17212b;
}

html[data-theme="light"] .overview-recent-nav:hover:not(:disabled) {
  border-color: #9eabb8;
  background: #f1f4f7;
  color: #111820;
}

html[data-theme="light"] .overview-recent-track-art img,
html[data-theme="light"] .overview-track-mini .track-layout-img {
  filter: brightness(0) saturate(100%) drop-shadow(0 4px 7px rgba(31, 42, 54, 0.18));
  opacity: 0.82;
}

html[data-theme="light"] .overview-recent-type {
  background: #edf1f5;
  color: #4f5c69;
}

html[data-theme="light"] .overview-recent-type.race {
  background: rgba(239, 47, 50, 0.12);
  color: #c52327;
}

html[data-theme="light"] .overview-recent-type.qualifying {
  background: rgba(45, 125, 255, 0.12);
  color: #175fc2;
}

html[data-theme="light"] .overview-recent-type.practice {
  background: #e9edf2;
  color: #56616d;
}

html[data-theme="light"] .overview-recent-type.test {
  background: rgba(24, 168, 68, 0.12);
  color: #137b35;
}

html[data-theme="light"] .session-compare-topbar p,
html[data-theme="light"] .session-hero-main span,
html[data-theme="light"] .session-hero-best small,
html[data-theme="light"] .session-pickers label > span,
html[data-theme="light"] .comparison-session-field > span,
html[data-theme="light"] .session-metric-card small,
html[data-theme="light"] .session-panel-head span,
html[data-theme="light"] .sector-summary-table small,
html[data-theme="light"] .comparison-panel-status,
html[data-theme="light"] .compare-insight-list li {
  color: #66727f;
}

html[data-theme="light"] .session-compare-page .soft-button,
html[data-theme="light"] .session-compare-page .icon-button,
html[data-theme="light"] .session-compare-page .select,
html[data-theme="light"] .session-picker-trigger,
html[data-theme="light"] .session-vs,
html[data-theme="light"] .session-panel,
html[data-theme="light"] .session-metric-card,
html[data-theme="light"] .comparison-panel-status > span {
  border-color: #d8dfe7;
  background: #ffffff;
  color: #111820;
  box-shadow: 0 12px 30px rgba(24, 35, 48, 0.07);
}

html[data-theme="light"] .session-hero-card,
html[data-theme="light"] .session-hero-card.session-b {
  background:
    radial-gradient(circle at 0 0, var(--driver-glow, rgba(45, 125, 255, 0.12)), transparent 48%),
    #ffffff;
}

html[data-theme="light"] .comparison-session-placeholder {
  background: color-mix(in srgb, var(--driver-color) 8%, #ffffff);
}

html[data-theme="light"] .session-hero-card.awaiting-selection .session-hero-main strong,
html[data-theme="light"] .session-picker-trigger-copy strong,
html[data-theme="light"] .session-hero-best strong,
html[data-theme="light"] .session-metric-card span,
html[data-theme="light"] .session-panel-head h2,
html[data-theme="light"] .sector-summary-table th,
html[data-theme="light"] .comparison-panel-status strong {
  color: #17212b;
}

html[data-theme="light"] .session-hero-best,
html[data-theme="light"] .session-pickers,
html[data-theme="light"] .session-panel-head,
html[data-theme="light"] .compare-graph-stack canvas,
html[data-theme="light"] .sector-summary-table th,
html[data-theme="light"] .sector-summary-table td {
  border-color: #dce2e8;
}

html[data-theme="light"] .session-metric-row {
  border-color: #dce2e8;
  background: #dce2e8;
}

html[data-theme="light"] .session-tabs button {
  color: #697582;
}

html[data-theme="light"] .session-tabs .active {
  color: #111820;
}

html[data-theme="light"] .session-picker-trigger:hover,
html[data-theme="light"] .comparison-session-picker.open .session-picker-trigger {
  background: #f7f9fb;
}

html[data-theme="light"] .session-picker-trigger:disabled {
  border-color: #d9e0e7;
  background: #f1f4f7;
  color: #8894a0;
}

html[data-theme="light"] .session-picker-trigger-copy small,
html[data-theme="light"] .session-picker-option-copy small,
html[data-theme="light"] .session-picker-empty {
  color: #6d7986;
}

html[data-theme="light"] .session-picker-menu,
html[data-theme="light"] .session-picker-search input,
html[data-theme="light"] .session-picker-track-head,
html[data-theme="light"] .session-picker-option {
  border-color: #d6dde5;
  background: #ffffff;
  color: #111820;
  box-shadow: 0 22px 52px rgba(24, 35, 48, 0.16);
}

html[data-theme="light"] .session-picker-filters,
html[data-theme="light"] .session-picker-track-group + .session-picker-track-group,
html[data-theme="light"] .session-picker-option {
  border-color: #e0e5eb;
}

html[data-theme="light"] .session-picker-filters select,
html[data-theme="light"] .session-picker-locked-track,
html[data-theme="light"] .session-picker-favorites-only,
html[data-theme="light"] .session-picker-lap small,
html[data-theme="light"] .session-picker-lap strong,
html[data-theme="light"] .session-picker-track-head span {
  border-color: #d7dee6;
  background: #f0f3f6;
  color: #4d5966;
}

html[data-theme="light"] .session-picker-option:hover {
  background: #f4f7fa;
}

html[data-theme="light"] .session-picker-option-main {
  color: #17212b;
}

html[data-theme="light"] .session-picker-option.selected,
html[data-theme="light"] .session-picker-option.selected .session-picker-option-main {
  color: #ffffff;
}

html[data-theme="light"] .session-picker-option.selected .session-picker-option-copy small,
html[data-theme="light"] .session-picker-option.selected .session-picker-lap small,
html[data-theme="light"] .session-picker-option.selected .session-picker-lap strong {
  color: #ffffff;
}

html[data-theme="light"] .sector-analysis-widget,
html[data-theme="light"] .overview-analysis-widget,
html[data-theme="light"] .sector-selector-strip,
html[data-theme="light"] .sector-selector-card {
  border-color: #dce2e8;
  background: #ffffff;
  color: #111820;
}

html[data-theme="light"] .sector-selector-card:hover {
  border-color: #b3c1ce;
  background: #f5f8fa;
}

html[data-theme="light"] .sector-selector-card.active {
  border-color: #1f7cff;
  background: linear-gradient(180deg, rgba(45, 125, 255, 0.14), rgba(45, 125, 255, 0.07));
}

html[data-theme="light"] .sector-selector-card span,
html[data-theme="light"] .sector-selector-card strong,
html[data-theme="light"] .sector-graph-label,
html[data-theme="light"] .sector-driver-legend {
  color: #17212b;
}

html[data-theme="light"] .sector-selector-card small,
html[data-theme="light"] .sector-graph-label span,
html[data-theme="light"] .sector-graph-metric span,
html[data-theme="light"] .sector-distance-caption {
  color: #66727f;
}

html[data-theme="light"] .sector-graph-row,
html[data-theme="light"] .sector-graph-metric {
  border-color: #e0e5eb;
}

html[data-theme="light"] .library-topbar p,
html[data-theme="light"] .track-session-topbar p,
html[data-theme="light"] .library-filter span,
html[data-theme="light"] .track-card-copy p,
html[data-theme="light"] .track-card-copy span,
html[data-theme="light"] .track-detail-copy p,
html[data-theme="light"] .track-detail-stat span,
html[data-theme="light"] .session-list-head span,
html[data-theme="light"] .session-row-title span,
html[data-theme="light"] .session-library-row small,
html[data-theme="light"] .compare-selection-bar span {
  color: #66727f;
}

html[data-theme="light"] .session-library-page .soft-button,
html[data-theme="light"] .session-library-page .library-select,
html[data-theme="light"] .session-library-page .library-search-input,
html[data-theme="light"] .library-filter-panel,
html[data-theme="light"] .library-filter,
html[data-theme="light"] .track-library-card,
html[data-theme="light"] .track-session-count,
html[data-theme="light"] .track-detail-hero,
html[data-theme="light"] .session-library-row,
html[data-theme="light"] .session-row-check,
html[data-theme="light"] .compare-selection-bar,
html[data-theme="light"] .compare-selection-card,
html[data-theme="light"] .selection-vs,
html[data-theme="light"] .folder-sync-panel,
html[data-theme="light"] .folder-sync-symbol {
  border-color: #d9e0e7;
  background: #ffffff;
  color: #111820;
  box-shadow: 0 12px 30px rgba(24, 35, 48, 0.06);
}

html[data-theme="light"] .library-select {
  color: #111820;
}

html[data-theme="light"] .track-library-card {
  background:
    radial-gradient(circle at 30% 100%, rgba(239, 47, 50, 0.08), transparent 35%),
    #ffffff;
}

html[data-theme="light"] .track-library-card:hover {
  border-color: #aeb9c5;
}

html[data-theme="light"] .track-layout-img,
html[data-theme="light"] .library-track-svg {
  filter: brightness(0) saturate(100%) drop-shadow(0 10px 16px rgba(31, 42, 54, 0.16));
}

html[data-theme="light"] .track-logo-img,
html[data-theme="light"] .track-card-logo {
  border: 1px solid #e0e5eb;
  background: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .track-tags em {
  border-color: #d3dbe3;
  color: #46525f;
}

html[data-theme="light"] .back-link,
html[data-theme="light"] .session-list-head,
html[data-theme="light"] .session-row-number {
  color: #17212b;
}

html[data-theme="light"] .track-detail-stat,
html[data-theme="light"] .folder-sync-summary > span,
html[data-theme="light"] .folder-sync-message,
html[data-theme="light"] .folder-sync-error {
  border-color: #dce2e8;
}

html[data-theme="light"] .compare-selection-bar {
  background: rgba(255, 255, 255, 0.96);
}

html[data-theme="light"] .compare-selection-card {
  background: radial-gradient(circle at 0 0, var(--driver-glow, rgba(45, 125, 255, 0.13)), transparent 72%), #fff;
}

html[data-theme="light"] .corner-report-page .card,
html[data-theme="light"] .corner-report-page .soft-button,
html[data-theme="light"] .corner-report-page .select,
html[data-theme="light"] .corner-report-page .report-config,
html[data-theme="light"] .corner-scoreboard,
html[data-theme="light"] .corner-stepper,
html[data-theme="light"] .corner-map-card,
html[data-theme="light"] .corner-bottom-card,
html[data-theme="light"] .corner-graphs-card,
html[data-theme="light"] .corner-customize summary,
html[data-theme="light"] .corner-customize .report-config,
html[data-theme="light"] .zone-interest-toggle {
  border-color: #d7dfe7;
  background: #ffffff;
  color: #111820;
  box-shadow: none;
}

html[data-theme="light"] .corner-score-card,
html[data-theme="light"] .corner-event-card,
html[data-theme="light"] .corner-bottom-card .corner-event-card {
  background: radial-gradient(circle at 12% 0, var(--driver-glow, rgba(45, 125, 255, 0.1)), transparent 58%), #ffffff;
}

html[data-theme="light"] .corner-title-block p,
html[data-theme="light"] .corner-report-page .muted,
html[data-theme="light"] .corner-report-page .chart-head,
html[data-theme="light"] .corner-report-page .report-config p,
html[data-theme="light"] .corner-score-card span,
html[data-theme="light"] .time-loss span,
html[data-theme="light"] .time-loss small,
html[data-theme="light"] .corner-event-card span,
html[data-theme="light"] .corner-graph-label span,
html[data-theme="light"] .corner-graph-side,
html[data-theme="light"] .graph-side-placeholder,
html[data-theme="light"] .graph-side-distance {
  color: #66727f;
}

html[data-theme="light"] .corner-back,
html[data-theme="light"] .corner-score-card strong,
html[data-theme="light"] .corner-stepper button,
html[data-theme="light"] .corner-stepper select,
html[data-theme="light"] .corner-tab-list .active,
html[data-theme="light"] .corner-event-card p,
html[data-theme="light"] .corner-graph-label,
html[data-theme="light"] .graph-side-driver b {
  color: #17212b;
}

html[data-theme="light"] .corner-scoreboard .vs-dot {
  border-color: #d6dde5;
  background: #f0f3f6;
  color: #4d5966;
}

html[data-theme="light"] .time-loss,
html[data-theme="light"] .corner-tabs,
html[data-theme="light"] .corner-graph-row,
html[data-theme="light"] .corner-graph-toolbar,
html[data-theme="light"] .channel-section-title {
  border-color: #dce2e8;
}

html[data-theme="light"] .corner-event-icon {
  border-color: #d7dfe7;
  background: #f2f5f8;
}

html[data-theme="light"] .corner-tab-list button {
  color: #697582;
}

html[data-theme="light"] .corner-stepper button:hover {
  background: #f1f4f7;
}

html[data-theme="light"] .zone-toggle-track {
  background: #d8dfe7;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 32, 0.08);
}

html[data-theme="light"] .zone-toggle-track i {
  background: #7f8b97;
}

html[data-theme="light"] .settings-topbar p,
html[data-theme="light"] .settings-panel-head p,
html[data-theme="light"] .settings-section-nav small,
html[data-theme="light"] .settings-field,
html[data-theme="light"] .settings-status-field,
html[data-theme="light"] .settings-field small,
html[data-theme="light"] .settings-stats small,
html[data-theme="light"] .settings-data-summary small,
html[data-theme="light"] .settings-security-list small,
html[data-theme="light"] .settings-toggle-row small,
html[data-theme="light"] .settings-detail-list > div > span,
html[data-theme="light"] .settings-signout-row small,
html[data-theme="light"] .settings-theme-field > span {
  color: #66727f;
}

html[data-theme="light"] .settings-context > span,
html[data-theme="light"] .settings-section-nav,
html[data-theme="light"] .settings-panel,
html[data-theme="light"] .settings-save-button,
html[data-theme="light"] .settings-secondary-button,
html[data-theme="light"] .settings-security-list button,
html[data-theme="light"] .settings-field input,
html[data-theme="light"] .settings-field select,
html[data-theme="light"] .settings-status-field strong,
html[data-theme="light"] .settings-stats,
html[data-theme="light"] .settings-data-summary,
html[data-theme="light"] .settings-about-brand,
html[data-theme="light"] .settings-theme-control {
  border-color: #d8dfe7;
  background: #ffffff;
  color: #111820;
  box-shadow: 0 12px 30px rgba(24, 35, 48, 0.06);
}

html[data-theme="light"] .settings-section-nav button {
  color: #4f5c69;
}

html[data-theme="light"] .settings-section-nav button:hover {
  background: #f2f5f8;
  color: #111820;
}

html[data-theme="light"] .settings-section-nav button.active {
  background: linear-gradient(90deg, rgba(239, 47, 50, 0.1), rgba(255, 255, 255, 0.96));
  color: var(--red);
}

html[data-theme="light"] .settings-panel-head h2,
html[data-theme="light"] .settings-profile-form h3,
html[data-theme="light"] .settings-stats strong,
html[data-theme="light"] .settings-data-summary strong,
html[data-theme="light"] .settings-security-list > div,
html[data-theme="light"] .settings-detail-list > div,
html[data-theme="light"] .settings-toggle-row strong,
html[data-theme="light"] .settings-signout-row strong {
  color: #17212b;
}

html[data-theme="light"] .settings-avatar {
  border-color: #cfd8e1;
  background: radial-gradient(circle at 36% 30%, #ffffff, #e8edf2 68%);
  color: #17212b;
}

html[data-theme="light"] .settings-divider,
html[data-theme="light"] .settings-security-list,
html[data-theme="light"] .settings-detail-list,
html[data-theme="light"] .settings-security-list > div,
html[data-theme="light"] .settings-detail-list > div,
html[data-theme="light"] .settings-toggle-row,
html[data-theme="light"] .settings-signout-row {
  border-color: #dce2e8;
}

html[data-theme="light"] .settings-toggle-row > i {
  border-color: #cbd4de;
  background: #e3e8ed;
}

html[data-theme="light"] .settings-theme-option {
  color: #65717e;
}

html[data-theme="light"] .settings-theme-option:hover {
  background: #f3f6f8;
  color: #111820;
}

html[data-theme="light"] .settings-theme-option.active {
  border-color: #ccd5de;
  background: #edf1f5;
  color: #111820;
  box-shadow: 0 5px 14px rgba(24, 35, 48, 0.09);
}

html[data-theme="light"] .settings-about-brand {
  background: radial-gradient(circle at center, rgba(239, 47, 50, 0.06), transparent 62%), #ffffff;
}

html[data-theme="light"] .upload-modal,
html[data-theme="light"] .folder-review-modal {
  border-color: #ccd5de;
  background: #ffffff;
  color: #111820;
  box-shadow: 0 28px 80px rgba(24, 35, 48, 0.24);
}

html[data-theme="light"] .upload-modal-head p,
html[data-theme="light"] .upload-drop-zone span,
html[data-theme="light"] .upload-drop-zone small,
html[data-theme="light"] .detected-note,
html[data-theme="light"] .metadata-field > span,
html[data-theme="light"] .switch-row small,
html[data-theme="light"] .folder-review-eyebrow,
html[data-theme="light"] .folder-review-progress span,
html[data-theme="light"] .folder-queue-item small,
html[data-theme="light"] .folder-queue-item em,
html[data-theme="light"] .folder-current-file small,
html[data-theme="light"] .folder-preview-facts small,
html[data-theme="light"] .folder-review-loading,
html[data-theme="light"] .folder-review-complete,
html[data-theme="light"] .folder-sync-identity small,
html[data-theme="light"] .folder-sync-summary small {
  color: #66727f;
}

html[data-theme="light"] .modal-close {
  color: #111820;
}

html[data-theme="light"] .upload-file-panel,
html[data-theme="light"] .folder-review-head,
html[data-theme="light"] .folder-review-queue,
html[data-theme="light"] .folder-current-file,
html[data-theme="light"] .folder-review-actions {
  border-color: #dce2e8;
}

html[data-theme="light"] .upload-drop-zone,
html[data-theme="light"] .metadata-input,
html[data-theme="light"] .folder-review-progress strong,
html[data-theme="light"] .folder-current-file-icon {
  border-color: #cfd8e1;
  background: #f7f9fb;
  color: #111820;
}

html[data-theme="light"] .upload-drop-zone em {
  border-color: #cfd8e1;
  color: #111820;
}

html[data-theme="light"] .metadata-input i,
html[data-theme="light"] .metadata-input input {
  color: #111820;
}

html[data-theme="light"] .folder-review-queue {
  background: #f5f7fa;
}

html[data-theme="light"] .folder-queue-item {
  color: #17212b;
}

html[data-theme="light"] .folder-queue-item:hover:not(:disabled),
html[data-theme="light"] .folder-queue-item.active {
  border-color: #cbd4de;
  background: #ffffff;
}

html[data-theme="light"] .folder-preview-facts > span {
  border-color: #cbd4de;
}

html[data-theme="light"] .folder-review-complete h3 {
  color: #17212b;
}

html[data-theme="light"] body.auth-active,
html[data-theme="light"] .auth-screen {
  background: #f4f6f8;
  color: #111820;
}

html[data-theme="light"] .auth-screen {
  background:
    linear-gradient(115deg, rgba(207, 216, 225, 0.32), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f1f4f7 100%);
}

html[data-theme="light"] .auth-screen::before {
  background-image:
    linear-gradient(rgba(17, 24, 32, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 32, 0.025) 1px, transparent 1px);
}

html[data-theme="light"] .auth-panel {
  border-color: #ccd5de;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 30px 80px rgba(24, 35, 48, 0.16);
}

html[data-theme="light"] .auth-tabs,
html[data-theme="light"] .auth-footer-switch {
  border-color: #d9e0e7;
}

html[data-theme="light"] .auth-tabs button {
  color: #7a8591;
}

html[data-theme="light"] .auth-tabs button:hover,
html[data-theme="light"] .auth-tabs button.active,
html[data-theme="light"] .auth-field > span,
html[data-theme="light"] .auth-remember,
html[data-theme="light"] .auth-footer-switch {
  color: #17212b;
}

html[data-theme="light"] .auth-input-shell,
html[data-theme="light"] .auth-remember > span {
  border-color: #cdd6df;
  background: #ffffff;
}

html[data-theme="light"] .auth-input-shell input {
  color: #111820;
}

html[data-theme="light"] .auth-password-toggle:hover,
html[data-theme="light"] .auth-password-toggle:focus-visible {
  background: #edf1f5;
  color: #111820;
}

html[data-theme="light"] .auth-corner-lines {
  border-color: rgba(105, 118, 132, 0.26);
  box-shadow:
    0 0 0 12px rgba(105, 118, 132, 0.09),
    0 0 0 24px rgba(105, 118, 132, 0.06),
    0 0 0 36px rgba(239, 47, 50, 0.08),
    0 0 0 48px rgba(105, 118, 132, 0.045);
}

html[data-theme="light"] .setup-screen {
  background: #f4f6f8;
}

html[data-theme="light"] .setup-panel {
  border-color: #d5dde5;
  color: #111820;
  box-shadow: 0 18px 50px rgba(24, 35, 48, 0.13);
}

html[data-theme="light"] .admin-page {
  background: #f4f6f8;
  color: #111820;
}

html[data-theme="light"] .admin-topbar p,
html[data-theme="light"] .admin-panel-head p,
html[data-theme="light"] .admin-modal header p,
html[data-theme="light"] .admin-user-email,
html[data-theme="light"] .admin-created-date,
html[data-theme="light"] .admin-user-form > label,
html[data-theme="light"] .admin-user-form label small,
html[data-theme="light"] .admin-quota-user small {
  color: #66727f;
}

html[data-theme="light"] .admin-summary > div,
html[data-theme="light"] .admin-user-panel,
html[data-theme="light"] .admin-refresh-button,
html[data-theme="light"] .admin-icon-button,
html[data-theme="light"] .admin-status-button,
html[data-theme="light"] .admin-modal,
html[data-theme="light"] .admin-modal-close,
html[data-theme="light"] .admin-user-form input,
html[data-theme="light"] .admin-user-form select {
  border-color: #d7dfe7;
  background: #ffffff;
  color: #111820;
  box-shadow: 0 12px 30px rgba(24, 35, 48, 0.06);
}

html[data-theme="light"] .admin-summary strong,
html[data-theme="light"] .admin-panel-head h2,
html[data-theme="light"] .admin-user-name strong,
html[data-theme="light"] .admin-modal h2,
html[data-theme="light"] .admin-quota-user span {
  color: #17212b;
}

html[data-theme="light"] .admin-panel-head,
html[data-theme="light"] .admin-user-table th,
html[data-theme="light"] .admin-user-table td,
html[data-theme="light"] .admin-modal header {
  border-color: #dce2e8;
}

html[data-theme="light"] .admin-user-table th {
  background: #f3f6f8;
  color: #65717e;
}

html[data-theme="light"] .admin-user-table tbody tr:hover {
  background: #f7f9fb;
}

html[data-theme="light"] .admin-user-name i,
html[data-theme="light"] .admin-badge {
  border-color: #d4dce4;
  background: #f1f4f7;
  color: #46525f;
}

html[data-theme="light"] .admin-badge.role-admin {
  border-color: rgba(45, 125, 255, 0.32);
  background: rgba(45, 125, 255, 0.1);
  color: #175fc2;
}

html[data-theme="light"] .admin-badge.status-active {
  border-color: rgba(24, 168, 68, 0.28);
  background: rgba(24, 168, 68, 0.09);
  color: #137b35;
}

html[data-theme="light"] .admin-badge.status-pending {
  border-color: rgba(188, 128, 13, 0.3);
  background: rgba(227, 163, 38, 0.09);
  color: #94620a;
}

html[data-theme="light"] .admin-badge.status-disabled {
  border-color: rgba(239, 47, 50, 0.3);
  background: rgba(239, 47, 50, 0.09);
  color: #c52327;
}

html[data-theme="light"] .admin-usage > span {
  background: #e2e8ee;
}

html[data-theme="light"] .admin-modal-backdrop {
  background: rgba(39, 49, 60, 0.48);
}

html[data-theme="light"] .admin-quota-user {
  background: #f5f7fa;
}

html[data-theme="light"] .auth-local-heading {
  border-color: #d9e0e7;
}

html[data-theme="light"] .auth-local-heading strong {
  color: #17212b;
}

html[data-theme="light"] .auth-local-heading span {
  color: #66727f;
}

html[data-theme="light"] .access-denied-panel {
  border-color: #ccd5de;
  background: #ffffff;
  color: #111820;
  box-shadow: 0 30px 80px rgba(24, 35, 48, 0.16);
}

html[data-theme="light"] .access-denied-panel p {
  color: #66727f;
}

/* Application-password controls and one-time admin account links. */
.settings-account-form h3 {
  margin: 0;
  color: #e8edf2;
  font-size: 14px;
}

.settings-password-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-change-password {
  width: max-content;
  min-width: 150px;
  justify-self: end;
}

.admin-access-link {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(280px, 1.8fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(45, 125, 255, 0.34);
  border-radius: 7px;
  background: rgba(45, 125, 255, 0.08);
  padding: 12px 14px;
}

.admin-access-link > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-access-link strong {
  color: #e7edf4;
  font-size: 12px;
}

.admin-access-link small {
  color: #8d9aa7;
  font-size: 10px;
}

.admin-access-link input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid #33404d;
  border-radius: 5px;
  outline: 0;
  background: #081017;
  color: #cbd4dd;
  padding: 0 10px;
  font-size: 10px;
}

.admin-access-link .settings-secondary-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-access-link .settings-icon {
  width: 15px;
  height: 15px;
}

html[data-theme="light"] .settings-account-form h3 {
  color: #17212b;
}

html[data-theme="light"] .admin-access-link {
  border-color: rgba(45, 125, 255, 0.28);
  background: rgba(45, 125, 255, 0.06);
}

html[data-theme="light"] .admin-access-link strong {
  color: #17212b;
}

html[data-theme="light"] .admin-access-link small {
  color: #66727f;
}

html[data-theme="light"] .admin-access-link input {
  border-color: #cfd8e1;
  background: #ffffff;
  color: #17212b;
}

@media (max-width: 1050px) {
  .settings-password-grid {
    grid-template-columns: 1fr;
  }

  .admin-access-link {
    grid-template-columns: 1fr auto;
  }

  .admin-access-link > div {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .settings-change-password {
    width: 100%;
    justify-self: stretch;
  }

  .admin-access-link {
    grid-template-columns: 1fr;
  }
}
