/* helpMEal visual system. Presentation only; existing flows and data stay intact. */
:root {
  color-scheme: light;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-sm: .875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --ink: #102b28;
  --ink-soft: #50615e;
  --cream: #f7f5ef;
  --paper: #fffdf8;
  --green: #1f6a55;
  --green-dark: #145043;
  --mint: #d8eadf;
  --mint-strong: #9ecbb6;
  --line: #d9e1db;
  --control-border: #7b8f86;
  --coral: #a33d32;
  --error-surface: #fff1ed;
  --success-surface: #edf5ef;
  --focus: #1f6a55;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow: 0 8px 28px rgb(16 43 40 / .045);
  --control-height: 48px;
}

html { font-size: 100%; scroll-padding-top: var(--space-5); }
body { background: var(--cream); font-family: var(--font-body); font-size: var(--text-base); line-height: 1.6; }
button, input, select, textarea { font-family: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: rgb(31 106 85 / .12); }
button { touch-action: manipulation; }
a { text-underline-offset: .2em; }
p, li, h1, h2, h3, h4, h5 { overflow-wrap: break-word; }
h1, h2, h3, h4, h5 { color: var(--ink); font-weight: 700; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 4px;
}
.skip-link { position: absolute; z-index: 100; left: 16px; top: 12px; padding: 12px 18px; border-radius: var(--radius-sm); background: var(--ink); color: white; transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.topbar { max-width: 1216px; padding: 24px 24px 12px; gap: var(--space-5); }
.brand { flex-shrink: 0; max-width: 100%; }
.brand-logo { display: block; width: 270px; max-width: 100%; height: auto; object-fit: contain; }
.top-note { font-size: var(--text-sm); font-weight: 600; }
.helpmeal-app main { max-width: 1216px; padding: 24px 24px 64px; }
.hero { max-width: 880px; padding: 20px 0 32px; }
.eyebrow { font-size: var(--text-sm); font-weight: 600; letter-spacing: .07em; }
h1 { max-width: 820px; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.13; letter-spacing: -.04em; font-weight: 700; }
.hero-copy { max-width: 64ch; margin-bottom: 20px; font-size: var(--text-lg); line-height: 1.65; }
.hero-pills { gap: var(--space-2); }
.hero-pill, .tag { background: var(--paper); color: var(--ink-soft); border-color: var(--line); font-size: var(--text-sm); font-weight: 500; }
.hero-pill strong { font-size: var(--text-sm); font-weight: 700; }
.app-card { background: var(--paper); border-color: var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.app-head { padding: 24px 28px; align-items: center; }
.app-head h2 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -.025em; }
.app-head p { font-size: var(--text-sm); line-height: 1.6; }
.app-head-side:not(:has(.account-menu)):has(.step-count:empty) { display: none; }
.app-body { padding: 32px 28px; }
.section-intro { margin-bottom: 28px; }
.section-intro h3 { font-size: clamp(1.5rem, 2.8vw, 2rem); line-height: 1.25; letter-spacing: -.025em; }
.section-intro p { max-width: 70ch; font-size: var(--text-base); line-height: 1.65; }
.step-count { font-size: var(--text-sm); font-weight: 600; }
.stepper { padding: 0 28px; gap: 12px; }
.step-dot { padding: 14px 4px; color: var(--ink-soft); font-size: var(--text-sm); font-weight: 500; text-transform: none; letter-spacing: 0; line-height: 1.4; }
.step-dot span { display: block; white-space: normal; overflow: visible; }
.step-dot .step-number { display: none; }
.step-dot.is-active { border-color: var(--green); font-weight: 700; background: var(--success-surface); border-radius: 8px 8px 0 0; }
.step-dot.is-done { font-weight: 600; }

/* Every textual input receives the same treatment, including email/password. */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]),
select, textarea, .meal-editor input, .meal-editor select, .meal-editor textarea,
.workflow-card input[type="time"], .workflow-card input[type="date"], .form-grid input {
  display: block; width: 100%; max-width: 100%; min-height: var(--control-height);
  padding: 11px 14px; border: 1px solid var(--control-border); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font-size: var(--text-base); line-height: 1.5;
}
textarea { min-height: 112px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #64756e; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(31 106 85 / .1); }
input:disabled, select:disabled, textarea:disabled { background: #edf0eb; color: var(--ink-soft); cursor: not-allowed; }
.field label, .field legend, .macro-field label { margin-bottom: 8px; font-size: var(--text-sm); font-weight: 600; line-height: 1.5; }
.field small, .field-error, .estimate-label, .practical-tip, .family-group-hint, .sport-day-help,
.sport-day-status, .family-reference, .shopping-guides figcaption { font-size: var(--text-sm); line-height: 1.6; }
.field-error, .field.is-invalid > label, .field.is-invalid > legend, .macro-total.is-invalid, .sport-day-status.is-warning { color: var(--coral); }
.field-error { margin-top: 8px; font-weight: 600; }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--coral) !important; box-shadow: 0 0 0 2px rgb(163 61 50 / .1) !important; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--green); }
.radio-label, .check-label { min-height: 44px; gap: 10px; padding: 10px 12px; border-color: var(--control-border); font-size: var(--text-sm); font-weight: 500; line-height: 1.5; }
.radio-label:has(input:checked), .check-label:has(input:checked) { border-color: var(--green); background: var(--success-surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--green); }
.radio-label:has(input:focus-visible), .check-label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.check-grid { gap: 10px; }
.form-grid { gap: 24px; }
.form-actions { gap: 16px; margin-top: 32px; padding-top: 24px; }

