:root {
  --bg-top: #f6f9fd;
  --bg-bottom: #e2ebf5;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-alt: #f1f5fa;
  --stroke: rgba(13, 17, 23, 0.08);
  --text: #0d1117;
  --text2: #5c6678;
  --text3: #8a94a6;
  --accent: #2f6bff;
  --accent-deep: #0b5bd3;
  --success: #12b76a;
  --warning: #f5a524;
  --danger: #f04438;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(31, 45, 61, 0.07);
  --shadow-soft: 0 4px 16px rgba(31, 45, 61, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-top);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; border: 0; }
button:active { transform: scale(0.985); }
[hidden] { display: none !important; }

.app-shell {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% -10%, #ffffff 0%, rgba(255, 255, 255, 0.55) 28%, transparent 60%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}
.app-shell::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -130px;
  top: 110px;
  background: url("assets/logo-mark-muted.png") center / contain no-repeat;
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
}
.statusbar, .app-header, .content, .tabbar { position: relative; z-index: 1; }

.statusbar {
  height: 44px;
  flex: none;
  padding: 9px 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
}
.status-time { font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }
.status-icons { display: flex; align-items: center; gap: 5px; }
.status-icon { width: 15px; height: 15px; }
.status-icon.battery { width: 22px; height: 15px; }

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.app-header {
  flex: none;
  min-height: 58px;
  padding: 2px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-brand { min-width: 0; }
.header-model {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.header-sub {
  font-size: 10px;
  font-weight: 550;
  color: var(--text3);
  margin-top: 3px;
  letter-spacing: 0.01em;
}
.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--stroke);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(31, 45, 61, 0.04);
  transition: 0.16s ease;
}
.icon-btn:active { background: rgba(47, 107, 255, 0.08); }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn.blue { color: var(--accent); background: rgba(47, 107, 255, 0.09); border-color: rgba(47, 107, 255, 0.12); }

.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 22px;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.content::-webkit-scrollbar { width: 0; height: 0; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text3); }
.tiny { font-size: 9px; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.right { text-align: right; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card.clickable { transition: 0.16s ease; }
.card.clickable:active { transform: scale(0.992); box-shadow: var(--shadow-soft); }

.label {
  font-size: 11px;
  font-weight: 650;
  color: var(--text3);
  letter-spacing: 0.02em;
}
.card-title { font-size: 13px; font-weight: 750; letter-spacing: -0.01em; }
.card-sub { font-size: 10px; color: var(--text3); margin-top: 3px; line-height: 1.45; }
.metric-value {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.03;
  font-variant-numeric: tabular-nums;
}
.metric-unit { font-size: 10px; font-weight: 650; color: var(--text2); margin-left: 2px; letter-spacing: 0; }
.metric-sub { font-size: 9.5px; color: var(--text3); line-height: 1.5; margin-top: 4px; }
.metric-card { min-height: 108px; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.09);
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.pill-soft { background: rgba(138, 148, 166, 0.12); color: var(--text3); }
.pill-demo { background: rgba(245, 165, 36, 0.13); color: #a96f00; }
.pill-live { background: rgba(18, 183, 106, 0.11); color: #09864f; }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill .icon { width: 11px; height: 11px; }
.footer-note .icon { width: 12px; height: 12px; }
.note-box .icon { width: 13px; height: 13px; vertical-align: -2px; }
.option-sub .icon { width: 12px; height: 12px; vertical-align: -2px; }
.range-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 7px; font-size: 8px; color: var(--text3); }
.range-foot b { color: var(--accent); font-weight: 750; }

/* ---------- overview ---------- */
.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 222px;
  padding: 18px;
  background:
    linear-gradient(142deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 255, 0.90) 52%, rgba(231, 240, 250, 0.82) 100%),
    url("assets/widget-bg.png") center / cover no-repeat;
}
.hero-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.55));
  pointer-events: none;
}
.hero-top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; }
.hero-vehicle {
  display: block;
  width: 100%;
  height: 158px;
  object-fit: contain;
  object-position: 50% 50%;
  margin-top: -4px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 22px 26px rgba(20, 35, 55, 0.18));
}
.hero-bottom { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; margin-top: -12px; }
.odo-value { font-size: 31px; font-weight: 820; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.odo-label { font-size: 9.5px; color: var(--text3); margin-top: 4px; font-weight: 600; }
.hero-sync { text-align: right; font-size: 8.5px; color: var(--text3); line-height: 1.55; }
.hero-sync b { color: var(--text2); font-weight: 700; }

.parking-card { padding: 0; overflow: hidden; }
.parking-head { padding: 15px 16px 11px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.map-thumb-wrap {
  position: relative;
  margin: 0 12px;
  height: 142px;
  border-radius: 16px;
  overflow: hidden;
  background: #eaf0f6;
}
.map-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-thumb-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(13, 17, 23, 0.06);
  border-radius: 16px;
  pointer-events: none;
}
.map-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 11px 9px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
  background: linear-gradient(transparent, rgba(8, 15, 25, 0.58));
}
.map-attr { position: absolute; right: 7px; bottom: 4px; font-size: 6.5px; color: rgba(255, 255, 255, 0.75); letter-spacing: 0.01em; }
.map-pin-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.map-pin-label .icon { width: 11px; height: 11px; }
.parking-body { padding: 11px 16px 15px; display: flex; align-items: flex-start; gap: 10px; }
.parking-address { font-size: 12.5px; font-weight: 720; letter-spacing: -0.01em; }
.parking-note { font-size: 9px; color: var(--text3); margin-top: 3px; }
.parking-chev { color: var(--text3); margin-left: auto; padding-top: 2px; }
.parking-chev .icon { width: 16px; height: 16px; }

