@layer reset, base, components, pages, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, h4, p { margin: 0; }
  button, input, select, textarea { font: inherit; }
  button, input[type=submit], summary { cursor: pointer; }
  img, svg { max-width: 100%; }
  [hidden] { display: none !important; }
}

@layer base {
  :root {
    --paper: #f7f6f0; --surface: #fffefa; --ink: #24392f; --muted: #607067;
    --green: #214b3c; --green-hover: #173c2e; --sage: #e5eadb; --line: #dce1d7;
    --yellow: #eed68a; --error: #8b302c; --error-bg: #faece8;
    --radius: 18px; --serif: Georgia, "Times New Roman", serif;
  }
  html { scroll-behavior: smooth; }
  body { background: var(--paper); color: var(--ink); font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .9375rem; line-height: 1.55; overflow-wrap: anywhere; }
  a { color: inherit; text-underline-offset: 4px; }
  button, input[type=submit] { appearance: none; }
  :focus-visible { outline: 3px solid #a25b16; outline-offset: 4px; }
  h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.1rem, 4.2vw, 3.7rem); line-height: 1.13; letter-spacing: -.04em; }
  h2 { font-size: 1.4rem; line-height: 1.3; letter-spacing: -.025em; }
  h3 { font-size: 1.18rem; line-height: 1.4; }
  h4 { font-size: 1.2rem; line-height: 1.35; letter-spacing: -.025em; }
  h1 em { color: #527044; font-weight: 400; }
  label, .field-label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 7px; }
  input:not([type=checkbox],[type=submit],[type=hidden]), select, textarea { width: 100%; min-height: 48px; border: 1px solid #83917f; border-radius: 9px; background: var(--surface); color: var(--ink); padding: 11px 13px; }
  textarea { resize: vertical; }
  input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--green); }
  fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 20px; }
  fieldset:disabled { opacity: .7; }
  small { font-size: .8rem; color: var(--muted); }
  .muted { color: var(--muted); }
  .eyebrow { display: block; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
  .quiet-note { color: var(--muted); font-size: .82rem; margin-top: 22px; }
}

