:root {
  color-scheme: light;
  --md-ref-palette-primary-40: #2f5d8e;
  --md-ref-palette-primary-90: #dbe9ff;
  --md-ref-palette-secondary-40: #536477;
  --md-ref-palette-secondary-90: #dde7f2;
  --md-ref-palette-neutral-10: #18212a;
  --md-ref-palette-neutral-20: #2e3944;
  --md-ref-palette-neutral-40: #5a6877;
  --md-ref-palette-neutral-60: #7e8a98;
  --md-ref-palette-neutral-90: #e3e9f0;
  --md-ref-palette-neutral-99: #fcfdff;
  --md-ref-palette-success-40: #1f6a3f;
  --md-ref-palette-success-90: #d8efdd;
  --md-ref-palette-warning-40: #8a4a08;
  --md-ref-palette-warning-90: #f7e2c9;
  --md-ref-palette-error-40: #b3261e;
  --md-ref-palette-error-90: #f9dedc;

  --md-sys-color-primary: var(--md-ref-palette-primary-40);
  --md-sys-color-primary-container: var(--md-ref-palette-primary-90);
  --md-sys-color-secondary: var(--md-ref-palette-secondary-40);
  --md-sys-color-secondary-container: var(--md-ref-palette-secondary-90);
  --md-sys-color-surface: #f3f6fb;
  --md-sys-color-surface-bright: var(--md-ref-palette-neutral-99);
  --md-sys-color-surface-container-low: #eef3f8;
  --md-sys-color-surface-container: #e7edf5;
  --md-sys-color-surface-container-high: #e0e7f0;
  --md-sys-color-surface-container-highest: #d8e1eb;
  --md-sys-color-outline: #b3beca;
  --md-sys-color-outline-variant: #d4dce6;
  --md-sys-color-on-surface: var(--md-ref-palette-neutral-10);
  --md-sys-color-on-surface-variant: var(--md-ref-palette-neutral-40);
  --md-sys-color-error: var(--md-ref-palette-error-40);
  --md-sys-color-error-container: var(--md-ref-palette-error-90);
  --md-sys-color-success: var(--md-ref-palette-success-40);
  --md-sys-color-success-container: var(--md-ref-palette-success-90);
  --md-sys-color-warning: var(--md-ref-palette-warning-40);
  --md-sys-color-warning-container: var(--md-ref-palette-warning-90);

  --app-bg: #edf2f8;
  --app-bg-radial: rgba(204, 221, 243, 0.78);
  --surface-page: rgba(247, 250, 254, 0.96);
  --surface-1: rgba(255, 255, 255, 0.99);
  --surface-2: rgba(247, 250, 254, 0.98);
  --surface-3: rgba(241, 246, 251, 1);
  --surface-tonal: rgba(214, 228, 246, 0.5);
  --surface-tonal-strong: rgba(198, 217, 241, 0.82);
  --surface-neutral: rgba(228, 236, 245, 0.96);
  --surface-hover: rgba(234, 240, 247, 0.96);
  --surface-pressed: rgba(213, 226, 244, 0.94);
  --surface-selected: rgba(47, 93, 142, 0.18);
  --surface-overlay: rgba(247, 250, 255, 0.97);
  --surface-warning-strong: rgba(247, 226, 201, 0.52);
  --surface-error-strong: rgba(249, 222, 220, 0.56);
  --text-strong: var(--md-sys-color-on-surface);
  --text-base: #26313c;
  --text-muted: var(--md-sys-color-on-surface-variant);
  --text-inverse: #ffffff;
  --text-accent: #183a60;
  --text-success: var(--md-sys-color-success);
  --text-warning: var(--md-sys-color-warning);
  --text-error: var(--md-sys-color-error);
  --outline-subtle: rgba(212, 220, 230, 0.92);
  --outline-strong: rgba(179, 190, 202, 0.98);
  --focus-ring: rgba(47, 93, 142, 0.28);
  --focus-ring-strong: rgba(47, 93, 142, 0.42);
  --button-primary-hover: #23486f;
  --chart-area-fill: rgba(47, 93, 142, 0.12);
  --chart-line-muted: rgba(47, 93, 142, 0.34);
  --charts-distribution-practice: #2f5d8e;
  --charts-distribution-race: #0f766e;
  --charts-distribution-trackday: #c27a2c;
  --charts-distribution-hotlap: #b45309;
  --charts-distribution-other: #778396;
  --trend-card-tint: rgba(214, 228, 246, 0.72);
  --shadow-color-rgb: 17, 24, 32;
  --md-elevation-0: none;
  --md-elevation-1: 0 2px 8px rgba(var(--shadow-color-rgb), 0.05), 0 10px 24px rgba(var(--shadow-color-rgb), 0.06);
  --md-elevation-2: 0 12px 30px rgba(var(--shadow-color-rgb), 0.09), 0 4px 12px rgba(var(--shadow-color-rgb), 0.05);
  --md-elevation-3: 0 20px 44px rgba(var(--shadow-color-rgb), 0.13), 0 8px 18px rgba(var(--shadow-color-rgb), 0.08);
  --md-radius-large: 30px;
  --md-radius-medium: 24px;
  --md-radius-small: 14px;
  --md-radius-xsmall: 10px;
  --md-space-1: 4px;
  --md-space-2: 8px;
  --md-space-3: 12px;
  --md-space-4: 16px;
  --md-space-5: 20px;
  --md-space-6: 24px;
  --md-space-7: 32px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, var(--app-bg-radial), transparent 34%),
    linear-gradient(180deg, var(--surface-page) 0%, var(--app-bg) 100%);
  color: var(--text-strong);
  font-family: "Roboto Flex", Roboto, "Segoe UI", sans-serif;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  width: min(1520px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.dashboard-shell {
  display: grid;
  gap: var(--md-space-6);
}

.section-card {
  padding: 24px;
}

.top-app-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: var(--md-space-6);
  align-items: center;
  padding: 18px 24px;
  border: 1px solid var(--outline-subtle);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(242, 248, 255, 0.98) 0%, rgba(233, 242, 252, 0.96) 100%);
  backdrop-filter: blur(18px);
  box-shadow: var(--md-elevation-2);
}

