/* PACE TRACK — dark premium, black & blue */
:root {
  --bg: #080B12;
  --bg-2: #111827;
  --card: rgba(17, 24, 39, 0.72);
  --card-solid: #0F1522;
  --line: rgba(146, 155, 170, 0.14);
  --line-strong: rgba(146, 155, 170, 0.24);
  --blue: #287BFF;
  --blue-2: #42A5FF;
  --blue-glow: rgba(40, 123, 255, 0.35);
  --text: #FFFFFF;
  --text-2: #929BAA;
  --text-3: #5D6676;
  --ok: #25C685;
  --warn: #F5B942;
  --bad: #FF5A5F;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(40, 123, 255, 0.16), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}
input, select, textarea { -webkit-user-select: auto; user-select: auto; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--text-2); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 10px) 18px calc(var(--tabbar-h) + var(--safe-b) + 24px);
}
.view { animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 44px; }
.brand { font-weight: 800; letter-spacing: .14em; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.brand b { color: var(--blue-2); font-weight: 800; margin-left: 4px; }
.brand-mark { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--blue-2)); box-shadow: 0 0 12px var(--blue-glow); }
.chips { display: flex; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: var(--text-3); background: rgba(17, 24, 39, .8); border: 1px solid var(--line);
  transition: color .3s, border-color .3s, background .3s;
}
.chip .ico { width: 13px; height: 13px; }
.chip.ok { color: var(--ok); border-color: rgba(37, 198, 133, .3); }
.chip.warn { color: var(--warn); border-color: rgba(245, 185, 66, .3); }
.chip.bad { color: var(--bad); border-color: rgba(255, 90, 95, .3); }
.chip.on { color: var(--blue-2); border-color: rgba(66, 165, 255, .3); }

/* ---------- Banner ---------- */
.banner {
  display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 0; padding: 12px 12px 12px 14px;
  border-radius: var(--r-sm); background: rgba(245, 185, 66, .08); border: 1px solid rgba(245, 185, 66, .25); color: #F7D58E;
  font-size: 13px; animation: viewIn .3s var(--ease);
}
.banner.info { background: rgba(40, 123, 255, .08); border-color: rgba(66, 165, 255, .25); color: #A9CEFF; }
.banner .ico { margin-top: 1px; }
.banner-text { flex: 1; }
.banner-close { font-size: 20px; line-height: 1; color: inherit; opacity: .7; padding: 0 4px; }

/* ---------- Hero ring ---------- */
.hero { display: flex; justify-content: center; padding: 8px 0 2px; }
.ring-wrap { position: relative; width: min(58vw, 212px); aspect-ratio: 1; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: rgba(146, 155, 170, .1); stroke-width: 8; }
.ring-ticks { fill: none; stroke: rgba(146, 155, 170, .16); stroke-width: 3; stroke-dasharray: 1 8.2; }
.ring-progress {
  fill: none; stroke: url(#ringGrad); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 1000; stroke-dashoffset: 1000;
  transition: stroke-dashoffset .8s var(--ease), opacity .3s;
  filter: drop-shadow(0 0 6px rgba(40, 123, 255, .55));
}
.hero-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.state-label { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.state-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
body[data-state="running"] .state-label { color: var(--ok); }
body[data-state="running"] .state-label::before { background: var(--ok); animation: pulse 1.6s infinite; }
body[data-state="paused"] .state-label { color: var(--warn); }
body[data-state="paused"] .state-label::before { background: var(--warn); }
body[data-state="paused"] .time { animation: blink 1.6s ease-in-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 198, 133, .6); } 70% { box-shadow: 0 0 0 7px rgba(37, 198, 133, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 198, 133, 0); } }
@keyframes blink { 50% { opacity: .45; } }
.time { font-size: clamp(38px, 12vw, 48px); font-weight: 600; margin: 4px 0 2px; }
.goal-label { font-size: 12px; color: var(--text-2); min-height: 16px; }

/* ---------- Primary metrics ---------- */
.primary { display: flex; align-items: center; justify-content: center; padding: 6px 0 14px; }
.big-metric { flex: 1; text-align: center; }
.big-metric .val { font-size: 40px; font-weight: 600; line-height: 1.05; transition: color .3s; }
.big-metric .lbl { font-size: 12px; color: var(--text-2); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
.big-metric .val.na { color: var(--text-3); }
.vdiv { width: 1px; height: 46px; background: var(--line-strong); }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(23, 32, 52, .72), rgba(15, 21, 34, .72));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric { padding: 13px 14px 12px; }
.metric-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.metric-head .ico { width: 15px; height: 15px; color: var(--blue-2); }
.metric-val { margin-top: 6px; display: flex; align-items: baseline; gap: 5px; }
.metric-val .num { font-size: 27px; font-weight: 600; }
.metric-val small { font-size: 11px; color: var(--text-3); }

.status-card { margin-top: 10px; padding: 4px 14px; }
.status-row { display: flex; justify-content: space-between; align-items: center; min-height: 38px; font-size: 13px; }
.status-name { color: var(--text-2); }
.status-val { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); display: inline-block; }
.status-val.ok .dot { background: var(--ok); box-shadow: 0 0 8px rgba(37, 198, 133, .6); }
.status-val.warn .dot { background: var(--warn); }
.status-val.bad .dot { background: var(--bad); }
.status-val.on .dot { background: var(--blue-2); }
.sep { height: 1px; background: var(--line); }
.acc { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.acc-bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.acc-bars i { width: 4px; border-radius: 1px; background: rgba(146, 155, 170, .2); transition: background .3s; }
.acc-bars i:nth-child(1) { height: 5px; } .acc-bars i:nth-child(2) { height: 8px; } .acc-bars i:nth-child(3) { height: 11px; } .acc-bars i:nth-child(4) { height: 14px; }
.acc-bars[data-level="1"] i:nth-child(-n+1) { background: var(--bad); }
.acc-bars[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.acc-bars[data-level="3"] i:nth-child(-n+3) { background: var(--ok); }
.acc-bars[data-level="4"] i:nth-child(-n+4) { background: var(--ok); }
.status-note { margin: 0 0 12px; font-size: 12px; color: var(--text-2); }
.status-note:empty { display: none; }

/* ---------- Controls ---------- */
.controls-spacer { height: 104px; }
.controls {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b));
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 14px 18px 12px; pointer-events: none;
  background: linear-gradient(to top, var(--bg) 55%, rgba(8, 11, 18, 0));
}
.controls > * { pointer-events: auto; }
body:not([data-view="workout"]) .controls { display: none; }
.controls button { display: none; }
body[data-state="idle"] #btn-start, body[data-state="completed"] #btn-start { display: grid; }
body[data-state="running"] #btn-pause, body[data-state="running"] #btn-end { display: grid; }
body[data-state="paused"] #btn-resume, body[data-state="paused"] #btn-end { display: grid; }

