@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/IBMPlexSansArabic_400Regular.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/IBMPlexSansArabic_700Bold.ttf") format("truetype"); }
@font-face { font-family: "Readex Pro"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/ReadexPro_700Bold.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/Inter_400Regular.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/Inter_600SemiBold.ttf") format("truetype"); }
/*
 * The ALYAF site's stylesheet. scripts/site/build-site.mjs puts the
 * @font-face rules in front of it and writes it to site/dist/style.css.
 * Colours are the app's light and dark themes (src/constants/theme.ts).
 * Light is the default; html[data-theme="dark"] is set by the header switch.
 * Logical properties only, so one sheet serves Arabic and English.
 */
:root {
  color-scheme: light;
  --ground: #F4F7F5;
  --surface: #FFFFFF;
  --raised: #EBF0EC;
  --line: #DCE4DF;
  --line-strong: #C7D3CB;
  --ink: #0F1A14;
  --ink-soft: #556760;
  --brand: #147B3B;
  --brand-pale: #ECFDF3;
  --brand-line: #D1FADF;
  --on-brand: #FFFFFF;
  --mark: #147B3B;
  --src-label: #1C70B2;
  --src-mine: #0B7695;
  --estimate: #925B00;
  --warn-bg: #FDF6E7;
  --warn-line: #F0DCB4;
  --warn-ink: #6B4300;
  --note-bg: #FDF6E7;
  --note-text: #5A4300;
  --header: rgba(244, 247, 245, 0.86);
  --shadow-card: 0 1px 2px rgba(15, 26, 20, 0.04);
  --shadow-lift: 0 18px 40px -24px rgba(15, 26, 20, 0.35);
  --radius: 18px;
  --text: "IBM Plex Sans Arabic", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --latin: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0E141B;
  --surface: #1A2029;
  --raised: #232A33;
  --line: #2F3741;
  --line-strong: #3B444F;
  --ink: #E8EDF2;
  --ink-soft: #9AA4B0;
  --brand: #4ADE80;
  --brand-pale: rgba(74, 222, 128, 0.12);
  --brand-line: rgba(74, 222, 128, 0.28);
  --on-brand: #06210F;
  --mark: #FFFFFF;
  --src-label: #6DB9F0;
  --src-mine: #7FDCF4;
  --estimate: #F0B454;
  --warn-bg: rgba(255, 176, 32, 0.12);
  --warn-line: rgba(255, 176, 32, 0.32);
  --warn-ink: #FFD58A;
  --note-bg: #3A2F12;
  --note-text: #FFE7A3;
  --header: rgba(14, 20, 27, 0.86);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lift: 0 18px 40px -24px rgba(0, 0, 0, 0.7);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-block-start: 88px; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.8;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
html[lang="en"] body { font-family: var(--latin); line-height: 1.65; }
:lang(en) { font-family: var(--latin); }
:lang(ar) { font-family: var(--text); }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: max(20px, env(safe-area-inset-left)); }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; inset-inline-start: 12px; inset-block-start: -60px; z-index: 50; background: var(--brand); color: var(--on-brand); padding: 8px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { inset-block-start: 12px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.35; color: var(--ink); }
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3 { font-family: var(--latin); font-weight: 600; letter-spacing: -0.015em; }
h1 { text-wrap: pretty; }
h2, h3 { text-wrap: balance; }
.num { font-family: var(--latin); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ header */
.site-header { position: sticky; inset-block-start: 0; z-index: 20; background: var(--header); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-block-end: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; direction: ltr; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark { height: 32px; width: auto; fill: var(--mark); padding-block: 2px; }
.brand-word { font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1; }
.brand-word:lang(en) { font-family: var(--latin); font-weight: 600; letter-spacing: 0.08em; font-size: 1.05rem; }
.nav-wide { display: flex; justify-content: center; gap: 2px; flex: 1; }
.nav-wide a, .nav-narrow a { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 0.96rem; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.nav-wide a:hover, .nav-narrow a:hover { color: var(--ink); background: var(--raised); }
.nav-wide a[aria-current="page"], .nav-narrow a[aria-current="page"] { color: var(--brand); background: var(--brand-pale); font-weight: 600; }
.header-tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.lang-switch { display: inline-flex; align-items: center; min-height: 42px; padding-inline: 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.lang-switch:hover { border-color: var(--line-strong); }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
.menu { position: relative; display: none; }
.menu summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-bars, .menu-bars::before, .menu-bars::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); position: relative; transition: transform 0.2s ease, background-color 0.2s ease; }
.menu-bars::before, .menu-bars::after { content: ""; position: absolute; inset-inline-start: 0; }
.menu-bars::before { inset-block-start: -6px; }
.menu-bars::after { inset-block-start: 6px; }
.menu[open] .menu-bars { background: transparent; }
.menu[open] .menu-bars::before { transform: translateY(6px) rotate(45deg); }
.menu[open] .menu-bars::after { transform: translateY(-6px) rotate(-45deg); }
.nav-narrow { position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 10px); min-width: 240px; display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lift); }
.nav-narrow a { padding: 12px 14px; font-size: 1rem; border-radius: 12px; }
@media (max-width: 980px) {
  .nav-wide { display: none; }
  .menu { display: block; }
}

/* ----------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding-inline: 24px; border-radius: 14px; font-weight: 600; text-decoration: none; font-size: 1rem; line-height: 1.3; text-align: center; border: 1px solid transparent; }
.btn-solid { background: var(--brand); color: var(--on-brand); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
a.btn:hover { text-decoration: none; filter: brightness(1.06); }
a.btn-quiet:hover { border-color: var(--line-strong); }

/* ------------------------------------------------------------- the badges */
.trust { --tint: var(--brand); display: inline-flex; align-items: center; gap: 6px; inline-size: fit-content; padding-block: 3px; padding-inline: 6px 11px; border-radius: 999px; font-weight: 700; font-size: 0.8rem; line-height: 1.4; color: var(--tint); background: color-mix(in srgb, var(--tint) 13%, transparent); white-space: nowrap; }
.trust-label { --tint: var(--src-label); }
.trust-mine { --tint: var(--src-mine); background: color-mix(in srgb, var(--tint) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tint) 35%, transparent); }
.trust-edited { --tint: var(--ink); background: var(--raised); border: 1px solid var(--line); }
.trust-estimate { --tint: var(--estimate); background: color-mix(in srgb, var(--tint) 10%, transparent); border: 1px solid color-mix(in srgb, var(--tint) 45%, transparent); }
.trust-disc { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--tint); }
.trust-tick { width: 11px; height: 11px; color: var(--surface); stroke-width: 3.4; }
.trust-ico { width: 15px; height: 15px; }

