:root {
  --bg: #f4f6f0;
  --surface: #ffffff;
  --surface-soft: #f8faf6;
  --ink: #23362d;
  --ink-soft: #53675b;
  --muted: #8a978e;
  --line: #e5ebe3;
  --green: #3c7656;
  --green-dark: #28583e;
  --green-soft: #eaf3e9;
  --green-pale: #f2f7ef;
  --orange: #e9a064;
  --orange-soft: #fff1e4;
  --blue: #72a5bb;
  --blue-soft: #eaf4f7;
  --red: #ce735e;
  --shadow: 0 12px 36px rgba(40, 69, 51, 0.055);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 28px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 4%, rgba(218, 232, 205, 0.45), transparent 28%),
    radial-gradient(circle at 28% 100%, rgba(228, 239, 234, 0.5), transparent 32%),
    var(--bg);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

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

button {
  color: inherit;
}

button:not(:disabled),
a {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(60, 118, 86, 0.22);
  outline-offset: 3px;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 238px;
  flex-direction: column;
  padding: 30px 20px 22px;
  border-right: 1px solid rgba(222, 230, 218, 0.9);
  background: rgba(253, 254, 251, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 34px;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 15px 15px 15px 5px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(60, 118, 86, 0.2);
}

.brand-mark .icon {
  width: 25px;
  height: 25px;
  stroke-width: 1.65;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-copy small {
  margin-top: -2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item,
.settings-link {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 13px;
  color: #7a8980;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item:hover,
.settings-link:hover {
  color: var(--green-dark);
  background: var(--green-pale);
}

.nav-item.active {
  color: var(--green-dark);
  background: var(--green-soft);
  font-weight: 650;
}

.nav-item.active .icon {
  stroke-width: 2.1;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.local-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 8px 14px;
  color: #96a198;
  font-size: 11px;
  line-height: 1.7;
}

.local-note .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

.settings-link {
  width: 100%;
  text-align: left;
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
}

.avatar {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--green-dark);
  background: #e3eddf;
  font-size: 13px;
  font-weight: 700;
}

.profile > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.profile strong {
  font-size: 12px;
  font-weight: 650;
}

.profile small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  width: calc(100% - 238px);
  max-width: 1540px;
  margin-left: 238px;
  padding: 36px 38px 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.eyebrow,
.section-kicker {
  color: #8fa08f;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.19em;
}

.page-header h1 {
  margin-top: 7px;
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.date-copy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.date-switcher {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.8);
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button:hover:not(:disabled) {
  color: var(--green-dark);
  background: var(--green-soft);
}

.icon-button:active:not(:disabled) {
  transform: scale(0.94);
}

.icon-button.soft {
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.date-picker {
  position: relative;
  display: flex;
  min-width: 116px;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.date-picker .icon {
  width: 16px;
  height: 16px;
  color: var(--green);
}

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

.text-button {
  padding: 7px 3px;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.text-button:hover {
  color: var(--green-dark);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 17px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 650;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  border: 1px solid var(--green);
  color: #fff;
  background: var(--green);
  box-shadow: 0 7px 16px rgba(60, 118, 86, 0.16);
}

.primary-button:hover {
  background: var(--green-dark);
  box-shadow: 0 9px 20px rgba(60, 118, 86, 0.22);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button .icon {
  width: 17px;
  height: 17px;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: #fff;
}

.secondary-button:hover {
  background: var(--surface-soft);
}

.secondary-button .icon {
  width: 16px;
  height: 16px;
}

.card {
  border: 1px solid rgba(225, 232, 220, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.28fr 1fr 0.78fr;
  gap: 18px;
}

.calorie-card,
.macro-card,
.water-card {
  min-width: 0;
  padding: 23px;
}

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

.card-heading h2,
.records-heading h2 {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.muted-label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.calorie-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 18px;
}

.calorie-ring {
  position: relative;
  width: 172px;
  height: 172px;
  flex: 0 0 172px;
}

.calorie-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.calorie-ring circle {
  fill: none;
  stroke-width: 11;
}

.ring-track {
  stroke: #eef2e9;
}

.ring-progress {
  stroke: var(--green);
  stroke-linecap: round;
  stroke-dasharray: 464.96;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 600ms cubic-bezier(0.22, 1, 0.36, 1), stroke 200ms ease;
}

.ring-copy {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

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

.ring-copy strong {
  margin: -1px 0 -3px;
  font-size: 35px;
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 1.2;
}

.ring-copy small {
  color: #9aa69d;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.calorie-numbers {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 13px;
}

.calorie-numbers > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.stat-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.stat-dot.food {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.stat-dot.burn {
  background: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-soft);
}

.stat-dot.net {
  background: #9eaaa2;
  box-shadow: 0 0 0 4px #f0f3ef;
}

.calorie-numbers p {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.calorie-numbers strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.calorie-numbers strong small {
  color: #9aa69d;
  font-size: 8px;
  font-weight: 500;
}

.budget-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: #859288;
  font-size: 10px;
}

.goal-pill {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 8px;
  color: var(--green-dark);
  background: var(--green-pale);
}

.goal-pill b {
  font-weight: 700;
}

.macro-list {
  display: flex;
  flex-direction: column;
  gap: 21px;
  margin-top: 27px;
}

.macro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 11px;
}

.macro-top > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
}

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

.macro-dot.carbs {
  background: #8caf72;
}

.macro-dot.protein {
  background: #e7ad71;
}

.macro-dot.fat {
  background: #89a9ba;
}

.macro-top strong {
  color: #9aa69d;
  font-size: 10px;
  font-weight: 500;
}

.macro-top strong b {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #eff2ec;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 500ms ease;
}

.macro-row[data-macro="carbs"] .progress-track span {
  background: #8caf72;
}

.macro-row[data-macro="protein"] .progress-track span {
  background: #e7ad71;
}

.macro-row[data-macro="fat"] .progress-track span {
  background: #89a9ba;
}

.card-footnote {
  margin-top: 23px;
  color: #9aa69d;
  font-size: 9px;
}

.water-icon {
  width: 23px;
  height: 23px;
  color: var(--blue);
  fill: rgba(114, 165, 187, 0.12);
}

.water-amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 26px;
}

.water-amount strong {
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

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

.water-amount small {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
}

.water-cups {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.water-cup {
  display: grid;
  aspect-ratio: 1 / 1.05;
  place-items: center;
  padding: 0;
  border: 1px solid #e4edf0;
  border-radius: 11px;
  color: #c1d4dc;
  background: #f7fbfc;
  transition: color 160ms ease, background 160ms ease, border 160ms ease, transform 160ms ease;
}

.water-cup .icon {
  width: 19px;
  height: 19px;
  stroke-width: 1.7;
}

.water-cup.filled {
  border-color: #cfe4eb;
  color: var(--blue);
  background: var(--blue-soft);
}

.water-cup.filled .icon {
  fill: rgba(114, 165, 187, 0.22);
}

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

.water-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.water-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 9px;
  font-weight: 650;
}

.water-add .icon {
  width: 12px;
  height: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(280px, 0.88fr);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.records-card {
  overflow: hidden;
}

.records-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 24px 18px;
}

.count-badge {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  margin-left: 4px;
  place-items: center;
  padding: 0 6px;
  border-radius: 7px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 10px;
  vertical-align: 2px;
}

.filter-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: #f3f6f0;
}

.filter-tab {
  min-width: 43px;
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  transition: color 160ms ease, background 160ms ease;
}

.filter-tab.active {
  color: var(--green-dark);
  background: #fff;
  box-shadow: 0 2px 8px rgba(40, 69, 51, 0.06);
  font-weight: 650;
}

.records-list {
  padding: 0 24px;
}

.meal-group + .meal-group {
  margin-top: 4px;
}

.meal-group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 0 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.meal-group-heading .icon {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.meal-group-heading small {
  margin-left: auto;
  color: #a2ada5;
  font-size: 9px;
  font-weight: 500;
}

.record-row {
  display: flex;
  min-height: 63px;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
  border-top: 1px solid #eef2ec;
}

.record-row:first-child {
  border-top: 0;
}

.record-icon {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
}

.record-icon.breakfast {
  color: #aa8750;
  background: #faf2df;
}

.record-icon.lunch {
  color: #658764;
  background: #edf4e9;
}

.record-icon.dinner {
  color: #7b82a3;
  background: #eef0f7;
}

.record-icon.snack {
  color: #bb7e67;
  background: #fbede5;
}

.record-icon.exercise {
  color: #c08557;
  background: #fff0e2;
}

.record-icon .icon {
  width: 19px;
  height: 19px;
}

.record-main {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.record-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.record-copy strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-copy small {
  overflow: hidden;
  margin-top: 2px;
  color: #9aa69d;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-time {
  flex: 0 0 auto;
  color: #a0aba3;
  font-size: 9px;
}

.record-calories {
  min-width: 66px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.record-calories.exercise {
  color: var(--orange);
}

.record-calories small {
  font-size: 8px;
  font-weight: 500;
}

.record-delete {
  width: 28px;
  height: 28px;
  color: #b0bab3;
}

.record-delete .icon {
  width: 14px;
  height: 14px;
}

.record-delete:hover {
  color: var(--red);
  background: #fcf0ec;
}

.empty-group {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #eef2ec;
  color: #a3aea6;
  font-size: 10px;
}

.empty-group:first-child {
  border-top: 0;
}

.empty-group button {
  padding: 3px 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 9px;
}

.empty-records {
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-records .icon {
  width: 32px;
  height: 32px;
  margin-bottom: 10px;
  color: #a9b8aa;
}

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

.empty-records p {
  margin-top: 4px;
  font-size: 10px;
}

.add-record-row {
  display: flex;
  width: calc(100% - 48px);
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 12px 24px 22px;
  border: 1px dashed #cfdccc;
  border-radius: 11px;
  color: var(--green);
  background: #fbfcf9;
  font-size: 10px;
  font-weight: 600;
  transition: background 160ms ease, border 160ms ease;
}

.add-record-row:hover {
  border-color: #9eb79d;
  background: var(--green-pale);
}

.add-record-row .icon {
  width: 15px;
  height: 15px;
}

.right-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

.trend-card,
.insight-card,
.quick-card {
  padding: 22px;
}

.week-chart {
  display: grid;
  height: 142px;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 9px;
  margin-top: 20px;
  padding-top: 10px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0, transparent 37px, #f0f3ed 38px, transparent 39px);
}

.day-bar {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: flex-end;
  flex-direction: column;
  gap: 8px;
}

.day-bar .bar-track {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 22px;
  height: 96px;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 7px 7px 3px 3px;
  background: rgba(237, 242, 232, 0.7);
}

.day-bar .bar-fill {
  width: 100%;
  min-height: 3px;
  border-radius: inherit;
  background: #b9cdb4;
  transition: height 450ms ease;
}

.day-bar.today .bar-fill {
  background: var(--green);
}

.day-bar span {
  color: #9aa69d;
  font-size: 9px;
}

.day-bar.today span {
  color: var(--green-dark);
  font-weight: 700;
}

.trend-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
}

.trend-summary strong {
  color: var(--ink);
  font-size: 15px;
}

.trend-summary small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
}

.insight-card {
  position: relative;
  overflow: hidden;
  border-color: #dce8d5;
  background:
    radial-gradient(circle at 100% 0%, rgba(199, 222, 183, 0.45), transparent 45%),
    #f1f6ec;
}

.insight-card::after {
  position: absolute;
  right: -30px;
  bottom: -54px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(121, 156, 104, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(121, 156, 104, 0.04), 0 0 0 44px rgba(121, 156, 104, 0.025);
  content: "";
  pointer-events: none;
}

.insight-icon {
  display: grid;
  width: 37px;
  height: 37px;
  margin-bottom: 17px;
  place-items: center;
  border-radius: 12px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.7);
}

.insight-icon .icon {
  width: 19px;
  height: 19px;
}

.insight-card h2 {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.insight-card p {
  position: relative;
  z-index: 1;
  max-width: 300px;
  margin-top: 8px;
  color: #7d8d7b;
  font-size: 11px;
  line-height: 1.8;
}

.insight-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 0;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.insight-link .icon {
  width: 14px;
  height: 14px;
  transition: transform 160ms ease;
}

.insight-link:hover .icon {
  transform: translate(2px, -2px);
}

.quick-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 14px;
}

.quick-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid #eef2ec;
  background: transparent;
  text-align: left;
}

.quick-item:last-child {
  border-bottom: 0;
}

.quick-icon {
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
}

.quick-icon .icon {
  width: 16px;
  height: 16px;
}

.quick-icon.oat {
  color: #9d865c;
  background: #f8f1e2;
}

.quick-icon.chicken {
  color: #6c8b65;
  background: #eef4e9;
}

.quick-icon.apple {
  color: #bc7d65;
  background: #fbede5;
}

.quick-icon.walk {
  color: #c18656;
  background: #fff0e3;
}

.quick-item > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.quick-item strong {
  font-size: 11px;
  font-weight: 600;
}

.quick-item small {
  color: var(--muted);
  font-size: 9px;
}

.quick-plus {
  width: 17px;
  height: 17px;
  color: #a4b0a6;
  transition: color 160ms ease, transform 160ms ease;
}

.quick-item:hover .quick-plus {
  color: var(--green);
  transform: rotate(90deg);
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 27px 4px 4px;
  color: #9aa69d;
  font-size: 9px;
}

.page-footer > span:first-child {
  color: #7c8d80;
  font-weight: 650;
}

.page-footer p {
  letter-spacing: 0.08em;
}

.mobile-nav {
  display: none;
}

.modal {
  width: min(520px, calc(100% - 32px));
  max-height: min(90vh, 780px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 28px 80px rgba(27, 49, 36, 0.22);
}

.modal::backdrop {
  background: rgba(28, 43, 34, 0.34);
  backdrop-filter: blur(5px);
}

.modal form {
  padding: 25px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.modal-header h2 {
  margin-top: 4px;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 12px;
  background: #f1f5ee;
}

.segmented-control label {
  position: relative;
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.segmented-control .icon {
  width: 16px;
  height: 16px;
}

.segmented-control input:checked + span {
  color: var(--green-dark);
  background: #fff;
  box-shadow: 0 3px 10px rgba(40, 69, 51, 0.06);
}

.segmented-control input:focus-visible + span {
  outline: 3px solid rgba(60, 118, 86, 0.22);
  outline-offset: 2px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 15px;
}

.form-field > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid #dfe7dc;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #fcfdfb;
  font-size: 12px;
  transition: border 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-field input::placeholder {
  color: #b2bcb4;
}

.form-field input:focus,
.form-field select:focus {
  border-color: #9bb89a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(60, 118, 86, 0.08);
}

.macro-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.form-hint {
  margin-top: -4px;
  color: #9aa69d;
  font-size: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.settings-intro {
  margin: -7px 0 20px;
  color: var(--muted);
  font-size: 11px;
}

.data-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 7px;
  padding: 15px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.data-actions strong {
  font-size: 11px;
}

.data-actions p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.data-actions .secondary-button {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 100;
  left: calc(50% + 119px);
  bottom: 28px;
  display: flex;
  min-width: 180px;
  max-width: calc(100vw - 32px);
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  color: #fff;
  background: rgba(35, 54, 45, 0.94);
  box-shadow: 0 12px 30px rgba(35, 54, 45, 0.2);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast .icon {
  width: 15px;
  height: 15px;
  color: #b9d9aa;
}

[hidden] {
  display: none !important;
}

@media (min-width: 1500px) {
  .main {
    padding-right: 48px;
    padding-left: 48px;
  }

  .calorie-ring {
    width: 186px;
    height: 186px;
    flex-basis: 186px;
  }

  .calorie-card,
  .macro-card,
  .water-card {
    padding: 26px;
  }
}

@media (max-width: 1220px) {
  .sidebar {
    width: 210px;
    padding-right: 15px;
    padding-left: 15px;
  }

  .main {
    width: calc(100% - 210px);
    margin-left: 210px;
    padding: 30px 26px 24px;
  }

  .overview-grid {
    grid-template-columns: 1.2fr 1fr;
  }

  .water-card {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1.4fr 1fr;
    align-items: center;
    gap: 24px;
  }

  .water-card .card-heading {
    align-self: start;
  }

  .water-amount {
    margin-top: 0;
  }

  .water-cups {
    grid-template-columns: repeat(8, 1fr);
    margin: 0;
  }

  .water-actions {
    justify-content: flex-end;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.9fr);
  }

  .toast {
    left: calc(50% + 105px);
  }
}

@media (max-width: 1020px) {
  .sidebar {
    width: 82px;
    align-items: center;
    padding: 26px 12px 20px;
  }

  .brand {
    padding: 0 0 30px;
  }

  .brand-copy,
  .nav-item span,
  .settings-link span,
  .local-note,
  .profile > span:last-child {
    display: none;
  }

  .side-nav {
    width: 100%;
  }

  .nav-item,
  .settings-link {
    justify-content: center;
    padding: 0;
  }

  .profile {
    justify-content: center;
    padding: 16px 0 0;
  }

  .main {
    width: calc(100% - 82px);
    margin-left: 82px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .right-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

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

  .quick-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
  }

  .toast {
    left: calc(50% + 41px);
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 82px;
  }

  .sidebar {
    display: none;
  }

  .main {
    width: 100%;
    margin-left: 0;
    padding: 24px 18px 18px;
  }

  .page-header {
    margin-bottom: 23px;
  }

  .page-header h1 {
    font-size: 27px;
  }

  .header-actions {
    gap: 9px;
  }

  .header-actions > .primary-button {
    display: none;
  }

  .overview-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .calorie-card,
  .macro-card,
  .water-card {
    padding: 21px;
  }

  .water-card {
    display: block;
    grid-column: auto;
  }

  .water-amount {
    margin-top: 23px;
  }

  .water-cups {
    grid-template-columns: repeat(8, 1fr);
    margin: 17px 0;
  }

  .water-actions {
    justify-content: space-between;
  }

  .content-grid {
    gap: 14px;
    margin-top: 14px;
  }

  .records-heading {
    padding: 20px 18px 14px;
  }

  .records-list {
    padding: 0 18px;
  }

  .add-record-row {
    width: calc(100% - 36px);
    margin-right: 18px;
    margin-left: 18px;
  }

  .right-column {
    display: flex;
    gap: 14px;
  }

  .quick-list {
    display: flex;
  }

  .page-footer {
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 24px;
    text-align: center;
  }

  .page-footer p {
    order: 3;
    width: 100%;
  }

  .mobile-nav {
    position: fixed;
    z-index: 30;
    right: 12px;
    bottom: 10px;
    left: 12px;
    display: flex;
    height: 66px;
    align-items: center;
    justify-content: space-around;
    padding: 6px 10px env(safe-area-inset-bottom);
    border: 1px solid rgba(224, 232, 219, 0.94);
    border-radius: 20px;
    background: rgba(253, 254, 251, 0.96);
    box-shadow: 0 12px 38px rgba(40, 69, 51, 0.16);
    backdrop-filter: blur(16px);
  }

  .mobile-nav a,
  .mobile-nav > button {
    display: flex;
    min-width: 48px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    padding: 0;
    border: 0;
    color: #99a59c;
    background: transparent;
    font-size: 9px;
  }

  .mobile-nav a.active {
    color: var(--green);
    font-weight: 650;
  }

  .mobile-nav .icon {
    width: 19px;
    height: 19px;
  }

  .mobile-nav > button {
    transform: translateY(-15px);
  }

  .mobile-add-icon {
    display: grid;
    width: 47px;
    height: 47px;
    place-items: center;
    border: 5px solid #f9fbf6;
    border-radius: 50%;
    color: #fff;
    background: var(--green);
    box-shadow: 0 7px 17px rgba(60, 118, 86, 0.25);
  }

  .mobile-add-icon .icon {
    width: 21px;
    height: 21px;
  }

  .toast {
    left: 50%;
    bottom: 91px;
  }

  .modal {
    width: calc(100% - 24px);
    max-height: 88vh;
    border-radius: 22px;
  }

  .modal form {
    padding: 22px 20px;
  }
}

@media (max-width: 420px) {
  .main {
    padding-right: 13px;
    padding-left: 13px;
  }

  .date-switcher {
    flex: 1;
  }

  .date-picker {
    flex: 1;
  }

  .calorie-body {
    gap: 10px;
  }

  .calorie-ring {
    width: 148px;
    height: 148px;
    flex-basis: 148px;
  }

  .ring-copy strong {
    font-size: 30px;
  }

  .calorie-numbers {
    gap: 11px;
  }

  .calorie-numbers p {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .budget-footer {
    align-items: flex-start;
  }

  .water-cups {
    gap: 5px;
  }

  .water-cup {
    border-radius: 8px;
  }

  .water-cup .icon {
    width: 15px;
    height: 15px;
  }

  .record-time {
    display: none;
  }

  .record-calories {
    min-width: 55px;
    font-size: 10px;
  }

  .filter-tab {
    min-width: 38px;
    padding-right: 7px;
    padding-left: 7px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .data-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
