:root {
  color-scheme: dark;
  --bg: #050910;
  --panel: rgba(11, 18, 31, 0.88);
  --panel-solid: #0b121f;
  --panel-soft: #101a2b;
  --line: rgba(139, 159, 194, 0.17);
  --text: #f4f7fb;
  --muted: #8e9bb0;
  --red: #ff143d;
  --red-deep: #a90022;
  --blue: #2274ff;
  --green: #15d488;
  --orange: #ff9c24;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 20, 61, 0.16), transparent 34rem),
    linear-gradient(180deg, #050910 0%, #07101c 44%, #050910 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-sim="iracing"] {
  --red: #2274ff;
  --red-deep: #0d48a8;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header,
main,
.site-footer {
  width: min(1440px, calc(100% - 36px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 210px 1fr 260px auto;
  gap: 20px;
  align-items: center;
  min-height: 78px;
  background: rgba(5, 9, 16, 0.84);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  align-content: center;
  line-height: 1;
}

.brand span,
.site-footer span {
  color: var(--red);
}

.brand strong {
  margin-left: 4px;
}

.brand > span,
.brand > strong {
  display: inline;
  font-size: 1.45rem;
  font-weight: 950;
  font-style: italic;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2.4vw, 34px);
}

.main-nav a {
  position: relative;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.main-nav a.active,
.main-nav a:hover {
  color: var(--text);
}

.main-nav a.active::after {
  position: absolute;
  right: 0;
  bottom: -18px;
  left: 0;
  height: 3px;
  background: var(--red);
  content: "";
}

.user-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
  cursor: pointer;
}

.login-button {
  border: 1px solid var(--line);
  background: rgba(12, 22, 37, 0.72);
  color: var(--text);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: linear-gradient(145deg, #1d2838, #050910);
  font-weight: 900;
}

.user-actions strong {
  display: block;
  font-size: 0.78rem;
}

.user-actions small {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
}

.header-auth-panel {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  z-index: 20;
  display: none;
  width: min(340px, calc(100vw - 24px));
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 15, 27, 0.98);
  box-shadow: var(--shadow);
}

.header-auth-panel.open {
  display: grid;
}

.hero {
  display: grid;
  align-items: center;
  min-height: clamp(300px, 42vh, 460px);
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  background:
    linear-gradient(90deg, rgba(5, 9, 16, 0.98) 0%, rgba(5, 9, 16, 0.9) 38%, rgba(5, 9, 16, 0.36) 78%, rgba(5, 9, 16, 0.72) 100%),
    linear-gradient(180deg, rgba(5, 9, 16, 0.18), rgba(5, 9, 16, 0.88)),
    url("assets/hero-prototype.png") center right / cover no-repeat,
    #07101c;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  position: absolute;
  inset: auto clamp(18px, 5vw, 76px) clamp(18px, 4vw, 42px) auto;
  width: clamp(150px, 22vw, 310px);
  height: 2px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 20, 61, 0.9), rgba(176, 95, 255, 0.85), transparent);
  box-shadow: 0 0 28px rgba(255, 20, 61, 0.42);
  content: "";
  pointer-events: none;
  opacity: 0.74;
  z-index: 0;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 20px;
  max-width: 710px;
}

.eyebrow {
  margin: 0;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.25rem, 5.8vw, 4.7rem);
  font-style: italic;
  font-weight: 1000;
  letter-spacing: -0.05em;
  line-height: 0.88;
  text-transform: uppercase;
}

h2 {
  font-size: 1rem;
  font-weight: 950;
  text-transform: uppercase;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 470px;
  color: #c4ccd8;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.45;
}

.hero-actions,
.sim-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.primary-action,
.secondary-action,
.save-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.primary-action,
.save-button {
  border: 0;
  background: linear-gradient(135deg, var(--red), #ff244d);
  color: #fff;
  box-shadow: 0 12px 38px rgba(255, 20, 61, 0.28);
}

.primary-action {
  padding: 0 22px;
}

.secondary-action,
.ghost-button {
  border: 1px solid var(--line);
  background: rgba(12, 22, 37, 0.74);
  color: var(--text);
}

.secondary-action {
  padding: 0 20px;
}

.sim-switch {
  width: min(100%, 360px);
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 15, 27, 0.8);
}

.sim-switch button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 950;
  text-transform: uppercase;
}

.sim-switch button.active {
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--red) 30%, transparent);
}

.header-switch {
  justify-self: end;
  width: 260px;
  padding: 4px;
}

.header-switch button {
  min-height: 36px;
  font-size: 0.74rem;
}

