:root {
  --bg: #f3f1ec;
  --bg2: #ebe7df;
  --card: #ffffff;
  --sunk: #f6f4f0;
  --text: #1c1e24;
  --muted: #6a6e78;
  --line: #e4e0d8;
  --accent: #e24a38;
  --accent2: #f2762e;
  --accent-ink: #ffffff;
  --ok: #2f9e55;
  --warn-bg: #fdeceb;
  --warn-ink: #a0291b;
  --info-bg: #fff5dc;
  --info-ink: #7a5600;
  --s0: #e24a38;
  --s1: #3b72c4;
  --shadow-sm: 0 1px 2px rgba(30, 25, 15, 0.06), 0 1px 1px rgba(30, 25, 15, 0.04);
  --shadow: 0 1px 2px rgba(30, 25, 15, 0.06), 0 6px 18px rgba(30, 25, 15, 0.07);
  --shadow-lg: 0 2px 4px rgba(30, 25, 15, 0.06), 0 14px 34px rgba(30, 25, 15, 0.12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --bg2: #0d0f12;
    --card: #1c1f26;
    --sunk: #161920;
    --text: #eceae6;
    --muted: #9a9ea8;
    --line: #2b2f38;
    --accent: #ef5a42;
    --accent2: #f58a3e;
    --ok: #4cc174;
    --warn-bg: #3a1f1c;
    --warn-ink: #ffb3a6;
    --info-bg: #332e1d;
    --info-ink: #f2d58a;
    --s0: #ef5a42;
    --s1: #7aa7e8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 22px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%) fixed;
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
body.touring { overflow: hidden; }
main { max-width: 640px; margin: 0 auto; padding: calc(8px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left)); }
h1 { font-size: 1.3rem; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 8px; letter-spacing: -0.01em; }
h3 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 6px 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.hint { font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.center { text-align: center; }
.center-block { display: block; text-align: center; margin-top: 6px; }
.loading { margin-top: 40vh; }
.big { font-size: 2rem; font-weight: 800; }
.good { color: var(--ok); }
.bad { color: var(--warn-ink); font-weight: 700; }
.error { color: var(--warn-ink); background: var(--warn-bg); padding: 8px 10px; border-radius: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- icons */
.ic { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; vertical-align: -0.2em; }
.ic .r { fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.ic .d { fill: none; stroke: var(--b, var(--card)); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ic .df { fill: var(--b, var(--card)); }
.badge {
  --b: #56657a;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px; color: #fff; background: var(--b);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 2px 6px color-mix(in srgb, var(--b) 35%, transparent);
}
.badge .ic { width: 22px; height: 22px; }
.badge.sm { width: 32px; height: 32px; border-radius: 10px; }
.badge.sm .ic { width: 18px; height: 18px; }
.badge.lg { width: 52px; height: 52px; border-radius: 15px; }
.badge.lg .ic { width: 28px; height: 28px; }
.badge.xl { width: 72px; height: 72px; border-radius: 20px; }
.badge.xl .ic { width: 40px; height: 40px; }
.b-amber { --b: #e9a02c; } .b-violet { --b: #7b61ff; } .b-blue { --b: #3b78d8; } .b-red { --b: #e24a38; }
.b-teal { --b: #12998f; } .b-orange { --b: #f2762e; } .b-pink { --b: #e0457c; } .b-indigo { --b: #565cd6; }
.b-green { --b: #2f9e55; } .b-slate { --b: #5a6678; } .b-wood { --b: #b98348; }

/* ---------- surfaces */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; margin: 14px 0; box-shadow: var(--shadow);
}
.card.raised { box-shadow: var(--shadow-lg); border-color: transparent; }
.card-head { margin-bottom: 4px; }
.note, .tip { display: flex; gap: 10px; align-items: flex-start; background: var(--info-bg); color: var(--info-ink); padding: 10px 12px; border-radius: 12px; font-size: 0.9rem; }
.tip { box-shadow: none; border: 0; }
.note .ic, .tip .ic { margin-top: 2px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin: 12px 0; font-size: 0.92rem; box-shadow: var(--shadow-sm); }
.alert .ic { margin-top: 1px; width: 20px; height: 20px; }
.alert.warn { background: var(--warn-bg); color: var(--warn-ink); }
.alert.info { background: var(--info-bg); color: var(--info-ink); }

/* ---------- headers */
.bar, .daybar { display: flex; align-items: center; gap: 10px; padding: 10px 0 2px; }
.daybar { justify-content: space-between; }
.daytitle { font-weight: 800; font-size: 1.2rem; }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 700; white-space: nowrap; padding: 6px 10px 6px 4px; border-radius: 10px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }

/* ---------- hero */
.hero {
  margin: 12px 0; padding: 18px; border-radius: 22px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, var(--accent2) 0%, var(--accent) 55%, #b8322a 100%);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 40%, transparent);
}
.hero-main { display: flex; align-items: center; gap: 12px; }
.hero-num { font-size: 3.2rem; font-weight: 900; line-height: 1; letter-spacing: -0.03em; }
.hero-label { font-weight: 700; line-height: 1.15; opacity: 0.95; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; background: rgba(255, 255, 255, 0.18); }
.chip .ic { width: 15px; height: 15px; }

/* ---------- next up */
.next { border-left: 5px solid var(--accent); }
.next-label { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 8px; }
.next-head { display: flex; align-items: center; gap: 12px; }
.next-title { font-weight: 800; font-size: 1.1rem; }
.next-what { color: var(--muted); font-size: 0.92rem; }
.done-all { border-left-color: var(--ok); }

/* ---------- day steps */
.steps { display: flex; flex-direction: column; }
.step { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.steps .step:first-child { border-top: 0; }
.step-body { flex: 1; min-width: 0; }
.step-title { font-weight: 700; }
.step-sub { color: var(--muted); font-size: 0.84rem; }
.step-act { display: flex; align-items: center; gap: 8px; flex: none; }
.step.done .badge { filter: grayscale(0.6); opacity: 0.6; }
.step.done .step-title { color: var(--muted); }
.tick { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--ok); color: #fff; align-items: center; justify-content: center; }
.tick .ic { width: 16px; height: 16px; }

/* ---------- mix bar */
.mix { margin: 8px 0 4px; }
.mix svg { width: 100%; height: 10px; border-radius: 99px; display: block; overflow: hidden; }
.mix .m1 { fill: #7b61ff; } .mix .m2 { fill: #3b78d8; } .mix .m3 { fill: #e24a38; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 0.78rem; color: var(--muted); }
.mix-legend .k::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.mix-legend .m1::before { background: #7b61ff; } .mix-legend .m2::before { background: #3b78d8; } .mix-legend .m3::before { background: #e24a38; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; margin: 4px 0;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); box-shadow: var(--shadow-sm);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); box-shadow: none; }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff) 0%, var(--accent) 100%); border-color: transparent; color: var(--accent-ink); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 -2px 0 rgba(0, 0, 0, 0.12); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.danger { color: var(--warn-ink); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 0.86rem; border-radius: 10px; }
.btn.wide, .form .btn:not(.small) { width: 100%; }
.btn.big { min-height: 54px; font-size: 1.06rem; border-radius: 14px; }
.btn:disabled { opacity: 0.6; }
.link { background: none; border: 0; color: var(--accent); font: inherit; padding: 6px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- lists */
.list { display: flex; flex-direction: column; }
.list.card { padding: 4px 16px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; background: none; border-left: 0; border-right: 0; border-bottom: 0; font: inherit; text-align: left; width: 100%; cursor: pointer; }
.item:first-child { border-top: 0; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item.menu > .ic { color: var(--muted); }
.group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 22px 0 -4px; }
.group h2 { margin: 0; font-size: 1.05rem; }
.group .hint { flex-basis: 100%; margin-left: 42px; margin-top: -6px; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 0.7rem; font-weight: 700; background: var(--sunk); border: 1px solid var(--line); padding: 1px 7px; border-radius: 99px; vertical-align: 1px; color: var(--muted); }
.tag .ic { width: 11px; height: 11px; }
.pill { display: inline-flex; flex-direction: column; align-items: center; min-width: 58px; padding: 4px 8px; border-radius: 12px; background: var(--sunk); font-weight: 800; line-height: 1.1; }
.pill small { font-weight: 600; font-size: 0.66rem; color: var(--muted); }
.pill.good { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill.mid { background: color-mix(in srgb, #3b78d8 15%, transparent); color: #3b78d8; }
.pill.low { background: color-mix(in srgb, #7b61ff 15%, transparent); color: #7b61ff; }
.empty { text-align: center; }
.empty .badge { margin: 4px auto 8px; }
.howto { text-align: left; padding-left: 22px; margin: 8px 0; }
.howto li { margin: 10px 0; }
.row-icon { display: flex; gap: 12px; align-items: flex-start; }

/* ---------- forms */
.form label { display: block; margin: 12px 0; font-weight: 700; font-size: 0.92rem; }
.form input:not([type=radio]):not([type=checkbox]), .form select, .form textarea {
  display: block; width: 100%; margin-top: 6px; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--sunk); color: var(--text);
  font: inherit; font-size: 16px; font-weight: 400; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 1px; }
.form textarea { resize: vertical; }
.form.inline { display: flex; gap: 8px; align-items: center; }
.form.inline input { margin: 0 !important; flex: 1; }
.form.inline .btn { width: auto; margin: 0; }
.check { display: flex !important; align-items: center; gap: 10px; flex-wrap: wrap; }
.check input { width: 24px; height: 24px; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 14px 0; min-width: 0; }
legend { font-weight: 700; font-size: 0.92rem; padding: 0; margin-bottom: 8px; }
.scale .opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale.rpe .opts { grid-template-columns: repeat(6, 1fr); }
.scale.status .opts { grid-template-columns: 1fr; }
.scale .opts.wide { grid-template-columns: repeat(2, 1fr); }
.scale label { margin: 0; }
.scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale .opts span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--sunk); font-weight: 800; cursor: pointer; box-shadow: var(--shadow-sm); text-align: center; }
.scale input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.scale input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.grid2, .grid3, .grid4 { display: grid; gap: 8px; }
.grid2 { grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: repeat(3, 1fr); }
.grid4 { grid-template-columns: repeat(4, 1fr); }
.grid2 label, .grid3 label, .grid4 label { margin: 4px 0; font-size: 0.8rem; }
.ex-head { display: flex; gap: 10px; align-items: flex-start; }
.ex-head h3 { margin: 0; }
.ex-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--sunk); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; }
.last { background: var(--sunk); border-radius: 10px; padding: 6px 10px; color: var(--muted); }
.file input { display: none; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 10px 0; padding: 4px; background: var(--sunk); border: 1px solid var(--line); border-radius: 14px; }
.seg a { text-align: center; padding: 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 700; }
.seg a.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

progress { width: 100%; height: 12px; border-radius: 99px; overflow: hidden; appearance: none; -webkit-appearance: none; border: 0; background: var(--sunk); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08); }
progress::-webkit-progress-bar { background: var(--sunk); border-radius: 99px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 99px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 99px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stats div { background: var(--sunk); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; }
.stats b { display: block; font-size: 1.15rem; }
.stats span { font-size: 0.72rem; color: var(--muted); }
.explain { margin-top: 10px; font-size: 0.86rem; }
.explain summary { cursor: pointer; color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- tricks counter */
.counter .tally { text-align: center; margin: 4px 0 14px; font-weight: 600; }
.counter .sep { color: var(--muted); margin: 0 4px; }
.taps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 128px; border-radius: 20px; border: 0; font: inherit; font-size: 1.25rem; font-weight: 800; cursor: pointer; touch-action: manipulation; transition: transform 0.06s ease; }
.tap .ic { width: 34px; height: 34px; }
.tap.land { background: linear-gradient(180deg, #3cb366, #2a8f4b); color: #fff; box-shadow: 0 8px 18px rgba(47, 158, 85, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.15); }
.tap.miss { background: var(--sunk); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow), inset 0 -3px 0 rgba(0, 0, 0, 0.06); }
.tap:active { transform: scale(0.96) translateY(2px); }
.undo { display: flex; justify-content: space-between; margin-top: 4px; }

/* ---------- timer */
.preset { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; margin: 8px 0; border-radius: 14px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); }
.preset-body { flex: 1; display: flex; flex-direction: column; }
.preset > .ic { color: var(--muted); }
.timer { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tlabel { font-weight: 800; font-size: 1.1rem; min-height: 2.6em; display: flex; align-items: center; }
.ttime { font-size: 4.8rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.05; letter-spacing: -0.03em; }
.timer.break .ttime, .timer.easy .ttime { color: var(--s1); }
.timer.rest .ttime { color: #565cd6; }
.timer.hard .ttime, .timer.work .ttime { color: var(--accent); }
.timer.done .ttime { color: var(--ok); }
.tbtns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.segs { padding-left: 22px; margin: 0 0 12px; }
.segs li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.segs li span { display: inline-block; width: calc(100% - 56px); }
.segs li b { float: right; }
.segs li.break, .segs li.easy, .segs li.rest { color: var(--muted); }

/* ---------- charts */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; }
.chart polyline { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.chart polyline.s0 { stroke: var(--s0); }
.chart polyline.s1 { stroke: var(--s1); }
.chart polyline.dashed { stroke-dasharray: 5 4; stroke-width: 2; }
.chart circle.s0 { fill: var(--s0); }
.chart circle.s1 { fill: var(--s1); }
.legend { display: flex; gap: 14px; font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.legend .k::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 6px; vertical-align: middle; background: var(--s0); }
.legend .k.s1::before { background: var(--s1); }
.legend .k.dashed::before { background: repeating-linear-gradient(90deg, var(--s1) 0 4px, transparent 4px 7px); }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td { padding: 7px 5px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.phases td { white-space: normal; vertical-align: top; }
.phases tr.now td { background: var(--info-bg); }
.phases tr.now td:first-child { border-radius: 10px 0 0 10px; }
.phases tr.now td:last-child { border-radius: 0 10px 10px 0; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 0.92rem; }
.checks li .ic { color: var(--muted); margin-top: 2px; }

/* ---------- guide */
.toc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
.toc a { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; font-size: 0.88rem; }
.guide h2 { display: flex; align-items: center; gap: 10px; }
.guide { scroll-margin-top: 12px; }
.timeline { list-style: none; padding: 0; margin: 12px 0; }
.timeline li { display: grid; grid-template-columns: 56px 32px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .time { font-weight: 800; font-size: 0.8rem; color: var(--accent); padding-top: 6px; }
.timeline p { margin: 2px 0 0; }
.glossary dt { font-weight: 800; margin-top: 12px; }
.glossary dd { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }

/* mock UI used in the guide and tour */
.mock-nav { display: grid; grid-template-columns: repeat(5, 1fr); margin: 8px 0; padding: 6px 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.mock-nav span { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.68rem; font-weight: 700; color: var(--muted); padding: 4px 0; border-radius: 10px; }
.mock-nav span.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); outline: 2px dashed var(--accent); outline-offset: 1px; }
.mock-nav .ic { width: 20px; height: 20px; }
.mock-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; padding: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.mock-input { flex: 1; padding: 8px 10px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--line); font-size: 0.9rem; }
.mock-row .btn, .mock-steps .btn { pointer-events: none; outline: 2px dashed var(--accent); outline-offset: 2px; }
.taps.mini { margin: 8px 0; }
.taps.mini .tap { min-height: 64px; font-size: 1rem; border-radius: 14px; }
.taps.mini .tap .ic { width: 22px; height: 22px; }
.mock-steps { padding: 2px 12px; margin: 10px 0; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: left; }
.mock-timer { margin: 8px 0; padding: 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: center; box-shadow: var(--shadow); }
.mock-timer .tlabel { justify-content: center; min-height: 0; font-size: 0.9rem; }
.mock-timer .ttime { font-size: 2.6rem; color: var(--accent); }
.mock-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.mock-chips .ic { color: var(--muted); }
.mock-chips .chip { color: #fff; }
.chip.violet { background: #7b61ff; } .chip.blue { background: #3b78d8; } .chip.green { background: #2f9e55; }

/* ---------- tour */
.tour { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 10, 14, 0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.tour-card { position: relative; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); border-radius: 24px; padding: 26px 20px 18px; text-align: center; box-shadow: var(--shadow-lg); }
.tour-card h2 { font-size: 1.3rem; margin: 10px 0 4px; }
.tour-card p { color: var(--muted); }
.tour-art { display: flex; justify-content: center; }
.tour-skip { position: absolute; top: 10px; right: 16px; }
.tour-mock { margin: 10px 0 4px; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0 12px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots span.on { width: 22px; border-radius: 99px; background: var(--accent); }
.tour-nav { display: flex; justify-content: space-between; gap: 8px; }
.tour-nav .btn { flex: 1; }

/* ---------- login */
.login { max-width: 420px; margin: 7vh auto 0; text-align: center; }
.login .card { text-align: left; }
.login-logo {
  width: 128px; height: 128px; margin: 0 auto 18px; border-radius: 30px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 100% at 30% 0%, #353a46 0%, #1b1e25 55%, #111318 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.login-logo img { height: 100px; width: auto; display: block; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); }

/* ---------- navigation */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 10;
  width: calc(100% - 24px); max-width: 520px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 22px; padding: 6px; box-shadow: var(--shadow-lg);
}
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; color: var(--muted); text-decoration: none; font-size: 0.72rem; font-weight: 700; border-radius: 16px; }
.nav .ic { width: 24px; height: 24px; }
.nav a.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 0.9rem; font-weight: 600; max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); }
.offline { position: sticky; top: 0; z-index: 30; background: var(--info-bg); color: var(--info-ink); text-align: center; padding: 6px; font-size: 0.85rem; }

@media (max-width: 380px) {
  .hero-num { font-size: 2.6rem; }
  .ttime { font-size: 4rem; }
  .toc { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }

/* ---------- guided training */
.hero-btn { margin-top: 14px; background: #fff; color: var(--accent); border-color: transparent; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.train-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: linear-gradient(180deg, var(--bg) 70%, transparent); padding-bottom: 6px; }
.train-top { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.train-top .next-label { margin: 0; }
.stage-card .next-head { margin-bottom: 4px; }
.stage-card .next-label { margin-bottom: 2px; }
.train-actions { display: flex; justify-content: space-between; gap: 8px; }
.stage-list { list-style: none; padding: 0; margin: 10px 0; }
.stage-list li { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-weight: 600; font-size: 0.92rem; }
.stage-list li:first-child { border-top: 0; }
.stage-list li.done span:nth-child(2) { color: var(--muted); text-decoration: line-through; }
.stage-list li.now { color: var(--accent); }
.rpe-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0 6px; }
.rpe-btn { min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); font: inherit; font-size: 1.15rem; font-weight: 800; cursor: pointer; box-shadow: var(--shadow-sm); }
.rpe-btn:active { background: var(--accent); color: #fff; transform: scale(0.96); }
.done-train h2 { margin-top: 10px; }

/* ---------- session split and tricks inside the timer */
.split-box { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.split-box .chip { color: #fff; }
.chip.red { background: #e24a38; }
.seg-names { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.seg-tricks { width: 100%; margin: 12px 0 4px; text-align: left; border-top: 1px solid var(--line); padding-top: 10px; }
.seg-tricks-head { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.seg-trick { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.seg-trick:first-of-type { border-top: 0; }
.seg-trick-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini { width: 54px; height: 48px; border-radius: 14px; border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; }
.mini .ic { width: 24px; height: 24px; }
.mini.land { background: linear-gradient(180deg, #3cb366, #2a8f4b); color: #fff; box-shadow: 0 4px 10px rgba(47, 158, 85, 0.3); }
.mini.miss { background: var(--sunk); color: var(--text); border: 1px solid var(--line); }
.mini:active { transform: scale(0.94); }

/* ---------- check-in adjustments */
.adjust { border-left: 5px solid #e9a02c; }
.adjust.off { border-left-color: var(--line); box-shadow: var(--shadow-sm); }
.adjust .checks { margin-top: 8px; }
.adjust .checks li .ic { color: #e9a02c; }
.ex.skipped { opacity: 0.55; box-shadow: none; border-style: dashed; }

/* ---------- mobile: no zoom on tap, safe areas, small screens, landscape */
/* iOS zooms into any field under 16px when you tap it; keep every field at 16px. */
input, select, textarea { font-size: 16px !important; }
/* No text selection or callout menus when tapping buttons quickly. */
button, .btn, .tap, .mini, .rpe-btn, .nav a, .preset, .scale .opts span, .seg a, .icon-btn {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.nav { width: calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
.toast { max-width: calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
.tour { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.tour-card { max-height: calc(100dvh - 32px); }
.step-body, .item-body, .preset-body, .next-head > div { overflow-wrap: anywhere; }

/* small phones (iPhone SE, small Androids) */
@media (max-width: 360px) {
  main { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .card { padding: 14px; border-radius: 16px; }
  .hero { padding: 16px; }
  .hero-num { font-size: 2.4rem; }
  .ttime { font-size: 3.6rem; }
  .btn.big { font-size: 1rem; }
  .step { gap: 10px; }
  .step .badge { width: 34px; height: 34px; border-radius: 10px; }
  .step .badge .ic { width: 19px; height: 19px; }
  .step-act .link { display: none; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .rpe-grid { grid-template-columns: repeat(4, 1fr); }
  .scale.rpe .opts { grid-template-columns: repeat(4, 1fr); }
  .timeline li { grid-template-columns: 44px 28px 1fr; gap: 8px; }
  .nav a { font-size: 0.66rem; }
  .tap { min-height: 104px; }
}

/* phones held sideways */
@media (orientation: landscape) and (max-height: 500px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .ttime { font-size: 3.4rem; }
  .tlabel { min-height: 0; }
  .tap { min-height: 84px; }
  .hero-num { font-size: 2.4rem; }
  .login { margin-top: 3vh; }
  .login-logo { width: 96px; height: 96px; border-radius: 24px; }
  .login-logo img { height: 74px; }
  .nav { bottom: max(6px, env(safe-area-inset-bottom)); }
  .nav a { flex-direction: row; justify-content: center; gap: 6px; padding: 6px 0; }
}

/* tablets: a little more room */
@media (min-width: 768px) {
  main { max-width: 720px; padding-top: calc(20px + env(safe-area-inset-top)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