.latest-card { display: flex; flex-direction: column; gap: 11px; }
.latest-stats { display: flex; align-items: stretch; }
.latest-stat { flex: 1; min-width: 0; }
.latest-stat + .latest-stat { border-left: 1px solid var(--stroke); padding-left: 12px; }
.latest-value { font-size: 18px; font-weight: 780; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.latest-value .unit { font-size: 9px; font-weight: 650; color: var(--text2); margin-left: 2px; }
.latest-label { font-size: 8.5px; color: var(--text3); margin-top: 3px; }

.quick-card { padding: 7px; display: flex; }
.quick-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 4px;
  border-radius: 14px;
  background: transparent;
  color: var(--text2);
  font-size: 9.5px;
  font-weight: 650;
  transition: 0.16s ease;
}
.quick-btn:active { background: rgba(47, 107, 255, 0.06); }
.quick-btn + .quick-btn { border-left: 1px solid var(--stroke); border-radius: 0; }
.quick-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(47, 107, 255, 0.08);
  color: var(--accent);
}
.quick-icon .icon { width: 17px; height: 17px; }
.quick-btn:nth-child(2) .quick-icon { background: rgba(18, 183, 106, 0.09); color: #0b9b5c; }
.quick-btn:nth-child(3) .quick-icon { background: rgba(245, 165, 36, 0.12); color: #b37708; }

.footer-note { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 2px 0 4px; font-size: 8.5px; color: var(--text3); text-align: center; }

/* ---------- segmented ---------- */
.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(13, 17, 23, 0.045);
  border: 1px solid rgba(13, 17, 23, 0.03);
}
.seg {
  flex: 1;
  padding: 7px 6px;
  border-radius: 9px;
  background: transparent;
  color: var(--text3);
  font-size: 10.5px;
  font-weight: 650;
  transition: 0.16s ease;
}
.seg.active { background: #fff; color: var(--text); box-shadow: 0 2px 7px rgba(13, 17, 23, 0.08); }

/* ---------- ride ---------- */
.summary-blue {
  background: linear-gradient(135deg, #3b78ff 0%, #2f6bff 44%, #0b5bd3 100%);
  border: 0;
  color: #fff;
  box-shadow: 0 16px 34px rgba(47, 107, 255, 0.22);
  position: relative;
  overflow: hidden;
}
.summary-blue::after {
  content: "";
  position: absolute;
  width: 170px; height: 170px;
  right: -60px; top: -80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
}
.summary-blue .label { color: rgba(255, 255, 255, 0.68); }
.summary-blue .card-sub { color: rgba(255, 255, 255, 0.62); }
.summary-blue .metric-value { color: #fff; }
.summary-blue .metric-unit { color: rgba(255, 255, 255, 0.72); }
.summary-stats { display: flex; margin-top: 14px; position: relative; z-index: 1; }
.summary-stat { flex: 1; min-width: 0; }
.summary-stat + .summary-stat { border-left: 1px solid rgba(255, 255, 255, 0.18); padding-left: 12px; }
.summary-stat b { display: block; font-size: 17px; font-weight: 780; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.summary-stat span { display: block; font-size: 8.5px; color: rgba(255, 255, 255, 0.65); margin-top: 3px; }

.month-label { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px 1px; font-size: 10px; font-weight: 700; color: var(--text3); }
.month-label .tiny { font-weight: 550; }

.ride-card { padding: 11px; display: flex; gap: 11px; align-items: center; }
.ride-map { width: 104px; height: 70px; border-radius: 14px; object-fit: cover; flex: none; background: #eaf0f6; }
.ride-info { flex: 1; min-width: 0; }
.ride-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ride-date { font-size: 12.5px; font-weight: 760; letter-spacing: -0.01em; }
.ride-time { font-size: 9px; color: var(--text3); white-space: nowrap; }
.ride-stats { display: flex; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.ride-stat { font-size: 9px; color: var(--text3); white-space: nowrap; }
.ride-stat b { color: var(--text); font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.ride-chev { color: var(--text3); padding-left: 2px; }
.ride-chev .icon { width: 15px; height: 15px; }

.map-view { padding: 0; overflow: hidden; }
.map-view .map-hero { width: 100%; height: 248px; object-fit: cover; display: block; }
.map-view .map-caption { padding: 13px 15px 15px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.map-chip { position: absolute; left: 12px; top: 12px; }
.map-view .map-stage { position: relative; }

/* ---------- fuel ---------- */
.fuel-summary { padding: 16px; }
.fuel-summary .metric-value { font-size: 31px; }
.cost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cost-card { padding: 13px 14px; }
.cost-value { font-size: 19px; font-weight: 780; letter-spacing: -0.03em; margin-top: 7px; font-variant-numeric: tabular-nums; }
.cost-sub { font-size: 8.5px; color: var(--text3); margin-top: 3px; }

.chart-card { padding: 15px 14px 12px; }
.bar-chart { height: 112px; display: flex; align-items: flex-end; gap: 7px; padding-top: 10px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; min-width: 0; }
.bar-track { width: 100%; max-width: 25px; height: 86px; display: flex; align-items: flex-end; }
.bar-fill {
  width: 100%;
  min-height: 4px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #6b96ff 0%, #2f6bff 70%, #1b54dd 100%);
  box-shadow: 0 4px 10px rgba(47, 107, 255, 0.18);
  transition: height 0.35s ease;
}
.bar-fill.soft { background: linear-gradient(180deg, #b9cdfc, #7fa5f8); box-shadow: none; }
.bar-label { font-size: 7.5px; color: var(--text3); white-space: nowrap; }
.bar-value { font-size: 7.5px; color: var(--text3); font-weight: 650; height: 10px; }

.record-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.record-row + .record-row { border-top: 1px solid var(--stroke); }
.record-icon { width: 34px; height: 34px; border-radius: 11px; background: rgba(47, 107, 255, 0.08); color: var(--accent); display: grid; place-items: center; flex: none; }
.record-icon .icon { width: 16px; height: 16px; }
.record-main { flex: 1; min-width: 0; }
.record-title { font-size: 11.5px; font-weight: 720; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.record-sub { font-size: 8.5px; color: var(--text3); margin-top: 3px; }
.record-right { text-align: right; flex: none; }
.record-amount { font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.record-unit { font-size: 8px; color: var(--text3); margin-top: 2px; }

.badge { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 999px; font-size: 7.5px; font-weight: 750; letter-spacing: 0.01em; }
.badge-ok { background: rgba(18, 183, 106, 0.11); color: #09864f; }
.badge-muted { background: rgba(138, 148, 166, 0.13); color: var(--text3); }
.badge-demo { background: rgba(245, 165, 36, 0.13); color: #a96f00; }
.badge-warn { background: rgba(245, 165, 36, 0.14); color: #a96f00; }

.basis-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; font-size: 10.5px; }
.basis-row + .basis-row { border-top: 1px solid var(--stroke); }
.basis-key { color: var(--text3); }
.basis-val { color: var(--text); font-weight: 650; text-align: right; }
.action-row { display: flex; gap: 8px; margin-top: 11px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 13px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 720;
  letter-spacing: 0.01em;
  transition: 0.16s ease;
}
.btn .icon { width: 14px; height: 14px; }
.btn.ghost { background: rgba(47, 107, 255, 0.08); color: var(--accent); }
.btn.soft { background: rgba(13, 17, 23, 0.055); color: var(--text2); }
.btn.block { width: 100%; }
.btn.danger { background: rgba(240, 68, 56, 0.08); color: var(--danger); }
.btn:active { filter: brightness(0.97); }

/* ---------- service ---------- */
.service-summary {
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.11) 0%, rgba(255, 255, 255, 0.92) 62%, rgba(255, 255, 255, 0.86) 100%);
  position: relative;
  overflow: hidden;
}
.service-summary::after {
  content: "";
  position: absolute;
  width: 150px; height: 150px;
  right: -55px; top: -70px;
  border-radius: 50%;
  background: rgba(47, 107, 255, 0.08);
}
.service-summary .service-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; position: relative; z-index: 1; }
.service-summary .metric-value { font-size: 25px; margin-top: 10px; }
.service-summary .service-meta { font-size: 9px; color: var(--text3); margin-top: 4px; }
.progress { height: 7px; border-radius: 999px; background: rgba(13, 17, 23, 0.07); overflow: hidden; margin-top: 10px; position: relative; z-index: 1; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6b96ff, #2f6bff); }
.progress-labels { display: flex; justify-content: space-between; font-size: 8px; color: var(--text3); margin-top: 5px; position: relative; z-index: 1; }

.service-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.service-item + .service-item { border-top: 1px solid var(--stroke); }
.service-icon { width: 34px; height: 34px; border-radius: 11px; background: rgba(47, 107, 255, 0.08); color: var(--accent); display: grid; place-items: center; flex: none; }
.service-icon .icon { width: 16px; height: 16px; }
.service-main { flex: 1; min-width: 0; }
.service-name { font-size: 11.5px; font-weight: 720; }
.service-sub { font-size: 8.5px; color: var(--text3); margin-top: 3px; }
.service-next { text-align: right; flex: none; }
.service-next b { display: block; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.service-next span { display: block; font-size: 7.5px; color: var(--text3); margin-top: 3px; }
.status-dot { display: inline-flex; align-items: center; gap: 4px; font-size: 8px; font-weight: 650; color: var(--text3); margin-top: 3px; }
.status-dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.75; }
.status-dot.ok { color: #09864f; }
.status-dot.muted { color: var(--text3); }

.timeline { position: relative; padding-left: 17px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 7px; bottom: 8px; width: 1px; background: var(--stroke); }
.timeline-item { position: relative; padding: 0 0 14px 10px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -15px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12); }
.timeline-date { font-size: 9px; color: var(--text3); font-weight: 650; }
.timeline-title { font-size: 11.5px; font-weight: 720; margin-top: 3px; }
.timeline-sub { font-size: 8.5px; color: var(--text3); margin-top: 3px; }

.empty-state { border: 1px dashed rgba(13, 17, 23, 0.14); border-radius: 16px; padding: 20px 14px; text-align: center; color: var(--text3); }
.empty-state .empty-icon { width: 40px; height: 40px; border-radius: 14px; background: rgba(47, 107, 255, 0.07); color: var(--accent); display: grid; place-items: center; margin: 0 auto 9px; }
.empty-state .empty-icon .icon { width: 19px; height: 19px; }
.empty-state b { display: block; font-size: 11px; color: var(--text2); margin-bottom: 3px; }
.empty-state span { font-size: 8.5px; line-height: 1.5; }

/* ---------- tabbar ---------- */
.tabbar {
  flex: none;
  height: 74px;
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  display: flex;
  align-items: stretch;
  gap: 2px;
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid var(--stroke);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 13px;
  background: transparent;
  color: var(--text3);
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: 0.16s ease;
}
.tab-icon { width: 29px; height: 25px; border-radius: 9px; display: grid; place-items: center; transition: 0.16s ease; }
.tab-icon .icon { width: 19px; height: 19px; }
.tab.active { color: var(--accent); }
.tab.active .tab-icon { background: rgba(47, 107, 255, 0.10); }
.tab.active .icon { stroke-width: 2; }

/* ---------- detail ---------- */
.detail {
  position: absolute;
  inset: 44px 0 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}
.detail-header {
  flex: none;
  height: 54px;
  padding: 6px 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.detail-title { font-size: 13px; font-weight: 760; letter-spacing: -0.01em; }
.detail-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 24px; scrollbar-width: none; }
.detail-scroll::-webkit-scrollbar { width: 0; }
.detail-map-card { padding: 0; overflow: hidden; }
.detail-map { width: 100%; height: 202px; object-fit: cover; display: block; }
.detail-map-stage { position: relative; }
.detail-map-overlay { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; color: #fff; }
.detail-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { font-size: 8px; font-weight: 700; padding: 3px 7px; border-radius: 999px; background: rgba(13, 17, 23, 0.72); color: #fff; backdrop-filter: blur(6px); }
.tag.light { background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.28); }

.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 4px 0; }
.detail-stat { padding: 9px 0; }
.detail-stat + .detail-stat { border-left: 1px solid var(--stroke); padding-left: 12px; }
.detail-stat b { display: block; font-size: 17px; font-weight: 780; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.detail-stat span { display: block; font-size: 8px; color: var(--text3); margin-top: 3px; }
.detail-stats.six .detail-stat:nth-child(n+4) { border-top: 1px solid var(--stroke); }
.detail-stats.six .detail-stat:nth-child(3n+1) { border-left: 0; padding-left: 0; }
.chart-svg { width: 100%; height: 108px; display: block; overflow: visible; }
.chart-svg .grid { stroke: rgba(13, 17, 23, 0.06); stroke-width: 1; }
.chart-svg .area { fill: url(#speedFill); }
.chart-svg .line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .marker { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.chart-foot { display: flex; justify-content: space-between; font-size: 8px; color: var(--text3); margin-top: 3px; }

.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 10.5px; }
.info-row + .info-row { border-top: 1px solid var(--stroke); }
.info-key { color: var(--text3); flex: none; }
.info-value { text-align: right; font-weight: 650; }
.note-box { font-size: 9px; color: var(--text2); line-height: 1.6; background: rgba(47, 107, 255, 0.055); border-radius: 12px; padding: 10px 11px; margin-top: 10px; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.detail-actions .btn { width: 100%; }

/* ---------- sheet ---------- */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(13, 17, 23, 0.34);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.scrim.open { opacity: 1; }
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  max-height: 88%;
  overflow-y: auto;
  padding: 9px 16px calc(18px + env(safe-area-inset-bottom));
  background: #fff;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 50px rgba(13, 17, 23, 0.18);
  transform: translateY(102%);
  transition: transform 0.26s cubic-bezier(0.22, 0.8, 0.26, 1);
  scrollbar-width: none;
}
.sheet::-webkit-scrollbar { width: 0; }
.sheet.open { transform: translateY(0); }
.sheet-handle { width: 36px; height: 4px; border-radius: 999px; background: rgba(13, 17, 23, 0.14); margin: 0 auto 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-bottom: 11px; }
.sheet-title { font-size: 17px; font-weight: 800; letter-spacing: -0.03em; }
.sheet-sub { font-size: 9.5px; color: var(--text3); line-height: 1.5; margin-top: 4px; }
.sheet-close { width: 30px; height: 30px; border-radius: 50%; background: rgba(13, 17, 23, 0.055); color: var(--text2); display: grid; place-items: center; flex: none; }
.sheet-close .icon { width: 15px; height: 15px; }
.option-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  background: transparent;
  text-align: left;
  border-top: 1px solid var(--stroke);
}
.option-icon { width: 36px; height: 36px; border-radius: 12px; background: rgba(47, 107, 255, 0.08); color: var(--accent); display: grid; place-items: center; flex: none; }
.option-icon .icon { width: 17px; height: 17px; }
.option-icon.warn { background: rgba(245, 165, 36, 0.12); color: #b37708; }
.option-icon.danger { background: rgba(240, 68, 56, 0.08); color: var(--danger); }
.option-main { flex: 1; min-width: 0; }
.option-title { font-size: 11.5px; font-weight: 720; }
.option-sub { font-size: 8.5px; color: var(--text3); margin-top: 3px; line-height: 1.45; }
.option-chev { color: var(--text3); }
.option-chev .icon { width: 14px; height: 14px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.form-row { margin-top: 9px; }
.form-label { display: block; font-size: 9px; font-weight: 650; color: var(--text3); margin-bottom: 5px; }
.input {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #f7fafe;
  padding: 0 12px;
  font-size: 12px;
  color: var(--text);
  outline: none;
  transition: 0.16s ease;
}
.input:focus { border-color: rgba(47, 107, 255, 0.45); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.08); }
.toggle-row { display: flex; gap: 7px; margin-top: 9px; }
.toggle-chip {
  flex: 1;
  padding: 9px 8px;
  border-radius: 11px;
  background: #f4f7fb;
  color: var(--text3);
  font-size: 10px;
  font-weight: 650;
  border: 1px solid transparent;
}
.toggle-chip.active { background: rgba(47, 107, 255, 0.08); color: var(--accent); border-color: rgba(47, 107, 255, 0.16); }
.sheet-actions { display: flex; gap: 8px; margin-top: 15px; }
.sheet-actions .btn { flex: 1; }
.danger-link { width: 100%; background: transparent; color: var(--danger); font-size: 10px; font-weight: 650; padding: 12px 0 2px; text-align: center; }

.toast {
  position: absolute;
  left: 50%;
  bottom: 86px;
  z-index: 70;
  transform: translate(-50%, 12px);
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(13, 17, 23, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  max-width: 90%;
  opacity: 0;
  pointer-events: none;
  transition: 0.22s ease;
  box-shadow: 0 8px 22px rgba(13, 17, 23, 0.18);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- PWA / iPhone ---------- */
@supports (height: 100dvh) {
  .app-shell { height: 100dvh; min-height: 100dvh; }
}
body.standalone .statusbar { display: none; }
body.standalone .app-shell { padding-top: env(safe-area-inset-top); }
body.standalone .detail { top: 0; }
body.standalone .sheet { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }

.boot, .login {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(120% 70% at 50% 0%, #ffffff 0%, rgba(255, 255, 255, 0.5) 30%, transparent 62%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}
.boot-mark, .login-mark {
  width: 66px;
  height: 66px;
  border-radius: 21px;
  background: linear-gradient(135deg, #3b78ff, #0b5bd3) url("assets/logo-mark-white.png") center / 58% no-repeat;
  box-shadow: 0 14px 30px rgba(47, 107, 255, 0.25);
  margin-bottom: 16px;
}
.boot-title { font-size: 18px; font-weight: 820; letter-spacing: -0.03em; }
.boot-sub { font-size: 10px; color: var(--text3); margin-top: 6px; }
.boot.hide { opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }

.login-card {
  width: 100%;
  max-width: 330px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(31, 45, 61, 0.14);
  padding: 26px 22px 20px;
  text-align: center;
  backdrop-filter: blur(16px);
}
.login-mark { margin: 0 auto 14px; }
.login-title { font-size: 18px; font-weight: 820; letter-spacing: -0.03em; }
.login-sub { font-size: 9.5px; color: var(--text3); line-height: 1.6; margin: 6px 0 16px; }
.login-input { text-align: center; letter-spacing: 0.25em; font-size: 18px; height: 48px; margin-bottom: 10px; }
.login-error { min-height: 18px; font-size: 9px; color: var(--danger); margin-top: 10px; }
.login .btn { height: 44px; }