.top-app-bar__title-group h1,
.section-heading h2,
.detail-hero-card h2,
.panel h1,
.empty-state-card h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2vw, 2.35rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.top-app-bar__subtitle,
.summary-card__support,
.trend-card__support,
.section-support,
.detail-support,
.table-empty span,
.chart-empty,
.panel p,
.empty-state-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.top-app-bar__actions,
.top-app-bar__controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.top-app-bar__actions {
  gap: var(--md-space-3);
  flex-wrap: wrap;
}

.top-app-bar__title-group,
.section-heading > div {
  display: grid;
  gap: var(--md-space-1);
}

.top-app-bar__title-group {
  max-width: 74ch;
}

.top-app-bar__brand {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.top-app-bar__brand:hover {
  text-decoration: none;
}

.top-app-bar__brand-icon {
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

.top-app-bar__brand-wordmark {
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.top-app-bar__controls {
  position: relative;
  flex: 0 0 auto;
  gap: var(--md-space-3);
}

.overline,
.section-label,
.summary-card__label,
.metric-chip__label {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.surface-card,
.summary-card,
.detail-hero-card,
.panel,
.empty-state-card {
  background: var(--surface-1);
  border: 1px solid var(--outline-subtle);
  border-radius: 22px;
  box-shadow: var(--md-elevation-1);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--md-space-4);
}

.cm-stats-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cm-stats-two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--md-space-4);
}

.cm-stats-meta {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.unit-imperial {
  font-size: 0.7em;
  opacity: 0.8;
}

.summary-card {
  padding: 22px;
  min-height: 164px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--md-space-5);
  background:
    linear-gradient(180deg, var(--surface-tonal) 0%, var(--surface-1) 58%);
  box-shadow: var(--md-elevation-2);
  border-color: rgba(198, 217, 241, 0.92);
}

.summary-card__header,
.summary-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--md-space-2);
}

.summary-card__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--md-sys-color-surface-container);
  color: var(--text-base);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68);
}

.summary-card__badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.summary-card__label {
  margin-bottom: 0;
}

.summary-card__value {
  display: block;
  font-size: clamp(1.95rem, 2.3vw, 2.7rem);
  font-weight: 640;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}

.summary-card__support--stacked {
  display: flex;
  flex-direction: column;
  gap: var(--md-space-1);
}

.filter-card,
.table-card,
.trend-card,
.auth-panel,
.empty-state-card {
  padding: 24px;
}

.filter-panel {
  overflow: clip;
  box-shadow: var(--md-elevation-2);
}

.filter-panel--header {
  position: relative;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.filter-panel__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--md-space-4);
  padding: 24px;
  cursor: pointer;
  list-style: none;
}

.filter-panel__summary::-webkit-details-marker {
  display: none;
}

.filter-panel__summary--compact {
  padding: 0;
}

.filter-panel__summary:hover .filter-panel__toggle-label {
  color: var(--md-sys-color-primary);
}

.filter-panel__summary-actions {
  display: flex;
  align-items: center;
  gap: var(--md-space-3);
}

.filter-panel__toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-panel__toggle-label::after {
  content: "▾";
  font-size: 0.9rem;
  transition: transform 0.18s ease;
}

.filter-panel[open] .filter-panel__toggle-label::after {
  transform: rotate(180deg);
}

.filter-panel__body {
  display: grid;
  gap: var(--md-space-5);
  padding: 0 24px 24px;
  border-top: 1px solid var(--outline-subtle);
}

.filter-panel__body--header {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(720px, calc(100vw - 40px));
  padding-top: 20px;
  border-top: 0;
  border: 1px solid var(--outline-subtle);
  border-radius: var(--md-radius-medium);
  background: var(--surface-2);
  backdrop-filter: blur(18px);
  box-shadow: var(--md-elevation-3);
}

.filter-panel__body-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--md-space-4);
}

.filter-panel__button {
  gap: 10px;
  min-height: 42px;
}

.filter-panel__count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--md-sys-color-primary);
  color: var(--text-inverse);
  font-size: 0.78rem;
  font-weight: 700;
}

.filter-panel[open] .filter-panel__body {
  animation: filter-panel-reveal 180ms ease;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: var(--md-space-4);
  align-items: flex-start;
  margin-bottom: var(--md-space-5);
}

.section-support {
  max-width: 64ch;
}

.filter-chip-groups {
  display: grid;
  gap: var(--md-space-4);
}

.filter-chip-group {
  display: grid;
  gap: var(--md-space-2);
}

.filter-chip-group__label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: var(--md-space-4);
  align-items: end;
}

.filter-form--compact .field input {
  min-height: 46px;
}

.filter-form__actions {
  display: flex;
  align-items: stretch;
  min-width: 146px;
}

.field,
.form-field {
  display: grid;
  gap: var(--md-space-2);
}

.field span,
.form-field span {
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--text-base);
}

.field input,
.field select,
.form-field input,
.form-field select {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--outline-strong);
  border-radius: 18px;
  background: var(--surface-3);
  color: var(--text-strong);
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.field input:focus,
.field select:focus,
.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 4px var(--focus-ring);
  background: var(--surface-1);
}

a:focus-visible,
.button:focus-visible,
button:focus-visible,
.chip-filter:focus-visible,
.table-row-link:focus-visible,
.filter-panel__summary:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.form-field input:focus-visible,
.form-field select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus-ring-strong);
}

