@font-face { font-family: "DM Sans"; src: url("/assets/fonts/dm-sans-400.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/assets/fonts/dm-sans-500.woff2") format("woff2"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/assets/fonts/dm-sans-600.woff2") format("woff2"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/assets/fonts/dm-sans-700.woff2") format("woff2"); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-600.woff2") format("woff2"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-700.woff2") format("woff2"); font-style: normal; font-weight: 700; font-display: swap; }

:root {
  --ink: #173d2b;
  --ink-deep: #0f2b20;
  --paper: #f3f1e8;
  --paper-2: #fbfaf5;
  --line: #d8d7cc;
  --muted: #6a726c;
  --lime: #c8ef5a;
  --lime-soft: #e5f5b9;
  --coral: #fb7c61;
  --violet: #8e7bea;
  --blue: #6db4d3;
  --yellow: #e7c74e;
  --white: #fffef9;
  --shadow: 0 18px 50px rgba(27, 54, 40, 0.09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-deep);
  font-family: "DM Sans", system-ui, sans-serif;
  min-width: 320px;
}

.legal-page, .offline-page { min-height: 100vh; padding: clamp(28px,7vw,84px) 20px; }
.legal-page main, .offline-page main { width: min(720px,100%); margin: auto; padding: clamp(28px,5vw,54px); border: 1px solid var(--line); border-radius: 28px; background: var(--white); box-shadow: var(--shadow); }
.legal-page h1, .offline-page h1 { margin-bottom: 24px; }
.legal-page h2 { margin-top: 30px; font-size: 24px; }
.legal-page p, .offline-page p { color: var(--muted); line-height: 1.7; }
.legal-page > main > a, .offline-page a { display: inline-flex; margin-bottom: 32px; color: var(--ink); font-size: 12px; font-weight: 700; }
.legal-updated { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 10px; }
.offline-page { display: grid; place-items: center; }
.offline-page main { text-align: center; }
.offline-page img { width: 84px; margin-bottom: 22px; border-radius: 22px; }

button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(109, 180, 211, .65); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 34px 24px 24px;
  background: var(--ink-deep);
  color: var(--white);
  display: flex;
  flex-direction: column;
  z-index: 4;
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--white); text-decoration: none; font-family: "Fraunces", serif; font-size: 25px; font-weight: 700; letter-spacing: -.8px; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; color: var(--ink-deep); background: var(--lime); border-radius: 50% 50% 50% 8px; transform: rotate(-5deg); }
.brand-mark svg { width: 20px; height: 20px; transform: rotate(5deg); }
.brand-dot { color: var(--lime); }

