:root {
  color-scheme: light;
  --ink: #24332a;
  --muted: #667268;
  --forest: #264d38;
  --green: #346448;
  --paper: #f7f8f2;
  --white: #fffefa;
  --line: #e3e8dc;
  --sage: #e7efdb;
  --peach: #f7e8d8;
  --lilac: #eee9f3;
  --radius: 21px;
  font-family: Inter, 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
  font-synthesis: none;
  background: var(--paper);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; line-height: 1.55; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .file-button:focus-within { outline: 3px solid #659574; outline-offset: 3px; }
main:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
a { color: var(--forest); }
svg { flex: none; vertical-align: middle; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 31px 19px 23px; border-right: 1px solid var(--line); background: #fbfcf6; }
.brand { background: none; border: 0; color: var(--ink); display: inline-flex; gap: 12px; align-items: center; text-align: left; padding: 0; width: fit-content; }
.sidebar .brand { margin: 0 0 49px 9px; }
.brand-mark { display: grid; place-items: center; width: 47px; height: 47px; color: #fffdef; background: var(--forest); border-radius: 15px; }
.brand strong { display: block; font-size: 24px; font-weight: 780; letter-spacing: .055em; line-height: 1.16; }
.brand small { display: block; margin-top: 6px; font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.navigation { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 13px 16px; width: 100%; text-align: left; border: 0; border-radius: 13px; color: #536054; background: transparent; font-size: .95rem; }
.nav-item:hover { background: #eff3e8; }
.nav-item.active { color: #214730; background: #e7eedf; font-weight: 750; }
.sidebar-bottom { margin-top: auto; padding: 15px 8px 0; border-top: 1px solid var(--line); }
.privacy-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .84rem; margin-bottom: 13px; }
.mobile-top { display: none; }
.main { min-width: 0; }
.content { width: min(100%, 1275px); padding: 37px 42px 42px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 0 0 24px; }
h1 { color: #26382c; font-size: clamp(1.85rem, 3vw, 2.35rem); line-height: 1.25; font-weight: 790; letter-spacing: -.045em; }
.page-head p { color: var(--muted); margin-top: 7px; }
.date-chip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 13px; border-radius: 999px; border: 1px solid #dce5d8; color: #46614d; background: #f1f5eb; font-size: .86rem; white-space: nowrap; }
.hero { min-height: 330px; display: grid; grid-template-columns: .93fr 1.07fr; overflow: hidden; border-radius: 27px; background: #e8efdc; border: 1px solid #e0e8d7; }
.hero-text { position: relative; padding: 39px clamp(25px, 4vw, 58px) 36px; z-index: 1; }
.hero h2 { margin: 14px 0 14px; color: #1f402e; font-size: clamp(2.5rem, 4.35vw, 4.1rem); line-height: 1.1; font-weight: 820; letter-spacing: -.085em; }
.hero p { font-size: 1rem; color: #506854; line-height: 1.68; }
.hero-visual { position: relative; min-width: 0; min-height: 100%; background: radial-gradient(ellipse at 55% 46%, #d3debc, #c0cfa7); overflow: hidden; }
.hero-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 53%; }
.photo-tag { position: absolute; display: flex; align-items: center; gap: 7px; bottom: 18px; right: 19px; padding: 8px 12px; color: #284a37; background: #fcfff6ed; border: 1px solid #eff2ea; border-radius: 999px; box-shadow: 0 3px 14px #243d2833; font-weight: 660; font-size: .83rem; }
.hero-actions, .action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-actions { margin-top: 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: .94rem; font-weight: 720; text-decoration: none; text-align: center; line-height: 1.25; padding: 11px 15px; min-height: 44px; border: 1px solid transparent; border-radius: 11px; white-space: nowrap; }
.primary { color: #fffefa; background: var(--forest); box-shadow: 0 3px 6px #264d3816; }
.primary:hover:not(:disabled) { background: #1d402c; }
.ghost { color: #31513b; background: #f4f7eb; border-color: #cfdbc4; }
.outline { color: var(--forest); background: #fffc; border-color: #d9e3d6; }
.outline:hover, .ghost:hover { background: #eff4e9; }
.text-button { display: inline-flex; align-items: center; color: var(--forest); background: transparent; border: 0; border-radius: 6px; padding: 5px 4px; font-size: .9rem; font-weight: 720; white-space: nowrap; }
.text-button:hover { background: #edf2e8; }
.danger { color: #9a4437; }
.danger:hover { background: #fbede8; }
.quick-section { margin-top: 27px; }
.section-title { font-size: 1.22rem; font-weight: 780; letter-spacing: -.025em; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-top: 11px; }
.quick-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 16px 14px; text-align: left; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 16px; min-height: 95px; }
.quick-card:hover { border-color: #b9cdb6; background: #fdfff9; }
.icon-tile { align-self: start; display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--forest); flex: none; }
.green { background: var(--sage); color: #35543b; }
.peach { background: var(--peach); color: #814d30; }
.lilac { background: var(--lilac); color: #614d73; }
.quick-card strong, .overview-body strong { display: block; font-size: 1rem; font-weight: 760; }
.quick-card small, .overview-body p { display: block; margin-top: 3px; font-size: .83rem; color: var(--muted); line-height: 1.5; }
.home-bottom { display: grid; grid-template-columns: 1.1fr 1fr; gap: 15px; margin-top: 24px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 3px #213a2105; }
.overview { padding: 17px 20px; }
.section-head { display: flex; justify-content: space-between; gap: 9px; align-items: center; }
.section-head h2 { font-size: 1.18rem; font-weight: 780; letter-spacing: -.025em; }
.overview-body { display: flex; align-items: center; gap: 14px; margin-top: 13px; }
.overview-body .icon-tile { width: 42px; height: 42px; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; border: 1px solid #e3e9dd; background: #edf1e8; margin-bottom: 20px; }
.segmented button { display: inline-flex; align-items: center; gap: 8px; color: #56645a; background: transparent; border: 1px solid transparent; padding: 8px 14px; border-radius: 10px; font-size: .94rem; }
.segmented button[aria-pressed="true"] { background: var(--white); border-color: #e0e6da; box-shadow: 0 1px 3px #1f3c2010; color: var(--forest); font-weight: 750; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.07fr) minmax(0, .93fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 16px; min-width: 0; }
.form-card { padding: 19px; }
.form-card > .section-head { margin-bottom: 13px; }
.pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: .77rem; white-space: nowrap; font-weight: 730; background: var(--lilac); color: #5f5070; }
.pill.peach { background: var(--peach); color: #814d30; }
.pill.green { background: var(--sage); color: #35543b; }
.upload-area { overflow: hidden; min-height: 155px; border: 1px dashed #bacab6; border-radius: 15px; background: #f4f7ed; display: grid; place-items: center; text-align: center; position: relative; }
.upload-controls { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px; min-width: 0; max-width: 100%; }
.upload-controls strong { font-size: .91rem; overflow-wrap: anywhere; }
.upload-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.camera-file { display: none; }
.upload-controls .icon-tile { align-self: center; width: 40px; height: 40px; }
.upload-area.has-image { grid-template-columns: 1fr; }
.upload-area.has-image img { width: 100%; height: 225px; display: block; object-fit: contain; background: #e8eee1; }
.upload-area.has-image .upload-controls { padding: 10px; }
.upload-area.has-image .upload-controls .icon-tile { display: none; }
.file-button { position: relative; cursor: pointer; }
.file-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.inline-status { padding: 9px 11px; background: #eef3e8; border-radius: 10px; color: #405d46; font-size: .89rem; margin: 10px 0 0; overflow-wrap: anywhere; }
.micro, .muted { color: var(--muted); }
.micro { font-size: .83rem; margin-top: 9px; line-height: 1.55; }
.field { color: #49564a; display: flex; flex-direction: column; gap: 5px; font-size: .88rem; font-weight: 690; min-width: 0; margin-top: 10px; }
input:not([type='radio']):not([type='file']), textarea, select { min-width: 0; width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #dae2d6; border-radius: 9px; background: #fff; color: #29352b; font-size: .95rem; }
textarea { resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23546756' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 30px; }
input::placeholder, textarea::placeholder { color: #778279; }
.fields.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.energy-input { display: grid; grid-template-columns: minmax(0, 1fr) minmax(65px, .66fr); gap: 5px; }
.food-table { display: grid; gap: 8px; }
.food-head, .food-row { display: grid; grid-template-columns: minmax(0, 1fr) 105px 32px; gap: 8px; align-items: center; }
.food-head { font-size: .82rem; color: var(--muted); }
.icon-button { display: inline-grid; place-items: center; color: #5b6d5c; background: transparent; border: 1px solid transparent; width: 36px; height: 36px; border-radius: 9px; font-size: 1.45rem; line-height: 1; }
.icon-button:hover { background: #eef3e8; }
.remove-button { width: 32px; }
.result-name { color: var(--muted); font-weight: 630; font-size: .92rem; margin: 2px 0 12px; }
.nutrient-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.nutrient { padding: 10px 8px; border: 1px solid #e7ebe1; background: #f6f7f0; border-radius: 11px; }
.nutrient.priority { border-color: #cadcbf; background: #e9f1df; }
.nutrient span { display: block; color: #526253; font-size: .77rem; margin-bottom: 2px; }
.nutrient strong { color: var(--forest); display: block; font-size: clamp(1.2rem, 2.1vw, 1.76rem); font-variant-numeric: tabular-nums; line-height: 1.22; font-weight: 800; overflow-wrap: anywhere; }
.nutrient small { color: #526253; font-size: .76rem; }
.empty-result { min-height: 153px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 6px; color: var(--muted); padding: 12px; }
.empty-result .icon-tile { align-self: center; }
.empty-result strong { color: var(--ink); margin-top: 3px; }
.empty-result p { font-size: .88rem; }
.advice-card { background: #f9fcf4; border-color: #e0e9d8; }
.advice-card h2 svg { margin-right: 4px; color: var(--green); }
.tip-title { display: block; font-size: .98rem; }
.advice-card p { color: #526254; font-size: .92rem; margin-top: 5px; }
.advice-card .frequency, .advice-card .ingredients { border-top: 1px solid #e4ebde; padding-top: 9px; margin-top: 10px; overflow-wrap: anywhere; }
.frequency svg { margin-right: 4px; }
.ingredients { overflow-wrap: anywhere; }
.ingredient-notes { margin: 8px 0 0; padding-left: 1.45rem; color: #455749; font-size: .9rem; }
details { margin-top: 12px; }
summary { color: var(--forest); font-size: .89rem; font-weight: 690; cursor: pointer; }
details .button { margin-top: 8px; }
.sample-label { padding: 12px; background: #faf2e6; border: 1px solid #efdfc9; border-radius: 12px; margin-bottom: 10px; }
.sample-label strong, .sample-label span { display: block; }
.sample-label span, .sample-label div { color: #65584b; font-size: .84rem; }
.goal-list { display: grid; gap: 8px; }
.goal-choice { cursor: pointer; display: flex; gap: 8px; align-items: flex-start; border: 1px solid #e2e9dd; border-radius: 11px; padding: 9px 11px; }
.goal-choice:has(:checked) { background: #eef4e7; border-color: #cbdcc3; }
.goal-choice input { accent-color: var(--forest); width: 16px; height: 16px; margin-top: 5px; }
.goal-choice strong, .goal-choice small { display: block; }
.goal-choice small { color: var(--muted); font-size: .84rem; }
.profile-foot { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 9px; }
.log-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 15px; }
.log-metric { padding: 15px; }
.log-metric span { font-size: .91rem; color: var(--muted); }
.log-metric strong { display: block; font-size: 1.75rem; color: var(--forest); }
.log-metric small { font-size: .85rem; }
.record-list { display: grid; }
.record { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; gap: 11px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.record-text { overflow-wrap: anywhere; }
.record-text p, .record-energy small { font-size: .82rem; color: var(--muted); }
.toast { position: fixed; z-index: 20; bottom: 22px; left: 50%; translate: -50% 0; max-width: calc(100vw - 28px); padding: 9px 15px; border-radius: 11px; background: #264d38; color: #fff; box-shadow: 0 6px 24px #1e342a35; }
.dish-guesses { margin-top: 13px; }
.dish-guesses ul { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 6px 0 0; list-style: none; }
.dish-guesses li { padding: 4px 10px; border-radius: 999px; color: #36543d; background: var(--sage); font-size: .84rem; }
@media (max-width: 1110px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); }
  .content { padding: 30px 28px 38px; }
  .sidebar { padding-inline: 14px; }
  .quick-card { gap: 9px; }
  .quick-card .icon-tile { width: 39px; height: 39px; }
}
@media (max-width: 800px) {
  .camera-file { display: inline-flex; }
  .layout { display: block; }
  .sidebar { position: fixed; z-index: 5; top: auto; left: 0; right: 0; bottom: 0; padding: 5px 8px max(5px, env(safe-area-inset-bottom)); height: auto; border-right: 0; border-top: 1px solid var(--line); background: #fbfcf7fa; }
  .sidebar .brand, .sidebar-bottom { display: none; }
  .navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .nav-item { flex-direction: column; align-items: center; gap: 3px; padding: 5px 3px; text-align: center; font-size: .77rem; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 10px 17px; background: #fbfcf6; }
  .mobile-top .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .mobile-top .brand strong { font-size: 20px; }
  .content { padding: 24px 18px 87px; }
  .toast { bottom: 70px; }
}
@media (max-width: 570px) {
  .content { padding-inline: 13px; }
  .page-head { align-items: flex-start; margin-bottom: 17px; }
  .page-head p { font-size: .91rem; }
  .page-head .date-chip { padding: 5px 7px; font-size: .72rem; }
  .page-head .button { font-size: .8rem; padding: 8px; min-height: 35px; }
  .page-head .date-chip svg { display: none; }
  .hero { grid-template-columns: 1fr; border-radius: 19px; }
  .hero-text { padding: 23px 21px 22px; }
  .hero h2 { font-size: clamp(2.18rem, 10.8vw, 3.2rem); }
  .desktop-break { display: none; }
  .hero p { font-size: .92rem; }
  .hero-actions { margin-top: 15px; }
  .hero-visual { min-height: 185px; }
  .photo-tag { bottom: 9px; right: 10px; }
  .quick-section { margin-top: 18px; }
  .quick-grid { grid-template-columns: 1fr; gap: 8px; }
  .quick-card { min-height: 65px; padding: 9px 12px; }
  .home-bottom, .workspace-grid { grid-template-columns: 1fr; gap: 12px; }
  .home-bottom { margin-top: 14px; }
  .stack { gap: 12px; }
  .form-card { padding: 14px; }
  .log-totals { gap: 6px; }
  .log-metric { padding: 8px; }
  .log-metric span, .log-metric .micro { font-size: .73rem; }
  .log-metric strong { font-size: 1.3rem; }
  .record { gap: 7px; }
  .record .icon-tile { width: 35px; height: 35px; }
  .record-energy { font-size: .85rem; }
}
