:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #12141a;
  --mute: #6b7280;
  --line: #e6e8ee;
  --saf: #ff7a1a;
  --saf-deep: #f25c00;
  --ok: #159947;
  --bad: #e11d48;
  --nav: #ffffff;
  --shadow: 0 8px 24px rgba(18, 20, 26, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(900px 420px at 50% -80px, rgba(255, 122, 26, 0.16), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  min-height: 100vh;
}
body.is-login { padding-bottom: 0; }
.gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(28px, env(safe-area-inset-top)) 20px max(36px, env(safe-area-inset-bottom));
}
.gate-card { width: min(400px, 100%); }
.gate-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 22px;
}
.gate-brand .logo { width: 88px; height: 88px; margin-bottom: 14px; }
.gate-brand h1 { margin: 0; font-size: 32px; letter-spacing: -0.04em; }
.gate-brand .move { margin: 8px 0 0; color: var(--mute); font-size: 14px; font-weight: 650; }
.gate-brand .by { margin: 2px 0 0; color: #374151; font-size: 14px; font-weight: 750; }
.gate-form { padding: 18px 16px 16px; margin: 0; }
.gate-form label:first-of-type { margin-top: 0; }
.field { position: relative; }
.field input { padding-left: 44px; }
.field input.has-end { padding-right: 46px; }
.field-ic {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa3b2;
  display: grid;
  pointer-events: none;
}
.field-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #6b7280;
  display: grid;
  place-items: center;
  padding: 0;
}
.gate-form .btn { margin-top: 6px; }
.gate-foot {
  margin: 16px 0 0;
  text-align: center;
  color: var(--mute);
  font-size: 13px;
  font-weight: 650;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--saf); outline-offset: 2px; }