.status-message {
  margin: 0 0 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.status-message--success {
  background: rgba(68, 160, 87, 0.14);
  color: #1e5f2b;
}

.status-message--error {
  background: rgba(176, 63, 69, 0.12);
  color: #8d1f2a;
}

.manual-track-panel {
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.manual-track-panel--flush {
  margin-top: 0;
  margin-bottom: 20px;
  padding-top: 0;
  border-top: 0;
}

.manual-track-form {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.manual-track-form--stacked {
  align-items: stretch;
}

.manual-track-form .form-field {
  flex: 1 1 18rem;
  margin: 0;
}

.checkbox-field {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--text-strong);
  font-weight: 580;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.manual-track-panel__note {
  margin: 0.75rem 0 0;
  color: #5b6474;
  font-size: 0.92rem;
}

.manual-track-summary {
  list-style: none;
  display: inline-flex;
  margin-bottom: 0.9rem;
}

.manual-track-summary::-webkit-details-marker {
  display: none;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--md-sys-color-primary);
  color: var(--text-inverse);
  font: inherit;
  font-weight: 580;
  cursor: pointer;
  box-shadow: var(--md-elevation-1);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  letter-spacing: 0.01em;
}

.button:hover,
button:hover {
  text-decoration: none;
  background: var(--button-primary-hover);
  box-shadow: var(--md-elevation-2);
}

.button--outlined {
  background: var(--surface-2);
  border-color: var(--outline-strong);
  color: var(--text-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.button--text {
  background: transparent;
  color: var(--md-sys-color-primary);
  box-shadow: none;
}

.button--text:hover {
  color: #ffffff;
}

.chip-row {
  display: flex;
  gap: var(--md-space-2);
  flex-wrap: wrap;
  margin-top: var(--md-space-5);
}

.chip-row--compact {
  margin-top: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--md-sys-color-surface-container-low);
  color: var(--text-base);
  font-size: 0.86rem;
  font-weight: 560;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.chip--tonal {
  background: var(--md-sys-color-primary-container);
  color: var(--text-accent);
}

.chip--dismissible {
  justify-content: space-between;
  gap: 10px;
  border-color: var(--outline-subtle);
  background: var(--surface-1);
}

.chip--success {
  background: var(--md-sys-color-success-container);
  color: var(--text-success);
}

.chip--warning {
  background: var(--md-sys-color-warning-container);
  color: var(--text-warning);
}

.chip-filter {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--outline-subtle);
  border-radius: 999px;
  background: var(--surface-1);
  color: var(--text-base);
  font-size: 0.88rem;
  font-weight: 560;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: var(--md-elevation-0), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.chip-filter:hover {
  text-decoration: none;
  border-color: var(--md-sys-color-primary);
  background: var(--surface-tonal);
}

.chip-filter.is-selected {
  border-color: transparent;
  background: var(--md-sys-color-primary);
  color: var(--text-inverse);
  box-shadow: inset 0 0 0 1px rgba(var(--shadow-color-rgb), 0.04);
}

.active-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--md-space-2);
  align-items: center;
}

.dashboard-content-grid,
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.95fr) minmax(310px, 0.95fr);
  gap: var(--md-space-6);
  align-items: start;
}

.dashboard-sidebar {
  display: grid;
  gap: var(--md-space-6);
}

body:has(.dashboard-shell) {
  background: #f3f4f6;
}

