:root {
  --accent: #FF6B1A;          /* Track (kart): orange; Sim stays racing red */
  --accent-ink: #1A0A00;
  --bg: #0C0C0C;
  --bg2: #151515;
  --bg3: #1E1E1E;
  --border: rgba(255, 255, 255, 0.10);
  --text: #F0F0F0;
  --muted: #9A9A9A;
  --danger: #FF6B6B;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 'DM Sans', system-ui, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2 { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 .5rem; }
h1 { font-size: 34px; } h2 { font-size: 22px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 22px; text-transform: uppercase; }
.brand b { color: var(--accent); }
.demo { background: var(--accent); color: var(--accent-ink); text-align: center; font-size: 14px; font-weight: 600; padding: 6px 16px; }

main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; }
.view > p { max-width: 560px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.btn, .ghost {
  font: 600 15px 'DM Sans', sans-serif; border-radius: 8px; padding: 10px 16px; cursor: pointer;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn { background: var(--accent); color: var(--accent-ink); border: 0; }
.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn:focus-visible, .ghost:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.cards { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; }
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.veh { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.veh h3 { margin: 0; font-size: 18px; }
.veh .meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
  background: rgba(255, 107, 26, .15); color: var(--accent); margin-right: 6px; }
.veh .acts { display: flex; gap: 8px; flex-shrink: 0; }
.veh .acts button { min-height: 36px; padding: 6px 12px; font-size: 14px; }
@media (max-width: 520px) {
  .veh { flex-direction: column; }
  .veh .acts { width: 100%; }
  .veh .acts button { flex: 1; }
}

.form { margin-top: 16px; display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input, select, textarea {
  font: 400 16px 'DM Sans', sans-serif; color: var(--text); background: var(--bg3);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; width: 100%;
}
#ownFields { display: grid; gap: 12px; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text);
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px; cursor: pointer; }
.seg input { width: auto; accent-color: var(--accent); }
.seg label:has(input:checked) { border-color: var(--accent); }
.err { color: var(--danger); font-size: 14px; margin: 0; min-height: 1em; }

.foot { text-align: center; font-size: 13px; padding: 16px; border-top: 1px solid var(--border); }

.sync { background: var(--bg3); color: var(--text); text-align: center; font-size: 14px; padding: 6px 16px; border-bottom: 1px solid var(--border); }
.tabs { display: flex; max-width: 720px; margin: 0 auto; width: 100%; padding: 0 16px; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted);
  font: 600 15px 'DM Sans', sans-serif; padding: 12px 8px; cursor: pointer; min-height: 44px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin: 0; display: grid; gap: 12px; }
legend { padding: 0 6px; font-weight: 600; font-size: 14px; }
.hint { font-size: 12px; margin: 0; }
.wx { background: var(--bg3); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.sess .when { font-size: 14px; color: var(--muted); }
.sess .lap { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 26px; color: var(--accent); line-height: 1.1; }
.sess .line { font-size: 14px; color: var(--muted); margin-top: 4px; }
.sess .feel { font-size: 15px; margin-top: 6px; }
.tag.wait { background: var(--bg3); color: var(--muted); }
.form { scroll-margin-top: 72px; }

.chk { margin: 16px 0; }
.chk h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.chk h2 small { font: 500 14px 'DM Sans', sans-serif; color: var(--muted); text-transform: none; letter-spacing: 0; }
.chk ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.chk li { display: flex; align-items: center; gap: 12px; padding: 4px 8px 4px 14px; border-top: 1px solid var(--border); background: var(--bg2); }
.chk li:first-child { border-top: 0; }
.chk li label { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; }
.chk li input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.chk li.done label span { color: var(--muted); text-decoration: line-through; }
.chk li .x { background: none; border: 0; color: var(--muted); font-size: 20px; width: 40px; height: 40px; cursor: pointer; border-radius: 8px; }
.chk li .x:hover { color: var(--text); background: var(--bg3); }
.chk form { display: flex; gap: 8px; margin-top: 8px; }
.chk form input { flex: 1; }
.chk form button { min-height: 44px; }

.coach { margin-top: 12px; border: 1px solid var(--accent); border-radius: 10px; padding: 12px; background: rgba(255, 107, 26, .06); display: grid; gap: 8px; font-size: 15px; }
.coach p { margin: 0; }
.coach-head { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 20px; text-transform: uppercase; color: var(--accent); }
.coach-change { display: grid; gap: 2px; background: var(--bg3); border-radius: 8px; padding: 8px 10px; font-weight: 600; }
.coach-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.coach-meta { font-size: 13px; }
.coach-ask { display: grid; gap: 8px; }
.coach .ghost { justify-self: start; }
.veh .acts .coach-btn { border-color: var(--accent); color: var(--accent); }

.smart { display: grid; gap: 8px; }
.smart-row { display: flex; flex-wrap: wrap; gap: 8px; }
.smart-row .ghost { font-size: 14px; min-height: 40px; padding: 8px 12px; }
.smart-row small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.smart-msg { background: var(--bg3); border-radius: 8px; padding: 10px 12px; font-size: 14px; display: grid; gap: 8px; }
.smart-msg .row { justify-content: flex-start; }
.smart-msg button { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.base { font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.base button { min-height: 36px; padding: 6px 12px; font-size: 14px; }

.check { display: flex !important; grid-template-columns: none !important; align-items: flex-start; gap: 10px; color: var(--text) !important; font-size: 15px !important; }
.check input { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--accent); margin-top: 1px; }
#vTeam h2 { margin-top: 20px; }
#vTeam select { width: auto; }
.member { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.member .acts { display: flex; gap: 8px; }
.member select { min-height: 36px; padding: 6px 8px; }
.member button { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.member.left { opacity: .6; }
#teamLeave { margin-top: 24px; }

.landing h1 { font-size: 40px; line-height: 1.05; }
.kicker { color: var(--accent); font-weight: 600; font-size: 14px; margin: 0 0 8px; }
.lead { font-size: 18px; }
.promises { padding: 0; list-style: none; display: grid; gap: 10px; margin: 16px 0; }
.promises li { background: var(--bg2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 0; padding: 10px 14px; }
.shots { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 12px; scroll-snap-type: x mandatory; }
.shots img { width: 200px; height: auto; flex-shrink: 0; border-radius: 16px; border: 1px solid var(--border); scroll-snap-align: start; }
.small { font-size: 13px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#waitOk { font-weight: 600; }
.today { margin: 12px 0; display: grid; gap: 8px; }
.today h2 { margin: 0; }
.today select { width: auto; max-width: 60%; }
.today-body { display: grid; gap: 6px; font-size: 15px; }
.today-body b { color: var(--text); }
.today-body .diff { color: var(--accent); }
.season-row { justify-content: flex-end; }
.season-row .ghost { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.privacy { margin-top: 24px; display: grid; gap: 8px; }

.gps { background: var(--bg3); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.gps-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gps-head .btn { min-height: 44px; }
.gps-head .btn.stop { background: var(--danger); }
#gpsTrace { width: 100%; height: auto; aspect-ratio: 300 / 220; background: var(--bg); border-radius: 8px; touch-action: manipulation; cursor: crosshair; }
#gpsTrace path.trace { fill: none; stroke: #6f6f6f; stroke-width: 2.5; stroke-linejoin: round; }
#gpsTrace line.finish { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
#gpsTrace circle.finish { fill: var(--accent); }
.gps-result { display: grid; gap: 8px; font-size: 14px; }
.gps-result .laps { display: flex; flex-wrap: wrap; gap: 6px; }
.gps-result .laps span { background: var(--bg2); border-radius: 6px; padding: 4px 8px; font-variant-numeric: tabular-nums; }
.gps-result .laps span.best { color: var(--accent); font-weight: 700; }
