:root {
  --bg: #f3efe5;
  --surface: #fffdf8;
  --surface-soft: #f8f5ec;
  --surface-sage: #eef2e8;
  --ink: #293329;
  --ink-soft: #4c574b;
  --muted: #7e877b;
  --muted-light: #a7ada1;
  --sage: #66825f;
  --sage-deep: #405a40;
  --sage-light: #dce7d5;
  --peach: #e2a675;
  --peach-soft: #f7e4d4;
  --rose: #c77d6b;
  --line: rgba(48, 67, 49, 0.12);
  --line-strong: rgba(48, 67, 49, 0.2);
  --shadow-lg: 0 30px 70px rgba(60, 70, 54, 0.12);
  --shadow-md: 0 16px 36px rgba(60, 70, 54, 0.09);
  --shadow-sm: 0 6px 18px rgba(60, 70, 54, 0.07);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  background:
    radial-gradient(circle at 8% 5%, rgba(226, 166, 117, 0.16), transparent 28%),
    radial-gradient(circle at 92% 88%, rgba(102, 130, 95, 0.16), transparent 28%),
    var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::selection {
  background: var(--sage-light);
  color: var(--sage-deep);
}

:focus-visible {
  outline: 3px solid rgba(102, 130, 95, 0.35);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--sage-deep);
  color: #fff;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(10px);
  pointer-events: none;
  opacity: 0.65;
  z-index: 0;
}

.ambient-one {
  width: 360px;
  height: 360px;
  top: -160px;
  left: -100px;
  background: radial-gradient(circle, rgba(238, 208, 176, 0.65), transparent 68%);
}

.ambient-two {
  width: 500px;
  height: 500px;
  right: -220px;
  bottom: -220px;
  background: radial-gradient(circle, rgba(158, 181, 147, 0.45), transparent 68%);
}

.ambient-three {
  width: 220px;
  height: 220px;
  right: 28%;
  top: -120px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), transparent 70%);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 388px minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 1480px;
  height: 100dvh;
  margin: 0 auto;
  padding: 22px;
}

.sidebar,
.chat-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 25px 24px 20px;
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, 0.8);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 130, 95, 0.25) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(102, 130, 95, 0.25);
  border-radius: 99px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 2px 20px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 19px;
  color: #fffdf6;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.35), transparent 34%),
    linear-gradient(145deg, #78916d, #466143);
  box-shadow: 0 12px 24px rgba(64, 90, 64, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
}

.brand-mark span {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1;
  transform: translateY(-1px);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--sage);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.05em;
}

.brand-sub {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 13px;
  border: 1px solid rgba(72, 96, 70, 0.08);
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(242, 240, 230, 0.9), rgba(248, 246, 238, 0.65));
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--sage-deep);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  background:
    radial-gradient(circle at 30% 20%, #fff, transparent 42%),
    linear-gradient(140deg, #edf2e6, #d9e5d2);
  box-shadow: inset 0 0 0 1px rgba(65, 90, 63, 0.12);
}

.profile-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  line-height: 1.4;
}

.profile-copy strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy span {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  transition: 0.2s var(--ease);
}

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

.icon-button:hover {
  border-color: var(--line);
  color: var(--sage-deep);
  background: rgba(255, 255, 255, 0.7);
}

.today-card {
  margin-top: 14px;
  padding: 17px 16px 15px;
  border: 1px solid rgba(72, 96, 70, 0.09);
  border-radius: 22px;
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.85), transparent 28%),
    linear-gradient(155deg, #f8f6ee 0%, #f1f4e9 100%);
}

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

.card-heading h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.card-heading > span {
  color: var(--muted);
  font-size: 11px;
}

.ring-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 186px;
  height: 186px;
  margin: 5px auto 1px;
}

.calorie-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 9px 16px rgba(73, 96, 68, 0.1));
}

.ring-track,
.ring-fill {
  fill: none;
  stroke-width: 9;
}

.ring-track {
  stroke: rgba(83, 107, 78, 0.1);
}

