:root {
  color-scheme: dark;
  --color-bg: #0b0b0f;
  --color-surface: #18181f;
  --color-surface-2: #1f1f28;
  --color-surface-3: #272733;
  --color-border: #2b2b38;
  --color-text: #f4f4f5;
  --color-text-muted: #adadb6;
  --color-text-soft: #81818b;
  --color-primary: #6c5cff;
  --color-primary-hover: #7c6dff;
  --color-primary-soft: rgba(108, 92, 255, .15);
  --color-primary-border: rgba(108, 92, 255, .38);
  --color-success: #b8ff3d;
  --color-danger: #ff7088;
  --radius-button: 14px;
  --radius-card: 18px;
  --shadow-card: 0 18px 40px rgba(0, 0, 0, .22);
  --shadow-primary: 0 12px 30px rgba(108, 92, 255, .24);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--color-bg); }
body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p, figure { margin-top: 0; }
.ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 84% -12%, rgba(108, 92, 255, .18), transparent 32rem), radial-gradient(circle at -12% 76%, rgba(184, 255, 61, .035), transparent 25rem);
}
.app-shell { width: min(100% - 32px, 860px); min-height: 100dvh; margin: auto; padding: 24px 0 64px; }
.site-header { display: flex; align-items: center; margin-bottom: 28px; }
.back-link { display: inline-flex; min-height: 44px; align-items: center; gap: 9px; padding: 0 5px; color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; }
.back-link:hover { opacity: .72; }
.button-arrow { color: #d7d3ff; font-size: 26px; line-height: 1; }
.hero { max-width: 800px; margin-bottom: clamp(22px, 4vw, 36px); }
.section-kicker, .card-label { margin: 0; color: #a99fff; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { max-width: 780px; margin: 10px 0 16px; font-size: clamp(36px, 6vw, 54px); font-weight: 700; line-height: .99; letter-spacing: -.065em; }
.lead { max-width: 700px; margin: 0; color: var(--color-text-muted); font-size: clamp(16px, 2vw, 18px); line-height: 1.55; }
.wizard-progress { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; color: var(--color-text-muted); font-size: 13px; }
.wizard-progress strong { color: var(--color-text); }
.progress-dots { display: flex; gap: 6px; }
.progress-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--color-surface-3); }
.progress-dots span.is-done { background: var(--color-success); }
.progress-dots span.is-current { background: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }
.step-panel, .result-panel { min-width: 0; padding: clamp(20px, 4vw, 32px); border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); box-shadow: var(--shadow-card); }
.step-heading { max-width: 680px; margin-bottom: 27px; }
.step-heading h2 { margin: 0 0 8px; font-size: clamp(27px, 5vw, 36px); line-height: 1.08; letter-spacing: -.05em; }
.step-heading p { margin: 0; color: var(--color-text-muted); font-size: 16px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend, .field label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 700; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-card { position: relative; display: block; min-width: 0; cursor: pointer; }
.choice-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-content { display: flex; width: 100%; min-height: 62px; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--color-border); border-radius: 13px; background: var(--color-surface-2); transition: border-color .14s ease, background .14s ease, transform .14s ease; }
.choice-card:hover .choice-content { border-color: var(--color-primary-border); background: #22222c; transform: translateY(-1px); }
.choice-card input:checked + .choice-content { border-color: var(--color-primary); background: var(--color-primary-soft); box-shadow: 0 0 0 1px var(--color-primary); }
.choice-card input:focus-visible + .choice-content { outline: 3px solid rgba(108, 92, 255, .55); outline-offset: 3px; }
.choice-dot { width: 15px; height: 15px; flex: 0 0 auto; border: 1px solid #626276; border-radius: 50%; }
.choice-card input:checked + .choice-content .choice-dot { border: 4px solid var(--color-primary); background: var(--color-text); }
.choice-content strong { display: block; font-size: 14px; line-height: 1.3; }
.choice-content small { display: block; margin-top: 3px; color: var(--color-text-muted); font-size: 13px; line-height: 1.35; }
.field { max-width: 410px; margin-top: 25px; }
.formula-fieldset { margin-bottom: 27px; }
.formula-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface-2); }
.formula-option { position: relative; min-width: 0; cursor: pointer; }
.formula-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.formula-option span { display: flex; min-height: 48px; align-items: center; justify-content: center; padding: 9px 8px; border-radius: 10px; color: var(--color-text-muted); font-size: 14px; font-weight: 700; text-align: center; }
.formula-option:hover span { color: var(--color-text); background: var(--color-surface-3); }
.formula-option input:checked + span { color: #fff; background: var(--color-primary); }
.formula-option input:focus-visible + span { outline: 3px solid rgba(108, 92, 255, .55); outline-offset: 2px; }
.formula-hints { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.formula-hints p { margin: 0; padding: 0 8px; color: var(--color-text-muted); font-size: 12px; line-height: 1.4; text-align: center; }
.input-with-suffix { display: flex; min-height: 54px; align-items: center; border: 1px solid var(--color-border); border-radius: 13px; background: var(--color-surface-2); }
.input-with-suffix:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }
.input-with-suffix input { width: 100%; min-width: 0; height: 52px; padding: 0 15px; border: 0; outline: 0; background: transparent; color: var(--color-text); font-size: 18px; }
.input-with-suffix input::placeholder { color: #777783; font-size: 16px; }
.input-with-suffix span { padding-right: 16px; color: var(--color-text-muted); font-size: 14px; }
.field-hint, .fat-reference figcaption { margin: 8px 0 0; color: var(--color-text-soft); font-size: 13px; line-height: 1.45; }
.legend-hint { max-width: 700px; margin: -1px 0 14px; color: var(--color-text-soft); font-size: 13px; line-height: 1.45; }
.field-error { min-height: 0; margin: 6px 0 0; color: var(--color-danger); font-size: 13px; font-weight: 600; }
.field-error:empty { display: none; }
[aria-invalid="true"] { border-color: var(--color-danger); }
.step-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; margin-top: 28px; }
.step-actions--end { display: block; }
.button { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; gap: 12px; padding: 0 20px; border: 1px solid transparent; border-radius: var(--radius-button); font-size: 15px; font-weight: 800; text-align: center; text-decoration: none; transition: background .14s ease, border-color .14s ease, transform .14s ease; }
.button.primary { width: 100%; background: var(--color-primary); color: #fff; box-shadow: var(--shadow-primary); }
.button.primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); }
.button.secondary { background: var(--color-surface-2); border-color: var(--color-border); color: var(--color-text); }
.button.secondary:hover { border-color: var(--color-primary-border); background: var(--color-surface-3); }
.text-button { min-height: 44px; padding: 0 5px; background: transparent; color: #c9c4ff; }
.text-button:hover { color: #fff; }
.button:focus-visible, .back-link:focus-visible, summary:focus-visible { outline: 3px solid rgba(108, 92, 255, .55); outline-offset: 3px; }
.fat-reference { margin: 0; }
.fat-reference img { display: block; width: 100%; height: auto; border: 1px solid var(--color-border); border-radius: 13px; }
.fat-reference figcaption { margin-top: 10px; }
.activity-grid .choice-content { min-height: 78px; }
.spaced-fieldset { margin-top: 25px; }
.result-intro { max-width: 720px; margin-bottom: 24px; }
.result-intro h2 { margin: 0 0 11px; font-size: clamp(30px, 5vw, 42px); line-height: 1.04; letter-spacing: -.055em; }
.result-intro p:last-child { margin: 0; color: var(--color-text-muted); font-size: 16px; }
.result-card { min-width: 0; padding: 19px; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface-2); }
.result-card h3 { margin: 0; font-size: 21px; line-height: 1.15; letter-spacing: -.04em; }
.result-card__calories { margin: 14px 0 17px; color: var(--color-success); font-size: clamp(27px, 3vw, 34px); font-weight: 800; line-height: 1; letter-spacing: -.05em; white-space: nowrap; }
.result-card__calories small { margin-left: 5px; color: var(--color-text-muted); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.macro-list { display: grid; gap: 8px; margin: 0; }
.macro-list div { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--color-border); font-size: 14px; }
.macro-list dt { color: var(--color-text-muted); }
.macro-list dd { margin: 0; font-weight: 750; white-space: nowrap; }
.result-details { margin-top: 18px; border: 1px solid var(--color-border); border-radius: 15px; background: var(--color-surface-2); }
.result-details summary { min-height: 55px; padding: 16px 19px; cursor: pointer; font-size: 15px; font-weight: 750; }
.result-details[open] summary { border-bottom: 1px solid var(--color-border); }
.details-body { padding: 19px; }
.details-body > p { margin-bottom: 16px; color: var(--color-text-muted); font-size: 14px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 !important; color: var(--color-text) !important; font-weight: 700; }
.switch { position: relative; flex: 0 0 auto; display: inline-flex; width: 49px; height: 28px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { width: 100%; border-radius: 20px; background: var(--color-surface-3); border: 1px solid var(--color-border); transition: background .14s ease; }
.switch-track::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .14s ease; }
.switch input:checked + .switch-track { background: var(--color-primary); }
.switch input:checked + .switch-track::after { transform: translateX(21px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(108, 92, 255, .55); outline-offset: 3px; }
.technical-details { margin-top: 10px; }
.technical-grid { display: grid; gap: 12px; }
.technical-grid div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.technical-grid span { color: var(--color-text-muted); }
.technical-grid strong { text-align: right; }
.next-step-card { margin-top: 22px; padding: 18px; border: 1px solid rgba(255,180,84,.28); border-radius: var(--radius-card); background: linear-gradient(145deg, rgba(255,180,84,.07), var(--color-surface)); }
.next-step-card .card-label { color: #ffd094; font-size: 10px; letter-spacing: .1em; line-height: 1.25; }
.next-step-card h3 { margin: 17px 0 11px; font-size: clamp(20px, 3vw, 25px); line-height: 1.1; letter-spacing: -.045em; }
.next-step-card p:not(.card-label) { max-width: 700px; margin: 0; color: var(--color-text-muted); font-size: 14px; line-height: 1.5; }
.next-step-card .button { margin-top: 20px; }
.result-disclaimer { margin: 18px 0 0; color: var(--color-text-soft); font-size: 13px; }
.reset-button { width: 100%; margin-top: 22px; border-color: var(--color-border); background: transparent; color: var(--color-text); }
.reset-button:hover { background: var(--color-surface-2); }
.noscript-message { width: min(100% - 32px, 860px); margin: 0 auto; color: var(--color-danger); }

@media (max-width: 700px) {
  .app-shell { width: min(100% - 28px, 560px); padding-top: 20px; }
  .site-header { margin-bottom: 24px; }
  .result-card__calories { font-size: 32px; }
}
@media (max-width: 520px) {
  .choice-grid { grid-template-columns: 1fr; }
  .choice-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-grid .choice-content { min-height: 65px; }
}
@media (max-width: 390px) {
  .app-shell { width: min(100% - 24px, 366px); }
  .step-panel, .result-panel { padding: 18px; }
  .hero h1 { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