@layer components {
  .site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
  .header-inner { min-height: 88px; max-width: 1360px; margin: auto; padding: 0 48px; display: flex; align-items: center; gap: 28px; }
  .brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.55rem; font-weight: 750; letter-spacing: -.055em; text-decoration: none; color: var(--green); flex-shrink: 0; max-width: 100%; }
  .brand-icon { width: 40px; height: 40px; flex-shrink: 0; }
  .brand-wordmark { min-width: 0; line-height: 1.12; }
  .brand-order { font-weight: 350; letter-spacing: -.045em; }
  .icon { width: 20px; height: 20px; flex-shrink: 0; }
  .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .primary-nav { display: flex; gap: 24px; align-self: stretch; align-items: center; flex: 1; }
  .primary-nav a { text-decoration: none; color: var(--muted); height: 100%; display: inline-flex; align-items: center; border-bottom: 3px solid transparent; padding-top: 3px; font-size: .88rem; font-weight: 600; }
  .primary-nav a.active { color: var(--green); border-color: var(--green); }
  .primary-nav a:hover { color: var(--green); }
  .header-account { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; text-decoration: none; }
  .header-account:hover, .header-account[aria-current] { background: var(--sage); }
  .header-account[aria-current] .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--green); }
  .header-tagline { flex: 1; color: var(--muted); font-size: .82rem; }
  .language-picker { position: relative; flex-shrink: 0; margin-left: auto; }
  .language-control { display: flex; align-items: center; gap: 9px; list-style: none; min-height: 44px; padding: 8px 10px; border-radius: 9px; font-size: .8rem; font-weight: 550; }
  .language-control::-webkit-details-marker { display: none; }
  .language-control:hover, .language-picker[open] > .language-control { background: var(--sage); }
  .language-control > .icon { width: 15px; height: 15px; }
  .language-picker[open] > .language-control > .icon { transform: rotate(180deg); }
  .language-flag { font-size: 1.15rem; line-height: 1; }
  .language-options { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: max-content; min-width: 190px; max-width: calc(100vw - 40px); padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 10px 30px #173c2e1c; }
  .language-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: left; text-decoration: none; font-size: .85rem; }
  .language-option:hover { background: var(--paper); }
  .language-option[aria-current] { background: var(--sage); color: var(--green); font-weight: 600; }
  .language-option > .icon { width: 17px; height: 17px; margin-left: auto; }
  .language-picker-field { margin-left: 0; }
  .language-picker-field > .language-control { min-height: 48px; padding: 11px 13px; border: 1px solid var(--line); font-size: .9rem; }
  .language-picker-field > .language-control > .icon { margin-left: auto; }
  .language-picker-field > .language-options { width: 100%; min-width: 0; max-width: none; }
  .main-container { max-width: 1184px; margin: auto; padding: 48px 48px 80px; min-height: calc(100vh - 190px); }
  .site-footer { max-width: 1184px; margin: auto; padding: 24px 48px 34px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .76rem; gap: 16px; }
  .site-footer .brand { font-size: 1.05rem; }
  .site-footer .brand-icon { width: 28px; height: 28px; }
  .page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
  .page-heading p { margin-top: 14px; color: var(--muted); }
  .page-heading .heading-note { display: flex; align-items: start; gap: 8px; color: var(--muted); font-size: .8rem; margin-top: 12px; }
  .heading-note .icon { width: 17px; height: 17px; margin-top: 2px; }
  .button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; border: 1px solid transparent; min-height: 44px; padding: 11px 18px; font-size: .84rem; font-weight: 650; text-decoration: none; line-height: 1.3; transition: background .15s, transform .15s; }
  .button.primary { color: white; background: var(--green); }
  .button.primary:hover { background: var(--green-hover); }
  .button.secondary { color: var(--green); background: var(--sage); }
  .button.quiet, .icon-button { background: var(--surface); color: var(--green); border-color: var(--line); }
  .button.quiet:hover, .icon-button:hover { background: var(--sage); }
  .button:disabled { background: #e9eae3; color: #687269; cursor: not-allowed; border-color: transparent; }
  .icon-button { width: 44px; padding: 8px; font-size: 1.25rem; }
  .text-link, .text-button { font-size: .84rem; color: var(--green); font-weight: 650; }
  .text-button { border: 0; background: none; padding: 11px 4px; text-decoration: underline; text-underline-offset: 4px; min-height: 44px; }
  .message { padding: 15px 18px; border-radius: 10px; background: var(--sage); font-size: .9rem; margin-bottom: 20px; }
  .message-error { background: var(--error-bg); color: var(--error); }
  .toast-stack { position: fixed; top: 24px; right: 24px; z-index: 100; display: grid; gap: 12px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
  .toast { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 8px 28px #173c2e20; pointer-events: auto; }
  .toast-content { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; font-size: .88rem; }
  .toast-body { flex: 1; min-width: 0; }
  .toast-action { margin-left: 42px; }
  .toast-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: var(--sage); color: var(--green); }
  .toast-icon .icon { width: 18px; height: 18px; }
  .toast-dismiss { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; flex-shrink: 0; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
  .toast-dismiss:hover { background: var(--paper); color: var(--ink); }
  .skip-link { position: absolute; left: 20px; top: -100px; background: var(--green); color: white; padding: 12px 20px; z-index: 20; border-radius: 8px; }
  .skip-link:focus { top: 12px; }
  .avatar { flex-shrink: 0; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; background: #e5dac1; border-radius: 50%; font-size: .76rem; font-weight: 700; color: #5d4b30; }
  .avatar.small { width: 30px; height: 30px; font-size: .67rem; }
  .avatar.large { width: 62px; height: 62px; font-size: 1.05rem; margin-bottom: 20px; }
  .child-switcher { display: flex; gap: 8px; margin: 0 0 20px; flex-wrap: wrap; }
  .child-chip { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; gap: 9px; padding: 8px 12px; text-decoration: none; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
  .child-chip strong { display: block; font-size: .82rem; }
  .child-chip .avatar { width: 28px; height: 28px; font-size: .62rem; }
  .child-chip.selected { border-color: var(--green); background: #edf0e6; box-shadow: inset 0 0 0 1px var(--green); }
  .child-chip:nth-child(2) .avatar { background: #d5e1d7; color: #395a48; }
  .chip-check { margin-left: auto; font-size: .85rem; color: var(--green); }
  .status { display: inline-flex; align-items: center; border-radius: 30px; padding: 5px 11px; font-weight: 650; font-size: .69rem; background: #eee; }
  .status-ordered { background: #e0e9d5; color: #35542b; }
  .status-not_ordered { background: #f3e8bd; color: #705823; }
  .status-cancelled, .status-not_available, .status-ordering_closed { background: #eeeee7; color: #626c63; }
  .form-panel, .auth-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; max-width: 640px; }
  .form-panel.wide { max-width: none; }
  .form-panel.deadline-settings { max-width: 800px; }
  .deadline-rule-fields { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
  .deadline-rule-fields legend { font-size: 1.1rem; font-weight: 650; margin-bottom: 16px; }
  .rule-inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1fr); align-items: end; gap: 18px; }
  .closure-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .deadline-settings .quiet-note { margin-top: 0; }
  .day-deadlines { display: grid; gap: 6px; margin: 0 0 22px; font-size: .8rem; }
  .day-deadlines > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
  .day-deadlines dt { flex: 0 1 9em; color: var(--muted); }
  .day-deadlines dd { margin: 0; font-weight: 550; font-variant-numeric: tabular-nums; }
  .rule-example { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
  .rule-example h2 { font-size: 1.05rem; margin-bottom: 18px; }
  .institution-settings { margin: 32px 0; max-width: 800px; }
  .institution-settings > .text-link { display: block; width: fit-content; margin-top: 14px; }
  .institution-settings > .quiet-note { margin-top: 8px; }
  .closure-list { list-style: none; padding: 0; margin: 18px 0 0; }
  .closure-list li { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
  .closure-list li span { display: block; color: var(--muted); font-size: .85rem; }
  @media (max-width: 540px) {
    .rule-inputs { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
    .rule-inputs > div:last-child { grid-column: 1 / -1; max-width: 180px; }
    .closure-dates { grid-template-columns: minmax(0, 1fr); }
  }
  .form-stack { display: grid; gap: 20px; margin-top: 26px; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .inline-form { display: flex; gap: 20px; align-items: end; flex-wrap: wrap; margin-top: 16px; }
  .inline-form > div:first-child { flex: 1; }
  .check-field { display: flex; gap: 10px; align-items: center; }
  .check-field label { margin: 0; }
  .field_with_errors input, .field_with_errors select { border-color: var(--error); }
  .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 32px 0 22px; }
  .empty-state { padding: 40px 28px; border: 1px dashed #bdc6b8; border-radius: var(--radius); background: #f0f1e9; text-align: center; color: var(--muted); }
  .empty-state p { margin-top: 10px; }
}

@layer pages {
  .week-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; margin: 32px 0 20px; border-top: 1px solid var(--line); padding-top: 24px; }
  .week-navigation { display: flex; align-items: center; gap: 16px; margin-left: auto; }
  .week-selection { display: flex; align-items: flex-start; gap: 12px; min-height: 60px; padding: 6px 0; border-radius: 6px; color: var(--ink); }
  .week-title { display: grid; gap: 4px; min-width: 0; }
  .week-dates { font-size: 1.3rem; line-height: 1.3; font-weight: 650; letter-spacing: -.025em; }
  .week-meta { color: var(--muted); font-size: .76rem; font-weight: 400; }
  .week-selection > .icon { width: 18px; height: 18px; margin-top: .28rem; color: var(--green); }
  .week-selection:hover .week-dates { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
  .week-stepper { display: flex; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  .week-stepper a { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--green); }
  .week-stepper a:first-child { border-radius: 9px 0 0 9px; }
  .week-stepper a:last-child { border-left: 1px solid var(--line); border-radius: 0 9px 9px 0; }
  .week-stepper a:hover { background: var(--sage); }
  .week-picker { position: relative; min-width: 0; }
  .week-picker > summary { list-style: none; }
  .week-picker > summary::-webkit-details-marker { display: none; }
  .week-picker[open] > summary > .icon { transform: rotate(180deg); }
  .week-popover { position: absolute; top: calc(100% + 8px); right: 0; width: min(350px, calc(100vw - 32px)); max-height: min(440px, calc(100dvh - 32px)); z-index: 30; display: flex; flex-direction: column; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 12px 36px #173c2e25; }
  .week-picker-heading { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
  .week-picker-heading strong { font-size: 1.05rem; padding: 8px; }
  .week-picker-list { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 6px; }
  .week-option { display: grid; grid-template-columns: 5em 1fr; gap: 10px; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: 7px; text-decoration: none; font-size: .82rem; }
  .week-option span { color: var(--muted); }
  .week-option:hover { background: #f0f1e9; }
  .week-option[aria-current] { background: var(--sage); color: var(--green); }
  .week-list { display: grid; gap: 18px; }
  .meal-payment-notice { max-width: 75ch; margin-bottom: 20px; color: var(--muted); font-size: .85rem; line-height: 1.5; }
  .meal-day { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--surface); overflow: clip; }
  .meal-day.is-today { border-color: #8c9f7e; }
  .day-heading { display: flex; align-items: center; gap: 14px; list-style: none; }
  .day-heading::-webkit-details-marker { display: none; }
  .day-summary-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-shrink: 0; }
  .day-summary-actions > .icon { width: 18px; height: 18px; color: var(--muted); }
  .day-history-link { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 9px; color: var(--muted); }
  .day-history-link:hover { background: var(--sage); color: var(--green); }
  .day-disclosure[open] > .day-heading .day-summary-actions > .icon { transform: rotate(180deg); }
  .day-choice-preview { color: var(--green); font-size: .82rem; margin-top: 4px; }
  .day-order-summary { color: var(--muted); font-size: .82rem; margin-top: 4px; }
  .day-content { padding-top: 20px; }
  .date-tile { width: 48px; min-height: 57px; text-align: center; background: #eff0e8; border-radius: 9px; padding: 5px; flex-shrink: 0; }
  .date-tile span { display: block; font-size: .65rem; text-transform: uppercase; }
  .date-tile strong { display: block; font-size: 1.4rem; line-height: 1.2; font-weight: 500; }
  .meal-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .meal-choice { padding: 21px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: stretch; background: #fffefa; }
  .meal-choice.chosen { border-color: #668056; background: #f0f4e8; }
  .meal-choice-content { min-width: 0; }
  .meal-choice:only-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .8fr); align-items: end; column-gap: 24px; }
  .meal-choice:only-child .meal-details { margin-bottom: 0; }
  .meal-choice:only-child .meal-choice-footer { justify-content: flex-end; column-gap: 18px; }
  .meal-choice:only-child .meal-cancellation { margin-left: 0; }
  .meal-category { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
  .meal-number { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
  .diet-label { font-size: .66rem; letter-spacing: .045em; text-transform: uppercase; color: #586b4b; }
  .meal-description { margin-top: 9px; color: var(--muted); font-size: .83rem; line-height: 1.65; }
  .meal-details { font-size: .76rem; color: var(--muted); margin: 14px 0 18px; }
  .meal-details summary { color: var(--green); padding: 5px 0; text-decoration: underline; text-underline-offset: 3px; }
  .meal-details p { padding: 2px 0; line-height: 1.4; }
  .meal-choice-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; padding-top: 8px; }
  .meal-action-deadline { flex-basis: 100%; margin: -4px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.5; text-align: right; }
  .meal-action-deadline time { display: inline-block; font-variant-numeric: tabular-nums; }
  .meal-deadline-closed { display: block; }
  .price { font-weight: 650; white-space: nowrap; font-size: .93rem; }
  .selected-label { color: var(--green); font-size: .81rem; font-weight: 650; }
  .meal-category .selected-label { margin-left: auto; }
  .meal-choice-footer:has(.meal-cancellation) { align-items: flex-end; }
  .meal-choice-footer:has(.meal-cancellation) > .price { padding-bottom: 11px; }
  .meal-cancellation { margin-left: auto; }
  .cancellation-question { visibility: hidden; margin: 0 0 6px; color: var(--muted); font-size: .76rem; line-height: 1.4; }
  .cancellation-actions { display: flex; align-items: stretch; gap: 8px; }
  .cancellation-confirm { visibility: hidden; }
  .cancellation-toggle { display: grid; }
  .cancellation-toggle > span { grid-area: 1 / 1; }
  .cancellation-no { visibility: hidden; }
  .is-confirming .cancellation-question, .is-confirming .cancellation-confirm, .is-confirming .cancellation-no { visibility: visible; }
  .is-confirming .cancellation-start { visibility: hidden; }
  .cancellation-fallback .cancellation-no { display: none; }
  .cancellation-fallback[open] .cancellation-start { display: none; }
  .cancellation-fallback[open] .cancellation-no { display: inline; visibility: visible; }
  .cancellation-fallback p { margin-block: 8px; font-size: .8rem; }
  .day-note { color: var(--muted); font-size: .73rem; margin-top: 16px; }
  .non-service { margin-top: 4px; color: var(--muted); font-size: .82rem; }
  .saved-order { background: #eaf0e1; border-radius: 10px; padding: 18px; margin-bottom: 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
  .saved-order > div:first-child { flex: 1; }
  .saved-order strong, .saved-order .muted { display: block; }
  .saved-order .muted { font-size: .75rem; }
  .saved-order .eyebrow { margin-bottom: 3px; font-size: .61rem; }
  .saved-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .change-history-context { padding: 20px 0; }
  .change-history-context .muted { font-size: .85rem; margin-top: 4px; }
  .change-history { list-style: none; margin: 0; padding: 0; max-width: 760px; }
  .change-history li { padding: 18px 0; border-top: 1px solid var(--line); }
  .change-history-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 20px; }
  .change-history time { color: var(--muted); font-size: .78rem; }
  .change-history p { color: var(--muted); font-size: .85rem; margin-top: 5px; }
  .home-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 0 38px; }
  .home-hero h1 { font-size: clamp(2.6rem, 5vw, 4.5rem); }
  .home-hero p { color: var(--muted); margin: 20px 0 26px; max-width: 380px; }
  .hero-orbit { width: 320px; height: 285px; position: relative; display: grid; place-items: center; flex-shrink: 0; background: #e8ebdc; border-radius: 51% 49% 42% 58%; }
  .orbit-label { position: absolute; right: 5px; bottom: 13px; background: var(--yellow); transform: rotate(-6deg); padding: 7px 16px; border-radius: 5px; font-family: var(--serif); font-size: .94rem; color: #524927; }
  .plate-art { width: 225px; height: 225px; background: #fffdf2; border: 14px solid #eeeada; box-shadow: 0 12px 18px #344c3410, inset 0 0 0 2px #dedac6; border-radius: 50%; position: relative; transform: rotate(-12deg); }
  .plate-art > span { position: absolute; }
  .leaf { background: #8caa64; border-radius: 100% 0 100% 0; width: 66px; height: 35px; transform: rotate(-30deg); }
  .leaf-one { top: 40px; left: 20px; }
  .leaf-two { top: 70px; left: 25px; transform: rotate(25deg); background: #5f804b; }
  .carrot { width: 83px; height: 24px; background: #d89a61; top: 60px; right: 20px; border-radius: 55% 30% 30% 55%; transform: rotate(-50deg); border: 4px solid #e0aa77; }
  .pea { width: 31px; height: 31px; background: #a1b273; border-radius: 50%; }
  .pea-one { top: 115px; left: 30px; }
  .pea-two { top: 145px; left: 63px; width: 23px; height: 23px; }
  .grain { width: 71px; height: 53px; border-radius: 50%; background: #e4ce93; top: 108px; right: 28px; box-shadow: inset 8px 5px 0 #eddbac; }
  .upcoming-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
  .upcoming-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 24px; position: relative; display: flex; flex-direction: column; align-items: start; text-decoration: none; min-height: 185px; }
  .upcoming-card:hover { border-color: #8c9f7e; }
  .upcoming-card h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 400; margin: 6px 0 24px; }
  .upcoming-card .status { margin-top: auto; }
  .card-arrow { position: absolute; bottom: 22px; right: 22px; color: var(--green); }
  .profile-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
  .profile-card { border: 1px solid var(--line); padding: 30px; border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; align-items: start; min-width: 0; }
  .profile-enrollments { width: 100%; }
  .profile-card-actions { margin-top: auto; padding-top: 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
  .history-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; }
  .history-link .icon { width: 17px; height: 17px; }
  .enrollment { padding: 20px 0; display: grid; gap: 4px; }
  .enrollment span { color: var(--muted); font-size: .86rem; }
  .enrollment .enrollment-label { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
  .enrollment-empty { color: var(--muted); font-size: .86rem; padding-top: 20px; }
  .history-dialog { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 0; width: min(620px, calc(100% - 40px)); max-width: none; max-height: min(760px, calc(100dvh - 64px)); overflow: hidden; box-shadow: 0 24px 80px #173c2e25; }
  .history-dialog[open] { display: flex; flex-direction: column; }
  .history-dialog::backdrop { background: #1b2e2470; backdrop-filter: blur(3px); }
  body:has(.history-dialog[open]) { overflow: hidden; }
  .dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 26px 28px 22px; border-bottom: 1px solid var(--line); }
  .dialog-header > div { flex: 1; min-width: 0; }
  .dialog-header h2 { font-family: var(--serif); font-size: 1.7rem; font-weight: 400; }
  .dialog-header .icon-button { flex-shrink: 0; }
  .dialog-body { padding: 8px 28px 28px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
  .dialog-body > turbo-frame[busy] { display: block; padding-block: 20px; }
  .enrollment-timeline .enrollment { position: relative; margin-left: 7px; padding: 20px 0 24px 25px; border-left: 1px solid var(--line); }
  .enrollment-timeline .enrollment::before { content: ""; position: absolute; top: 26px; left: -5px; width: 9px; height: 9px; background: #8e9d85; border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px #8e9d85; }
  .enrollment-timeline .enrollment-current::before { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
  .enrollment-timeline .enrollment:last-child { border-left-color: transparent; padding-bottom: 0; }
  .enrollment-timeline .enrollment:last-child::after { content: ""; position: absolute; top: 0; left: -1px; width: 1px; height: 26px; background: var(--line); }
  .account-actions { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 20px; display: flex; gap: 18px; justify-content: space-between; align-items: center; }
  .account-family-link { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 640px; margin-bottom: 24px; padding: 22px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; }
  .account-family-link strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
  .account-family-link span span { color: var(--muted); font-size: .85rem; }
  .account-family-link:hover { border-color: #8c9f7e; }
  .back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-bottom: 20px; font-size: .84rem; text-decoration: none; color: var(--muted); }
  .back-link:hover { color: var(--green); text-decoration: underline; }
  .auth-container { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; padding-top: 76px; padding-bottom: 70px; }
  .auth-container > #messages { grid-column: 1/-1; }
  #messages:not(:has(.message-error, .toast)) { display: none; }
  .auth-container > #messages:not(:has(.message-error)) { display: contents; }
  .auth-intro h1 { font-size: clamp(2.8rem,4.8vw,4.4rem); }
  .auth-intro > p { color: var(--muted); margin-top: 24px; max-width: 350px; }
  .auth-intro .plate-art { margin: 35px 0 0 35px; width: 200px; height: 200px; }
  .auth-panel { padding: 42px; }
  .auth-panel h2 { font-family: var(--serif); font-size: 2rem; font-weight: 400; margin: 12px 0; }
  .auth-panel p { margin: 14px 0; }
  .auth-panel .button.primary { width: 100%; }
  .auth-links { display: grid; gap: 12px; margin-top: 24px; font-size: .8rem; }
  .auth-panel .quiet-note { border-top: 1px solid var(--line); padding-top: 22px; font-size: .76rem; }
  .auth-panel.standalone { grid-column: 1/-1; width: 100%; max-width: 540px; justify-self: center; }
  .auth-panel.standalone h1 { font-size: 2.3rem; }
  .auth-panel.standalone > .text-link { display: inline-block; margin-top: 22px; }
  .menu-list { display: grid; gap: 14px; margin-top: 28px; }
  .menu-list-item { display: flex; align-items: center; gap: 18px; padding: 24px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
  .menu-list-item > div { flex: 1; }
  .menu-list-item h2 { font-size: 1.12rem; }
  .staff-day-list { display: grid; gap: 20px; }
  .staff-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 25px; }
  .staff-day .section-heading { margin: 0 0 16px; }
  .staff-day .section-heading h2 { font-size: 1.13rem; }
  .staff-day .quiet-note { margin: 0 0 16px; }
  .staff-offering { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding: 17px 0; }
  .staff-offering > div { flex: 1; }
  .staff-offering small { display: block; margin-top: 4px; }
  .total-badge { display: flex; align-items: baseline; gap: 12px; }
  .total-badge strong { font-family: var(--serif); font-weight: 400; font-size: 3rem; }
  .total-badge span { color: var(--muted); font-size: .8rem; }
  .kitchen-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
  .kitchen-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 25px; border-bottom: 1px solid var(--line); }
  .kitchen-row:last-child { border-bottom: 0; }
  .meal-count { font-size: 2rem; min-width: 64px; text-align: center; color: var(--green); }
}

@layer responsive {
  @media (max-width: 1050px) {
    .header-inner { padding-inline: 28px; gap: 20px; }
    .brand { font-size: 1.35rem; }
    .brand-icon { width: 34px; height: 34px; }
    .primary-nav { gap: 18px; }
    .main-container, .site-footer { padding-inline: 28px; }
    .hero-orbit { width: 270px; height: 260px; transform: scale(.9); }
  }
  @media (max-width: 720px) {
    .header-inner { min-height: 74px; flex-wrap: wrap; padding: 17px 20px 0; gap: 12px 8px; }
    .brand { font-size: 1.15rem; gap: 7px; flex-shrink: 1; }
    .brand-icon { width: 30px; height: 30px; }
    .header-inner > .brand { flex: 1; min-width: 0; }
    .language-picker { margin-left: 0; }
    .site-header .language-control .language-name { display: none; }
    .toast-stack { top: 16px; right: 16px; }
    .primary-nav { order: 4; flex-basis: 100%; min-height: 48px; justify-content: flex-start; gap: 8px 28px; flex-wrap: wrap; }
    .primary-nav a { height: auto; padding: 12px 0; font-size: .81rem; white-space: nowrap; }
    .header-tagline { display: none; }
    .site-header:has(.header-tagline) .header-inner { padding-bottom: 17px; }
    .main-container { padding: 32px 20px 50px; }
    .site-footer { padding: 22px 20px; flex-wrap: wrap; }
    .page-heading { align-items: start; flex-direction: column; gap: 12px; margin-bottom: 24px; }
    .page-heading h1 { font-size: 2.5rem; }
    .child-chip { padding: 8px 10px; }
    .week-toolbar { margin-top: 22px; padding-top: 18px; gap: 12px; }
    .week-toolbar > .week-picker { width: 100%; }
    .week-selection { justify-content: space-between; }
    .week-selection > .icon { margin-top: .2rem; }
    .week-dates { font-size: 1.18rem; }
    .week-navigation { width: 100%; justify-content: space-between; }
    .week-navigation .button { padding-inline: 14px; font-size: .8rem; }
    .meal-day { padding: 17px; }
    .meal-choices { grid-template-columns: 1fr; gap: 12px; }
    .meal-choice { padding: 18px; }
    .meal-choice:only-child { display: flex; align-items: stretch; gap: 0; }
    .meal-choice:only-child .meal-details { margin-bottom: 18px; }
    .day-heading { gap: 10px; flex-wrap: wrap; }
    .day-heading > div:nth-child(2) { flex: 1; min-width: calc(100% - 60px); }
    .day-summary-actions { margin-left: 58px; flex: 1; }
    .day-summary-actions > .icon { margin-left: auto; }
    .day-heading h3 { font-size: 1.05rem; }
    .saved-order { padding: 16px; }
    .saved-order > div:first-child { flex-basis: 100%; }
    .home-hero { padding: 0 0 30px; }
    .home-hero h1 { font-size: 3rem; }
    .hero-orbit { display: none; }
    .home-hero p { max-width: 310px; }
    .upcoming-grid, .profile-grid { grid-template-columns: 1fr; }
    .profile-card { padding: 25px; }
    .history-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 32px); }
    .dialog-header { padding: 22px 20px 18px; }
    .dialog-body { padding: 6px 20px 24px; }
    .upcoming-card { min-height: 160px; }
    .section-heading { align-items: start; flex-wrap: wrap; }
    .section-heading h2 { font-size: 1.2rem; }
    .form-panel, .auth-panel { padding: 25px; }
    .auth-container { display: block; }
    .auth-intro { padding: 8px 0 26px; }
    .auth-intro h1 { font-size: 2.8rem; }
    .auth-intro > p { margin-top: 16px; }
    .auth-intro .plate-art { display: none; }
    .auth-panel.standalone { margin: auto; }
    .auth-panel.standalone h1 { font-size: 2rem; }
    .inline-form { display: grid; grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .staff-day { padding: 20px; }
    .staff-offering { flex-wrap: wrap; }
    .menu-list-item { padding: 20px; flex-wrap: wrap; }
    .menu-list-item > div { flex-basis: 100%; }
    .account-actions { flex-wrap: wrap; }
  }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
  }
}