.dashboard-shell .top-app-bar {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.dashboard-shell .top-app-bar__title-group h1 {
  color: #111827;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dashboard-shell .surface-card,
.dashboard-shell .summary-card {
  border-radius: 12px;
}

.dashboard-shell .summary-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.dashboard-shell .summary-card__label {
  color: #6b7280;
}

.dashboard-shell .summary-card__value {
  color: #111827;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dashboard-shell .progress-card .summary-card__value,
.dashboard-shell .progress-card .achievement-summary-card__title {
  color: var(--md-sys-color-primary);
}

.dashboard-shell .summary-card__badge {
  background: #eff6ff;
  color: #1e40af;
  box-shadow: none;
}

.dashboard-shell .summary-card__badge--neutral {
  background: #f3f4f6;
  color: #374151;
}

.dashboard-shell .table-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.dashboard-shell .table-card__scroller {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: none;
}

.dashboard-shell .section-heading--timeline {
  align-items: flex-start;
  gap: 16px;
}

.dashboard-shell .section-heading--timeline .button--outlined {
  padding: 0 14px;
  border: 1px solid #d1d5db;
  background: #ffffff;
}

.dashboard-shell .section-heading--timeline .button--outlined:hover {
  background: #f9fafb;
}

.dashboard-shell .dashboard-sidebar .surface-card,
.dashboard-shell .dashboard-sidebar .trend-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.dashboard-shell .insight-card,
.dashboard-shell .insight-subcard {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.dashboard-shell .section-heading h2 {
  color: #111827;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0;
}

.dashboard-shell .section-label,
.dashboard-shell .insight-card__label,
.dashboard-shell .summary-card__label,
.dashboard-shell .filter-chip-group__label {
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.dashboard-shell .section-support,
.dashboard-shell .trend-card__support,
.dashboard-shell .insight-card__support,
.dashboard-shell .date-stack span,
.dashboard-shell .table-empty span {
  color: #6b7280;
}

.dashboard-shell .button--outline,
.dashboard-shell .button--outlined {
  margin: 0;
  min-height: 40px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #111827;
  font-weight: 500;
  box-shadow: none;
}

.dashboard-shell .button--outlined:hover {
  background: #f9fafb;
}

.dashboard-shell .chip-filter {
  min-height: 32px;
  padding: 0 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: none;
}

.dashboard-shell .chip-filter:hover {
  background: #e5e7eb;
  border-color: #e5e7eb;
}

.dashboard-shell .chip-filter.is-selected {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.dashboard-shell .field span {
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
}

.dashboard-shell .field input,
.dashboard-shell .field select {
  min-height: 40px;
  padding: 0 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: none;
}

.dashboard-shell .field input:focus,
.dashboard-shell .field select:focus {
  background: #ffffff;
  border-color: #d1d5db;
}

.dashboard-shell .data-table {
  font-size: 0.875rem;
}

.dashboard-shell .data-table th,
.dashboard-shell .data-table td {
  padding: 12px 16px;
}

.dashboard-shell .data-table th {
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: none;
}

.dashboard-shell .data-table th.is-active-sort {
  background: #eff6ff;
  color: #1e40af;
}

.dashboard-shell .data-table td {
  border-bottom-color: #e5e7eb;
}

.dashboard-shell .table-row-link:hover,
.dashboard-shell .table-row-link:focus-visible {
  background: #f9fafb;
  box-shadow: none;
}

.dashboard-shell .table-row-link.is-pressed {
  background: #f3f4f6;
  box-shadow: none;
}

.dashboard-shell .session-feed {
  display: grid;
  gap: 20px;
}

.dashboard-shell .session-group {
  display: grid;
  gap: 10px;
}

.dashboard-shell .session-group__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e5e7eb;
}

.dashboard-shell .session-group__header h3 {
  margin: 0;
  color: #111827;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dashboard-shell .session-group__header span {
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 600;
}

.dashboard-shell .session-group__list {
  display: grid;
  gap: 10px;
}

.dashboard-shell .session-archive {
  display: grid;
  gap: 14px;
  margin-top: 4px;
  padding: 14px 16px 0;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
}

.dashboard-shell .session-archive__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.dashboard-shell .session-archive__summary::-webkit-details-marker {
  display: none;
}

.dashboard-shell .session-archive__summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.dashboard-shell .session-archive[open] .session-archive__summary::after {
  content: "−";
}

.dashboard-shell .session-archive__title {
  color: #0f172a;
  font-size: 0.94rem;
  font-weight: 700;
}

.dashboard-shell .session-archive__count {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: auto;
}

.dashboard-shell .session-archive__content {
  display: grid;
  gap: 18px;
}

.dashboard-shell .session-entry {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(255, 255, 255, 1) 100%);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dashboard-shell .session-entry:hover,
.dashboard-shell .session-entry:focus-visible {
  border-color: #cbd5e1;
  box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.5);
  transform: translateY(-1px);
}

.dashboard-shell .session-entry.is-pressed {
  transform: translateY(0);
}

.dashboard-shell .session-entry__main {
  display: grid;
  gap: 8px;
}

.dashboard-shell .session-entry__title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-shell .session-entry__identity {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.dashboard-shell .session-entry__track,
.dashboard-shell .session-entry__car,
.dashboard-shell .session-entry__best-lap {
  color: #111827;
}

.dashboard-shell .session-entry__track {
  font-size: 1rem;
  font-weight: 800;
}

.dashboard-shell .session-entry__car {
  font-size: 0.97rem;
  font-weight: 600;
}

.dashboard-shell .session-entry__dash {
  color: #9ca3af;
  font-weight: 600;
}

.dashboard-shell .session-entry__best-lap {
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.dashboard-shell .session-entry__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #4b5563;
  font-size: 0.83rem;
}

.dashboard-shell .session-entry__meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dashboard-shell .session-entry__meta > span:not(:last-child)::after {
  content: "•";
  margin-left: 8px;
  color: #cbd5e1;
}

.unit-secondary {
  font-size: 0.7em;
  opacity: 0.7;
}

.dashboard-shell .type-pill {
  min-height: 24px;
  padding: 0 10px;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 600;
}

.dashboard-shell .trend-chart__axis {
  stroke: #e5e7eb;
}

.dashboard-shell .trend-chart__line {
  stroke: #2563eb;
  stroke-width: 3;
}

.dashboard-shell .trend-chart__area {
  fill: #eff6ff;
}

.table-card__scroller {
  overflow: auto;
  border: 1px solid var(--outline-subtle);
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--outline-subtle);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-3);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  box-shadow: inset 0 -1px 0 var(--outline-subtle);
}

.data-table th a {
  color: inherit;
  font-weight: 650;
}

.data-table th.is-active-sort {
  color: var(--md-sys-color-primary);
  background: var(--surface-tonal-strong);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-row-link {
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.table-row-link:hover,
.table-row-link:focus-visible {
  background: var(--surface-hover);
  box-shadow: inset 4px 0 0 var(--md-sys-color-primary);
  outline: none;
}

.table-row-link.is-pressed {
  background: var(--surface-pressed);
  box-shadow: inset 5px 0 0 var(--md-sys-color-primary);
}

.data-table__numeric {
  text-align: right !important;
  white-space: nowrap;
}

.data-table__lap-time {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 560;
}

.data-table__title-cell strong {
  display: block;
  font-size: 0.93rem;
  font-weight: 650;
}

.data-table__subline {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.82rem;
}

.gt-benchmark-table {
  min-width: 980px;
}

.gt-benchmark-table__corner {
  min-width: 92px;
  width: 92px;
  padding: 6px 8px !important;
  background: var(--surface-3);
}

.gt-benchmark-table__row-label {
  min-width: 170px;
  font-size: 0.9rem;
  font-weight: 650;
}

.gt-benchmark-table__group {
  padding-top: 6px !important;
  padding-bottom: 4px !important;
  font-size: 0.72rem;
  font-style: italic;
  text-align: center !important;
  line-height: 1.1;
}

.gt-benchmark-table__step {
  padding-top: 4px !important;
  padding-bottom: 6px !important;
  font-size: 0.68rem;
  font-weight: 560;
  white-space: nowrap;
  line-height: 1.1;
  border-left: 1px solid rgba(148, 163, 184, 0.22);
}

.gt-benchmark-table__group--1,
.gt-benchmark-table__step--top8_avg,
.gt-benchmark-table__cell--top8_avg {
  background: #f8fafc;
}

.gt-benchmark-table__group--2,
.gt-benchmark-table__step--pct_101,
.gt-benchmark-table__cell--pct_101 {
  background: #edf4ff;
}

.gt-benchmark-table__group--3,
.gt-benchmark-table__step--pct_102,
.gt-benchmark-table__step--pct_103,
.gt-benchmark-table__cell--pct_102,
.gt-benchmark-table__cell--pct_103 {
  background: #eef8f1;
}

.gt-benchmark-table__group--4,
.gt-benchmark-table__step--pct_104,
.gt-benchmark-table__step--pct_105,
.gt-benchmark-table__cell--pct_104,
.gt-benchmark-table__cell--pct_105 {
  background: #fbf1e4;
}

.gt-benchmark-table__group--5,
.gt-benchmark-table__step--pct_106,
.gt-benchmark-table__cell--pct_106 {
  background: #fae8e6;
}

.gt-benchmark-table__group--6,
.gt-benchmark-table__step--pct_107,
.gt-benchmark-table__cell--pct_107 {
  background: #f7e2e7;
}

.gt-benchmark-table__step--top8_avg,
.gt-benchmark-table__cell--top8_avg,
.gt-benchmark-table__group--2,
.gt-benchmark-table__step--pct_101,
.gt-benchmark-table__cell--pct_101,
.gt-benchmark-table__step--pct_102,
.gt-benchmark-table__cell--pct_102,
.gt-benchmark-table__step--pct_104,
.gt-benchmark-table__cell--pct_104,
.gt-benchmark-table__step--pct_106,
.gt-benchmark-table__cell--pct_106 {
  box-shadow: inset -1px 0 0 rgba(148, 163, 184, 0.2);
}

.gt-benchmark-delta {
  font-weight: 650;
}

.gt-benchmark-delta--faster {
  color: #15803d;
}

.gt-benchmark-delta--slower {
  color: #b91c1c;
}

.gt-benchmark-delta--neutral {
  color: var(--text-muted);
}

.type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.date-stack {
  display: grid;
  gap: 2px;
}

.date-stack strong {
  font-size: 0.92rem;
}

.date-stack span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.table-empty {
  display: grid;
  gap: 6px;
  padding: 28px 12px;
  text-align: center;
}

.trend-card {
  min-height: 100%;
  background:
    linear-gradient(180deg, var(--trend-card-tint) 0%, var(--surface-1) 58%);
}

.insight-grid {
  display: grid;
  gap: var(--md-space-3);
}

.insight-card {
  display: grid;
  gap: var(--md-space-2);
  border: 1px solid var(--outline-subtle);
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.insight-card__label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-card__value {
  font-size: 1.1rem;
  font-weight: 650;
  line-height: 1.2;
}

.insight-card__support {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.insight-subgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--md-space-3);
  margin-top: var(--md-space-3);
}

.insight-subgrid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.insight-subcard {
  display: grid;
  gap: var(--md-space-1);
  border: 1px solid var(--outline-subtle);
  border-radius: 16px;
  background: var(--surface-3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.insight-subcard__value {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
}

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

.usage-card__header {
  display: grid;
  gap: 6px;
}

.usage-card__header .section-label,
.usage-card__header h2,
.usage-card__header p {
  margin: 0;
}

.usage-card__support {
  max-width: 44ch;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.usage-card__segment {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(47, 93, 142, 0.12);
  border-radius: 14px;
  background: #f9fafb;
}

.metric-row,
.insight-row,
.usage-card__metrics,
.usage-card__entities,
.usage-card__visuals {
  align-items: start;
}

.usage-card__metrics {
  gap: 20px;
  overflow: visible;
}

.usage-card__metrics--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.usage-card__metrics--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric,
.usage-card__metric {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 0;
}

.usage-card__metric + .usage-card__metric {
  border-left: 1px solid rgba(47, 93, 142, 0.12);
  padding-left: 20px;
}

.usage-card__metric-icon,
.usage-card__entity-icon {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  line-height: 0;
  color: var(--md-sys-color-primary);
  opacity: 0.8;
  margin-top: 2px;
}

.usage-card__metric-copy,
.usage-card__entity-copy,
.usage-card__visual-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.usage-card__metric-value,
.usage-card__visual-value {
  color: #0f172a;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.usage-card__metric-label {
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.7;
}

.usage-card__entities {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  overflow: visible;
}

.entity-block,
.usage-card__entity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 0;
}

.usage-card__entity + .usage-card__entity {
  border-left: 1px solid rgba(47, 93, 142, 0.12);
  padding-left: 20px;
}

.entity-text,
.usage-card__entity-copy {
  justify-content: flex-start;
}

.usage-card__entity-label {
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.usage-card__entity-value {
  color: #0f172a;
  font-size: clamp(1.35rem, 1.9vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.usage-card__entity-value a {
  color: inherit;
}

.usage-card__entity-support {
  color: #6b7280;
  font-size: 0.92rem;
}

.usage-card__visuals {
  grid-template-columns: 1.05fr 1.25fr;
  gap: 20px;
}

.usage-card__visual {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
}

.usage-card__visual--donut {
  padding-right: 0;
}

.usage-card__visual--bar {
  padding-left: 20px;
  border-left: 1px solid rgba(47, 93, 142, 0.12);
}

.usage-card__progress {
  position: relative;
  flex: 1 1 auto;
  height: 16px;
  border-radius: 999px;
  background: #dbe4f0;
  overflow: hidden;
  margin-top: 10px;
}

.usage-card__progress-bar {
  display: block;
  width: var(--usage-progress, 0%);
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1e3a8a 0%, #2f5d8e 100%);
}

.usage-card__icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.usage-card__donut.achievement-donut--small {
  width: 110px;
  height: 110px;
}

.usage-card__donut.achievement-donut--small .achievement-donut__value {
  width: 62px;
  height: 62px;
  font-size: 1rem;
}

.usage-card--compact .usage-card__segment {
  padding: 16px 18px;
}

.usage-card--compact .usage-card__entity-value {
  font-size: 1.2rem;
}

.usage-card--compact .usage-card__metric-value {
  font-size: 30px;
}

.usage-card .achievement-donut-wrap {
  justify-content: flex-start;
  margin-top: 0;
}

.milestone-list {
  gap: var(--md-space-2);
}

.milestone-card {
  gap: var(--md-space-1);
}

.achievements-shell .section-card,
.achievements-shell .summary-card {
  background: #ffffff;
}

.achievement-group-stack {
  display: grid;
  gap: var(--md-space-5);
}

.achievement-group {
  display: grid;
  gap: var(--md-space-3);
}

.section-heading--compact {
  margin-bottom: 0;
}

.achievement-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--md-space-4);
}

.achievement-card-grid--tracks,
.achievement-card-grid--cars {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.achievement-card-grid--next {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.milestones-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.milestone-tile {
  padding: 0;
  display: grid;
  align-items: stretch;
  text-align: left;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  gap: 5px;
}

.milestone-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
}

.milestone-tile .achievement-card__title {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 0;
  justify-self: start;
  text-align: left;
}

.milestone-value-row {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.milestone-meter-wrap {
  margin-top: 0;
}

.progress-meter {
  width: 100%;
}

.progress-meter__track {
  position: relative;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #dbe4f0;
  overflow: hidden;
}

.progress-meter__fill {
  display: block;
  width: var(--progress-value, 0%);
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--md-sys-color-primary);
}

.progress-meter--empty .progress-meter__fill {
  width: 0;
}

.milestone-tile + .milestone-tile {
  padding-top: 2px;
}

.achievement-card {
  padding: 18px 20px;
  gap: var(--md-space-2);
}

.achievement-summary-card {
  min-width: 0;
}

.progress-card {
  min-width: 0;
  display: block;
  color: inherit;
  text-decoration: none;
}

.progress-card:visited,
.progress-card:hover,
.progress-card:active {
  color: inherit;
  text-decoration: none;
}

.achievement-summary-card--compact .summary-card__body {
  align-items: center;
  text-align: center;
}

.achievement-summary-card__topline {
  display: flex;
  justify-content: flex-end;
  min-height: 24px;
  padding: 0 24px;
  margin-top: 18px;
}

.achievement-summary-card__title {
  display: block;
  font-size: 1.35rem !important;
  line-height: 1.15;
  color: var(--md-sys-color-primary);
}

.achievement-card--tile {
  align-items: center;
  text-align: center;
}

.achievement-card__badge {
  align-self: flex-start;
}

.achievement-card-grid--sidebar-milestones .achievement-card__badge {
  margin-bottom: 2px;
}

.achievement-card__title {
  display: block;
}

.achievement-card__support--compact {
  font-size: 0.86rem;
}

.achievement-donut-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--md-space-2);
}

.achievement-donut {
  --donut-angle: calc(var(--donut-value, 0) * 3.6deg);
  width: 102px;
  height: 102px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #ffffff 56%, transparent 57%),
    conic-gradient(#2563eb 0deg var(--donut-angle), #e5e7eb var(--donut-angle) 360deg);
}

.achievement-donut--small {
  width: 92px;
  height: 92px;
}

.achievement-donut--empty {
  background:
    radial-gradient(circle at center, #ffffff 56%, transparent 57%),
    conic-gradient(#d1d5db 0deg 360deg);
}

.achievement-donut__value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffffff;
  color: #111827;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.achievement-donut--small .achievement-donut__value {
  width: 50px;
  height: 50px;
  font-size: 0.9rem;
}

.achievement-donut--empty .achievement-donut__value {
  color: #9ca3af;
}

.achievement-stat-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin-top: var(--md-space-3);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.trend-chart {
  width: 100%;
  height: auto;
  display: block;
}

.trend-chart__axis {
  stroke: var(--md-sys-color-outline);
  stroke-width: 1;
}

.trend-chart__line {
  fill: none;
  stroke: var(--md-sys-color-primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.5;
}

.trend-chart__grid {
  stroke: rgba(179, 190, 202, 0.45);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}

.trend-chart__area {
  fill: var(--chart-area-fill);
}

.trend-chart__dot {
  fill: var(--surface-1);
  stroke: var(--md-sys-color-primary);
  stroke-width: 2.25;
}

.trend-chart__label {
  fill: var(--text-muted);
  font-size: 11px;
  font-weight: 560;
}

.chart-hover-layer {
  pointer-events: all;
}

.chart-hover-target {
  fill: transparent;
  cursor: crosshair;
}

.chart-hover-target:focus {
  outline: none;
}

.chart-hover-target:focus-visible {
  fill: rgba(15, 23, 42, 0.04);
}

.chart-tooltip {
  position: fixed;
  z-index: 1200;
  min-width: 132px;
  max-width: 220px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.94);
  color: #f8fafc;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.24);
  font-size: 0.8rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity 120ms ease, transform 120ms ease;
}

.chart-tooltip.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.chart-tooltip__title {
  margin: 0 0 4px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 650;
}

.chart-tooltip__line {
  margin: 0;
  color: rgba(241, 245, 249, 0.92);
  font-variant-numeric: tabular-nums;
}

.chart-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed var(--outline-strong);
  border-radius: var(--md-radius-small);
  background: var(--md-sys-color-surface-container);
  padding: 20px;
}

.detail-hero-card {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: var(--md-space-3);
  padding: 24px;
  background:
    linear-gradient(180deg, var(--surface-tonal) 0%, var(--surface-1) 60%);
  box-shadow: var(--md-elevation-2);
}

.charts-shell {
  gap: 18px;
}

.charts-shell .top-app-bar {
  margin-bottom: 2px;
}

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

.chart-card {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.chart-card__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.chart-card__header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.chart-card__eyebrow {
  margin: 0 0 4px;
  color: rgba(38, 49, 60, 0.58);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.chart-card .trend-card__support {
  margin-top: 4px;
  font-size: 0.86rem;
}

.chart-card__stat {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-tonal);
  color: var(--text-accent);
  font-size: 0.95rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.charts-distribution {
  display: grid;
  gap: 10px;
}

.charts-distribution__stack {
  display: flex;
  min-height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-neutral);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68);
}

.charts-distribution__segment {
  width: var(--segment-width);
  background: var(--segment-color);
}

.charts-distribution__legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.charts-distribution__legend-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--outline-subtle);
  border-radius: 18px;
  background: var(--surface-2);
}

.charts-distribution__legend-item strong,
.charts-distribution__legend-item span {
  display: block;
}

.charts-distribution__legend-item strong {
  margin-bottom: 1px;
  font-size: 0.9rem;
}

.charts-distribution__legend-item span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.charts-distribution__swatch {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--swatch-color);
  flex: 0 0 auto;
}

.charts-line-chart--key .trend-chart__line {
  stroke-width: 4.5;
}

.charts-line-chart--key .trend-chart__dot {
  stroke-width: 2.75;
}

.detail-hero-card__top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--md-space-4);
  align-items: start;
  align-content: start;
}

.detail-hero-card__panel {
  display: grid;
  gap: var(--md-space-3);
  min-width: 0;
  align-content: start;
  align-self: start;
}

.detail-hero-card__panel--identity {
  gap: var(--md-space-2);
}

.detail-hero-card__panel--identity .section-label {
  margin-bottom: 2px;
}

.detail-hero-card__panel--identity .chip-row {
  margin-top: 0;
}

.detail-hero-card__panel--meta {
  align-self: start;
}

.detail-kpis__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--md-space-3);
}

.detail-kpis__grid--hero {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.detail-kpis__row {
  display: flex;
  gap: var(--md-space-3);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.detail-kpis__row--benchmarks {
  justify-content: flex-start;
}

.metric-chip {
  min-width: 0;
  height: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--outline-subtle);
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.98) 0%, rgba(241, 246, 251, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 18px rgba(var(--shadow-color-rgb), 0.04);
}

.metric-chip--best {
  border-color: rgba(79, 123, 180, 0.26);
  background:
    linear-gradient(180deg, rgba(240, 246, 255, 0.98) 0%, rgba(235, 243, 252, 0.96) 100%);
}

.metric-chip--secondary strong {
  font-size: 1.08rem;
  font-weight: 580;
}

.metric-chip__value-unit {
  font-size: 0.76em;
  font-weight: 520;
  color: var(--text-muted);
}

.metric-chip__value-unit--session {
  opacity: 0.5;
}

.metric-chip strong {
  display: block;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 620;
  color: var(--text-strong);
}

.metric-chip__delta {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.metric-chip__delta--warning {
  color: var(--text-warning);
}

.detail-kpis__subtext {
  margin: 0 0 2px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.detail-kpis__insight {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 550;
}

.detail-list {
  margin: 0;
  display: grid;
  gap: 14px;
}

.detail-list--compact {
  gap: 10px;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--outline-subtle);
}

.detail-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.detail-list dt {
  color: var(--text-muted);
}

.detail-list dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
}

.section-card--compact {
  padding: 20px 24px;
}

.session-detail-footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--md-space-6);
}