.ring-fill {
  stroke: url(#ringGradient);
  stroke-dasharray: 477.52;
  stroke-dashoffset: 477.52;
  transition: stroke-dashoffset 0.85s var(--ease);
}

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

.ring-caption {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.ring-center strong {
  margin: 3px 0 0;
  font-family: var(--font-serif);
  font-size: 37px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 5px;
  padding-top: 13px;
  border-top: 1px solid rgba(72, 96, 70, 0.1);
}

.metric {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
  text-align: center;
}

.metric + .metric {
  border-left: 1px solid rgba(72, 96, 70, 0.1);
}

.metric span {
  width: 100%;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.metric strong {
  font-family: var(--font-serif);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.metric strong.over {
  color: var(--rose);
}

.metric small {
  color: var(--muted-light);
  font-size: 8px;
}

.balance-block {
  margin-top: 12px;
}

.balance-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}

.balance-track {
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(76, 99, 73, 0.1);
}

.balance-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8ca37f, #d3b382);
  transition: width 0.7s var(--ease);
}

.log-section {
  margin-top: 19px;
  min-height: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 9px;
}

.section-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.section-head > span {
  color: var(--muted);
  font-size: 10px;
}

.meal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 245px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.empty-log {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 13px;
  border: 1px dashed rgba(72, 96, 70, 0.18);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.34);
}

.empty-log span {
  font-size: 18px;
}

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

.meal-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 8px;
  padding: 9px 9px 9px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  transition: 0.2s var(--ease);
}

.meal-item:hover {
  border-color: var(--line);
  background: #fff;
}

.meal-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface-sage);
  font-size: 14px;
}

.meal-info {
  min-width: 0;
  line-height: 1.35;
}

.meal-info strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
}

.meal-info span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meal-calories {
  color: var(--sage-deep);
  font-family: var(--font-serif);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.meal-calories small {
  color: var(--muted-light);
  font-family: var(--font-sans);
  font-size: 8px;
}

.meal-delete {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted-light);
  background: transparent;
  opacity: 0.35;
  transition: 0.2s;
}

.meal-delete svg {
  width: 11px;
  height: 11px;
}

.meal-item:hover .meal-delete,
.meal-delete:focus-visible {
  opacity: 1;
}

.meal-delete:hover {
  color: var(--rose);
  background: rgba(199, 125, 107, 0.1);
}

.side-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: auto;
  padding-top: 16px;
}

.side-action {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid rgba(72, 96, 70, 0.09);
  border-radius: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.48);
  transition: 0.22s var(--ease);
}

.side-action:hover {
  border-color: rgba(72, 96, 70, 0.16);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.side-action-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--sage-deep);
  background: var(--surface-sage);
}

.side-action-icon svg {
  width: 16px;
  height: 16px;
}

.side-action-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  line-height: 1.35;
}

.side-action-copy strong {
  font-size: 11px;
  font-weight: 700;
}

.side-action-copy small {
  color: var(--muted);
  font-size: 9px;
}

.side-action-arrow {
  color: var(--muted-light);
  font-size: 17px;
  line-height: 1;
}

.disclaimer {
  margin: 12px 2px 0;
  color: var(--muted-light);
  font-size: 8.5px;
  line-height: 1.55;
}

/* ── Chat ───────────────────────────────────────────────────────────── */

.chat-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.9), transparent 38%),
    rgba(255, 253, 248, 0.74);
}

.mobile-bar {
  display: none;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
  padding: 21px 28px 17px;
  border-bottom: 1px solid rgba(72, 96, 70, 0.08);
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(93, 126, 87, 0.14);
  border-radius: 999px;
  color: var(--sage-deep);
  font-size: 9px;
  letter-spacing: 0.03em;
  background: rgba(223, 233, 216, 0.55);
}

.online-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7f9e72;
  box-shadow: 0 0 0 3px rgba(127, 158, 114, 0.15);
  animation: breathe 2.4s ease-in-out infinite;
}

.chat-title {
  flex: 1;
  min-width: 0;
}

.chat-title h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.chat-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

.soft-button {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid rgba(72, 96, 70, 0.12);
  border-radius: 999px;
  color: var(--sage-deep);
  font-size: 10px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.58);
  transition: 0.2s;
}

.soft-button:hover {
  border-color: rgba(72, 96, 70, 0.22);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.messages {
  flex: 1;
  min-height: 0;
  padding: 13px 30px 20px;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 130, 95, 0.2) transparent;
}

