/* Touch-first choices. Native inputs retain keyboard and form semantics. */
:root { --motion: cubic-bezier(.22, 1, .36, 1); }
/* Dark accents keep white selected labels and pale surfaces readable. */
[data-tone="blue"] { --tone: #2463a2; --tone-soft: #edf5ff; --tone-line: #b9d5f2; }
[data-tone="teal"] { --tone: #167465; --tone-soft: #eaf8f2; --tone-line: #abdccd; }
[data-tone="gold"] { --tone: #91600e; --tone-soft: #fff6df; --tone-line: #ecd18c; }
[data-tone="warm"] { --tone: #b34c22; --tone-soft: #fff0e7; --tone-line: #efbaa0; }
[data-tone="hot"] { --tone: #b33149; --tone-soft: #fff0f2; --tone-line: #eeb5c0; }
[data-tone="slate"] { --tone: #59677b; --tone-soft: #f0f3f8; --tone-line: #ccd5e2; }
[hidden] { display: none !important; }
button, .choice-face, .body-choice, .check, .card, .field input { transition: background .2s, border-color .2s, box-shadow .2s, transform .2s var(--motion); }
button:active:not(:disabled) { transform: scale(.97); }
main > .header-row, main > .form-card, main > .workout-layout, main > .dashboard-grid { animation: screen-in .4s var(--motion) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.choice-field { min-width: 0; margin: 0 0 24px; }
.choice-field legend { font-size: 13px; font-weight: 650; letter-spacing: 0; margin: 0 0 12px; line-height: 1.5; }
.form-grid > .choice-field, .form-grid > .range-field { grid-column: 1 / -1; }
.choice-options { position: relative; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; padding: 4px; border: 1px solid #e5e9df; background: #f0f3ec; border-radius: 17px; isolation: isolate; }
.choice-option { position: relative; min-width: 0; cursor: pointer; }
.choice-option input { position: absolute; opacity: 0; width: 1px; height: 1px; left: 50%; top: 50%; margin: 0; }
.choice-face { position: relative; display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 54px; padding: 12px 9px; border: 1px solid transparent; border-radius: 12px; color: #66776b; font-size: 12px; font-weight: 650; text-align: center; line-height: 1.4; }
.choice-face small { display: block; color: inherit; font-weight: 400; font-size: 11px; margin-top: 3px; }
.choice-glider { position: absolute; left: 4px; top: 4px; bottom: 4px; z-index: -1; background: var(--green); border-radius: 12px; box-shadow: 0 3px 7px #173f3820; transition: transform .35s var(--motion), width .2s; }
.choice-option input:checked + .choice-face { color: white; }
.choice-option input:focus-visible + .choice-face { outline: 3px solid #8ba75a; outline-offset: 3px; }
.choice-option:hover .choice-face { color: var(--green); }
.choice-option:hover input:checked + .choice-face { color: white; }
.choice-option:active .choice-face { transform: scale(.96); }
.choice-cards .choice-options { background: none; border: 0; padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; gap: 10px; }
.choice-cards .choice-face { height: 100%; justify-content: flex-start; background: #fff; border: 1px solid #dfe5d8; text-align: left; padding: 17px 14px; min-height: 64px; font-size: 13px; }
.choice-cards input:checked + .choice-face { border-color: #497054; background: #edf4e5; box-shadow: 0 0 0 1px #497054; color: var(--green); }
.choice-cards .choice-option:hover input:checked + .choice-face { color: var(--green); }
.choice-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.choice-tick { flex-shrink: 0; display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid #d2dace; border-radius: 50%; color: transparent; font-size: 10px; transition: background .2s, color .2s; }
input:checked + .choice-face .choice-tick { background: var(--green); border-color: var(--green); color: white; }
.goal-mark { flex-shrink: 0; display: grid; place-items: center; width: 42px; height: 46px; border-radius: 13px; color: #536847; background: #f0f3e9; font-size: 17px; font-weight: 750; letter-spacing: -.7px; }
input:checked + .choice-face .goal-mark { background: var(--lime); color: var(--green); }
[data-choice-name="goal"] .choice-options, [data-choice-name="running_goal"] .choice-options { grid-template-columns: 1fr; }
[data-choice-name="running_days"] .choice-copy, [data-choice-name="strength_days"] .choice-copy { font-size: 21px; font-variant-numeric: tabular-nums; }
[data-choice-name="completion_type"] .choice-face { font-size: 12px; min-height: 60px; }
.scale-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.scale-caption { font-size: 9px; letter-spacing: 1.5px; color: #7b887b; font-weight: 650; }
.scale-summary strong { font-size: 15px; color: var(--green); }
.choice-scale .choice-face { flex-direction: column; gap: 7px; padding: 11px 5px; font-size: 12px; min-height: 76px; }
.scale-symbol { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.scale-symbol > path:first-child { opacity: .22; }
.scale-endpoints, .range-endpoints { display: flex; justify-content: space-between; gap: 16px; margin-top: 9px; color: #758171; font-size: 10px; }
.range-field { border: 1px solid #e0e7d9; padding: 20px; border-radius: 18px; margin: 0 0 24px; background: linear-gradient(140deg, #f5f8ef, #fbfcf8); }
.range-heading { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.range-heading label { font-size: 13px; line-height: 1.5; font-weight: 650; }
.range-heading output { white-space: nowrap; color: var(--green); }
.range-heading output strong { font-size: 36px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -1.5px; }
.range-heading output span { color: #7b8876; font-size: 12px; margin-left: 5px; }
.effort-description { display: block; color: #576d4c; font-size: 12px; margin-top: 6px; }
[data-range] input[type="range"] { display: block; width: 100%; appearance: none; -webkit-appearance: none; height: 44px; padding: 0; margin: 14px 0 0; background: transparent; cursor: pointer; touch-action: pan-y; }
[data-range] input[type="range"]::-webkit-slider-runnable-track { height: 7px; border-radius: 10px; background: linear-gradient(to right, #496f50 0, #496f50 var(--range-progress, 0%), #dce4d4 var(--range-progress, 0%), #dce4d4 100%); }
[data-range] input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; height: 28px; width: 28px; margin-top: -10.5px; background: #fff; border: 7px solid var(--green); border-radius: 50%; box-shadow: 0 2px 7px #173f3825; transition: box-shadow .2s; }
[data-range] input[type="range"]:active::-webkit-slider-thumb { box-shadow: 0 0 0 7px #173f3810; }
[data-range] input[type="range"]::-moz-range-track { height: 7px; border-radius: 10px; background: #dce4d4; }
[data-range] input[type="range"]::-moz-range-progress { height: 7px; background: #496f50; border-radius: 10px; }
[data-range] input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 7px solid var(--green); background: #fff; border-radius: 50%; }
[data-range] input[type="range"]:focus-visible { outline-offset: 3px; border-radius: 12px; }
.check.toggle-choice { position: relative; align-items: center; min-height: 58px; padding: 14px 62px 14px 16px; border: 1px solid #e1e7da; background: #fafbf7; border-radius: 15px; cursor: pointer; }
.toggle-choice input { appearance: none; -webkit-appearance: none; position: absolute; right: 14px; top: 50%; margin: -12px 0 0; width: 40px; height: 24px; border: 0; border-radius: 20px; background: #d6ded0; transition: background .2s; cursor: pointer; }
.toggle-choice input::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; background: white; border-radius: 50%; box-shadow: 0 1px 3px #0002; transition: transform .25s var(--motion); }
.toggle-choice input:checked { background: var(--green); }
.toggle-choice input:checked::after { transform: translateX(16px); }
.toggle-choice:has(input:checked) { border-color: #adc09e; background: #f1f6eb; }
.safety-choice { align-items: center; min-height: 48px; border-bottom: 1px solid #edf0e8; padding: 12px 4px; margin: 0; cursor: pointer; }
.safety-choice input { width: 21px; height: 21px; margin: 0; }
.safety-choice:has(input:checked) { color: #8c4630; background: #fdf4ef; border-radius: 10px; }
.symptoms { border-radius: 16px; padding: 16px; background: #f7f9f3; }
.symptoms summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 30px; list-style: none; }
.symptoms summary::-webkit-details-marker { display: none; }
.symptoms summary:focus-visible { outline: 3px solid #88a44e; outline-offset: 6px; border-radius: 6px; }
.disclosure-plus { font-size: 24px; font-weight: 400; transition: transform .25s; }
.symptoms[open] .disclosure-plus { transform: rotate(45deg); }
.symptoms .footer-note { margin-top: 12px; }
.symptom-choices { display: grid; gap: 8px; }
.symptom-option { min-width: 0; border: 1px solid #dfe6d7; border-radius: 13px; background: #fff; overflow: hidden; }
.body-choice { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 12px; cursor: pointer; font-size: 12px; }
.body-choice input { width: 18px; height: 18px; accent-color: var(--green); margin: 0; }
.body-choice-mark { margin-left: auto; font-size: 18px; color: #84937b; }
.symptom-option:has(input[type="checkbox"]:checked) { border-color: #8ea67d; background: #f3f7ed; }
.symptom-option > .range-field { display: none; }
.symptom-option:has(input[type="checkbox"]:checked) > .range-field { display: block; }
.range-compact { margin: 0; border: 0; border-top: 1px solid #e3e9db; border-radius: 0; padding: 10px 14px; background: transparent; }
.range-compact .range-heading label { font-size: 11px; font-weight: 400; }
.range-compact .range-heading output strong { font-size: 22px; }
.range-compact input[type="range"] { margin-top: 0; }
.range-compact .range-endpoints { margin-top: 0; }
#assessment-form { scroll-margin-top: 24px; }
#assessment-form > fieldset { animation: screen-in .3s var(--motion); margin-bottom: 0; }
.form-journey { margin-bottom: 28px; }
.journey-caption { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; color: #6c7e60; letter-spacing: 1.3px; margin-bottom: 12px; }
.journey-caption [data-step-count] { letter-spacing: 0; font-variant-numeric: tabular-nums; }
.journey-track { display: flex; gap: 6px; }
.journey-track i { height: 4px; background: #e7edde; border-radius: 5px; flex: 1; transition: background .3s; }
.journey-track i.complete { background: #557f4e; }
.journey-actions { display: flex; gap: 16px; justify-content: space-between; align-items: center; border-top: 1px solid #e5ebdf; padding-top: 20px; margin-top: 26px; }
.journey-actions .primary { margin-left: auto; }
.journey-back { min-height: 48px; padding: 10px 0; color: #5c7051; font-size: 13px; }
.field input:focus, .field textarea:focus { border-color: #829974; box-shadow: 0 0 0 4px #7389610a; }

/* Semantic temperature across choices, live sliders and saved results. */
.choice-field[data-tone] .choice-options { background: var(--tone-soft); border-color: var(--tone-line); transition: background .3s, border-color .3s; }
.choice-field[data-tone] .choice-glider { background: var(--tone); transition: transform .35s var(--motion), width .2s, background .3s; }
.choice-field[data-tone] .scale-summary strong { color: var(--tone); transition: color .3s; }
.choice-option[data-tone] .choice-face { color: var(--tone); }
.choice-option[data-tone] input:checked + .choice-face { color: white; }
.choice-scale .choice-option[data-tone] input:not(:checked) + .choice-face { background: var(--tone-soft); margin: 3px; min-height: 70px; }
.choice-field.choice-cards[data-tone] .choice-options { background: none; }
.choice-cards .choice-option[data-tone] .choice-face { background: var(--tone-soft); border-color: var(--tone-line); }
.choice-cards .choice-option[data-tone] input:checked + .choice-face { color: var(--tone); border-color: var(--tone); box-shadow: 0 0 0 1px var(--tone); }
.choice-cards .choice-option[data-tone] input:checked + .choice-face .choice-tick { background: var(--tone); border-color: var(--tone); }
.range-field[data-tone] { background: var(--tone-soft); border-color: var(--tone-line); transition: background .25s, border-color .25s; }
.range-field[data-tone] output, .range-field[data-tone] .effort-description { color: var(--tone); }
[data-range-kind="intensity"] input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(90deg, #2463a2, #167465 30%, #c19430 50%, #c56332 75%, #b33149); }
[data-range-kind="intensity"] input[type="range"]::-moz-range-track { background: linear-gradient(90deg, #2463a2, #167465 30%, #c19430 50%, #c56332 75%, #b33149); }
[data-range-kind="intensity"] input[type="range"]::-moz-range-progress { background: transparent; }
[data-range-kind="completion"] input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--tone) var(--range-progress), #d5e3f2 var(--range-progress)); }
[data-range-kind="completion"] input[type="range"]::-moz-range-progress { background: var(--tone); }
[data-range] input[type="range"]::-webkit-slider-thumb { border-color: var(--tone); }
[data-range] input[type="range"]::-moz-range-thumb { border-color: var(--tone); }
.symptom-option:has(input[type="checkbox"]:checked) { border-color: #efbaa0; background: #fff6ef; }
.body-choice input, .safety-choice input { accent-color: #b33149; }
.safety-choice:has(input:checked), .toggle-choice:has(input[name="functional_limitation"]:checked) { background: #fff0f2; color: #9b2940; border-color: #eeb5c0; }
.toggle-choice input[name="functional_limitation"]:checked { background: #b33149; }
.intensity-chip { display: inline-block; padding: 3px 8px; border-radius: 8px; font-size: 12px; font-weight: 650; background: var(--tone-soft); color: var(--tone); border: 1px solid var(--tone-line); white-space: nowrap; }
.tag.PROGRESS, .notice.good { background: #eaf8f2; color: #126354; border-color: #abdccd; }
.tag.MAINTAIN { background: #edf5ff; color: #2463a2; }
.tag.ADAPT { background: #fff6df; color: #91600e; }
.tag.REGRESS { background: #fff0e7; color: #a34620; }
.tag.ALERT, .notice.alert { background: #fff0f2; color: #9b2940; border-color: #eeb5c0; }
.badge-achievement { background: linear-gradient(120deg, #fff2c9, #ffe5a3); color: #78520c; border: 1px solid #ebcf82; }
.progress-bar progress::-webkit-progress-value { background: linear-gradient(90deg, #4384bd, #238c80); }
.progress-bar progress::-moz-progress-bar { background: linear-gradient(90deg, #4384bd, #238c80); }
.card.soft { background: linear-gradient(130deg, #edf5ff, #f2f7fc); border-color: #d4e3f1; }

@media (min-width: 801px) {
  .card { box-shadow: 0 4px 22px #203a2b03; }
  #assessment-form { max-width: 620px; margin: 0 auto; padding: 32px; }
}
@media (max-width: 800px) {
  body { background: #f6f7f2; }
  main { padding: max(22px, env(safe-area-inset-top)) 18px calc(112px + env(safe-area-inset-bottom)); }
  .sidebar { inset: auto 10px calc(10px + env(safe-area-inset-bottom)); width: auto; height: auto; min-height: 70px; border: 1px solid #e0e7d9; border-radius: 24px; padding: 8px 5px; background: #fffffff2; backdrop-filter: blur(20px); box-shadow: 0 6px 30px #173f3812; }
  .nav button { position: relative; min-width: 0; min-height: 50px; border-radius: 16px; padding: 6px 2px; font-size: 9px; letter-spacing: -.15px; }
  .nav button.active { color: var(--green); background: #edf4e3; }
  .nav svg { width: 20px; height: 20px; }
  .topbar { margin-bottom: 24px; }
  .topbar .date { font-size: 10px; max-width: 155px; text-align: right; }
  .header-row h1 { font-size: 30px; line-height: 1.14; letter-spacing: -1px; }
  .header-row p { font-size: 13px; }
  .header-row { margin-bottom: 24px; }
  .card { padding: 22px 18px; border-radius: 22px; box-shadow: 0 4px 20px #263d2704; }
  .field input, .field select, .field textarea { font-size: 16px; min-height: 50px; border-radius: 13px; }
  .field { font-size: 12px; }
  .primary { border-radius: 15px !important; }
  form > .primary { width: 100%; }
  .choice-cards .choice-face { padding: 14px 12px; }
  .choice-options { border-radius: 16px; }
  .range-field { padding: 16px; }
  .range-compact { padding: 10px 12px; }
  #checkin-form { border-color: #ccdabb; }
  .workout-layout:has(#checkin-form) > .card { display: none; }
  .workout-layout:has(#checkin-form) { display: block; }
  .hero { min-height: 300px; border-radius: 26px; }
  .hero h2 { line-height: 1.22; }
  #assessment-form > fieldset > legend { font-size: 21px; line-height: 1.3; margin-bottom: 24px; }
  .journey-actions { gap: 12px; }
  .journey-actions .primary { flex: 1; padding: 15px; font-size: 13px; }
  .form-journey { margin-bottom: 26px; }
  .auth-story { min-height: 235px; padding: 28px 24px; gap: 25px; border-radius: 0 0 30px 30px; }
  .auth-story h1 { font-size: 34px; }
  .auth-story p, .auth-story footer { display: none; }
  .auth-form { padding: 28px 24px 40px; }
  .auth-inner h2 { font-size: 26px; }
  #toast { bottom: calc(94px + env(safe-area-inset-bottom)); border-radius: 18px; padding: 14px 18px; font-size: 12px; width: max-content; max-width: calc(100% - 32px); box-shadow: 0 8px 32px #173f3830; }
}
@media (max-width: 380px) {
  main { padding-left: 12px; padding-right: 12px; }
  .choice-face { font-size: 11px; padding-left: 5px; padding-right: 5px; }
  .choice-cards .choice-options { grid-template-columns: 1fr; }
  .choice-scale .choice-face { min-height: 70px; }
  .nav button { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