.btn-start {
  width: 88px; height: 88px; border-radius: 50%; place-items: center;
  background: radial-gradient(circle at 30% 25%, #4FA9FF, var(--blue) 60%, #1B5FD6);
  font-weight: 800; letter-spacing: .1em; font-size: 15px;
  box-shadow: 0 0 0 6px rgba(40, 123, 255, .12), 0 10px 32px rgba(40, 123, 255, .45);
  transition: transform .15s var(--ease), box-shadow .3s;
}
.btn-start:active { transform: scale(.94); }
.btn-start::after { content: ""; position: absolute; }
.btn-round {
  width: 68px; height: 68px; border-radius: 50%; place-items: center;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  transition: transform .15s var(--ease);
}
.btn-round svg { width: 26px; height: 26px; fill: currentColor; }
.btn-round:active, .btn-end:active { transform: scale(.94); }
.btn-resume { background: linear-gradient(135deg, var(--blue), var(--blue-2)); border: 0; box-shadow: 0 8px 26px rgba(40, 123, 255, .4); }
.btn-end {
  height: 68px; min-width: 120px; padding: 0 28px; border-radius: 34px; place-items: center;
  background: #FFFFFF; color: #080B12; font-weight: 800; letter-spacing: .12em;
  transition: transform .15s var(--ease);
}

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: flex-start;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding: 8px 12px var(--safe-b);
  background: rgba(8, 11, 18, .82); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--text-3); padding: 4px 0; transition: color .2s; }
.tab .ico { width: 24px; height: 24px; }
.tab.active { color: var(--blue-2); }
body[data-state="running"] .tab[data-tab="workout"] .ico, body[data-state="paused"] .tab[data-tab="workout"] .ico { filter: drop-shadow(0 0 6px var(--blue-glow)); }

