/* Splitwerk – free time calculator (/rechner/, /en/calculator/). Loaded after site.css; same tokens.
   No inline styles anywhere (CSP style-src 'self'): all states are classes. */

/* ---------- Intro ---------- */
.calc-hero { position: relative; padding: 26px 0 16px; overflow: hidden; }
.calc-hero::before {
  content: ""; position: absolute; right: -260px; top: -300px; width: 720px; height: 720px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 107, 26, 0.2), rgba(255, 107, 26, 0) 70%);
}
.calc-hero .wrap { position: relative; max-width: 720px; }
.calc-hero .eyebrow { margin-bottom: 14px; }
.calc-hero h1 {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.9rem, 12.5vw, 5rem); line-height: 0.9; margin-bottom: 14px;
}
.calc-hero h1 em { font-style: normal; color: var(--accent); }
.calc-hero .lede { font-size: 1rem; margin-bottom: 12px; }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; margin: 0; color: var(--text); font-size: 0.9rem; font-weight: 500; }
.privacy-note svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--gain); }
.privacy-note span span { color: var(--muted); font-weight: 400; }
@media (min-width: 900px) { .calc-hero { padding: 56px 0 26px; } }

/* ---------- Card ---------- */
.calc-section { padding: 8px 0 56px; }
.calc-section .wrap { max-width: 720px; }
.calc-card {
  position: relative; border-radius: 24px; background: var(--surface); border: 1px solid var(--line-strong);
  padding: 20px 16px 20px; box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
}
@media (min-width: 560px) { .calc-card { padding: 28px 28px 26px; } }
.calc-card noscript p, .calc-fallback { margin: 0; color: var(--muted); }