.messages::-webkit-scrollbar {
  width: 6px;
}

.messages::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(102, 130, 95, 0.2);
}

.date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 20px;
  color: var(--muted-light);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.date-divider::before,
.date-divider::after {
  content: "";
  width: 34px;
  height: 1px;
  background: rgba(72, 96, 70, 0.12);
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 21px;
  animation: messageIn 0.45s var(--ease) both;
}

.message.user {
  flex-direction: row-reverse;
  padding-left: 14%;
}

.message-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--sage-deep);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(145deg, #edf3e7, #d7e4d1);
  box-shadow: inset 0 0 0 1px rgba(65, 90, 63, 0.1);
}

.message.user .message-avatar {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 10px;
  background: linear-gradient(145deg, #7f9875, #5d7958);
}

.message-content {
  max-width: min(700px, 84%);
  min-width: 0;
}

.bubble {
  position: relative;
  padding: 13px 16px;
  border: 1px solid rgba(72, 96, 70, 0.08);
  border-radius: 5px 19px 19px 19px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px rgba(60, 70, 54, 0.045);
}

.bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble p + p {
  margin-top: 9px;
}

.bubble p:empty {
  display: none;
}

.message.user .bubble {
  border: 0;
  border-radius: 19px 5px 19px 19px;
  color: #fffdf8;
  background: linear-gradient(145deg, #78906f, #5a7656);
  box-shadow: 0 10px 22px rgba(70, 93, 67, 0.16);
}

.message-time {
  margin-top: 5px;
  color: var(--muted-light);
  font-size: 8px;
  text-align: right;
}

.intro-message {
  margin-bottom: 23px;
}

.intro-message .bubble {
  padding: 15px 17px;
}

.guide-card {
  width: min(460px, 100%);
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid rgba(72, 96, 70, 0.09);
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(247, 245, 235, 0.9), rgba(246, 248, 240, 0.8));
}

.guide-title {
  margin-bottom: 8px;
  color: var(--sage-deep);
  font-size: 10px;
  font-weight: 700;
}

.guide-title span {
  margin-right: 4px;
}

.guide-example {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 7px 10px;
  border: 1px solid rgba(72, 96, 70, 0.1);
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  transition: 0.2s;
}

.guide-example:hover {
  border-color: rgba(72, 96, 70, 0.2);
  color: var(--sage-deep);
  background: #fff;
  transform: translateX(2px);
}

.guide-note {
  margin: 8px 1px 0;
  color: var(--muted);
  font-size: 9px;
}

/* Analysis card appended below assistant bubbles */
.analysis-card {
  width: min(520px, 100%);
  margin-top: 9px;
  padding: 13px 14px;
  border: 1px solid rgba(72, 96, 70, 0.09);
  border-radius: 16px;
  background: rgba(251, 249, 242, 0.9);
}

.analysis-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(72, 96, 70, 0.08);
}

.analysis-head span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.analysis-head strong {
  color: var(--sage-deep);
  font-family: var(--font-serif);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.analysis-head strong small {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
}

.analysis-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 0 2px;
}

.analysis-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: 10px;
}

.analysis-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-item-name b {
  margin-right: 4px;
  color: var(--sage);
  font-weight: 600;
}

.analysis-item-cal {
  flex: 0 0 auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.warning-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
  padding-top: 8px;
  border-top: 1px solid rgba(72, 96, 70, 0.08);
}

.warning-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #8a624a;
  font-size: 8.5px;
  background: rgba(238, 206, 178, 0.3);
}

.warning-chip::before {
  content: "·";
  font-size: 13px;
  line-height: 0.5;
}

.warning-chip.nudge {
  color: #6e755d;
  background: rgba(215, 226, 205, 0.6);
}

.analysis-unknown {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}

.message.error .bubble {
  color: #8b5547;
  background: #fdf2ee;
  border-color: rgba(199, 125, 107, 0.16);
}

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 54px;
  padding: 15px 17px;
}

.typing-bubble i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
  animation: typing 1.15s ease-in-out infinite;
}

.typing-bubble i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-bubble i:nth-child(3) {
  animation-delay: 0.3s;
}