/* ---------- Pages ---------- */
.page-head { padding: 8px 2px 14px; }
.page-head h1, .detail-head h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { margin: 2px 0 0; font-size: 13px; }
.sec-title { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); margin: 22px 4px 8px; }

.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.total { padding: 12px; }
.total .v { font-family: var(--font-num); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.total .l { font-size: 11px; color: var(--text-2); }
.row-actions { display: flex; gap: 8px; margin: 14px 0 8px; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(17, 24, 39, .8); border: 1px solid var(--line); color: var(--text);
}
.btn-ghost .ico { width: 15px; height: 15px; }
.btn-ghost.danger { color: var(--bad); }
.row-actions .danger { margin-left: auto; }

.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.h-item { display: flex; align-items: stretch; overflow: hidden; }
.h-open { flex: 1; display: flex; align-items: center; gap: 12px; padding: 14px; text-align: left; min-width: 0; }
.h-badge { width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center; background: rgba(40, 123, 255, .12); color: var(--blue-2); }
.h-badge .ico { width: 22px; height: 22px; }
.h-main { flex: 1; min-width: 0; }
.h-date { font-weight: 600; font-size: 15px; }
.h-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.h-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 7px; font-size: 12px; color: var(--text-2); }
.h-stats b { color: var(--text); font-family: var(--font-num); font-weight: 600; font-variant-numeric: tabular-nums; }
.h-km { text-align: right; }
.h-km .num { font-size: 22px; font-weight: 600; }
.h-km small { display: block; font-size: 11px; color: var(--text-2); }
.h-del { width: 44px; flex: none; display: grid; place-items: center; color: var(--text-3); border-left: 1px solid var(--line); }
.h-del:active { color: var(--bad); }
.empty { text-align: center; padding: 50px 20px; }
.empty h3 { margin: 18px 0 4px; }
.empty-ring { width: 70px; height: 70px; margin: 0 auto; border-radius: 50%; border: 6px solid rgba(40, 123, 255, .18); border-top-color: var(--blue); }