.primary-nav { display: grid; gap: 7px; margin-top: 56px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #aebbb4; display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 12px; cursor: pointer; text-align: left; font-weight: 600; }
.nav-item svg { width: 19px; }
.nav-item:hover { color: var(--white); background: rgba(255,255,255,.06); }
.nav-item.is-active { color: var(--ink-deep); background: var(--lime); }

.streak-card { margin-top: auto; padding: 18px; color: var(--ink-deep); background: var(--lime-soft); border-radius: 18px 18px 5px 18px; }
.streak-top { display: flex; align-items: center; gap: 8px; }
.streak-top svg { width: 18px; fill: none; color: var(--coral); }
.streak-card p { margin: 8px 0 14px; color: #526259; font-size: 12px; line-height: 1.45; }
.streak-days { display: flex; justify-content: space-between; gap: 4px; }
.streak-days span { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid rgba(23,61,43,.18); border-radius: 50%; font-size: 9px; font-weight: 700; }
.streak-days span.done, .streak-days span.is-clear { color: var(--white); background: var(--ink); border-color: var(--ink); }
.streak-days span.had-drink { color: var(--white); background: var(--coral); border-color: var(--coral); }

.profile-chip { margin-top: 16px; border: 0; padding: 10px 2px 0; background: transparent; color: var(--white); display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: center; text-align: left; cursor: pointer; }
.profile-chip .avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-deep); background: var(--coral); font-weight: 700; font-size: 12px; }
.profile-chip strong, .profile-chip small { display: block; }
.profile-chip strong { font-size: 13px; }
.profile-chip small { margin-top: 2px; color: #98aaa0; font-size: 11px; }
.profile-chip svg { width: 17px; color: #75887e; }

.main-content { min-width: 0; padding: 44px clamp(24px, 4vw, 64px) 72px; overflow: hidden; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.personal-greeting { margin: 0 0 5px; color: var(--ink); font-family: "Fraunces", serif; font-size: clamp(17px, 1.8vw, 23px); font-weight: 600; }
.eyebrow { margin: 0 0 7px; color: #718079; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }
.eyebrow.light { color: #afc3b7; }
h1, h2 { margin: 0; font-family: "Fraunces", serif; letter-spacing: -1.2px; }
h1 { font-size: clamp(34px, 4vw, 54px); line-height: .96; }
h2 { font-size: clamp(25px, 2.4vw, 34px); line-height: 1; }
.hero-tagline { margin: 11px 0 0; display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--muted); font-size: 11px; }
.hero-tagline strong { color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.icon-button, .date-button, .cloud-button { height: 40px; border: 1px solid var(--line); background: var(--paper-2); cursor: pointer; }
.icon-button { width: 40px; display: grid; place-items: center; border-radius: 50%; }
.icon-button svg { width: 17px; }
.date-button { padding: 0 18px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.cloud-button { padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; }
.cloud-button svg { width: 15px; }
.cloud-button.is-synced { color: var(--ink-deep); background: var(--lime-soft); border-color: rgba(23,61,43,.14); }
.icon-button:disabled { opacity: .38; cursor: default; }
.mobile-settings { display: none; }

.energy-strip { display: grid; grid-template-columns: 1.25fr .85fr 1fr auto; align-items: center; gap: 24px; padding: 14px 18px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,254,249,.68); }
.energy-copy { display: flex; align-items: center; gap: 12px; }
.energy-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--ink-deep); background: var(--lime); border-radius: 11px; }
.energy-icon svg { width: 19px; fill: var(--ink-deep); }
.energy-copy small, .energy-metric small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; }
.energy-copy strong, .energy-metric strong { font-size: 14px; }
.energy-metric { padding-left: 22px; border-left: 1px solid var(--line); }
.text-button { border: 0; background: transparent; display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.text-button svg { width: 15px; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px; }
.protein-panel, .macro-panel { min-width: 0; min-height: 520px; padding: clamp(24px, 3vw, 38px); border-radius: 30px; overflow: hidden; }
.protein-panel { color: var(--white); background: var(--ink); }
.macro-panel { background: var(--white); border: 1px solid var(--line); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading.dark .eyebrow { color: var(--muted); }
.goal-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; color: var(--ink-deep); background: var(--lime); border-radius: 999px; font-size: 10px; font-weight: 700; }
.goal-badge svg { width: 13px; fill: currentColor; }
.calories { text-align: right; }
.calories strong, .calories small { display: block; }
.calories strong { font-size: 20px; }
.calories small { color: var(--muted); font-size: 10px; }

.gauge-wrap, .macro-chart-wrap { position: relative; display: grid; place-items: center; }
.gauge-wrap { margin: 12px auto -2px; max-width: 430px; }
.protein-gauge { width: 100%; display: block; }
.gauge-track, .gauge-progress { fill: none; stroke-width: 24; stroke-linecap: round; }
.gauge-track { stroke: rgba(255,255,255,.11); }
.gauge-progress { stroke: var(--lime); stroke-dasharray: 80 100; transition: stroke-dasharray .55s ease; }
.gauge-center { position: absolute; left: 50%; bottom: 27px; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.gauge-center div { display: flex; justify-content: center; align-items: baseline; }
.gauge-center strong { font-family: "Fraunces", serif; font-size: 56px; line-height: .9; letter-spacing: -3px; }
.gauge-center div span { margin-left: 3px; color: var(--lime); font-size: 20px; font-weight: 700; }
.gauge-center p { margin: 8px 0 0; color: #9fb3a8; font-size: 12px; }

.protein-footer { display: grid; grid-template-columns: .8fr 1.35fr; gap: 18px; align-items: center; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.protein-footer small, .protein-footer strong { display: block; }
.protein-footer > div:first-child small { color: #9fb3a8; font-size: 10px; }
.protein-footer > div:first-child strong { margin-top: 2px; font-size: 15px; }
.protein-message { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; color: var(--ink-deep); background: var(--lime-soft); }
.protein-message > svg { width: 18px; flex: 0 0 auto; }
.protein-message strong { font-size: 12px; }
.protein-message small { margin-top: 2px; color: #526259; font-size: 9px; }
.calorie-track { margin-top: 18px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,.1); }
.calorie-track-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.calorie-track-heading > span { display: inline-flex; align-items: center; gap: 7px; color: #afc3b7; font-size: 11px; font-weight: 700; }
.calorie-track-heading > span svg { width: 14px; color: var(--coral); fill: var(--coral); }
.calorie-track-heading > strong { font-size: 13px; }
.calorie-track-heading > strong small { color: #9fb3a8; font-weight: 500; }
.calorie-track-bar { height: 7px; margin-top: 10px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.calorie-track-bar span { display: block; width: 38%; height: 100%; border-radius: inherit; background: var(--coral); transition: width .55s ease; }

.macro-chart-wrap { max-width: 420px; margin: 0 auto -3px; }
.macro-chart { width: 100%; display: block; }
.macro-base, .macro-segment { fill: none; stroke-width: 34; }
.macro-base { stroke: #ecebe4; }
.macro-segment { transition: stroke-dasharray .55s ease, stroke-dashoffset .55s ease; }
.macro-segment.carbs { stroke: var(--ink); }
.macro-segment.fiber { stroke: var(--lime); }
.macro-segment.sugar { stroke: var(--coral); }
.macro-segment.fat { stroke: var(--violet); }
.macro-center { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); text-align: center; }
.macro-center span, .macro-center small { display: block; color: var(--muted); font-size: 10px; }
.macro-center strong { display: block; margin: 1px 0; font-family: "Fraunces", serif; font-size: 38px; letter-spacing: -2px; }
.macro-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.macro-legend > div { display: flex; gap: 8px; min-width: 0; }
.legend-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; flex: 0 0 auto; }
.legend-dot.carbs { background: var(--ink); }
.legend-dot.fiber { background: var(--lime); }
.legend-dot.sugar { background: var(--coral); }
.legend-dot.fat { background: var(--violet); }
.macro-legend p, .macro-legend small, .macro-legend strong { display: block; margin: 0; }
.macro-legend p { font-size: 11px; font-weight: 700; }
.macro-legend small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 400; white-space: nowrap; }
.macro-legend small strong { display: inline; color: var(--ink-deep); }

.food-section { padding-top: 48px; }
.habit-manifesto { margin-top: 54px; padding: 30px clamp(22px,3vw,36px); border-radius: 24px; color: var(--white); background: linear-gradient(115deg, var(--ink-deep), #285c42); }
.habit-manifesto .eyebrow { color: var(--lime); }
.habit-manifesto h2 { max-width: 680px; font-size: clamp(28px,3.2vw,42px); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; }
.section-heading.compact { align-items: center; margin-bottom: 22px; }
.secondary-button, .primary-button { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 700; }
.secondary-button { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); font-size: 12px; }
.secondary-button svg, .primary-button svg { width: 16px; }
.primary-button { min-height: 48px; padding: 0 20px; color: var(--white); background: var(--ink); border-radius: 12px; }

.food-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.food-card { position: relative; min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--paper-2); overflow: hidden; cursor: pointer; text-align: left; transition: transform .2s ease, box-shadow .2s ease; }
.food-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.food-image { height: 145px; display: grid; place-items: center; overflow: hidden; background: #e8eadf; }
.food-image img { width: 100%; height: 100%; object-fit: contain; padding: 12px; mix-blend-mode: multiply; }
.food-image .food-emoji { font-size: 64px; filter: saturate(.85); }
.food-card-content { min-height: 105px; padding: 14px; }
.food-card h3 { margin: 0 26px 4px 0; font-size: 13px; line-height: 1.2; }
.food-card p { margin: 0; color: var(--muted); font-size: 10px; }
.food-card strong { display: block; margin-top: 9px; font-size: 11px; }
.food-card strong span { color: var(--muted); font-weight: 500; }
.quick-add { position: absolute; right: 11px; bottom: 13px; width: 29px; height: 29px; display: grid; place-items: center; color: var(--white); background: var(--ink); border-radius: 50%; }
.quick-add svg { width: 15px; }
.food-added { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-deep); background: rgba(200,239,90,.92); font-weight: 800; opacity: 0; pointer-events: none; }
.food-card.just-added .food-added { animation: added .6s ease; }
@keyframes added { 0% { opacity: 0; transform: scale(.95); } 35%, 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 18px; padding-top: 48px; }
.today-log, .weight-card { padding: 28px; border-top: 1px solid var(--line); background: rgba(255,254,249,.42); }
.log-count, .trend-badge { padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.log-count { background: var(--lime-soft); }
.trend-badge { color: var(--white); background: var(--ink); }
.log-list { display: grid; }
.log-empty { padding: 28px 0; color: var(--muted); font-size: 13px; }
.log-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: 0; }
.log-thumb { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; overflow: hidden; background: #e5e7dc; font-size: 23px; }
.log-thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.log-copy strong, .log-copy small { display: block; }
.log-copy strong { font-size: 12px; }
.log-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.stepper { display: grid; grid-template-columns: 27px 26px 27px; align-items: center; text-align: center; }
.stepper button { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper-2); cursor: pointer; }
.stepper button svg { width: 13px; }
.stepper span { font-size: 11px; font-weight: 700; }

.weight-current { display: flex; align-items: baseline; gap: 7px; }
.weight-current strong { font-family: "Fraunces", serif; font-size: 44px; line-height: 1; letter-spacing: -2px; }
.weight-current span { color: var(--muted); font-size: 11px; }
.weight-chart { width: 100%; margin: 12px 0 2px; overflow: visible; }
.weight-line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.weight-area { fill: rgba(200,239,90,.3); }
.weight-dot { fill: var(--paper-2); stroke: var(--ink); stroke-width: 2; }
.weight-dot.last { fill: var(--lime); stroke-width: 3; }
.weight-label { fill: var(--muted); font: 9px "DM Sans", sans-serif; }
.weight-form { display: grid; gap: 7px; margin-top: 8px; }
.weight-form label { color: var(--muted); font-size: 10px; font-weight: 700; }
.weight-form > div { display: grid; grid-template-columns: 1fr auto auto; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--paper-2); overflow: hidden; }
.weight-form input { min-width: 0; padding: 11px 5px 11px 13px; border: 0; background: transparent; font-weight: 700; }
.weight-form input:focus { outline: 0; }
.weight-form span { color: var(--muted); font-size: 11px; }
.weight-form button { align-self: stretch; margin-left: 10px; padding: 0 16px; border: 0; color: var(--white); background: var(--ink); font-size: 11px; font-weight: 700; cursor: pointer; }

.workout-card { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(190px,.7fr) minmax(320px,1.25fr) auto; align-items: center; gap: 24px; padding: 24px 28px; border: 1px solid rgba(251,124,97,.3); border-radius: 24px; background: linear-gradient(110deg, #fff4ed, var(--white)); }
.workout-symbol { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px 18px 6px 18px; color: var(--white); background: var(--coral); box-shadow: 0 12px 26px rgba(251,124,97,.22); }
.workout-symbol svg { width: 28px; height: 28px; }
.workout-total { display: flex; align-items: center; gap: 12px; }
.workout-total strong { font-family: "Fraunces", serif; font-size: 48px; line-height: .85; letter-spacing: -3px; }
.workout-total span { color: var(--muted); font-size: 11px; line-height: 1.25; }
.workout-copy > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 9px; }
.workout-history-wrap > span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.workout-history { display: grid; grid-template-columns: repeat(14,minmax(13px,1fr)); gap: 5px; }
.workout-day { height: 24px; display: grid; place-items: center; border: 1px solid rgba(23,61,43,.08); border-radius: 5px; color: #8a938d; background: rgba(23,61,43,.04); font-size: 8px; font-weight: 700; }
.workout-day.is-workout { color: var(--white); background: var(--coral); border-color: var(--coral); }
.workout-legend { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 9px; color: var(--muted); font-size: 8px; }
.workout-legend span { display: inline-flex; align-items: center; gap: 4px; }
.workout-legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--coral); }
.workout-legend i.empty { border: 1px solid rgba(23,61,43,.15); background: rgba(23,61,43,.04); }
.workout-actions { display: grid; gap: 8px; min-width: 165px; }
.workout-actions button { min-height: 40px; padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 10px; font-weight: 700; cursor: pointer; }
.workout-actions button svg { width: 14px; }
#mark-workout { border: 0; color: var(--white); background: var(--ink); }
#mark-workout[aria-pressed="true"] { background: var(--coral); }
#undo-workout { border: 1px solid var(--line); background: var(--white); }
.workout-actions button:disabled { opacity: .42; cursor: default; }

.journal-card { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(190px,.7fr) minmax(320px,1.25fr) auto; align-items: center; gap: 24px; padding: 24px 28px; border: 1px solid rgba(231,199,78,.38); border-radius: 24px; background: linear-gradient(110deg, #fff7cf, var(--white)); }
.journal-symbol { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px 18px 6px 18px; color: var(--ink-deep); background: var(--yellow); box-shadow: 0 12px 26px rgba(192,155,22,.18); }
.journal-symbol svg { width: 28px; height: 28px; }
.journal-total { display: flex; align-items: center; gap: 12px; }
.journal-total strong { font-family: "Fraunces", serif; font-size: 48px; line-height: .85; letter-spacing: -3px; }
.journal-total span { color: var(--muted); font-size: 11px; line-height: 1.25; }
.journal-copy > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 9px; }
.journal-history-wrap > span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.journal-history { display: grid; grid-template-columns: repeat(14,minmax(13px,1fr)); gap: 5px; }
.journal-day { height: 24px; display: grid; place-items: center; border: 1px solid rgba(23,61,43,.08); border-radius: 5px; color: #8a938d; background: rgba(23,61,43,.04); font-size: 8px; font-weight: 700; }
.journal-day.is-journaled { color: var(--ink-deep); background: var(--yellow); border-color: var(--yellow); }
.journal-legend { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 9px; color: var(--muted); font-size: 8px; }
.journal-legend span { display: inline-flex; align-items: center; gap: 4px; }
.journal-legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--yellow); }
.journal-legend i.empty { border: 1px solid rgba(23,61,43,.15); background: rgba(23,61,43,.04); }
.journal-actions { display: grid; gap: 8px; min-width: 165px; }
.journal-actions button { min-height: 40px; padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 10px; font-weight: 700; cursor: pointer; }
.journal-actions button svg { width: 14px; }
#mark-journaled { border: 0; color: var(--white); background: var(--ink); }
#mark-journaled[aria-pressed="true"] { color: var(--ink-deep); background: var(--yellow); }
#undo-journaled { border: 1px solid var(--line); background: var(--white); }
.journal-actions button:disabled { opacity: .42; cursor: default; }

.meditation-card { grid-column: 1 / -1; position: relative; display: grid; grid-template-columns: auto minmax(220px,.75fr) minmax(330px,1.2fr) auto; align-items: center; gap: 26px; padding: 26px 28px; border: 1px solid rgba(142,123,234,.25); border-radius: 24px; background: linear-gradient(125deg, #eee9ff 0%, #fbfaf5 55%, #fff0e9 100%); overflow: hidden; }
.meditation-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: 18%; bottom: -150px; border: 24px solid rgba(142,123,234,.08); border-radius: 50%; pointer-events: none; }
.meditation-orb { --tm-progress: 0%; width: 92px; height: 92px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--violet) var(--tm-progress), rgba(142,123,234,.15) 0); box-shadow: 0 12px 30px rgba(142,123,234,.18); transition: background .35s ease; }
.meditation-orb::before { content: ""; grid-area: 1 / 1; width: 72px; height: 72px; border-radius: 50%; background: var(--white); }
.meditation-orb > span { z-index: 1; grid-area: 1 / 1; display: flex; align-items: baseline; }
.meditation-orb strong { font-family: "Fraunces", serif; font-size: 35px; line-height: 1; }
.meditation-orb small { color: var(--muted); font-size: 11px; font-weight: 700; }
.meditation-copy h2 { max-width: 280px; font-size: clamp(23px,2.2vw,31px); }
.meditation-copy > p:last-child { max-width: 310px; margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.meditation-rhythm { position: relative; z-index: 1; display: grid; gap: 13px; }
.meditation-session-track { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meditation-session { min-height: 43px; display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid rgba(142,123,234,.2); border-radius: 12px; color: #756d86; background: rgba(255,255,255,.55); }
.meditation-session svg { width: 15px; }
.meditation-session small { font-size: 9px; font-weight: 700; }
.meditation-session.is-done { color: var(--white); background: var(--violet); border-color: var(--violet); }
.meditation-history-wrap > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.meditation-history { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; }
.meditation-day { min-width: 0; display: grid; grid-template-columns: 1fr 7px 7px; align-items: center; gap: 3px; padding: 5px 6px; border-radius: 7px; background: rgba(255,255,255,.62); }
.meditation-day small { color: var(--muted); font-size: 8px; font-weight: 700; }
.meditation-day i { width: 7px; height: 7px; border: 1px solid rgba(142,123,234,.32); border-radius: 50%; }
.meditation-day.is-started i:first-of-type, .meditation-day.is-complete i { background: var(--violet); border-color: var(--violet); }
.meditation-actions { position: relative; z-index: 1; display: grid; gap: 7px; min-width: 165px; }
.meditation-actions button { min-height: 40px; padding: 0 13px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 10px; font-weight: 700; cursor: pointer; }
.meditation-actions button svg { width: 14px; }
.meditation-log { border: 0; color: var(--white); background: var(--ink); }
.meditation-undo { border: 1px solid rgba(23,61,43,.18); background: rgba(255,255,255,.55); }
.meditation-actions button:disabled { opacity: .42; cursor: default; }

.alcohol-card { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(190px,.7fr) minmax(320px,1.25fr) auto; align-items: center; gap: 24px; padding: 26px 28px; border-radius: 24px; color: var(--white); background: var(--ink-deep); }
.alcohol-symbol { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px 18px 6px 18px; color: var(--ink-deep); background: var(--lime); }
.alcohol-symbol svg { width: 28px; height: 28px; }
.alcohol-copy .eyebrow { color: #9eb2a7; }
.alcohol-total { display: flex; align-items: center; gap: 12px; }
.alcohol-total strong { font-family: "Fraunces", serif; font-size: 50px; line-height: .85; letter-spacing: -3px; }
.alcohol-total span { color: #b8c8bf; font-size: 11px; line-height: 1.25; }
.alcohol-copy > p:last-child { margin: 8px 0 0; color: #91a69b; font-size: 9px; }
.alcohol-history-wrap > span { display: block; margin-bottom: 9px; color: #91a69b; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.alcohol-history { display: grid; grid-template-columns: repeat(14, minmax(13px,1fr)); gap: 5px; }
.alcohol-day { height: 24px; display: grid; place-items: center; border-radius: 5px; color: #70857a; background: rgba(255,255,255,.08); font-size: 8px; font-weight: 700; }
.alcohol-day.is-clear { color: var(--ink-deep); background: var(--lime); }
.alcohol-day.had-drink { color: var(--white); background: var(--coral); }
.alcohol-legend { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 9px; color: #91a69b; font-size: 8px; }
.alcohol-legend span { display: inline-flex; align-items: center; gap: 4px; }
.alcohol-legend i { width: 7px; height: 7px; border-radius: 2px; background: rgba(255,255,255,.12); }
.alcohol-legend i.clear { background: var(--lime); }
.alcohol-legend i.drink { background: var(--coral); }
.alcohol-actions { display: grid; gap: 8px; min-width: 175px; }
.alcohol-actions button { min-height: 40px; padding: 0 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--white); background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.alcohol-actions button svg { width: 14px; }
.alcohol-actions button:hover { border-color: rgba(255,255,255,.35); }
.alcohol-actions button[aria-pressed="true"] { color: var(--ink-deep); background: var(--lime); border-color: var(--lime); }
.alcohol-actions #mark-had-drink[aria-pressed="true"] { color: var(--white); background: var(--coral); border-color: var(--coral); }

.micro-section { margin-top: 48px; padding: clamp(24px,3vw,38px); border: 1px solid var(--line); border-radius: 30px; background: var(--white); }
.micro-heading { align-items: center; }
.micro-reference-button { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; display: inline-flex; align-items: center; gap: 7px; color: var(--ink); background: var(--paper-2); font-size: 10px; font-weight: 700; cursor: pointer; }
.micro-reference-button svg { width: 15px; }
.micro-summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 15px; background: var(--lime-soft); }
.micro-summary-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; color: var(--white); background: var(--ink); }
.micro-summary-icon svg { width: 17px; }
.micro-summary strong, .micro-summary small { display: block; }
.micro-summary strong { font-size: 12px; }
.micro-summary small { margin-top: 2px; color: #59665f; font-size: 9px; }
.micro-summary-percent { font-family: "Fraunces", serif; font-size: 19px; font-weight: 700; }
.micro-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin-top: 28px; }
.micro-group + .micro-group { padding-left: 34px; border-left: 1px solid var(--line); }
.micro-group h3 { margin: 0 0 15px; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.micro-group h3 svg { width: 16px; color: var(--coral); }
.micro-list { display: grid; gap: 13px; }
.micro-row-head { display: grid; grid-template-columns: 1fr auto 40px; align-items: baseline; gap: 10px; }
.micro-row-head strong { font-size: 10px; }
.micro-row-head span { color: var(--muted); font-size: 8px; }
.micro-row-head b { text-align: right; color: var(--muted); font-size: 9px; }
.micro-row.is-met .micro-row-head b { color: var(--ink); }
.micro-bar { height: 5px; margin-top: 5px; border-radius: 999px; background: #ebece5; overflow: hidden; }
.micro-bar span { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .5s ease; }
.micro-row.is-near .micro-bar span { background: var(--yellow); }
.micro-row.is-met .micro-bar span { background: var(--lime); }
.micro-note { display: flex; gap: 7px; align-items: flex-start; margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.45; }
.micro-note svg { width: 14px; flex: 0 0 auto; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 22px; background: rgba(10,30,21,.72); backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(680px, 100%); max-height: calc(100vh - 44px); overflow: auto; padding: clamp(28px, 5vw, 48px); border-radius: 28px; background: var(--paper-2); box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.modal-close { position: absolute; top: 18px; right: 18px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.modal-close svg { width: 17px; }
.modal-kicker { display: flex; align-items: center; gap: 7px; margin-bottom: 15px; color: var(--ink); font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.modal-kicker svg { width: 15px; color: var(--coral); }
.auth-modal { max-width: 560px; }
.social-auth-actions { display: grid; gap: 9px; margin-top: 24px; }
.social-auth-button { min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: 24px 1fr 24px; align-items: center; color: var(--ink-deep); background: var(--white); font-size: 12px; font-weight: 700; cursor: pointer; }
.social-auth-button:disabled { cursor: wait; opacity: .62; }
.provider-mark { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 800; }
.apple-mark { position: relative; color: #111; font-size: 18px; line-height: 1; }
.apple-mark::after { content: ""; position: absolute; width: 5px; height: 3px; top: 1px; right: 3px; border-radius: 100% 0; background: #111; transform: rotate(-28deg); }
.google-mark { border: 1px solid #d7d9d4; color: #4285f4; background: #fff; font-family: Arial, sans-serif; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.auth-form { margin-top: 0; }
.auth-form > label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.auth-form > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.auth-form input { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper-2); }
.auth-form .primary-button { min-height: 44px; border: 0; }
.auth-status { margin: 12px 0 0; color: var(--muted); font-size: 10px; }
.data-privacy-panel { margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper-2); }
.data-privacy-panel strong, .data-privacy-panel small { display: block; }
.data-privacy-panel strong { font-size: 13px; }
.data-privacy-panel small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.data-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.data-actions button { min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; gap: 6px; background: var(--white); font-size: 9px; font-weight: 700; cursor: pointer; }
.data-actions button svg, .data-privacy-panel > a svg { width: 13px; }
.data-actions .danger-button { color: #9f3326; }
.data-privacy-panel > a { margin-top: 12px; display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-size: 9px; font-weight: 700; }
.modal h2 { max-width: 520px; font-size: clamp(32px, 5vw, 46px); }
.modal > p:not(.eyebrow) { max-width: 550px; margin: 14px 0 28px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.profile-form { display: grid; gap: 19px; }
.form-grid { display: grid; gap: 10px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.profile-form label, .custom-food-form label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.profile-form label > span { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); }
.profile-form input[type="number"] { width: 100%; min-width: 0; padding: 11px 0; border: 0; background: transparent; color: var(--ink-deep); font-weight: 700; }
.profile-form .profile-name-field input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-deep); background: var(--white); font-weight: 700; }
.profile-form input:focus { outline: 0; }
.select-label select, .custom-food-form input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-deep); background: var(--white); }
.range-label > span { display: flex !important; justify-content: space-between; padding: 0 !important; border: 0 !important; background: transparent !important; }
.range-label strong { color: var(--ink-deep); }
.range-label input { width: 100%; accent-color: var(--ink); }
.range-label small { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; font-weight: 500; }
.form-note { margin: -2px 0 18px; padding: 10px 12px; border-radius: 10px; display: flex; align-items: flex-start; gap: 8px; color: var(--muted); background: #f0efe8; font-size: 9px; line-height: 1.5; }
.form-note svg { width: 14px; flex: 0 0 auto; }
.calculation-preview { display: grid; grid-template-columns: 1fr auto .7fr auto 1fr; align-items: center; gap: 10px; padding: 15px; border-radius: 14px; color: var(--white); background: var(--ink-deep); }
.calculation-preview > svg { width: 14px; color: #84978d; }
.calculation-preview small, .calculation-preview strong { display: block; }
.calculation-preview small { margin-bottom: 3px; color: #93a69c; font-size: 9px; }
.calculation-preview strong { font-size: 14px; }
.calculation-preview .preview-result { padding-left: 13px; border-left: 1px solid rgba(255,255,255,.12); }
.calculation-preview .preview-result strong { color: var(--lime); }
.calculation-preview abbr { text-decoration: none; cursor: help; }
.goal-glossary { border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.goal-glossary summary { padding: 12px 14px; color: var(--ink-deep); cursor: pointer; font-size: 10px; font-weight: 700; }
.goal-glossary > div { padding: 0 14px 12px; }
.goal-glossary p { margin: 7px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.goal-glossary a, .micro-note a, .meditation-copy .eyebrow a { color: inherit; text-decoration: underline; text-decoration-color: rgba(23,61,43,.35); text-underline-offset: 2px; }
.billing-panel { margin-top: 22px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(135deg, var(--lime-soft), var(--white)); }
.billing-heading { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 12px; }
.billing-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); background: var(--lime); }
.billing-icon svg { width: 17px; }
.billing-heading h3 { margin: 2px 0 4px; font-family: "Fraunces", serif; font-size: 18px; }
.billing-heading p:not(.eyebrow) { max-width: 420px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.billing-usage { padding: 6px 8px; border-radius: 20px; white-space: nowrap; color: var(--ink); background: var(--white); font-size: 8px; font-weight: 700; }
.billing-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 14px; }
.billing-actions button { padding: 11px; border: 1px solid var(--line); border-radius: 11px; display: flex; align-items: center; gap: 9px; text-align: left; color: var(--ink-deep); background: var(--white); cursor: pointer; }
.billing-actions button:hover { border-color: var(--ink); }
.billing-actions button:disabled { cursor: wait; opacity: .55; }
.billing-actions button.recommended { border-color: var(--ink); }
.billing-actions svg { width: 15px; color: var(--ink); }
.billing-actions span, .billing-actions strong, .billing-actions small { display: block; }
.billing-actions strong { font-size: 9px; }
.billing-actions small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.billing-actions #manage-billing { grid-column: 1 / -1; }
.billing-note { margin: 10px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }

.food-modal { width: min(670px, 100%); }
.food-modal-intro { margin-bottom: 22px !important; }
.url-import-form, .database-search-form { display: grid; gap: 7px; }
.url-import-form > label, .database-search-form > label { color: var(--muted); font-size: 10px; font-weight: 700; }
.url-import-control, .database-search-control { display: grid; grid-template-columns: auto 1fr auto; align-items: center; border: 1px solid var(--ink); border-radius: 13px; background: var(--white); overflow: hidden; }
.url-import-control > svg, .database-search-control > svg { width: 16px; margin-left: 13px; color: var(--muted); }
.url-import-control input, .database-search-control input { min-width: 0; padding: 13px 10px; border: 0; background: transparent; }
.url-import-control input:focus, .database-search-control input:focus { outline: 0; }
.url-import-control button, .database-search-control button { align-self: stretch; border: 0; padding: 0 15px; display: inline-flex; align-items: center; gap: 7px; color: var(--white); background: var(--ink); font-size: 11px; font-weight: 700; cursor: pointer; }
.url-import-control button svg, .database-search-control button svg { width: 14px; }
.url-import-control button:disabled, .database-search-control button:disabled { cursor: wait; opacity: .68; }
.import-status { margin: 1px 0 0 !important; color: var(--muted); font-size: 9px !important; }
.import-status.is-error { color: #ad3b2b; }
.database-results { display: grid; gap: 8px; margin-top: 12px; }
.database-results[hidden] { display: none; }
.database-result { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 13px; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; text-align: left; color: var(--ink-deep); background: var(--white); cursor: pointer; }
.database-result:hover { border-color: var(--ink); transform: translateY(-1px); }
.database-result-image { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 10px; overflow: hidden; color: var(--ink); background: var(--lime-soft); font-size: 20px; }
.database-result-image img { width: 100%; height: 100%; object-fit: contain; background: var(--white); }
.database-result-copy strong, .database-result-copy span, .database-result-copy small { display: block; }
.database-result-copy strong { font-size: 11px; }
.database-result-copy span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.database-result-copy small { margin-top: 4px; color: #647068; font-size: 8px; }
.database-result-nutrition { text-align: right; white-space: nowrap; }
.database-result-nutrition strong { display: block; font-size: 11px; }
.database-result-nutrition small { color: var(--muted); font-size: 8px; }
.photo-import-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.photo-import-card { position: relative; min-height: 142px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; display: grid; align-content: start; gap: 7px; color: var(--ink-deep); background: var(--white); cursor: pointer; transition: border-color .2s ease, transform .2s ease, opacity .2s ease; }
.photo-import-card:hover { border-color: var(--ink); transform: translateY(-1px); }
.photo-import-card.is-busy { pointer-events: none; opacity: .55; }
.photo-import-card > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--ink); background: var(--lime-soft); }
.photo-import-card > span svg { width: 16px; }
.photo-import-card strong { font-size: 11px; }
.photo-import-card small { color: var(--muted); font-size: 8px; line-height: 1.5; }
.photo-import-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-status { margin-top: 8px !important; }
.source-disclosure { margin: 7px 0 0 !important; color: var(--muted); font-size: 8px !important; line-height: 1.45; }
.source-disclosure a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.food-empty-state { grid-column: 1 / -1; min-height: 170px; padding: 28px; border: 1px dashed #bfc9c1; border-radius: 20px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; background: linear-gradient(135deg, rgba(239,247,226,.72), rgba(255,255,255,.9)); }
.food-empty-state .food-empty-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: var(--ink); background: var(--lime); }
.food-empty-state .food-empty-icon svg { width: 22px; }
.food-empty-state strong { display: block; font-family: "Fraunces", serif; font-size: 18px; }
.food-empty-state p { max-width: 500px; margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.food-empty-state .primary-button { white-space: nowrap; }
.import-preview { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; margin-top: 14px; padding: 10px; border-radius: 13px; background: var(--lime-soft); }
.import-preview[hidden] { display: none; }
.import-preview img { width: 56px; height: 56px; object-fit: contain; border-radius: 9px; background: var(--white); mix-blend-mode: multiply; }
.import-preview strong, .import-preview span { display: block; }
.import-preview strong { font-size: 12px; }
.import-preview span { margin-top: 3px; color: #526259; font-size: 9px; }
.import-preview > svg { width: 19px; color: var(--ink); }
.review-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 13px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.review-divider::before, .review-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.custom-food-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin-top: 0; }
.custom-food-form .wide { grid-column: 1 / -1; }
.optional { color: #99a09c; font-weight: 400; }
.micro-editor { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.micro-editor summary { padding: 13px 2px; display: flex; align-items: center; justify-content: space-between; list-style: none; color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 700; }
.micro-editor summary::-webkit-details-marker { display: none; }
.micro-editor summary span { display: flex; align-items: baseline; gap: 7px; }
.micro-editor summary small { color: var(--muted); font-size: 9px; font-weight: 500; }
.micro-editor summary svg { width: 15px; transition: transform .2s ease; }
.micro-editor[open] summary svg { transform: rotate(180deg); }
.micro-input-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 2px 0 15px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translate(-50%, 20px); padding: 11px 16px; border-radius: 10px; color: var(--white); background: var(--ink-deep); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .food-grid { grid-template-columns: repeat(3, 1fr); }
  .energy-strip { grid-template-columns: 1.25fr .9fr 1fr; }
  .energy-strip .text-button { display: none; }
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 82px minmax(0,1fr); }
  .sidebar { padding: 28px 15px 20px; align-items: center; }
  .brand > span:last-child, .nav-item span, .streak-card, .profile-chip > span:not(.avatar), .profile-chip > svg { display: none; }
  .primary-nav { width: 100%; margin-top: 44px; }
  .nav-item { justify-content: center; padding: 13px; }
  .profile-chip { margin-top: auto; grid-template-columns: 38px; }
  .hero-grid, .lower-grid { grid-template-columns: 1fr; }
  .energy-strip { grid-template-columns: 1.2fr 1fr 1fr; }
  .alcohol-card { grid-template-columns: auto 1fr; }
  .alcohol-history-wrap, .alcohol-actions { grid-column: 1 / -1; }
  .alcohol-actions { grid-template-columns: 1fr 1fr; }
  .meditation-card { grid-template-columns: auto 1fr; }
  .meditation-rhythm, .meditation-actions { grid-column: 1 / -1; }
  .meditation-actions { grid-template-columns: 1fr auto; }
  .workout-card { grid-template-columns: auto 1fr; }
  .workout-history-wrap, .workout-actions { grid-column: 1 / -1; }
  .workout-actions { grid-template-columns: 1fr auto; }
  .journal-card { grid-template-columns: auto 1fr; }
  .journal-history-wrap, .journal-actions { grid-column: 1 / -1; }
  .journal-actions { grid-template-columns: 1fr auto; }
  .micro-groups { grid-template-columns: 1fr; }
  .micro-group + .micro-group { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 680px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 70px; padding: 8px 16px; flex-direction: row; border-top: 1px solid rgba(255,255,255,.1); }
  .brand, .profile-chip { display: none; }
  .primary-nav { grid-template-columns: repeat(4, 1fr); margin: 0; gap: 4px; }
  .nav-item { height: 52px; padding: 0; }
  .nav-item svg { width: 20px; }
  .main-content { padding: 28px 16px 100px; }
  .topbar { align-items: center; margin-bottom: 23px; }
  .topbar-actions .date-button { display: none; }
  .cloud-button span { display: none; }
  .cloud-button { width: 40px; padding: 0; justify-content: center; border-radius: 50%; }
  .mobile-settings { display: grid; }
  .energy-strip { grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px; }
  .energy-copy { grid-column: 1 / -1; }
  .energy-metric { padding-left: 0; border-left: 0; }
  .protein-panel, .macro-panel { min-height: 0; padding: 23px 20px; border-radius: 22px; }
  .gauge-center { bottom: 22px; }
  .gauge-center strong { font-size: 47px; }
  .protein-footer { grid-template-columns: 1fr; }
  .macro-legend { grid-template-columns: 1fr 1fr; }
  .food-section, .lower-grid { padding-top: 36px; }
  .habit-manifesto { margin-top: 38px; padding: 24px 20px; }
  .food-grid { grid-template-columns: repeat(2, 1fr); }
  .food-image { height: 125px; }
  .today-log, .weight-card { padding: 22px 4px; }
  .workout-card { grid-template-columns: 1fr; gap: 18px; padding: 24px 20px; }
  .workout-symbol { width: 52px; height: 52px; }
  .workout-copy, .workout-history-wrap, .workout-actions { grid-column: 1; }
  .workout-actions { grid-template-columns: 1fr; }
  .workout-history { gap: 4px; }
  .workout-day { height: 22px; }
  .journal-card { grid-template-columns: 1fr; gap: 18px; padding: 24px 20px; }
  .journal-symbol { width: 52px; height: 52px; }
  .journal-copy, .journal-history-wrap, .journal-actions { grid-column: 1; }
  .journal-actions { grid-template-columns: 1fr; }
  .journal-history { gap: 4px; }
  .journal-day { height: 22px; }
  .meditation-card { grid-template-columns: 1fr; gap: 18px; padding: 24px 20px; }
  .meditation-orb { width: 82px; height: 82px; }
  .meditation-orb::before { width: 64px; height: 64px; }
  .meditation-rhythm, .meditation-actions { grid-column: 1; }
  .meditation-actions { grid-template-columns: 1fr; }
  .meditation-day { grid-template-columns: 1fr 6px 6px; gap: 2px; padding: 5px 4px; }
  .meditation-day i { width: 6px; height: 6px; }
  .alcohol-card { grid-template-columns: 1fr; gap: 18px; padding: 24px 20px; }
  .alcohol-symbol { width: 52px; height: 52px; }
  .alcohol-copy, .alcohol-history-wrap, .alcohol-actions { grid-column: 1; }
  .alcohol-actions { grid-template-columns: 1fr; }
  .alcohol-history { gap: 4px; }
  .alcohol-day { height: 22px; }
  .micro-section { margin-top: 36px; padding: 24px 20px; border-radius: 22px; }
  .micro-heading { align-items: flex-start; }
  .micro-reference-button { width: 100%; justify-content: center; }
  .micro-summary { grid-template-columns: auto 1fr; }
  .micro-summary-percent { grid-column: 2; }
  .micro-input-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid.three { grid-template-columns: 1fr; }
  .custom-food-form { grid-template-columns: 1fr 1fr; }
  .modal { padding: 32px 20px 24px; border-radius: 22px; }
  .auth-form > div { grid-template-columns: 1fr; }
  .database-search-control, .url-import-control { grid-template-columns: auto 1fr; }
  .database-search-control button, .url-import-control button { grid-column: 1 / -1; min-height: 44px; justify-content: center; }
  .database-result { grid-template-columns: 42px 1fr; }
  .database-result-image { width: 42px; height: 42px; }
  .database-result-nutrition { grid-column: 2; text-align: left; }
  .photo-import-grid { grid-template-columns: 1fr; }
  .billing-heading { grid-template-columns: auto 1fr; }
  .billing-usage { grid-column: 2; justify-self: start; }
  .billing-actions { grid-template-columns: 1fr; }
  .food-empty-state { grid-template-columns: auto 1fr; padding: 22px 18px; }
  .food-empty-state .primary-button { grid-column: 1 / -1; justify-content: center; }
  .icon-button, .cloud-button, .micro-reference-button, .weight-form button, .stepper button, .alcohol-actions button, .workout-actions button, .journal-actions button, .meditation-actions button { min-width: 44px; min-height: 44px; }
  .icon-button, .cloud-button { width: 44px; height: 44px; }
  .calculation-preview { grid-template-columns: 1fr auto .6fr; }
  .calculation-preview > svg:nth-of-type(2), .calculation-preview .preview-result { display: none; }
}

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