/* ── Composer ───────────────────────────────────────────────────────── */

.composer-area {
  flex: 0 0 auto;
  padding: 0 28px 17px;
  background: linear-gradient(to top, rgba(255, 253, 248, 0.98) 45%, rgba(255, 253, 248, 0.45));
}

.quick-chips {
  display: flex;
  gap: 6px;
  padding: 2px 1px 9px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-chips::-webkit-scrollbar {
  display: none;
}

.quick-chips button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(72, 96, 70, 0.1);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 9.5px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.65);
  transition: 0.2s;
}

.quick-chips button:hover {
  border-color: rgba(72, 96, 70, 0.2);
  color: var(--sage-deep);
  background: #fff;
  transform: translateY(-1px);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 7px 7px 7px 16px;
  border: 1px solid rgba(72, 96, 70, 0.13);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(60, 70, 54, 0.07);
  transition: 0.2s var(--ease);
}

.composer:focus-within {
  border-color: rgba(102, 130, 95, 0.4);
  box-shadow: 0 12px 30px rgba(60, 70, 54, 0.09), 0 0 0 4px rgba(102, 130, 95, 0.08);
}

.composer textarea {
  flex: 1;
  min-height: 38px;
  max-height: 130px;
  padding: 8px 0 7px;
  border: 0;
  outline: 0;
  resize: none;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.55;
  background: transparent;
}

.composer textarea::placeholder {
  color: var(--muted-light);
}

.send-button {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 13px;
  color: #fffdf8;
  background: linear-gradient(145deg, #78916d, #4f6b4b);
  box-shadow: 0 7px 15px rgba(70, 93, 67, 0.2);
  transition: 0.22s var(--ease);
}

.send-button svg {
  width: 18px;
  height: 18px;
  transform: translateX(-1px);
}

.send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(70, 93, 67, 0.26);
}

.send-button:disabled {
  color: #b6bdb0;
  background: #eef0e9;
  box-shadow: none;
}

.composer-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 4px 0;
  color: var(--muted-light);
  font-size: 8px;
}

/* ── Modals ─────────────────────────────────────────────────────────── */

.modal {
  width: min(92vw, 720px);
  max-width: 720px;
  max-height: min(92dvh, 900px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 40px 100px rgba(41, 51, 41, 0.28);
  overflow: hidden;
}

.modal[open] {
  display: flex;
  flex-direction: column;
  animation: modalIn 0.32s var(--ease) both;
}

.modal::backdrop {
  background: rgba(43, 52, 41, 0.36);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.25s ease both;
}

.modal-wide,
.food-modal {
  width: min(94vw, 1020px);
  max-width: 1020px;
}

.history-modal {
  width: min(92vw, 780px);
  max-width: 780px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex: 0 0 auto;
  padding: 27px 30px 16px;
}

.modal-kicker {
  margin: 0 0 4px;
  color: var(--sage);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.modal-sub {
  max-width: 560px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.modal-body {
  padding: 4px 30px 24px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.modal-close {
  margin-top: -3px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
  padding: 15px 30px 23px;
  border-top: 1px solid rgba(72, 96, 70, 0.08);
  background: rgba(250, 248, 240, 0.55);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

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

.field > span small {
  color: var(--muted-light);
  font-size: 8px;
  font-weight: 400;
}

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

.field input,
.field select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid rgba(72, 96, 70, 0.14);
  border-radius: 11px;
  outline: 0;
  color: var(--ink);
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.8);
  transition: 0.2s;
}

.field select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237e877b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.field input:focus,
.field select:focus {
  border-color: rgba(102, 130, 95, 0.48);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(102, 130, 95, 0.08);
}

.field input::placeholder {
  color: var(--muted-light);
}

.input-suffix {
  position: relative;
}

.input-suffix input {
  padding-right: 38px;
}

.input-suffix em {
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--muted-light);
  font-size: 9px;
  font-style: normal;
  transform: translateY(-50%);
  pointer-events: none;
}

.choice-field {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.choice-field legend {
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.choice {
  position: relative;
  display: block;
  cursor: pointer;
}

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

.choice span {
  display: flex;
  min-height: 72px;
  padding: 11px 11px 9px;
  border: 1px solid rgba(72, 96, 70, 0.12);
  border-radius: 13px;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.55);
  transition: 0.2s var(--ease);
}

.choice strong {
  font-size: 10.5px;
  font-weight: 700;
}

.choice small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}

.choice input:checked + span {
  border-color: rgba(102, 130, 95, 0.48);
  background: rgba(232, 239, 226, 0.7);
  box-shadow: inset 0 0 0 1px rgba(102, 130, 95, 0.16);
}

.choice input:focus-visible + span {
  outline: 3px solid rgba(102, 130, 95, 0.3);
  outline-offset: 2px;
}

.target-preview {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(102, 130, 95, 0.13);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(237, 243, 231, 0.8), rgba(249, 245, 235, 0.6));
}

.target-preview-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.64);
  font-size: 15px;
}

