:root {
  color-scheme: light;
  --page: #f6f7f2;
  --card: #fff;
  --ink: #27332d;
  --muted: #89918b;
  --line: #e9ece6;
  --green: #527d5d;
  --green-dark: #3d6749;
  --green-soft: #eef4ee;
  --orange: #e89a67;
  --orange-soft: #fbf1e9;
  --blue: #7194ab;
  --shadow: 0 2px 10px rgb(41 57 46 / 3%);
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: var(--page); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgb(82 125 93 / 32%); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; width: 242px; flex-direction: column; padding: 29px 19px 18px; border-right: 1px solid var(--line); background: var(--card); }
.brand { display: flex; align-items: center; gap: 9px; padding: 0 9px; font: 800 24px/1 "Manrope", sans-serif; letter-spacing: -1.5px; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 12px 12px 12px 4px; background: var(--green); color: white; font: 800 20px/1 "Manrope", sans-serif; letter-spacing: -1.5px; }
.brand-period { color: var(--green); }
.nav-caption { margin: 48px 0 13px 11px; color: #a1a9a2; font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.main-nav { display: grid; gap: 5px; }
.nav-link { display: flex; min-height: 43px; align-items: center; gap: 12px; padding: 0 11px; border-radius: 8px; color: #818a83; font-size: 12px; font-weight: 600; transition: background .18s, color .18s; }
.nav-link:hover { background: #f8faf7; color: var(--ink); }
.nav-link.active { background: var(--green-soft); color: var(--green-dark); }
.nav-icon { width: 19px; font-size: 18px; line-height: 1; text-align: center; }
.sidebar-note { margin-top: auto; padding: 16px 14px 17px; border: 1px solid #e8eee7; border-radius: 10px; background: #f8faf7; }
.note-spark { color: var(--green); font-size: 17px; }
.sidebar-note p { margin: 9px 0 4px; font: 700 12px "Manrope", sans-serif; }
.sidebar-note > span:last-child { color: var(--muted); font-size: 10px; line-height: 1.6; }
.profile { display: flex; align-items: center; gap: 10px; margin-top: 19px; padding: 13px 5px 0; border-top: 1px solid var(--line); }
.avatar { display: grid; width: 33px; height: 33px; place-items: center; border-radius: 50%; background: #f5e9dc; color: #9a7251; font: 700 13px "Manrope", sans-serif; }
.profile-copy { display: grid; flex: 1; gap: 2px; }
.profile-copy strong { font-size: 11px; }
.profile-copy span { color: var(--muted); font-size: 9px; }
.icon-button, .dialog-close { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #89918b; cursor: pointer; font-size: 17px; }
.icon-button:hover, .dialog-close:hover { background: var(--page); }
.main-content { min-height: 100vh; margin-left: 242px; }
.topbar { display: flex; height: 68px; align-items: center; justify-content: flex-end; gap: 14px; padding: 0 46px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 76%); }
.today-label { margin: 0; color: #89918b; font-size: 11px; }
.today-button { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; background: white; cursor: pointer; font-size: 10px; font-weight: 600; }
.today-button span { color: var(--green); font-size: 14px; }
.mobile-brand { display: none; align-items: center; gap: 8px; margin-right: auto; font: 800 19px "Manrope", sans-serif; letter-spacing: -1px; }
.mobile-brand .brand-mark { width: 29px; height: 29px; font-size: 17px; }
.page-content { width: min(1170px, 100%); margin: 0 auto; padding: 32px 46px 33px; }
.welcome-row { display: flex; min-height: 91px; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 25px; }
.eyebrow, .card-label { margin: 0; color: #99a29b; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
h1, h2, p { overflow-wrap: anywhere; }
.welcome-row h1 { margin: 6px 0 3px; font: 800 25px/1.25 "Manrope", sans-serif; letter-spacing: -.8px; }
.welcome-row h1 > span:last-child { color: var(--orange); font-size: 19px; }
.welcome-copy { margin: 0; color: #879089; font-size: 11px; }
.week-pill { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid #e6ebe5; border-radius: 99px; background: white; color: #67736a; font-size: 10px; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #83aa79; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr .86fr; gap: 14px; }
.card { border: 1px solid var(--line); border-radius: 11px; background: var(--card); box-shadow: var(--shadow); }
.summary-grid > .card { min-height: 145px; padding: 17px 18px 15px; }
.card-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-heading h2 { margin: 8px 0 12px; font: 800 25px/1 "Manrope", sans-serif; letter-spacing: -.8px; }
.number-unit { color: #818b84; font: 500 11px "DM Sans", sans-serif; letter-spacing: 0; }
.metric-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; font-size: 17px; }
.calorie-icon { background: var(--orange-soft); color: #d78b5d; }
.protein-icon { background: var(--green-soft); color: var(--green); }
.weight-icon { background: #edf3f7; color: #65899e; }
.progress-track { height: 6px; overflow: hidden; border-radius: 99px; background: #f0f1ed; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; transition: width .3s; }
.calorie-track span { background: var(--orange); }
.protein-track span { background: #7ba47a; }
.progress-labels { display: flex; justify-content: space-between; gap: 6px; margin-top: 9px; color: #939a94; font-size: 9px; }
.progress-labels strong { color: #5e6961; font-weight: 700; }
.weight-card .card-heading h2 { margin-bottom: 7px; }
.weight-trend { display: flex; min-height: 17px; align-items: center; gap: 5px; color: #89918b; font-size: 9px; }
.trend-arrow { color: var(--green); font-size: 14px; }
.text-button { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--green-dark); cursor: pointer; font-size: 10px; font-weight: 700; }
.text-button:hover { color: #2a5736; }
.content-grid { display: grid; grid-template-columns: 1.16fr .84fr; gap: 14px; margin-top: 15px; }
.meals-card, .trend-card { min-height: 297px; padding: 19px; }
.section-heading { align-items: center; margin-bottom: 16px; }
.section-heading h2, .checkin-copy h2 { margin: 5px 0 0; font: 700 16px/1.3 "Manrope", sans-serif; letter-spacing: -.35px; }
.outline-button, .primary-button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 6px; padding: 0 11px; border: 1px solid #dfe8de; border-radius: 7px; background: white; color: var(--green-dark); cursor: pointer; font-size: 10px; font-weight: 700; transition: background .16s, border .16s; white-space: nowrap; }
.outline-button:hover { border-color: #bfd1be; background: #f7faf6; }
.outline-button > span { font-size: 15px; font-weight: 400; }
.meal-list { display: grid; min-height: 143px; align-content: start; }
.meal-row { display: grid; grid-template-columns: 37px 1fr auto 25px; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f1ee; }
.meal-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: #f8f1e8; font-size: 16px; }
.meal-avatar.lunch { background: #f1f5eb; }
.meal-avatar.dinner { background: #f0eff8; }
.meal-avatar.snack { background: #f9f0e8; }
.meal-main { min-width: 0; }
.meal-main strong { display: block; overflow: hidden; color: #515e55; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.meal-main span { display: block; margin-top: 3px; color: #a0a7a1; font-size: 9px; }
.meal-macros { color: #8c958e; font-size: 9px; white-space: nowrap; }
.meal-macros strong { color: #657168; }
.remove-meal { width: 24px; height: 24px; border: 0; border-radius: 5px; background: transparent; color: #a9b0aa; cursor: pointer; font-size: 16px; }
.remove-meal:hover { background: #f8eeee; color: #b95a50; }
.empty-meals { display: grid; min-height: 134px; place-content: center; gap: 5px; color: #89918b; text-align: center; }
.empty-meals strong { color: #5a675e; font: 700 11px "Manrope", sans-serif; }
.empty-meals span { font-size: 10px; }
.meal-tip { display: flex; align-items: center; gap: 9px; margin-top: 7px; padding: 9px 11px; border-radius: 7px; background: #faf7f0; color: #b48962; }
.meal-tip > span { font-size: 14px; }
.meal-tip p { margin: 0; color: #8b8579; font-size: 9px; line-height: 1.5; }
.meal-tip strong { margin-right: 4px; color: #a27a55; }
.trend-range { padding: 5px 8px; border-radius: 5px; background: #f5f7f3; color: #838e85; font-size: 9px; }
.chart-summary { margin: -1px 0 6px 36px; color: #929a93; font-size: 9px; }
.chart-summary strong { margin-right: 4px; color: #526b58; font: 800 20px "Manrope", sans-serif; letter-spacing: -.5px; }
.chart-wrap { position: relative; display: flex; height: 136px; }
.chart-y-labels { display: flex; width: 29px; flex-direction: column; justify-content: space-between; padding: 6px 0 14px; color: #a0a8a1; font-size: 8px; }
.weight-chart { width: 100%; height: 136px; overflow: visible; }
.chart-grid-line { stroke: #eef0eb; stroke-width: 1; stroke-dasharray: 3 5; }
.chart-area { fill: url(#areaGradient); }
.chart-line { fill: none; stroke: #749c78; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.chart-point { fill: white; stroke: #749c78; stroke-width: 2; }
.chart-empty-label { fill: #9ba49d; font-family: "DM Sans", sans-serif; font-size: 11px; text-anchor: middle; }
.chart-x-labels { display: flex; justify-content: space-between; padding-left: 31px; color: #a0a8a1; font-size: 8px; }
.chart-footnote { display: flex; align-items: flex-start; gap: 5px; margin: 13px 0 0; color: #9aa29b; font-size: 8px; line-height: 1.5; }
.chart-footnote span { color: #7c9d7d; font-size: 10px; }
.checkin-card { display: flex; min-height: 100px; align-items: center; justify-content: space-between; gap: 20px; margin-top: 15px; padding: 19px 21px; }
.checkin-copy { display: flex; align-items: center; gap: 13px; }
.checkin-icon { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: #f9eeeb; color: #ca8779; font-size: 19px; }
.checkin-copy p:last-child { margin: 4px 0 0; color: #919a92; font-size: 10px; }
.checkin-card > .outline-button { min-width: 126px; }
.safety-note { margin: 14px 2px 0; color: #9aa19b; font-size: 9px; line-height: 1.6; }
.app-dialog { width: min(440px, calc(100% - 30px)); max-height: min(90vh, 780px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--card); color: var(--ink); box-shadow: 0 18px 60px rgb(29 45 32 / 20%); }
.app-dialog::backdrop { background: rgb(32 43 35 / 38%); backdrop-filter: blur(2px); }
.app-dialog form { padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.dialog-heading h2 { margin: 5px 0 0; font: 800 19px "Manrope", sans-serif; letter-spacing: -.5px; }
.dialog-close { margin-top: -3px; font-size: 22px; }
.form-field { display: grid; gap: 7px; margin: 13px 0; color: #606c63; font-size: 10px; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #e2e7e1; border-radius: 7px; background: white; color: var(--ink); font-size: 11px; font-weight: 400; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #adb5ae; }
.form-field textarea { min-height: 73px; resize: vertical; }
.catalog-hint { margin: -9px 0 12px; }
.meal-type-field { margin-top: 0; }
.quick-food-list { display: grid; max-height: 277px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; overflow-y: auto; padding: 2px; }
.quick-food-option { position: relative; display: flex; min-width: 0; min-height: 54px; align-items: center; gap: 6px; padding: 6px 7px; border: 1px solid #e9eee8; border-radius: 8px; background: #fff; transition: border .15s, background .15s; }
.quick-food-option:hover { border-color: #ccddca; background: #fbfdfb; }
.quick-food-option:has(input:checked) { border-color: #9bb69a; background: #f2f7f1; }
.quick-food-option > input { width: 17px; height: 17px; flex: 0 0 auto; margin: 0; accent-color: var(--green); cursor: pointer; }
.quick-food-option:focus-within { outline: 3px solid rgb(82 125 93 / 18%); outline-offset: 2px; }
.quick-food-copy { display: grid; min-width: 0; flex: 1; gap: 3px; }
.quick-food-copy strong { overflow: hidden; color: #526056; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.quick-food-copy small { overflow: hidden; color: #9ba39c; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.quick-food-macros { display: none; }
.food-quantity-control { display: flex; height: 27px; flex: 0 0 auto; align-items: center; gap: 2px; padding: 2px; border: 1px solid #e8ece6; border-radius: 7px; background: white; }
.food-quantity-control button { display: grid; width: 23px; height: 21px; place-items: center; padding: 0; border: 0; border-radius: 5px; background: #f5f7f3; color: #526b56; cursor: pointer; font-size: 15px; line-height: 1; }
.food-quantity-control button:hover:not(:disabled) { background: #e7f0e5; }
.food-quantity-control button:disabled { color: #c5ccc5; cursor: default; }
.food-quantity-control [data-food-quantity] { min-width: 15px; color: #536157; font-size: 9px; font-weight: 700; text-align: center; }
.quick-food-summary { display: flex; min-height: 35px; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 7px 10px; border-radius: 7px; background: #f5f8f3; color: #89948a; font-size: 9px; }
.quick-food-summary strong { color: #536e56; }
.quick-food-summary span { text-align: right; }
.food-data-note { margin: -3px 0 0; font-size: 9px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.meal-dialog-actions .manual-toggle { margin-right: auto; }
.primary-button { min-height: 38px; padding-inline: 15px; border-color: var(--green); background: var(--green); color: white; }
.primary-button:hover { border-color: var(--green-dark); background: var(--green-dark); }
.primary-button:disabled { border-color: #dce4dc; background: #dce4dc; color: #879188; cursor: not-allowed; }
.compact-dialog { width: min(380px, calc(100% - 30px)); }
.field-hint { margin: -8px 0 15px; color: #879189; font-size: 10px; line-height: 1.6; }
.settings-hint { margin-top: -8px; }
.checkin-dialog { width: min(480px, calc(100% - 30px)); }
.rating-field { margin: 18px 0; padding: 0; border: 0; }
.rating-field legend { margin-bottom: 10px; color: #606c63; font-size: 10px; font-weight: 700; }
.rating-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.rating-options label { position: relative; }
.rating-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rating-options label > span { display: grid; min-height: 44px; align-content: center; justify-items: center; border: 1px solid #e5eae4; border-radius: 7px; color: #536157; cursor: pointer; font-size: 12px; font-weight: 700; }
.rating-options input:checked + span { border-color: #88a88a; background: #f0f6ef; color: var(--green-dark); }
.rating-options input:focus-visible + span { outline: 3px solid rgb(82 125 93 / 32%); outline-offset: 2px; }
.rating-options small { margin-top: 2px; color: #98a198; font-size: 7px; font-weight: 500; }
.toast { position: fixed; z-index: 10; right: 22px; bottom: 22px; max-width: min(360px, calc(100vw - 44px)); padding: 11px 15px; transform: translateY(12px); border-radius: 8px; background: #314a37; color: white; font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.visible { transform: translateY(0); opacity: 1; }

@media (min-width: 1500px) {
  .page-content { padding-top: 42px; }
  .summary-grid > .card { min-height: 158px; padding: 20px; }
  .meals-card, .trend-card { min-height: 315px; }
  .chart-wrap, .weight-chart { height: 150px; }
}

@media (max-width: 1150px) {
  .sidebar { width: 215px; }
  .main-content { margin-left: 215px; }
  .topbar { padding-inline: 29px; }
  .page-content { padding-inline: 29px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .weight-card { grid-column: 1 / -1; min-height: 118px !important; }
  .weight-card .card-heading { align-items: center; }
  .weight-card .card-heading > div { display: flex; align-items: baseline; gap: 10px; }
  .weight-card .card-heading h2 { margin: 5px 0; }
  .weight-card .card-heading .card-label { order: -1; }
  .weight-trend { display: inline-flex; }
  .weight-card .text-button { margin-left: 13px; }
}

@media (max-width: 850px) {
  .sidebar { width: 69px; align-items: center; padding-inline: 9px; }
  .brand { padding: 0; }
  .brand > span:last-child, .nav-caption, .nav-link > span:last-child, .sidebar-note, .profile-copy, .profile .icon-button { display: none; }
  .main-nav { width: 100%; margin-top: 47px; }
  .nav-link { justify-content: center; padding-inline: 0; }
  .nav-icon { font-size: 19px; }
  .profile { justify-content: center; padding: 13px 0 0; }
  .main-content { margin-left: 69px; }
  .content-grid { grid-template-columns: 1fr; }
  .meals-card, .trend-card { min-height: auto; }
  .chart-wrap, .weight-chart { height: 155px; }
  .chart-footnote { margin-top: 10px; }
}

@media (max-width: 560px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .topbar { height: 58px; justify-content: space-between; padding-inline: 17px; }
  .mobile-brand { display: flex; }
  .today-label { display: none; }
  .today-button { min-height: 32px; }
  .page-content { padding: 24px 16px 24px; }
  .welcome-row { align-items: flex-start; flex-direction: column; margin-bottom: 19px; }
  .welcome-row h1 { font-size: 23px; }
  .week-pill { padding: 7px 10px; }
  .summary-grid { gap: 9px; }
  .summary-grid > .card { min-height: 133px; padding: 14px 12px 12px; }
  .card-heading h2 { font-size: 21px; }
  .card-label { font-size: 8px; }
  .metric-icon { width: 27px; height: 27px; font-size: 15px; }
  .progress-labels { font-size: 8px; }
  .weight-card { min-height: 116px !important; }
  .content-grid { gap: 10px; margin-top: 10px; }
  .meals-card, .trend-card { padding: 15px 13px; }
  .section-heading h2, .checkin-copy h2 { font-size: 14px; }
  .outline-button { min-height: 32px; padding-inline: 9px; font-size: 9px; }
  .quick-food-list { max-height: 240px; gap: 5px; }
  .quick-food-option { min-height: 49px; gap: 5px; padding: 5px 6px; }
  .quick-food-copy strong { font-size: 8px; }
  .quick-food-copy small { font-size: 6px; }
  .food-quantity-control { height: 25px; gap: 1px; }
  .food-quantity-control button { width: 20px; height: 19px; }
  .meal-dialog-actions { flex-wrap: wrap; }
  .meal-row { grid-template-columns: 33px 1fr auto 22px; gap: 7px; }
  .meal-avatar { width: 31px; height: 31px; }
  .meal-macros { font-size: 8px; }
  .checkin-card { align-items: flex-start; flex-direction: column; gap: 13px; margin-top: 10px; padding: 15px; }
  .checkin-copy { align-items: flex-start; gap: 10px; }
  .checkin-icon { width: 34px; height: 34px; }
  .checkin-copy p:last-child { line-height: 1.5; }
  .safety-note { margin-inline: 1px; }
  .toast { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
