@font-face {
  font-family: Plex;
  src: url("/static/fonts/thai.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0E00-0E7F;
}
@font-face {
  font-family: Plex;
  src: url("/static/fonts/latin.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}
:root {
  --paper: #f6f6f0;
  --white: #fff;
  --ink: #20372b;
  --muted: #758078;
  --line: #e3e7df;
  --green: #206044;
  --green-deep: #154a33;
  --soft: #eaf0e4;
  --lime: #d3e2b7;
  --gold: #c19351;
  --blue: #88a6ae;
  --radius: 24px;
  --shadow: 0 12px 40px #24403008;
  font-family:
    Plex,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: weight;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #9aba75;
  outline-offset: 3px;
}
a {
  color: var(--green);
  text-decoration: none;
}
button {
  border: 0;
  background: none;
  color: inherit;
}
svg.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 34px;
  letter-spacing: -1.15px;
  font-weight: 600;
  line-height: 1.2;
}
h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
p {
  line-height: 1.65;
}
small,
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1.9px;
  font-weight: 700;
  color: var(--muted);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.gap8 {
  gap: 8px;
}
.text-link {
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 0;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 20px;
  background: var(--green);
  color: white;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  transition:
    background 0.2s,
    transform 0.2s;
}
.button:hover {
  background: var(--green-deep);
}
.button:active {
  transform: translateY(1px);
}
.button.secondary {
  background: var(--soft);
  color: var(--green);
}
.button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.button.wide {
  width: 100%;
}
.button.danger {
  background: #f4e9e0;
  color: #8b4b27;
}
.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-button:hover {
  background: var(--soft);
}
.icon-button.small {
  width: 34px;
  height: 34px;
}
.icon-button.small .icon {
  width: 18px;
  height: 18px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 20px;
  background: var(--soft);
  font-size: 10px;
  color: var(--green);
  white-space: nowrap;
}
.pill.estimate {
  background: #f5f0e5;
  color: #877243;
}
.pill.outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 228px;
  padding: 36px 26px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--green);
  color: #eff4e4;
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 3px;
}
.brand-name {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.8px;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
}
.side-nav {
  margin-top: 55px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  min-height: 48px;
}
.nav-item.active {
  background: var(--green);
  color: white;
}
.side-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.side-bottom p {
  font-size: 11px;
  margin-top: 10px;
  color: var(--muted);
}
.main {
  margin-left: 228px;
  padding: 32px 42px 55px;
  max-width: 1480px;
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 38px;
}
.masthead .brand {
  display: none;
}
.personal {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.personal .icon {
  width: 16px;
  height: 16px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e8eadd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-size: 12px;
}
.page-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}
.page-top p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 7px;
}
.page-top .eyebrow {
  margin-bottom: 8px;
}
.date-control {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: white;
  padding: 4px 6px;
  border-radius: 13px;
}
.date-control input {
  border: 0;
  background: transparent;
  font-size: 12px;
  color: var(--ink);
  width: 126px;
  padding: 6px;
  min-height: 36px;
}
.date-control .icon-button {
  width: 30px;
  height: 34px;
}
.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 22px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 25px;
  background: white;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.energy-card {
  background: var(--green);
  color: #fff;
  position: relative;
  overflow: hidden;
  border-color: var(--green);
  min-height: 348px;
  padding: 26px 28px;
}
.energy-card .eyebrow,
.energy-card .muted {
  color: #c1d4c6;
}
.energy-card h2 {
  font-size: 16px;
}
.energy-card .pill {
  background: #ffffff16;
  color: #dde8d6;
}
.ring-wrap {
  position: relative;
  width: 224px;
  height: 224px;
  margin: 6px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ring-wrap svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-track {
  fill: none;
  stroke: #ffffff18;
  stroke-width: 10;
}
.ring-fill {
  fill: none;
  stroke: var(--lime);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s;
}
.ring-copy {
  text-align: center;
  z-index: 1;
}
.ring-copy strong {
  display: block;
  font-size: 46px;
  font-weight: 500;
  letter-spacing: -2px;
  line-height: 1.25;
}
.ring-copy span {
  font-size: 12px;
  color: #c9d9cc;
}
.ring-copy .eyebrow {
  font-size: 9px;
  letter-spacing: 1.6px;
  margin-bottom: 4px;
}
.energy-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid #ffffff20;
  padding-top: 17px;
  margin-top: 10px;
  text-align: center;
}
.energy-footer > div + div {
  border-left: 1px solid #ffffff20;
}
.energy-footer strong {
  font-weight: 500;
  font-size: 19px;
  display: block;
}
.energy-footer span {
  font-size: 11px;
  color: #c9d9cc;
}
.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 26px;
}
.macro strong {
  display: block;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.8px;
  margin: 8px 0 3px;
}
.macro strong small {
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
}
.macro p {
  font-size: 11px;
  color: var(--muted);
}
.meter {
  height: 5px;
  border-radius: 4px;
  background: #f0f1eb;
  margin-top: 13px;
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--green);
}
.macro:nth-child(2) .meter > span {
  background: var(--gold);
}
.macro:nth-child(3) .meter > span {
  background: var(--blue);
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 5px;
  background: var(--green);
}
.macro:nth-child(2) .dot {
  background: var(--gold);
}
.macro:nth-child(3) .dot {
  background: var(--blue);
}
.scan-callout {
  background: #eaf0e3;
  border-radius: 20px;
  padding: 22px;
  display: flex;
  gap: 18px;
  align-items: center;
  position: relative;
}
.scan-callout h3 {
  font-size: 17px;
  margin-bottom: 5px;
}
.scan-callout p {
  font-size: 12px;
  color: #71816d;
}
.scan-callout .button {
  margin-top: 15px;
  min-height: 40px;
  padding: 9px 14px;
  font-size: 12px;
}
.scan-art {
  width: 72px;
  height: 82px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #477452;
}
.scan-art .icon {
  width: 50px;
  height: 50px;
  stroke-width: 1.2;
}
.scan-art:after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dashed #a7b99a;
  border-radius: 15px;
  transform: rotate(8deg);
}
.setup-card {
  padding: 18px 22px;
  border: 1px solid #cfdbc0;
  background: #f0f4e9;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.setup-card p {
  font-size: 12px;
  color: #687563;
}
.setup-card .button {
  flex-shrink: 0;
}
.meals-card {
  grid-column: 1/-1;
  padding: 24px 28px;
}
.meal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 30px;
}
.meal-block {
  border-top: 1px solid var(--line);
  padding: 17px 0 7px;
}
.meal-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.meal-label h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}
.meal-label .icon {
  width: 17px;
  height: 17px;
  color: #929c8c;
}
.meal-label span {
  font-size: 12px;
  color: var(--muted);
}
.meal-empty {
  font-size: 12px;
  color: #8b948b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}
.meal-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 61px;
}
.meal-entry .entry-name {
  flex: 1;
  min-width: 0;
}
.entry-name strong {
  font-size: 13px;
  font-weight: 500;
  display: block;
  overflow-wrap: anywhere;
}
.entry-name small {
  color: var(--muted);
  font-size: 11px;
}
.entry-kcal {
  font-size: 13px;
  white-space: nowrap;
}
.entry-kcal small {
  color: var(--muted);
}
.food-glyph {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: #f0f2e9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #78916a;
}
.food-glyph.noodles {
  background: #f5eee0;
  color: #b49459;
}
.food-glyph.drinks {
  background: #eaf0ef;
  color: #7b9894;
}
.food-glyph.fruit {
  background: #f4ece1;
  color: #bb9a6f;
}
.food-glyph.protein {
  background: #eeede4;
  color: #999064;
}
.food-glyph.snacks {
  background: #f2e9e2;
  color: #b79378;
}
.footer-note {
  margin-top: 24px;
  font-size: 11px;
  color: #899385;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.footer-note .icon {
  width: 14px;
  height: 14px;
}
.bottom-nav {
  display: none;
}
.status-banner {
  background: #f0ebdc;
  padding: 10px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 12px;
  color: #796940;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.status-banner button {
  color: inherit;
  text-decoration: underline;
  font-size: 12px;
  white-space: nowrap;
}
.search-layout {
  max-width: 880px;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 16px;
  padding: 8px 15px;
  margin: 20px 0 16px;
}
.search-bar > .icon {
  color: var(--muted);
}
.search-bar input {
  border: 0;
  background: none;
  flex: 1;
  min-width: 0;
  outline: none;
  padding: 10px 0;
  font-size: 15px;
}
.search-bar .icon-button {
  background: var(--green);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 11px;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 8px;
  margin-bottom: 18px;
}
.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 9px 16px;
  background: white;
  min-height: 40px;
  font-size: 12px;
}
.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.food-list {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: white;
}
.food-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 17px;
  min-height: 80px;
  border-bottom: 1px solid #edf0e8;
}
.food-row:last-child {
  border-bottom: 0;
}
.food-main {
  display: flex;
  align-items: center;
  gap: 13px;
  flex: 1;
  text-align: left;
  min-width: 0;
  padding: 0;
}
.food-text {
  flex: 1;
  min-width: 0;
}
.food-text strong {
  font-size: 15px;
  font-weight: 500;
  display: block;
  overflow-wrap: anywhere;
}
.food-text small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.food-num {
  font-size: 16px;
  white-space: nowrap;
}
.food-num small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}
.food-row .star {
  color: #a6af9d;
}
.food-row .star.active {
  color: #aa8750;
}
.food-row .star.active .icon {
  fill: #e7d8b0;
}
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
}
.section-label .eyebrow {
  letter-spacing: 1.4px;
}
.log-context {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}
.log-context select {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.empty {
  padding: 38px 22px;
  text-align: center;
  color: var(--muted);
}
.empty .icon {
  width: 35px;
  height: 35px;
  margin-bottom: 13px;
  color: #a0b18d;
}
.empty h3 {
  color: var(--ink);
  margin-bottom: 8px;
  font-size: 17px;
}
.empty p {
  font-size: 13px;
}
.empty .button {
  margin-top: 18px;
}
.info-note {
  padding: 13px 15px;
  background: #f2f4ed;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #78836f;
}
.error {
  background: #f7eae3;
  color: #8f4e32;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.error:empty {
  display: none;
}
.success {
  background: var(--soft);
  color: var(--green);
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 13px;
}
.progress-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 22px;
}
.chart-card {
  padding: 28px;
}
.weight-number {
  font-size: 40px;
  letter-spacing: -1.5px;
  font-weight: 500;
  line-height: 1.3;
}
.weight-number small {
  font-size: 18px;
  letter-spacing: 0;
  color: var(--muted);
}
.chart-label {
  font-size: 10px;
  fill: #889281;
  font-family: inherit;
}
.weight-chart {
  width: 100%;
  height: auto;
  min-height: 180px;
  margin: 24px 0 3px;
  display: block;
}
.chart-key {
  display: flex;
  gap: 19px;
  font-size: 11px;
  color: var(--muted);
}
.chart-key span:before {
  content: "";
  display: inline-block;
  background: #ccd4c4;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
}
.chart-key span:last-child:before {
  width: 15px;
  height: 3px;
  border-radius: 2px;
  background: var(--green);
  vertical-align: middle;
}
.stat-card {
  padding: 21px;
}
.stat-card strong {
  font-size: 28px;
  display: block;
  font-weight: 500;
  margin: 9px 0 4px;
  letter-spacing: -0.8px;
}
.stat-card strong small {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0;
}
.stat-card p {
  font-size: 12px;
  color: var(--muted);
}
.weight-history {
  margin-top: 22px;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.history-row > span {
  flex: 1;
  font-size: 13px;
}
.history-row strong {
  font-weight: 500;
  font-size: 14px;
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
  font-size: 14px;
}
.settings-row:last-child {
  border: 0;
}
.settings-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.settings-row .icon {
  color: var(--muted);
  width: 18px;
}
.target-banner {
  background: var(--green);
  color: white;
  padding: 22px;
  border-radius: 18px;
}
.target-banner strong {
  display: block;
  font-size: 30px;
  font-weight: 500;
  margin: 5px 0;
  letter-spacing: -1px;
}
.target-banner p {
  font-size: 12px;
  color: #c4d9c8;
}
.target-banner .eyebrow {
  color: #c4d9c8;
}
.setting-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.install-box {
  padding: 22px;
  background: #eaf0e3;
  border-radius: 20px;
}
.install-box p {
  color: #73816d;
  font-size: 12px;
  margin: 9px 0 15px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
}
.field.full {
  grid-column: 1/-1;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #dfe4d9;
  border-radius: 11px;
  min-height: 46px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
  font-size: 14px;
}
.field textarea {
  min-height: 95px;
  resize: vertical;
}
.field small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
}
.check-field {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
}
.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  margin-top: 2px;
}
.form-section {
  font-size: 11px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 8px 0 0;
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.form-actions > .button {
  flex: 1;
}
dialog {
  width: min(540px, calc(100% - 30px));
  max-height: 90dvh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 25px 100px #162e3133;
  overflow: auto;
}
dialog::backdrop {
  background: #12271c70;
  backdrop-filter: blur(4px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 21px 24px 10px;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 2;
}
.modal-head h2 {
  font-size: 20px;
}
.modal-body {
  padding: 10px 24px 25px;
}
.modal-body > p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}
.detail-hero {
  background: #e8eedd;
  padding: 24px;
  border-radius: 18px;
  text-align: center;
  margin-bottom: 20px;
}
.detail-hero .food-glyph {
  width: 66px;
  height: 66px;
  margin: 0 auto 14px;
  border-radius: 22px;
  background: #ffffff80;
}
.detail-hero .food-glyph .icon {
  width: 32px;
  height: 32px;
}
.detail-hero h3 {
  font-size: 22px;
}
.detail-hero p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.detail-calories {
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -1px;
  margin: 16px 0 6px;
}
.detail-calories small {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0;
}
.detail-macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  text-align: center;
}
.detail-macros strong {
  display: block;
  font-size: 18px;
  font-weight: 500;
}
.detail-macros small {
  font-size: 11px;
  color: var(--muted);
}
.portion-grid {
  display: flex;
  gap: 8px;
  margin-top: 9px;
  margin-bottom: 18px;
  overflow: auto;
}
.portion {
  flex: 1;
  min-width: 84px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 12px 9px;
  font-size: 12px;
  min-height: 65px;
}
.portion small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
.portion.active {
  border-color: var(--green);
  background: var(--soft);
  color: var(--green);
}
.detail-footer {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}
.detail-footer .button {
  flex: 1;
}
.upload-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border: 1.5px dashed #b6c5aa;
  border-radius: 18px;
  background: #edf2e7;
  cursor: pointer;
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.upload-area > .icon {
  width: 40px;
  height: 40px;
  color: #819a70;
}
.upload-area strong {
  font-size: 14px;
  font-weight: 500;
}
.upload-area small {
  font-size: 11px;
  color: var(--muted);
}
.upload-area input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  cursor: pointer;
}
.upload-area img {
  max-width: 100%;
  max-height: 230px;
  border-radius: 12px;
  object-fit: contain;
}
.scan-item {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 16px;
  background: white;
}
.scan-item h3 {
  margin-bottom: 3px;
}
.scan-item p {
  font-size: 11px;
  color: var(--muted);
}
.scan-item .field {
  margin-top: 12px;
}
.scan-item .info-note {
  margin-top: 10px;
}
.scan-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  padding: 5px 0;
}
.scan-total strong {
  font-weight: 500;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin: 2px 0;
}
.divider:before,
.divider:after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
#toast {
  position: fixed;
  bottom: 30px;
  left: calc(50% + 114px);
  transform: translateX(-50%) translateY(20px);
  padding: 13px 21px;
  background: #20372b;
  color: white;
  box-shadow: 0 5px 25px #0002;
  border-radius: 14px;
  font-size: 13px;
  z-index: 100;
  opacity: 0;
  transition: 0.2s;
  pointer-events: none;
  max-width: min(480px, 90vw);
  text-align: center;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.boot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 100dvh;
  color: var(--muted);
  font-size: 14px;
}
.login {
  max-width: 420px;
  margin: 10dvh auto;
  padding: 25px;
}
.login .brand {
  margin-bottom: 40px;
}
.login h1 {
  font-size: 34px;
  margin-bottom: 12px;
}
.login > p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
}
.login .card {
  padding: 24px;
}
.loading-note {
  font-size: 13px;
  color: var(--muted);
  padding: 30px;
  text-align: center;
}
.pending-label {
  font-size: 10px;
  color: #977d45;
}
.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;
}
@media (min-width: 1500px) {
  .main {
    margin-right: auto;
    margin-left: calc(228px + (100vw - 1500px) / 2);
    max-width: 1200px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 190px;
    padding: 30px 19px;
  }
  .main {
    margin-left: 190px;
    padding: 28px;
  }
  .dashboard {
    gap: 16px;
  }
  .card {
    padding: 21px;
  }
  .energy-card {
    padding: 23px;
  }
  .macro-grid {
    gap: 10px;
  }
  .scan-callout {
    padding: 20px;
  }
  .scan-art {
    width: 50px;
  }
  .progress-grid {
    grid-template-columns: 1fr;
  }
  .progress-grid > .stack {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  #toast {
    left: calc(50% + 95px);
  }
}
@media (max-width: 760px) {
  .sidebar {
    display: none;
  }
  .main {
    margin: 0;
    padding: 21px 20px 110px;
    max-width: 600px;
    margin-inline: auto;
  }
  .masthead {
    margin-bottom: 28px;
  }
  .masthead .brand {
    display: flex;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 24px;
    border-radius: 11px;
  }
  .brand-name {
    font-size: 21px;
  }
  .brand small {
    display: none;
  }
  .masthead > .eyebrow {
    display: none;
  }
  .personal > span {
    display: none;
  }
  .personal > .icon {
    display: none;
  }
  .page-top {
    margin-bottom: 21px;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .page-top h1 {
    font-size: 29px;
    letter-spacing: -0.9px;
  }
  .page-top p {
    font-size: 12px;
  }
  .page-top .eyebrow {
    font-size: 9px;
  }
  .page-top .date-control {
    margin-top: 4px;
  }
  .dashboard {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .energy-card {
    min-height: 320px;
    padding: 24px;
  }
  .ring-wrap {
    width: 211px;
    height: 211px;
    margin-top: 0;
  }
  .energy-footer {
    margin-top: 5px;
  }
  .dashboard > .stack {
    gap: 16px;
  }
  .macro-grid {
    margin-top: 20px;
    gap: 18px;
  }
  .scan-callout {
    padding: 20px;
  }
  .scan-art {
    width: 65px;
  }
  .meals-card {
    grid-column: auto;
    padding: 21px;
  }
  .meal-grid {
    grid-template-columns: 1fr;
  }
  .meal-block {
    padding: 14px 0 7px;
  }
  .meal-empty {
    min-height: 43px;
  }
  .meal-entry {
    min-height: 62px;
  }
  .footer-note {
    font-size: 10px;
  }
  .setup-card {
    padding: 15px;
    align-items: flex-start;
  }
  .setup-card .button {
    font-size: 11px;
    min-height: 40px;
    padding: 10px 12px;
  }
  .setup-card h3 {
    font-size: 13px;
  }
  .setup-card p {
    font-size: 11px;
  }
  .bottom-nav {
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    background: #fffffff5;
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding: 9px 12px max(10px, env(safe-area-inset-bottom));
    z-index: 20;
    min-height: 77px;
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #8b9386;
    min-height: 45px;
    justify-content: center;
  }
  .bottom-nav a.active {
    color: var(--green);
    font-weight: 700;
  }
  .bottom-nav a .icon {
    width: 22px;
    height: 22px;
  }
  .bottom-nav .nav-add {
    width: 52px;
    height: 52px;
    background: var(--green);
    color: white;
    border: 5px solid var(--paper);
    border-radius: 50%;
    justify-self: center;
    margin-top: -25px;
    box-shadow: 0 3px 8px #23412918;
  }
  .bottom-nav .nav-add .icon {
    width: 22px;
    height: 22px;
  }
  .log-context {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .food-row {
    padding: 13px 12px;
    gap: 6px;
  }
  .food-main {
    gap: 10px;
  }
  .food-text strong {
    font-size: 14px;
  }
  .food-text small {
    font-size: 10px;
  }
  .food-num {
    font-size: 14px;
  }
  .food-glyph {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .chip {
    font-size: 11px;
    padding: 8px 13px;
  }
  .search-bar {
    margin-top: 16px;
  }
  .progress-grid {
    gap: 16px;
  }
  .progress-grid > .stack {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .progress-grid > .stack > .stat-card:last-child {
    grid-column: 1/-1;
  }
  .stat-card {
    padding: 19px;
  }
  .chart-card {
    padding: 22px;
  }
  .chart-card .chips {
    gap: 4px;
  }
  .chart-card .chip {
    padding: 7px 10px;
    min-height: 35px;
    font-size: 10px;
  }
  .chart-card .card-header {
    align-items: flex-start;
  }
  .weight-chart {
    margin-top: 12px;
  }
  .settings-layout {
    gap: 16px;
  }
  .card {
    border-radius: 21px;
  }
  .settings-row {
    font-size: 13px;
  }
  .status-banner {
    font-size: 11px;
    padding: 10px 12px;
  }
  #toast {
    left: 50%;
    bottom: 100px;
    width: max-content;
    max-width: calc(100vw - 40px);
  }
  dialog {
    width: calc(100% - 16px);
    max-height: 94dvh;
    border-radius: 24px;
  }
  .modal-head {
    padding: 18px 20px 10px;
  }
  .modal-body {
    padding: 10px 20px 23px;
  }
  .form-grid {
    gap: 14px;
  }
  .field {
    font-size: 11px;
  }
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }
  .login {
    margin-top: 6dvh;
  }
  .personal {
    gap: 8px;
  }
  .personal .pill {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
