:root {
  --bg: #f6f5f1;
  --panel: #ffffff;
  --ink: #1f2a24;
  --muted: #66706a;
  --line: #e3e1da;
  --brand: #2f7d5b;
  --brand-ink: #ffffff;
  --brand-soft: #e5f2ec;
  --warn: #b5541c;
  --warn-soft: #fbeee5;
  --danger: #b3261e;
  --bubble-in: #ffffff;
  --bubble-out: #dcf4e6;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel); padding: 7px 12px; border-radius: 8px; }
button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.danger { color: var(--danger); }
button.link { border: none; background: none; color: var(--brand); padding: 0; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: #fff; width: 100%; }
textarea { resize: vertical; min-height: 60px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
h1, h2, h3 { margin: 0 0 10px; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: #1f2a24; color: #e9efe9; padding: 18px 14px; }
.side .logo { font-weight: 700; font-size: 18px; margin-bottom: 18px; }
.side .logo span { color: #8fd1ad; }
.brand { display: flex; gap: 10px; align-items: center; margin: 0 4px 20px; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: #fff; flex: none; }
.brand-logo.initials { display: flex; align-items: center; justify-content: center; background: #2f7d5b; color: #fff; font-weight: 700; }
.brand-name { font-weight: 700; line-height: 1.2; }
.brand-sub { font-size: 12px; color: #a9b8ae; } .brand-sub span { color: #8fd1ad; font-weight: 600; }
.small { font-size: 12px; }
.error { color: var(--danger); font-size: 13px; }
.img-preview { height: 96px; border: 1px dashed var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; background: #fcfcfa; }
.img-preview img { max-height: 88px; max-width: 100%; border-radius: 6px; }
.chat.preview-chat { height: auto; min-height: 120px; overflow: visible; }
.preview-bubble { max-width: 100%; }
.demo-banner { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0d2bd; border-radius: 8px; padding: 8px 12px; margin: 6px 0 10px; font-size: 14px; }
.demo-banner.live { background: var(--brand-soft); color: var(--brand); border-color: #c6e3d5; }
.demo-banner.off { background: #eee; color: var(--muted); border-color: var(--line); }
.phrases { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); border-color: #c6e3d5; color: var(--brand); }
.bubble code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: rgba(0,0,0,.05); padding: 0 3px; border-radius: 3px; }
.bubble .wa-bullet { display: inline-block; padding-left: 4px; }
.side a { display: flex; justify-content: space-between; color: inherit; text-decoration: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.side a.active, .side a:hover { background: rgba(255,255,255,.08); }
.badge { background: var(--warn); color: #fff; border-radius: 999px; font-size: 12px; padding: 0 7px; min-width: 20px; text-align: center; }
.main { padding: 22px 26px; max-width: 1200px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 24px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
tr.click { cursor: pointer; } tr.click:hover { background: #fafaf7; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #eee; }
.pill.ok { background: var(--brand-soft); color: var(--brand); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 9px 12px; color: var(--muted); }
.tabs button.active { border-bottom-color: var(--brand); color: var(--ink); font-weight: 600; }
.issues li { margin: 3px 0; }
.issues li.block { color: var(--danger); }
.issues li.info { color: var(--warn); }
.day { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; background: #fff; }
.day > summary { padding: 10px 14px; cursor: pointer; font-weight: 600; }
.day .body { padding: 0 14px 14px; }
.meal { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.opt { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fcfcfa; }
.opt input { margin-bottom: 6px; }
.chat { display: flex; flex-direction: column; gap: 8px; background: #ece5dd; border-radius: var(--radius); padding: 14px; height: 520px; overflow-y: auto; }
.bubble { max-width: 78%; padding: 8px 11px; border-radius: 10px; white-space: normal; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.08); font-size: 14px; }
.bubble.in { background: var(--bubble-out); align-self: flex-end; }
.bubble.out { background: var(--bubble-in); align-self: flex-start; }
.bubble .meta { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.login { max-width: 380px; margin: 10vh auto; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1f2a24; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 10; max-width: 90vw; }
.toast.err { background: var(--danger); }
pre.menu { white-space: pre-wrap; font-family: inherit; margin: 0; }
.debug { font-family: ui-monospace, Menlo, monospace; font-size: 12px; white-space: pre-wrap; background: #f3f3ef; border-radius: 8px; padding: 8px; max-height: 240px; overflow: auto; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: flex; gap: 6px; overflow-x: auto; padding: 10px; }
  .side .logo { margin: 0 10px 0 0; }
  .main { padding: 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .brand { margin: 0 8px 0 0; flex: none; }
  .brand-sub { display: none; }
  .brand-name { max-width: 140px; font-size: 14px; }
}
textarea.prose { font-family: inherit; font-size: 14px; }

/* ---- percorso "Crea piano alimentare" ---- */
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: #eceae4; color: var(--muted); font-size: 13px; }
.stepper li .num { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center; background: #fff; font-size: 12px; font-weight: 600; }
.stepper li.done { background: var(--brand-soft); color: var(--brand); }
.stepper li.current { background: var(--brand); color: #fff; font-weight: 600; }
.stepper li.current .num { color: var(--brand); }
.plan-status.ok { border-left: 4px solid var(--brand); }
.plan-status.warn { border-left: 4px solid var(--warn); }
.cta { border: 1px solid #c6e3d5; background: linear-gradient(0deg, #fff, var(--brand-soft)); }
details.card > summary { cursor: pointer; font-weight: 600; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.choice { display: flex; flex-direction: column; gap: 6px; }
.choice p { flex: 1; }
.choice.disabled { opacity: .75; }
.choice .pill { align-self: flex-start; }
.meals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.meal-pick { display: flex; align-items: center; gap: 8px; margin: 0; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #fcfcfa; }
.meal-pick input[type=checkbox] { width: auto; }
.meal-pick .share { width: 64px; }
.freq { display: grid; grid-template-columns: 1fr 70px auto 70px auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.review { margin-top: 8px; }
.review-group { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
.review-group > summary { cursor: pointer; font-weight: 600; }
.review-group.block { border-color: #efc2bf; background: #fdf3f2; }
.review-group.parameters { border-color: #f0d2bd; background: var(--warn-soft); }
.ok-line { color: var(--brand); font-weight: 600; }
.freq-table { margin-top: 6px; }
/* ---- menu operativo ---- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pill.sub { background: #e7eefb; color: #2856a3; }
.pill.alt { background: #f1eafb; color: #6a3fa0; }
.pill.new { background: #e6f4ec; color: #22693f; }
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.day-card { margin: 0; }
.wmeal { border-top: 1px dashed var(--line); padding: 8px 0; }
.wmeal:first-of-type { border-top: none; }
.wmeal .slot { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; flex: 1; }
.wtitle { font-weight: 600; margin: 2px 0 4px; }
.witems { margin: 0; padding-left: 18px; font-size: 14px; }
.wsub { font-size: 13px; margin-top: 4px; }
@media (max-width: 860px) { .choices { grid-template-columns: 1fr; } .freq { grid-template-columns: 1fr 60px auto 60px; } .freq .small { display: none; } }
.review-sub { font-size: 13px; font-weight: 600; margin: 8px 0 2px; color: var(--ink); }

/* ---- cartella e progressi ---- */
.pill.o-measured { background: var(--brand-soft); color: var(--brand); }
.pill.o-self { background: #e7eefb; color: #2856a3; }
.pill.o-est { background: #fdf1d8; color: #8a5a00; }
.pill.o-calc { background: #f1eafb; color: #6a3fa0; }
.pill.o-demo { background: #f1eafb; color: #6a3fa0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric b { font-size: 24px; display: block; margin: 2px 0; }
.metric .row { gap: 6px; }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; margin-bottom: 14px; }
.chart-card { margin: 0; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #ecebe6; stroke-width: 1; }
.chart .axis { font-size: 11px; fill: #66706a; }
.chart .line { fill: none; stroke: #9bb5a8; stroke-width: 2; }
.chart .pt { stroke-width: 2; }
.chart .pt.o-measured { fill: #2f7d5b; stroke: #2f7d5b; }
.chart .pt.o-self { fill: #fff; stroke: #2856a3; }
.chart .pt.o-est { fill: #e2a12b; stroke: #8a5a00; }
.chart .pt.o-calc { fill: #8c62c4; stroke: #6a3fa0; }
.chart .pt.o-demo { fill: #9564a8; stroke: #6a3fa0; }
.tracked { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.feedback { padding-left: 0; list-style: none; margin: 0; }
.feedback li { margin: 6px 0; font-size: 14px; }
button.link.danger { color: var(--danger); }
@media (max-width: 860px) { .charts { grid-template-columns: 1fr; } }

/* ---- report stampabile ---- */
.report-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.report-page { padding: 24px 16px 48px; }
.report-doc { position: relative; max-width: 820px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 36px 40px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.report-doc h1 { font-size: 22px; margin: 18px 0 4px; }
.report-doc h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); border-bottom: 1px solid var(--line); padding-bottom: 4px; margin: 22px 0 10px; }
.rhead { display: flex; gap: 12px; align-items: center; border-bottom: 2px solid var(--brand); padding-bottom: 12px; }
.rstudio { font-weight: 700; font-size: 17px; }
.rmeta { text-align: right; font-size: 13px; }
.rverified { color: var(--brand); font-weight: 600; }
.rpatient { margin: 2px 0 0; }
.rtable { font-size: 13px; }
.rtable th { width: 34%; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--muted); }
.rtable ul { margin: 0; padding-left: 16px; }
.rcharts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.rchart { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.rmenu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.rday { break-inside: avoid; }
.rfoot { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 4px; }
.draft-mark { position: absolute; top: 12px; right: 16px; color: var(--warn); border: 2px solid var(--warn); border-radius: 6px; padding: 2px 8px; font-weight: 700; font-size: 12px; transform: rotate(2deg); }
.report-doc.is-draft::after { content: "BOZZA"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 120px; font-weight: 800; color: rgba(181, 84, 28, .06); transform: rotate(-24deg); pointer-events: none; }
@media (max-width: 860px) { .report-doc { padding: 20px 16px; } .rcharts, .rmenu { grid-template-columns: 1fr; } .rhead { flex-wrap: wrap; } .rmeta { text-align: left; } }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .no-print, .toast { display: none !important; }
  .report-page { padding: 0; }
  .report-doc { border: none; box-shadow: none; padding: 0; max-width: none; }
  .rsec h2 { break-after: avoid; }
  .rchart, .rday, .rtable tr, .rhead { break-inside: avoid; }
  .pill { border: 1px solid #ccc; }
}

/* valori nutrizionali: provenienza sempre visibile */
.pill.n-est { background: #fdf1d8; color: #8a5a00; }
.pill.n-decl { background: #e7eefb; color: #2856a3; }
.pill.n-ver { background: var(--brand-soft); color: var(--brand); }
.nut-table { width: 100%; font-size: 13px; margin-top: 6px; }
.nut-table td, .nut-table th { padding: 3px 6px; }
.nut-opt { margin-top: 8px; font-size: 13px; max-width: 100%; overflow-x: auto; }
.nut-opt .nut-table { font-size: 12px; min-width: 520px; }
.nut-table tr.stale td:not(:last-child):not(:nth-last-child(2)) { opacity: .5; text-decoration: line-through; }
.nut-opt summary { cursor: pointer; }
.nut-edit input { padding: 2px 4px; }
.reserved-mark { border: 2px solid #8a5a00; color: #8a5a00; font-weight: 700; text-align: center; padding: 6px; margin-bottom: 10px; letter-spacing: .03em; }

/* fasi di elaborazione (importazione e bozza AI) */
.phase-panel { position: fixed; right: 16px; bottom: 16px; z-index: 50; background: var(--card, #fff); border: 1px solid #ddd; border-radius: 10px; padding: 12px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.12); width: min(380px, calc(100vw - 32px)); font-size: 13px; }
.phase-panel ol { margin: 8px 0 0; padding-left: 18px; }
.phase-panel li { display: flex; gap: 8px; margin: 4px 0; }
.phase-panel .ok-text { color: var(--brand); }
.phase-panel .err-text { color: #b42318; }

/* ---- revisione semplificata ---- */
button.small { padding: 4px 10px; font-size: 13px; }
.rv-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 4px 0 12px; }
.rv-tile { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fcfcfa; }
.rv-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: #eceae4; color: var(--muted); }
.rv-tile.ok .rv-icon { background: var(--brand-soft); color: var(--brand); }
.rv-tile.warn .rv-icon { background: var(--warn-soft); color: var(--warn); }
.rv-tile.block { border-color: #efc2bf; background: #fdf6f5; }
.rv-tile.block .rv-icon { background: #f8dcda; color: var(--danger); }
.rv-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.rv-text { font-size: 14px; }
.rv-section { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.rv-section > summary { display: flex; gap: 8px; align-items: center; padding: 9px 12px; cursor: pointer; font-weight: 600; list-style: none; }
.rv-section > summary::-webkit-details-marker { display: none; }
.rv-section > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.rv-section[open] > summary::before { transform: rotate(90deg); }
.rv-section.has-open { border-color: #ead7c9; }
.rv-hint { margin: -4px 12px 4px 30px; }
.rv-count { font-size: 12px; font-weight: 600; color: var(--muted); background: #f1f0ec; border-radius: 999px; padding: 1px 8px; }
.rv-count.block { color: var(--warn); background: var(--warn-soft); }
.rv-items { list-style: none; margin: 0; padding: 0 12px 6px; }
.rv-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid #f0efea; }
.rv-item:first-child { border-top: none; }
.rv-item > button, .rv-item > .pill { flex: none; }
.rv-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: #c9c7c0; }
.rv-dot.block { background: var(--danger); } .rv-dot.todo { background: #e08a3c; } .rv-dot.ok { background: none; width: auto; height: auto; margin-top: 0; color: var(--brand); font-size: 12px; }
.rv-title { font-weight: 600; }
.rv-points { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink); }
.rv-refs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rv-refs .chip { font-size: 12px; padding: 2px 8px; }
.rv-done .rv-item { opacity: .85; }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px #e08a3c; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 860px) { .rv-summary { grid-template-columns: 1fr 1fr; } .rv-item { flex-wrap: wrap; } .rv-item > button, .rv-item > .pill { margin-left: 20px; } }
/* la colonna principale non si allarga oltre lo schermo: tabelle larghe scorrono al loro interno */
.main { min-width: 0; }
.card.nutrition { overflow-x: auto; }
@media (max-width: 860px) { .layout { grid-template-columns: minmax(0, 1fr); } }

/* ---- vista settimanale del piano ---- */
.plan-head h2 { margin-bottom: 2px; }
.advanced-note { background: #f1f0ec; border-radius: 8px; padding: 8px 12px; font-size: 14px; margin: 0 0 12px; }
.wk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.wk-day { border: 1px solid var(--line); border-radius: var(--radius); background: #fcfcfa; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.wk-day-head { display: flex; gap: 8px; align-items: flex-start; padding: 2px 2px 6px; border-bottom: 1px solid var(--line); }
.wk-day-head b { font-size: 15px; }
.wk-total { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; font-weight: 600; text-align: right; }
.wk-meal { display: flex; flex-direction: column; align-items: stretch; gap: 2px; text-align: left; width: 100%; border: 1px solid transparent; border-radius: 8px; background: #fff; padding: 7px 9px; }
.wk-meal:hover, .wk-meal:focus-visible { border-color: #c6e3d5; background: #f8fcf9; outline: none; }
.wk-meal.flag-todo { border-left: 3px solid #e08a3c; }
.wk-meal.flag-block { border-left: 3px solid var(--danger); }
.wk-slot { display: flex; gap: 6px; align-items: center; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.wk-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.wk-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; color: var(--muted); }
.wk-alt { color: var(--brand); }
.wk-flag { font-size: 10px; text-transform: none; letter-spacing: 0; padding: 0 6px; border-radius: 999px; background: #eceae4; color: var(--muted); font-weight: 600; }
.wk-flag.todo { background: var(--warn-soft); color: var(--warn); }
.wk-flag.block { background: #f8dcda; color: var(--danger); }
.wk-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.wk-group { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fcfcfa; }
table.kv th { width: 30%; text-transform: none; letter-spacing: 0; font-size: 13px; }
details.card.nested > .card { border: none; padding: 0; margin: 10px 0 0; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -4px 12px rgba(0,0,0,.04); }

/* scheda del piatto */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 28, 24, .35); z-index: 40; }
.sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); z-index: 41; overflow-y: auto; padding: 18px 20px 28px; box-shadow: -8px 0 30px rgba(0,0,0,.12); }
.sheet h2 { margin: 2px 0 0; }
.sheet h3 { margin: 18px 0 6px; }
.sheet-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.sheet-close { border: none; background: #f1f0ec; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; padding: 0; flex: none; }
.sheet-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.sheet-tabs button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 150px; max-width: 200px; text-align: left; border-radius: 8px; padding: 7px 9px; }
.sheet-tabs button.active { border-color: var(--brand); background: var(--brand-soft); }
.sheet-tabs .tab-title { font-weight: 600; font-size: 13px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sheet-tabs .tab-add { min-width: auto; justify-content: center; color: var(--brand); border-style: dashed; }
.sheet .tags { gap: 4px; margin-bottom: 8px; }
.sheet-review { border: 1px solid #ead7c9; border-radius: 8px; background: #fffaf6; padding: 0 10px; margin: 6px 0 10px; }
.macro { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0; }
.macro > div { background: #f6f5f1; border-radius: 8px; padding: 8px; text-align: center; }
.macro b { display: block; font-size: 18px; }
.macro span { font-size: 11px; color: var(--muted); }
.macro .macro-rel { grid-column: 1 / -1; background: none; padding: 0; text-align: left; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
table.ing td { padding: 7px 6px; font-size: 14px; }
table.ing td.q { width: 92px; white-space: nowrap; font-weight: 600; }
table.ing td.k { width: 90px; text-align: right; white-space: nowrap; color: var(--muted); font-size: 13px; }
table.ing .eq { color: #2856a3; }
ol.steps { padding-left: 20px; margin: 0; } ol.steps li { margin: 4px 0; }
.sheet-actions { margin-top: 16px; }
.dish-form input, .dish-form select { font-size: 14px; }
.ing-edit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.ing-row { display: grid; grid-template-columns: 70px 92px 1fr 34px; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fcfcfa; }
.ing-row > :nth-child(5) { grid-column: 1 / 3; }
.ing-row > :nth-child(6) { grid-column: 3 / 5; }
.ing-row button { padding: 0; }
@media (max-width: 860px) {
  .wk-grid { grid-template-columns: 1fr; }
  .sheet { width: 100vw; padding: 14px 16px 24px; }
  .macro { grid-template-columns: repeat(2, 1fr); }
  .ing-row { grid-template-columns: 64px 84px 1fr 34px; }
  .ing-row > :nth-child(5), .ing-row > :nth-child(6) { grid-column: 1 / -1; }
}
/* proposte dal profilo del paziente (da confermare) */
.suggest { border: 1px dashed #e0c9b6; background: #fffaf6; border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.suggest-row { display: flex; gap: 8px; align-items: flex-start; color: inherit; font-size: 14px; margin: 6px 0 0; }
.suggest-row input { margin-top: 3px; }
.origin-note { background: var(--brand-soft); color: var(--ink); border-radius: 8px; padding: 8px 12px; font-size: 14px; }

/* provenienza dei valori: discreta, senza badge */
.pill.n-est, .pill.n-decl, .pill.n-ver { background: #eceae4; color: var(--muted); }
.src-note { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; white-space: nowrap; }
details.method { margin: 6px 0 10px; font-size: 13px; color: var(--muted); }
details.method > summary { cursor: pointer; display: inline-block; color: var(--muted); text-decoration: underline dotted; }
details.method p { margin: 6px 0 0; max-width: 760px; }

/* ---- "Genera menu" ---- */
.setup-head h2 { margin-bottom: 4px; }
.areas { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.areas .card { margin: 0; }
.area-head { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.area-head h3 { margin: 0; }
.area-num { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.chip-check { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; margin: 0; color: var(--ink); font-size: 14px; background: #fcfcfa; cursor: pointer; }
.chip-check input { width: auto; margin: 0; }
.chip-check:has(input:checked) { border-color: #9ccdb4; background: var(--brand-soft); }
details.subtle { margin-top: 10px; } details.subtle > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.generate-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 14px; position: sticky; bottom: 0; z-index: 5; }
button.big { padding: 11px 26px; font-size: 16px; font-weight: 600; }
.progress-card { max-width: 640px; }
.progress-list { list-style: none; padding: 0; margin: 14px 0; }
.progress-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid #f0efea; color: var(--muted); }
.progress-list li .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.progress-list li.running { color: var(--ink); font-weight: 600; } .progress-list li.running .dot { border-color: var(--brand); border-top-color: transparent; animation: spin 1s linear infinite; }
.progress-list li.done { color: var(--ink); } .progress-list li.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.gen-banner { border-radius: 8px; padding: 10px 12px; margin: 8px 0 4px; font-size: 14px; }
.gen-banner.ok { background: var(--brand-soft); }
.gen-banner.warn { background: #fdf6ee; border: 1px solid #ead7c9; }
.gen-banner ul { margin: 6px 0 0; padding-left: 18px; } .gen-banner li { margin: 2px 0; }
.gen-banner button.link { text-align: left; }
.wk-line { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.wk-line.alt { font-size: 13px; color: var(--muted); border-top: 1px dotted #ecebe6; padding-top: 3px; cursor: pointer; }
.wk-line.alt:hover .wk-alt-title { color: var(--brand); }
.wk-kcal { white-space: nowrap; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-line.wk-first .wk-kcal { color: var(--ink); font-weight: 600; }
@media (max-width: 860px) { .areas, .grid3 { grid-template-columns: 1fr; } .grid4 { grid-template-columns: 1fr 1fr; } }
.wk-line > :first-child { flex: 1; min-width: 0; text-align: left; }
.wk-line.wk-first .wk-title { display: block; }
.wk-meal { align-items: stretch; }
.sheet-review.neutral { background: #f7f7f4; border-color: var(--line); }
.wk-meal { cursor: pointer; }
.wk-meal:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.gen-banner .lnk { color: var(--brand); cursor: pointer; } .gen-banner .lnk:hover { text-decoration: underline; }
.cat-info { margin: 4px 0 2px; }

/* "Genera menu": prescrizioni e preferenze del paziente */
.areas-title { margin: 18px 2px 8px; }
.areas .area-wide { grid-column: 1 / -1; }
.pref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 16px; }
.pref label { margin-top: 10px; }
.seg { display: inline-flex; flex-wrap: nowrap; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fcfcfa; }
.seg-btn { border: 0; border-radius: 0; background: transparent; padding: 6px 12px; font-size: 14px; color: var(--ink); white-space: nowrap; }
@media (max-width: 420px) { .seg-btn { padding: 6px 8px; font-size: 13px; } }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* "Prova come paziente" */
.patient-head { align-items: flex-start; }
.trial-head h2 { margin: 0 0 2px; }
.trial-head p { margin: 0; }
.trial-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; }
.trial-grid .card { margin: 0; }
.trial-chat { height: 560px; }
.trial-hint { align-self: center; margin-top: auto; margin-bottom: auto; }
.bubble.typing { font-style: italic; }
.trial-panel { max-height: 640px; overflow-y: auto; }
.trial-panel .seg { margin-bottom: 10px; }
.trial-day { padding: 8px 0; border-bottom: 1px solid var(--line); }
.trial-day:last-child { border-bottom: 0; }
.trial-meal { display: flex; gap: 8px; align-items: baseline; font-size: 14px; padding: 2px 0; }
.trial-meal > .muted:first-child { width: 72px; flex: none; }
.trial-meal.changed .grow { color: var(--brand); font-weight: 600; }
.trial-list { font-size: 14px; line-height: 1.5; }
@media (max-width: 860px) { .trial-grid { grid-template-columns: 1fr; } .trial-chat { height: 440px; } }
.trial-pending { border: 1px solid #c6e3d5; background: var(--brand-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.trial-pending ul, .trial-pending ol { margin: 6px 0 0; padding-left: 18px; }

.culinary-options { margin:12px 0; padding:12px; border:1px solid var(--border, #ddd); border-radius:8px; }
.culinary-options label { display:block; margin:8px 0; }
.culinary-options select { display:block; max-width:100%; }

.initial-choice { display:flex; align-items:center; gap:8px; padding:10px; background:#eef6ef; border-radius:6px; }
.initial-choice input { width:auto; }

/* Weekly review: explicit assignments and issues next to the affected dish. */
.wk-option { padding:10px; margin:8px 0; border:1px solid var(--line); border-radius:8px; min-width:0; }
.wk-option.selected { border:2px solid var(--brand); background:var(--brand-soft); }
.wk-option.needs-fix { border-color:#b44230; }
.wk-option .wk-line { width:100%; text-align:left; white-space:normal; }
.wk-option .initial-choice { font-size:12px; padding:6px; }
.wk-option p { margin:6px 0; overflow-wrap:anywhere; }
.wk-meal { cursor:default; }
.review-details > summary { font-weight:600; cursor:pointer; }

/* Diario: dichiarazioni separate dalle quantità pianificate. */
.monitoring-entry { border-top: 1px solid #ddd; padding: 12px 0; }
.monitoring-entry p, .monitoring-replies { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Diario: riepilogo leggibile, dati e strumenti approfondibili. */
.monitoring-stats { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; margin:16px 0; }
.monitoring-stat { display:flex; flex-direction:column; gap:4px; padding:12px; background:var(--brand-soft); border-radius:var(--radius); }
.monitoring-stat strong { font-size:24px; color:var(--brand); }
.monitoring-stat span { font-size:12px; color:var(--muted); }
.monitoring-focus h3 { margin-top:14px; }
.monitoring-note { background:var(--brand-soft); padding:12px; border-radius:var(--radius); }
.monitoring-details > summary { cursor:pointer; font-weight:600; color:var(--brand); padding:4px 0; }
.monitoring-details[open] > summary { margin-bottom:12px; }
.trial-meal small { display:block; }
@media (max-width:1000px) { .monitoring-stats { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:540px) { .monitoring-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* Phase 4D: weekly monitoring, using the existing ChefTeam palette. */
.wm-overview h2 {margin:4px 0 8px}.wm-eyebrow {text-transform:uppercase;letter-spacing:.12em;font-size:11px;color:var(--muted);margin:0}.wm-week-picker {margin:18px 0}.wm-week-picker input {width:165px}.wm-stats {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:20px 0}.wm-stat {display:flex;flex-direction:column;gap:8px;padding:16px;background:#f5f8f7;border-radius:12px}.wm-stat strong {font-size:23px;line-height:1.2;font-weight:650}.wm-stat span:last-child {line-height:1.5;color:#53675f}.wm-footnote {padding:12px 16px;background:#f8f4e9;border-radius:9px;font-size:13px;line-height:1.6}.wm-columns {display:grid;grid-template-columns:2fr 1fr;gap:20px}.wm-columns .wm-stats {grid-template-columns:repeat(2,minmax(0,1fr))}.wm-chart {display:grid;grid-template-columns:repeat(7,minmax(85px,1fr));gap:14px;padding:16px 8px 12px;overflow-x:auto}.wm-chart-day {text-align:center;display:flex;flex-direction:column;gap:7px;font-size:12px}.wm-chart-day small {font-size:11px}.wm-chart-bars {height:170px;display:flex;align-items:flex-end;justify-content:center;gap:6px;border-bottom:1px solid #d7e2dc;background:repeating-linear-gradient(to top,transparent 0,transparent 41px,#edf1ef 42px)}.wm-bar {width:25px;border-radius:5px 5px 0 0;position:relative;min-height:2px}.wm-bar-plan {background:#d0dcd5}.wm-bar-intake {background:#1f6c53}.wm-range-cap {position:absolute;top:0;left:0;right:0;background:repeating-linear-gradient(135deg,#86b6a3 0,#86b6a3 3px,#d5e8df 3px,#d5e8df 6px);border-radius:5px 5px 0 0;border-bottom:1px dashed #174d3b}.wm-bar-partial {background:repeating-linear-gradient(135deg,#1f6c53 0,#1f6c53 4px,#7da591 4px,#7da591 7px)}.wm-bar-missing {height:8px;background:transparent;border:1px dashed #95a79b}.wm-legend {display:flex;flex-wrap:wrap;gap:18px;font-size:12px;color:#54675d}.wm-legend-plan {color:#65776c}.wm-legend-intake {color:#1f6c53}.wm-incomplete {color:#86591c}.wm-table-wrap {overflow:auto;margin-top:16px}.wm-table-wrap table {font-size:12px;min-width:620px}.wm-table-wrap th {text-align:left}.wm-macros {display:flex;flex-wrap:wrap;gap:8px 24px}.wm-macros p {margin:8px 0;font-size:13px}.wm-signal {padding:14px 0;border-bottom:1px solid #e6ece8}.wm-signal p {font-size:14px;line-height:1.6}.wm-signal .pill {margin-left:8px}.wm-diary-date {padding:14px 0 10px;margin:12px 0 0;border-bottom:1px solid #dfe8e2;text-transform:capitalize}.wm-diary-entry {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px 22px;padding:16px 0;border-bottom:1px solid #edf1ef}.wm-diary-entry p {margin:6px 0;line-height:1.6;font-size:14px}.wm-entry-value {display:flex;flex-direction:column;gap:6px;text-align:right;max-width:210px}.wm-entry-value small {font-size:11px;color:#5a6c62}.wm-entry-details {grid-column:1/-1;font-size:12px}.wm-entry-details summary {color:#536c5d;cursor:pointer}.wm-coaching summary {font-weight:600;cursor:pointer}.wm-coaching select {max-width:560px}.wm-coaching label {margin:14px 0}.wm-flex-fields {max-width:560px}.wm-report {scroll-margin-top:24px}.wm-phone {max-width:540px;margin:20px auto;background:#e9e4d9;border-radius:20px;padding:0 20px 24px;border:1px solid #d6ded8}.wm-phone-head {background:#155944;color:white;padding:17px 20px;margin:0 -20px 20px;border-radius:19px 19px 0 0;font-weight:600}.wm-whatsapp-message {background:white;padding:18px;border-radius:0 12px 12px;white-space:pre-wrap;line-height:1.65;font-size:14px;box-shadow:0 1px 3px #21382c14;overflow-wrap:anywhere}.wm-phone-caption {display:block;text-align:center;font-size:11px;color:#54655a;margin-top:18px}.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}[hidden] {display:none!important}
@media(max-width:900px){.wm-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.wm-columns{grid-template-columns:1fr}.wm-chart{gap:8px}.wm-stat strong{font-size:20px}}
@media(max-width:540px){.wm-stats,.wm-columns .wm-stats{grid-template-columns:1fr 1fr;gap:8px}.wm-stat{padding:12px}.wm-stat strong{font-size:18px}.wm-diary-entry{grid-template-columns:1fr}.wm-entry-value{text-align:left;max-width:none}.wm-week-picker{gap:6px}.wm-week-picker input{width:140px}.wm-phone{padding:0 12px 16px}.wm-phone-head{margin:0 -12px 16px}}

/* Phase 4E — professional workspace. Data and 4D services remain unchanged. */
body{font-size:14px;-webkit-font-smoothing:antialiased}button{transition:background .15s,box-shadow .15s;border-radius:10px;padding:9px 14px;font-size:13px;font-weight:550}button:hover{background:#edf4ef}button.primary:hover{background:#1b6046}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #deaa5b;outline-offset:3px}.layout{grid-template-columns:224px minmax(0,1fr)}.main{max-width:1580px;width:100%;padding:26px 34px;min-width:0}.card{box-shadow:0 3px 16px #24453604;border-color:#e7ede8;padding:22px;margin-bottom:20px}h1{font-size:25px;letter-spacing:-.7px}h2{font-size:17px;letter-spacing:-.25px}h3{font-size:14px}.ct-icon{display:inline-block;flex:none;vertical-align:middle}
.side{position:sticky;top:0;height:100vh;background:#163f31;color:#d5e4db;padding:28px 16px 18px;display:flex;flex-direction:column;gap:3px;overflow-y:auto}.side .brand{margin:0 9px 32px;gap:12px}.side .brand-name{font-size:20px;color:#fff;font-weight:650;letter-spacing:-.5px}.brand-pro{font-size:9px;background:#ffffff1c;padding:4px 5px;border-radius:5px;letter-spacing:1px;margin-left:6px;vertical-align:middle}.side .brand-sub{font-size:10px;margin-top:6px;max-width:135px;line-height:1.5;color:#a9c5b4}.side .brand-logo.initials{background:#ffffff13;width:38px;height:40px}.side-link{width:100%;display:flex;align-items:center;gap:12px;background:transparent;border:0;color:inherit;border-radius:9px;padding:12px 14px;text-align:left;font-size:13px;margin:2px 0;font-weight:450}.side-link:hover{background:#ffffff0d;color:#fff}.side-link.active{background:#ffffff15;color:#fff;box-shadow:inset 3px 0 #a2ceb4}.side-link .ct-icon{opacity:.85;width:19px;height:19px}.side-caption{font-size:9px;letter-spacing:1.7px;color:#89ab98;padding:0 14px;margin:14px 0 9px}.side-bottom{margin-top:auto;padding-top:24px}.side-profile{border-top:1px solid #ffffff14;display:flex;gap:10px;align-items:center;margin:20px 7px 8px;padding-top:20px;font-size:11px}.side-profile small{display:block;color:#90b09c;font-size:10px;margin-top:4px}.side-avatar{display:grid;place-items:center;border-radius:50%;background:#6c967e;color:#fff;font-size:11px;width:32px;height:32px;flex:none}.side .badge{margin-left:auto}.patient-head{margin:10px 0 18px;gap:18px}.patient-head h1{margin-bottom:7px}.patient-head p{font-size:11px;margin:0}.patient-head button.primary{background:white;border-color:#dbe5de;color:#2c654a}.tabs{gap:16px;margin-bottom:12px;flex-wrap:nowrap;overflow-x:auto}.tabs button{padding:12px 1px;white-space:nowrap;font-size:12px;font-weight:550}.tabs button.active{border-color:#33805c;color:#216345}.patient-tools{margin:0 0 18px;font-size:11px;color:#718078}.patient-tools summary{cursor:pointer}.patient-tools .row{margin-top:12px}.patient-tools button{font-size:11px}.demo-banner{font-size:11px;border-color:#e6ddc4;background:#fcf8ed;color:#8c7444;border-radius:9px;padding:8px 12px}
.wm-overview{background:transparent;box-shadow:none;border:0;padding:0;margin-bottom:22px}.wm-overview>.row:first-child{align-items:center}.wm-overview h2{font-size:18px;margin:5px 0}.wm-overview .wm-eyebrow{font-size:9px;color:#768b7c}.wm-overview .wm-week-picker{margin:12px 0 18px;gap:6px}.wm-week-picker input{font-size:12px;width:143px;border-radius:9px;padding:8px 10px}.wm-week-picker button{font-size:11px;padding:8px 11px}.wm-overview .wm-footnote{background:transparent;padding:0;margin:8px 0;font-size:11px;color:#6f7f74}.wm-overview>.muted.small{font-size:10px;line-height:1.6;max-width:1000px}.wm-stats{gap:16px;margin:18px 0 14px}.wm-kpi{position:relative;border:1px solid var(--line);background:white;box-shadow:0 3px 12px #24453603;border-radius:16px;padding:20px 18px;gap:9px;min-width:0}.wm-kpi>.small{font-size:10px;line-height:1.6}.wm-kpi>.muted{font-size:11px;color:#687b6e;padding-right:32px}.wm-kpi strong{font-size:24px;letter-spacing:-.7px;color:#2e5941;line-height:1.2;font-variant-numeric:tabular-nums}.wm-kpi-icon{position:absolute;right:14px;top:16px;width:31px;height:31px;background:#edf6ef;display:grid;place-items:center;border-radius:10px;color:#448361}.wm-coral .wm-kpi-icon{background:#fff1ec;color:#c87e6c}.wm-orange .wm-kpi-icon{background:#fff5e7;color:#ca984e}.wm-coral strong{color:#a96758}.wm-orange strong{color:#926f3e}
.wm-workspace{display:grid;grid-template-columns:minmax(0,1fr) 285px;gap:22px;align-items:start}.wm-main-column,.wm-side-column{min-width:0}.wm-side-column .card{padding:20px}.wm-side-column h2{font-size:15px}.wm-side-column p{font-size:12px;line-height:1.75}.wm-side-column .wm-signal p{font-size:12px;margin:6px 0}.wm-side-column .wm-signal>b{font-size:12px}.wm-side-column .wm-signal .pill{font-size:9px}.wm-observations>.row{gap:9px}.wm-observations>.row .ct-icon{color:#b98748;width:18px}.wm-signal{padding:14px 0}.wm-side-column .wm-footnote{font-size:10px;background:#fcf6eb;padding:10px 12px;line-height:1.7}.wm-feedback blockquote{font-size:12px;line-height:1.8;margin:16px 0 8px;border-left:2px solid #bad3c3;padding:0 0 0 12px;color:#4a6a55}.wm-feedback small{font-size:10px}.wm-report-teaser{background:#ecf5ef;border-color:#dbe8df}.wm-report-teaser button{width:100%;font-size:11px}.wm-report-teaser>small{display:block;font-size:10px;color:#809385;text-align:center;margin-top:12px}.wm-report-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:13px;background:#dceee1;color:#3d7956;margin-bottom:16px}.wm-energy h2{margin-bottom:18px}.wm-legend{gap:10px 18px;font-size:10px;line-height:1.6}.wm-chart{gap:12px;padding:20px 0 10px;grid-template-columns:repeat(7,minmax(66px,1fr));overflow-x:auto}.wm-chart-bars{height:220px;gap:8px;border-color:#e2ebe4;background:repeating-linear-gradient(to top,transparent 0,transparent 54px,#edf2ee 55px)}.wm-bar{width:24px;border-radius:5px 5px 0 0}.wm-bar-plan{background:#e4b874}.wm-bar-intake{background:#5c9774}.wm-range-cap{background:repeating-linear-gradient(135deg,#90bba0 0,#90bba0 3px,#d7e9dd 3px,#d7e9dd 6px);border-color:#427d59}.wm-bar-partial{background:repeating-linear-gradient(135deg,#6a9d7b 0,#6a9d7b 4px,#c1d8c7 4px,#c1d8c7 7px)}.wm-bar-missing{height:10px;background:#f5f7f5;border:1px dashed #a9bbae}.wm-chart-day b{text-transform:capitalize;font-size:11px;font-weight:550;color:#647b6b}.wm-chart-day small{font-size:9px;line-height:1.5;font-variant-numeric:tabular-nums}.wm-legend-plan{color:#aa8148}.wm-legend-intake{color:#528160}.wm-daily-values{margin-top:15px;font-size:11px;color:#738578}.wm-daily-values summary{cursor:pointer}.wm-table-wrap{margin-top:14px;border-radius:10px}.wm-table-wrap table{min-width:620px;font-size:11px}.wm-table-wrap th{font-size:9px;background:#f7faf7;padding:12px 10px}.wm-table-wrap td{padding:12px 10px}.wm-table-wrap tbody th{background:transparent}
.wm-macro-rings{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;padding:20px 0 14px}.wm-macro-item{text-align:center;display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0}.wm-macro-item>b{font-size:12px;font-weight:550}.wm-macro-item>small{font-size:10px}.wm-donut{--ring:#729b7d;width:108px;height:108px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--ring) var(--coverage),#eef3ef 0)}.wm-donut-1{--ring:#d3a35e}.wm-donut-2{--ring:#d2927f}.wm-donut>div{width:88px;height:88px;border-radius:50%;background:white;display:flex;flex-direction:column;justify-content:center;gap:5px}.wm-donut strong{font-size:22px;color:#44634e;font-variant-numeric:tabular-nums;letter-spacing:-.5px}.wm-donut small{font-size:9px;color:#809182}.wm-macro-card>p{font-size:10px;line-height:1.7;margin:7px 0 0}.wm-macro-card .row>span{font-size:10px}.wm-weight-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:18px 0 10px}.wm-weight-heading strong{font-size:37px;font-weight:600;letter-spacing:-1.2px;color:#365b43;font-variant-numeric:tabular-nums}.wm-weight-heading>div>span{color:#87968b;font-size:15px}.wm-weight-heading p{margin:5px 0;font-size:10px}.wm-weight-change{text-align:right;max-width:230px;font-size:12px;color:#53735d}.wm-weight-change small{display:block;margin-top:6px;font-size:10px;line-height:1.5}.wm-measurements .chart{height:auto;width:100%;max-height:200px;margin:10px 0}.wm-measurements .chart .line{stroke:#77a186;stroke-width:2.5}.wm-measurements>p{font-size:10px}.wm-circumferences{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px;border-top:1px solid #edf1ed;padding-top:18px;margin-top:16px}.wm-circumferences>div{display:grid;grid-template-columns:20px 1fr;gap:8px}.wm-circumferences .ct-icon{grid-row:1/3;color:#8baf97;width:17px}.wm-circumferences strong{font-size:18px;color:#46654f;font-variant-numeric:tabular-nums}.wm-circumferences small:last-child{grid-column:1/-1;font-size:9px}.wm-synthetic-note{font-size:10px;color:#927b57;background:#fcf8ee;border-radius:7px;padding:8px 10px;margin-top:18px}.wm-empty{padding:30px 10px;text-align:center;color:#718a77;display:flex;flex-direction:column;align-items:center;gap:12px}.wm-empty>.ct-icon{width:32px;height:32px;color:#9eb8a6}.wm-empty p{font-size:12px;max-width:400px;margin:0;line-height:1.8}.wm-empty button{font-size:11px;margin-top:8px}.wm-measurements summary{font-size:11px;cursor:pointer}.wm-measurements details p{font-size:11px}
.wm-trend>summary,.wm-coaching>summary{font-size:12px;font-weight:550;cursor:pointer}.wm-trend .wm-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.wm-trend .wm-stat{font-size:11px;background:#f7faf7}.wm-trend .wm-stat strong{font-size:17px}.wm-diary-entry{display:table-row;grid-template-columns:none}.wm-diary-entry .wm-meal-icon{display:inline-block;padding-right:6px;color:#7e9f8a}.wm-diary-entry .wm-meal-icon .ct-icon{width:14px;height:14px}.wm-diary-entry p{font-size:11px;margin:0 0 5px;line-height:1.65}.wm-diary-entry td>small{display:block;font-size:9px;line-height:1.6;margin-top:5px}.wm-diary-entry td>strong{font-size:11px;white-space:nowrap;font-weight:550}.wm-diary-entry .pill{font-size:9px;white-space:normal;line-height:1.6;padding:3px 7px}.wm-food-cell{min-width:230px;max-width:340px}.wm-food-cell>p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.wm-food-cell:has(details[open])>p{-webkit-line-clamp:unset;display:block}.wm-entry-details{font-size:10px}.wm-entry-details summary{font-size:10px;padding:3px 0}.wm-entry-details[open]{background:#f7faf7;padding:10px;border-radius:8px;margin-top:7px}.wm-entry-details p{margin-top:8px}.wm-diary-table tbody tr:hover{background:#fafcf9}.wm-diary>.row .link{font-size:11px}.wm-report{max-width:850px;margin:24px auto}.wm-phone{max-width:500px}.wm-phone-head{font-size:13px}.wm-whatsapp-message{font-size:13px}.wm-coaching label{font-size:11px}.wm-coaching select,.wm-coaching input{font-size:12px}
@media(min-width:1450px){.wm-workspace{grid-template-columns:minmax(0,1fr) 310px}.wm-chart-bars{height:250px}.wm-macro-rings{padding:26px 0}.wm-donut{width:120px;height:120px}.wm-donut>div{width:100px;height:100px}}
@media(max-width:1180px){.main{padding:22px}.layout{grid-template-columns:200px minmax(0,1fr)}.side{padding:24px 12px}.wm-workspace{grid-template-columns:minmax(0,1fr) 245px;gap:16px}.wm-stats{gap:10px}.wm-kpi{padding:17px 13px}.wm-kpi strong{font-size:19px}.wm-kpi-icon{width:26px;height:26px;right:10px}.wm-kpi-icon .ct-icon{width:16px}.wm-side-column .card{padding:16px}.wm-chart{grid-template-columns:repeat(7,minmax(58px,1fr));gap:6px}.wm-chart-bars{height:200px}.wm-bar{width:20px}.wm-chart-day small{font-size:8px}.wm-donut{width:94px;height:94px}.wm-donut>div{width:76px;height:76px}.wm-donut strong{font-size:19px}}
@media(max-width:980px){.wm-workspace{grid-template-columns:minmax(0,1fr)}.wm-side-column{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.wm-side-column .card{margin:0}.wm-report-teaser{grid-column:1/-1}.wm-report-teaser button{width:auto}.wm-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.wm-kpi strong{font-size:24px}.wm-kpi-icon{width:32px;height:32px}.wm-chart-day small{font-size:10px}.wm-chart-bars{height:220px}}
@media(max-width:700px){.layout{display:block}.side{position:relative;top:auto;height:auto;overflow:visible;padding:16px;display:block}.side .brand{margin:0 0 16px}.side>.side-link{display:inline-flex;width:auto;margin-right:7px}.side>.side-caption,.side-patient-nav>.side-caption,.side-bottom .side-profile{display:none}.side-patient-nav{display:flex;overflow-x:auto;gap:6px;padding:4px 0;scrollbar-width:thin}.side-patient-nav .side-link{width:auto;white-space:nowrap;flex:none;font-size:11px;padding:10px}.side-bottom{display:flex;flex-wrap:wrap;gap:4px;padding-top:8px}.side-bottom .side-link{width:auto;font-size:10px;padding:8px}.side-bottom .ct-icon{width:15px;height:15px}.main{padding:18px 14px;max-width:none}.patient-head{margin-top:8px}.patient-head h1{font-size:22px}.patient-head button.primary{font-size:11px}.tabs{gap:20px}.tabs button{font-size:11px}.card{padding:18px}.wm-workspace{gap:0}.wm-side-column{margin-top:0;gap:14px}.wm-kpi strong{font-size:22px}.wm-kpi>.muted{font-size:10px}.wm-kpi>.small{font-size:9px}.wm-kpi-icon{width:25px;height:25px}.wm-overview>.row>.primary{font-size:10px}.wm-chart{grid-template-columns:repeat(7,minmax(58px,1fr));overflow-x:auto;gap:8px}.wm-chart-day small{font-size:9px}.wm-chart-bars{height:190px}.wm-bar{width:20px}.wm-macro-rings{gap:8px}.wm-donut{width:90px;height:90px}.wm-donut>div{width:72px;height:72px}.wm-macro-item>b{font-size:10px}.wm-macro-item>small{font-size:9px}.wm-weight-heading strong{font-size:32px}.wm-circumferences{grid-template-columns:repeat(2,minmax(0,1fr))}.wm-table-wrap{max-width:100%;overflow-x:auto}.wm-side-column .card{margin-bottom:0}.wm-phone{margin:16px 0}.wm-whatsapp-message{font-size:12px}.wm-weight-change{font-size:11px}}
@media(max-width:400px){.wm-kpi strong{font-size:19px}.wm-kpi{padding:16px 11px}.wm-kpi-icon{display:none}.wm-kpi>.muted{padding-right:0}.wm-side-column{grid-template-columns:1fr}.wm-report-teaser{grid-column:auto}.wm-donut{width:80px;height:80px}.wm-donut>div{width:64px;height:64px}.wm-donut strong{font-size:17px}.wm-week-picker input{width:128px}.wm-week-picker button{padding:7px 8px}}
@media(prefers-reduced-motion:reduce){button{transition:none}html{scroll-behavior:auto}}
@media print{.side,.tabs,.patient-tools,.wm-week-picker{display:none!important}.layout,.wm-workspace{display:block}.main{padding:0}.card{box-shadow:none;break-inside:avoid}.wm-daily-values{display:block}.wm-chart{overflow:visible}}
.side-request-link{position:relative}.side-request-link .badge{position:absolute;right:9px;top:12px;pointer-events:none;background:#c98b58;font-size:10px}.side-request-link .side-link{padding-right:30px}
.wm-diary .wm-table-wrap{max-height:430px;overflow:auto;overscroll-behavior:contain}.wm-diary-table thead th{position:sticky;top:0;z-index:1;background:#f6faf6}.wm-diary-table th:last-child{min-width:105px}
.wm-report-snippet{background:#ffffffbf;border-radius:2px 11px 11px;padding:13px;font-size:11px;line-height:1.8;color:#4d6955;white-space:pre-wrap;margin:14px 0;box-shadow:0 1px 3px #24453607}

/* 4E UX refinement: one patient navigation, clearer readings, less header height. */
.patient-head{margin:0 0 10px}.patient-head h1{font-size:23px}.patient-tools{margin:0 0 10px}.patient-tools .row{margin-top:8px}.wm-overview{margin-bottom:14px}.wm-overview-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 16px}.wm-week-heading{flex:1;min-width:220px}.wm-week-heading h2{font-size:16px;margin:3px 0 4px}.wm-week-heading p{margin:0;font-size:10px}.wm-week-heading .wm-eyebrow{font-size:9px}.wm-overview .wm-week-picker{margin:0;gap:5px;flex-wrap:nowrap}.wm-overview-toolbar>.primary{font-size:11px;padding:9px 12px}.wm-overview .wm-stats{margin:12px 0 8px}.wm-overview .wm-kpi{gap:6px;padding:15px 14px}.wm-overview .wm-footnote{margin:5px 0;font-size:10px;line-height:1.5}.wm-reading-note{font-size:10px;color:#718078;margin-top:4px}.wm-reading-note summary{cursor:pointer;display:inline-block}.wm-reading-note p{font-size:10px;margin:6px 0 0;line-height:1.6}.wm-kpi-reading-label{font-size:9px;line-height:1.4;color:#738477}.wm-calorie-kpi>strong{font-size:20px;line-height:1.3;letter-spacing:-.4px;font-variant-numeric:tabular-nums}.wm-kpi-target{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:3px 8px;border-top:1px solid #edf2ee;padding-top:6px;font-size:10px}.wm-kpi-target span{color:#728176}.wm-kpi-target b{font-weight:600;color:#405d4a;white-space:nowrap}.wm-kpi-uncertainty{font-size:9px;line-height:1.5;color:#7b6c4b}.wm-calorie-kpi>.small{font-size:9px}.wm-weight-kpi{border-color:#e4d9c5;background:#fffefa}.wm-weight-kpi>strong{font-size:28px}.wm-measurement-origin{font-size:9px;line-height:1.5;color:#85724f}.wm-kpi-weight-change{font-size:10px;line-height:1.5;color:#5a6f60}.wm-mini-chart{height:48px;width:100%;overflow:hidden}.wm-mini-chart .chart{display:block;height:48px;width:100%;margin:0}.wm-mini-chart .axis,.wm-mini-chart .grid{display:none}.wm-mini-chart .line{stroke:#a18b5d;stroke-width:2.5}.wm-measurements{border-top:3px solid #d7bd8c}.wm-measurements>.row{gap:10px}.wm-measurements>.row p{margin:5px 0;font-size:10px}.wm-demo-measurements{display:inline-block;font-size:9px;color:#8c7547;background:#fcf7e9;padding:4px 7px;border-radius:6px;margin-top:2px}.wm-weight-heading{margin:12px 0 8px}.wm-weight-heading p{max-width:360px;line-height:1.6}.wm-circumferences{padding-top:13px;margin-top:12px}.wm-circumferences>div{gap:6px}.wm-circumferences strong{font-size:20px}.wm-main-column>.card{margin-bottom:16px}.wm-macro-rings{padding:16px 0 10px}.wm-diary-entry p{font-size:12px}.wm-report{padding:20px;margin-top:18px}.wm-report>.row{gap:8px}.wm-phone{margin-top:16px;margin-bottom:16px}.wm-phone-caption{margin-top:12px}.metrics{gap:14px}.chart-card{overflow:hidden}.chart-card .chart{max-width:100%}
@media(max-width:1180px){.wm-week-heading{min-width:200px}.wm-overview-toolbar{gap:8px 12px}.wm-calorie-kpi>strong{font-size:18px}.wm-weight-kpi>strong{font-size:25px}}
@media(max-width:980px){.wm-overview-toolbar{align-items:flex-start}.wm-week-heading{flex-basis:100%}.wm-overview .wm-week-picker{flex:1}.wm-calorie-kpi>strong{font-size:22px}.wm-overview .wm-kpi{padding:14px}.wm-weight-kpi>strong{font-size:28px}.wm-mini-chart{height:42px}.wm-mini-chart .chart{height:42px}}
@media(max-width:700px){.side{padding:12px 14px}.side .brand{margin-bottom:10px}.side-bottom{padding-top:5px}.side-patient-nav{gap:3px;padding:2px 0}.main{padding-top:14px}.patient-head{margin-bottom:8px}.patient-head h1{font-size:21px}.patient-head p{line-height:1.5}.patient-tools{margin-bottom:10px}.wm-overview-toolbar{gap:8px}.wm-week-heading{min-width:0}.wm-week-heading h2{font-size:16px}.wm-overview .wm-week-picker{flex:1 1 100%;justify-content:flex-start}.wm-overview-toolbar>.primary{font-size:10px;padding:7px 10px}.wm-overview .wm-stats{gap:8px;margin-top:10px}.wm-overview .wm-kpi{padding:12px 10px;gap:5px}.wm-calorie-kpi>strong{font-size:19px}.wm-kpi-target{font-size:9px}.wm-kpi-uncertainty,.wm-measurement-origin{font-size:9px;line-height:1.5}.wm-weight-kpi>strong{font-size:25px}.wm-kpi-weight-change{font-size:9px}.wm-measurements>.row{align-items:flex-start}.wm-demo-measurements{font-size:9px}.wm-main-column>.card{margin-bottom:14px}.wm-circumferences{gap:12px}.wm-report{padding:16px}.wm-report>.row h2{font-size:16px}.wm-whatsapp-message{line-height:1.7}.wm-diary-entry p{font-size:11px}}
@media(max-width:400px){.wm-calorie-kpi>strong{font-size:17px}.wm-week-picker button{padding:7px}.wm-week-picker input{width:127px}.wm-overview-toolbar>.primary{width:100%}.wm-weight-heading{align-items:flex-start}.wm-weight-change{max-width:125px}.wm-demo-measurements{max-width:100%;line-height:1.5}}

/* Progress and settings: same visual system, existing controls and data. */
.progress-heading{padding:18px 22px}.progress-heading>p{max-width:850px;line-height:1.7}.progress-origins{font-size:11px;color:#6e8174}.progress-origins summary{cursor:pointer}.progress-origins .legend{margin-top:12px}.progress-timeline{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.progress-weight-chart{grid-column:1/-1;border-top:3px solid #d7bd8c}.progress-weight-chart .chart{max-height:280px;width:100%;height:auto}.progress-timeline .chart-card{margin-bottom:0;padding:20px}.progress-timeline .chart-card>p{font-size:10px;line-height:1.7}.progress-single{padding:25px 12px;text-align:center;background:#f7faf7;border-radius:12px;margin-top:14px}.progress-single strong{font-size:30px;color:#486c52}.progress-single p{font-size:12px;line-height:1.7}.progress-history{overflow-x:auto}.progress-history summary{font-size:12px;font-weight:550;cursor:pointer}.progress-history table{min-width:650px;margin-top:16px;font-size:11px}.progress-history .danger{font-size:11px}.metrics .metric{padding:18px;border-radius:15px}.metrics .metric>b{font-size:27px}.settings-section{padding:20px 22px}.settings-section>summary{font-size:15px;font-weight:600;cursor:pointer;line-height:1.5}.settings-section[open]>summary{margin-bottom:10px}.settings-description{font-size:12px;color:#718078;line-height:1.7;max-width:820px;margin:8px 0 16px}.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 20px}.settings-section label{font-size:12px;color:#526b5b}.settings-section input,.settings-section select,.settings-section textarea{font-size:12px;margin-top:5px}.settings-section textarea{font-family:inherit;line-height:1.6}.settings-switch{display:flex;align-items:center;gap:12px;border-bottom:1px solid #edf2ee;padding:12px 0;margin:0!important;color:#405b49!important}.settings-switch span{line-height:1.6}.ui-switch{appearance:none;-webkit-appearance:none;flex:none;width:36px!important;height:21px;border:0;border-radius:20px;background:#c9d2cd;padding:0!important;position:relative;cursor:pointer;margin:0!important;transition:background .15s}.ui-switch:before{content:'';position:absolute;width:15px;height:15px;border-radius:50%;background:white;left:3px;top:3px;box-shadow:0 1px 3px #243d3320;transition:transform .15s}.ui-switch:checked{background:#3c835f}.ui-switch:checked:before{transform:translateX(15px)}.ui-switch:disabled{opacity:.45;cursor:not-allowed}.ui-switch:focus-visible{outline:3px solid #d9a355;outline-offset:3px}.automation-toggle{margin:0 0 10px!important}.automation-toggle .ui-switch{margin-right:6px!important}.automation-toggle b{font-size:12px}.settings-section .opt{border-radius:12px;background:#fafcf9;padding:15px}.settings-preferences{font-size:12px;padding:14px 0;color:#5b735f}.settings-preferences summary{cursor:pointer}.settings-preferences p{line-height:1.8}.settings-consent{font-size:12px;padding:12px;background:#fcf6e9;border-radius:9px;line-height:1.7;color:#8b734a}.settings-section>.card{box-shadow:none;margin:12px 0}.settings-section .demo-banner{margin-top:12px}
@media(max-width:980px){.progress-timeline{gap:14px}.settings-section{padding:18px}}
@media(max-width:700px){.progress-timeline,.settings-grid{grid-template-columns:minmax(0,1fr)}.progress-weight-chart{grid-column:auto}.progress-heading{padding:16px}.progress-timeline .chart-card{padding:16px}.progress-timeline .chart{max-width:100%;height:auto}.metrics .metric>b{font-size:24px}.settings-section>summary{font-size:14px}.settings-section{padding:16px}.settings-description{font-size:11px}.settings-switch{font-size:11px!important;gap:10px}.progress-history th,.progress-history td{padding:10px 7px}.progress-single strong{font-size:27px}}
@media(prefers-reduced-motion:reduce){.ui-switch,.ui-switch:before{transition:none}}
.metrics{grid-template-columns:repeat(auto-fit,minmax(155px,1fr))}.progress-weight-chart{padding:20px 22px}.progress-weight-chart>p{font-size:10px;line-height:1.7}.progress-weight-chart h3{font-size:16px}
@media(max-width:700px){.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.metrics .metric{padding:14px}.progress-weight-chart{padding:16px}}
/* Patient organization: existing six routes, clearer content and assistant identity. */
.patient-switcher{display:flex;justify-content:flex-end;margin:0 0 12px}.patient-switcher label{display:flex;align-items:center;gap:12px;margin:0;font-size:11px}.patient-switcher select{width:340px;max-width:60vw;font-size:12px;padding:8px 10px}.section-heading{margin:8px 0 20px}.section-heading p{font-size:12px;line-height:1.7}.plan-area>.wm-eyebrow{margin-bottom:8px}.plan-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 22px;margin:20px 0}.plan-fact{padding-bottom:12px;border-bottom:1px solid #edf2ee}.plan-fact dt{font-size:11px;color:#7b8c7e;margin-bottom:6px}.plan-fact dd{margin:0;font-size:13px;line-height:1.7;color:#36563f}.plan-area>details{font-size:12px;margin:16px 0}.plan-area>details>summary{cursor:pointer}.plan-method>.card{margin:14px 0;box-shadow:none}.plan-area>.card{box-shadow:none;background:#fafcf9;margin-top:16px}.chefteam-identity{display:flex;align-items:center;gap:18px;background:linear-gradient(120deg,#edf6f0,#fff);border-color:#dfebe2}.chefteam-identity h2{font-size:23px;margin-bottom:6px}.chefteam-identity p{margin:4px 0;font-size:13px}.chefteam-avatar{width:62px;height:62px;border-radius:19px;background:#d9ebdf;display:grid;place-items:center;color:#41775a;flex:none}.chefteam-avatar .ct-icon{width:33px;height:33px}.chefteam-identity .small{font-size:11px}.settings-section .chat{margin-top:18px}.settings-section .settings-section{box-shadow:none}.plan-method summary{font-weight:550}.plan-area .stepper{margin-top:20px}
@media(max-width:700px){.patient-switcher{justify-content:stretch;margin-bottom:10px}.patient-switcher label{display:block;width:100%}.patient-switcher select{max-width:none;width:100%;margin-top:5px}.plan-facts{grid-template-columns:minmax(0,1fr);gap:12px}.plan-fact dd{font-size:12px}.chefteam-identity{gap:12px;padding:16px}.chefteam-avatar{width:45px;height:45px;border-radius:14px}.chefteam-avatar .ct-icon{width:25px;height:25px}.chefteam-identity h2{font-size:20px}.chefteam-identity p{font-size:11px}}
/* Reference palette and concise ownership of page details. */
wm-brief .wm-chart-bars{height:185px}.wm-brief .wm-chart{padding-top:12px;padding-bottom:4px}.wm-brief .wm-energy{padding:18px}.wm-brief .wm-legend{font-size:10px}.wm-brief .wm-side-column>.card{margin-bottom:14px}.wm-quick-links{gap:8px;margin:0 0 15px}.wm-quick-links button{font-size:11px}.wm-brief .wm-signal{padding:10px 0}.wm-brief .wm-signal p{margin:5px 0;font-size:12px}.wm-brief .wm-kpi-reading-label{font-size:9px}.diary-filters{padding:18px}.diary-filters>label{display:flex;align-items:center;gap:12px;margin-top:14px}.diary-filters select{width:260px;max-width:100%}.diary-totals{font-size:12px}.diary-totals summary{cursor:pointer;font-weight:550}.diary-totals .wm-table-wrap{margin-top:18px}.demo-clean-chat{height:270px;min-height:170px;margin:14px 0}.demo-conversation>div.row>select{max-width:330px}.demo-original-history,.messages-history{margin-top:16px;font-size:12px}.demo-original-history summary,.messages-history summary{cursor:pointer}.demo-history-list{max-height:340px;overflow:auto;margin-top:14px}.demo-history-list>p{padding:12px;border-bottom:1px solid var(--line);font-size:12px}.demo-history-list small{display:block;margin-bottom:6px}.demo-conversation .phrases{margin:10px 0}.demo-conversation .meta{font-size:10px}.wm-report-teaser>small{margin-top:12px}.wm-overview .wm-footnote{font-size:10px}
@media(max-width:980px){.wm-brief .wm-chart-bars{height:170px}.wm-brief .wm-side-column{grid-template-columns:repeat(2,minmax(0,1fr))}.wm-open-requests{min-width:0}}
@media(max-width:700px){.wm-brief .wm-chart-bars{height:150px}.wm-brief .wm-side-column{grid-template-columns:minmax(0,1fr)}.diary-filters>label{display:block}.diary-filters select{width:100%;margin-top:6px}.demo-conversation>div.row>select{max-width:none;width:100%}.demo-conversation .chat{height:240px}.demo-clean-chat .bubble{max-width:92%}.wm-quick-links{gap:6px}}
.patient-avatar{width:45px;height:45px;border-radius:50%;background:#e0eee5;display:grid;place-items:center;color:#24744e;font-size:17px;font-weight:650;flex:none}.patient-head h1{margin:0!important;font-size:23px}.patient-head .pill{font-size:10px}.patient-head>.grow>p{margin-top:5px}.patient-head .patient-switcher{margin:0}.patient-head .patient-switcher label{display:block;font-size:9px}.patient-head .patient-switcher select{font-size:11px;width:265px;margin-top:3px}.wm-brief .wm-bar-plan{background:#b5e4c4}.wm-brief .wm-legend-plan{color:#649b76}.wm-calorie-kpi .wm-kpi-icon{background:#fff0e6;color:#e6785c}.wm-coral{background:#fffaf7}.wm-brief .wm-bar-intake{background:#249467}.wm-brief .wm-range-cap{background:repeating-linear-gradient(135deg,#70b68d 0,#70b68d 3px,#d7ebdf 3px,#d7ebdf 6px)}
@media(max-width:700px){.patient-head .patient-switcher{order:3;width:100%}.patient-head .patient-switcher select{width:100%;max-width:none}.patient-head>.primary{font-size:10px}.patient-avatar{width:38px;height:38px;font-size:15px}.patient-head h1{font-size:21px}.patient-head{gap:10px}.patient-head .patient-switcher label{font-size:10px}}
/* Final demo: attention list and compact historical views, same ChefTeam palette. */
.final-patient-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.final-patient-card{margin:0;min-width:0}.final-patient-card h2{margin:0}.final-patient-card .row p{margin:4px 0}.final-patient-facts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:16px}.final-fact{display:flex;flex-direction:column;align-items:flex-start;gap:7px;text-align:left;white-space:normal;min-width:0;padding:12px;background:#f7faf8}.final-fact small{font-size:11px;line-height:1.45;color:var(--muted)}.final-status-aligned{background:#e3f3e9;color:#216c4b}.final-status-different{background:#fff0e9;color:#994b35}.final-status-observe{background:#fff6df;color:#82621e}.final-status-insufficient{background:#eff1f0;color:#586b60}.final-patient-spark{width:100%;text-align:left;background:white;border:0;padding:12px 0 0}.final-patient-spark svg{height:85px;width:100%}.final-patient-filters label{display:flex;gap:12px;align-items:center}.final-patient-filters select{width:210px}.final-capabilities{margin-top:18px;font-size:12px}.final-capabilities summary{cursor:pointer;font-weight:600}.final-history select{width:230px}.final-menu-days{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:14px}.final-menu-day{border:1px solid var(--line);border-radius:12px;padding:12px;min-width:0}.final-menu-day>summary{font-weight:600;cursor:pointer}.final-meal{padding:12px 0;border-top:1px solid var(--line)}.final-meal>strong,.final-meal>small{display:block;margin-bottom:7px}.final-meal details{font-size:12px}.final-meal summary{cursor:pointer;color:var(--brand)}.final-free-chat{height:330px;margin:16px 0}.final-trial textarea{resize:vertical;min-height:64px}.final-trial>small{display:block;margin-top:10px}.final-trial [role=alert]:empty{display:none}.final-trial [role=alert]{color:#9b3f30}.final-weight-alert{border-left:4px solid var(--orange);font-size:13px}.final-history .wm-phone{max-width:620px;margin:12px auto}.final-history .wm-whatsapp-message{font-size:13px}.final-patient-spark .line-chart{height:85px}
@media(max-width:1180px){.final-patient-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:700px){.final-patient-facts{gap:6px}.final-fact{padding:10px}.final-history select{width:100%}.final-menu-days{grid-template-columns:minmax(0,1fr)}.final-trial .row>.grow{flex-basis:100%}.final-free-chat{height:290px}.final-patient-filters label{width:100%}.final-patient-filters select{flex:1;min-width:0}.final-patient-card{padding:15px}}
/* Only the patient list and the final-demo Overview. */
.brief-counters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:22px 0}.brief-counter{display:flex;align-items:center;gap:14px;padding:18px 22px;text-align:left;border:1px solid var(--line);background:white;border-radius:16px}.brief-counter strong{font-size:28px}.brief-counter[aria-pressed=true]{outline:2px solid var(--brand);outline-offset:2px}.brief-aligned{background:#e9f5ee;color:#235e44}.brief-review{background:#fff1df;color:#7f501d}.brief-missing{background:#f0f2f4;color:#485766}.brief-list-heading{margin:10px 0}.brief-list-heading h2{font-size:16px}.brief-patient-list{display:grid;gap:12px}.brief-patient-row{display:grid;grid-template-columns:minmax(170px,1.2fr) minmax(130px,.8fr) minmax(170px,1fr) minmax(160px,1.2fr) 16px;gap:18px;align-items:center;width:100%;margin:0;text-align:left;white-space:normal;color:var(--text);font-weight:400;transition:border-color .15s}.brief-patient-row:hover{border-color:var(--brand);background:#fbfdfb}.brief-patient-row:focus-visible,.brief-metric:focus-visible{outline:3px solid var(--brand);outline-offset:2px}.brief-person{display:flex;align-items:center;gap:12px;min-width:0}.brief-person strong{display:block;font-size:17px}.brief-person .small,.brief-weight>span{display:block;margin-top:5px}.brief-weight strong{font-size:18px}.brief-weight-flag{display:block;font-size:12px;font-weight:600;color:#795326;margin-top:8px}.brief-reason{font-size:13px;line-height:1.5}.brief-state .pill{font-size:12px}.brief-overview{margin-top:12px;padding:24px}.brief-overview h2{margin:0;font-size:21px}.brief-verdict{font-size:16px;line-height:1.5;margin:12px 0 20px}.brief-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.brief-metric{display:flex;flex-direction:column;gap:8px;align-items:flex-start;text-align:left;white-space:normal;background:#f6f9f7;border-color:#e4ece7;padding:16px;min-width:0}.brief-metric strong{font-size:22px;overflow-wrap:anywhere}.brief-metric>.small{font-size:12px;line-height:1.5;font-weight:400}.brief-checks{margin-top:18px;border-top:1px solid var(--line);padding-top:12px}.brief-checks h3{font-size:14px;margin:4px 0 8px}.brief-checks button{display:block;white-space:normal;text-align:left;font-size:13px;padding:5px 0}.brief-overview-links{margin:16px 0}.brief-unavailable pre{white-space:pre-wrap;overflow-wrap:anywhere}.brief-unavailable details{margin-top:16px}
@media(max-width:1180px){.brief-patient-row{grid-template-columns:minmax(180px,1.4fr) minmax(130px,1fr) minmax(170px,1fr);gap:14px}.brief-reason{grid-column:1/-1}.brief-open{display:none}.brief-metric strong{font-size:19px}}
.options-generation-preferences{margin:12px 0;padding:14px 16px;border:1px solid var(--line);border-left:3px solid var(--accent);background:var(--panel)}
.options-generation-preferences>summary{cursor:pointer;color:var(--ink);font-weight:600;line-height:1.45}
.options-generation-preferences>p{margin:9px 0;line-height:1.55}
.options-prescribed-style{padding:8px 10px;border-radius:8px;background:#fff5e9;color:var(--ink)}
.options-menu-controls{align-items:stretch}
.options-menu-controls>select{flex:0 1 145px}
.options-menu-controls>input{flex:1 1 280px;min-width:180px}
.options-pref-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:10px 14px}
.options-pref-field{display:flex;flex-direction:column;gap:5px;min-width:0;margin:5px 0;color:var(--ink);font-size:12px}
.options-pref-field select,.options-pref-field input{min-width:0;width:100%;font-size:13px}
.options-pref-list,.options-pref-scope{min-width:0;margin:10px 0;padding:8px 10px 10px;border:1px solid var(--line);border-radius:9px}
.options-pref-list legend,.options-pref-scope legend{padding:0 5px;color:var(--ink);font-size:12px;font-weight:600}
.options-pref-checks{display:flex;flex-wrap:wrap;gap:5px 14px}
.options-pref-check{display:inline-flex;align-items:center;gap:7px;margin:3px 0;color:var(--ink);font-size:12px}
.options-pref-check input{flex:none;width:17px;height:17px;margin:0;accent-color:var(--accent)}
.options-pref-days{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr));gap:6px 12px;padding:8px 10px;border-left:2px solid var(--line)}
.options-pref-scope{display:flex;flex-wrap:wrap;gap:8px 20px}
.options-pref-note{grid-column:1/-1}
.options-menu-generate{margin-top:10px}
@media(max-width:640px){.options-generation-preferences{padding:12px}.options-pref-grid{grid-template-columns:minmax(0,1fr);gap:5px}.options-menu-controls>select,.options-menu-controls>input{flex-basis:100%;width:100%}.options-pref-scope{display:grid;gap:3px}}
.professional-preferences-editor{margin-top:12px;border-color:var(--line)}
.professional-preferences-editor>p{max-width:72ch}
.professional-preferences-editor .professional-pref-cuisines{margin:8px 0 12px;border:1px solid var(--line);border-radius:9px;padding:8px 10px}
.professional-preferences-editor .professional-pref-cuisines legend{padding:0 5px;font-size:12px;font-weight:600;color:var(--ink)}
.professional-preferences-editor .professional-pref-lunch-days{margin-top:2px;padding:2px 10px 8px;border-left:2px solid var(--line)}
.professional-pref-ratings{margin:12px 0}
.professional-pref-ratings>summary{cursor:pointer;font-weight:600;color:var(--ink)}
.professional-pref-search{margin:6px 0 8px}
.professional-pref-food-list{max-height:280px;overflow:auto;border:1px solid var(--line);border-radius:8px;padding:4px 10px;overscroll-behavior:contain}
.professional-pref-food-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(190px,.8fr);gap:10px;align-items:center;border-bottom:1px solid var(--line);padding:6px 0;font-size:13px}
.professional-pref-food-row:last-child{border-bottom:0}
.professional-pref-food-row>[aria-label]{margin:0}
.professional-pref-food-row select{min-width:0;width:100%;font-size:12px}
.professional-preferences-editor [role=status]{min-height:1.4em}
@media(max-width:640px){.professional-preferences-editor{padding:12px}.professional-preferences-editor>.row{align-items:flex-start}.professional-pref-food-row{grid-template-columns:minmax(0,1fr) minmax(145px,.9fr);gap:7px}.professional-pref-food-row select{font-size:11px;padding:7px 5px}.professional-pref-food-list{max-height:260px}}
@media(max-width:700px){.brief-counters{gap:8px}.brief-counter{display:block;padding:12px 8px;text-align:center}.brief-counter strong{display:block;font-size:24px;margin-bottom:6px}.brief-counter span{font-size:12px}.brief-patient-row{grid-template-columns:minmax(0,1fr) auto;padding:16px;gap:14px}.brief-weight{grid-column:1/-1}.brief-weight>span{display:inline-block;margin-right:10px}.brief-person .patient-avatar{display:none}.brief-person strong{font-size:17px}.brief-metrics{grid-template-columns:minmax(0,1fr)}.brief-metric{padding:13px}.brief-overview{padding:18px}.brief-overview h2{font-size:19px}.brief-verdict{font-size:15px}.brief-overview-links>button{flex:1}}

/* Dashboard responsive pass: one full-width workspace and touch-sized navigation. */
.layout,.side,.main{min-width:0}
.patient-create-card,.patient-list-card{min-width:0}
.patient-create-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(170px,.8fr) auto;gap:12px;align-items:end}
.patient-create-grid>label{min-width:0;margin:0}
.patient-create-grid input,.patient-create-grid select{width:100%;min-width:0;margin-top:5px}
.patient-create-actions{display:flex;align-items:end}
.patient-create-actions button{white-space:nowrap;min-height:42px}
.patient-list-table{table-layout:fixed}
.patient-list-table th:nth-child(1){width:22%}.patient-list-table th:nth-child(2){width:22%}.patient-list-table th:nth-child(3){width:23%}.patient-list-table th:nth-child(4){width:18%}.patient-list-table th:nth-child(5){width:15%}
.patient-list-table td{overflow-wrap:anywhere}
.patient-list-name{font-weight:600}
.patient-list-open{display:none}
@media(max-width:860px){
  .layout{grid-template-columns:minmax(0,1fr);width:100%}
  .side{position:relative;top:auto;width:100%;height:auto;overflow:visible;display:grid;grid-template-columns:minmax(0,1fr);gap:7px;padding:12px 16px}
  .side .brand{margin:0 4px 4px;gap:10px;min-width:0}
  .side .brand-name{font-size:17px;max-width:none}
  .side .brand-sub{display:block;max-width:none;font-size:10px}
  .side>.side-caption,.side-patient-nav>.side-caption,.side-bottom .side-profile{display:none}
  .side>.side-link{width:100%;min-height:44px;margin:0;padding:10px 12px}
  .side-bottom{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;min-width:0;width:100%;margin:0;padding:3px 1px 5px}
  .side-bottom .side-request-link{position:relative;min-width:0}
  .side-bottom .side-request-link>.side-link,.side-bottom>.side-link{width:100%;min-width:0;min-height:44px;margin:0;padding:9px 10px;white-space:normal}
  .side-bottom .side-request-link>.badge{position:absolute;top:5px;right:5px;margin:0;pointer-events:none}
  .side-patient-nav{display:flex;gap:6px;min-width:0;width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;padding:2px 1px 5px;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
  .side-patient-nav .side-link{width:auto;min-height:44px;flex:0 0 auto;white-space:nowrap;padding:10px 12px}
  .main{width:100%;max-width:none;padding:18px clamp(14px,3vw,24px)}
  .patient-create-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .patient-create-actions{grid-column:1/-1}
  .patient-create-actions button{width:100%}
  .grid3,.grid4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  html{scroll-padding-block:16px 34vh}
  body,#app,.layout,.main{width:100%;max-width:100%;min-width:0}
  .side{padding:10px 12px;gap:5px}
  .side .brand{margin:0 2px 3px}
  .side .brand-logo{width:34px;height:36px}
  .side .brand-name{font-size:16px}
  .side .brand-sub{font-size:9px;line-height:1.35}
  .side>.side-link{min-height:42px;padding:8px 10px}
  .side-patient-nav,.side-bottom{gap:5px}
  .side-patient-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;padding:2px 1px 5px}
  .side-patient-nav .side-link{width:100%;min-width:0;min-height:44px;flex:none;white-space:normal;padding:9px 10px;font-size:11px}
  .side-patient-nav .side-link,.side-bottom .side-link{min-height:44px;padding:9px 10px;font-size:11px;gap:7px}
  .side-bottom .side-request-link>.badge{top:4px;right:4px}
  .side-patient-nav .side-link .ct-icon,.side-bottom .side-link .ct-icon{width:17px;height:17px;flex:none}
  .main{padding:16px 12px calc(24px + env(safe-area-inset-bottom))}
  .main>h1{font-size:21px;overflow-wrap:anywhere}
  .main .card,.main .stat,.main .day,.main .layout>*{min-width:0;max-width:100%}
  .main .card{padding:14px}
  .main .row{min-width:0;max-width:100%;gap:8px}
  .main .row>*{min-width:0;max-width:100%}
  .main .grid2,.main .grid3,.main .grid4,.main .choices{grid-template-columns:minmax(0,1fr)}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .stat{padding:11px;overflow-wrap:anywhere}
  .stat b{font-size:20px}
  .patient-create-card h3{margin-bottom:10px}
  .patient-create-grid{grid-template-columns:minmax(0,1fr);gap:10px}
  .patient-create-grid>label{display:block;width:100%;font-size:12px}
  .patient-create-grid input,.patient-create-grid select{min-height:46px;margin-top:5px;font-size:16px}
  .patient-create-actions{grid-column:auto}
  .patient-create-actions button{width:100%;min-height:48px;font-size:15px}
  .patient-list-table{display:block;width:100%;max-width:100%;table-layout:auto;border-collapse:separate;border-spacing:0}
  .patient-list-table thead{display:none}
  .patient-list-table tbody{display:grid;gap:9px;width:100%}
  .patient-list-table .patient-list-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;width:100%;margin:0;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:#fff}
  .patient-list-table .patient-list-row:hover{background:#fbfdfb}
  .patient-list-table td{display:flex;align-items:flex-start;justify-content:flex-start;min-width:0;width:100%;padding:3px 0;border:0;line-height:1.4}
  .patient-list-table td::before{content:attr(data-label);display:block;color:var(--muted);font-size:10px;font-weight:500;line-height:1.25}
  .patient-list-table .patient-list-name{grid-column:1;grid-row:1;align-self:center;font-size:15px;font-weight:650}
  .patient-list-table .patient-list-name::before{display:none}
  .patient-list-table .patient-list-phone{grid-column:1/-1;grid-row:2;font-size:12px;color:var(--muted);overflow-wrap:anywhere}
  .patient-list-table .patient-list-plan{grid-column:1;grid-row:3;flex-direction:column;align-items:flex-start;gap:3px}
  .patient-list-table .patient-list-status{grid-column:2;grid-row:3;flex-direction:column;align-items:flex-end;gap:3px;text-align:right}
  .patient-list-table .patient-list-requests{grid-column:2;grid-row:1;align-items:flex-end;min-height:24px}
  .patient-list-table .patient-list-requests:empty{display:none}
  .patient-list-table .patient-list-open{display:flex;grid-column:1/-1;grid-row:4;align-items:center;padding-top:8px;border-top:1px solid var(--line);color:var(--brand);font-size:12px;font-weight:600}
  .main table:not(.patient-list-table){display:block;width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .main pre,.main code{max-width:100%;overflow-wrap:anywhere;white-space:pre-wrap}
  .main img,.main svg,.main canvas{max-width:100%}
  .main input,.main select,.main textarea,.main button{max-width:100%;scroll-margin-block:16px 34vh}
  .main input,.main select{min-height:44px}
  .main textarea{min-height:92px}
  .main button{min-height:44px;white-space:normal;overflow-wrap:anywhere}
  .tabs{max-width:100%;gap:12px;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
  .tabs button{flex:none;min-height:44px;padding:10px 8px;font-size:12px;white-space:nowrap}
  .patient-head{min-width:0;gap:9px;flex-wrap:wrap}
  .patient-head>.grow{min-width:0;flex:1 1 150px}
  .patient-head h1{font-size:19px;overflow-wrap:anywhere}
  .patient-head .patient-switcher{flex:1 1 100%;min-width:0}
  .patient-head .patient-switcher select{width:100%;max-width:100%;min-height:44px;font-size:16px}
  .wm-table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
  .sticky-actions{position:static;max-width:100%}
}

/* Palette finale ChefTeam Pro V2: contrasto AA per tutte le superfici piene con testo. */
:root {
  --bg: #F7F6F3;
  --panel: #FFFFFF;
  --ink: #242C3C;
  --muted: #667084;
  --line: #E3E6EB;
  --brand: #1746A2;
  --brand-ink: #FFFFFF;
  --brand-soft: #EEF1F5;
  --navy: #17233B;
  --navy2: #26334D;
  --electric: #1746A2;
  --orange: #E68442;
  --accent: #B65A25;
  --accent-dark: #A94F1F;
  --warn: #713D1D;
  --warn-soft: #FFFFFF;
  --danger: #9B302A;
  --bubble-in: #FFFFFF;
  --bubble-out: #EEF1F5;
  --radius: 18px;
}
body { background: var(--bg); color: var(--ink); }
h1,h2,h3 { color: var(--navy); }
.main { background: var(--bg); }
.card,.stat,.day,.patient-create-card,.patient-list-card { background: var(--panel); border-color: var(--line); }
button { color: var(--navy); border-color: var(--line); transition: background .15s,border-color .15s,box-shadow .15s; }
button:hover:not(:disabled) { background: var(--brand-soft); }
button.primary { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
button.primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color: #FFFFFF; }
button.primary:disabled { background: #667084; border-color: #667084; color: #FFFFFF; opacity: .72; }
button.danger { color: var(--danger); }
button.link { color: var(--electric); }
button:focus-visible,a:focus-visible,summary:focus-visible { outline: 3px solid var(--electric); outline-offset: 3px; }
input:focus-visible,select:focus-visible,textarea:focus-visible { outline: 2px solid var(--electric); outline-offset: 2px; }
input,select,textarea { background: #FFFFFF; border-color: var(--line); color: var(--ink); }
.layout,.main,.side { min-width: 0; }
.side { background: var(--navy); color: #FFFFFF; }
.side .brand-name,.side .brand-sub,.side .side-caption,.side .side-profile,.side .side-profile small,.side .side-link,.side .side-link .ct-icon { color: #FFFFFF; }
.side .brand-sub,.side .side-caption,.side .side-profile small { opacity: .9; }
.side .brand-sub span,.side .logo span { color: #FFFFFF; }
.side .brand-logo.initials { background: var(--navy2); color: #FFFFFF; }
.side .side-link { background: transparent; }
.side .side-link:hover:not(.active) { background: var(--navy2); color: #FFFFFF; }
.side .side-link.active { background: var(--navy2); border: 1px solid var(--line); color: #FFFFFF; box-shadow: inset 3px 0 #E68442; }
.side .side-link.active .ct-icon { color: #FFFFFF; opacity: 1; }
.side .side-avatar { background: var(--navy2); color: #FFFFFF; }
.side .badge,.side-request-link .badge { background: var(--accent); color: #FFFFFF; }
.patient-head button.primary,.patient-create-actions button.primary,.plan-area button.primary,button.primary.options-menu-generate { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.patient-head button.primary:hover:not(:disabled),.patient-create-actions button.primary:hover:not(:disabled),.plan-area button.primary:hover:not(:disabled),button.primary.options-menu-generate:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color: #FFFFFF; }
.tabs button { color: var(--muted); }
.tabs button.active { background: var(--electric); border-color: var(--electric); color: #FFFFFF; border-radius: 8px; }
.stepper li.current { background: var(--navy); color: #FFFFFF; }
.stepper li.current .num { background: var(--navy2); color: #FFFFFF; }
.demo-banner,.demo-banner.live,.demo-banner.off { background: var(--brand-soft); color: var(--navy2); border-color: var(--line); }
.demo-banner.off { background: #FFFFFF; color: var(--muted); }
.chip { background: var(--brand-soft); border-color: var(--line); color: var(--navy2); }
.pill { background: var(--brand-soft); color: var(--navy2); }
.pill.ok,.brief-aligned,.final-status-aligned { background: #E6F1E9; border-color: var(--line); color: #24583B; }
.pill.warn,.brief-review,.final-status-different,.final-status-observe { background: var(--warn-soft); border-color: var(--line); color: #713D1D; }
.pill.error,.final-status-insufficient { background: #FFF0EF; border-color: var(--line); color: var(--danger); }
.issues li.info { color: var(--warn); }
.error,[role=alert] { color: var(--danger); }
.wm-stat,.final-fact,.brief-metric { background: #FFFFFF; border-color: var(--line); }
.wm-kpi strong,.wm-weight-heading strong,.wm-circumferences strong { color: var(--navy); }
.wm-kpi-icon,.wm-report-icon,.chefteam-avatar { background: var(--brand-soft); color: var(--electric); }
.wm-bar-plan { background: var(--electric); }
.wm-bar-intake { background: var(--accent-dark); }
.wm-range-cap { background: repeating-linear-gradient(135deg,#1746A2 0,#1746A2 3px,#577ECB 3px,#577ECB 6px); border-color: var(--electric); }
.wm-bar-partial { background: repeating-linear-gradient(135deg,#1746A2 0,#1746A2 4px,#577ECB 4px,#577ECB 7px); }
.wm-bar-missing { border-color: var(--electric); }
.wm-chart-bars { border-color: var(--line); background: repeating-linear-gradient(to top,transparent 0,transparent 41px,#EEF1F5 42px); }
.wm-donut { --ring: #1746A2; }
.wm-donut-1 { --ring: #C96A2E; }
.wm-donut-2 { --ring: #26334D; }
.wm-donut>div { background: #FFFFFF; }
.wm-donut strong { color: var(--navy); }
.wm-weight-kpi { border-color: var(--line); background: #FFFFFF; }
.wm-measurements .chart .line,.wm-mini-chart .line { stroke: var(--electric); }
.wm-circumferences .ct-icon { color: var(--electric); }
.wm-legend { color: var(--muted); }
.wm-legend-plan { color: var(--electric); }
.wm-legend-intake { color: var(--accent-dark); }
.wm-chart-day b { color: var(--navy); }
.wm-weight-change,.wm-kpi-weight-change,.wm-daily-values,.wm-reading-note,.wm-kpi-reading-label { color: var(--muted); }
.wm-kpi-target b { color: var(--navy); }
.wm-kpi-icon,.wm-coral .wm-kpi-icon,.wm-orange .wm-kpi-icon { background: var(--brand-soft); color: var(--electric); }
.wm-coral strong,.wm-orange strong { color: var(--navy); }
.wm-observations>.row .ct-icon,.wm-diary-entry .wm-meal-icon,.wm-entry-details summary { color: var(--navy); }
.wm-feedback blockquote { border-left-color: var(--electric); color: var(--navy2); }
.wm-synthetic-note,.wm-demo-measurements { background: #EEF1F5; color: var(--navy2); }
.wm-empty { color: var(--muted); }
.wm-empty>.ct-icon { color: var(--electric); }
.wm-overview .wm-eyebrow,.wm-week-heading p,.patient-head p { color: var(--muted); }
.wm-incomplete { color: var(--warn); }
.wm-weight-alert { border-left-color: var(--accent); }
.wm-report-teaser { background: var(--brand-soft); border-color: var(--line); }
.wm-report-icon { color: var(--electric); }
.wm-phone-head { background: var(--navy); color: #FFFFFF; border-bottom: 2px solid #E68442; }
.wm-whatsapp-message { color: var(--ink); }
.chefteam-identity { background: linear-gradient(120deg,#EEF1F5,#FFFFFF); border-color: var(--line); }
.patient-avatar { background: var(--brand-soft); color: var(--navy); }
.final-patient-row:hover { background: #F7F6F3; }
.options-generation-preferences { background: #FFFFFF; border-left-color: var(--electric); }
.options-prescribed-style { background: var(--brand-soft); color: var(--navy); }
.options-pref-check input { accent-color: var(--electric); }
.wm-phone { background: var(--brand-soft); border-color: var(--line); }
.wm-footnote,.wm-side-column .wm-footnote,.settings-consent { background: #FFF7F0; color: #713D1D; }
@media(max-width:700px) { .side { background: var(--navy); } }

/* Shared, neutral light outlines for cards, panels, fields and secondary controls. */
.card,.stat,.day,.patient-create-card,.patient-list-card,[class*="card"],[class*="panel"],[class*="box"],[class*="section"],input,select,textarea,button:not(.link),.tabs,.stepper,.pill,.chip,.demo-banner,.side .badge{border-color:var(--line)}
button.primary,.tabs button.active,.side .side-link.active,.patient-head button.primary,.patient-create-actions button.primary,.plan-area button.primary,button.primary.options-menu-generate{border-color:var(--electric)}

/* V2 dashboard: navy/orange brand finish, on top of 879d692 */
:root { --orange: #E68442; --accent: #E68442; --accent-dark: #C96A2E; }
body { background: #F7F6F3; }
.side { background: #17233B; color: #FFFFFF; }
.side .side-link.active { background: #26334D; color: #FFFFFF; border-color: rgba(230,132,66,.36); box-shadow: inset 3px 0 #E68442; }
.side .side-link.active .ct-icon { color: #E68442; }
.side .brand-logo.initials { background: #26334D url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13.4c-2.1-1.1-2.2-5.4.8-6.3C6.7 4.7 8.8 4.2 11 5c2.3-2.5 6.1-1.5 6.8 1.8 3.6 0 4.8 5.1 1.2 6.8V21H5Z'/%3E%3Cpath d='M5 17h14'/%3E%3C/svg%3E") center/25px 25px no-repeat; color: transparent; }
.side .brand-logo.initials .ct-icon { opacity: 0; }
button.primary:not(:disabled), .patient-head button.primary:not(:disabled), .patient-create-actions button.primary:not(:disabled), .plan-area button.primary:not(:disabled), button.primary.options-menu-generate:not(:disabled) {
  background: #E68442;
  border-color: #E68442;
  color: #17233B;
  font-weight: 650;
}
button.primary:hover:not(:disabled), .patient-head button.primary:hover:not(:disabled), .patient-create-actions button.primary:hover:not(:disabled), .plan-area button.primary:hover:not(:disabled), button.primary.options-menu-generate:hover:not(:disabled) {
  background: #F09A5D;
  border-color: #F09A5D;
  color: #17233B;
}
button.primary:disabled { background: #667084; border-color: #667084; color: #FFFFFF; }
.side .side-link:focus-visible, button.primary:focus-visible { outline: 3px solid #E68442; outline-offset: 2px; }