.track-highlight-grid,
.track-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--md-space-6);
}

.track-highlight-card {
  min-height: 180px;
}

.chart-legend--track {
  margin-bottom: var(--md-space-5);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 540;
}

.chart-legend__swatch {
  width: 18px;
  height: 0;
  border-top: 3px solid var(--legend-color, var(--md-sys-color-primary));
  border-radius: 999px;
}

.chart-legend__swatch--dashed {
  border-top-style: dashed;
  border-top-color: var(--chart-line-muted);
}

.chart-legend__swatch--pb {
  border-top-style: dotted;
  opacity: 0.9;
}

.chart-legend__swatch--session-valid {
  --legend-color: #2563eb;
}

.chart-legend__swatch--session-invalid {
  --legend-color: #d97706;
  border-top-style: dashed;
}

.chart-legend__swatch--session-excluded {
  --legend-color: #9ca3af;
  border-top-style: dotted;
}

.chart-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.chart-legend__dot--valid {
  background: var(--md-sys-color-primary);
}

.chart-legend__dot--invalid {
  background: var(--md-sys-color-warning);
}

.chart-legend__dot--best {
  background: var(--md-sys-color-success);
}

.chart-legend__dot--analysis-outlier {
  background: var(--md-ref-palette-neutral-60);
}

