@font-face { font-family: Manrope; src: url("/manrope.ttf") format("truetype"); font-style: normal; font-weight: 200 800; font-display: swap; }
:root {
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sage: #cfd9c2;
  --ink: #253728;
  --forest: #3f553e;
  --muted: #50604e;
  --paper: #faf9f1;
  --soft: #e9eedf;
  --line: #c0cbb5;
  --orange: #fd590e;
  --rust: #983d22;
  color: var(--ink);
  background: var(--sage);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input, textarea { font: inherit; }
button, .file-label, a { -webkit-tap-highlight-color: transparent; }
button, .file-label { cursor: pointer; }
a { color: var(--forest); text-underline-offset: .16em; }
:focus-visible { outline: 3px solid #88501d; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .58; }
.shell { max-width: 760px; min-height: 100vh; margin: auto; padding: 0 clamp(16px,4vw,32px); }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: inline-flex; align-items: center; border-radius: 8px; }
.brand img { display: block; width: 72px; height: auto; }
.avatar { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 4px 12px 4px 5px; border: 1px solid #a5b69b; border-radius: 24px; background: #e9eedf; color: var(--forest); font-weight: 750; font-size: .9rem; }
#avatar-initial { display: grid; place-items: center; width: 31px; height: 31px; background: var(--forest); color: var(--paper); border-radius: 50%; }
.screen { padding: 8px 0 106px; }
h1, h2, p { margin: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: clamp(2.02rem,7.6vw,3rem); line-height: 1.09; letter-spacing: -.047em; color: #304430; }
h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.045em; }
.muted { color: var(--muted); margin-top: 8px; line-height: 1.45; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; }
.gate { padding: 24px; margin-top: 12px; }
.gate .primary, .gate .secondary { margin-top: 18px; display: inline-flex; text-decoration: none; }
.day-heading, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.day-heading { min-height: 126px; padding: 16px; align-items: flex-end; overflow: hidden; border: 1px solid #b8c4ad; border-radius: 23px; background: linear-gradient(90deg,#e7ebdb 1%,#e7ebdbdc 37%,#e7ebdb16 83%), url("/header.webp") right 44% / cover; }
.day-heading > div { min-width: 0; }
.day-heading h1 { overflow-wrap: anywhere; }
.date-control { display: grid; gap: 3px; font-size: .875rem; font-weight: 740; flex: none; color: var(--ink); }
input[type=date] { background: var(--paper); border: 1px solid #b2c0a7; border-radius: 11px; padding: 8px 6px; width: 142px; min-height: 42px; color: var(--ink); }
.week { display: grid; grid-template-columns: repeat(7,1fr); gap: clamp(4px,1vw,9px); margin: 12px 0 15px; }
.week button { display: grid; place-items: center; gap: 2px; min-width: 0; min-height: 58px; padding: 4px 0; border: 1px solid #b7c5ab; border-radius: 15px; background: #e8eedf; color: var(--ink); }
.week button[aria-pressed=true] { background: var(--forest); border-color: var(--forest); color: #fffbed; }
.week button:disabled { opacity: .53; cursor: default; }
.weekday { font-size: .875rem; }
.day-number { font-weight: 800; font-variant-numeric: tabular-nums; }
.status-mark { color: var(--forest); min-height: 13px; font-size: .85rem; line-height: 1; }
.week button[aria-pressed=true] .status-mark { color: #ffc295; }
.balance, .composer, .goal-form, .stats { padding: clamp(15px,4vw,24px); }
.text-button { min-height: 40px; padding: 4px 8px; background: transparent; border: 0; color: var(--forest); font-weight: 760; }
.text-button:hover { text-decoration: underline; }
.progress-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px 14px; }
.nutrient:first-child { grid-column: 1/-1; padding-bottom: 14px; border-bottom: 1px solid #d5ddca; }
.nutrient .label { display: block; font-size: .875rem; color: var(--muted); }
.nutrient .amount { margin: 3px 0; font-size: .95rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.nutrient:first-child .amount { font-size: clamp(1.65rem,7vw,2.3rem); line-height: 1.2; letter-spacing: -.05em; }
.nutrient .goal { font-weight: 520; color: var(--muted); }
.nutrient[data-over=true] .value, .nutrient .over { color: var(--rust); }
.nutrient .over { font-size: .875rem; }
progress { width: 100%; height: 8px; appearance: none; display: block; border: 0; border-radius: 20px; color: var(--forest); background: #d9e1cf; margin: 8px 0 0; }
progress::-webkit-progress-bar { border-radius: 20px; background: #d9e1cf; }
progress::-webkit-progress-value { border-radius: 20px; background: #536e4d; }
progress::-moz-progress-bar { border-radius: 20px; background: #536e4d; }
.nutrient[data-over=true] progress::-webkit-progress-value { background: #b44b28; }
.nutrient[data-over=true] progress::-moz-progress-bar { background: #b44b28; }
.diary-heading { margin: 22px 0 10px; }
.primary, .secondary { border: 1px solid transparent; border-radius: 13px; padding: 10px 14px; min-height: 44px; font-weight: 740; }
.primary { background: var(--forest); color: var(--paper); }
.primary:hover { background: #2d432f; }
.secondary { background: var(--soft); color: var(--ink); }
.secondary:hover { background: #dbe5d0; }
.compact, .file-label { display: inline-flex; align-items: center; gap: 7px; }
.compact { padding: 9px 12px; }
.glyph { display: inline-block; flex: none; width: 20px; height: 20px; background: currentColor; -webkit-mask: url("/ui-icons.png") var(--pos,0%) center / 1100% 100% no-repeat; mask: url("/ui-icons.png") var(--pos,0%) center / 1100% 100% no-repeat; }
[data-symbol=chat] { --pos:10%; } [data-symbol=profile] { --pos:20%; } [data-symbol=stats] { --pos:30%; }
[data-symbol=breakfast] { --pos:40%; } [data-symbol=lunch] { --pos:50%; } [data-symbol=dinner] { --pos:60%; } [data-symbol=snack] { --pos:70%; }
[data-symbol=camera] { --pos:80%; } [data-symbol=plus] { --pos:90%; }
.compact .glyph { width: 16px; height: 16px; }
.meals { display: grid; gap: 8px; }
.meal-card { background: var(--paper); border: 1px solid var(--line); border-radius: 17px; overflow: hidden; }
.meal-card summary { display: flex; gap: 11px; align-items: center; min-height: 61px; padding: 10px 14px; list-style: none; cursor: pointer; }
.meal-card summary::-webkit-details-marker { display: none; }
.meal-card summary::after { content: "+"; color: var(--forest); font-weight: 680; font-size: 1.24rem; }
.meal-card[open] summary::after { content: "−"; }
.meal-icon { display: grid; place-items: center; width: 35px; height: 35px; flex: none; border-radius: 12px; }
.meal-icon .glyph { width: 21px; height: 21px; }
.meal-icon[data-icon="0"] { background: #f1e5be; color: #70511e; }
.meal-icon[data-icon="1"] { background: #dde7cb; color: #456338; }
.meal-icon[data-icon="2"] { background: #f3dccb; color: #854424; }
.meal-icon[data-icon="3"] { background: #e2e7cf; color: #526334; }
.meal-title { flex: 1; font-weight: 780; }
.meal-energy { color: var(--muted); font-variant-numeric: tabular-nums; }
.meal-content { padding: 0 14px 14px; }
.entry { display: grid; gap: 7px; border-top: 1px solid var(--line); padding: 10px 0; }
.entry-meta { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .875rem; }
.entry-meta button { margin-left: auto; }
.entry ul { margin: 0; padding-left: 20px; }
.entry li { margin: 6px 0; }
.item-meta { color: var(--muted); display: block; font-size: .875rem; }
.navigation { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%,760px); display: flex; gap: 4px; padding: 7px 12px max(8px,env(safe-area-inset-bottom)); z-index: 5; background: var(--paper); border: 1px solid #bbc6ae; border-radius: 20px 20px 0 0; }
.navigation button { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: center; flex-direction: column; gap: 3px; min-height: 48px; font-weight: 720; font-size: .875rem; line-height: 1.2; color: var(--muted); border: 0; border-radius: 12px; padding: 5px 2px; background: transparent; }
.navigation button[aria-current=page] { background: #dce7cc; color: #324831; box-shadow: inset 0 -2px var(--orange); }
.notice { background: #f6e7d1; color: #674125; border-radius: 13px; padding: 10px 12px; margin-top: 8px; }
.messages { display: grid; gap: 10px; margin: 17px 0; }
.bubble { scroll-margin-top: 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--paper); border: 1px solid var(--line); padding: 12px 14px; border-radius: 17px 17px 17px 4px; }
.bubble.mine { background: var(--forest); border-color: var(--forest); color: var(--paper); max-width: 92%; justify-self: end; border-radius: 17px 17px 4px 17px; }
.actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.actions button { text-align: left; }
.composer > label, .goal-form label { font-weight: 715; }
.photo-status { margin: 0 0 12px; padding: 16px; background: #f5f7eb; scroll-margin: 12px; }
.photo-status-head { display: flex; gap: 10px; align-items: center; }
.photo-status-head strong { flex: 1; line-height: 1.3; }
.photo-emblem { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 12px; background: #dce6cf; }
.photo-clock { padding: 3px 9px; border: 1px solid #c2cdb6; border-radius: 20px; color: var(--forest); font-size: .83rem; font-weight: 720; font-variant-numeric: tabular-nums; white-space: nowrap; }
.photo-track { position: relative; margin-top: 15px; overflow: hidden; border-radius: 12px; background: #d9e1cf; }
.photo-track progress { margin: 0; height: 8px; }
.photo-status[data-mode=work] progress { opacity: 0; }
.photo-status[data-mode=work] .photo-track::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 38%; background: var(--forest); border-radius: inherit; animation: photo-scan 1.7s ease-in-out infinite alternate; }
@keyframes photo-scan { to { transform: translateX(163%); } }
@media (prefers-reduced-motion: reduce) { .photo-status[data-mode=work] .photo-track::after { animation: none; left: 31%; } }
.photo-steps { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px; list-style: none; padding: 0; margin: 9px 0 0; color: var(--muted); font-size: .81rem; }
.photo-steps li::before { content: "○"; margin-right: 5px; }
.photo-steps li[aria-current=step] { color: var(--forest); font-weight: 800; }
.photo-steps li[aria-current=step]::before { content: "●"; color: #ad440e; }
.photo-steps .done::before { content: "✓"; color: var(--forest); font-weight: 800; }
.photo-status p { color: var(--muted); margin: 11px 0 0; font-size: .86rem; }
.photo-status[data-mode=error] { background: #fbefe1; }
.photo-status[data-mode=error] .photo-track, .photo-status[data-mode=error] .photo-steps { display: none; }
textarea, input[type=number] { width: 100%; margin-top: 6px; background: #f3f5ea; border: 1px solid #afbeaa; border-radius: 11px; padding: 10px 12px; color: var(--ink); }
textarea { resize: vertical; min-height: 88px; }
.compose-actions { margin-top: 11px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.compose-actions .primary { margin-left: auto; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-label:has(+ input:focus-visible) { outline: 3px solid #88501d; outline-offset: 3px; }
.entry-context { display: flex; align-items: center; justify-content: space-between; color: var(--forest); }
.goal-form { display: grid; gap: 16px; margin-top: 21px; }
.goal-grid { display: grid; gap: 14px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.privacy { font-size: .875rem; margin-top: 15px; }
.stats { margin-top: 16px; }
.usage-card { padding: clamp(14px,4vw,24px); margin: 18px 0 24px; }
.usage-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 18px; }
.usage-summary div { display: grid; align-content: start; }
.usage-summary strong { font-size: 1.4rem; color: var(--forest); }
.usage-summary span, .usage-table small, .usage-card .muted { font-size: .875rem; color: var(--muted); }
.usage-table { width: 100%; margin-top: 16px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.usage-table td, .usage-table th { text-align: right; padding: 8px 3px; border-bottom: 1px solid var(--line); }
.usage-table th { font-size: .875rem; white-space: nowrap; }
.usage-table :is(td,th):first-child { text-align: left; overflow-wrap: anywhere; }
.usage-table small { display: block; }
.usage-pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.stats > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stats > div:last-child { border-bottom: 0; }
@media (max-width:370px) {
  .topbar { min-height: 70px; }
  .brand img { width: 65px; }
  .day-heading { padding: 12px; gap: 6px; }
  .day-heading h1 { font-size: 1.55rem; }
  input[type=date] { width: 122px; }
  .week { gap: 3px; }
  .week button { border-radius: 10px; }
  .progress-list { gap: 10px 8px; }
  .nutrient .amount, .navigation button { font-size: .875rem; }
  .file-label { padding: 9px; }
}
@media (min-width:620px) {
  .topbar { min-height: 90px; }
  .brand img { width: 84px; }
  .day-heading { min-height: 145px; padding: 20px 23px; }
  .navigation button { flex-direction: row; gap: 9px; }
}