/* ----------------------------------------------------------------- landing */
.hero { padding-block: 72px 80px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 64px; align-items: center; }
.badge { display: inline-block; margin: 0 0 20px; padding: 5px 16px; border-radius: 999px; background: var(--brand-pale); border: 1px solid var(--brand-line); color: var(--brand); font-weight: 600; font-size: 0.92rem; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.3rem); line-height: 1.18; margin: 0 0 22px; }
.accent { color: var(--brand); }
.lead { font-size: 1.18rem; color: var(--ink-soft); margin: 0 0 30px; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.soon { margin: 18px 0 0; color: var(--ink-soft); font-size: 0.92rem; display: flex; align-items: center; gap: 8px; }
.soon::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-pale); }
.meal-card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 26px; box-shadow: var(--shadow-lift); }
.meal-card figcaption { display: flex; justify-content: space-between; align-items: baseline; padding-block-end: 16px; border-block-end: 1px solid var(--line); }
.meal-card figcaption b { font-family: var(--display); font-size: 1.15rem; }
html[lang="en"] .meal-card figcaption b { font-family: var(--latin); }
.meal-card figcaption span { color: var(--ink-soft); font-size: 0.85rem; }
.meal-card ul { list-style: none; margin: 0; padding: 0; }
.meal-card li { display: flex; align-items: center; gap: 12px; padding-block: 16px; border-block-end: 1px solid var(--line); }
.food { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex: 1; line-height: 1.4; }
.food small { color: var(--ink-soft); font-size: 0.82rem; }
.food .trust { margin-block-start: 6px; }
.kcal { color: var(--ink-soft); font-size: 0.9rem; white-space: nowrap; }
.kcal b { color: var(--ink); font-size: 1.05rem; }
.meal-total { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 0; font-weight: 700; }
.meal-total b { color: var(--brand); font-size: 1.7rem; }
.section { padding-block: 72px; }
.band { background: var(--surface); border-block: 1px solid var(--line); padding-block: 72px; }
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 0 0 10px; }
.section-lead { color: var(--ink-soft); margin: 0 0 36px; max-width: 46em; font-size: 1.05rem; }
.trust-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.trust-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-card); }
.trust-card .trust { font-size: 0.88rem; padding-block: 5px; }
.trust-card p { margin: 12px 0 0; color: var(--ink-soft); font-size: 0.97rem; }
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 16px; align-items: start; background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature .ico { grid-row: span 2; width: 46px; height: 46px; padding: 11px; border-radius: 14px; background: var(--brand-pale); color: var(--brand); }
.feature h3 { font-size: 1.1rem; margin: 2px 0 4px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }
.split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-block: 72px; }
.panel { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px; }
.panel h2 { font-size: 1.35rem; margin: 16px 0 8px; }
.panel p { color: var(--ink-soft); margin: 0 0 20px; }
.panel .panel-links { display: flex; flex-wrap: wrap; gap: 10px; margin: auto 0 0; }
.panel-ico { width: 46px; height: 46px; padding: 11px; border-radius: 14px; background: var(--brand-pale); color: var(--brand); }
.panel-calc { border-color: var(--brand-line); }
.panel-brand { background: var(--brand-pale); border-color: var(--brand-line); }
.panel-mark { height: 46px; width: auto; fill: var(--mark); }
@media (max-width: 1060px) {
  .split { grid-template-columns: 1fr 1fr; }
  .panel-brand { grid-column: 1 / -1; }
  .trust-grid, .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { padding-block: 36px 44px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .section, .band { padding-block: 48px; }
  .split { padding-block: 44px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding-inline: max(16px, env(safe-area-inset-left)); }
  .trust-grid, .features, .split { grid-template-columns: 1fr; gap: 12px; }
  .feature, .trust-card { padding: 18px; }
  .actions .btn { flex: 1 1 100%; }
  .meal-card { padding: 18px; }
  .panel { padding: 22px; }
}

/* --------------------------------------------------------------- documents */
.page-head { background: var(--surface); border-block-end: 1px solid var(--line); padding-block: 48px 40px; }
.eyebrow { margin: 0 0 6px; color: var(--brand); font-weight: 600; font-size: 0.92rem; }
.page-head h1 { margin: 0; font-size: clamp(1.9rem, 4.4vw, 2.8rem); }
.page-lead { margin: 12px 0 0; color: var(--ink-soft); font-size: 1.08rem; max-width: 46em; }
.doc { padding-block: 40px 72px; }
.doc.has-toc { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc-wide { position: sticky; inset-block-start: 92px; max-height: calc(100vh - 116px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 8px 14px; }
.toc-title { font-weight: 700; font-family: var(--display); margin: 0 0 8px; padding-inline: 12px; }
html[lang="en"] .toc-title { font-family: var(--latin); }
.toc-box { display: none; }
.toc-box summary { list-style: none; }
.toc-box summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 7px 12px; border-radius: 10px; color: var(--ink-soft); text-decoration: none; font-size: 0.92rem; line-height: 1.5; }
.toc a:hover { color: var(--brand); background: var(--brand-pale); }
.prose { max-width: 820px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 36px 44px; box-shadow: var(--shadow-card); }
.prose > :first-child { margin-block-start: 0; }
.prose > :last-child { margin-block-end: 0; }
.prose h2 { font-size: 1.38rem; margin-block: 1.8em 0.6em; padding-block-start: 1.1em; border-block-start: 1px solid var(--line); }
.prose h3 { font-size: 1.14rem; margin-block: 1.6em 0.4em; }
.prose h4 { font-size: 1rem; margin-block: 1.4em 0.4em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose .table-wrap { margin-block: 0 1em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose li { margin-block: 0.35em; }
.prose li > p { margin-block: 0.4em; }
.prose strong { font-weight: 700; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--brand-pale); padding-inline: 0.35em; border-radius: 6px; direction: ltr; unicode-bidi: isolate; }
.prose blockquote { margin-inline: 0; padding: 14px 18px; border-inline-start: 4px solid var(--brand); background: var(--ground); border-radius: 12px; }
.prose blockquote > :last-child { margin-block-end: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.93em; }
.prose th, .prose td { border-block-end: 1px solid var(--line); padding: 10px 14px; text-align: start; vertical-align: top; line-height: 1.6; }
.prose tr:last-child td { border-block-end: 0; }
.prose th { background: var(--raised); font-weight: 700; white-space: nowrap; }
.prose td + td, .prose th + th { border-inline-start: 1px solid var(--line); }
.prose hr { border: 0; border-block-start: 1px solid var(--line); margin-block: 2em; }
mark.pending { background: #FFE58F; color: #000000; padding-inline: 0.2em; border-radius: 3px; }
.preview-note { margin-block: 16px 0; padding: 10px 14px; border-radius: 10px; background: var(--note-bg); color: var(--note-text); font-weight: 500; }
.attributions { margin-block-start: 2em; }
@media (max-width: 980px) {
  .doc.has-toc { grid-template-columns: 1fr; gap: 20px; }
  .toc-wide { display: none; }
  .toc-box { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px; }
  .toc-box summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 48px; margin: 0; font-weight: 700; font-family: var(--display); }
  html[lang="en"] .toc-box summary { font-family: var(--latin); }
  .toc-box summary::after { content: ""; width: 9px; height: 9px; border-inline-end: 2px solid var(--ink-soft); border-block-end: 2px solid var(--ink-soft); transform: rotate(45deg); margin-block-start: -4px; transition: transform 0.2s ease; }
  .toc-box[open] summary::after { transform: rotate(-135deg); margin-block-start: 4px; }
  .toc-box ol { margin-block-end: 12px; }
  .toc-box a { padding-inline: 0; }
  .prose { max-width: none; }
}
@media (max-width: 640px) {
  .page-head { padding-block: 28px 22px; }
  .doc { padding-block: 20px 44px; }
  .prose { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  .prose table { min-width: 560px; }
  .prose h2 { font-size: 1.22rem; }
}

/* -------------------------------------------------------------- calculator */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; align-items: start; padding-block: 36px 72px; }
.calc-form { display: grid; gap: 16px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow-card); }
fieldset.card { margin: 0; min-width: 0; }
.card legend { float: inline-start; width: 100%; padding: 0; margin-block-end: 14px; font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
html[lang="en"] .card legend { font-family: var(--latin); font-weight: 600; }
.card legend + * { clear: both; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-block-start: 16px; }
.target-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-weight: 600; font-size: 0.95rem; }
.field-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--ground); padding-inline: 12px; min-height: 50px; }
.field-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-pale); }
.field-box input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: 600 1.1rem var(--latin); padding: 0; outline: none; -moz-appearance: textfield; }
.field-box input::-webkit-outer-spin-button, .field-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field-unit { color: var(--ink-soft); font-size: 0.9rem; flex: none; }
.field-range { color: var(--ink-soft); font-size: 0.78rem; text-align: end; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice { position: relative; display: flex; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--ground); line-height: 1.45; transition: border-color 0.15s ease, background-color 0.15s ease; }
.seg .choice-body { align-items: center; text-align: center; }
.choice-body b { font-weight: 600; }
.choice-body small { color: var(--ink-soft); font-size: 0.82rem; }
.choice:hover .choice-body { border-color: var(--line-strong); }
.choice input:checked + .choice-body { border-color: var(--brand); background: var(--brand-pale); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input:checked + .choice-body b { color: var(--brand); }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--brand); outline-offset: 2px; }
.calc-result { position: sticky; inset-block-start: 92px; }
.result-card h2 { font-size: 1.15rem; margin: 0 0 6px; }
html[lang="en"] .result-card h2 { font-weight: 600; }
.result-card h3 { font-size: 1rem; margin: 22px 0 10px; }
.result-problem { margin: 8px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--raised); color: var(--ink-soft); font-size: 0.93rem; }
.result-kcal { margin: 6px 0 4px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.result-kcal b { font-size: 3rem; line-height: 1.1; color: var(--brand); font-weight: 600; }
.result-kcal span { color: var(--ink-soft); }
.result-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 0; }
.result-sub div { background: var(--ground); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.result-sub dt { color: var(--ink-soft); font-size: 0.8rem; }
.result-sub dd { margin: 2px 0 0; font-weight: 600; }
.result-warning { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); font-size: 0.9rem; line-height: 1.6; }
.macros, .nutrients { list-style: none; margin: 0; padding: 0; }
.macro { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name grams" "bar share"; column-gap: 12px; row-gap: 6px; padding-block: 8px; align-items: center; }
.macro-name { grid-area: name; font-weight: 600; }
.macro-grams { grid-area: grams; color: var(--ink-soft); font-size: 0.9rem; }
.macro-grams b { color: var(--ink); font-size: 1.1rem; }
.macro-bar { grid-area: bar; height: 8px; border-radius: 99px; background: var(--raised); overflow: hidden; }
.macro-bar span { display: block; height: 100%; inline-size: 0%; border-radius: 99px; background: var(--brand); transition: inline-size 0.3s ease; }
.macro-carbs .macro-bar span { background: var(--src-label); }
.macro-fat .macro-bar span { background: var(--estimate); }
.macro-share { grid-area: share; color: var(--ink-soft); font-size: 0.85rem; min-width: 3ch; text-align: end; }
.nutrients li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding-block: 9px; border-block-end: 1px solid var(--line); font-size: 0.95rem; }
.nutrients li:last-child { border-block-end: 0; }
.n-kind { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.n-goal { color: var(--brand); background: var(--brand-pale); }
.n-limit { color: var(--estimate); background: color-mix(in srgb, var(--estimate) 12%, transparent); }
.n-value { min-width: 6.5em; text-align: end; color: var(--ink-soft); font-size: 0.9rem; }
.n-value b { color: var(--ink); font-size: 1rem; }
.result-note { margin: 18px 0 0; color: var(--ink-soft); font-size: 0.85rem; line-height: 1.7; }
.calc-peek { display: none; }
@media (max-width: 980px) {
  .calc-grid { grid-template-columns: 1fr; padding-block: 20px 96px; }
  .calc-result { position: static; }
  .calc-peek { position: fixed; z-index: 15; inset-inline: 12px; inset-block-end: max(12px, env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding-inline: 18px; border-radius: 16px; background: var(--brand); color: var(--on-brand); text-decoration: none; font-weight: 600; box-shadow: var(--shadow-lift); transition: transform 0.25s ease, opacity 0.25s ease; }
  .calc-peek b { font-size: 1.25rem; }
  .calc-peek.away { transform: translateY(140%); opacity: 0; pointer-events: none; }
}
@media (max-width: 640px) {
  .card { padding: 18px; }
  .fields { grid-template-columns: 1fr 1fr; }
  .fields .field:first-child { grid-column: 1 / -1; }
  .target-fields .field:first-child { grid-column: auto; }
  .choices { grid-template-columns: 1fr; }
  .seg-4 { grid-template-columns: 1fr 1fr; }
  .result-kcal b { font-size: 2.6rem; }
}

/* ------------------------------------------------------------------ footer */
.site-footer { background: var(--surface); border-block-start: 1px solid var(--line); padding-block: 56px max(28px, env(safe-area-inset-bottom)); color: var(--ink-soft); font-size: 0.95rem; }
.foot-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }
.foot-brand p { margin: 14px 0 0; max-width: 22em; }
.foot-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot-col h2 { font-family: var(--text); font-size: 0.88rem; font-weight: 700; color: var(--ink); margin: 0 0 10px; }
html[lang="en"] .foot-col h2 { font-family: var(--latin); }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin: 0; }
.foot-col a { display: inline-block; padding-block: 6px; color: var(--ink-soft); text-decoration: none; }
.foot-col a:hover { color: var(--brand); text-decoration: underline; }
.foot-base { margin-block-start: 40px; padding-block-start: 20px; border-block-start: 1px solid var(--line); font-size: 0.85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; }
.foot-base p { margin: 0; }
@media (max-width: 760px) {
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .foot-links { grid-template-columns: 1fr 1fr; }
  .foot-links .foot-col:last-child { grid-column: 1 / -1; }
  .foot-base { flex-direction: column; }
}
.not-found { text-align: center; padding-block: 96px; }
.nf-mark { height: 64px; width: auto; fill: var(--mark); }