.metric-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 22px auto 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 15, 27, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.metric-strip article {
  display: flex;
  gap: 15px;
  min-height: 114px;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.metric-strip article:last-child {
  border-right: 0;
}

.personal-dashboard {
  display: grid;
  grid-template-columns: minmax(420px, 1.4fr) minmax(280px, 0.8fr);
  gap: 20px;
  margin: 28px 0;
}

.personal-dashboard > .section-heading {
  grid-column: 1 / -1;
  margin-bottom: -2px;
}

.personal-dashboard .recent-panel,
.personal-dashboard .progression {
  grid-column: 1;
}

.personal-dashboard .track-focus,
.personal-dashboard .favorites {
  grid-column: 2;
}

.metric-icon {
  color: var(--red);
  font-size: 2rem;
}

.metric-strip small,
.muted,
label {
  color: var(--muted);
}

.metric-strip small {
  display: block;
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.metric-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 1.65rem;
}

.metric-strip p {
  color: var(--muted);
  font-size: 0.78rem;
}

.green {
  color: var(--green) !important;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 20px;
}

[hidden] {
  display: none !important;
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

.quick-add {
  grid-column: 1;
}

.add-lap-form {
  width: min(980px, 100%);
  margin: 28px auto 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
  margin-top: 28px;
}

.edit-form {
  display: grid;
  gap: 14px;
  align-self: start;
  padding: 0 22px 22px;
}

.small-action {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(12, 22, 37, 0.72);
  color: var(--text);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.small-action.danger {
  border-color: rgba(255, 20, 61, 0.45);
  color: #ff8fa3;
}

.admin-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(16, 26, 43, 0.72);
}

.admin-editor .save-button,
.admin-editor .ghost-button {
  min-height: 42px;
  margin: 0;
}

.add-lap-form .panel-head,
.add-lap-form input[type="hidden"],
.add-lap-form label:has(textarea),
.add-lap-form .save-button {
  grid-column: 1 / -1;
}

.add-lap-form .time-group {
  min-height: 118px;
}

.public-results {
  grid-column: 1 / -1;
}

.fastest-panel {
  grid-column: 1;
}

.compare-panel {
  grid-column: 2;
  grid-row: span 2;
}

.recent-panel {
  grid-column: 2;
  grid-row: span 2;
}

.track-focus {
  grid-column: 3;
  grid-row: span 2;
}

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

.panel-head {
  padding: 22px 22px 0;
}

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

.quick-add {
  display: grid;
  gap: 14px;
  padding: 0 22px 22px;
}

.ghost-button.full {
  width: 100%;
  margin: 0;
}

label {
  display: grid;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

label span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: none;
}

fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 26, 43, 0.5);
}

legend {
  padding: 0 8px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(15, 26, 43, 0.95);
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 88px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 20, 61, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 20, 61, 0.12);
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.auth-message {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.form-status.success {
  color: var(--green);
}

.form-status.error {
  color: var(--red);
}

.save-button {
  width: 100%;
  cursor: pointer;
}

.recent-panel {
  min-width: 0;
}

.table-wrap {
  overflow-x: auto;
  padding: 10px 16px 18px;
}

table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

td {
  font-size: 0.84rem;
  font-weight: 750;
}

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

.track-shape {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--red);
}

.time {
  color: var(--text);
  font-weight: 950;
}

.delta-pos {
  color: var(--red);
}

.delta-neg {
  color: var(--green);
}

.own-lap {
  background: rgba(255, 20, 61, 0.08);
}

body[data-sim="iracing"] .own-lap {
  background: rgba(34, 116, 255, 0.1);
}

.sim-label,
.class-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 950;
}

.sim-label.lmu {
  background: rgba(255, 20, 61, 0.14);
  color: #ff5471;
}

.sim-label.iracing {
  background: rgba(34, 116, 255, 0.14);
  color: #82afff;
}

.track-focus {
  padding-bottom: 22px;
}

.track-focus .panel-head,
.progression .panel-head {
  padding-bottom: 0;
}

.track-focus > p,
.track-focus > strong {
  margin-right: 22px;
  margin-left: 22px;
}

.track-focus > strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
}

.focus-stats {
  display: grid;
  gap: 10px;
  margin: 16px 22px 0;
}

.focus-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.focus-stats small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.focus-stats b {
  color: var(--text);
  font-size: 0.84rem;
  text-align: right;
}

.pace-meter {
  display: grid;
  gap: 10px;
  margin: 18px 22px;
  padding: 18px;
  border: 1px solid rgba(255, 20, 61, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    #08111f;
}

.pace-meter-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--red));
}

