@font-face {
  font-family: "IRANYekanX";
  src: url("./IRANYekanXVF.woff2") format("woff2-variations"),
       url("./IRANYekanXVF.woff") format("woff-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "IRANYekanX", Vazirmatn, Tahoma, Arial, sans-serif;
  --bg: #07111f;
  --bg-elevated: #0b1728;
  --surface: #0e1c2f;
  --surface-2: #11233a;
  --surface-3: #152a44;
  --text: #f5f8fc;
  --muted: #a4b2c4;
  --muted-2: #718198;
  --line: rgba(159, 177, 202, 0.15);
  --line-strong: rgba(159, 177, 202, 0.26);
  --primary: #67e8b5;
  --primary-strong: #36d99a;
  --primary-ink: #03251a;
  --blue: #7cc4ff;
  --violet: #ad9cff;
  --amber: #ffd166;
  --danger: #ff8597;
  --danger-bg: rgba(255, 133, 151, 0.1);
  --success-bg: rgba(103, 232, 181, 0.1);
  --shadow-xl: 0 30px 80px rgba(0, 0, 0, 0.36);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.22);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --container: 1220px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

html[data-theme="light"] {
  --bg: #eef3f8;
  --bg-elevated: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f5f8fb;
  --surface-3: #edf3f8;
  --text: #102033;
  --muted: #5f7084;
  --muted-2: #8997a8;
  --line: rgba(33, 54, 78, 0.11);
  --line-strong: rgba(33, 54, 78, 0.2);
  --primary: #16c784;
  --primary-strong: #0fb778;
  --primary-ink: #ffffff;
  --blue: #2b8de5;
  --violet: #7564e8;
  --amber: #e9a41b;
  --danger: #e45168;
  --danger-bg: rgba(228, 81, 104, 0.08);
  --success-bg: rgba(22, 199, 132, 0.09);
  --shadow-xl: 0 30px 70px rgba(39, 60, 83, 0.14);
  --shadow-md: 0 14px 34px rgba(39, 60, 83, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  transition: background-color .25s ease, color .25s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image: radial-gradient(rgba(255,255,255,.06) .7px, transparent .7px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 55%);
  z-index: -2;
}

button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
svg { display: block; }
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .11;
  pointer-events: none;
  z-index: -3;
}
.ambient--one { top: -220px; right: -120px; background: var(--primary); }
.ambient--two { bottom: -280px; left: -120px; background: var(--blue); }

.container { width: min(var(--container), calc(100% - 40px)); margin-inline: auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(140%);
}
.site-header__inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--primary-ink); background: var(--primary); border-radius: 15px;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--primary) 25%, transparent);
}
.brand__mark svg { width: 25px; height: 25px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; line-height: 1.4; }
.brand small { color: var(--muted-2); font-size: 11px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.save-status { color: var(--muted-2); font-size: 12px; }
.icon-button {
  width: 44px; height: 44px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); border-radius: 14px;
  cursor: pointer; transition: transform .2s var(--ease), border-color .2s ease, background .2s ease;
}
.icon-button:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--surface-2); }
.theme-icon { width: 20px; height: 20px; }
html[data-theme="dark"] .theme-icon--sun, html[data-theme="light"] .theme-icon--moon { display: none; }