/* ---------- Detail ---------- */
.detail-head { display: flex; align-items: center; gap: 12px; padding: 6px 0 16px; }
.detail-head h1 { font-size: 24px; }
.eyebrow { font-size: 12px; color: var(--blue-2); font-weight: 600; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); flex: none; }
.icon-btn .ico { width: 20px; height: 20px; }
.d-hero { padding: 18px; display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; gap: 6px; }
.d-hero .v { font-family: var(--font-num); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.d-hero .l { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); margin-top: 10px; }
.stat { background: var(--card-solid); padding: 12px 14px; }
.stat .l { font-size: 12px; color: var(--text-2); }
.stat .v { font-family: var(--font-num); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .v small { font-size: 11px; color: var(--text-3); font-weight: 500; margin-left: 3px; font-family: var(--font); }
.stat .note { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.chart-card { padding: 14px 12px 8px; margin-top: 10px; }
.chart-title { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 6px; font-size: 13px; font-weight: 600; }
.chart-title span { font-size: 11px; color: var(--text-2); font-weight: 500; }
.chart svg, .route svg { display: block; width: 100%; }
.chart .empty-chart, .route .empty-chart { padding: 26px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.route { padding: 0; overflow: hidden; margin-top: 10px; }
.route-foot { display: flex; justify-content: space-between; padding: 10px 14px; font-size: 11px; color: var(--text-2); border-top: 1px solid var(--line); }
.legend { display: flex; gap: 12px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.kvs { padding: 4px 14px; margin-top: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--text-2); }
.kv b { font-weight: 600; text-align: right; }
.gap-list { list-style: none; margin: 0; padding: 0; }
.gap-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.gap-list li:last-child { border-bottom: 0; }
.gap-list .tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(245, 185, 66, .12); color: var(--warn); }
.gap-list .tag.gps { background: rgba(66, 165, 255, .12); color: var(--blue-2); }
.notes { margin: 10px 0 0; padding: 12px 14px; font-size: 12px; color: var(--text-2); }
.notes p { margin: 4px 0; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.detail-actions .danger { margin-left: auto; }

/* ---------- Forms ---------- */
.form { padding: 4px 14px 14px; }
.form.compact { padding: 0; margin: 14px 0 6px; background: var(--bg-2); border-radius: var(--r-sm); padding: 0 12px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); font-size: 15px; }
.field > span:first-child { color: var(--text); }
.field .opt { font-style: normal; font-size: 11px; color: var(--text-3); margin-left: 4px; }
.field input, .field select {
  background: transparent; border: 0; color: var(--blue-2); font: inherit; font-weight: 600; text-align: right;
  width: 110px; padding: 8px 0; outline: none; -webkit-appearance: none; appearance: none;
}
.field select { width: auto; max-width: 170px; direction: rtl; }
.field select option { direction: ltr; color: #000; }
.field input::placeholder { color: var(--text-3); font-weight: 500; }
.unit-wrap { display: inline-flex; align-items: center; gap: 4px; }
.unit-wrap em { font-style: normal; font-size: 13px; color: var(--text-2); }
.unit-wrap input { width: 76px; }
.field.slider { flex-direction: column; align-items: stretch; justify-content: center; padding: 10px 0; gap: 8px; }
.field.slider > span { display: flex; justify-content: space-between; }
.field.slider b { color: var(--blue-2); font-family: var(--font-num); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px; background: rgba(146, 155, 170, .25); text-align: left; padding: 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.hint { font-size: 12px; color: var(--text-2); margin: 10px 0 0; }
.hint:empty { display: none; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.seg button { white-space: nowrap; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg button.active { background: var(--blue); color: #fff; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 700; font-size: 15px; transition: transform .12s, opacity .2s;
}
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff; box-shadow: 0 6px 18px rgba(40, 123, 255, .3); }
.form > .btn-primary { width: 100%; margin-top: 14px; }
.btn-secondary { background: var(--bg-2); border: 1px solid var(--line-strong); color: var(--text); }
.btn-danger { background: rgba(255, 90, 95, .12); color: var(--bad); border: 1px solid rgba(255, 90, 95, .3); width: 100%; margin-top: 8px; }
.btn-primary:active, .btn-secondary:active, .btn-danger:active, .btn-ghost:active { transform: scale(.97); }
button:disabled { opacity: .45; pointer-events: none; }
.prose { padding: 14px 16px; font-size: 14px; color: #C9D0DB; }
.prose p { margin: 0 0 10px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0; padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose b { color: #fff; }
.about { text-align: center; font-size: 12px; color: var(--text-3); margin: 26px 0 0; }

/* ---------- Dialogs ---------- */
dialog.sheet {
  width: min(92vw, 420px); max-height: 86dvh; overflow: auto; padding: 22px 20px 18px;
  border-radius: 24px; border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #141C2E, #0D1320); color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(40, 123, 255, .08);
}
dialog.sheet[open] { animation: sheetIn .3s var(--ease); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(3, 5, 10, .66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.01em; }
dialog p { margin: 0; font-size: 14px; }
.dlg-actions { display: flex; gap: 10px; margin-top: 18px; }
.dlg-actions > * { flex: 1; }
.dlg-actions.vertical { flex-direction: column; }
.welcome-mark { width: 54px; height: 54px; border-radius: 16px; background: url(../icons/icon-192.png) center/cover; margin-bottom: 14px; box-shadow: 0 8px 24px rgba(40, 123, 255, .3); }
.calib-big { font-family: var(--font-num); font-size: 54px; font-weight: 600; text-align: center; margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.calib-bar { height: 6px; border-radius: 3px; background: rgba(146, 155, 170, .2); overflow: hidden; margin: 12px 0; }
.calib-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--blue-2)); transition: width .2s linear; }
.calib-steps { margin: 10px 0 0; padding-left: 20px; font-size: 14px; color: #C9D0DB; }
.calib-steps li { margin: 4px 0; }
.calib-input { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 0 12px; background: var(--bg-2); border-radius: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); transform: translate(-50%, 180%); opacity: 0;
  max-width: min(92vw, 440px); padding: 12px 16px; border-radius: 14px; z-index: 50;
  background: rgba(17, 24, 39, .96); border: 1px solid var(--line-strong); font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .5); transition: transform .35s var(--ease), opacity .25s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
body[data-view="workout"] .toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + 112px); }
.toast.bad { border-color: rgba(255, 90, 95, .4); }
.toast.ok { border-color: rgba(37, 198, 133, .4); }

@media (max-height: 700px) {
  .ring-wrap { width: min(54vw, 190px); }
  .time { font-size: 36px; }
  .big-metric .val { font-size: 32px; }
  .metric-val .num { font-size: 23px; }
  .metric { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.form .field:last-of-type, .form.compact .field:last-child { border-bottom: 0; }