.pace-meter-track span {
  position: absolute;
  top: 50%;
  width: 15px;
  height: 15px;
  border: 2px solid #f4eaff;
  border-radius: 999px;
  background: var(--purple);
  box-shadow: 0 0 16px rgba(176, 95, 255, 0.5);
  transform: translate(-50%, -50%);
}

.pace-meter-track span:last-child {
  background: var(--red);
  border-color: #ffdce4;
  box-shadow: 0 0 16px rgba(255, 20, 61, 0.42);
}

.pace-meter-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ghost-button {
  width: calc(100% - 44px);
  margin-top: 16px;
  cursor: pointer;
}

.progression {
  grid-column: span 1;
  padding-bottom: 20px;
}

.chart {
  display: block;
  position: relative;
  height: 190px;
  margin: 20px 22px;
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(180deg, rgba(255, 20, 61, 0.12), transparent),
    #08111f;
}

.chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart .chart-area {
  fill: url("#progressionFill");
}

.chart .chart-line {
  fill: none;
  stroke: var(--red);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart .chart-point {
  fill: #0b1220;
  stroke: var(--red);
  stroke-width: 2.5;
}

.chart .chart-point.best-point {
  fill: var(--purple);
  stroke: #f2e8ff;
  filter: drop-shadow(0 0 8px rgba(176, 95, 255, 0.7));
}

.chart .chart-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.chart .chart-best-label {
  fill: var(--purple);
}

.empty-chart {
  width: 100%;
  padding-top: 66px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0 22px;
}

.mini-stats small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.mini-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 1.2rem;
}

.favorites {
  padding-bottom: 20px;
}

.guest-content {
  display: grid;
  gap: 16px;
  padding: 18px 22px 22px;
}

.public-filters,
.fastest-content {
  display: grid;
  gap: 12px;
  padding: 18px 22px 22px;
}

.public-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compare-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.compare-controls .muted {
  grid-column: 1 / -1;
}

.public-table-wrap {
  max-height: 700px;
  overflow: auto;
  padding-top: 0;
}

.public-table-wrap table {
  min-width: 780px;
}

.public-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(11, 18, 31, 0.98);
  backdrop-filter: blur(12px);
}

.fastest-result {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 26, 43, 0.82);
}

.fastest-result span,
.fastest-result small {
  color: var(--muted);
}

.fastest-result strong {
  font-size: 1.15rem;
}

.fastest-result b {
  color: #c084fc;
  font-size: 1.8rem;
}

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

.driver-list button {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 26, 43, 0.82);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.driver-list button.active {
  border-color: rgba(255, 20, 61, 0.7);
  box-shadow: inset 3px 0 0 var(--red);
}

.driver-list span {
  color: var(--muted);
  font-size: 0.78rem;
}

.compare-panel {
  padding-bottom: 20px;
}

.compare-controls {
  display: grid;
  gap: 10px;
  padding: 18px 22px 0;
}

.reset-compare {
  align-self: end;
  width: auto;
  min-height: 34px;
  margin: 0;
  padding: 0 10px;
  border-radius: 6px;
  background: rgba(12, 22, 37, 0.48);
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.compare-driver-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 22px 0;
}

.compare-driver-picker button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 26, 43, 0.82);
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.compare-driver-picker button.active {
  border-color: rgba(255, 20, 61, 0.7);
  background: rgba(255, 20, 61, 0.14);
  color: var(--text);
}

.compare-grid {
  max-height: 520px;
  overflow: auto;
  padding: 18px 22px 0;
}

.compare-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compare-table th,
.compare-table td {
  min-width: 140px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  vertical-align: top;
}

.compare-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(16, 26, 43, 0.92);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.compare-table td {
  color: var(--text);
  font-size: 1rem;
  font-weight: 850;
}

.compare-table .fastest-time {
  color: #c084fc;
  font-weight: 950;
  background: rgba(192, 132, 252, 0.12);
}