.page-shell { padding-block: 48px 32px; }
.hero {
  min-height: 390px;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 32px; align-items: center; padding: 54px;
  border: 1px solid var(--line); border-radius: var(--radius-xl);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-2) 88%, transparent)),
    radial-gradient(circle at 75% 20%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 38%);
  box-shadow: var(--shadow-xl); overflow: hidden; position: relative;
}
.hero::after {
  content: ""; position: absolute; inset: auto -80px -145px auto; width: 360px; height: 360px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); border-radius: 50%;
  box-shadow: 0 0 0 42px color-mix(in srgb, var(--primary) 4%, transparent), 0 0 0 88px color-mix(in srgb, var(--primary) 3%, transparent);
}
.hero__copy { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 18px; color: var(--primary); font-size: 13px; font-weight: 800; }
.eyebrow span { width: 22px; height: 2px; background: currentColor; border-radius: 999px; }
.hero h1 { margin-bottom: 18px; max-width: 780px; font-size: clamp(38px, 5vw, 70px); line-height: 1.18; letter-spacing: -2.4px; }
.hero h1 em { color: var(--primary); font-style: normal; }
.hero p { max-width: 760px; margin-bottom: 24px; color: var(--muted); font-size: 17px; }
.hero__chips { display: flex; flex-wrap: wrap; gap: 9px; }
.hero__chips span { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--surface-2) 72%, transparent); font-size: 12px; }
.hero__visual { position: relative; z-index: 1; }
.pulse-card {
  min-height: 260px; padding: 24px; border: 1px solid var(--line-strong); border-radius: 26px;
  background: color-mix(in srgb, var(--bg-elevated) 80%, transparent); box-shadow: var(--shadow-md);
  transform: rotate(-2deg);
}
.pulse-card__top, .pulse-card__legend { display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); font-size: 11px; }
.live-dot { color: var(--primary); font-weight: 900; letter-spacing: 1px; }
.pulse-card strong { display: block; margin-top: 26px; font-size: 25px; }
.pulse-chart { height: 100px; margin: 24px 0 14px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 8px; }
.pulse-chart i { height: var(--h); border-radius: 8px 8px 3px 3px; background: linear-gradient(to top, color-mix(in srgb, var(--primary) 45%, transparent), var(--primary)); box-shadow: 0 0 20px color-mix(in srgb, var(--primary) 12%, transparent); }

.calculator-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; align-items: start; margin-top: 26px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-md); }
.form-panel { padding: 30px; }
.result-panel { min-height: 720px; padding: 30px; position: sticky; top: 102px; }
.panel__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.panel__heading h2 { margin-bottom: 0; font-size: 25px; line-height: 1.35; }
.section-kicker { display: block; margin-bottom: 3px; color: var(--primary); font-size: 11px; font-weight: 900; letter-spacing: .3px; }
.required-note, .result-state { padding: 6px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted-2); font-size: 11px; white-space: nowrap; }
.result-state.is-ready { color: var(--primary); background: var(--success-bg); }

.field-group { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.field-group legend, .field > label { display: block; width: 100%; margin-bottom: 9px; color: var(--text); font-size: 13px; font-weight: 800; }
.field label small { color: var(--muted-2); font-weight: 500; }
.fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { min-width: 0; margin-bottom: 18px; }
.input-shell, .select-shell { position: relative; }
.input-shell input, .select-shell select {
  width: 100%; height: 54px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-md);
  outline: none; color: var(--text); background: var(--surface-2); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.input-shell input { padding-inline-end: 62px; }
.input-shell > span { position: absolute; inset-inline-end: 16px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 12px; pointer-events: none; }
.input-shell input::placeholder { color: color-mix(in srgb, var(--muted-2) 70%, transparent); }
.input-shell input:hover, .select-shell select:hover { border-color: var(--line-strong); }
.input-shell input:focus, .select-shell select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); background: var(--surface-3); }
.select-shell select { appearance: none; padding-inline-end: 46px; cursor: pointer; }
.select-shell svg { position: absolute; inset-inline-end: 15px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.field-error { display: block; min-height: 20px; margin-top: 5px; color: var(--danger); font-size: 11px; }
.field.is-invalid input, .field.is-invalid select { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 10%, transparent); }
.field-hint { margin: 8px 0 0; color: var(--muted-2); font-size: 11px; }