/* Progress */
.calc-progress { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.calc-progress b { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.calc-progress span { font-size: 0.8rem; color: var(--dim); text-align: right; }
.calc-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 22px; }
.calc-bars i { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background-color 0.25s ease; }
.calc-bars i.on { background: var(--accent); }

.calc-step { border: 0; margin: 0; padding: 0; min-width: 0; }
.calc-card [hidden] { display: none !important; }
.calc-step > legend { padding: 0; margin-bottom: 18px; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 2rem; line-height: 0.95; }

/* Question */
.q { margin: 0 0 20px; }
.q-label { display: block; margin-bottom: 4px; font-weight: 650; font-size: 0.98rem; line-height: 1.35; color: var(--text); }
.q-sub { display: block; margin-bottom: 10px; font-size: 0.86rem; line-height: 1.45; color: var(--muted); }
.q-label + .opts, .q-label + .fivek { margin-top: 10px; }
.q-hint { margin: 8px 0 0; font-size: 0.84rem; color: var(--muted); }
.q.missing .q-label { color: var(--loss); }
.q.missing .opt > span { border-color: rgba(255, 77, 61, 0.55); }

/* Options (radio chips / cards) */
.opts { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
.opts.cols-3 { grid-template-columns: repeat(3, 1fr); }
.opts.cols-4 { grid-template-columns: repeat(4, 1fr); }
.opts.cols-1 { grid-template-columns: 1fr; }
.opts.cols-2 > .opt:last-child:nth-child(odd) { grid-column: 1 / -1; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opt > span {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; height: 100%;
  min-height: 48px; padding: 10px 12px; border-radius: 14px; text-align: center;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
  font-weight: 650; font-size: 0.95rem; line-height: 1.25;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.opt.card > span { text-align: left; padding: 12px 14px; }
.opt small { display: block; font-weight: 400; font-size: 0.8rem; line-height: 1.35; color: var(--muted); }
.opt:hover > span { border-color: rgba(255, 107, 26, 0.45); }
.opt input:checked + span { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.opt input:checked + span small { color: #E7D2C6; }
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.opts.cols-4 .opt > span { padding: 10px 4px; font-size: 0.92rem; }

/* 5 km time + best time */
.fivek { display: grid; gap: 12px; }
.time-in { display: flex; align-items: flex-end; gap: 8px; }
.time-in label { display: grid; gap: 4px; text-align: center; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.time-in input {
  width: 4.6rem; height: 64px; padding: 0 6px; border-radius: 14px; text-align: center;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
  font-family: var(--font-display); font-weight: 800; font-size: 2.5rem; line-height: 1; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.time-in input::-webkit-outer-spin-button, .time-in input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.time-in input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.time-in .colon { padding-bottom: 12px; font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; color: var(--muted); }
.time-in.invalid input { border-color: var(--loss); }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.presets > span { flex-basis: 100%; font-size: 0.8rem; color: var(--dim); }
.presets button {
  min-height: 36px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong); color: var(--text);
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums;
}
.presets button:hover { border-color: var(--accent); }
.presets button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.q-error { margin: 8px 0 0; font-size: 0.84rem; color: var(--loss); }
.linkbtn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--accent); font: inherit; font-weight: 650; font-size: 0.94rem;
}
.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
.best-box { margin-top: 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.best-box .time-in input { background: var(--surface); }

/* Nav */
.calc-nav { display: flex; gap: 10px; align-items: center; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.calc-nav .btn { cursor: pointer; font-family: inherit; border: 0; }
.calc-nav .btn-ghost { background: transparent; border: 1px solid var(--line-strong); }
.calc-nav .btn-next { margin-left: auto; min-width: 9.5rem; min-height: 50px; font-size: 1rem; }
.calc-missing { margin: 12px 0 0; font-size: 0.88rem; color: var(--loss); }

/* ---------- Result ---------- */
.calc-result { text-align: center; }
.calc-result:focus { outline: none; }
.res-eyebrow { justify-content: center; margin-bottom: 6px; }
.res-title { margin: 0 0 4px; font-size: 1rem; font-weight: 600; color: var(--muted); }
.res-time {
  display: block; font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums;
  font-size: clamp(4.4rem, 24vw, 6.4rem); line-height: 0.92; letter-spacing: 0.005em;
  text-shadow: 0 0 60px rgba(255, 107, 26, 0.35);
}
.res-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0 8px; }
.res-pills .pill { font-size: 0.74rem; padding: 4px 10px; }
.pill-muted { background: var(--surface-3); color: var(--text); border: 1px solid var(--line-strong); }
.pill-estimate { background: transparent; color: var(--muted); border: 1px solid var(--line-strong); text-transform: uppercase; letter-spacing: 0.1em; }
.res-division { margin: 0 0 8px; font-size: 0.84rem; color: var(--dim); }
.res-band { max-width: 30rem; margin: 0 auto 20px; color: var(--muted); font-size: 0.95rem; }

.res-block { text-align: left; margin-top: 14px; padding: 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.res-block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.res-block-head b { font-size: 0.95rem; font-weight: 700; }
.res-block-head span { font-size: 0.78rem; color: var(--dim); }

.hbar { display: grid; grid-template-columns: repeat(17, 1fr); gap: 3px; align-items: end; height: 46px; }
.hbar i { display: block; height: 100%; border-radius: 4px; }
.hbar i.run { height: 62%; }
.hbar i.hot { box-shadow: 0 0 10px rgba(255, 77, 61, 0.5); }
.hc0 { background: #50709F }
.hc1 { background: #6C69A3 }
.hc2 { background: #91608F }
.hc3 { background: #B9535F }
.hc4 { background: #E0483A }
.hc5 { background: #FF4D3D }
.hbar-legend { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.7rem; color: var(--dim); }
.hbar-key { margin: 10px 0 0; font-size: 0.8rem; color: var(--muted); }
.hbar-ramp { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 0.76rem; color: var(--dim); }
.ramp { display: inline-flex; gap: 2px; }
.ramp i { width: 10px; height: 8px; border-radius: 2px; }

.zf-sub { margin: -6px 0 12px; font-size: 0.82rem; color: var(--muted); }
.zf { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.zf li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.zf .rank { flex: none; width: 1.9rem; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--dim); }
.zf .name { flex: 1; font-weight: 600; font-size: 0.96rem; line-height: 1.3; }
.zf .loss { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; line-height: 1; color: var(--loss); font-variant-numeric: tabular-nums; }
.zf .loss small { font-family: var(--font-body); font-size: 0.72rem; font-weight: 600; color: var(--muted); margin-left: 3px; }
.zf-total { margin: 10px 2px 0; font-size: 0.86rem; font-weight: 600; color: var(--muted); }

.splits { margin-top: 12px; }
.splits summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; color: var(--muted); padding: 6px 0; }
.splits summary:hover { color: var(--text); }
.splits ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.splits li { display: flex; align-items: center; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.splits li .dot { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.splits li .seg { flex: 1; }
.splits li .t { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.splits li.run .seg { color: var(--muted); }
.splits .note { margin: 10px 0 0; font-size: 0.8rem; color: var(--dim); }

.res-cta { margin-top: 18px; padding: 22px 18px; border-radius: 20px; background: linear-gradient(160deg, #22160F, var(--surface-2) 60%); border: 1px solid rgba(255, 107, 26, 0.45); }
.res-cta h2 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 2rem; line-height: 0.95; margin-bottom: 8px; }
.res-cta p { color: var(--muted); font-size: 0.93rem; margin: 0 auto 16px; max-width: 30rem; }
.res-cta .btn-cta { width: 100%; max-width: 360px; min-height: 54px; font-size: 1.05rem; }
.res-cta .cta-note { margin: 12px auto 0; font-size: 0.8rem; max-width: 26rem; }
.res-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.res-links .btn { cursor: pointer; font-family: inherit; background: transparent; }
.res-foot { margin: 16px auto 0; max-width: 32rem; font-size: 0.8rem; color: var(--dim); }

@media (prefers-reduced-motion: no-preference) {
  .calc-result.enter .res-time { animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .calc-result.enter .hbar i { animation: grow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: bottom; }
}
@keyframes grow { from { transform: scaleY(0.1); opacity: 0.3; } to { transform: none; opacity: 1; } }

/* ---------- How we calculate ---------- */
.how { padding: 56px 0 24px; border-top: 1px solid var(--line); }
.how .wrap { max-width: 720px; }
.how .section-head { margin-bottom: 24px; }
.how-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.how-list li { padding: 18px 18px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.how-list h3 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 700; letter-spacing: 0; line-height: 1.3; margin-bottom: 6px; }
.how-list p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.how .fineprint { margin-top: 18px; }
.calc-final { padding: 56px 0 72px; }
