/* ===== Atemp — Create Plan page ===== */
.mp-page {
  --accent: var(--brand);
  --accent-soft: rgb(64 147 247 / 16%);
  --hard-soft: rgb(214 82 88 / 16%);
  --card: rgb(22 22 24 / 78%);
  --line: #2A2A2E;
  /* phase colours: validated categorical slots 1–4 for dark surfaces */
  --ph-base: #3A78C6; --ph-build: #E8823F; --ph-peak: #D65258; --ph-taper: #2FA6B5;
}
.mp { position: relative; z-index: 1; width: min(1080px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 120px; }

/* crumbs */
.mp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 44px; color: var(--muted); font-size: 13px; }
.mp-crumbs a { transition: color .2s ease; }
.mp-crumbs i { font-style: normal; opacity: .6; }
.mp-crumbs span { color: var(--bright); }
.mp-hero .mp-back { margin-bottom: 22px; }
.mp-back { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; padding: 7px 14px 7px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--bright); font-weight: 500; transition: background .2s ease, border-color .2s ease, transform .3s cubic-bezier(.3,1.5,.5,1); }
.mp-back svg { width: 14px; height: 14px; }
.mp-back:hover { border-color: #3A3A3F; background: rgb(255 255 255 / 5%); transform: translateX(-2px); }

/* hero */
.mp-hero { max-width: 680px; margin-bottom: 36px; }
.mp-eyebrow { margin: 0 0 10px; color: var(--brand-ink); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.mp-brand { display: flex; align-items: center; gap: 16px; }
.mp-logo { display: block; width: 56px; height: 56px; flex: none; border-radius: 14px; box-shadow: 0 0 0 1px rgb(255 255 255 / 10%), 0 10px 28px -10px rgb(64 147 247 / 55%); }
.mp-tagline { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.mp-hero h1 { margin: 0; color: var(--bright); font-size: clamp(30px, 5vw, 44px); font-weight: 700; letter-spacing: -.035em; line-height: 1.08; }
.mp-lead { margin: 14px 0 0; font-size: 15.5px; line-height: 1.75; }
.mp-privacy { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); font-size: 12.5px; }
.mp-privacy svg { width: 14px; height: 14px; }

/* buttons */
.mp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid #333338; border-radius: 10px; background: rgb(255 255 255 / 4%); color: var(--bright); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.mp-btn svg { width: 15px; height: 15px; flex: none; }
.mp-btn:hover:not(:disabled) { border-color: #4A4A50; background: rgb(255 255 255 / 8%); }
.mp-btn:active:not(:disabled) { transform: scale(.98); }
.mp-btn:disabled { opacity: .35; cursor: default; }
.mp-btn-primary { border-color: var(--brand-strong); background: var(--brand-strong); color: #fff; }
.mp-btn-primary:hover:not(:disabled) { border-color: #2A7BE6; background: #2A7BE6; }
.mp-btn-block { width: 100%; }
.mp-page :focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; }

/* form */
.mp-form { display: grid; gap: 16px; }
.mp-group { min-width: 0; margin: 0; padding: 22px 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.mp-group legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; float: left; width: 100%; margin-bottom: 18px; padding: 0; color: var(--bright); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.mp-group legend + * { clear: both; }
.mp-group legend em { color: var(--muted); font-size: 12.5px; font-style: normal; font-weight: 400; }
.mp-step { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: #F2A3A7; font-size: 12px; font-weight: 700; }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 16px; }
.mp-field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.mp-field[hidden] { display: none; }
.mp-field > span { color: var(--bright); font-size: 13px; font-weight: 500; }
.mp-field small { color: var(--muted); font-size: 11.5px; }
.mp-field input, .mp-field select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #303035; border-radius: 10px; background: #111113; color: var(--bright); font: inherit; font-size: 14.5px; font-variant-numeric: tabular-nums; transition: border-color .15s ease, box-shadow .15s ease; }
.mp-field select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%238E8E93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: right 10px center; background-repeat: no-repeat; background-size: 16px; }
.mp-field input::placeholder { color: #55555B; }
.mp-field input:hover, .mp-field select:hover { border-color: #45454B; }
.mp-field input:focus, .mp-field select:focus { border-color: #6A6A70; outline: none; box-shadow: 0 0 0 3px rgb(255 255 255 / 8%); }
.mp-field input[type="date"] { color-scheme: dark; }
.mp-field.is-invalid input, .mp-field.is-invalid select { border-color: var(--hard); }
.mp-field-error { color: #F2A3A7 !important; }
.mp-weeks { margin: 16px 0 0; color: var(--text); font-size: 13.5px; }
.mp-weeks:empty { display: none; }
.mp-weeks b { color: var(--bright); }
.mp-weeks.is-short b { color: #F2A3A7; }

.mp-choices { display: flex; flex-wrap: wrap; gap: 18px 28px; }
.mp-sec { display: grid; gap: 20px; padding-top: 26px; margin-top: 26px; border-top: 1px solid var(--line, #26262b); }
.mp-sec:first-of-type { padding-top: 0; margin-top: 22px; border-top: 0; }
.mp-sec > header { display: grid; gap: 4px; }
.mp-sec h3 { margin: 0; color: var(--bright); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.mp-sec header p { margin: 0; color: var(--muted); font-size: 13px; }
.mp-sec .mp-cols { gap: 24px 40px; }
.mp-sec .mp-mini-wrap { margin-top: 4px; }
.mp-choice { display: grid; gap: 8px; }
.mp-choice > span { color: var(--bright); font-size: 13px; font-weight: 500; }
.mp-seg { display: inline-flex; height: 38px; padding: 3px; border: 1px solid #303035; border-radius: 10px; background: #111113; }
.mp-seg label { position: relative; }
.mp-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mp-seg b { display: grid; min-width: 40px; height: 100%; place-items: center; padding: 0 12px; border-radius: 7px; color: var(--muted); font-size: 13.5px; font-weight: 500; transition: background .15s ease, color .15s ease; }
.mp-seg input:checked + b { background: #2A2A2F; color: var(--bright); box-shadow: 0 1px 0 rgb(255 255 255 / 6%) inset; }
.mp-seg input:focus-visible + b { outline: 2px solid var(--bright); outline-offset: 1px; }
.mp-seg label:hover b { color: var(--bright); }

.mp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.mp-error { flex-basis: 100%; margin: 0; color: #F2A3A7; font-size: 13px; }
.mp-error:empty { display: none; }

/* ===== form controls ===== */
.mp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 40px; align-items: start; }
.mp-start { margin-top: 10px; }
.mp-start-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.mp-start-panel .mp-date { position: relative; width: 190px; }
.mp-start-panel .mp-date > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.mp-link { padding: 0; border: 0; background: none; color: var(--brand-ink); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
.mp-link:hover { color: var(--bright); }
.mp-link[hidden], .mp-start-panel[hidden] { display: none; }
.mp-race-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.mp-race-row .mp-pills { flex: none; }
.mp-or { color: var(--muted); font-size: 13px; }
.mp-race-row .mp-date { position: relative; flex: none; width: 190px; }
.mp-race-row .mp-date > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 720px) {
  .mp-race-row .mp-pills { flex: 1 1 100%; }
  .mp-race-row .mp-or { display: none; }
  .mp-race-row .mp-date { flex: 1 1 100%; width: auto; }
  .mp-slider .mp-s-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}
.mp-group[data-wiz="0"] > .mp-cols { grid-template-columns: 1fr; gap: 32px; }
.mp-ctl { display: grid; gap: 10px; min-width: 0; align-content: start; }
.mp-label { color: var(--bright); font-size: 13px; font-weight: 500; }
.mp-ctl.is-invalid .mp-field input { border-color: var(--hard); }
.mp-ctl.is-invalid .mp-pills { box-shadow: 0 0 0 1px var(--hard); border-radius: 12px; }
.mp-date { max-width: 260px; }
.mp-date > span { color: var(--muted); font-weight: 400; }

/* pills */
.mp-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-pill, .mp-pills label span { display: inline-flex; align-items: baseline; gap: 5px; min-height: 40px; padding: 0 16px; align-items: center; border: 1px solid #303035; border-radius: 999px; background: #111113; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
.mp-pill { justify-content: center; padding: 0 14px; gap: 4px; }
.mp-pill b { color: var(--bright); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mp-pill:hover, .mp-pills label:hover span { border-color: #4A4A50; color: var(--bright); }
.mp-pill:active, .mp-pills label:active span { transform: scale(.97); }
.mp-pill[aria-pressed="true"], .mp-pills input:checked + span { border-color: var(--accent); background: rgb(64 147 247 / 14%); color: var(--bright); }
.mp-pills label { position: relative; }
.mp-pills input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mp-pills input:focus-visible + span, .mp-pill:focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; }
.mp-pills-sm label span { padding: 0 14px; min-height: 38px; }
.mp-seg-wide { display: flex; width: 100%; max-width: 440px; margin-bottom: 20px; }
.mp-seg-wide label { flex: 1; }
.mp-seg-wide b { width: 100%; padding: 0 8px; font-size: 13px; }
.mp-seg-wide b { display: flex; align-items: center; justify-content: center; gap: 5px; text-align: center; }
.mp-seg b .mp-star { flex: none; width: 12px; height: 12px; color: var(--brand); }
.mp-fit-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.mp-fit-note svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }
.mp-fit-note.is-best { color: var(--text); }
.mp-fit-note.is-best svg { color: var(--brand); }
.mp-fit-note.is-best b { color: var(--bright); font-weight: 600; }
.mp-panelx { display: grid; gap: 18px; max-width: 560px; animation: mp-in .3s ease both; }
.mp-panelx[hidden] { display: none; }

/* slider */
.mp-slider { --fill: var(--accent); display: grid; gap: 4px; min-width: 0; align-content: start; }
.mp-s-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mp-s-head label { color: var(--bright); font-size: 13px; font-weight: 500; }
.mp-s-right { display: inline-flex; align-items: baseline; gap: 10px; }
.mp-s-val { color: var(--bright); font-size: 22px; font-weight: 600; letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-slider.is-unset .mp-s-val, .mp-slider.is-off .mp-s-val { color: var(--muted); font-size: 16px; font-weight: 500; letter-spacing: 0; }
.mp-s-clear { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
.mp-s-clear:hover { color: var(--bright); }
.mp-s-row { display: flex; align-items: center; gap: 10px; }
.mp-s-track { flex: 1; min-width: 0; }
.mp-s-step { display: grid; width: 34px; height: 34px; flex: none; place-items: center; padding: 0 0 2px; border: 1px solid #333338; border-radius: 50%; background: rgb(255 255 255 / 3%); color: var(--bright); font-size: 18px; line-height: 1; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.mp-s-step:hover:not(:disabled) { border-color: #55555B; background: rgb(255 255 255 / 8%); }
.mp-s-step:disabled { opacity: .3; cursor: default; }
.mp-slider input[type="range"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 32px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.mp-slider input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--fill) var(--pct), #2E2E33 var(--pct)); }
.mp-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgb(64 147 247 / 30%), 0 2px 8px rgb(0 0 0 / 55%); transition: box-shadow .15s ease, transform .15s ease; }
.mp-slider input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: #2E2E33; }
.mp-slider input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--fill); }
.mp-slider input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgb(64 147 247 / 30%), 0 2px 8px rgb(0 0 0 / 55%); }
.mp-slider input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); box-shadow: 0 0 0 7px rgb(64 147 247 / 26%), 0 2px 8px rgb(0 0 0 / 55%); }
.mp-slider input[type="range"]:focus-visible { outline: none; }
.mp-slider input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #0A0B0E, 0 0 0 5px #fff; }
.mp-slider input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px #0A0B0E, 0 0 0 5px #fff; }
.mp-slider.is-unset { --fill: #55555B; }
.mp-slider.is-unset input[type="range"]::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgb(255 255 255 / 10%), 0 2px 8px rgb(0 0 0 / 55%); opacity: .75; }
.mp-slider.is-off { opacity: .45; }
.mp-slider.is-off input[type="range"] { cursor: not-allowed; }
.mp-s-scale { display: flex; justify-content: space-between; padding: 0 2px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.mp-slider.is-fine .mp-s-scale { padding: 0 44px; }
.mp-s-right:has(.is-inline) { align-items: center; gap: 14px; }
.mp-slider { gap: 14px; }
.mp-slider .mp-s-val { font-size: 16px; }
.mp-slider .mp-s-scale { margin-top: -6px; }
.mp-s-hint.is-inline { order: 2; min-height: 0; padding-left: 14px; border-left: 1px solid #3A3A40; font-size: 16px; font-weight: 400; letter-spacing: -.025em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-s-hint.is-inline:empty { padding: 0; border: 0; }
.mp-slider:has(.is-inline) .mp-s-val { order: 1; }
.mp-s-hint { min-height: 1.4em; color: var(--muted); font-size: 12px; }

/* stepper */
.mp-st-row { display: flex; align-items: center; gap: 14px; }
.mp-stepper { display: inline-flex; align-items: center; height: 38px; padding: 3px; border: 1px solid #303035; border-radius: 10px; background: #111113; }
.mp-stepper button { display: grid; width: 30px; height: 30px; place-items: center; padding: 0 0 2px; border: 0; border-radius: 7px; background: rgb(255 255 255 / 5%); color: var(--bright); font-size: 18px; line-height: 1; cursor: pointer; transition: background .15s ease, transform .15s ease; touch-action: manipulation; user-select: none; }
.mp-stepper button:hover:not(:disabled) { background: rgb(255 255 255 / 10%); }
.mp-stepper button:active:not(:disabled) { transform: scale(.94); }
.mp-stepper button:disabled { opacity: .3; cursor: default; }
.mp-st-val { display: flex; align-items: baseline; justify-content: center; gap: 4px; min-width: 86px; padding: 0 8px; border-radius: 7px; color: var(--bright); line-height: 1.1; }
.mp-st-val b { font-size: 15px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.mp-st-val small { color: var(--muted); font-size: 12px; }
.mp-st-val:focus-visible { outline: 2px solid var(--bright); outline-offset: 1px; }

/* switch */
.mp-switch { display: inline-flex; align-items: center; gap: 12px; width: max-content; max-width: 100%; margin-top: 2px; color: var(--text); font-size: 13.5px; cursor: pointer; }
.mp-switch input { position: absolute; opacity: 0; }
.mp-switch i { position: relative; width: 42px; height: 24px; flex: none; border-radius: 999px; background: #2E2E33; transition: background .2s ease; }
.mp-switch i::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 50%); content: ""; transition: transform .2s cubic-bezier(.3,1.4,.5,1); }
.mp-switch input:checked + i { background: var(--accent); }
.mp-switch input:checked + i::after { transform: translateX(18px); }
.mp-switch input:focus-visible + i { outline: 2px solid var(--bright); outline-offset: 2px; }

/* fine-tune drawer */
.mp-more { margin-top: 22px; border-top: 1px solid var(--line); }
.mp-more summary { display: flex; align-items: baseline; gap: 10px; padding: 16px 0; color: var(--bright); font-size: 14px; font-weight: 500; list-style: none; cursor: pointer; }
.mp-more summary::-webkit-details-marker { display: none; }
.mp-more summary::before { width: 8px; height: 8px; margin-right: 2px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; content: ""; transform: translateY(-2px) rotate(-45deg); transition: transform .2s ease; }
.mp-more[open] summary::before { transform: translateY(-3px) rotate(45deg); }
.mp-more summary em { color: var(--muted); font-size: 12.5px; font-style: normal; font-weight: 400; }
.mp-more .mp-cols { padding-bottom: 6px; }

/* week preview */
.mp-mini-wrap { display: grid; gap: 10px; margin-top: 24px; }
.mp-mini { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.mp-mini-d { display: grid; justify-items: center; gap: 2px; padding: 10px 4px 9px; border: 1px solid var(--line); border-top: 3px solid #3A3A3F; border-radius: 10px; background: rgb(17 17 19 / 70%); text-align: center; transition: border-color .2s ease, background .2s ease; }
.mp-mini-d b { color: var(--bright); font-size: 13px; }
.mp-mini-d .mp-lbl { color: var(--text); font-size: 11.5px; white-space: nowrap; }
.mp-mini-d .mp-short, .mp-mini-d .mp-dot { display: none; }
.mp-mini-d.t-run { border-top-color: var(--ph-base); }
.mp-mini-d.t-quality { border-top-color: var(--hard); }
.mp-mini-d.t-long { border-top-color: #8C76FF; }
.mp-mini-d.t-strength { border-top-color: #fff; }
.mp-mini-d.t-rest { background: transparent; }
.mp-mini-d.t-rest .mp-lbl { color: var(--muted); }

@media (max-width: 760px) {
  .mp-cols { grid-template-columns: 1fr; gap: 24px; }
  .mp-seg-wide { max-width: none; }
}
@media (max-width: 640px) {
  .mp-pills-sm label span { padding: 0 11px; }
  .mp-mini-d .mp-lbl { font-size: 10.5px; }
  .mp-mini-d .mp-x, .mp-mini-d .mp-full { display: none; }
  .mp-mini-d .mp-short { display: inline; }
  .mp-mini-d .mp-dot { display: inline-block; width: 5px; height: 5px; margin-left: 3px; border-radius: 50%; background: #fff; vertical-align: 1px; }
}

/* ===== wizard: progress + one step at a time ===== */
.mp-progress-wrap { margin-bottom: 18px; }
.mp-progress-now { display: none; margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.mp-progress { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; }
.mp-progress li { display: flex; align-items: center; flex: 1; min-width: 0; }
.mp-progress li:last-child { flex: none; }
.mp-progress li::after { flex: 1; min-width: 20px; height: 2px; margin: 0 16px; border-radius: 2px; background: #2A2A2E; content: ""; transition: background .3s ease; }
.mp-progress li:last-child::after { display: none; }
.mp-progress li.is-done::after { background: var(--accent); }
.mp-progress button { display: flex; align-items: center; gap: 12px; padding: 4px 6px 4px 0; border: 0; border-radius: 12px; background: none; color: var(--muted); font: inherit; text-align: left; cursor: pointer; }
.mp-progress button:disabled { cursor: default; }
.mp-progress button:not(:disabled):hover .mp-pdot { border-color: #77777D; }
.mp-pdot { position: relative; display: grid; width: 34px; height: 34px; flex: none; place-items: center; border: 1.5px solid #3A3A3F; border-radius: 50%; background: #111113; color: var(--muted); font-size: 13px; font-weight: 600; transition: background .25s ease, border-color .25s ease, color .25s ease, transform .3s cubic-bezier(.3,1.5,.5,1); }
.mp-pdot em { font-style: normal; font-variant-numeric: tabular-nums; }
.mp-pdot svg { position: absolute; width: 16px; height: 16px; opacity: 0; transform: scale(.5); transition: opacity .2s ease, transform .3s cubic-bezier(.3,1.6,.5,1); }
.mp-ptext { display: grid; gap: 1px; }
.mp-ptext b { font-size: 13.5px; font-weight: 600; }
.mp-ptext small { color: var(--muted); font-size: 11.5px; }
.mp-progress li.is-current .mp-pdot { border-color: var(--bright); background: var(--bright); color: #0A0B0E; transform: scale(1.06); }
.mp-progress li.is-current .mp-ptext b, .mp-progress li.is-done .mp-ptext b { color: var(--bright); }
.mp-progress li.is-done .mp-pdot { border-color: var(--accent); background: var(--accent); color: #fff; }
.mp-progress li.is-done .mp-pdot em { opacity: 0; }
.mp-progress li.is-done .mp-pdot svg { opacity: 1; transform: none; }
.mp-progress button:focus-visible { outline: 2px solid var(--bright); outline-offset: 3px; }

.mp-group[data-wiz] { padding: 28px 28px 30px; }
.mp-group[data-wiz][hidden] { display: none; }
.mp-group[data-wiz]:focus { outline: none; }
.mp-group[data-wiz].from-next { animation: mp-from-next .38s cubic-bezier(.2,.8,.2,1) both; }
.mp-group[data-wiz].from-prev { animation: mp-from-prev .38s cubic-bezier(.2,.8,.2,1) both; }
@keyframes mp-from-next { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes mp-from-prev { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
.mp-group[data-wiz] legend { display: grid; gap: 6px; margin-bottom: 26px; font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.mp-group[data-wiz] legend em { color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: 0; }

.mp-actions { justify-content: space-between; margin-top: 4px; }
.mp-actions-l, .mp-actions-r { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mp-actions-r { margin-left: auto; }
.mp-btn[hidden] { display: none; }
.mp-btn-ghost { border-color: transparent; background: none; color: var(--muted); }
.mp-btn-ghost:hover:not(:disabled) { border-color: transparent; background: rgb(255 255 255 / 5%); color: var(--bright); }
.mp-btn-sm { min-height: 36px; padding: 6px 14px 6px 10px; font-size: 13px; }
.mp-btn-sm svg { width: 14px; height: 14px; }
#mpWizard[hidden] { display: none; }
#mpWizard[hidden] + .mp-result { margin-top: 12px; }

@media (max-width: 640px) {
  .mp-progress-now { display: block; }
  .mp-ptext { display: none; }
  .mp-progress li::after { margin: 0 10px; }
  .mp-group[data-wiz] { padding: 20px 18px 24px; }
  .mp-group[data-wiz] legend { font-size: 20px; }
  .mp-actions-r { flex: 1; }
  .mp-actions-r .mp-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .mp-group[data-wiz].from-next, .mp-group[data-wiz].from-prev { animation: none; } }

/* ===== result ===== */
.mp-result { margin-top: 64px; scroll-margin-top: 84px; }
.mp-summary { padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.mp-sum-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.mp-sum-dates { color: var(--muted); font-size: 13px; }
.mp-verdict { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.mp-verdict.is-good { background: rgb(48 164 108 / 16%); color: #7FD8A8; }
.mp-verdict.is-warn { background: rgb(201 133 0 / 18%); color: #F0C064; }
.mp-verdict.is-risk { background: var(--hard-soft); color: #F2A3A7; }
.mp-ico { width: 15px; height: 15px; flex: none; }
.mp-summary h2 { margin: 16px 0 6px; color: var(--bright); font-size: clamp(22px, 3.2vw, 28px); font-weight: 700; letter-spacing: -.03em; }
.mp-sum-text { max-width: 720px; margin: 0; font-size: 14.5px; line-height: 1.7; }
.mp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 22px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.mp-stats div { display: grid; gap: 4px; padding: 14px 16px; background: #121214; }
.mp-stats dt { color: var(--muted); font-size: 12px; }
.mp-stats dd { margin: 0; color: var(--bright); font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mp-stats small { color: var(--muted); font-size: 11.5px; }
.mp-source { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; }
.mp-notes { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.mp-notes li { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgb(255 255 255 / 2%); font-size: 13.5px; line-height: 1.55; }
.mp-notes .mp-ico { margin-top: 2px; }
.mp-notes .is-good .mp-ico { color: #7FD8A8; }
.mp-notes .is-warn .mp-ico { color: #F0C064; }
.mp-notes .is-risk .mp-ico { color: #F2A3A7; }
.mp-notes .is-info .mp-ico { color: #8FB8EE; }

.mp-toolbar { position: sticky; z-index: 5; top: 68px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 18px; padding: 10px 0; background: linear-gradient(#0A0B0E 70%, rgb(10 11 14 / 0)); }
.mp-tabs { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #111113; }
.mp-tabs button { min-height: 38px; padding: 0 18px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s ease, color .15s ease; }
.mp-tabs button:hover { color: var(--bright); }
.mp-tabs button[aria-selected="true"] { background: #2A2A2F; color: var(--bright); }
.mp-panel { animation: mp-in .35s ease both; }
@keyframes mp-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mp-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.mp-card-head { margin-bottom: 16px; }
.mp-card-head h3 { margin: 0; color: var(--bright); font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.mp-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.mp-two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.mp-small { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.mp-scroll { overflow-x: auto; }

/* chart */
.mp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 14px; padding: 0; list-style: none; color: var(--text); font-size: 12.5px; }
.mp-legend li { display: inline-flex; align-items: center; gap: 7px; }
.mp-swatch { display: inline-block; width: 10px; height: 10px; flex: none; border-radius: 3px; }
.mp-swatch.is-base { background: var(--ph-base); } .mp-swatch.is-build { background: var(--ph-build); }
.mp-swatch.is-peak { background: var(--ph-peak); } .mp-swatch.is-taper { background: var(--ph-taper); }
.mp-swatch.is-cut { background: #8E8E93; opacity: .45; }
.mp-chart { position: relative; height: 240px; margin-left: 30px; }
.mp-grid-y { position: absolute; inset: 0 0 24px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.mp-grid-y span { position: relative; height: 0; border-top: 1px solid #232327; }
.mp-grid-y em { position: absolute; right: calc(100% + 8px); top: -8px; color: var(--muted); font-size: 11px; font-style: normal; font-variant-numeric: tabular-nums; }
.mp-bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.mp-bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; padding: 0 0 24px; border: 0; background: none; cursor: pointer; }
.mp-bar i { font-style: normal; position: relative; display: block; width: min(24px, calc(100% - 2px)); border-radius: 4px 4px 0 0; transition: filter .15s ease, opacity .15s ease; }
.mp-bar.is-base i { background: var(--ph-base); } .mp-bar.is-build i { background: var(--ph-build); }
.mp-bar.is-peak i { background: var(--ph-peak); } .mp-bar.is-taper i { background: var(--ph-taper); }
.mp-bar.is-cut i { opacity: .5; }
.mp-bars:hover .mp-bar:not(.is-hover) i { opacity: .45; }
.mp-bars:hover .mp-bar.is-cut:not(.is-hover) i { opacity: .25; }
.mp-bar.is-hover i { filter: brightness(1.12); opacity: 1; }
.mp-bar:focus-visible { outline: none; }
.mp-bar:focus-visible i { outline: 2px solid var(--bright); outline-offset: 2px; }
.mp-bar-val, .mp-bar-flag { position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); color: var(--bright); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.mp-bar-flag { padding: 1px 6px; border-radius: 4px; background: var(--bright); color: #0B0B0C; font-size: 10px; }
.mp-bar-x { position: absolute; bottom: 4px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.mp-axis-x { margin: 2px 0 0 30px; color: var(--muted); font-size: 11px; text-align: center; }
.mp-tip { position: absolute; top: -12px; z-index: 2; max-width: 280px; padding: 8px 11px; border: 1px solid #333338; border-radius: 9px; background: #1C1C1F; box-shadow: 0 10px 24px rgb(0 0 0 / 45%); color: var(--bright); font-size: 12px; line-height: 1.45; pointer-events: none; }
.mp-table-toggle { margin-top: 14px; font-size: 13px; }
.mp-table-toggle summary { width: max-content; color: var(--muted); cursor: pointer; }
.mp-table-toggle summary:hover { color: var(--bright); }
.mp-table-toggle .mp-table { margin-top: 10px; }

.mp-phases { display: grid; gap: 4px; margin: 6px 0 0 30px; padding: 0; list-style: none; }
.mp-phases li { min-width: 0; padding-top: 8px; border-top: 3px solid var(--c); border-radius: 2px; }
.mp-phases li.is-base { --c: var(--ph-base); } .mp-phases li.is-build { --c: var(--ph-build); }
.mp-phases li.is-peak { --c: var(--ph-peak); } .mp-phases li.is-taper { --c: var(--ph-taper); }
.mp-phases li { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.mp-phases b { color: var(--bright); font-size: 13px; font-weight: 600; }
.mp-phases small { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; }
.mp-phases small::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }
.mp-phases li { transition: opacity .18s ease; }
.mp-phases.is-dim li:not(.is-on), .mp-phases:hover li:not(:hover) { opacity: .4; }
.mp-phases p { flex-basis: 100%; margin: 4px 0 0; font-size: 12px; line-height: 1.45; opacity: 0; transform: translateY(-3px); transition: opacity .18s ease, transform .18s ease; }
.mp-phases li.is-on p, .mp-phases li:hover p { opacity: 1; transform: none; }

.mp-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.mp-table th, .mp-table td { padding: 10px 10px; border-bottom: 1px solid #232327; text-align: left; vertical-align: top; }
.mp-table thead th { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.mp-table tbody th { color: var(--bright); font-weight: 500; white-space: nowrap; }
.mp-table td { white-space: nowrap; }
.mp-table td:last-child { white-space: normal; color: var(--muted); }
.mp-table tr:last-child > * { border-bottom: 0; }
.mp-table-zones td { text-align: right; color: var(--bright) !important; }
.mp-z { display: inline-grid; width: 30px; height: 20px; margin-right: 10px; place-items: center; border-radius: 5px; background: rgb(255 255 255 / 7%); color: var(--bright); font-size: 11px; font-weight: 600; }

/* nav row (month & week) */
.mp-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mp-nav-title { text-align: center; }
.mp-nav-title h3 { margin: 0; color: var(--bright); font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.mp-nav-title h3 span { color: var(--muted); font-weight: 400; }
.mp-nav-title p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.mp-icon-btn { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border: 1px solid #333338; border-radius: 50%; background: rgb(255 255 255 / 3%); color: var(--bright); cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.mp-icon-btn svg { width: 16px; height: 16px; }
.mp-icon-btn:hover:not(:disabled) { border-color: #4A4A50; background: rgb(255 255 255 / 8%); }
.mp-icon-btn:disabled { opacity: .3; cursor: default; }

/* day-type tags */
.mp-tag { display: inline-block; padding: 2px 7px; border-radius: 5px; background: rgb(255 255 255 / 7%); color: var(--bright); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.mp-tag.t-quality, .mp-tag.t-test { background: var(--hard-soft); color: #F2A3A7; }
.mp-tag.t-long { background: rgb(124 96 255 / 20%); color: #C9BEFF; }
.mp-tag.t-strength { background: var(--bright); color: #0B0B0C; }
.mp-tag.t-rest, .mp-tag.t-off { background: none; box-shadow: inset 0 0 0 1px #3A3A3F; color: var(--muted); }
.mp-tag.t-race { background: linear-gradient(90deg, #D65258, #E8823F); color: #fff; }
.mp-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }

/* month grid */
.mp-month { display: grid; gap: 6px; }
.mp-mrow { display: grid; grid-template-columns: 74px repeat(7, minmax(0, 1fr)); gap: 6px; }
.mp-mhead span { padding: 0 4px; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.mp-wk { display: grid; align-content: center; gap: 1px; padding: 8px; border: 1px solid var(--line); border-left: 3px solid; border-radius: 10px; background: #111113; color: var(--bright); font: inherit; text-align: left; }
.mp-wk.is-base { border-left-color: var(--ph-base); } .mp-wk.is-build { border-left-color: var(--ph-build); }
.mp-wk.is-peak { border-left-color: var(--ph-peak); } .mp-wk.is-taper { border-left-color: var(--ph-taper); }
.mp-wk b { font-size: 13px; } .mp-wk small { color: var(--muted); font-size: 11px; }
.mp-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; min-height: 104px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: rgb(17 17 19 / 85%); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.mp-cell:hover { border-color: #44444A; background: #18181B; transform: translateY(-1px); }
.mp-cell.is-out { opacity: .32; }
.mp-cell.is-today { border-color: var(--bright); }
.mp-cell.t-rest, .mp-cell.t-off { background: transparent; }
.mp-cell.t-race { border-color: var(--hard); background: rgb(214 82 88 / 10%); }
.mp-cell-date { color: var(--bright); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mp-cell-title { display: -webkit-box; overflow: hidden; color: var(--text); font-size: 12px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.mp-cell-km { margin-top: auto; color: var(--bright); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* week view */
.mp-chips { display: flex; gap: 6px; margin-bottom: 16px; padding-bottom: 6px; overflow-x: auto; scrollbar-width: thin; }
.mp-chip { flex: none; min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-bottom: 3px solid; border-radius: 9px; background: #111113; color: var(--muted); font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: pointer; }
.mp-chip.is-base { border-bottom-color: var(--ph-base); } .mp-chip.is-build { border-bottom-color: var(--ph-build); }
.mp-chip.is-peak { border-bottom-color: var(--ph-peak); } .mp-chip.is-taper { border-bottom-color: var(--ph-taper); }
.mp-chip:hover { color: var(--bright); }
.mp-chip.is-on { background: #2A2A2F; color: var(--bright); font-weight: 600; }
.mp-week-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; margin-bottom: 18px; font-size: 13px; }
.mp-week-meta b { color: var(--bright); }
.mp-week-meta .mp-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--bright); font-size: 12px; font-weight: 600; }
.mp-week-meta .mp-pill::before { width: 8px; height: 8px; border-radius: 2px; content: ""; }
.mp-pill.is-base::before { background: var(--ph-base); } .mp-pill.is-build::before { background: var(--ph-build); }
.mp-pill.is-peak::before { background: var(--ph-peak); } .mp-pill.is-taper::before { background: var(--ph-taper); }
.mp-focus { color: var(--muted); }
.mp-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.mp-daycard { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 12.5px; line-height: 1.5; }
.mp-daycard.is-today { border-color: var(--bright); }
.mp-daycard.t-rest, .mp-daycard.t-off { background: rgb(17 17 19 / 50%); }
.mp-daycard.t-race { border-color: var(--hard); }
.mp-daycard header { display: grid; gap: 1px; }
.mp-dow { color: var(--bright); font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.mp-date { color: var(--muted); font-size: 11.5px; }
.mp-band { padding: 5px 8px; border-radius: 6px; background: var(--ph-base); background: rgb(57 135 229 / 22%); color: #B9D4F6; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.mp-band.t-quality, .mp-band.t-test { background: var(--hard-soft); color: #F2A3A7; }
.mp-band.t-long { background: rgb(124 96 255 / 22%); color: #C9BEFF; }
.mp-band.t-strength { background: var(--bright); color: #0B0B0C; }
.mp-band.t-rest, .mp-band.t-off { background: #1C1C1F; color: var(--muted); }
.mp-band.t-race { background: linear-gradient(90deg, #D65258, #E8823F); color: #fff; }
.mp-day-title { margin: 0; color: var(--bright); font-size: 13.5px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }
.mp-lines { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.mp-lines li { position: relative; padding-left: 11px; }
.mp-lines li::before { position: absolute; top: .62em; left: 0; width: 4px; height: 4px; border-radius: 50%; background: #55555B; content: ""; }
.mp-targets { display: grid; gap: 6px; margin: 0; }
.mp-targets div { padding: 7px 9px; border-radius: 8px; background: rgb(255 255 255 / 4%); }
.mp-targets dt { color: var(--muted); font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.mp-targets dd { margin: 1px 0 0; color: var(--bright); font-variant-numeric: tabular-nums; }
.mp-block { padding-top: 10px; border-top: 1px solid #232327; }
.mp-block h5 { margin: 0 0 4px; color: var(--bright); font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.mp-block p { margin: 0 0 6px; color: var(--muted); }
.mp-block ul:not(.mp-lines) { display: grid; gap: 3px; margin: 0; padding-left: 15px; }
.mp-nutri h5 { color: #8FB8EE; }
.mp-recov h5 { color: #7FD8A8; }

/* dialogs */
.mp-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100% - 48px); padding: 0; border: 1px solid #333338; border-radius: 18px; background: #141416; box-shadow: 0 30px 80px rgb(0 0 0 / 60%); color: var(--text); }
.mp-dialog::backdrop { background: rgb(0 0 0 / 60%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.mp-dialog[open] { animation: mp-pop .25s cubic-bezier(.2,.8,.2,1); }
@keyframes mp-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.mp-dialog-in { position: relative; display: grid; gap: 14px; padding: 26px; }
.mp-dialog h2 { margin: 0; padding-right: 40px; color: var(--bright); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.mp-close { position: absolute; top: 14px; right: 14px; display: grid; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 50%; background: rgb(255 255 255 / 6%); color: var(--bright); cursor: pointer; }
.mp-close svg { width: 15px; height: 15px; }
.mp-close:hover { background: rgb(255 255 255 / 12%); }
.mp-day-week { margin: 0; color: var(--muted); font-size: 12.5px; }
.mp-day #mpDayTitle { margin-top: -10px; }
.mp-daycard.is-full { padding: 16px; font-size: 14px; }
.mp-daycard.is-full header { display: none; }
.mp-daycard.is-full .mp-day-title { font-size: 17px; }
.mp-day-nav { display: flex; justify-content: space-between; gap: 10px; }
.mp-dl-sub { margin: -6px 0 0; font-size: 13.5px; line-height: 1.6; }
.mp-formats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.mp-formats legend { margin-bottom: 6px; padding: 0; color: var(--bright); font-size: 13px; font-weight: 500; }
.mp-format { position: relative; }
.mp-format input { position: absolute; opacity: 0; }
.mp-format span { display: grid; gap: 2px; height: 100%; padding: 12px; border: 1px solid #303035; border-radius: 11px; background: #111113; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.mp-format b { color: var(--bright); font-size: 13.5px; font-weight: 600; }
.mp-format small { color: var(--muted); font-size: 11.5px; }
.mp-format input:checked + span { border-color: var(--brand); background: rgb(64 147 247 / 8%); }
.mp-format input:focus-visible + span { outline: 2px solid var(--bright); outline-offset: 2px; }
.mp-check { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.mp-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.mp-dl-note { margin: -4px 0 0; color: var(--muted); font-size: 11.5px; text-align: center; }
.mp-dl .mp-field input[aria-invalid] { border-color: var(--hard); }

.mp-toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; max-width: calc(100% - 32px); padding: 12px 18px; border: 1px solid #333338; border-radius: 12px; background: #1C1C1F; box-shadow: 0 16px 40px rgb(0 0 0 / 50%); color: var(--bright); font-size: 13.5px; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .25s ease, transform .25s ease; }
.mp-toast.on { opacity: 1; transform: translate(-50%, 0); }


/* responsive */
@media (max-width: 980px) {
  .mp-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-two { grid-template-columns: 1fr; }
  .mp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .mp-mrow { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .mp-mhead span:first-child { display: none; }
  .mp-wk { grid-column: 1 / -1; grid-template-columns: auto auto 1fr; gap: 10px; margin-top: 6px; padding: 6px 10px; }
  .mp-wk small:last-child { text-align: right; }
  .mp-cell { min-height: 64px; padding: 5px 4px; gap: 3px; }
  .mp-cell .mp-tag { padding: 1px 3px; font-size: 8.5px; max-width: 100%; overflow: hidden; text-overflow: clip; }
  .mp-cell-title { display: none; }
  .mp-cell-km { font-size: 10.5px; }
  .mp-mhead span { text-align: center; padding: 0; font-size: 10.5px; }
}
@media (max-width: 640px) {
  .mp { width: calc(100% - 32px); padding-top: 20px; }
  .mp-group, .mp-summary, .mp-card { padding: 18px; }
  .mp-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .mp-days { grid-template-columns: 1fr; }
  .mp-chart { height: 200px; }
  .mp-phases p { display: none; }
  .mp-toolbar { gap: 8px; }
  .mp-download, .mp-tabs { flex: 1 1 100%; }
  .mp-tabs button { flex: 1; padding: 0 8px; }
  .mp-actions .mp-btn { flex: 1; }
  .mp-formats { grid-template-columns: 1fr; }
}
@media (max-width: 400px) { .mp-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .mp-panel, .mp-dialog[open] { animation: none; } }

/* print → PDF */
.mp-print { display: none; }
@media print {
  @page { margin: 14mm; }
  body.is-printing > *:not(.mp-print) { display: none !important; }
  body.is-printing { background: #fff !important; color: #111; }
  body.is-printing .mp-print { display: block; }
  .pr { color: #111; font: 10.5px/1.45 "Plus Jakarta Sans", sans-serif; }
  .pr h1 { margin: 0 0 4px; font-size: 22px; }
  .pr h2 { margin: 18px 0 6px; font-size: 14px; }
  .pr p { margin: 0 0 4px; }
  .pr table { width: 100%; border-collapse: collapse; }
  .pr th, .pr td { padding: 5px 6px; border: 1px solid #ccc; text-align: left; vertical-align: top; }
  .pr th { background: #f2f2f2; }
  .pr .pw { break-inside: avoid; page-break-inside: avoid; }
  .pr .pf { color: #666; }
}
.mp-s-hint:empty { display: none; }

/* confirm + analysing */
.mp-confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.mp-confirm .mp-dl-sub { margin: 0; }
.mp-loading { scroll-margin-top: 84px; display: grid; justify-items: center; gap: 22px; padding: 72px 20px; text-align: center; }
.mp-loading[hidden] { display: none; }
.mp-loading h2 { margin: 0; color: var(--bright); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.mp-orbit { position: relative; width: 64px; height: 64px; }
.mp-orbit i { position: absolute; inset: 0; border: 3px solid transparent; border-top-color: #4093F7; border-radius: 50%; animation: mp-spin 1.1s linear infinite; }
.mp-orbit i:nth-child(2) { inset: 9px; border-top-color: #8FC0FF; animation-duration: 1.6s; animation-direction: reverse; }
.mp-orbit i:nth-child(3) { inset: 18px; border-top-color: #1E6FD9; animation-duration: 2.1s; }
@keyframes mp-spin { to { transform: rotate(360deg); } }
.mp-load-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; text-align: left; }
.mp-load-steps li { display: flex; align-items: center; gap: 10px; color: #5C616A; font-size: 14px; transition: color .25s; }
.mp-load-steps li::before { content: ""; width: 14px; height: 14px; flex: none; border: 2px solid #3A3D44; border-radius: 50%; box-sizing: border-box; transition: all .25s; }
.mp-load-steps li.is-active { color: var(--bright); }
.mp-load-steps li.is-active::before { border-color: #4093F7 #4093F7 #4093F7 transparent; animation: mp-spin .8s linear infinite; }
.mp-load-steps li.is-done { color: var(--text); }
.mp-load-steps li.is-done::before { border-color: #4093F7; background: #4093F7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 8.5 3 3 6-6.5' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.mp-load-bar { width: min(260px, 70vw); height: 4px; overflow: hidden; border-radius: 2px; background: #23252B; }
.mp-load-bar i { display: block; width: 0; height: 100%; border-radius: 2px; background: #4093F7; transition: width .7s ease; }
@media (prefers-reduced-motion: reduce) { .mp-orbit i, .mp-load-steps li.is-active::before { animation-duration: 3s; } .mp-load-bar i { transition: none; } }
.mp-table-zones td { white-space: nowrap; }

/* date hover: detail card + dimmed surroundings */
.mp-summary, .mp-toolbar, .mp-nav, .mp-mhead, .mp-types, .mp-wk, .mp-cell { transition: opacity .18s ease, background .15s ease, border-color .15s ease, transform .15s ease; }
.mp-result.is-peek .mp-summary, .mp-result.is-peek .mp-toolbar, .mp-result.is-peek .mp-nav, .mp-result.is-peek .mp-mhead, .mp-result.is-peek .mp-types, .mp-result.is-peek .mp-wk, .mp-result.is-peek .mp-cell:not(.is-hover) { opacity: .28; }
.mp-peek { position: fixed; z-index: 30; width: min(340px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 16px; overflow: hidden; border: 1px solid #333338; border-radius: 14px; background: #141416; box-shadow: 0 24px 60px rgb(0 0 0 / 55%); font-size: 13px; pointer-events: none; animation: mp-pop .16s ease; }
.mp-peek[hidden] { display: none; }
.mp-peek h3 { margin: 2px 0 12px; color: var(--bright); font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.mp-peek .mp-daycard.is-full { padding: 0; border: 0; background: none; font-size: 13px; }

/* heart-rate zones donut */
.mp-zones { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; }
.mp-donut { position: relative; width: 132px; height: 132px; }
.mp-donut svg { display: block; width: 100%; height: 100%; }
.mp-arc { cursor: pointer; transition: opacity .18s ease, stroke-width .18s ease; }
.mp-zones.is-dim .mp-arc:not(.is-on) { opacity: .25; }
.mp-arc.is-on { stroke-width: 22; }
.mp-donut-c { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 1px; pointer-events: none; }
.mp-donut-c small { color: var(--muted); font-size: 11.5px; }
.mp-donut-c b { color: var(--bright); font-size: 19px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mp-zlist { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.mp-zrow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; font-size: 13px; cursor: default; transition: opacity .18s ease, background .18s ease; }
.mp-zdot { width: 10px; height: 10px; border-radius: 3px; }
.mp-zname { display: flex; gap: 8px; white-space: nowrap; color: var(--bright); }
.mp-zname b { min-width: 20px; color: var(--muted); font-weight: 500; }
.mp-zbpm { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-zones.is-dim .mp-zrow:not(.is-on) { opacity: .35; }
.mp-zrow.is-on { background: rgb(255 255 255 / 5%); }
@media (max-width: 520px) { .mp-zones { grid-template-columns: 1fr; justify-items: center; } .mp-zlist { width: 100%; } }

/* training paces: effort bars */
.mp-paces { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.mp-pcol, .mp-phead { display: grid; grid-template-columns: 108px minmax(0, 1fr) 78px 78px; align-items: center; gap: 14px; padding: 8px 0; }
.mp-pcol { border-top: 1px solid #232327; transition: opacity .18s ease; }
.mp-phead { padding: 0 0 6px; color: var(--muted); font-size: 11.5px; }
.mp-phead span:nth-child(n+3), .mp-pcol span, .mp-pcol small { text-align: right; }
.mp-paces:hover .mp-pcol:not(:hover) { opacity: .4; }
.mp-pbar { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.mp-pbar i { height: 12px; border-radius: 3px; background: #23252B; }
.mp-pcol b { color: var(--bright); font-size: 13px; font-weight: 500; white-space: nowrap; }
.mp-pcol span { color: var(--bright); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-pcol small { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 520px) {
  .mp-pcol, .mp-phead { grid-template-columns: minmax(0, 1fr) 70px 70px; gap: 4px 8px; }
  .mp-phead span:first-child { display: none; }
  .mp-pcol b { grid-column: 1; grid-row: 1; }
  .mp-pcol span { grid-column: 2; grid-row: 1; }
  .mp-pcol small { grid-column: 3; grid-row: 1; }
  .mp-pcol .mp-pbar { grid-column: 1 / -1; grid-row: 2; }
  .mp-pcol b, .mp-pcol span, .mp-pcol small { font-size: 12px; }
}
@media (max-width: 640px) {
  .mp-phases li { flex-direction: column; align-items: flex-start; }
  .mp-phases small::before { display: none; }
}
}

.mp-sum-head { position: relative; justify-content: flex-start; }
.mp-info { position: relative; display: inline-flex; margin-left: 2px; }
.mp-sum-head .mp-sum-dates { margin-left: auto; }
.mp-info-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: help; transition: color .15s ease, background .15s ease; }
.mp-info-btn svg { width: 16px; height: 16px; }
.mp-info-btn:hover, .mp-info-btn:focus-visible { color: var(--bright); background: rgb(255 255 255 / 8%); }
.mp-tip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: min(340px, calc(100vw - 48px)); padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #15171C; color: var(--muted); font-size: 12px; line-height: 1.65; box-shadow: 0 12px 32px rgb(0 0 0 / 45%); opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s; }
.mp-info:hover .mp-tip, .mp-info:focus-within .mp-tip { opacity: 1; visibility: visible; transform: none; }

/* ===== v2: multi-distance, saved profile, training-days table ===== */
.mp-seg-4 { max-width: 560px; }
.mp-opt { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgb(255 255 255 / 6%); color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .01em; vertical-align: 1px; }
.mp-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.mp-ctl > .mp-date + .mp-slider { margin-top: 18px; }
.mp-weeks-warn { display: block; margin-top: 6px; color: #F0C064; }
.mp-weeks-warn .mp-link { margin-left: 4px; }
.mp-weeks-note { display: block; margin-top: 6px; color: var(--muted); }
.mp-btn-danger { border-color: #B8434A; background: #B8434A; color: #fff; }
.mp-btn-danger:hover:not(:disabled) { border-color: #C9545B; background: #C9545B; }

/* plan already exists */
.mp-exists { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin: 0 0 28px; padding: 18px 22px; border: 1px solid rgb(64 147 247 / 35%); border-radius: 16px; background: rgb(64 147 247 / 8%); }
.mp-exists[hidden] { display: none; }
.mp-exists h2 { margin: 0; color: var(--bright); font-size: 16px; font-weight: 600; }
.mp-exists p { margin: 4px 0 0; font-size: 13.5px; }
.mp-exists-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* feasibility check */
.mp-feas { margin-top: 18px; }
.mp-feas-off { margin: 0; color: var(--muted); font-size: 13px; }
.mp-feas-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mp-feas-row p { margin: 0; font-size: 13.5px; }
.mp-feas-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 14px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.mp-feas-stats div { padding: 10px 14px; background: #121214; }
.mp-feas-stats dt { color: var(--muted); font-size: 11.5px; }
.mp-feas-stats dd { margin: 2px 0 0; color: var(--bright); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* training days */
.mp-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.mp-day { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-top: 3px solid #3A3A3F; border-radius: 12px; background: rgb(17 17 19 / 70%); transition: border-color .2s ease, background .2s ease; }
.mp-day label { display: flex; align-items: baseline; gap: 6px; color: var(--bright); font-size: 13px; }
.mp-day label .mp-full { display: none; }
.mp-day select { width: 100%; min-height: 40px; padding: 6px 26px 6px 8px; border: 1px solid #303035; border-radius: 8px; background: #0E0E10 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%238A8F98' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 6px center / 14px; color: var(--bright); font: inherit; font-size: 13px; -webkit-appearance: none; appearance: none; cursor: pointer; }
.mp-day select:hover { border-color: #4A4A50; }
.mp-day.a-run { border-top-color: var(--brand); }
.mp-day.a-long { border-top-color: #8C76FF; background: rgb(124 96 255 / 7%); }
.mp-day.a-run-strength { border-top-color: var(--brand); box-shadow: inset 0 -3px 0 var(--bright); }
.mp-day.a-strength { border-top-color: var(--bright); }
.mp-days-status { margin: 12px 0 0; font-size: 13px; }
.mp-days-status.is-ok { color: #7FD8A8; }
.mp-days-status.is-warn { color: #F0C064; }
.mp-days-status.is-bad { color: #F2A3A7; }
.mp-ctl.is-invalid .mp-days .mp-day { border-color: rgb(214 82 88 / 55%); }

@media (max-width: 860px) {
  .mp-cols-3 { grid-template-columns: 1fr; }
  .mp-days { grid-template-columns: 1fr; gap: 6px; }
  .mp-day { grid-template-columns: 110px 1fr; align-items: center; padding: 8px 10px; border-top-width: 1px; border-left: 3px solid #3A3A3F; }
  .mp-days .mp-day { border-top-color: var(--line); }
  .mp-day label b { display: none; }
  .mp-day label .mp-full { display: inline; }
  .mp-day.a-run, .mp-day.a-run-strength { border-left-color: var(--brand); }
  .mp-day.a-long { border-left-color: #8C76FF; }
  .mp-day.a-strength { border-left-color: var(--bright); }
  .mp-day.a-run-strength { box-shadow: none; }
}
@media (max-width: 640px) {
  .mp-hide-sm { display: none; }
  .mp-feas-stats { grid-template-columns: 1fr; }
}