.segmented { display: grid; gap: 9px; }
.segmented--gender { grid-template-columns: repeat(2, 1fr); }
.segmented--pace { grid-template-columns: repeat(3, 1fr); }
.segmented__option { min-width: 0; cursor: pointer; }
.segmented__option input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__option span {
  min-height: 62px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); color: var(--muted);
  transition: transform .18s var(--ease), border-color .18s ease, background .18s ease, color .18s ease;
}
.segmented__option b { color: var(--text); font-size: 13px; }
.segmented__option small { color: var(--muted-2); font-size: 10px; }
.segmented__option:hover span { transform: translateY(-1px); border-color: var(--line-strong); }
.segmented__option input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 11%, var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 55%, transparent); }
.segmented__option input:checked + span b { color: var(--primary); }
.segmented__option input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent); outline-offset: 2px; }
.pace-group { margin-top: 2px; }
.form-alert { margin: 2px 0 16px; padding: 13px 14px; border: 1px solid color-mix(in srgb, var(--danger) 34%, transparent); border-radius: 14px; color: var(--danger); background: var(--danger-bg); font-size: 12px; }
.form-actions, .result-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.button {
  min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-md); cursor: pointer; font-weight: 850;
  transition: transform .2s var(--ease), box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.button svg { width: 19px; height: 19px; }
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button:focus-visible, .icon-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 30%, transparent); outline-offset: 3px; }
.button--primary { color: var(--primary-ink); background: var(--primary); box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 18%, transparent); }
.button--primary:hover { background: var(--primary-strong); box-shadow: 0 16px 34px color-mix(in srgb, var(--primary) 24%, transparent); }
.button--secondary { color: var(--text); border-color: color-mix(in srgb, var(--blue) 32%, transparent); background: color-mix(in srgb, var(--blue) 12%, var(--surface-2)); }
.button--quiet { color: var(--muted); border-color: var(--line); background: var(--surface-2); }
.button--quiet:hover { border-color: var(--line-strong); color: var(--text); }

.empty-state { min-height: 590px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--line-strong); border-radius: 24px; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface-2) 65%, transparent)); }
.empty-orbit { width: 100px; height: 100px; position: relative; display: grid; place-items: center; margin-bottom: 24px; color: var(--primary); }
.empty-orbit::before, .empty-orbit::after { content: ""; position: absolute; inset: 8px; border: 1px solid var(--line-strong); border-radius: 50%; }
.empty-orbit::after { inset: 23px; }
.empty-orbit svg { width: 36px; height: 36px; }
.empty-orbit span { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 18px var(--primary); }
.empty-orbit span:nth-child(1) { top: 8px; }
.empty-orbit span:nth-child(2) { bottom: 18px; right: 15px; background: var(--blue); }
.empty-orbit span:nth-child(3) { bottom: 18px; left: 15px; background: var(--violet); }
.empty-state h3 { margin-bottom: 8px; font-size: 22px; }
.empty-state p { max-width: 450px; margin-bottom: 26px; color: var(--muted); font-size: 13px; }
.empty-preview { width: min(380px, 75%); display: grid; gap: 9px; }
.empty-preview span { height: 12px; border-radius: 99px; background: var(--surface-3); }
.empty-preview span:nth-child(1) { width: 100%; }.empty-preview span:nth-child(2) { width: 72%; }.empty-preview span:nth-child(3) { width: 46%; }

.results { display: grid; gap: 14px; animation: resultIn .45s var(--ease) both; }
@keyframes resultIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.calorie-overview { min-height: 228px; display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 22px; padding: 22px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line)); border-radius: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, var(--surface-2)), var(--surface-2)); overflow: hidden; position: relative; }
.calorie-overview::after { content: ""; position: absolute; width: 180px; height: 180px; left: -80px; bottom: -100px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 10%, transparent); filter: blur(15px); }
.calorie-ring { --ring-progress: 270deg; width: 176px; height: 176px; padding: 13px; border-radius: 50%; background: conic-gradient(var(--primary) var(--ring-progress), color-mix(in srgb, var(--line-strong) 65%, transparent) 0); box-shadow: 0 0 40px color-mix(in srgb, var(--primary) 10%, transparent); }
.calorie-ring__inner { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); }
.calorie-ring span, .calorie-ring small { color: var(--muted-2); font-size: 10px; }
.calorie-ring strong { margin: 1px 0; font-size: 31px; line-height: 1.25; letter-spacing: -.5px; }
.goal-badge { display: inline-flex; padding: 5px 10px; border-radius: 999px; color: var(--primary); background: var(--success-bg); font-size: 11px; font-weight: 900; }
.calorie-overview__copy h3 { margin: 9px 0 4px; font-size: 23px; }
.calorie-overview__copy p { margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.delta-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 11px; }
.delta-row strong { color: var(--text); font-size: 13px; }