.directory-section {
  margin-top: 28px;
  min-height: calc(100vh - 190px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

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

.directory-grid:has(.car-class-group) {
  grid-template-columns: 1fr;
}

.directory-grid article {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 26, 43, 0.82);
}

.car-class-group {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(16, 26, 43, 0.72);
}

.car-class-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.car-class-head > span {
  width: 6px;
  height: 42px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 20px rgba(255, 20, 61, 0.32);
}

.car-class-head h3,
.car-class-head p {
  margin: 0;
}

.car-class-head h3 {
  font-size: 1rem;
  text-transform: uppercase;
}

.car-class-head p {
  color: var(--muted);
  font-size: 0.82rem;
}

.car-class-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.car-class-list article {
  min-height: 68px;
  background: rgba(5, 9, 16, 0.34);
}

.class-swatches {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
}

.class-swatches i {
  display: block;
  width: 34px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.class-lmp2 .car-class-head > span,
.class-lmp3 .car-class-head > span {
  background: var(--blue);
  box-shadow: 0 0 20px rgba(34, 116, 255, 0.32);
}

.class-lmgt3 .car-class-head > span,
.class-lmgte-am .car-class-head > span,
.class-gt3 .car-class-head > span {
  background: var(--orange);
  box-shadow: 0 0 20px rgba(255, 156, 36, 0.32);
}

.directory-grid span {
  color: var(--muted);
}

.directory-grid b {
  color: var(--red);
}

.info-section {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.info-section article {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 18, 31, 0.56);
  box-shadow: none;
}

.info-section article:target {
  border-color: rgba(255, 20, 61, 0.72);
  box-shadow: 0 0 0 2px rgba(255, 20, 61, 0.1);
}

.info-section h2 {
  font-size: 0.92rem;
  text-transform: none;
}

.info-section .eyebrow {
  font-size: 0.64rem;
}

.info-section p:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.42;
}

.favorites ol {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0 22px;
  list-style: none;
}

.favorites li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}

.favorites small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.mobile-laps {
  display: none;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 86px;
  color: var(--muted);
}

.site-footer strong {
  color: var(--text);
  font-size: 1.3rem;
  font-style: italic;
}

.site-footer nav {
  display: flex;
  gap: 20px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr auto auto;
    padding-bottom: 12px;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .header-switch {
    width: 230px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  }

  .quick-add {
    grid-column: 1;
  }

  .recent-panel,
  .track-focus,
  .progression,
  .compare-panel,
  .public-results,
  .favorites {
    grid-column: 2;
    grid-row: auto;
  }

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

}

@media (max-width: 860px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 24px, 1440px);
  }

  .user-actions > div {
    display: none;
  }

  .hero {
    min-height: 390px;
    padding: 28px;
    background:
      linear-gradient(180deg, rgba(5, 9, 16, 0.72) 0%, rgba(5, 9, 16, 0.96) 70%),
      linear-gradient(90deg, rgba(5, 9, 16, 0.96), rgba(5, 9, 16, 0.48)),
      url("assets/hero-prototype.png") 62% center / cover no-repeat,
      #07101c;
  }

  .metric-strip,
  .personal-dashboard,
  .edit-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .personal-dashboard .recent-panel,
  .personal-dashboard .progression,
  .personal-dashboard .track-focus,
  .personal-dashboard .favorites {
    grid-column: 1;
  }

  .quick-add,
  .add-lap-form,
  .recent-panel,
  .track-focus,
  .progression,
  .compare-panel,
  .public-results,
  .favorites {
    grid-column: 1;
    grid-row: auto;
  }

  .public-filters,
  .directory-grid,
  .info-section,
  .admin-editor,
  .car-class-list {
    grid-template-columns: 1fr;
  }

  .add-lap-form .panel-head,
  .add-lap-form input[type="hidden"],
  .add-lap-form label:has(textarea),
  .add-lap-form .save-button {
    grid-column: 1;
  }

  .metric-strip {
    margin-top: 18px;
  }

  .metric-strip article {
    min-height: 96px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-strip article:last-child {
    border-bottom: 0;
  }

  .table-wrap {
    display: none;
  }

  .mobile-laps {
    display: grid;
    gap: 12px;
    padding: 18px;
  }

  .lap-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(16, 26, 43, 0.82);
  }

  .lap-card-top,
  .lap-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mini-stats,
  .site-footer {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .site-header {
    min-height: 68px;
    gap: 8px;
  }

  .brand small {
    display: none;
  }

  .header-switch {
    width: 116px;
  }

  .header-switch button {
    min-height: 34px;
    font-size: 0.65rem;
  }

  .login-button {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.68rem;
  }

  .brand > span,
  .brand > strong {
    font-size: 1.1rem;
  }

  .avatar {
    display: none;
  }

  h1 {
    font-size: clamp(2.05rem, 12vw, 3.35rem);
  }

  .hero-actions,
  .panel-head.split {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .hero {
    min-height: 420px;
  }

  .favorites li {
    grid-template-columns: 24px 1fr;
  }

  .compare-grid article {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .favorites li > strong {
    grid-column: 2;
  }

  .site-footer nav {
    flex-wrap: wrap;
    gap: 16px;
  }
}