.track-trend__line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track-trend__line--best {
  stroke-width: 2;
  stroke-dasharray: 8 7;
  opacity: 0.85;
}

.track-trend__line--pb {
  stroke-width: 2;
  stroke-dasharray: 4 6;
  opacity: 0.7;
}

.session-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr);
  gap: 16px;
}

.session-chart-panel {
  display: grid;
  gap: 6px;
}

.session-chart-wrap {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 220px;
}

.session-chart {
  width: 100%;
  height: 220px;
  max-height: none;
  display: block;
}

.session-chart-legend {
  margin-bottom: 12px;
}

.session-chart__segment {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.session-chart__segment {
  stroke-width: 3.25;
}

.session-chart__segment--valid {
  stroke: #2563eb;
}

.session-chart__segment--invalid {
  stroke: #d97706;
  stroke-width: 2;
  stroke-dasharray: 7 6;
  opacity: 0.82;
}

.session-chart__segment--excluded {
  stroke: #9ca3af;
  stroke-width: 1.75;
  stroke-dasharray: 2 7;
  opacity: 0.66;
}

.session-chart__point {
  stroke-width: 1.6;
}

.session-chart__point--valid {
  fill: #2563eb;
  stroke: rgba(255, 255, 255, 0.9);
}

.session-chart__point--invalid {
  fill: #ffffff;
  stroke: #d97706;
}

.session-chart__point--excluded {
  fill: rgba(156, 163, 175, 0.5);
  stroke: rgba(255, 255, 255, 0.7);
}

.session-chart__point--best {
  fill: #059669;
  stroke: #ffffff;
  stroke-width: 3;
}


.session-chart__zero-line {
  stroke: rgba(24, 33, 42, 0.28);
  stroke-width: 1.5;
}

.session-chart__consistency-band {
  fill: rgba(37, 99, 235, 0.12);
}

.session-chart__consistency-threshold {
  stroke: rgba(37, 99, 235, 0.28);
  stroke-width: 1;
  stroke-dasharray: 5 6;
}

.data-table--detail td:first-child {
  white-space: nowrap;
}

.data-table--detail .is-best-row {
  background: var(--surface-selected);
  box-shadow: inset 4px 0 0 var(--md-sys-color-primary);
}

.data-table--detail .is-worst-valid-row {
  background: var(--surface-warning-strong);
  box-shadow: inset 4px 0 0 var(--md-sys-color-warning);
}

.data-table--detail .is-analysis-excluded-row {
  background: var(--surface-neutral);
  box-shadow: inset 4px 0 0 var(--md-ref-palette-neutral-60);
}

.data-table--detail .is-invalid-row {
  background: var(--surface-error-strong);
  box-shadow: inset 4px 0 0 var(--md-sys-color-error);
}

.is-low-sample-row {
  opacity: 0.72;
}

.lap-flag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--md-sys-color-primary-container);
  color: var(--text-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.lap-flag--warning {
  background: var(--md-sys-color-warning-container);
  color: var(--text-warning);
}

.lap-flag--muted {
  background: var(--surface-neutral);
  color: var(--text-base);
}

.lap-flag--best-rank {
  background: rgba(54, 94, 141, 0.12);
  color: #365e8d;
}

.sector-best-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(47, 93, 142, 0.12);
  color: var(--text-accent);
  box-shadow: inset 0 0 0 1px rgba(47, 93, 142, 0.12);
}