.warning-banner { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 14px; border: 1px solid color-mix(in srgb, var(--amber) 32%, transparent); border-radius: 17px; background: color-mix(in srgb, var(--amber) 8%, var(--surface)); }
.warning-banner svg { width: 25px; height: 25px; color: var(--amber); }
.warning-banner strong { font-size: 13px; }.warning-banner p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metric-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); }
.metric-card__label, .metric-card small { display: block; color: var(--muted-2); font-size: 10px; }
.metric-card strong { display: block; margin: 4px 0 2px; overflow-wrap: anywhere; font-size: 19px; line-height: 1.3; }
.data-card, .insights { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-2); }
.data-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.data-card__header > div > span, .journey-card__top > div > span { color: var(--primary); font-size: 10px; font-weight: 900; }
.data-card__header h3, .journey-card__top h3 { margin: 1px 0 0; font-size: 16px; }
.bmi-summary { display: flex; gap: 8px; }
.bmi-summary span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted-2); font-size: 10px; }
.bmi-summary b { color: var(--text); }
.bmi-scale { position: relative; padding-top: 38px; }
.bmi-scale__track { height: 12px; display: grid; grid-template-columns: 4.5fr 6.5fr 5fr 10fr; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.bmi-scale__track i:nth-child(1) { background: #5aa9e6; }.bmi-scale__track i:nth-child(2) { background: #67e8b5; }.bmi-scale__track i:nth-child(3) { background: #ffd166; }.bmi-scale__track i:nth-child(4) { background: #ff8597; }
.bmi-marker { position: absolute; top: 14px; inset-inline-start: var(--pos, 50%); width: 2px; height: 40px; background: var(--text); transform: translateX(50%); transition: inset-inline-start .65s var(--ease); }
.bmi-marker::after { content: ""; position: absolute; top: 21px; left: 50%; width: 8px; height: 8px; border: 2px solid var(--surface-2); border-radius: 50%; background: var(--text); transform: translate(-50%, -50%); }
.bmi-marker b { position: absolute; top: -14px; left: 50%; padding: 2px 6px; border-radius: 6px; color: var(--surface); background: var(--text); font-size: 8px; white-space: nowrap; transform: translateX(-50%); }
.bmi-marker--target { height: 34px; background: var(--primary); }
.bmi-marker--target::after { background: var(--primary); }.bmi-marker--target b { color: var(--primary-ink); background: var(--primary); }
.bmi-scale__labels { display: grid; grid-template-columns: 4.5fr 6.5fr 5fr 10fr; margin-top: 8px; color: var(--muted-2); font-size: 8px; text-align: center; }
.bmi-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.bmi-footer p { margin: 0; color: var(--muted); font-size: 10px; }.bmi-footer strong { color: var(--text); }
.approx-badge { padding: 5px 8px; border-radius: 999px; color: var(--muted-2); background: var(--surface-3); font-size: 9px; }
.macro-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.macro-grid article { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.macro-grid article > div { min-width: 0; }
.macro-grid small, .macro-grid strong, .macro-grid article div span { display: block; }
.macro-grid small { color: var(--muted-2); font-size: 9px; }.macro-grid strong { margin: 1px 0; font-size: 16px; }.macro-grid article div span { color: var(--muted-2); font-size: 8px; }
.macro-icon { flex: 0 0 33px; width: 33px; height: 33px; display: grid; place-items: center; border-radius: 11px; font-size: 11px; font-weight: 900; }
.macro-icon--protein { color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, transparent); }.macro-icon--carbs { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }.macro-icon--fat { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }.macro-icon--water { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.macro-bar { height: 7px; display: flex; overflow: hidden; margin-top: 14px; border-radius: 999px; background: var(--surface-3); }
.macro-bar i { width: var(--w, 33%); transition: width .5s var(--ease); }.macro-bar i:nth-child(1) { background: var(--violet); }.macro-bar i:nth-child(2) { background: var(--blue); }.macro-bar i:nth-child(3) { background: var(--amber); }
.journey-card__top { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.journey-card__top > strong { color: var(--primary); font-size: 20px; }
.journey-line { height: 4px; position: relative; margin: 28px 8px 14px; border-radius: 999px; background: var(--surface-3); }
.journey-line span, .journey-line b { position: absolute; top: 50%; width: 13px; height: 13px; border: 3px solid var(--surface-2); border-radius: 50%; transform: translateY(-50%); }
.journey-line span { right: 0; background: var(--text); }.journey-line b { left: 0; background: var(--primary); }
.journey-line i { position: absolute; top: 0; right: 0; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(to left, var(--text), var(--primary)); opacity: .7; }
.journey-labels { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 10px; }
.insights ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.insights li { position: relative; padding: 11px 35px 11px 12px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: var(--surface); font-size: 11px; }
.insights li::before { content: ""; position: absolute; right: 14px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 10%, transparent); }
.result-actions { grid-template-columns: 1fr 1fr; margin-top: 2px; }

.method-section { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.method-section article { display: grid; grid-template-columns: 50px 1fr; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.method-section article > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: var(--primary); background: var(--success-bg); font-weight: 900; }
.method-section h3 { margin-bottom: 3px; font-size: 15px; }.method-section p { margin: 0; color: var(--muted); font-size: 11px; }
.medical-note { display: grid; grid-template-columns: 46px 1fr; gap: 16px; margin-top: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.medical-note svg { width: 32px; height: 32px; color: var(--primary); }.medical-note strong { font-size: 14px; }.medical-note p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 18px; }
.site-footer .container { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted-2); font-size: 11px; }
.site-footer p { margin: 0; }
.toast { position: fixed; left: 24px; bottom: 24px; z-index: 50; max-width: 320px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 14px; color: var(--text); background: var(--surface-3); box-shadow: var(--shadow-md); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s var(--ease); }
.toast.is-visible { opacity: 1; transform: none; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero__visual { display: none; }
  .calculator-layout { grid-template-columns: 1fr; }
  .result-panel { position: static; min-height: auto; }
  .empty-state { min-height: 430px; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 24px, var(--container)); }
  .save-status { display: none; }
  .page-shell { padding-top: 20px; }
  .hero { padding: 30px 22px; border-radius: 24px; }
  .hero h1 { font-size: clamp(35px, 11vw, 52px); letter-spacing: -1.5px; }
  .hero p { font-size: 14px; }
  .panel { border-radius: 24px; }
  .form-panel, .result-panel { padding: 20px; }
  .fields-grid { grid-template-columns: 1fr; gap: 0; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .calorie-overview { grid-template-columns: 1fr; text-align: center; }
  .calorie-ring { margin-inline: auto; }
  .delta-row { text-align: start; }
  .macro-grid { grid-template-columns: repeat(2, 1fr); }
  .method-section { grid-template-columns: 1fr; }
  .bmi-footer { display: grid; }
}

@media (max-width: 500px) {
  .site-header__inner { min-height: 68px; }
  .brand small { display: none; }
  .brand__mark { width: 40px; height: 40px; }
  .hero { padding: 26px 18px; }
  .hero h1 { font-size: 38px; }
  .hero__chips { gap: 6px; }.hero__chips span { font-size: 10px; }
  .panel__heading { display: grid; }.required-note, .result-state { justify-self: start; }
  .segmented--pace { grid-template-columns: 1fr; }
  .segmented--pace .segmented__option span { min-height: 54px; flex-direction: row; justify-content: space-between; padding-inline: 14px; }
  .form-actions { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 13px; }.metric-card strong { font-size: 16px; }
  .data-card__header { display: grid; }
  .bmi-summary { justify-self: start; }
  .macro-grid { grid-template-columns: 1fr; }
  .result-actions { grid-template-columns: 1fr; }
  .site-footer .container { align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --surface-3: #f4f4f4; --text: #111; --muted: #444; --muted-2: #666; --line: #ddd; }
  body { background: #fff; }
  .site-header, .hero, .form-panel, .method-section, .medical-note, .site-footer, .result-actions, .ambient, .toast { display: none !important; }
  .container { width: 100%; }
  .page-shell { padding: 0; }
  .calculator-layout { display: block; margin: 0; }
  .result-panel { position: static; border: 0; box-shadow: none; padding: 0; }
  .results { gap: 8px; }
  .data-card, .insights, .metric-card, .calorie-overview { break-inside: avoid; box-shadow: none; }
}

/* Account and authentication */
body.modal-open { overflow: hidden; }
.account-button,
.user-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  transition: transform .2s var(--ease), border-color .2s ease, background .2s ease;
}
.account-button:hover,
.user-button:hover { transform: translateY(-1px); border-color: var(--line-strong); background: var(--surface-2); }
.account-button svg { width: 18px; height: 18px; color: var(--primary); }
.user-area { position: relative; }
.user-button { padding: 4px 8px 4px 11px; gap: 9px; text-align: right; }
.user-button > svg { width: 16px; height: 16px; color: var(--muted-2); }
.user-avatar,
.profile-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary-ink);
  background: var(--primary);
  font-weight: 900;
}
.user-avatar { width: 34px; height: 34px; font-size: 11px; }
.user-button__copy { min-width: 0; display: block; }
.user-button__copy strong,
.user-button__copy small { display: block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-button__copy strong { font-size: 11px; line-height: 1.35; }
.user-button__copy small { color: var(--muted-2); font-size: 9px; }
.user-menu {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  z-index: 45;
  min-width: 190px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.user-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
}
.user-menu button:hover { color: var(--text); background: var(--surface-2); }
.user-menu button svg { width: 17px; height: 17px; }
.user-menu .user-menu__danger { color: var(--danger); }

.setup-notice { border-bottom: 1px solid color-mix(in srgb, var(--amber) 32%, var(--line)); background: color-mix(in srgb, var(--amber) 9%, var(--bg)); }
.setup-notice__inner { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setup-notice strong,
.setup-notice span { display: block; }
.setup-notice strong { font-size: 12px; }
.setup-notice span { color: var(--muted); font-size: 10px; }
.setup-notice button { width: 34px; height: 34px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-size: 23px; }
.setup-notice button:hover { color: var(--text); background: color-mix(in srgb, var(--amber) 12%, transparent); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .18s ease;
}
.modal.is-open { opacity: 1; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(2, 8, 18, .74); backdrop-filter: blur(8px); }
html[data-theme="light"] .modal__backdrop { background: rgba(17, 31, 49, .48); }
.modal__dialog {
  width: min(100%, 480px);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  position: relative;
  z-index: 1;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  transform: translateY(12px) scale(.985);
  transition: transform .2s var(--ease);
}
.modal.is-open .modal__dialog { transform: none; }
.modal__close {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.modal__close:hover { color: var(--text); border-color: var(--line-strong); }
.modal__brand { display: flex; align-items: center; gap: 13px; padding-left: 42px; }
.modal__brand .brand__mark { width: 42px; height: 42px; border-radius: 14px; }
.modal__brand .brand__mark svg { width: 24px; height: 24px; }
.modal__brand h2 { margin: 0 0 2px; font-size: 18px; }
.modal__brand p { margin: 0; color: var(--muted); font-size: 10px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 22px 0 16px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.auth-tabs button { min-height: 39px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.auth-tabs button.is-active { color: var(--primary-ink); background: var(--primary); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 17%, transparent); }
.auth-alert { margin: 0 0 14px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: 12px; color: color-mix(in srgb, var(--danger) 88%, var(--text)); background: var(--danger-bg); font-size: 10px; }
.auth-alert[data-tone="success"] { border-color: color-mix(in srgb, var(--primary) 34%, transparent); color: var(--primary); background: var(--success-bg); }
.auth-form { display: grid; gap: 13px; }
.auth-field { display: grid; gap: 6px; }
.auth-field label { color: var(--text); font-size: 10px; font-weight: 800; }
.auth-field input,
.auth-field select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  color: var(--text);
  background: var(--surface-2);
  font-size: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.auth-field input:focus,
.auth-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.auth-field input::placeholder { color: var(--muted-2); }
.auth-check { display: grid; grid-template-columns: 17px 1fr; gap: 9px; align-items: start; color: var(--muted); cursor: pointer; font-size: 9px; line-height: 1.7; }
.auth-check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--primary-strong); }
.auth-submit { width: 100%; margin-top: 2px; }
.auth-submit.is-loading { opacity: .7; cursor: wait; }
.auth-submit.is-loading span::after { content: "…"; }
.text-button { justify-self: center; padding: 5px 8px; border: 0; color: var(--primary); background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; }
.text-button:hover { text-decoration: underline; }
.auth-view-heading h3 { margin-bottom: 3px; font-size: 16px; }
.auth-view-heading p { margin: 0; color: var(--muted); font-size: 10px; }

.profile-dialog { width: min(100%, 680px); }
.profile-heading { display: flex; align-items: center; gap: 14px; padding-left: 42px; margin-bottom: 20px; }
.profile-avatar { width: 54px; height: 54px; font-size: 15px; }
.profile-heading span { color: var(--primary); font-size: 9px; font-weight: 900; }
.profile-heading h2 { margin: 0; font-size: 19px; }
.profile-heading p { margin: 1px 0 0; direction: ltr; color: var(--muted-2); font-size: 10px; text-align: right; }
.profile-form { display: grid; gap: 16px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.profile-grid__wide { grid-column: 1 / -1; }
.profile-help { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface-2); font-size: 9px; }
.profile-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.button--danger-text { color: var(--danger); }

@media (max-width: 760px) {
  .account-button { padding-inline: 11px; }
  .account-button span { display: none; }
  .account-button svg { width: 20px; height: 20px; }
  .user-button__copy { display: none; }
  .user-button { padding: 4px; }
  .user-button > svg { display: none; }
  .user-menu { left: 0; }
  .modal { padding: 12px; align-items: end; }
  .modal__dialog { width: 100%; max-height: calc(100vh - 24px); padding: 23px 18px; border-radius: 24px 24px 18px 18px; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-grid__wide { grid-column: auto; }
  .profile-actions { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  .header-actions { gap: 7px; }
  .icon-button, .account-button { width: 40px; height: 40px; min-height: 40px; padding: 0; }
  .user-avatar { width: 32px; height: 32px; }
  .setup-notice__inner { padding-block: 9px; }
  .setup-notice span { line-height: 1.55; }
  .modal__brand h2 { font-size: 16px; }
  .modal__brand p { max-width: 240px; }
}

@media print {
  .account-button, .user-area, .setup-notice, .modal { display: none !important; }
}

/* Phone OTP authentication */
.auth-dialog .auth-form { margin-top: 21px; }
.auth-dialog .auth-alert:not([hidden]) + .auth-form { margin-top: 0; }
.phone-input-shell {
  display: grid;
  grid-template-columns: 1fr 48px;
  align-items: center;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.phone-input-shell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}
.phone-input-shell input {
  min-height: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
  text-align: left;
  letter-spacing: .04em;
}
.phone-input-shell > span {
  display: grid;
  align-self: stretch;
  place-items: center;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--primary) 6%);
  font-size: 18px;
}
.auth-help {
  color: var(--muted-2);
  font-size: 9px;
}
.auth-legal {
  margin: 1px 0 0;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.75;
  text-align: center;
}
.otp-input {
  min-height: 58px !important;
  font-size: 23px !important;
  font-weight: 900 !important;
  letter-spacing: .42em;
  text-align: center;
  padding-right: calc(16px + .42em) !important;
  font-variant-numeric: tabular-nums;
}
.otp-input::placeholder { letter-spacing: .3em; }
.otp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
}
.otp-countdown {
  color: var(--muted-2);
  font-size: 9px;
}
.text-button--muted { color: var(--muted-2); }
.auth-view-heading strong {
  display: inline-block;
  direction: ltr;
  color: var(--text);
  font-weight: 850;
}

@media (max-width: 480px) {
  .otp-actions { align-items: flex-start; flex-direction: column; gap: 4px; }
  .otp-input { font-size: 21px !important; }
}