.wrap { max-width: 480px; margin: 0 auto; padding: 18px 16px 8px; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.icon-btn {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--saf);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}
.logo {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  flex: none;
}
.top-copy { min-width: 0; flex: 1; }
.top-copy b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.top-copy small { display: flex; flex-direction: column; gap: 1px; color: var(--mute); font-size: 12px; font-weight: 650; margin-top: 4px; line-height: 1.3; }
.top-copy .by { color: #374151; font-weight: 750; }
.card {
  background: var(--card);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
h1, h2, h3 { margin: 0 0 8px; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 15px; font-weight: 700; }
.row { display: flex; gap: 10px; align-items: center; }
.sb { justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  background: #f7f8fa;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
}
.stat b { display: block; font-size: 20px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--mute); font-weight: 650; }
.hero-card {
  background: linear-gradient(160deg, #ff9340 0%, var(--saf) 42%, var(--saf-deep) 100%);
  color: #fff;
  border-radius: 24px;
  padding: 18px 18px 14px;
  margin-bottom: 12px;
  box-shadow: 0 16px 32px rgba(255, 122, 26, 0.28);
}
.hero-card h2 { color: #fff; font-size: 28px; margin: 2px 0 4px; }
.hero-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; opacity: 0.92; }
.hero-sub { margin: 0; font-size: 14px; opacity: 0.92; }
.ring {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, 0.28) 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  flex: none;
}
.ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #f25c00;
}
.ring b, .ring span {
  position: relative;
  z-index: 1;
  color: #fff;
  text-align: center;
  width: 100%;
}
.ring b { font-size: 18px; letter-spacing: -0.03em; line-height: 1; }
.ring span { display: block; margin-top: 2px; font-size: 10px; line-height: 1.1; font-weight: 650; opacity: 0.92; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.hero-stats div {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}
.hero-stats b { display: block; font-size: 18px; letter-spacing: -0.03em; }
.hero-stats span { font-size: 11px; font-weight: 650; opacity: 0.9; }
.nudge {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 0;
  border-radius: 16px;
  padding: 14px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  text-align: left;
  font-weight: 700;
}
.nudge span { display: block; }
.nudge small { display: block; color: var(--mute); font-weight: 600; font-size: 13px; margin-top: 2px; }
label { display: block; font-size: 13px; color: var(--mute); font-weight: 650; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f7f8fa;
  font-size: 16px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--saf); background: #fff; }
textarea { resize: vertical; }
button.btn, a.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 750;
  background: var(--saf);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 16px rgba(255, 122, 26, 0.22);
}
button.btn.sec, a.btn.sec { background: #f3f4f6; color: var(--ink); border: 0; box-shadow: none; }
button.btn.ok { background: var(--ok); box-shadow: none; }
button.btn.bad { background: var(--bad); color: #fff; box-shadow: none; }
button.btn.sm { width: auto; padding: 8px 12px; font-size: 13px; border-radius: 999px; box-shadow: none; }
button:disabled { opacity: 0.55; cursor: default; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.card > .row > h2 { margin: 0; }
.sports { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.sport {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f3f4f6;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.sport .ic { color: #9aa3b2; }
.sport.on { background: var(--saf); color: #fff; }
.sport.on .ic { color: #fff; }
.train-act { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.train-act .muted { margin: 0 0 12px; }
.card .chip { background: #f3f4f6; box-shadow: none; }
.card .chip.on { background: var(--saf); color: #fff; }
.chips, .tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin: 4px 0 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 0;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.chip.on { background: var(--saf); color: #fff; }
nav {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(448px, calc(100% - 20px));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-radius: 22px;
  display: flex;
  z-index: 20;
  box-shadow: 0 10px 30px rgba(18, 20, 26, 0.12);
  padding: 6px;
}
nav button {
  flex: 1;
  background: none;
  color: #9aa3b2;
  border: 0;
  border-radius: 16px;
  padding: 8px 2px 6px;
  font-size: 10px;
  font-weight: 750;
}
nav button .ic { display: block; margin: 0 auto 2px; }
nav button.on { color: var(--saf); background: #fff4ec; }
.ic { display: inline-block; vertical-align: middle; flex: none; }
.muted { color: var(--mute); font-size: 14px; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}
.pill.approved { background: #e8f8ee; color: #127a38; }
.pill.flagged { background: #fff4e5; color: #b45309; }
.pill.rejected { background: #ffe8ec; color: #be123c; }
.lb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 16px;
  margin-bottom: 8px;
  background: #fff;
  width: 100%;
  border: 0;
  text-align: left;
  color: inherit;
  box-shadow: var(--shadow);
}
.lb.top .rk { background: #fff4ec; color: var(--saf); }
.lb.me { box-shadow: 0 0 0 2px var(--saf), var(--shadow); }
.lb .rk {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f3f4f6;
  font-weight: 800;
  font-size: 13px;
}
.lb .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.lb .v { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--saf); }
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.badge {
  text-align: center;
  font-size: 11px;
  font-weight: 650;
  color: #9aa3b2;
  background: #f7f8fa;
  border-radius: 14px;
  padding: 10px 4px;
}
.badge.on { color: var(--ink); background: #fff4ec; }
.badge .ic { display: block; margin: 0 auto 4px; color: #c5cad3; }
.badge.on .ic { color: var(--saf); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
tr.today td { background: #fff4ec; }
tr.marathon td { background: #fff3bf; }
tr.clk { cursor: pointer; }
.note, .notice {
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  font-size: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.notice b { font-size: 20px; letter-spacing: -0.02em; }
.notice { display: flex; gap: 10px; align-items: flex-start; }
.notice .ic { color: var(--saf); margin-top: 2px; }
.notice p { margin: 2px 0 0; color: var(--mute); font-size: 13px; }
.plan-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.plan-row + .plan-row { border-top: 1px solid var(--line); }
.plan-mid { flex: 1; min-width: 0; }
.plan-mid .row span:first-child { font-weight: 700; font-size: 14px; min-width: 0; }
.plan-mid .row span:last-child { white-space: nowrap; }
.bar { height: 6px; border-radius: 999px; background: #eceef2; margin-top: 6px; overflow: hidden; }
.bar i { display: block; width: 100%; height: 100%; border-radius: 999px; background: var(--saf); transform-origin: left center; }
.post { display: flex; gap: 10px; }
.av {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #fff4ec;
  color: var(--saf);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.actbox { background: #f7f8fa; border-radius: 14px; padding: 10px 12px; }
.cam-stage {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #12141a;
  min-height: 240px;
}
.cam-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
.cam-preview {
  display: block;
  width: 100%;
  max-height: 62vh;
  min-height: 240px;
  object-fit: contain;
  background: #12141a;
}
.cam-preview.front { transform: scaleX(-1); }
.cam-count {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 1;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.cam-count b {
  display: block;
  font-size: 64px;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.cam-count span { font-weight: 650; font-size: 14px; }
.cam-flip {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  padding: 0;
}
.cam-flip:disabled { opacity: 0.6; }
.hero { text-align: center; padding: 12px 0 8px; }
.hero .km { font-size: 72px; font-weight: 800; color: var(--ink); line-height: 0.95; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.hero .u { color: var(--mute); font-weight: 650; }
canvas.route { width: 100%; height: auto; border-radius: 16px; background: #f3f4f6; display: block; }
.menu { background: #fff; border-radius: 20px; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: 0;
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--ink);
}
.menu button + button { border-top: 1px solid var(--line); }
.menu button .ic { color: var(--saf); }
.menu button .chev { margin-left: auto; color: #c5cad3; }
.who { display: flex; gap: 14px; align-items: center; }
.who .av { width: 56px; height: 56px; border-radius: 18px; font-size: 22px; }
.steps { margin: 8px 0 0; padding-left: 18px; color: var(--ink); }
.steps li { margin: 8px 0; }
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #12141a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  z-index: 60;
  max-width: 90%;
  text-align: center;
}
#toast[hidden], #sheet[hidden] { display: none; }
#sheet {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 40;
  overflow: auto;
}
.sheet-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 0 16px;
  padding: 2px 0 12px;
  background: var(--bg);
}
.sheet-bar h2 {
  margin: 0;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.back {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
}
.faq + .faq { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.loading {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(480px 260px at 50% 42%, rgba(255, 122, 26, 0.2), transparent 68%),
    var(--bg);
  padding: 24px;
}
.loading .logo {
  width: 96px;
  height: 96px;
}
.loading-name {
  margin-top: 18px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.loading-label {
  margin-top: 4px;
  min-height: 1.3em;
  color: var(--mute);
  font-size: 14px;
  font-weight: 650;
}
.loadbar {
  width: min(220px, 68vw);
  height: 6px;
  margin-top: 18px;
  border-radius: 999px;
  background: #e4e6eb;
  overflow: hidden;
}
.loadbar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9340, var(--saf));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s ease;
}
.top-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 50;
  overflow: hidden;
  background: #ffe1cc;
}
.top-progress i {
  display: block;
  height: 100%;
  width: 35%;
  background: var(--saf);
  animation: top-slide 0.9s ease-in-out infinite;
}
@keyframes top-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(340%); }
}
.sheet-loading {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.sheet-loading .logo { width: 72px; height: 72px; }
.sheet-loading .loadbar { width: 160px; margin: 0; }
@media (max-width: 380px) {
  .sport { font-size: 13px; padding: 8px 12px; }
  .badges { grid-template-columns: repeat(3, 1fr); }
  nav button { font-size: 9px; }
}
@media (min-width: 900px) {
  body { background:
    radial-gradient(700px 360px at 50% -40px, rgba(255, 122, 26, 0.18), transparent 55%),
    #e8eaef; }
}