.panel,
.empty-state-card {
  max-width: 520px;
  margin: 80px auto 0;
  padding: 28px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.error-message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--md-sys-color-error-container);
  color: var(--text-error);
  font-weight: 600;
}

.text-link {
  font-weight: 600;
}

.text-link--inline {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

code {
  font-family: "SFMono-Regular", Consolas, monospace;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--md-sys-color-surface-container);
  color: var(--text-base);
}

@keyframes filter-panel-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cm-stats-two-up {
    grid-template-columns: 1fr;
  }

  .detail-kpis__grid--hero {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-panel__body--header {
    width: min(640px, calc(100vw - 40px));
  }

  .filter-form__actions {
    grid-column: 1 / -1;
  }

  .dashboard-content-grid,
  .detail-grid,
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .shell {
    width: min(100vw - 20px, 100%);
    padding-top: 16px;
  }

  .top-app-bar,
  .detail-hero-card,
  .filter-panel__summary {
    flex-direction: column;
  }

  .detail-hero-card__top {
    grid-template-columns: 1fr;
  }

  .session-detail-footer-grid {
    grid-template-columns: 1fr;
  }

  .track-highlight-grid,
  .track-table-grid {
    grid-template-columns: 1fr;
  }

  .detail-kpis__grid--hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-app-bar__controls {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-panel--header {
    width: 100%;
  }

  .filter-panel__body--header {
    left: 0;
    right: auto;
    width: 100%;
  }

  .detail-kpis,
  .detail-kpis__row,
  .detail-kpis__row--benchmarks {
    justify-content: flex-start;
  }

  .detail-kpis {
    justify-items: stretch;
  }

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

  .filter-form__actions {
    min-width: 0;
  }

  .filter-panel__summary-actions {
    width: 100%;
    justify-content: space-between;
  }

  .filter-panel__body-head {
    flex-direction: column;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .charts-summary-grid,
  .charts-distribution__legend {
    grid-template-columns: 1fr;
  }

  .achievement-card-grid {
    grid-template-columns: 1fr;
  }

  .milestones-grid {
    grid-template-columns: 1fr;
  }

  .detail-kpis__grid--hero {
    grid-template-columns: 1fr;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .chart-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-shell .section-heading--timeline {
    align-items: stretch;
  }

  .dashboard-shell .session-group__header,
  .dashboard-shell .session-entry__title-row,
  .dashboard-shell .session-archive__summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-shell .session-entry__best-lap {
    font-size: 1rem;
  }

  .dashboard-shell .session-archive__count {
    margin-left: 0;
  }

  .dashboard-shell .session-entry__meta > span:not(:last-child)::after {
    display: none;
  }

  .insight-subgrid,
  .insight-subgrid--three {
    grid-template-columns: 1fr;
  }

  .usage-card__metrics--three,
  .usage-card__metrics--two,
  .usage-card__entities,
  .usage-card__visuals {
    grid-template-columns: 1fr;
  }

  .usage-card__metric,
  .usage-card__entity {
    padding-inline: 0;
  }

  .usage-card__metric + .usage-card__metric,
  .usage-card__entity + .usage-card__entity,
  .usage-card__visual--bar {
    border-left: 0;
    border-top: 1px solid rgba(47, 93, 142, 0.12);
    padding-left: 0;
    padding-top: 14px;
  }

  .usage-card__visual,
  .usage-card__visual--donut,
  .usage-card__visual--bar {
    padding-right: 0;
  }

  .usage-card__progress {
    width: 100%;
  }

  .detail-list div {
    flex-direction: column;
    gap: 4px;
  }

  .detail-list dd {
    text-align: left;
  }

  .session-chart-grid {
    grid-template-columns: 1fr;
  }
}
