/* ─────────────────────────── Variables ─────────────────────────── */
:root {
  --bg:          #0a0a12;
  --surface:     #13131e;
  --surface-2:   #1c1c28;
  --surface-3:   #252535;
  --card-bg:     #13131e;
  --blue:        #0A84FF;
  --blue-dim:    rgba(10,132,255,0.15);
  --blue-glow:   rgba(10,132,255,0.35);
  --purple:      #5E5CE6;
  --orange:      #FF9F0A;
  --green:       #30D158;
  --red:         #FF453A;
  --text:        #F2F2F7;
  --text-2:      #8E8E93;
  --text-muted:  #8E8E93;
  --text-3:      #48484A;
  --border:      rgba(255,255,255,0.07);
  --border-2:    rgba(255,255,255,0.13);
  --radius:      12px;
  --radius-lg:   20px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --font:        -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  --font-mono:   'SF Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  --nav-h:       60px;
}

/* ─────────────────────────── Reset ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ─────────────────────────── Layout ────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 80px 24px; max-width: 1200px; margin: 0 auto; }

/* ─────────────────────────── Navbar ────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: rgba(10,10,18,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; padding: 0 24px; gap: 32px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; letter-spacing: -0.3px;
  color: var(--text); white-space: nowrap;
}
.nav-logo svg { width: 24px; height: 24px; color: var(--blue); }
.nav-links {
  display: flex; list-style: none; gap: 4px; flex: 1;
}
.nav-link {
  padding: 6px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--surface-2);
}
.nav-actions { display: flex; gap: 8px; }

/* ─────────────────────────── Buttons ───────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue); color: #fff;
}
.btn-primary:hover { background: #2a96ff; transform: translateY(-1px); box-shadow: 0 4px 16px var(--blue-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: 12px; }

/* ─────────────────────────── Hero ──────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: var(--nav-h) 24px 0;
  position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}
.hero-glow {
  position: absolute; border-radius: 50%;
  filter: blur(100px); pointer-events: none;
}
.hero-glow-1 {
  width: 600px; height: 600px;
  top: -150px; left: -100px;
  background: rgba(10,132,255,0.12);
}
.hero-glow-2 {
  width: 500px; height: 500px;
  bottom: -100px; right: -50px;
  background: rgba(94,92,230,0.10);
}
.hero-content {
  position: relative; z-index: 1;
  max-width: 560px;
}
.hero-badge {
  display: inline-block; margin-bottom: 20px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid rgba(10,132,255,0.25);
}
.hero-title {
  font-size: clamp(48px, 7vw, 84px);
  font-weight: 800; line-height: 1.05;
  letter-spacing: -2px; margin-bottom: 20px;
}
.hero-accent { color: var(--blue); }
.hero-sub {
  font-size: 17px; color: var(--text-2); line-height: 1.6;
  margin-bottom: 36px; max-width: 460px;
}
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* Speedometer dial decoration */
.hero-dial {
  position: absolute; right: 6vw; top: 50%;
  transform: translateY(-50%);
  width: min(380px, 40vw); height: min(380px, 40vw);
  display: flex; align-items: center; justify-content: center;
}
.dial-ring {
  position: absolute; border-radius: 50%; border: 1px solid;
  animation: dial-spin linear infinite;
}
.dial-ring-1 {
  inset: 0; border-color: rgba(10,132,255,0.2);
  animation-duration: 20s;
}
.dial-ring-2 {
  inset: 20px; border-color: rgba(94,92,230,0.15);
  animation-duration: 35s; animation-direction: reverse;
}
.dial-ring-3 {
  inset: 46px; border-color: rgba(255,255,255,0.05);
  animation-duration: 60s;
}
.dial-ring-1::after, .dial-ring-2::after {
  content: ''; position: absolute;
  width: 8px; height: 8px; border-radius: 50%;
  top: -4px; left: 50%; transform: translateX(-50%);
}
.dial-ring-1::after { background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.dial-ring-2::after { background: var(--purple); box-shadow: 0 0 10px var(--purple); }
@keyframes dial-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.dial-center {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.dial-center span {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800; font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  color: var(--blue);
  text-shadow: 0 0 30px var(--blue-glow);
}
.dial-center small {
  font-size: 12px; color: var(--text-2); letter-spacing: 1px; text-transform: uppercase;
}

/* ─────────────────────────── Stats strip ───────────────────────── */
.section-stats {
  padding: 0;
  background: linear-gradient(180deg, transparent 0%, var(--surface) 20%, var(--surface) 80%, transparent 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-grid {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.stat-card {
  padding: 36px 24px; text-align: center;
  border-right: 1px solid var(--border);
  transition: background 0.2s;
}
.stat-card:last-child { border-right: none; }
.stat-card:hover { background: var(--surface-2); }
.stat-icon { font-size: 24px; margin-bottom: 12px; }
.stat-value {
  font-size: 42px; font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text); letter-spacing: -1px;
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
}
.stat-value small { font-size: 16px; color: var(--text-2); font-weight: 500; }
.stat-label { font-size: 13px; color: var(--text-2); margin-top: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* ─────────────────────────── Rankings ──────────────────────────── */
.rankings-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 4px;
}
.ranking-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  cursor: default;
}
.ranking-row:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  transform: translateY(-1px);
}
.rank-badge {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
  font-family: var(--font-mono);
}
.rank-badge.gold   { background: #FFD700; color: #1a1200; }
.rank-badge.silver { background: #C0C0C0; color: #1a1a1a; }
.rank-badge.bronze { background: rgba(205,127,50,0.85); color: #fff; }
.rank-badge.plain  {
  background: transparent; color: var(--text-3);
  border: 1px solid var(--border-2);
}
.ranking-info { flex: 1; min-width: 0; }
.ranking-name {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ranking-flag { font-size: 15px; flex-shrink: 0; }
.ranking-car {
  font-size: 12px; color: var(--text-2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ranking-speeds {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
}
.ranking-top {
  font-size: 18px; font-weight: 800; font-family: var(--font-mono);
  color: var(--text); letter-spacing: -0.5px; white-space: nowrap;
}
.ranking-top small { font-size: 11px; font-weight: 500; color: var(--text-2); margin-left: 2px; }
.ranking-sub {
  display: flex; gap: 10px; align-items: center;
}
.ranking-sub-item {
  display: flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; font-family: var(--font-mono);
  color: var(--text-2); white-space: nowrap;
}
.ranking-sub-item .icon-sun     { color: var(--orange); font-size: 10px; }
.ranking-sub-item .icon-month   { color: var(--blue);   font-size: 10px; }
.ranking-sub-item small { font-size: 10px; font-weight: 400; color: var(--text-3); }
.ranking-badges {
  display: flex; flex-direction: column; gap: 5px; align-items: flex-end; margin-left: 8px;
}
/* Speed tier pill — solid fill */
.pill-speed {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 22px; padding: 0 5px;
  border-radius: 6px; font-size: 11px; font-weight: 900;
  color: #fff; letter-spacing: 0.3px;
}
/* Performance class pill — tinted fill + colored border */
.pill-perf {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 22px; padding: 0 5px;
  border-radius: 6px; font-size: 11px; font-weight: 900;
  color: #fff; letter-spacing: 0.3px;
  opacity: 0.85;
}
/* Class color variants */
.cls-S { background: #5E5CE6; }
.cls-A { background: #FF453A; }
.cls-B { background: #FF9F0A; }
.cls-C { background: #FFD60A; color: #1a1a00; }
.cls-D { background: #30D158; }
.cls-E { background: #0A84FF; }
.cls-F { background: #636366; }
.pill-perf.cls-S { background: rgba(94,92,230,0.25);  border: 1px solid #5E5CE6; color: #5E5CE6; opacity: 1; }
.pill-perf.cls-A { background: rgba(255,69,58,0.25);   border: 1px solid #FF453A; color: #FF453A; opacity: 1; }
.pill-perf.cls-B { background: rgba(255,159,10,0.25);  border: 1px solid #FF9F0A; color: #FF9F0A; opacity: 1; }
.pill-perf.cls-C { background: rgba(255,214,10,0.2);   border: 1px solid #FFD60A; color: #FFD60A; opacity: 1; }
.pill-perf.cls-D { background: rgba(48,209,88,0.2);    border: 1px solid #30D158; color: #30D158; opacity: 1; }
.pill-perf.cls-E { background: rgba(10,132,255,0.2);   border: 1px solid #0A84FF; color: #0A84FF; opacity: 1; }
.pill-perf.cls-F { background: rgba(99,99,102,0.2);    border: 1px solid #636366; color: #8E8E93; opacity: 1; }

/* Skeleton for rankings */
.ranking-skeleton {
  height: 460px; border-radius: 20px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
.ranking-tabs { display: flex; gap: 6px; }
.rankings-header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.ranking-unit-toggle { display: flex; background: var(--surface-2); border-radius: 8px; padding: 2px; gap: 2px; }
.unit-btn { background: none; border: none; color: var(--text-muted); font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px; cursor: pointer; letter-spacing: 0.5px; transition: background .15s, color .15s; }
.unit-btn.active { background: var(--accent); color: #fff; }
.recent-activity { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }
.recent-activity-title { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px; }
.recent-activity-list { display: flex; flex-direction: column; gap: 6px; }
.activity-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.activity-flag { font-size: 14px; flex-shrink: 0; }
.activity-name { font-weight: 600; color: var(--text-primary); flex-shrink: 0; }
.activity-car { color: var(--text-muted); flex-shrink: 0; }
.activity-speed { color: var(--blue); font-weight: 600; margin-left: auto; flex-shrink: 0; }
.activity-time { color: var(--text-muted); font-size: 11px; flex-shrink: 0; margin-left: 8px; }
.rankings-search-row { position: relative; margin-bottom: 16px; }
.rankings-search-row input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text-primary); font-size: 14px; padding: 9px 36px 9px 14px; outline: none; box-sizing: border-box; transition: border-color .15s; }
.rankings-search-row input:focus { border-color: var(--accent); }
.rankings-search-row input::placeholder { color: var(--text-muted); }
.rankings-search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; display: flex; align-items: center; }
.rankings-more { text-align: center; margin-top: 24px; }
#hazard-map { height: 380px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-1); }
.hazard-map-pin { width: 36px; height: 36px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.hazard-map-pin > * { transform: rotate(45deg); }
.hazard-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.hazard-legend-item { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); background: var(--surface-2); padding: 3px 8px; border-radius: 20px; }
.hazard-list-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); gap: 10px; }
.hazard-list-item { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.hazard-emoji { font-size: 22px; flex-shrink: 0; }
.hazard-list-type { color: var(--text-primary); font-size: 13px; font-weight: 500; }
.hazard-list-time { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.hazard-upvotes { margin-left: auto; font-size: 11px; color: var(--accent); font-weight: 700; }
.duel-result-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.duel-result-target { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--accent); text-transform: uppercase; margin-bottom: 10px; }
.duel-result-matchup { display: flex; align-items: center; gap: 12px; }
.duel-result-side { flex: 1; }
.duel-result-side.duel-winner .duel-result-name { color: #fff; font-weight: 700; }
.duel-result-side.duel-winner .duel-result-time { color: var(--accent); font-weight: 700; }
.duel-result-name { color: var(--text-secondary); font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duel-result-time { font-size: 22px; font-weight: 200; color: var(--text-primary); letter-spacing: -0.5px; margin-top: 2px; }
.duel-result-vs { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.duel-result-ago { font-size: 11px; color: var(--text-muted); margin-top: 8px; text-align: right; }
.roads-search-row { position: relative; margin-bottom: 16px; }
.roads-search-input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text-primary); font-size: 14px; padding: 9px 36px 9px 14px; outline: none; box-sizing: border-box; transition: border-color .15s; }
.roads-search-input:focus { border-color: var(--accent); }
.roads-search-input::placeholder { color: var(--text-muted); }
.roads-search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; display: flex; align-items: center; }

/* ─── Car cards grid ─────────────────────────────────────────────── */
.rankings-list {
  display: grid !important;
  flex-direction: unset !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 4px;
}

.car-card {
  background: linear-gradient(145deg, #17171f 0%, #0d0d15 100%);
  border: 1.5px solid var(--cc-dim, rgba(255,255,255,0.08));
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px var(--cc-shadow, rgba(0,0,0,0.4));
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.car-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 48px var(--cc-shadow, rgba(0,0,0,0.5));
}

/* Photo area */
.car-card-photo {
  height: 200px; position: relative; overflow: hidden;
}
.car-card-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.car-card-photo-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(180deg, var(--cc-dim, rgba(94,92,230,0.2)) 0%, #17171f 100%);
  display: flex; align-items: center; justify-content: center;
}
.car-card-photo-placeholder svg {
  width: 72px; height: 72px; opacity: 0.25;
  color: var(--cc, var(--purple));
}

/* Gradient fade at bottom of photo into card body */
.car-card-fade {
  position: absolute; bottom: 0; left: 0; right: 0; height: 90px;
  background: linear-gradient(to bottom, transparent, #17171f);
  pointer-events: none;
}

/* Name + OVR overlaid at bottom of photo */
.car-card-photo-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 14px 10px;
}
.car-card-name {
  font-size: 16px; font-weight: 800; color: #fff; line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.car-card-origin {
  font-size: 9px; font-weight: 600; letter-spacing: 1.4px;
  color: rgba(255,255,255,0.55); margin-top: 3px; text-transform: uppercase;
}

/* OVR badge (bottom-right of photo) */
.car-card-ovr {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 4px; flex-shrink: 0;
}
.car-card-ovr-letter {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: #fff;
  box-shadow: 0 4px 14px var(--cc-shadow, rgba(94,92,230,0.5));
  line-height: 1;
}
.car-card-ovr-label {
  font-size: 8px; font-weight: 700; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.4); text-transform: uppercase; margin-top: 3px;
}

/* Rank badge overlaid top-left on photo */
.car-card-rank-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; font-family: var(--font-mono);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.car-card-rank-badge.gold   { background: #FFD700; color: #1a1200; }
.car-card-rank-badge.silver { background: #C0C0C0; color: #1a1a1a; }
.car-card-rank-badge.bronze { background: rgba(205,127,50,0.9); color: #fff; }
.car-card-rank-badge.plain  { background: rgba(0,0,0,0.5); color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.2); }

/* Card stats body */
.car-card-body { padding: 4px 14px 14px; }

/* Driver strip */
.car-card-driver {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0 2px;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.car-card-driver-flag { font-size: 15px; }
.you-badge { background: rgba(10,132,255,0.2); color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: 0.8px; padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(10,132,255,0.35); }
.car-card-me { outline: 2px solid rgba(10,132,255,0.4); outline-offset: -1px; }

/* Section divider (matches app: coloured bar + label + line) */
.car-card-divider {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 0 4px;
}
.car-card-divider-bar {
  width: 3px; height: 12px; border-radius: 2px;
  background: var(--cc, var(--purple)); flex-shrink: 0;
}
.car-card-divider-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1.8px;
  color: var(--cc, var(--purple)); text-transform: uppercase;
}
.car-card-divider-line {
  flex: 1; height: 1px; background: rgba(255,255,255,0.06);
}

/* Stat rows */
.car-stat-row {
  display: flex; align-items: center; gap: 8px; padding: 2.5px 0;
}
.car-stat-label {
  flex: 1; font-size: 10px; font-weight: 500; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.45); text-transform: uppercase;
}
.car-stat-value {
  font-size: 13px; font-weight: 600; color: #fff;
  font-variant-numeric: tabular-nums; font-family: var(--font-mono);
  white-space: nowrap;
}
.car-stat-value.muted { color: rgba(255,255,255,0.25); font-weight: 400; }

/* Admin delete on card */
.car-card-delete {
  display: flex; justify-content: flex-end; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.05);
}

/* ─────────────────────────── Section header ────────────────────── */
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 36px; gap: 16px; flex-wrap: wrap;
}
.section-title {
  font-size: 32px; font-weight: 800; letter-spacing: -0.5px;
}
.section-sub { font-size: 15px; color: var(--text-2); margin-top: 4px; }

/* ─────────────────────────── Cards ─────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 0;
}
.card-header h3 { font-size: 16px; font-weight: 700; }
.badge {
  background: var(--blue-dim); color: var(--blue);
  border: 1px solid rgba(10,132,255,0.2);
  border-radius: 20px; padding: 2px 10px; font-size: 12px; font-weight: 700;
}

/* ─────────────────────────── Calendar ──────────────────────────── */
.events-layout {
  display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start;
}
.calendar-card { padding: 20px; position: relative; }
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.cal-title { font-weight: 700; font-size: 15px; }
.cal-nav {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.cal-nav:hover { background: var(--surface-3); color: var(--text); }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7,1fr);
  margin-bottom: 8px;
}
.cal-weekdays span {
  text-align: center; font-size: 11px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 0;
}
.cal-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-cell {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 8px; position: relative;
  font-size: 13px; color: var(--text-2);
  transition: background 0.15s;
  gap: 2px;
}
.cal-cell.empty { pointer-events: none; }
.cal-cell.today { background: var(--blue-dim); }
.cal-cell.today span { color: var(--blue); font-weight: 700; }
.cal-cell.has-event { cursor: pointer; color: var(--text); }
.cal-cell.has-event:hover { background: var(--surface-2); }
.cal-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--blue);
}

/* Day panel */
.day-panel {
  display: none; margin-top: 16px;
  background: var(--surface-2); border-radius: 12px;
  border: 1px solid var(--border);
}
.day-panel.visible { display: block; }
.day-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13px;
}
.day-panel-list { padding: 12px; max-height: 280px; overflow-y: auto; }

/* Upcoming list */
.upcoming-card { padding: 0; }
.upcoming-list { padding: 0 20px 20px; overflow-y: auto; max-height: 500px; }
.event-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.event-row:last-child { border-bottom: none; }
.event-row-date {
  display: flex; flex-direction: column; align-items: center;
  min-width: 44px; padding: 8px 6px; border-radius: 10px;
  background: var(--blue-dim);
}
.event-row-date .month { font-size: 9px; font-weight: 700; color: var(--blue); letter-spacing: 0.5px; text-transform: uppercase; }
.event-row-date .day   { font-size: 22px; font-weight: 800; color: var(--text); font-family: var(--font-mono); line-height: 1; }
.event-row-info { flex: 1; min-width: 0; }
.event-row-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-row-loc  { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.event-row-count { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.event-row-count strong { color: var(--blue); }

/* Day panel event card */
.day-event-item {
  padding: 10px; border-radius: 8px;
  background: var(--surface-3); margin-bottom: 8px;
}
.day-event-item:last-child { margin-bottom: 0; }
.day-event-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.day-event-title { font-size: 13px; font-weight: 600; }
.day-event-meta  { font-size: 11px; color: var(--text-2); display: flex; gap: 10px; flex-wrap: wrap; }
.day-event-fee   { color: var(--orange); font-weight: 600; }
.day-event-count { color: var(--blue); }
.day-event-type  { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; white-space: nowrap; flex-shrink: 0; }
.day-event-type--event   { background: rgba(10,132,255,.15); color: #0A84FF; }
.day-event-type--showoff { background: rgba(249,115,22,.15); color: #f97316; }

/* ─────────────────────────── Map section ───────────────────────── */
.section-map { padding: 0; }
.map-header {
  padding: 80px 24px 32px;
}
#events-map {
  height: 520px; width: 100%;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.map-popup { min-width: 160px; font-family: var(--font); }
.map-popup strong { display: block; font-size: 13px; margin-bottom: 4px; }
.map-popup div { font-size: 11px; color: #555; margin-top: 2px; }

/* custom map pin */
.map-marker-pin {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--blue);
  border: 2px solid white;
  box-shadow: 0 0 8px var(--blue-glow);
}

/* ─────────────────────────── Marketplace ───────────────────────── */
.market-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.filter-btn {
  padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
  color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  transition: all 0.15s;
}
.filter-btn:hover { background: var(--surface-2); color: var(--text); }
.filter-btn.active {
  background: var(--blue-dim); color: var(--blue);
  border-color: rgba(10,132,255,0.3);
}
.sprint-target-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.sprint-list { display: flex; flex-direction: column; gap: 6px; }
.sprint-row { display: flex; align-items: center; gap: 14px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.sprint-rank { min-width: 32px; text-align: center; font-size: 18px; }
.sprint-info { flex: 1; min-width: 0; }
.sprint-name { color: var(--text-primary); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sprint-car { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.sprint-time { color: var(--blue); font-size: 22px; font-weight: 300; letter-spacing: -0.5px; flex-shrink: 0; }
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.listing-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-2);
}
.listing-img {
  width: 100%; height: 180px; object-fit: cover;
  display: block;
  background: var(--surface-2);
}
.listing-img-placeholder {
  width: 100%; height: 180px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--text-3);
}
.listing-body { padding: 16px; }
.listing-category-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.listing-category {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--blue);
}
.listing-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.listing-car   { font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.listing-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.listing-price  { font-size: 16px; font-weight: 800; color: var(--blue); }
.listing-seller { font-size: 11px; color: var(--text-2); }
.market-more { text-align: center; margin-top: 32px; }

/* ─────────────────────────── Skeleton loaders ──────────────────── */
.skeleton, .skeleton-card {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
.skeleton { height: 60px; margin-bottom: 10px; }
.skeleton-card { height: 300px; border-radius: var(--radius-lg); }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-list { padding: 20px; }

/* ─────────────────────────── Empty state ───────────────────────── */
.empty-msg { color: var(--text-2); font-size: 14px; padding: 24px 0; text-align: center; }

/* ─────────────────────────── Modals ────────────────────────────── */
.modal {
  display: none; position: fixed; inset: 0; z-index: 200;
  align-items: center; justify-content: center;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-box {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  width: min(640px, 94vw);
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modal-in 0.2s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body   { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}
body.modal-open { overflow: hidden; }
.modal-title { font-size: 18px; font-weight: 700; }

/* ── Overlay-style modals (older pattern: modal-overlay > modal) ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
/* Reset inner .modal so it's a content box, not a fixed overlay */
.modal-overlay > .modal,
.modal-overlay > .modal-card {
  display: flex !important;
  position: relative !important;
  inset: unset !important;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-height: 88vh;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modal-in 0.2s ease;
  overflow-y: auto;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

/* ─────────────────────────── Forms ─────────────────────────────── */
.form-row    { margin-bottom: 18px; }
.form-2col   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.form-3col   { display: grid; grid-template-columns: 1fr 1fr 80px; gap: 8px; }

/* Tire size selector */
.tire-presets {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
}
.tire-preset-btn {
  padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--text-2);
  font-size: 11px; font-weight: 700; cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.tire-preset-btn:hover { border-color: var(--blue); color: var(--blue); }
.tire-preset-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.tire-size-display {
  text-align: center; font-size: 20px; font-weight: 800;
  color: var(--blue); letter-spacing: 0.5px;
  padding: 8px 0 4px; font-variant-numeric: tabular-nums;
}
.form-label  { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.form-hint   { font-size: 11px; color: var(--text-3); font-weight: 400; }
.form-input  {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 10px;
  padding: 10px 14px; font-size: 14px;
  outline: none; transition: border-color 0.15s;
  appearance: none;
}
.form-input:focus { border-color: var(--blue); }
.form-input::placeholder { color: var(--text-3); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select  { cursor: pointer; }
.form-error   { color: var(--red); font-size: 12px; margin-top: 8px; }

/* Location picker map */
#picker-map {
  height: 220px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border-2); margin-top: 4px;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border-2); border-radius: 10px;
  min-height: 100px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.upload-zone:hover { border-color: var(--blue); background: var(--blue-dim); }
#ev-upload-prompt, #ls-upload-prompt {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 16px; color: var(--text-2); font-size: 13px;
  pointer-events: none;
}
.upload-icon { font-size: 28px; }
.upload-preview-hidden { display: none; width: 100%; }
.upload-preview-hidden img {
  width: 100%; max-height: 200px; object-fit: cover;
  display: block; border-radius: 8px;
}

/* ─────────────────────────── Toast ─────────────────────────────── */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--border-2);
  padding: 12px 24px; border-radius: 30px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  opacity: 0; pointer-events: none; z-index: 999; white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success { border-color: rgba(48,209,88,0.4); color: var(--green); }
.toast.error   { border-color: rgba(255,69,58,0.4);  color: var(--red); }

/* ─────────────────────────── Footer ────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 32px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.footer-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px;
}
.footer-logo svg { width: 20px; height: 20px; color: var(--blue); }
.footer-copy { font-size: 13px; color: var(--text-2); }

/* ─────────────────────────── Leaflet overrides ──────────────────── */
.leaflet-container { background: #1a1a28; font-family: var(--font); }
.leaflet-tile-pane { filter: brightness(0.9) contrast(1.05); }
.leaflet-popup-content-wrapper {
  background: var(--surface-2); color: var(--text);
  border-radius: 10px; border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
}
.leaflet-popup-tip { background: var(--surface-2); }
.leaflet-popup-content { margin: 12px 14px; }
.leaflet-control-zoom a {
  background: var(--surface-2) !important; color: var(--text) !important;
  border-color: var(--border-2) !important;
}
.leaflet-control-zoom a:hover { background: var(--surface-3) !important; }
.leaflet-bar { border: none !important; box-shadow: var(--shadow) !important; }

/* ─────────────────────────── Admin mode ────────────────────────── */
/* auth-only: hidden until user is signed in (set via JS on init) */
.auth-only { display: none; }

.admin-only { display: none !important; }
.admin-mode .admin-only { display: inline-flex !important; }

.user-badge {
  padding: 2px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: lowercase;
  color: var(--blue);
  background: rgba(10,132,255,0.12);
  border: 1px solid rgba(10,132,255,0.25);
  white-space: nowrap; max-width: 140px;
  overflow: hidden; text-overflow: ellipsis;
}

.admin-badge {
  display: none;
  padding: 2px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--orange);
  background: rgba(255,159,10,0.12);
  border: 1px solid rgba(255,159,10,0.25);
  white-space: nowrap;
}
.admin-mode .admin-badge { display: inline-flex; align-items: center; }

/* Lock icon button in navbar */
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; flex-shrink: 0;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border-2);
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.lang-toggle { display: flex; gap: 4px; align-items: center; }
.lang-btn {
  width: 32px; height: 32px; padding: 0; border-radius: 8px; border: 1px solid transparent;
  background: transparent; cursor: pointer; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0.45; transition: all 0.15s;
}
.lang-btn:hover { opacity: 0.8; background: var(--surface-2); }
.lang-btn.lang-active { opacity: 1; background: var(--surface-2); border-color: var(--border-2); }
.admin-mode .btn-icon#admin-lock-btn {
  color: var(--orange);
  border-color: rgba(255,159,10,0.35);
  background: rgba(255,159,10,0.1);
}
.admin-mode .btn-icon#admin-lock-btn:hover { background: rgba(255,159,10,0.18); }

/* Delete button — shown inside cards/rows only in admin mode */
.delete-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px;
  background: rgba(255,69,58,0.1); color: var(--red);
  border: 1px solid rgba(255,69,58,0.2);
  font-size: 13px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.delete-btn:hover {
  background: rgba(255,69,58,0.22);
  border-color: rgba(255,69,58,0.45);
  transform: scale(1.08);
}

/* Smaller modal variant for login */
.modal-box-sm { max-width: 400px !important; }

/* Larger modal variant for topic detail */
.modal-box-lg { max-width: 760px !important; }

/* ─────────────────────────── Knowledge Base ─────────────────────── */
.kb-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.kb-search-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 600px) { .kb-search-row { grid-template-columns: 1fr; } }

.kb-search { padding: 8px 14px !important; font-size: 14px !important; }

.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* Topic card */
.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.topic-card:hover {
  border-color: var(--blue-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}

.topic-card-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}
.topic-card-photo-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--text-3);
}

.topic-card-body {
  padding: 14px 16px 16px;
}
.topic-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.topic-card-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #fff;
  background: var(--blue);
  padding: 2px 8px;
  border-radius: 20px;
}
.topic-card-vehicle {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topic-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.topic-card-excerpt {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.topic-card-footer {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topic-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
}
.topic-stat svg { width: 13px; height: 13px; }
.topic-stat.upvoted { color: var(--blue); }

/* Topic detail modal body */
.td-body { padding: 0 !important; }
.td-cover {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}
.td-content { padding: 20px 24px 24px; }
.td-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.td-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: #fff;
  background: var(--blue);
  padding: 3px 10px;
  border-radius: 20px;
}
.td-vehicle {
  font-size: 13px;
  color: var(--text-2);
}
.td-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}
.td-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.td-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.td-action-btn:hover, .td-action-btn.active {
  color: var(--blue);
  border-color: var(--blue-dim);
  background: var(--blue-dim);
}
.td-body-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 20px;
  white-space: pre-wrap;
}
.td-media-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 20px;
  scrollbar-width: thin;
}
.td-media-item {
  flex: 0 0 180px;
  height: 130px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
}
.td-media-item img { width: 100%; height: 100%; object-fit: cover; }
.td-media-item.video-thumb { cursor: pointer; }
.td-media-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
}
.td-media-play svg { width: 44px; height: 44px; color: #fff; opacity: 0.9; }

.td-divider { border: none; border-top: 1px solid var(--border); margin: 0 0 20px; }
.td-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* Comments */
.td-comments { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.td-comment {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.td-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.td-comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.td-comment-own .td-comment-author { color: var(--blue); }
.td-comment-you {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  background: var(--blue);
  padding: 1px 5px;
  border-radius: 4px;
}
.td-comment-date {
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
}
.td-comment-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

/* Add comment form */
.td-add-comment { display: flex; flex-direction: column; gap: 8px; }
.td-comment-row { display: flex; gap: 8px; align-items: flex-start; }
.td-comment-row textarea {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  resize: none;
  min-height: 72px;
  outline: none;
  font-family: var(--font);
  transition: border-color 0.15s;
}
.td-comment-row textarea:focus { border-color: var(--blue); }
.td-comment-send {
  background: var(--blue);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  transition: opacity 0.15s;
  margin-top: 2px;
}
.td-comment-send:hover { opacity: 0.85; }
.td-comment-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Create topic media helpers */
.ct-photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ct-photo-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
}
.ct-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ct-photo-thumb button {
  position: absolute;
  top: 2px; right: 2px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
.ct-video-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ct-video-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 6px 10px;
}
.ct-video-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-video-item button { color: var(--red); font-size: 14px; }
.kb-video-add { display: flex; gap: 8px; margin-bottom: 6px; }
.kb-video-add input { flex: 1; }

/* ─────────────────────────── Responsive ────────────────────────── */
@media (max-width: 900px) {
  .events-layout { grid-template-columns: 1fr; }
  .hero-dial     { display: none; }
  .stats-grid    { grid-template-columns: repeat(2,1fr); }
  .stat-card:nth-child(2) { border-right: none; }
}
/* ─── Hamburger button ─────────────────────────────── */
.hamburger { display: none; }

/* ─── Mobile nav dropdown ─────────────────────────── */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 8px 0 12px;
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
  padding: 12px 20px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.15s;
}
.mobile-nav-link:hover { color: var(--text); }

@media (max-width: 600px) {
  /* ── Nav ── */
  .nav-links       { display: none; }
  .hamburger       { display: flex; }
  .navbar          { height: auto; }
  .nav-inner       { height: var(--nav-h); padding: 0 16px; gap: 12px; }
  /* Hide text action buttons on mobile — use hamburger instead */
  .nav-actions .btn:not([id="user-signin-btn"]):not([id="user-signout-btn"]) { display: none !important; }

  /* ── Layout ── */
  .section         { padding-block: 48px; padding-inline: 16px; }
  .container       { padding-inline: 16px; }
  .section.container { padding-block: 48px; padding-inline: 16px; }

  /* ── Section headers ── */
  .section-header  { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-title   { font-size: 26px; }

  /* ── Hero ── */
  .hero-title      { font-size: clamp(36px, 10vw, 48px); }
  .hero-sub        { font-size: 15px; }
  .hero            { padding-inline: 16px; }

  /* ── Stats ── */
  .stats-grid      { grid-template-columns: repeat(2,1fr); }
  .stat-card       { padding: 24px 16px; }
  .stat-value      { font-size: 32px; }

  /* ── Forms ── */
  .form-2col       { grid-template-columns: 1fr; }
  .form-3col       { grid-template-columns: 1fr 1fr; }

  /* ── Modals ── */
  .modal-overlay   { padding: 12px; align-items: flex-end; }
  .modal-overlay > .modal,
  .modal-overlay > .modal-card { max-height: 92vh; border-radius: 20px 20px 12px 12px; }
  .modal-box       { width: 100%; border-radius: 20px 20px 12px 12px; }

  /* ── Misc ── */
  .footer-inner    { flex-direction: column; text-align: center; }
  .market-grid     { grid-template-columns: 1fr; }
  .map-header.container { padding-inline: 16px; }
  /* Hide ranking sub-badges on very small screens to prevent overflow */
  .ranking-badges { display: none; }
}

/* ─────────────────────────── Rides ─────────────────────────────── */
.rides-filters { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.rides-list    { display: flex; flex-direction: column; gap: 12px; }
.ride-card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ride-route { font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ride-arrow { color: var(--text-muted); font-size: 12px; }
.ride-meta  { font-size: 13px; color: var(--text-muted); }
.ride-notes { font-size: 13px; color: var(--text-2); font-style: italic; }
.ride-actions { display: flex; justify-content: flex-end; margin-top: 4px; }

/* ─────────────────────────── News ──────────────────────────────── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.news-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s;
}
.news-card:hover { border-color: var(--accent); }
.news-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.news-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.news-card-date  { font-size: 12px; color: var(--text-muted); }
.news-card-title { font-size: 16px; font-weight: 700; color: var(--text-1); line-height: 1.3; }
.news-card-body-text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ──────────────────────── Showoff Battle ───────────────────────── */

/* Filter bar */
.showoff-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.showoff-filter {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.showoff-filter:hover { border-color: var(--blue); color: var(--text); }
.showoff-filter.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Card grid */
.showoff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* Event card */
.showoff-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
}
.showoff-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.showoff-card--live { border-color: #22c55e; }
.showoff-card--finals { border-color: var(--orange); }

.showoff-card-header {
  height: 140px;
  background: linear-gradient(135deg, #1c1c28, #252535);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 12px;
}
.showoff-card-header img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.showoff-card-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 60%);
}

.showoff-status-badge {
  position: relative;
  z-index: 1;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}
.showoff-status-badge .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

.showoff-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.showoff-card-title { font-size: 16px; font-weight: 700; color: var(--text); }
.showoff-card-meta  { font-size: 12px; color: var(--text-2); display: flex; gap: 10px; }

/* Discipline chips */
.showoff-disc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.showoff-disc-chip {
  background: var(--surface-3);
  border-radius: 10px;
  padding: 3px 9px;
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
}

/* Slot / spots */
.showoff-spots {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}
.showoff-spots--full { color: var(--red); }

.showoff-progress-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}
.showoff-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--blue);
  transition: width .4s ease;
}
.showoff-progress-fill--full  { background: var(--red); }
.showoff-progress-fill--near  { background: var(--orange); }

.showoff-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 4px;
}

/* Performance class badge */
.perf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.perf-s  { background: #9333ea; color: #fff; }
.perf-a  { background: #ef4444; color: #fff; }
.perf-b  { background: #f97316; color: #fff; }
.perf-c  { background: #eab308; color: #000; }
.perf-d  { background: #22c55e; color: #000; }
.perf-e  { background: #3b82f6; color: #fff; }
.perf-f  { background: #6b7280; color: #fff; }

/* ── Event detail modal (showoff) ──────────────────────────────── */
.showoff-event-hero {
  height: 180px;
  background: linear-gradient(135deg, #1c1c28, #252535);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}
.showoff-event-hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.showoff-event-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.8), transparent 60%);
}
.showoff-event-hero-title {
  position: relative; z-index: 1;
  font-size: 20px; font-weight: 800; color: #fff;
}

.showoff-event-sections { display: flex; flex-direction: column; gap: 20px; }

.showoff-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 10px;
}

/* Participant grid */
.showoff-pax-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.showoff-pax-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 10px;
  text-align: center;
  transition: border-color .15s;
}
.showoff-pax-card.eliminated { opacity: .45; }
.showoff-pax-card.finalist   { border-color: var(--orange); }
.showoff-pax-card.winner     { border-color: #22c55e; }

.showoff-pax-photo {
  width: 100%;
  height: 90px;
  object-fit: cover;
  background: var(--surface-3);
  display: block;
}
.showoff-pax-photo-placeholder {
  width: 100%;
  height: 90px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.showoff-pax-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-top: 8px;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.showoff-pax-car {
  font-size: 11px;
  color: var(--text-2);
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.showoff-pax-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  margin-top: 4px;
}

/* Round / voting */
.showoff-round-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.showoff-round-title { font-size: 15px; font-weight: 700; }
.showoff-round-state {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--surface-3);
}
.showoff-round-state--open   { background: rgba(34,197,94,.2); color: #22c55e; }
.showoff-round-state--closed { background: var(--surface-3); color: var(--text-2); }

.showoff-vote-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.showoff-vote-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.showoff-vote-btn:hover  { border-color: var(--blue); color: var(--blue); }
.showoff-vote-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.showoff-avg-score {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue);
  text-align: center;
  margin: 6px 0;
}

/* Visitor list */
.showoff-visitor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.showoff-visitor-row:last-child { border-bottom: none; }
.showoff-visitor-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}
.showoff-visitor-name { font-size: 13px; font-weight: 600; }

/* Podium / results */
.showoff-podium {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: flex-end;
  padding: 16px 0 8px;
}
.showoff-podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.showoff-podium-medal { font-size: 28px; line-height: 1; }
.showoff-podium-name  { font-size: 12px; font-weight: 700; text-align: center; }
.showoff-podium-pts   { font-size: 11px; color: var(--text-2); }
.showoff-podium-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: var(--surface-3);
}
.showoff-podium-place--1 .showoff-podium-bar { height: 70px; background: #f59e0b; }
.showoff-podium-place--2 .showoff-podium-bar { height: 50px; background: #94a3b8; }
.showoff-podium-place--3 .showoff-podium-bar { height: 36px; background: #b45309; }

/* Empty state */
.showoff-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-2);
}
.showoff-empty-icon { font-size: 48px; margin-bottom: 12px; }
.showoff-empty-text { font-size: 15px; }

/* Responsive */
@media (max-width: 600px) {
  .showoff-grid { grid-template-columns: 1fr; }
  .showoff-pax-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════
   KNOWLEDGE BASE — Vehicle-first redesign
═══════════════════════════════════════════════════════════════ */

/* Vehicle type tabs */
.kb-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.kb-type-tab {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.kb-type-tab.active, .kb-type-tab:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Vehicle row search */
.kb-vehicle-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.kb-vehicle-field { flex: 1; min-width: 140px; }
.kb-year-input    { width: 100px; flex: 0 0 100px; }
.kb-clear-btn     { flex: 0 0 auto; padding: 0 12px; height: 40px; }

/* Vehicle-type selector in modal */
.kb-vtype-btns {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.kb-vtype-btn {
  flex: 1;
  padding: 8px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.kb-vtype-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Steps badge on topic card */
.topic-steps-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--accent);
  font-weight: 600;
}

/* ── Topic detail: steps ───────────────────────────────────── */
.td-steps { margin: 20px 0; }
.td-step {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.td-step:last-child { border-bottom: none; margin-bottom: 0; }
.td-step-num {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  margin-top: 2px;
}
.td-step-content { flex: 1; min-width: 0; }
.td-step-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-1);
  margin-bottom: 6px;
}
.td-step-body {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 10px;
  white-space: pre-wrap;
}
.td-step-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.td-step-photos img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  border: 1px solid var(--border);
}
.td-step-video {
  display: block;
  position: relative;
  width: 200px;
  height: 112px;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--border);
}
.td-step-video img { width: 100%; height: 100%; object-fit: cover; }

/* ── Step editor in create modal ──────────────────────────── */
.ct-step {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.ct-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.ct-step-num {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ct-step-media {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.ct-step-media-thumb {
  position: relative;
  width: 64px;
  height: 48px;
}
.ct-step-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.ct-step-media-thumb button {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red, #ef4444);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ct-step-photo-btn, .ct-step-video-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  background: none;
  transition: border-color .15s;
}
.ct-step-photo-btn:hover, .ct-step-video-btn:hover { border-color: var(--accent); }

@media (max-width: 600px) {
  .kb-type-tabs { flex-wrap: wrap; }
  .kb-vehicle-row { flex-direction: column; }
  .kb-year-input { width: 100%; flex: 1; }
  .td-step-photos img { width: 90px; height: 68px; }
}