.btn { min-height: var(--control-height); min-width: 48px; padding: 11px 20px; gap: 10px; border-radius: var(--radius-sm); font-size: var(--text-base); line-height: 1.5; font-weight: 600; white-space: normal; text-align: center; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.btn:hover { transform: none; }
.btn-primary { background: var(--green); color: #fff; box-shadow: none; }
.btn-primary:hover { background: var(--green-dark); box-shadow: none; }
.btn-primary:active { background: var(--ink); }
.btn-secondary { border-color: var(--control-border); color: var(--ink); background: white; }
.btn-secondary:hover { background: var(--success-surface); border-color: var(--green); }
.btn-quiet { padding-inline: 14px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: .2em; }
.btn-quiet:hover { color: var(--ink); background: var(--success-surface); }
.btn:disabled { opacity: .65; cursor: not-allowed; box-shadow: none; transform: none; }
.btn[aria-pressed="true"] { outline: 2px solid var(--green); outline-offset: 2px; }
.auth-link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 2px; font-size: var(--text-sm); font-weight: 600; text-align: left; text-decoration: underline; text-underline-offset: .2em; }
.auth-shell { max-width: 560px; }
.auth-card { padding: 0; border: 0; border-radius: 0; background: transparent; }
.auth-card h3 { font-size: 1.375rem; line-height: 1.3; letter-spacing: -.02em; }
.auth-card > p, .auth-switch { font-size: var(--text-sm); line-height: 1.6; }
.auth-form { gap: 20px; }
.auth-switch { margin-top: 12px; margin-bottom: 0; }
.auth-message { color: var(--green-dark); background: var(--success-surface); font-size: var(--text-sm); padding: 14px 16px; }
.auth-message.is-error { color: var(--coral); background: var(--error-surface); border-left: 3px solid var(--coral); }
.account-trigger { min-height: 44px; padding: 8px 12px; max-width: 100%; font-size: var(--text-sm); font-weight: 500; border-color: var(--control-border); }
.account-links { z-index: 30; min-width: 220px; }
.account-links button, .auth-logout { min-height: 44px; padding: 10px 12px; font-size: var(--text-sm); }
.auth-user-email { max-width: 230px; }

.choice-card { min-height: 208px; padding: 24px; border-radius: var(--radius-md); box-shadow: none; }
.choice-card:hover { transform: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.choice-card h3 { padding-right: 12px; font-size: 1.25rem; line-height: 1.35; letter-spacing: -.02em; }
.choice-card p { font-size: var(--text-base); line-height: 1.6; }
.choice-card .choice-icon { margin-bottom: 16px; }
.option-button { padding: 16px; border-color: var(--control-border); border-radius: var(--radius-sm); line-height: 1.5; }
.option-button strong { font-size: var(--text-base); font-weight: 600; }
.option-button span { font-size: var(--text-sm); line-height: 1.6; }
.option-button.is-selected { color: var(--ink); background: var(--success-surface); border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.note { font-size: var(--text-sm); line-height: 1.65; }
.food-group h4, .subsection h4, .macro-settings h4, .summary-card h4, .family-section h4 { font-size: var(--text-lg); font-weight: 600; line-height: 1.4; }
.summary-card h5 { font-size: var(--text-base); line-height: 1.5; }
.metric-label { font-size: var(--text-sm); letter-spacing: .04em; font-weight: 600; }
.metric-number { font-size: 2.5rem; letter-spacing: -.04em; }
.metric-card p, .mini-metric span, .macro-settings > p, .macro-total, .summary-row { font-size: var(--text-sm); line-height: 1.6; }
.summary-row { padding-block: 12px; }
.workflow-card { padding: 24px; border-radius: var(--radius-md); }
.workflow-card h3 { font-size: 1.5rem; line-height: 1.3; letter-spacing: -.025em; }
.workflow-card h4 { font-size: var(--text-lg); line-height: 1.4; }
.workflow-card p, .workflow-card label, .meal-editor label, .form-grid > label { font-size: var(--text-base); line-height: 1.6; }
.workflow-card > label:has(> input[type="checkbox"]) { flex-direction: row; align-items: flex-start; min-height: 44px; gap: 12px; }
.workflow-card > label > input[type="checkbox"] { margin-top: 3px; }
.workflow-message { font-size: var(--text-base); line-height: 1.6; }
.workflow-actions { gap: 12px; margin-block: 20px; }
.mood-choice { min-height: 100px; font-size: var(--text-sm); border-color: var(--control-border); }
.mood-choice.selected { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.journey-actions { max-width: 800px; gap: 16px; }
.edit-day summary, .shopping-guides summary { min-height: 48px; padding-block: 12px; font-size: var(--text-base); line-height: 1.5; }
.edit-meal-row { gap: 16px; }
.catalog-results [role="option"] { min-height: 48px; font-size: var(--text-base); line-height: 1.5; }
.observations-table th, .observations-table td, .weekly-mood span:not(.mood-face), .weekly-mood small { font-size: var(--text-sm); }

/* Meal information: title, procedure, quantities, then nutritional details. */
.result-head h3 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -.025em; line-height: 1.2; }
.result-head p { font-size: var(--text-base); line-height: 1.65; }
.result-badge { font-size: var(--text-sm); font-weight: 600; }
.menu-grid { gap: 24px; }
.day-card { padding: 24px; border-radius: var(--radius-md); }
.day-top { align-items: baseline; gap: 16px; padding-bottom: 14px; }
.day-top strong { font-size: 1.25rem; }
.day-top span { font-size: var(--text-sm); font-weight: 600; }
.meal { padding: 20px 0; }
.meal-label { margin-bottom: 8px; color: var(--green-dark); font-size: var(--text-sm); font-weight: 600; letter-spacing: .02em; text-transform: none; }
.meal .dish-title, .alternative-preview .dish-title, .backup-card .dish-title { margin: 0 0 12px; font-size: 1.125rem; font-weight: 700; line-height: 1.4; overflow-wrap: break-word; }
.meal p, .recipe-procedure { font-size: var(--text-base); line-height: 1.65; }
.meal-portion { margin-top: 12px; font-size: var(--text-sm); line-height: 1.65; }
.meal-macros { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.meal-macros span, .macro-summary span { min-width: 0; padding: 8px 10px; font-size: var(--text-sm); line-height: 1.45; font-weight: 400; flex-wrap: wrap; background: #f1f5ef; }
.meal-macros strong, .macro-summary strong { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
.macro-summary { gap: 8px; }
.day-total { margin-top: 8px; padding-top: 18px; }
.day-total > strong { margin-bottom: 10px; font-size: var(--text-base); }
.backup-card { padding: 20px; box-shadow: none; }
.backup-card strong, .backup-card p, .backup-card small, .backup-replacement label { font-size: var(--text-sm); line-height: 1.6; }
.backup-card .backup-choice { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; }
.backup-card input { margin: 3px 0 0; }
.family-section > p, .family-group h5, .family-result ul { font-size: var(--text-sm); line-height: 1.6; }
.energy-table { font-size: var(--text-sm); }
.result-bottom { gap: 24px; margin-top: 24px; }
.shopping-list { column-gap: 28px; }
.shopping-list li { padding-block: 4px; font-size: var(--text-base); line-height: 1.6; }
.shopping-list.checklist label { min-height: 48px; padding-block: 10px; gap: 12px; }
.shopping-list input { margin-top: 3px; }
.shopping-list input:checked + span { opacity: 1; color: var(--ink-soft); }
.shopping-guides { padding: 16px 20px; background: var(--cream); }
.shopping-guides summary { padding-block: 0; display: list-item; align-content: center; }
.guide-grid h5 { font-size: var(--text-base); }
.calendar-connect { padding: 20px; }
.loading { min-height: 320px; }
.loading > div { max-width: 65ch; }
.loading p { font-size: var(--text-base); line-height: 1.65; }
.footer { max-width: 1216px; padding: 0 24px 32px; font-size: var(--text-sm); line-height: 1.7; }
.privacy-section a { display: inline-block; min-height: 44px; padding-block: 10px; }

.privacy-page .topbar { max-width: 960px; }
.privacy-page main { max-width: 960px; padding: 36px 24px 64px; }
.privacy-page article { background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.privacy-page h1 { font-size: clamp(2rem, 4vw, 3rem); }
.privacy-page h2 { font-size: 1.5rem; line-height: 1.4; letter-spacing: -.02em; }
.privacy-page .back { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--text-sm); }
.privacy-page footer { font-size: var(--text-sm); }

@media (min-width: 1050px) {
  .helpmeal-app main:has(.auth-shell) { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 48px; padding-top: 32px; }
  main:has(.auth-shell) .hero { padding-top: 36px; }
  main:has(.auth-shell) h1 { max-width: 15ch; font-size: clamp(2.5rem, 4vw, 3.5rem); }
  main:has(.auth-shell) .hero-pills { max-width: 440px; }
  main:has(.auth-shell) .app-head { padding: 24px; }
  main:has(.auth-shell) .app-head h2 { font-size: 1.25rem; }
  main:has(.auth-shell) .app-body { padding: 24px; }
  main:has(.auth-shell) .section-intro { margin-bottom: 24px; }
  main:has(.auth-shell) .section-intro h3 { font-size: 1.5rem; }
}
@media (max-width: 820px) {
  .topbar, .helpmeal-app main { padding-inline: 20px; }
  .hero { padding: 12px 0 28px; }
  .app-head, .app-body { padding-inline: 24px; }
  .stepper { padding-inline: 24px; gap: 6px; }
  .step-dot { font-size: .8125rem; padding-inline: 2px; }
  .app-head-side { gap: 8px; }
  .auth-user-email { max-width: 210px; }
  .macro-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card, .family-section { padding: 20px; }
}
@media (max-width: 520px) {
  .topbar { padding: 18px 18px 8px; gap: 10px; }
  .brand-logo { width: 217.5px; }
  .top-note { font-size: var(--text-sm); }
  .helpmeal-app main { padding: 20px 16px 40px; }
  .helpmeal-app main:has(.auth-shell) { display: flex; flex-direction: column; gap: 32px; }
  main:has(.auth-shell) .app-card { order: 0; }
  main:has(.auth-shell) .hero { order: 1; }
  .hero { padding-top: 4px; }
  h1 { font-size: 2rem; line-height: 1.16; letter-spacing: -.035em; }
  .hero-copy { font-size: var(--text-base); line-height: 1.6; margin-bottom: 16px; }
  .hero-pill { font-size: .8125rem; padding: 6px 10px; }
  .eyebrow { margin-bottom: 10px; font-size: .8125rem; }
  .app-card { border-radius: 18px; }
  .app-head { padding: 20px; }
  .app-head h2 { font-size: 1.25rem; }
  .app-head-side { margin-top: 12px; }
  .app-body { padding: 24px 20px; }
  .stepper { padding: 0 10px; gap: 4px; }
  .step-dot { min-height: 48px; font-size: var(--text-sm); line-height: 1.5; }
  .step-dot.is-active { flex-grow: 2.5; }
  .step-dot:not(.is-active) .step-number { display: block; }
  .step-dot:not(.is-active) .step-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .section-intro { margin-bottom: 24px; }
  .section-intro h3 { font-size: 1.5rem; }
  .auth-card h3 { font-size: 1.25rem; }
  .form-grid { gap: 20px; }
  .form-actions { gap: 12px; }
  .form-actions .btn, .workflow-actions .btn { width: 100%; }
  .choice-card { min-height: 190px; padding: 20px; }
  .choice-card h3 { font-size: var(--text-lg); }
  .workflow-card, .meal-editor { padding: 18px 16px; }
  .edit-meal-row { flex-wrap: wrap; }
  .edit-meal-row > span { flex-basis: 60%; }
  .edit-meal-row button { min-height: 44px; font-size: var(--text-sm); }
  .day-card { padding: 20px 16px; }
  .day-top { flex-wrap: wrap; gap: 8px; }
  .meal .dish-title { font-size: var(--text-lg); }
  .backup-grid, .shopping-list { columns: 1; }
  .backup-grid { grid-template-columns: 1fr; }
  .calendar-feed-actions { align-items: stretch; }
  .calendar-feed-actions .btn { width: 100%; }
  .account-trigger { width: 100%; }
  .account-links { min-width: min(240px, calc(100vw - 76px)); }
  .footer { padding-inline: 18px; }
  .privacy-page .topbar { padding-inline: 20px; }
  .privacy-page main { padding: 24px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
