:root {
  --ink: #172825;
  --ink-soft: #5f716b;
  --muted: #8a9993;
  --paper: #f6f7f3;
  --panel: #ffffff;
  --line: #e5eae4;
  --line-dark: #d7e0d9;
  --forest: #173b32;
  --forest-2: #245548;
  --mint: #d9eadd;
  --mint-strong: #97c2aa;
  --gold: #eab968;
  --coral: #df806b;
  --blue: #80aaca;
  --shadow: 0 20px 55px rgba(23, 40, 37, 0.08);
  --shadow-small: 0 8px 24px rgba(23, 40, 37, 0.07);
  --radius-lg: 25px;
  --radius-md: 17px;
  --radius-sm: 11px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 84% 9%, rgba(218, 234, 221, 0.52), transparent 27rem),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  cursor: pointer;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(87, 155, 126, 0.38);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  width: min(1370px, calc(100% - 48px));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--forest);
  box-shadow: 0 6px 18px rgba(23, 59, 50, 0.2);
}

.brand-mark svg {
  width: 26px;
  height: 26px;
  fill: #bad9c1;
}

.brand-mark .brand-stroke {
  fill: none;
  stroke: var(--forest);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 17px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-copy small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.17em;
  line-height: 1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-status {
  margin-left: auto;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  background: #f7f9f6;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.sync-status::before {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  display: inline-block;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

.sync-status.saved {
  color: var(--forest-2);
  background: var(--mint);
}

.sync-status.saved::before {
  background: #4f9c71;
}

.sync-status.saving,
.sync-status.loading {
  color: #8a6b33;
  background: #fff6dc;
}

.sync-status.saving::before,
.sync-status.loading::before {
  background: var(--gold);
}

.sync-status.locked,
.sync-status.error {
  color: #a25d4d;
  background: #fae9e4;
}

.sync-status.locked::before,
.sync-status.error::before {
  background: var(--coral);
}

.text-button,
.button,
.icon-button,
.circle-button,
.today-button,
.link-button,
.modal-close {
  border: 0;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.text-button {
  padding: 10px 9px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.text-button span {
  margin-right: 4px;
  color: var(--forest-2);
  font-size: 16px;
  font-weight: 900;
}

.text-button:hover {
  color: var(--forest);
  transform: translateY(-1px);
}

.button {
  min-height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 8px 18px rgba(23, 59, 50, 0.17);
}

.button-primary:hover {
  background: #235648;
  box-shadow: 0 10px 23px rgba(23, 59, 50, 0.23);
}

.button-light {
  min-height: 39px;
  padding: 0 15px;
  color: var(--ink);
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 3px 8px rgba(23, 40, 37, 0.03);
}

.button-light:hover {
  border-color: var(--mint-strong);
  background: #fff;
}

.button-ghost {
  color: var(--ink-soft);
  background: var(--paper);
}

.button-ghost:hover {
  color: var(--ink);
  background: var(--line);
}

.page-content {
  width: min(1370px, calc(100% - 48px));
  margin: 0 auto;
  padding: 52px 0 28px;
}

.hero {
  min-height: 245px;
  padding: 0 20px 50px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.eyebrow,
.section-kicker,
.date-label,
.tools-label {
  margin: 0;
  color: var(--forest-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(223, 128, 107, 0.13);
}

.hero h1 {
  max-width: 610px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(39px, 5vw, 68px);
  font-weight: 800;
  letter-spacing: -0.075em;
  line-height: 0.99;
}

.hero h1 em {
  color: var(--forest-2);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.06em;
}

.hero-text {
  max-width: 545px;
  margin: 21px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.date-control {
  min-width: 292px;
  min-height: 76px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(215, 224, 217, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-small);
}

.circle-button {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: var(--mint);
  font-size: 21px;
  line-height: 1;
}

.circle-button:hover {
  background: var(--mint-strong);
  transform: scale(1.05);
}

.date-display {
  min-width: 122px;
  flex: 1;
  position: relative;
  display: grid;
  gap: 4px;
}

.date-display strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.date-display input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.today-button {
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.today-button:hover {
  color: var(--forest);
  background: var(--mint);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.85fr);
  align-items: start;
  gap: 22px;
}

.main-column,
.sidebar {
  min-width: 0;
  display: grid;
  gap: 22px;
}

.panel {
  border: 1px solid rgba(224, 231, 225, 0.92);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.add-panel {
  min-height: 425px;
  padding: 31px 32px 27px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 23px;
  letter-spacing: -0.055em;
  line-height: 1.1;
}

.section-description {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.source-pill {
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #dce9df;
  border-radius: 100px;
  color: #47715c;
  background: #f1f8f2;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.source-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5eaf78;
  box-shadow: 0 0 0 3px rgba(94, 175, 120, 0.13);
}

.search-form {
  margin-top: 28px;
  display: flex;
  gap: 10px;
}

.search-box {
  min-height: 49px;
  flex: 1;
  min-width: 0;
  padding: 0 12px 0 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  background: #fafcf9;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.search-box:focus-within {
  border-color: var(--mint-strong);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(151, 194, 170, 0.17);
}

.search-icon {
  color: var(--forest-2);
  font-size: 24px;
  line-height: 1;
  transform: rotate(-20deg);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.search-box input::placeholder {
  color: #9aa7a0;
}

kbd {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: #fff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.search-form .button {
  min-width: 120px;
}

.search-tools {
  margin-top: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.tools-label {
  margin-right: 3px;
  color: var(--muted);
  font-size: 9px;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-tag {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink-soft);
  background: #fbfcfa;
  font-size: 11px;
  font-weight: 700;
}

.quick-tag:hover {
  border-color: var(--mint-strong);
  color: var(--forest);
  background: var(--mint);
  transform: translateY(-1px);
}

.link-button {
  margin-left: auto;
  padding: 7px 0;
  color: var(--forest-2);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.link-button:hover {
  color: var(--coral);
}

.search-status {
  min-height: 24px;
  margin-top: 19px;
  color: var(--ink-soft);
  font-size: 12px;
}

.search-status.loading::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-right: 7px;
  display: inline-block;
  vertical-align: -2px;
  border: 2px solid var(--mint-strong);
  border-top-color: var(--forest-2);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.search-status.error {
  color: #a04d3f;
}

.search-status.success {
  color: #47715c;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.search-results {
  min-height: 82px;
}

.search-empty {
  min-height: 78px;
  padding: 17px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px dashed #d9e5db;
  border-radius: 14px;
  color: var(--ink-soft);
  background: #fbfdfb;
}

.empty-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #5a9273;
  background: var(--mint);
  font-size: 17px;
}

.search-empty strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.search-empty p {
  margin: 4px 0 0;
  font-size: 12px;
}

.result-list {
  display: grid;
  gap: 8px;
}

.food-result {
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  animation: rise-in 220ms ease both;
}

.food-result:hover {
  border-color: var(--mint-strong);
  box-shadow: 0 7px 18px rgba(23, 59, 50, 0.06);
}

.food-result-main {
  min-width: 0;
  flex: 1;
}

.result-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.food-result h3 {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-type {
  padding: 3px 6px;
  border-radius: 5px;
  color: #6b7a72;
  background: #f0f3ef;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.food-result p {
  max-width: 100%;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-kcal {
  min-width: 58px;
  color: var(--forest-2);
  font-size: 11px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.result-kcal small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.result-add {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--forest);
  background: var(--mint);
  font-size: 11px;
  font-weight: 900;
}

.result-add:hover {
  background: var(--mint-strong);
  transform: translateY(-1px);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.log-panel {
  min-height: 300px;
  padding: 29px 32px 27px;
}

.log-heading {
  align-items: center;
}

.entry-count,
.nutrient-count {
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--muted);
  background: #f7f9f6;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.day-log {
  margin-top: 23px;
  display: grid;
  gap: 21px;
}

.meal-group {
  display: grid;
  gap: 8px;
}

.meal-heading {
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf0ec;
}

.meal-heading-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meal-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--forest-2);
  background: var(--mint);
  font-size: 12px;
}

.meal-heading strong {
  font-size: 12px;
  letter-spacing: -0.01em;
}

.meal-kcal {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.log-entry {
  min-height: 54px;
  padding: 10px 5px 10px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f0f2ef;
}

.entry-bullet {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--coral);
}

.entry-copy {
  min-width: 0;
  flex: 1;
}

.entry-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-copy span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-macros {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 10px;
  white-space: nowrap;
}

.entry-macros b {
  color: var(--ink);
  font-weight: 800;
}

.entry-kcal {
  min-width: 61px;
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.entry-actions {
  display: flex;
  gap: 2px;
}

.entry-action {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.entry-action:hover {
  color: var(--forest);
  background: var(--mint);
}

.entry-action.delete:hover {
  color: #ad5848;
  background: #f9e8e3;
}

.log-empty {
  padding: 39px 20px;
  display: grid;
  place-items: center;
  border: 1px dashed #d9e5db;
  border-radius: 15px;
  color: var(--ink-soft);
  background: #fbfdfb;
  text-align: center;
}

.log-empty-icon {
  width: 43px;
  height: 43px;
  margin-bottom: 11px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--forest-2);
  background: var(--mint);
  font-size: 19px;
}

.log-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.log-empty p {
  margin: 6px 0 0;
  font-size: 12px;
}

.demo-load-button {
  min-height: 35px;
  margin-top: 16px;
  padding: 0 13px;
  font-size: 11px;
}

.insight-grid {
  display: grid;
  grid-template-columns: minmax(235px, 0.82fr) minmax(370px, 1.18fr);
  gap: 22px;
}

.water-panel,
.week-panel {
  min-width: 0;
  padding: 27px 27px 24px;
}

.insight-description {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.water-overview {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.water-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #4b8ca1;
  background: #e3f2f5;
  font-size: 23px;
  font-weight: 700;
}

.water-overview strong,
.water-overview span {
  display: block;
}

.water-overview strong {
  color: var(--ink);
  font-size: 17px;
  letter-spacing: -0.04em;
}

.water-overview span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.water-track {
  height: 7px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 100px;
  background: #eaf2f3;
}

.water-progress {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #6ca7b7;
  transition: width 300ms ease;
}

.water-glasses {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}

.water-glass {
  min-width: 0;
  height: 29px;
  padding: 0;
  border: 1px solid #dbecef;
  border-radius: 7px;
  color: #86b9c6;
  background: #f6fbfc;
  font-size: 15px;
  line-height: 1;
}

.water-glass:hover,
.water-glass.filled {
  border-color: #92c5cf;
  color: #fff;
  background: #6ca7b7;
  transform: translateY(-1px);
}

.water-reset {
  margin-top: 11px;
  color: #6b8f99;
  font-size: 10px;
}

.week-summary {
  margin-top: 22px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.week-summary strong {
  color: var(--forest-2);
  font-size: 19px;
  letter-spacing: -0.04em;
}

.week-summary span {
  color: var(--muted);
  font-size: 10px;
}

.week-chart {
  min-height: 122px;
  margin-top: 14px;
  padding: 10px 3px 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.week-bar-item {
  min-width: 0;
  height: 105px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  justify-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.week-bar-item.current {
  color: var(--forest-2);
}

.week-bar-track {
  width: 100%;
  max-width: 26px;
  height: 74px;
  display: flex;
  align-items: end;
  overflow: hidden;
  border-radius: 7px 7px 3px 3px;
  background: #f1f5f1;
}

.week-bar-fill {
  width: 100%;
  min-height: 0;
  border-radius: 7px 7px 3px 3px;
  background: #c5dec9;
  transition: height 300ms ease;
}

.week-bar-item.current .week-bar-fill {
  background: var(--forest-2);
}

.week-bar-item span {
  font-size: 9px;
  font-weight: 900;
}

.week-bar-item small {
  min-height: 11px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.week-legend {
  margin-top: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
}

.week-legend span:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
}

.week-legend i {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--forest-2);
}

.balance-panel,
.nutrients-panel {
  padding: 27px 27px 25px;
}

.compact-heading {
  align-items: center;
}

.compact-heading h2 {
  font-size: 20px;
}

.icon-button {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  color: var(--ink-soft);
  background: #f3f7f2;
  font-size: 14px;
}

.icon-button:hover {
  color: var(--forest);
  background: var(--mint);
  transform: rotate(-8deg);
}

.calorie-summary {
  margin-top: 27px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.calorie-ring {
  width: 142px;
  height: 142px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--forest-2) var(--progress), #e9f0e9 0deg);
  transform: rotate(-35deg);
}

.calorie-ring-inner {
  width: 113px;
  height: 113px;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: #fff;
  text-align: center;
  transform: rotate(35deg);
}

.calorie-ring-inner strong {
  color: var(--ink);
  font-size: 26px;
  letter-spacing: -0.07em;
  line-height: 1;
}

.calorie-ring-inner span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.calorie-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.calorie-copy > strong {
  color: var(--forest-2);
  font-size: 19px;
  letter-spacing: -0.04em;
}

.calorie-copy > span {
  color: var(--ink-soft);
  font-size: 11px;
}

.calorie-goal {
  margin-top: 11px;
  color: var(--muted);
  font-size: 10px;
}

.calorie-goal b {
  color: var(--ink-soft);
}

.macro-list {
  margin-top: 28px;
  display: grid;
  gap: 17px;
}

.macro-row {
  display: grid;
  gap: 7px;
}

.macro-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.macro-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.macro-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.macro-dot.protein { background: var(--coral); }
.macro-dot.carbs { background: var(--gold); }
.macro-dot.fat { background: var(--blue); }
.macro-dot.fiber { background: var(--mint-strong); }

.macro-amount {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.macro-amount span {
  color: var(--muted);
  font-weight: 700;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 100px;
  background: #edf1ed;
}

.progress-fill {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  transition: width 350ms ease;
}

.progress-fill.protein { background: var(--coral); }
.progress-fill.carbs { background: var(--gold); }
.progress-fill.fat { background: var(--blue); }
.progress-fill.fiber { background: var(--mint-strong); }

.nutrient-groups {
  margin-top: 23px;
  display: grid;
  gap: 22px;
}

.nutrient-group {
  display: grid;
  gap: 0;
}

.nutrient-group-title {
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nutrient-row {
  min-height: 31px;
  padding: 7px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid #f0f2ef;
}

.nutrient-name {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.3;
}

.nutrient-name small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 9px;
}

.nutrient-value {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.nutrient-empty {
  padding: 17px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.performance-panel {
  padding: 27px 27px 25px;
}

.performance-intro {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.performance-groups {
  margin-top: 21px;
  display: grid;
  gap: 18px;
}

.performance-group {
  display: grid;
  gap: 0;
}

.performance-group-title {
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.performance-row {
  min-height: 31px;
  padding: 7px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #f0f2ef;
}

.performance-row > span {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.3;
}

.performance-row > span small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.performance-row > strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.privacy-card {
  padding: 17px 19px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid #dce9df;
  border-radius: var(--radius-md);
  background: #edf7ee;
}

.privacy-icon {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--forest-2);
  background: #d5ebd9;
  font-size: 19px;
}

.privacy-card strong {
  display: block;
  color: var(--forest);
  font-size: 11px;
}

.privacy-card p {
  margin: 5px 0 0;
  color: #648071;
  font-size: 10px;
  line-height: 1.5;
}

.page-footer {
  padding: 24px 20px 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: var(--muted);
  font-size: 10px;
}

.page-footer a {
  color: var(--forest-2);
  font-weight: 800;
  text-decoration: none;
}

.page-footer a:hover {
  text-decoration: underline;
}

dialog.modal {
  width: min(550px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 23px;
  background: transparent;
  box-shadow: 0 30px 90px rgba(13, 34, 28, 0.23);
}

dialog.modal::backdrop {
  background: rgba(18, 35, 31, 0.48);
  backdrop-filter: blur(4px);
}

.modal-card {
  padding: 29px;
  background: #fff;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-header h2 {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 24px;
  letter-spacing: -0.06em;
}

.modal-close {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--muted);
  background: var(--paper);
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
  background: var(--mint);
  transform: rotate(90deg);
}

.selected-food-card {
  margin-top: 24px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid #dce9df;
  border-radius: 13px;
  background: #f5faf5;
}

.selected-food-icon {
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--forest-2);
  background: var(--mint);
}

.selected-food-card > div {
  min-width: 0;
  flex: 1;
}

.selected-food-card strong,
.selected-food-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-food-card strong {
  color: var(--ink);
  font-size: 12px;
}

.selected-food-card > div span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.selected-food-source {
  padding: 5px 7px;
  border-radius: 6px;
  color: #557964;
  background: #e3f0e5;
  font-size: 8px !important;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.two-columns {
  grid-template-columns: 1fr 1fr;
}

.form-grid.two-columns {
  margin-top: 21px;
}

.form-field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.form-field.full-width {
  grid-column: 1 / -1;
}

.form-field > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: #fbfcfa;
  font-size: 13px;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--mint-strong);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(151, 194, 170, 0.16);
}

.preview-heading {
  margin-top: 23px;
  padding-bottom: 9px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preview-heading small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.food-preview {
  padding: 13px 0 1px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.preview-value {
  padding: 10px 8px;
  border-radius: 9px;
  background: #f7f9f6;
}

.preview-value strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: -0.04em;
}

.preview-value span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.modal-actions {
  margin-top: 27px;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.custom-modal-card {
  width: 100%;
}

.modal-intro {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.manual-section {
  margin-top: 7px;
}

.manual-grid {
  padding-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.manual-grid .form-field {
  gap: 5px;
}

.manual-grid .form-field > span {
  font-size: 9px;
}

.manual-grid .form-field input {
  min-height: 39px;
  padding: 0 9px;
  font-size: 12px;
}

.manual-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.settings-card {
  width: 100%;
}

.settings-block {
  margin-top: 23px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfa;
}

.settings-block-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.settings-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--forest-2);
  background: var(--mint);
  font-size: 16px;
}

.settings-block-title strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.settings-block-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.settings-block > .form-field {
  margin-top: 17px;
}

.help-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.help-text a {
  color: var(--forest-2);
  font-weight: 800;
}

code {
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--forest-2);
  background: #eaf3ea;
  font-size: 10px;
}

.goal-fields {
  margin-top: 17px !important;
}

.settings-note {
  margin-top: 18px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 9px;
  color: #557964;
  background: #edf7ee;
  font-size: 10px;
  line-height: 1.4;
}

.settings-note span {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #65a576;
  font-size: 10px;
  font-weight: 900;
}

.login-card {
  width: 100%;
}

.login-field {
  margin-top: 24px;
}

.login-status {
  min-height: 20px;
  margin: 9px 0 0;
  color: #a25d4d;
  font-size: 11px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 23px;
  bottom: 23px;
  z-index: 20;
  max-width: min(390px, calc(100% - 46px));
  padding: 13px 16px;
  border: 1px solid rgba(151, 194, 170, 0.5);
  border-radius: 11px;
  color: #fff;
  background: var(--forest);
  box-shadow: 0 13px 30px rgba(23, 59, 50, 0.22);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1050px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  }

  .entry-macros {
    display: none;
  }
}

@media (max-width: 800px) {
  .topbar,
  .page-content {
    width: min(100% - 30px, 650px);
  }

  .topbar {
    min-height: 72px;
  }

  .sync-status {
    display: none;
  }

  .text-button {
    font-size: 0;
  }

  .text-button span {
    margin: 0;
    font-size: 18px;
  }

  .hero {
    min-height: auto;
    padding: 38px 6px 32px;
    display: grid;
    gap: 28px;
  }

  .date-control {
    width: 100%;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .insight-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .privacy-card {
    grid-column: 1 / -1;
  }

  .page-footer {
    padding-right: 6px;
    padding-left: 6px;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .topbar,
  .page-content {
    width: calc(100% - 24px);
  }

  .top-actions {
    gap: 1px;
  }

  .button-light {
    padding: 0 10px;
    font-size: 0;
  }

  .button-light span {
    font-size: 16px;
  }

  .hero {
    padding-top: 30px;
    padding-right: 0;
    padding-left: 0;
  }

  .hero h1 {
    font-size: 43px;
  }

  .date-control {
    min-width: 0;
  }

  .add-panel,
  .log-panel,
  .balance-panel,
  .nutrients-panel,
  .performance-panel {
    padding: 22px 18px;
  }

  .section-heading {
    display: grid;
  }

  .section-heading .source-pill {
    justify-self: start;
  }

  .search-form {
    display: grid;
  }

  .search-form .button {
    width: 100%;
  }

  kbd {
    display: none;
  }

  .link-button {
    margin-left: 0;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .water-panel,
  .week-panel {
    padding: 22px 18px;
  }

  .privacy-card {
    grid-column: auto;
  }

  .calorie-summary {
    gap: 17px;
  }

  .calorie-ring {
    width: 125px;
    height: 125px;
  }

  .calorie-ring-inner {
    width: 99px;
    height: 99px;
  }

  .calorie-ring-inner strong {
    font-size: 23px;
  }

  .food-preview {
    grid-template-columns: repeat(2, 1fr);
  }

  .manual-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-columns {
    grid-template-columns: 1fr;
  }

  .form-field.full-width {
    grid-column: auto;
  }

  .modal-card {
    padding: 22px 18px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .modal-actions .button {
    width: 100%;
    padding: 0 8px;
    font-size: 11px;
  }

  .food-result {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .result-kcal {
    order: 3;
    margin-left: 26px;
    text-align: left;
  }

  .result-add {
    order: 2;
    margin-left: auto;
  }

  .log-entry {
    gap: 8px;
  }

  .entry-kcal {
    min-width: 46px;
    font-size: 11px;
  }

  .entry-actions {
    display: grid;
  }

  .page-footer {
    display: grid;
    gap: 8px;
  }
}
