@font-face {
  font-family: Inter;
  src: url('./assets/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #191918;
  background: #fffcf8;
  font-synthesis: none;
  --purple: #5d33bf;
  --border: #e5dfd9;
  --muted: #666360;
  --chip: #f1ece5;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid #7f7c79; outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #7f7c79; outline-offset: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.sidebar { width: 240px; height: 100dvh; position: fixed; inset: 0 auto 0 0; padding: 22px 16px 16px; display: flex; flex-direction: column; background: #fffcf8; border-right: 1px solid var(--border); }
.brand { color: #191918; text-decoration: none; font-size: 25px; letter-spacing: -1.2px; font-weight: 540; padding: 4px 8px 28px; display: flex; align-items: center; gap: 8px; }
.brand-leaf { color: #f26533; font-size: 28px; }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { border: 0; background: transparent; display: flex; align-items: center; gap: 10px; height: 32px; padding: 8px; border-radius: 12px; font-size: 14px; font-weight: 540; text-align: left; color: #191918; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item.active { background: #e5dfd9; }
.nav-item:enabled:hover { background: #eee8e0; }
.nav-item:disabled { color: #989591; }
.sidebar-bottom { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 12px 8px 0; border-top: 1px solid var(--border); }
.workspace-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e5dfd9; color: #4c4a48; font-size: 11px; }
main { margin-left: 240px; padding: 22px 32px 32px; max-width: 1520px; }
.workspace-heading { display: flex; align-items: center; gap: 8px; height: 28px; margin-bottom: 20px; }
h1 { font-size: 20px; font-weight: 540; line-height: 28px; margin: 0; }
.back-button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; background: none; border: 0; font-size: 22px; color: #4c4a48; }
.surface { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
#setup { height: calc(100dvh - 118px); min-height: 260px; }
#settings-form { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.form-scroll { flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: #cbc6c1 transparent; }
.form-content { width: 100%; max-width: 840px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; }
.section { margin: 0; padding: 0 16px 16px; border: 0; min-width: 0; }
h2, legend { margin: 0; padding: 12px 0; font-size: 18px; line-height: 28px; font-weight: 540; }
.patient-control { width: 50%; padding-bottom: 0; }
label { font-size: 14px; line-height: 20px; color: var(--muted); display: block; margin-bottom: 4px; }
select, input[type=text], textarea { color: #191918; background: white; width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; font-size: 16px; line-height: 24px; }
select { height: 48px; padding-right: 32px; }
select:hover, textarea:hover, input[type=text]:hover, .field-wrap:hover { border-color: #b2aea9; }
textarea { resize: vertical; min-height: 76px; }
::placeholder { color: #b2aea9; opacity: 1; }
.household { display: flex; gap: 12px; align-items: center; color: #4c4a48; font-size: 16px; line-height: 24px; }
.stepper { height: 36px; border: 1px solid #cbc6c1; border-radius: 999px; display: flex; align-items: center; gap: 8px; padding: 8px; box-shadow: 0 1px 2px #1919180d; }
.stepper button { display: grid; place-items: center; padding: 0; width: 20px; height: 20px; border: 0; background: none; font-size: 24px; color: #191918; }
.stepper button:disabled { color: #b2aea9; }
.stepper input { width: 20px; border: 0; padding: 0; text-align: center; appearance: textfield; -moz-appearance: textfield; font-size: 14px; font-weight: 540; color: #191918; }
input::-webkit-inner-spin-button { appearance: none; }
.meal-types, .nutrition { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.meal-types label { display: flex; gap: 12px; align-items: center; height: 48px; border: 1px solid var(--border); padding: 0 16px; border-radius: 12px; font-size: 16px; margin: 0; color: #191918; cursor: pointer; }
input[type=checkbox]:not([role=switch]), input[type=radio] { appearance: none; width: 20px; height: 20px; border: 1px solid #cbc6c1; flex-shrink: 0; margin: 0; background: white; display: grid; place-content: center; cursor: pointer; }
input[type=checkbox]:not([role=switch]) { border-radius: 4px; }
input[type=checkbox]:not([role=switch]):checked { background: #f26533; border-color: #f26533; }
input[type=checkbox]:not([role=switch]):checked::before { content: ''; width: 10px; height: 6px; border: solid white; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translateY(-1px); }
input[type=radio] { border-radius: 50%; box-shadow: 0 1px 2px #1919180d; }
input[type=radio]:checked { border: 6px solid #f26533; }
.info { font-size: 14px; color: #989591; font-weight: 400; vertical-align: 1px; margin-left: 2px; }
.field-wrap { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; height: 48px; }
.field-wrap input { border: 0; width: 100%; min-width: 0; padding: 12px 0; background: transparent; font-size: 16px; line-height: 24px; color: #191918; }
.field-wrap:focus-within { outline: 2px solid #7f7c79; }
.field-wrap input:focus-visible { outline: 0; }
.unit { color: #666360; font-size: 16px; }
.max { float: right; color: #989591; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.chip { height: 32px; border: 0; border-radius: 999px; background: var(--chip); padding: 0 12px; font-size: 14px; font-weight: 540; color: #4c4a48; line-height: 20px; }
.chip:hover { background: #e5dfd9; }
.chip[aria-pressed=true] { background: #191918; color: #fff; }
.distribution-shell { border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin: 12px 0; }
.distribution-bar { position: relative; display: flex; border-radius: 8px; overflow: hidden; height: 48px; }
.segment { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 12px; line-height: 16px; font-weight: 540; min-width: 0; overflow: hidden; }
.segment strong { font-weight: 540; }
.segment[data-period=Breakfast] { background: #eaf1f8; color: #2d6596; }
.segment[data-period=Lunch] { background: #eef6ea; color: #4c7c2e; }
.segment[data-period=Snacks] { background: #fdf9eb; color: #938326; }
.segment[data-period=Dinner] { background: #f7ebf3; color: #983579; }
.distribution-handle { position: absolute; top: 0; bottom: 0; width: 12px; padding: 0; transform: translateX(-50%); border: 0; background: transparent; display: flex; justify-content: center; align-items: center; cursor: col-resize; touch-action: none; z-index: 1; }
.distribution-handle::after { content: ''; display: block; width: 6px; height: 32px; border: 1px solid var(--border); border-radius: 3px; background: white; box-shadow: 0 2px 4px #19191826; }
.distribution-handle:focus-visible { outline: none; }
.distribution-handle:focus-visible::after { outline: 2px solid #7f7c79; }
.switch-row { display: flex; align-items: center; gap: 12px; line-height: 20px; margin: 0; font-size: 14px; }
.switch-row input { appearance: none; width: 36px; height: 20px; background: #cbc6c1; border-radius: 999px; position: relative; flex-shrink: 0; cursor: pointer; margin: 0; }
.switch-row input:before { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: white; transition: left .15s; }
.switch-row input:checked { background: var(--purple); }
.switch-row input:checked:before { left: 18px; }
#partial-field { margin-top: 12px; }
#coverage { padding: 10px; border: 1px solid var(--border); border-radius: 8px; width: 100px; }
.prep legend { width: 100%; padding-bottom: 12px; }
.prep label { display: flex; align-items: center; gap: 12px; font-size: 16px; line-height: 24px; color: #191918; margin: 0 0 12px; cursor: pointer; }
.prep label:last-child { margin-bottom: 0; }
.preference { margin-top: 12px; }
.preference:first-child { margin-top: 0; }
.preference h3 { font-size: 16px; line-height: 24px; font-weight: 540; margin: 0; padding: 12px 0; }
.preference > label { margin-top: 12px; }
.additional-section h2 { font-size: 16px; line-height: 24px; }
.additional-section > label { margin-bottom: 8px; }
.bottom-bar { flex-shrink: 0; background: white; border-top: 1px solid var(--border); padding: 16px; display: flex; justify-content: flex-end; gap: 16px; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 8px 16px; min-height: 40px; font-size: 14px; line-height: 20px; font-weight: 540; white-space: nowrap; box-shadow: 0 1px 2px #1919180d; }
.primary { background: var(--purple); color: white; border: 1px solid var(--purple); }
.primary:hover { background: #4f2e9e; }
.secondary { background: white; border: 1px solid var(--border); color: #4c4a48; }
.secondary:hover { background: #f1ece5; }
.primary svg { width: 20px; height: 20px; }
#plan { height: calc(100dvh - 118px); display: flex; flex-direction: column; }
.plan-heading { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 12px; }
.plan-heading h2 { padding: 0; font-size: 16px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: white; }
.toolbar > div { display: flex; gap: 12px; }
.toolbar label { color: #191918; font-weight: 540; }
.grid-scroll { overflow: auto; padding: 0 12px 16px; min-height: 0; }
.meal-grid { display: grid; grid-template-columns: 90px repeat(var(--columns,4), minmax(140px,1fr)); gap: 12px; min-width: 740px; }
.column-heading { text-align: center; font-size: 14px; line-height: 20px; color: #4c4a48; padding: 16px 4px 8px; }
.day-heading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; line-height: 16px; text-align: center; color: #4c4a48; }
.day-heading strong { font-size: 16px; line-height: 24px; color: #191918; font-weight: 540; }
.meal-card { background: #efebf9; border: 1px solid transparent; border-radius: 12px; padding: 12px; min-height: 144px; text-align: left; display: flex; flex-direction: column; gap: 12px; color: #191918; }
.meal-card:hover { background: #e8e1f5; border-color: #dfd6f2; }
.meal-icon { font-size: 16px; line-height: 20px; }
.meal-title { font-size: 14px; line-height: 20px; font-weight: 540; overflow-wrap: anywhere; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; font-size: 12px; color: #7f7c79; }
.badge { font-size: 12px; background: #eef6ea; color: #4c7c2e; border-radius: 999px; padding: 2px 6px; white-space: nowrap; }
.badge.batch { background: #eaf1f8; color: #2d6596; }
.macro-line { font-size: 10px; color: #7f7c79; line-height: 16px; }
dialog { width: min(650px, calc(100% - 32px)); max-height: 90dvh; padding: 24px; border: 1px solid var(--border); border-radius: 12px; color: #191918; box-shadow: 0 20px 90px #35204533; }
dialog::backdrop { background: #19191866; }
.dialog-heading { display: flex; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { padding: 0 0 16px; }
.eyebrow { font-size: 11px; letter-spacing: 1px; color: #7f7c79; font-weight: 540; margin: 0 0 8px; }
.close { border: 0; background: none; font-size: 26px; color: #7f7c79; width: 32px; height: 32px; }
.recipe-numbers { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 20px 0; }
.recipe-numbers input { display: block; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-top: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
#recipe-form > input { padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; width: 100%; font-size: 16px; }
#recipe-form > label { margin-top: 16px; }
#restore-dialog { width: 450px; }
#restore-dialog p { line-height: 24px; color: #666360; }
#recipe-library { display: grid; gap: 8px; }
.library-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: white; color: #191918; text-align: left; font-size: 14px; }
.library-item:hover { background: #f1ece5; }
@media (min-width: 1760px) { main { margin-right: auto; margin-left: calc(240px + (100vw - 1760px)/2); max-width: 1520px; } }
@media (max-width: 1023px) {
  .sidebar { width: 64px; padding: 22px 8px 16px; }
  .brand { font-size: 0; padding: 0 10px 24px; }
  .brand-leaf { font-size: 26px; }
  .nav-item { padding: 8px 14px; }
  .nav-item span, .sidebar-bottom > span { display: none; }
  .sidebar-bottom { padding: 12px 8px 0; }
  main { margin-left: 64px; padding: 22px 24px 32px; }
}
@media (max-width: 700px) {
  .sidebar { display: none; }
  main { margin: 0; padding: 16px; }
  .workspace-heading { margin-bottom: 16px; }
  #setup, #plan { height: calc(100dvh - 92px); }
  .form-content { padding: 16px 8px; }
  .section { padding: 0 8px 16px; }
  .patient-control { width: 100%; }
  .meal-types, .nutrition { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .meal-types label { padding: 0 12px; }
  h2, legend { font-size: 17px; }
  .prep label { font-size: 14px; }
  .segment { font-size: 11px; }
  .switch-row { font-size: 13px; }
  .toolbar { flex-wrap: wrap; gap: 12px; }
  .toolbar > div { gap: 8px; }
  .toolbar button { font-size: 12px; padding: 8px 10px; }
  .plan-heading h2 { font-size: 14px; line-height: 20px; }
  .plan-heading .secondary { font-size: 12px; padding: 8px 10px; }
  .recipe-numbers { grid-template-columns: repeat(2,1fr); }
  .bottom-bar { padding: 12px; gap: 8px; }
  .bottom-bar button { font-size: 12px; padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .sidebar, .workspace-heading, .toolbar, .plan-heading button, dialog, #setup { display: none !important; }
  body { background: white; }
  main { margin: 0; padding: 0; max-width: none; }
  #plan { display: block !important; height: auto; border: 0; overflow: visible; }
  .grid-scroll { overflow: visible; padding: 0; }
  .meal-grid { min-width: 0; grid-template-columns: 65px repeat(var(--columns,4),1fr); gap: 8px; }
  .meal-card { min-height: 130px; break-inside: avoid; padding: 10px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .meal-title { font-size: 11px; }
  .macro-line { font-size: 9px; }
  .card-bottom { font-size: 10px; }
  .badge { font-size: 9px; }
  .day-heading { font-size: 10px; }
  .day-heading strong { font-size: 14px; }
  .meal-icon { font-size: 14px; }
  @page { size: landscape; margin: 12mm; }
}

.needs-calculator{border:1px solid #ddd5ce;border-radius:12px;padding:16px;margin:16px 0 24px}.needs-calculator summary{cursor:pointer;font-weight:600}.needs-calculator p{font-size:14px;line-height:1.5}.needs-calculator label{display:block;font-size:14px}.needs-calculator input,.needs-calculator select{width:100%;margin:6px 0 12px;box-sizing:border-box}.needs-calculator button{margin-top:10px}.calculator-note{color:#655f59}

/* Visible daily-needs workflow */
.needs-calculator{background:#faf8f5;border:1px solid #e5dfd8;border-radius:16px;padding:24px;margin:20px 0 28px}
.calculator-heading h3{font-size:22px;line-height:1.3;margin:6px 0 0;font-weight:650}
.calculator-eyebrow{font-size:11px;font-weight:700;letter-spacing:.1em;color:#786b91}
.needs-calculator .calculator-intro{margin:8px 0 26px;color:#69635d;font-size:15px}
.calculator-step{display:flex;align-items:center;gap:10px;font-size:16px;margin:26px 0 18px;font-weight:650}
.calculator-step>span{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#eee7fa;color:#5931b7;font-size:13px;flex-shrink:0}
.needs-calculator .nutrition{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;margin:0 0 18px}
.needs-calculator label{color:#56514d;font-size:14px;font-weight:500;min-width:0}
.needs-calculator input,.needs-calculator select{display:block;width:100%;min-height:48px;background:#fff;border:1px solid #dcd5cf;border-radius:10px;padding:10px 12px;margin:8px 0 0;font:inherit;font-size:16px;color:#252321}
.needs-calculator input:focus,.needs-calculator select:focus{outline:2px solid #7450c9;outline-offset:2px}
.maintenance-result{background:#fff;border:1px solid #e4dced;border-left:4px solid #6840bd;border-radius:12px;padding:18px 20px;margin:22px 0}
.needs-calculator #calc-result{font-size:20px;font-weight:600;line-height:1.6;margin:8px 0 0;color:#35254f}
#calc-adjustments>label{max-width:420px;margin-bottom:20px}
.needs-calculator #calc-macro-result{background:#f0eaf9;border-radius:10px;padding:14px 16px;line-height:1.7;font-size:15px}
.needs-calculator .calculator-note{font-size:12px;line-height:1.65;margin:24px 0 0;color:#746d66}
.needs-calculator button{min-height:46px;font-size:14px;white-space:normal}
.needs-calculator button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:600px){.needs-calculator{padding:18px 16px}.needs-calculator .nutrition{grid-template-columns:1fr;gap:14px}.needs-calculator button{width:100%}.needs-calculator #calc-result{font-size:18px}}