.target-preview strong {
  display: block;
  color: var(--sage-deep);
  font-size: 11px;
}

.target-preview p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.target-preview.is-warning {
  border-color: rgba(199, 125, 107, 0.2);
  background: #fdf3ef;
}

.target-preview.is-warning strong {
  color: #95614f;
}

.safety-note {
  margin: 13px 0 0;
  padding-left: 10px;
  border-left: 2px solid rgba(199, 125, 107, 0.25);
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.65;
}

.text-button {
  padding: 9px 12px;
  border: 0;
  color: var(--muted);
  font-size: 10.5px;
  background: transparent;
}

.text-button:hover {
  color: var(--sage-deep);
}

.primary-button {
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  color: #fffdf8;
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(145deg, #718b67, #4e694a);
  box-shadow: 0 8px 18px rgba(70, 93, 67, 0.18);
  transition: 0.2s var(--ease);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 23px rgba(70, 93, 67, 0.23);
}

.primary-button:disabled {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

/* ── Food library ───────────────────────────────────────────────────── */

.food-toolbar {
  flex: 0 0 auto;
  padding: 0 30px 10px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(72, 96, 70, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  transition: 0.2s;
}

.search-field:focus-within {
  border-color: rgba(102, 130, 95, 0.45);
  box-shadow: 0 0 0 3px rgba(102, 130, 95, 0.08);
}

.search-field svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  font-size: 11px;
  background: transparent;
}

.search-field input::placeholder {
  color: var(--muted-light);
}

.category-scroll {
  display: flex;
  gap: 5px;
  padding-top: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid rgba(72, 96, 70, 0.1);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  background: rgba(255, 255, 255, 0.55);
  transition: 0.2s;
}

.category-chip:hover {
  color: var(--sage-deep);
  background: #fff;
}

.category-chip.active {
  border-color: var(--sage-deep);
  color: #fffdf8;
  background: var(--sage-deep);
}

.food-help {
  flex: 0 0 auto;
  margin: 0;
  padding: 4px 30px 10px;
  color: var(--muted);
  font-size: 9px;
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 30px 18px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.food-card {
  position: relative;
  display: flex;
  min-height: 77px;
  padding: 11px 12px;
  border: 1px solid rgba(72, 96, 70, 0.1);
  border-radius: 14px;
  flex-direction: column;
  text-align: left;
  background: rgba(255, 255, 255, 0.62);
  transition: 0.2s var(--ease);
}

.food-card:hover {
  border-color: rgba(102, 130, 95, 0.3);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.food-card.added {
  border-color: rgba(102, 130, 95, 0.5);
  background: rgba(235, 242, 228, 0.8);
}

.food-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.food-emoji {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--surface-sage);
  font-size: 12px;
}

.food-add {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid rgba(72, 96, 70, 0.16);
  border-radius: 50%;
  color: var(--sage-deep);
  font-size: 13px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.7);
}

.food-card strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  margin-top: auto;
  padding-top: 5px;
  color: var(--muted);
  font-size: 8.5px;
}

.food-card-meta b {
  color: var(--sage-deep);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.food-card-meta b small {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 7.5px;
  font-weight: 400;
}

.food-source {
  position: absolute;
  right: 9px;
  bottom: 26px;
  color: var(--muted-light);
  font-size: 6.5px;
}

.food-empty {
  padding: 30px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.food-foot {
  justify-content: space-between;
  color: var(--muted);
  font-size: 8.5px;
}

/* ── History ────────────────────────────────────────────────────────── */

.history-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.history-stats > div {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
  padding: 11px 7px;
  border: 1px solid rgba(72, 96, 70, 0.08);
  border-radius: 13px;
  text-align: center;
  background: var(--surface-soft);
}

.history-stats span {
  width: 100%;
  color: var(--muted);
  font-size: 8.5px;
}

.history-stats strong {
  font-family: var(--font-serif);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.history-stats small {
  color: var(--muted-light);
  font-size: 7.5px;
}

.chart-wrap {
  position: relative;
  height: 255px;
  padding: 16px 8px 0;
  border-bottom: 1px solid rgba(72, 96, 70, 0.1);
  background:
    repeating-linear-gradient(to top, transparent 0, transparent 61px, rgba(72, 96, 70, 0.05) 61px, rgba(72, 96, 70, 0.05) 62px);
}

.history-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
  height: 192px;
  padding: 0 4px;
}

.chart-target-line {
  position: absolute;
  right: 10px;
  left: 10px;
  z-index: 2;
  height: 0;
  border-top: 1px dashed rgba(199, 125, 107, 0.5);
  pointer-events: none;
}

.chart-target-line span {
  position: absolute;
  top: -16px;
  right: 0;
  padding: 1px 5px;
  border-radius: 4px;
  color: #9b6b58;
  font-size: 7.5px;
  background: #fbefea;
}

.chart-col {
  display: flex;
  align-items: center;
  width: 11%;
  max-width: 62px;
  flex-direction: column;
  gap: 7px;
}

.bar-track {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 160px;
}

.bar-fill {
  position: relative;
  width: 100%;
  min-height: 3px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(to top, #7e9a74, #b8c8a9);
  box-shadow: 0 4px 10px rgba(104, 130, 96, 0.13);
  transition: height 0.65s var(--ease);
}

.bar-fill.over {
  background: linear-gradient(to top, #d19a77, #e8c3a7);
}

.bar-fill.empty {
  min-height: 3px;
  background: rgba(72, 96, 70, 0.12);
  box-shadow: none;
}

.bar-value {
  position: absolute;
  top: -14px;
  left: 50%;
  color: var(--muted);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(-50%);
}

.bar-day {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
  text-align: center;
}

.bar-day b {
  display: block;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 8.5px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

.dot-normal {
  background: #90a885;
}

.dot-over {
  background: #d8a37e;
}

.dot-empty {
  background: rgba(72, 96, 70, 0.2);
}

.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(72, 96, 70, 0.09);
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(246, 245, 235, 0.9), rgba(238, 243, 232, 0.7));
}

.insight-icon {
  font-size: 16px;
  line-height: 1.4;
}

.insight-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
}

/* ── Toast ──────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 1000;
  max-width: min(86vw, 420px);
  padding: 10px 17px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fffdf8;
  font-size: 11px;
  text-align: center;
  background: rgba(50, 65, 49, 0.92);
  box-shadow: 0 14px 30px rgba(41, 51, 41, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 0.25s var(--ease);
}

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

.toast.is-error {
  background: rgba(142, 83, 67, 0.94);
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1210px) {
  .app-shell {
    grid-template-columns: 360px minmax(0, 1fr);
    padding: 16px;
  }

  .sidebar {
    padding: 22px 20px 18px;
  }

  .ring-wrap {
    width: 174px;
    height: 174px;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 100dvh;
    padding: 10px;
  }

  .sidebar {
    display: none;
  }

  .chat-panel {
    height: calc(100dvh - 20px);
    min-height: 580px;
    border-radius: 24px;
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding: 11px 15px 9px;
    border-bottom: 1px solid rgba(72, 96, 70, 0.08);
    background: rgba(255, 253, 248, 0.84);
  }

  .mobile-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--sage-deep);
    font-family: var(--font-serif);
    font-size: 14px;
    background: linear-gradient(145deg, #edf3e7, #d7e4d1);
  }

  .mobile-kcal {
    flex: 1;
    min-width: 0;
  }

  .mobile-kcal > div:first-child {
    color: var(--muted);
    font-size: 9px;
    line-height: 1.2;
  }

  .mobile-kcal strong {
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 17px;
    font-variant-numeric: tabular-nums;
  }

  .mobile-progress {
    height: 3px;
    margin-top: 4px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(72, 96, 70, 0.1);
  }

  .mobile-progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7e9a74, #d3b382);
    transition: width 0.5s var(--ease);
  }

  .mobile-tool {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid rgba(72, 96, 70, 0.1);
    border-radius: 50%;
    color: var(--sage-deep);
    background: rgba(255, 255, 255, 0.6);
  }

  .mobile-tool svg {
    width: 15px;
    height: 15px;
  }

  .chat-head {
    padding: 13px 17px 11px;
    gap: 10px;
  }

  .online-pill {
    display: none;
  }

  .chat-title h2 {
    font-size: 18px;
  }

  .chat-title p {
    font-size: 9px;
  }

  .messages {
    padding: 10px 15px 16px;
  }

  .message {
    gap: 8px;
  }

  .message-avatar {
    width: 27px;
    height: 27px;
    font-size: 12px;
  }

  .message-content {
    max-width: 88%;
  }

  .bubble {
    padding: 11px 13px;
    font-size: 12px;
  }

  .composer-area {
    padding: 0 14px 12px;
  }

  .quick-chips button {
    font-size: 9px;
  }

  .composer textarea {
    font-size: 12px;
  }

  .composer-meta {
    font-size: 7.5px;
  }

  .composer-meta span:last-child {
    display: none;
  }

  .modal {
    border-radius: 24px;
  }

  .modal-head {
    padding: 22px 20px 13px;
  }

  .modal-head h2 {
    font-size: 21px;
  }

  .modal-body {
    padding: 3px 20px 20px;
  }

  .modal-foot {
    padding: 13px 20px 18px;
  }

  .food-toolbar {
    padding: 0 20px 8px;
  }

  .food-help {
    padding: 2px 20px 8px;
  }

  .food-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 20px 15px;
  }

  .food-foot {
    gap: 8px;
    font-size: 7.5px;
  }

  .history-stats strong {
    font-size: 18px;
  }

  .chart-wrap {
    height: 228px;
  }

  .history-chart {
    height: 165px;
  }

  .bar-track {
    height: 135px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 6px;
  }

  .chat-panel {
    height: calc(100dvh - 12px);
    min-height: 540px;
    border-radius: 20px;
  }

  .chat-title p {
    display: none;
  }

  .soft-button {
    padding: 7px 11px;
    font-size: 9px;
  }

  .message.user {
    padding-left: 6%;
  }

  .guide-card {
    display: none;
  }

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

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

  .choice-row {
    grid-template-columns: 1fr;
  }

  .choice span {
    min-height: auto;
    padding: 9px 11px;
  }

  .modal {
    width: 96vw;
    max-height: 93dvh;
    border-radius: 20px;
  }

  .modal-head {
    padding: 19px 16px 11px;
  }

  .modal-head h2 {
    font-size: 19px;
  }

  .modal-sub {
    font-size: 9px;
  }

  .modal-body {
    padding: 2px 16px 17px;
  }

  .modal-foot {
    padding: 11px 16px 16px;
  }

  .food-toolbar,
  .food-help {
    padding-right: 16px;
    padding-left: 16px;
  }

  .food-grid {
    gap: 6px;
    padding: 0 16px 12px;
  }

  .food-card {
    min-height: 72px;
    padding: 9px;
  }

  .food-card strong {
    font-size: 10px;
  }

  .food-foot span {
    display: none;
  }

  .food-foot {
    justify-content: flex-end;
  }

  .history-stats {
    gap: 5px;
  }

  .chart-wrap {
    height: 205px;
    padding-right: 0;
    padding-left: 0;
  }

  .history-chart {
    gap: 3px;
    height: 145px;
  }

  .bar-track {
    height: 116px;
  }

  .chart-col {
    width: 13%;
  }

  .bar-day {
    font-size: 7px;
  }

  .bar-day b {
    font-size: 8px;
  }

  .chart-legend {
    gap: 9px;
  }

  .toast {
    bottom: 18px;
  }
}

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