:root {
  --purple: #68009b;
  --purple-2: #8a2bd1;
  --purple-soft: #f3e9fb;
  --purple-line: #dcc6ee;
  --ink: #0b0a0d;
  --ink-2: #2a2730;
  --muted: #6d6875;
  --line: #e6e3ea;
  --bg: #f6f5f8;
  --card: #ffffff;
  --high: #c0262d;
  --med: #c77700;
  --low: #3c7a3a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11,10,13,.06), 0 6px 20px rgba(11,10,13,.06);
  --head: "Oswald", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--purple); }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--ink); color: #fff;
  border-bottom: 3px solid var(--purple);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-badge { width: 40px; height: 40px; border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.brand-badge img { width: 46px; height: 46px; object-fit: cover; }
.brand-text { font-family: var(--head); font-size: 20px; letter-spacing: .04em; text-transform: uppercase; font-weight: 500; }
.brand-text b { font-weight: 700; color: #c99bf0; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a, .nav button {
  color: #d9d4e0; text-decoration: none; background: none; border: 0; cursor: pointer;
  font-family: var(--head); text-transform: uppercase; letter-spacing: .06em; font-size: 14px;
  padding: 8px 10px; border-radius: 8px;
}
.nav a.active { color: #fff; background: rgba(138,43,209,.35); }
.nav a:hover, .nav button:hover { color: #fff; }

.app { max-width: 880px; margin: 0 auto; padding: 18px 16px 80px; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--head); text-transform: uppercase; letter-spacing: .03em; margin: 0; line-height: 1.1; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
.eyebrow { font-family: var(--head); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--purple); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 6px 0 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.stack > * + * { margin-top: 14px; }

.practice-card { overflow: hidden; }
.practice-card .pc-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.practice-card.purple .pc-head { background: var(--purple); color: #fff; border-bottom: 0; }
.practice-card.white .pc-head { background: #fff; color: var(--ink); border-bottom: 2px solid var(--ink); }
.pc-title { display: flex; flex-direction: column; gap: 2px; }
.pc-title .when { font-size: 13px; opacity: .8; }
.pc-body { padding: 6px 16px 16px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--head); text-transform: uppercase; letter-spacing: .06em; font-size: 12px;
  padding: 4px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap;
}
.chip.purple { background: var(--purple); color: #fff; }
.chip.white { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.chip.done { background: #e7f3e6; color: #285a27; }
.chip.ghost { background: rgba(255,255,255,.18); color: inherit; }
.practice-card.white .chip.ghost { background: var(--bg); }

/* ---------- block timeline ---------- */
.blocks { list-style: none; margin: 0; padding: 0; }
.block { display: grid; grid-template-columns: 62px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.block:last-child { border-bottom: 0; }
.block .time { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 2px; }
.block .time b { display: block; font-size: 18px; color: var(--ink); }
.block h3 { font-size: 16px; }
.block ul { margin: 6px 0 0; padding-left: 18px; }
.block li { margin: 2px 0; }
.block .tech-detail { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.block .tech-detail span { color: var(--muted); }

/* ---------- adjustments ---------- */
.adjust { padding: 14px 16px; border-left: 5px solid var(--purple); }
.adjust h3 { margin-bottom: 8px; }
.adjust-item { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.prio { font-family: var(--head); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #fff; border-radius: 5px; padding: 2px 6px; flex: none; margin-top: 2px; }
.prio.high { background: var(--high); }
.prio.medium { background: var(--med); }
.prio.low { background: var(--low); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--head); text-transform: uppercase; letter-spacing: .07em; font-size: 15px; font-weight: 600;
  padding: 12px 18px; border-radius: 10px;
  background: var(--purple); color: #fff;
  transition: transform .06s ease, background .15s ease;
}
.btn:hover { background: #57007f; }
.btn:active { transform: translateY(1px); }
.btn.dark { background: var(--ink); }
.btn.dark:hover { background: #26222c; }
.btn.light { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.ghost { background: transparent; color: var(--purple); border: 1.5px solid var(--purple-line); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- week view ---------- */
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav button { width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 18px; }
.week-nav button[disabled] { opacity: .35; cursor: default; }
.theme-banner {
  background: var(--ink); color: #fff; border-radius: var(--radius); padding: 18px;
  position: relative; overflow: hidden;
}
.theme-banner::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(138,43,209,.55), rgba(138,43,209,0) 70%);
}
.theme-banner .eyebrow { color: #c99bf0; }
.theme-banner h2 { font-size: 26px; margin-top: 4px; position: relative; z-index: 1; }
.theme-banner p { margin: 6px 0 0; color: #d9d4e0; position: relative; z-index: 1; }

.day-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; cursor: pointer; }
.day-row + .day-detail { border-top: 1px solid var(--line); }
.day-row .left { display: flex; align-items: center; gap: 12px; }
.datebox { width: 52px; text-align: center; border-radius: 10px; padding: 4px 0; background: var(--bg); flex: none; }
.datebox .dow { font-family: var(--head); font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .08em; }
.datebox .dom { font-family: var(--head); font-size: 22px; font-weight: 600; line-height: 1; }
.datebox.today { background: var(--purple); color: #fff; }
.datebox.today .dow { color: #e7d4f7; }
.day-detail { padding: 0 16px 14px; }
.caret { transition: transform .2s; color: var(--muted); }
.open .caret { transform: rotate(90deg); }

.empty { text-align: center; padding: 34px 18px; }
.empty h2 { margin-bottom: 6px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 50% -10%, rgba(138,43,209,.35), transparent 60%), var(--ink); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 26px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-card img { width: 170px; display: block; margin: -8px auto 4px; }
.login-card h1 { text-align: center; font-size: 22px; margin-bottom: 18px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.input, textarea.input {
  width: 100%; padding: 12px 13px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; outline: none;
}
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg); padding: 4px; border-radius: 12px; }
.seg button { border: 0; background: transparent; padding: 10px; border-radius: 9px; cursor: pointer; font-family: var(--head); text-transform: uppercase; letter-spacing: .07em; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }
.error { color: var(--high); font-size: 14px; min-height: 20px; margin: 4px 0 8px; }

/* ---------- run mode (minimal) ---------- */
.run {
  --acc: #b77ff0;
  position: fixed; inset: 0; z-index: 50; background: #0b0a0d; color: #f4f2f7;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.run.white { --acc: #ffffff; }
.run-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 10px; }
.run-top .x { background: none; border: 0; color: #8f8a98; font-size: 15px; cursor: pointer; padding: 6px; white-space: nowrap; }
.run-top .x:hover { color: #fff; }
#rx { font-size: 20px; line-height: 1; }
.run-who { font-size: 13px; color: #8f8a98; letter-spacing: .02em; }
.segs { display: flex; gap: 4px; padding: 0 20px; }
.segs i { height: 3px; background: #26232c; border-radius: 2px; overflow: hidden; }
.segs b { display: block; height: 100%; width: 0; background: var(--acc); transition: width .9s linear; }
.run-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px 24px; overflow: auto; }
.run-step { font-size: 12px; color: #6e6977; letter-spacing: .14em; text-transform: uppercase; }
.run-title { font-family: var(--body); text-transform: none; letter-spacing: -.01em; font-weight: 600; font-size: clamp(26px, 6vw, 40px); margin-top: 6px; }
.run-sub { color: #a8a3b0; font-size: 17px; margin-top: 6px; min-height: 22px; }
.clock { font-family: var(--body); font-weight: 300; font-size: clamp(96px, 27vw, 220px); line-height: 1; letter-spacing: -.04em; margin: 22px 0 8px; font-variant-numeric: tabular-nums; }
.clock.warn { color: #ffcf5c; }
.run-iv { min-height: 44px; display: flex; flex-direction: column; gap: 2px; font-size: 16px; }
.run-iv b { font-weight: 600; }
.run-iv span { color: #a8a3b0; font-variant-numeric: tabular-nums; }
.run-iv span.sw { color: #ffcf5c; }
.ctrls { display: flex; align-items: center; gap: 28px; margin-top: 18px; }
.round { width: 56px; height: 56px; border-radius: 50%; border: 1px solid #2f2b36; background: transparent; color: #d9d5df; font-size: 30px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 4px; }
.round:disabled { opacity: .25; cursor: default; }
.round.play { width: 84px; height: 84px; background: var(--acc); border: 0; color: #0b0a0d; padding: 0; }
.time-adj { display: flex; gap: 10px; margin-top: 22px; }
.time-adj button { background: transparent; border: 1px solid #2f2b36; color: #c9c4d0; border-radius: 999px; padding: 9px 18px; font-size: 14px; cursor: pointer; }
.time-adj button:hover { border-color: #5b5566; color: #fff; }
.run-items { margin-top: 26px; max-width: 460px; width: 100%; color: #a8a3b0; font-size: 15px; }
.run-items ul { list-style: none; margin: 0; padding: 0; }
.run-items li { padding: 3px 0; }
.run-items li.cur { color: #fff; font-weight: 600; }
.run-items p { margin: 6px 0; }
.run-items p span { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #6e6977; margin-bottom: 2px; }
.run-items a { color: var(--acc); }
.run-foot { padding: 12px 20px 18px; border-top: 1px solid #1c1a21; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.upnext { font-size: 14px; color: #8f8a98; }
.upnext b { color: #e6e2eb; font-weight: 600; margin: 0 4px; }
.run-links { display: flex; gap: 16px; }
.run-links button { background: none; border: 0; color: #8f8a98; font-size: 14px; cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #3a3542; }
.run-links button:hover { color: #fff; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 5; }
.run-sheet { background: #16141a; width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 22px 20px calc(16px + env(safe-area-inset-bottom)); max-height: 80vh; overflow: auto; }
.run-sheet h2 { font-family: var(--body); text-transform: none; letter-spacing: 0; font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.order { list-style: none; margin: 0; padding: 0; }
.order li { display: flex; justify-content: space-between; gap: 10px; padding: 11px 4px; border-bottom: 1px solid #24212a; color: #a8a3b0; cursor: pointer; font-size: 15px; }
.order li.cur { color: #fff; font-weight: 600; }
.order li.done { color: #55505d; }
.order li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hint { color: #6e6977; font-size: 13px; }
.adj-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; color: #e6e2eb; }
.sheet-close { margin-top: 14px; width: 100%; background: #24212a; border: 0; color: #fff; padding: 12px; border-radius: 10px; font-size: 15px; cursor: pointer; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(11,10,13,.6); display: grid; place-items: end center; padding: 0; }
@media (min-width: 600px) { .modal-bg { place-items: center; padding: 20px; } }
.modal { background: #fff; color: var(--ink); width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
@media (min-width: 600px) { .modal { border-radius: 18px; } }
.modal h2 { margin-bottom: 4px; }
.rating { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin: 8px 0 4px; }
.rating button { aspect-ratio: 1; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-family: var(--mono); font-weight: 700; font-size: 15px; padding: 0; }
.rating button.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.rating-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ---------- feedback ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px; text-align: center; }
.stat b { display: block; font-family: var(--head); font-size: 30px; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.fb { padding: 14px 16px; }
.fb-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.score { font-family: var(--mono); font-weight: 700; font-size: 20px; }
.fb p { margin: 4px 0; }
.fb .lbl { font-family: var(--head); text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
.fb .good .lbl { color: var(--low); }
.fb .bad .lbl { color: var(--high); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 99; box-shadow: var(--shadow); }
.spinner { padding: 60px 0; text-align: center; color: var(--muted); }

@media (max-width: 520px) {
  .brand-text { display: none; }
  h1 { font-size: 26px; }
  .nav a, .nav button { padding: 8px 7px; font-size: 13px; }
}
@media print {
  .topbar, .btn-row, .week-nav { display: none !important; }
  body { background: #fff; }
}

.countdown { font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: #c99bf0 !important; margin-top: 10px !important; }
.event-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-left: 5px solid var(--ink); }
.event-row .trophy { font-size: 24px; }

/* ---------- printable practice sheet ---------- */
body.print-mode { background: #e9e7ec; }
.print-tools { max-width: 8.5in; margin: 16px auto 0; padding: 0 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sheet {
  --accent: var(--purple);
  width: 8.5in; max-width: calc(100% - 32px); margin: 14px auto 40px; background: #fff; color: var(--ink);
  padding: 0.5in 0.55in; box-shadow: 0 10px 40px rgba(11,10,13,.15); font-size: 12.5px; line-height: 1.35;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.sheet.white { --accent: var(--ink); }
.sh-head { display: grid; grid-template-columns: 74px 1fr auto; gap: 14px; align-items: center; padding-bottom: 12px; border-bottom: 4px solid var(--accent); }
.sh-head img { width: 74px; height: 74px; object-fit: contain; }
.sh-club { font-family: var(--head); text-transform: uppercase; letter-spacing: .14em; font-size: 10.5px; color: var(--purple); font-weight: 600; }
.sh-title h1 { font-size: 30px; margin: 2px 0; }
.sh-title h1 span { font-size: 14px; color: var(--muted); letter-spacing: .1em; vertical-align: middle; margin-left: 6px; }
.sh-date { font-weight: 600; }
.sh-week { text-align: right; background: var(--accent); color: #fff; border-radius: 8px; padding: 8px 12px; max-width: 2.3in; }
.sheet.white .sh-week { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.sh-week b { display: block; font-family: var(--head); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; opacity: .85; }
.sh-week span { font-family: var(--head); text-transform: uppercase; font-size: 15px; letter-spacing: .03em; }
.sh-focus { margin: 10px 0 0; font-style: italic; color: var(--ink-2); }
.sh-adj { margin-top: 12px; border: 1.5px solid var(--ink); border-left: 6px solid var(--high); border-radius: 6px; padding: 8px 12px; }
.sh-adj h2, .sh-notes h2 { font-size: 13px; letter-spacing: .1em; margin-bottom: 6px; }
.sh-adj div { margin: 3px 0; }
.sh-adj .prio { margin-right: 6px; font-size: 9.5px; padding: 1px 5px; }
.sh-note { margin: 10px 0 0; }
.sh-table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.sh-table th { font-family: var(--head); text-transform: uppercase; letter-spacing: .1em; font-size: 10.5px; text-align: left; color: #fff; background: var(--ink); padding: 6px 8px; }
.sh-table td { padding: 8px; border-bottom: 1px solid #d8d4de; vertical-align: top; }
.sh-table tr { break-inside: avoid; }
.sh-table tr.technique td { background: #faf6fd; }
.sheet.white .sh-table tr.technique td { background: #f5f5f5; }
.c-chk { width: 26px; }
.c-time { width: 84px; font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.c-min { width: 40px; text-align: right; font-family: var(--mono); font-weight: 700; font-size: 14px; }
.box { display: inline-block; width: 14px; height: 14px; border: 1.8px solid var(--ink); border-radius: 3px; margin-top: 1px; }
.b-title { font-family: var(--head); text-transform: uppercase; letter-spacing: .05em; font-size: 14px; font-weight: 600; }
.b-title em { font-family: var(--body); text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 11px; color: var(--muted); }
.b-tech { font-weight: 700; font-size: 13.5px; color: var(--purple); margin-top: 2px; }
.sheet.white .b-tech { color: var(--ink); }
.b-sub { margin-top: 2px; color: var(--ink-2); }
.b-list { margin: 3px 0 0; padding: 0; list-style: none; columns: 2; column-gap: 18px; }
.b-list li { padding-left: 12px; position: relative; break-inside: avoid; }
.b-list li::before { content: ""; position: absolute; left: 0; top: .5em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.sh-notes { margin-top: 16px; break-inside: avoid; }
.sh-rate { display: flex; gap: 6px; align-items: center; font-weight: 600; margin-bottom: 4px; }
.sh-rate span { width: 22px; height: 22px; border: 1.5px solid var(--ink); border-radius: 50%; display: inline-grid; place-items: center; font-family: var(--mono); font-size: 10px; font-weight: 700; }
.sh-line { border-bottom: 1px solid #9c97a4; height: 30px; padding-top: 12px; }
.sh-foot { margin-top: 14px; text-align: center; font-size: 10px; color: var(--muted); letter-spacing: .06em; }

@media print {
  @page { size: letter; margin: 0.4in; }
  body.print-mode { background: #fff; }
  .print-tools { display: none !important; }
  .sheet { width: auto; max-width: none; margin: 0; padding: 0; box-shadow: none; }
}
@media (max-width: 600px) {
  .sheet { padding: 18px 14px; }
  .sh-head { grid-template-columns: 54px 1fr; }
  .sh-head img { width: 54px; height: 54px; }
  .sh-week { grid-column: 1 / -1; text-align: left; max-width: none; }
  .b-list { columns: 1; }
}
