:root {
  color-scheme: light;
  --page-bg: #f3f7f2;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --surface-muted: #edf3ed;
  --ink: #1d2d24;
  --ink-soft: #5c6c62;
  --ink-faint: #849087;
  --line: #dce6dd;
  --line-strong: #cbd8ce;
  --brand: #2f7750;
  --brand-dark: #235c3d;
  --brand-soft: #e1efe5;
  --brand-pale: #f0f7f2;
  --focus: #236843;

  --score-red-bg: #f3dfdc;
  --score-red-text: #8c4b45;
  --score-red-border: #d9a9a3;
  --score-orange-bg: #f4e6d4;
  --score-orange-text: #8b6035;
  --score-orange-border: #ddbf96;
  --score-yellow-bg: #f1eccf;
  --score-yellow-text: #766a2d;
  --score-yellow-border: #d7ca83;
  --score-light-green-bg: #dfece0;
  --score-light-green-text: #4e714f;
  --score-light-green-border: #acc8ad;
  --score-deep-green-bg: #cee4d3;
  --score-deep-green-text: #28613d;
  --score-deep-green-border: #83b092;

  --status-empty: #9da8a0;
  --status-empty-soft: #e8ece9;
  --status-low: #d69a43;
  --status-low-soft: #f5e8d3;
  --status-ok: #4f9869;
  --status-ok-soft: #dcecdf;
  --status-high: #b8615b;
  --status-high-soft: #f1dddb;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-card: 0 7px 24px rgba(37, 75, 50, 0.065);
  --shadow-dock: 0 -10px 30px rgba(35, 67, 45, 0.09);
  --app-width: 760px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  background: #e8eee9;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(195, 222, 202, 0.44), transparent 28rem),
    var(--page-bg);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(35, 104, 67, 0.28);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.app-frame {
  width: 100%;
  max-width: var(--app-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(250, 252, 249, 0.94), rgba(245, 249, 245, 0.88)),
    var(--page-bg);
  border-inline: 1px solid rgba(210, 221, 212, 0.66);
  box-shadow: 0 0 48px rgba(35, 68, 45, 0.055);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(18px + env(safe-area-inset-top)) 18px 14px;
}

.app-kicker,
.section-eyebrow {
  margin: 0 0 3px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  line-height: 1.35;
  text-transform: uppercase;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(20px, 5.6vw, 26px);
  font-weight: 780;
  letter-spacing: -0.03em;
}

.sample-badge {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 6px 10px;
  align-items: center;
  gap: 6px;
  color: var(--brand-dark);
  background: linear-gradient(145deg, #edf7f0, #dceee2);
  border: 1px solid rgba(137, 182, 150, 0.5);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
}

.sample-badge::before {
  width: 6px;
  height: 6px;
  background: #4f9869;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(79, 152, 105, 0.12);
  content: "";
}

.app-main {
  padding: 2px 18px calc(102px + env(safe-area-inset-bottom));
}

body[data-active-page="builder"] .app-main {
  padding-bottom: calc(184px + env(safe-area-inset-bottom));
}

.page-view {
  animation: page-enter 220ms ease-out;
}

.page-intro {
  margin: 3px 0 17px;
}

.page-intro h2 {
  margin: 0;
  font-size: clamp(29px, 8.2vw, 37px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.page-intro > p:last-child {
  max-width: 34rem;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.builder-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.builder-intro h2 {
  margin: 0;
}

.data-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 16px;
  padding: 12px 13px;
  color: #5e674d;
  background: linear-gradient(135deg, #f7f6e8, #f0f2df);
  border: 1px solid rgba(209, 208, 164, 0.58);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.data-notice p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.notice-icon {
  display: grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #6b744c;
  background: rgba(255, 255, 255, 0.46);
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.library-tools {
  position: sticky;
  z-index: 4;
  top: 0;
  margin-inline: -7px;
  padding: 6px 7px 13px;
  background: linear-gradient(to bottom, rgba(248, 251, 247, 0.97) 78%, rgba(248, 251, 247, 0));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field input {
  width: 100%;
  height: 49px;
  padding: 0 43px 0 43px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(188, 207, 193, 0.82);
  border-radius: 16px;
  box-shadow:
    0 8px 22px rgba(35, 68, 45, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.search-field input::placeholder {
  color: #8a968e;
}

.search-field input:focus {
  background: #fff;
  border-color: #7baa89;
  box-shadow:
    0 0 0 3px rgba(47, 119, 80, 0.1),
    0 10px 24px rgba(35, 68, 45, 0.075);
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

.search-icon {
  position: absolute;
  z-index: 1;
  left: 17px;
  width: 14px;
  height: 14px;
  border: 2px solid #75847a;
  border-radius: 50%;
  pointer-events: none;
}

.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 2px;
  background: #75847a;
  border-radius: 2px;
  content: "";
  transform: rotate(45deg);
}

.clear-search {
  position: absolute;
  right: 10px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface-muted);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.category-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  margin-top: 9px;
  padding: 3px;
  background: rgba(226, 235, 228, 0.82);
  border: 1px solid rgba(203, 216, 206, 0.74);
  border-radius: 14px;
  box-shadow: inset 0 1px 2px rgba(40, 75, 51, 0.035);
}

.category-filter button,
.segmented-control button,
.mini-segmented button {
  border: 0;
  cursor: pointer;
}

.category-filter button {
  min-width: 0;
  min-height: 35px;
  padding: 6px 4px;
  color: var(--ink-soft);
  background: transparent;
  border-radius: 10px;
  font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 650;
  white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.category-filter button[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(145deg, #347f57, #286a48);
  box-shadow:
    0 5px 13px rgba(47, 119, 80, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.section-row h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.library-count-row {
  margin: 4px 2px 10px;
}

.library-count-row h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
  font-weight: 780;
}

.library-count-row h3::before {
  width: 4px;
  height: 15px;
  background: linear-gradient(to bottom, #4d9870, #286a48);
  border-radius: 999px;
  content: "";
}

.library-count-row .result-count {
  padding: 3px 8px;
  color: var(--brand-dark);
  background: rgba(225, 239, 229, 0.7);
  border: 1px solid rgba(190, 215, 197, 0.62);
  border-radius: 999px;
}

.result-count,
.storage-note {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 650;
}

.food-library-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.loading-card,
.empty-library,
.empty-picker {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.74);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  text-align: center;
}

.empty-library {
  grid-column: 1 / -1;
}

.loading-card {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 120px;
  padding: 22px;
}

.loading-dot {
  width: 9px;
  height: 9px;
  background: var(--brand);
  border-radius: 50%;
  animation: loading-pulse 1.2s ease-in-out infinite;
}

.food-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  color: var(--score-text, var(--ink));
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08) 58%),
    color-mix(in srgb, var(--score-bg, var(--surface-muted)) 72%, var(--score-border, var(--line)));
  border: 1px solid color-mix(in srgb, var(--score-border, var(--line)) 74%, white);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 3px 10px rgba(31, 65, 42, 0.065);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.food-card-summary {
  display: flex;
  width: 100%;
  min-height: clamp(50px, 14vw, 56px);
  padding: 4px 4px 3px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: center;
  cursor: pointer;
}

.food-card-summary:active {
  background: rgba(255, 255, 255, 0.28);
}

.food-card-summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--score-text, var(--focus)) 72%, white);
  outline-offset: -3px;
  border-radius: 10px;
}

.compact-card-name {
  display: block;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
  font-size: clamp(10px, 3vw, 14px);
  font-weight: 780;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-card-category {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(7px, 2.2vw, 9px);
  font-weight: 680;
  line-height: 1.25;
  letter-spacing: 0.02em;
  opacity: 0.76;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-card-score {
  display: inline-flex;
  min-height: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: inherit;
}

.compact-card-score small {
  font-size: clamp(7px, 2vw, 9px);
  font-weight: 680;
  opacity: 0.76;
}

.compact-card-score strong {
  font-size: clamp(9px, 2.5vw, 11px);
  font-weight: 820;
  line-height: 1;
}

body.is-dialog-open {
  overflow: hidden;
}

.food-detail-dialog,
.portion-dialog {
  position: fixed;
  z-index: 60;
  inset: 0;
  width: min(92vw, 560px);
  max-width: none;
  max-height: min(86dvh, 720px);
  margin: auto;
  padding: 0;
  overflow: visible;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.food-detail-dialog::backdrop,
.portion-dialog::backdrop {
  background: rgba(20, 35, 26, 0.48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.food-dialog-card,
.portion-dialog-card {
  display: flex;
  max-height: min(86dvh, 720px);
  overflow: hidden;
  flex-direction: column;
  background: #fbfdfb;
  border: 1px solid rgba(221, 232, 223, 0.9);
  border-radius: 22px;
  box-shadow:
    0 26px 70px rgba(19, 40, 26, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
  animation: dialog-enter 180ms ease-out;
}

.food-dialog-header,
.portion-dialog-header {
  position: relative;
  flex: 0 0 auto;
  padding: 18px 58px 16px 19px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.14)),
    color-mix(in srgb, var(--score-bg, var(--brand-soft)) 76%, var(--score-border, var(--line)));
  border-bottom: 1px solid color-mix(in srgb, var(--score-border, var(--line)) 58%, white);
}

.food-dialog-category,
.food-dialog-score {
  margin: 0;
  color: var(--score-text, var(--brand-dark));
}

.food-dialog-category {
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.food-dialog-header h2 {
  margin: 0;
  color: var(--score-text, var(--ink));
  font-size: clamp(23px, 7vw, 30px);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.food-dialog-score {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 680;
}

.food-dialog-score strong {
  font-size: 14px;
  font-weight: 840;
}

.food-dialog-close,
.portion-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0 0 2px;
  place-items: center;
  color: #435249;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(126, 151, 134, 0.34);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(34, 65, 43, 0.09);
  cursor: pointer;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.food-dialog-close:active,
.portion-dialog-close:active {
  background: rgba(255, 255, 255, 0.94);
  transform: scale(0.96);
}

.food-detail-content,
.portion-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 19px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #fbfdfb, #f6faf7);
  -webkit-overflow-scrolling: touch;
}

.food-detail-content .food-description {
  line-height: 1.65;
}

.food-detail-content .nutrition-grid > div {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(215, 227, 218, 0.88);
}

.portion-dialog-category,
.portion-dialog-contribution {
  margin: 0;
  color: var(--score-text, var(--brand-dark));
}

.portion-dialog-category {
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.portion-dialog-header h2 {
  margin: 0;
  color: var(--score-text, var(--ink));
  font-size: clamp(23px, 7vw, 30px);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.portion-dialog-contribution {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 680;
}

.portion-dialog-label {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 720;
  text-align: center;
}

.portion-control {
  display: grid;
  width: min(100%, 340px);
  margin: 0 auto;
  grid-template-columns: 52px minmax(110px, 1fr) 52px;
  gap: 10px;
  align-items: center;
}

.portion-control button {
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  place-items: center;
  color: var(--brand-dark);
  background: linear-gradient(145deg, #e8f3eb, #d9eadf);
  border: 1px solid #bfd7c6;
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}

.portion-control button:active:not(:disabled) {
  background: #d0e5d5;
  transform: scale(0.97);
}

.portion-control button:disabled {
  color: #a7b0a9;
  background: #edf0ed;
  border-color: #e1e6e2;
  box-shadow: none;
  cursor: not-allowed;
}

.portion-control output {
  display: grid;
  min-height: 52px;
  padding: 0 10px;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: inset 0 1px 3px rgba(35, 68, 45, 0.04);
  font-size: clamp(20px, 6vw, 26px);
  font-weight: 820;
}

.portion-dialog-meta {
  display: flex;
  width: min(100%, 340px);
  margin: 11px auto 0;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-faint);
  font-size: 10px;
}

.portion-dialog-meta span:first-child {
  color: var(--brand-dark);
  font-weight: 760;
}

.portion-dialog-actions {
  display: grid;
  width: min(100%, 340px);
  margin: 18px auto 0;
  grid-template-columns: 1fr;
  gap: 9px;
}

.portion-dialog-actions button {
  min-height: 45px;
  padding: 9px 12px;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 780;
}

.portion-done-button {
  color: #fff;
  background: linear-gradient(145deg, #347f57, #286a48);
  border: 1px solid #2b704c;
  box-shadow: 0 7px 16px rgba(47, 119, 80, 0.18);
}

.food-description {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 13px;
}

.nutrition-block h4,
.recommendation-block h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 12px;
}

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

.nutrition-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 8px 9px;
  background: var(--surface);
  border: 1px solid #e8eee8;
  border-radius: 9px;
}

.nutrition-grid span,
.recommendation-block span {
  color: var(--ink-soft);
  font-size: 10px;
}

.nutrition-grid strong,
.recommendation-block strong {
  font-size: 11px;
}

.recommendation-block {
  margin-top: 14px;
}

.recommendation-block p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 5px 0;
  padding-bottom: 5px;
  border-bottom: 1px solid #e4ebe4;
}

.detail-footnote {
  margin: 12px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.empty-library {
  display: grid;
  min-height: 190px;
  padding: 30px 20px;
  place-items: center;
  align-content: center;
}

.empty-library > span {
  display: grid;
  width: 43px;
  height: 43px;
  margin-bottom: 10px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
  font-size: 22px;
}

.empty-library p {
  margin: 5px 0 0;
  font-size: 12px;
}

/* 食谱搭配 */
.segmented-control {
  display: grid;
  padding: 4px;
  background: #e3ebe4;
  border: 1px solid #d5e0d7;
  border-radius: 14px;
}

.meal-type-tabs {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
}

.segmented-control button {
  min-height: 43px;
  padding: 8px 12px;
  color: var(--ink-soft);
  background: transparent;
  border-radius: 10px;
  font-weight: 700;
}

.segmented-control button[aria-pressed="true"] {
  color: var(--brand-dark);
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(36, 65, 45, 0.09);
}

.quota-panel,
.food-picker,
.recent-section {
  margin-bottom: 14px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.quota-panel {
  padding: 12px 15px 10px;
}

.quota-heading {
  margin-bottom: 6px;
}

.quota-cups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.quota-card {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  text-align: center;
  --quota-color: var(--status-empty);
  --quota-soft: var(--status-empty-soft);
}

.quota-card[data-status="low"] {
  --quota-color: var(--status-low);
  --quota-soft: var(--status-low-soft);
}

.quota-card[data-status="ok"] {
  --quota-color: var(--status-ok);
  --quota-soft: var(--status-ok-soft);
}

.quota-card[data-status="high"] {
  --quota-color: var(--status-high);
  --quota-soft: var(--status-high-soft);
}

.quota-card h4 {
  width: 100%;
  min-height: 20px;
  margin: 0 0 3px;
  font-size: clamp(11px, 3.5vw, 13px);
  line-height: 1.3;
}

.cup-visual {
  position: relative;
  width: clamp(44px, 12vw, 56px);
  height: clamp(64px, 18vw, 82px);
  overflow: hidden;
  background:
    linear-gradient(102deg, rgba(255, 255, 255, 0.8) 0 16%, transparent 17% 100%),
    #f8faf8;
  border: 2px solid #aab6ad;
  border-top-color: #8c9b91;
  border-radius: 7px 7px 18px 18px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6);
}

.cup-visual::after {
  position: absolute;
  z-index: 4;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 4px 4px 14px 14px;
  content: "";
  pointer-events: none;
}

.cup-liquid {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--fill-height, 0%);
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.28), transparent 15%),
    var(--quota-color);
  opacity: 0.82;
  transition: height 380ms cubic-bezier(0.22, 0.72, 0.28, 1), background-color 180ms ease;
}

.cup-liquid::before {
  position: absolute;
  top: -3px;
  right: -4px;
  left: -4px;
  height: 6px;
  background: color-mix(in srgb, var(--quota-color) 76%, white);
  border-radius: 50%;
  content: "";
}

.target-line {
  position: absolute;
  z-index: 5;
  right: 3px;
  left: 3px;
  height: 0;
  border-top: 1px dashed rgba(44, 59, 49, 0.72);
  pointer-events: none;
}

.target-line span {
  position: absolute;
  top: -10px;
  left: 2px;
  min-width: 18px;
  padding: 1px 2px;
  color: #435048;
  background: rgba(248, 250, 248, 0.92);
  border: 1px solid rgba(174, 188, 178, 0.58);
  border-radius: 3px;
  font-size: 7px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
}

.maximum-line span {
  right: 2px;
  left: auto;
}

.minimum-line {
  bottom: var(--minimum-height, 0%);
}

.maximum-line {
  bottom: var(--maximum-height, 80%);
}

.quota-status-label {
  margin-top: 4px;
  padding: 2px 6px;
  color: color-mix(in srgb, var(--quota-color) 85%, #26392d);
  background: var(--quota-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.quota-values {
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  font-size: clamp(9px, 2.8vw, 11px);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quota-detail {
  min-height: 17px;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: clamp(8px, 2.4vw, 10px);
  line-height: 1.3;
}

.food-picker {
  padding: 0;
  overflow: hidden;
}

.builder-category-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 5px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}

.builder-category-tabs button {
  min-width: 0;
  min-height: 55px;
  padding: 7px 3px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.builder-category-tabs button > span,
.builder-category-tabs button > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-category-tabs button > span {
  font-size: clamp(11px, 3.3vw, 13px);
  font-weight: 750;
}

.builder-category-tabs button > small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: clamp(8px, 2.5vw, 10px);
}

.builder-category-tabs button[aria-pressed="true"] {
  color: var(--brand-dark);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(40, 71, 49, 0.08);
}

.builder-category-tabs button.has-selection:not([aria-pressed="true"]) > span::after {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 0 1px 4px;
  background: var(--status-ok);
  border-radius: 50%;
  content: "";
}

.picker-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 15px 0;
}

.picker-toolbar h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.picker-hint,
.picker-guidance {
  color: var(--ink-soft);
  font-size: 10px;
}

.picker-hint {
  margin: 2px 0 0;
}

.picker-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.picker-clear {
  min-height: 35px;
  padding: 5px 8px;
  color: var(--brand-dark);
  background: var(--brand-pale);
  border: 1px solid #c9ddce;
  border-radius: 9px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.picker-clear:disabled {
  color: var(--ink-faint);
  background: var(--surface-muted);
  border-color: var(--line);
  cursor: not-allowed;
  opacity: 0.65;
}

.mini-segmented {
  display: flex;
  flex: 0 0 auto;
  padding: 3px;
  background: var(--surface-muted);
  border-radius: 9px;
}

.mini-segmented button {
  min-height: 29px;
  padding: 5px 8px;
  color: var(--ink-soft);
  background: transparent;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
}

.mini-segmented button[aria-pressed="true"] {
  color: var(--brand-dark);
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(38, 67, 46, 0.08);
}

.picker-guidance {
  margin: 9px 15px 0;
  padding: 8px 9px;
  color: #68755f;
  background: #f2f5ec;
  border-radius: 9px;
  line-height: 1.45;
}

.food-options {
  min-height: 212px;
  padding: 14px;
}

.food-options.bubble-mode {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 11px 5px;
  place-items: center;
  align-content: center;
}

.food-bubble-wrap {
  --bubble-size: 98px;
  position: relative;
  width: var(--bubble-size);
  height: var(--bubble-size);
  animation: bubble-float 6.8s ease-in-out infinite;
}

.food-bubble {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 13px 8px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--score-text);
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.78), transparent 23%),
    var(--score-bg);
  border: 1px solid var(--score-border);
  border-radius: 47% 53% 49% 51% / 52% 48% 52% 48%;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.25),
    0 8px 17px rgba(52, 77, 59, 0.08);
  cursor: pointer;
  transition: opacity 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.food-bubble-wrap.bubble-variation-1 {
  --bubble-size: 104px;
  animation-delay: -2.1s;
  animation-duration: 7.7s;
}

.food-bubble-wrap.bubble-variation-2 {
  --bubble-size: 96px;
  animation-delay: -4.4s;
  animation-duration: 6.2s;
}

.food-bubble-wrap.bubble-variation-3 {
  --bubble-size: 101px;
  animation-delay: -1.3s;
  animation-duration: 8.1s;
}

.food-options.is-paused .food-bubble-wrap {
  animation-play-state: paused;
}

.food-bubble:hover {
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.32),
    0 9px 20px rgba(44, 79, 54, 0.13);
}

.food-bubble.is-selected {
  border: 3px solid var(--brand-dark);
  box-shadow:
    0 0 0 4px rgba(47, 119, 80, 0.14),
    0 10px 22px rgba(39, 86, 55, 0.14);
}

.food-bubble.is-severe:not(.is-selected) {
  opacity: 0.58;
  border-style: dashed;
}

.bubble-check {
  position: absolute;
  top: 5px;
  left: 7px;
  display: none;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #fff;
  background: var(--brand-dark);
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.food-bubble.is-selected .bubble-check {
  display: grid;
}

.bubble-remove {
  position: absolute;
  z-index: 3;
  top: 5px;
  right: 7px;
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  color: #99504b;
  background: rgba(255, 250, 249, 0.96);
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  box-shadow: 0 3px 9px rgba(94, 52, 48, 0.18);
  cursor: pointer;
  font-size: 18px;
  font-weight: 720;
  line-height: 1;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.bubble-remove:hover {
  background: #f7e8e5;
  box-shadow: 0 4px 11px rgba(94, 52, 48, 0.24);
}

.bubble-remove:active {
  transform: scale(0.92);
}

.bubble-name {
  max-width: 88px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.bubble-score {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.86;
}

.bubble-warning {
  margin-top: 2px;
  font-size: 8px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
}

.food-options.list-mode {
  display: grid;
  gap: 7px;
}

.food-option-row {
  position: relative;
  width: 100%;
}

.food-option-main-button {
  display: grid;
  width: 100%;
  min-height: 64px;
  padding: 9px 10px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
}

.food-option-row.is-selected .food-option-main-button {
  background: var(--brand-pale);
  border: 2px solid var(--brand);
}

.food-option-row.is-severe:not(.is-selected) .food-option-main-button {
  opacity: 0.62;
  border-style: dashed;
}

.food-option-row.has-remove .food-option-main-button {
  padding-right: 47px;
}

.option-remove-button {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 29px;
  height: 29px;
  padding: 0;
  place-items: center;
  color: #99504b;
  background: #fff8f7;
  border: 1px solid #e8cbc7;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transform: translateY(-50%);
}

.option-remove-button:hover {
  background: #f7e8e5;
}

.option-select-mark {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
  font-size: 17px;
  font-weight: 800;
}

.food-option-row.is-selected .option-select-mark {
  color: #fff;
  background: var(--brand);
}

.option-main {
  display: block;
  min-width: 0;
}

.option-main strong,
.option-main small,
.option-main em {
  display: block;
}

.option-main strong {
  font-size: 13px;
}

.option-main small {
  margin-top: 1px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-main em {
  margin-top: 3px;
  color: var(--status-high);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.3;
}

.score-chip {
  display: inline-grid;
  min-width: 39px;
  height: 31px;
  padding: 0 7px;
  place-items: center;
  color: var(--score-text);
  background: var(--score-bg);
  border: 1px solid var(--score-border);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}

.empty-picker {
  width: 100%;
  grid-column: 1 / -1;
  margin: 0;
  padding: 30px 16px;
}

.recent-section .section-row {
  margin-bottom: 12px;
}

.recent-meals {
  display: grid;
  gap: 7px;
}

.recent-meal-card {
  padding: 11px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.recent-meal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.recent-meal-meta {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.recent-meal-card strong {
  font-size: 11px;
}

.recent-meal-card time {
  color: var(--ink-faint);
  font-size: 9px;
}

.recent-meal-card p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.remove-recent-meal {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 4px 8px;
  color: var(--status-high);
  background: var(--status-high-soft);
  border: 1px solid #dfbfbc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.confirm-dock {
  position: fixed;
  z-index: 20;
  bottom: calc(74px + env(safe-area-inset-bottom));
  left: 50%;
  width: min(100%, var(--app-width));
  padding: 9px 18px 11px;
  background: linear-gradient(to top, rgba(251, 253, 250, 0.99) 72%, rgba(251, 253, 250, 0.92));
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-dock);
  transform: translateX(-50%);
}

.confirm-hint {
  margin: 0 0 6px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confirm-button,
.primary-button,
.secondary-button {
  width: 100%;
  min-height: 49px;
  padding: 11px 16px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}

.confirm-button,
.primary-button {
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  box-shadow: 0 7px 17px rgba(47, 119, 80, 0.2);
}

.confirm-button:disabled {
  color: #7b8780;
  background: #e2e7e3;
  border-color: #d8dfda;
  box-shadow: none;
  cursor: not-allowed;
}

.confirm-button[data-state="over"]:disabled {
  color: #94524d;
  background: var(--status-high-soft);
  border-color: #dfb9b5;
}

.secondary-button {
  color: var(--brand-dark);
  background: var(--surface);
  border: 1px solid #a9c8b2;
}

/* 确认结果 */
.meal-result {
  padding-top: 8px;
  animation: result-enter 320ms ease-out;
}

.result-hero {
  display: grid;
  margin-bottom: 16px;
  place-items: center;
  text-align: center;
}

.result-check {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 11px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border: 7px solid var(--brand-soft);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(47, 119, 80, 0.17);
  font-size: 22px;
  font-weight: 900;
}

.result-hero h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.result-hero > p:last-child {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.result-card {
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.result-foods {
  display: grid;
  gap: 14px;
}

.result-food-group h3 {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 11px;
}

.result-food-group p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  margin: 4px 0;
}

.result-food-group p span {
  color: var(--ink-soft);
  font-size: 13px;
}

.result-food-group p strong {
  font-size: 13px;
}

.result-divider {
  height: 1px;
  margin: 17px 0;
  background: repeating-linear-gradient(to right, var(--line-strong) 0 7px, transparent 7px 12px);
}

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

.result-quota-row {
  display: grid;
  padding: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: center;
  background: var(--brand-pale);
  border-radius: 10px;
}

.result-quota-row > span {
  font-size: 11px;
  font-weight: 700;
}

.result-quota-row > strong {
  color: var(--brand);
  font-size: 11px;
}

.result-quota-row > strong b {
  font-size: 10px;
}

.result-quota-row > small {
  grid-column: 1 / -1;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 9px;
}

.result-disclaimer {
  margin: 15px 0 0;
  padding-top: 11px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  font-size: 9px;
  line-height: 1.5;
}

.result-actions {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

/* 底部导航与全局反馈 */
.bottom-nav {
  position: fixed;
  z-index: 25;
  bottom: 8px;
  left: 50%;
  display: grid;
  width: min(calc(100% - 20px), calc(var(--app-width) - 20px));
  min-height: calc(60px + env(safe-area-inset-bottom));
  padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: rgba(250, 253, 250, 0.9);
  border: 1px solid rgba(196, 211, 200, 0.82);
  border-radius: 18px;
  box-shadow:
    0 14px 34px rgba(30, 58, 38, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  transform: translateX(-50%);
}

.bottom-nav button {
  display: flex;
  min-height: 48px;
  padding: 4px 10px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  color: #748078;
  background: transparent;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition: color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.bottom-nav button[aria-current="page"] {
  color: var(--brand-dark);
  background: linear-gradient(145deg, rgba(232, 244, 235, 0.94), rgba(244, 249, 245, 0.9));
  box-shadow: inset 0 0 0 1px rgba(196, 218, 202, 0.5);
}

.nav-symbol {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: inherit;
  border: 1.5px solid currentColor;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}

.bottom-nav button[aria-current="page"] .nav-symbol {
  color: #fff;
  background: linear-gradient(145deg, #347f57, #286a48);
  border-color: #2b704c;
  box-shadow: 0 4px 9px rgba(47, 119, 80, 0.2);
}

.toast {
  position: fixed;
  z-index: 50;
  bottom: calc(83px + env(safe-area-inset-bottom));
  left: 50%;
  max-width: min(88vw, 430px);
  padding: 9px 14px;
  color: #fff;
  background: rgba(29, 45, 36, 0.94);
  border-radius: 999px;
  box-shadow: 0 9px 24px rgba(23, 38, 29, 0.22);
  opacity: 0;
  font-size: 11px;
  text-align: center;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

body[data-active-page="builder"] .toast {
  bottom: calc(166px + env(safe-area-inset-bottom));
}

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

.load-error {
  display: grid;
  min-height: 56vh;
  padding: 30px 20px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.load-error > span {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  place-items: center;
  color: var(--status-high);
  background: var(--status-high-soft);
  border-radius: 50%;
  font-size: 25px;
  font-weight: 800;
}

.load-error h2 {
  margin: 0;
  font-size: 22px;
}

.load-error p {
  max-width: 25rem;
  margin: 8px 0 18px;
  color: var(--ink-soft);
  font-size: 13px;
}

.load-error .primary-button {
  width: auto;
  min-width: 140px;
}

/* 评分色阶：数字始终与颜色同时出现 */
.score-red,
.score-border-red {
  --score-bg: var(--score-red-bg);
  --score-text: var(--score-red-text);
  --score-border: var(--score-red-border);
}

.score-orange,
.score-border-orange {
  --score-bg: var(--score-orange-bg);
  --score-text: var(--score-orange-text);
  --score-border: var(--score-orange-border);
}

.score-yellow,
.score-border-yellow {
  --score-bg: var(--score-yellow-bg);
  --score-text: var(--score-yellow-text);
  --score-border: var(--score-yellow-border);
}

.score-light-green,
.score-border-light-green {
  --score-bg: var(--score-light-green-bg);
  --score-text: var(--score-light-green-text);
  --score-border: var(--score-light-green-border);
}

.score-deep-green,
.score-border-deep-green {
  --score-bg: var(--score-deep-green-bg);
  --score-text: var(--score-deep-green-text);
  --score-border: var(--score-deep-green-border);
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@keyframes result-enter {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

@keyframes loading-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes bubble-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  35% {
    transform: translate3d(2px, -4px, 0);
  }
  68% {
    transform: translate3d(-2px, 2px, 0);
  }
}

@media (hover: hover) {
  .food-card:hover {
    z-index: 1;
    border-color: color-mix(in srgb, var(--score-border, var(--line)) 88%, white);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.68),
      0 7px 17px rgba(31, 65, 42, 0.11);
    transform: translateY(-2px);
  }

  .category-filter button:not([aria-pressed="true"]):hover,
  .bottom-nav button:not([aria-current="page"]):hover {
    color: var(--brand-dark);
    background: rgba(255, 255, 255, 0.48);
  }
}

@media (min-width: 560px) {
  .app-header {
    padding-inline: 30px;
  }

  .app-main {
    padding-inline: 30px;
  }

  .food-library-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px;
  }

  .quota-panel,
  .food-picker,
  .recent-section {
    padding: 19px;
  }

  .quota-panel {
    padding: 13px 19px 11px;
  }

  .food-picker {
    padding: 0;
  }

  .builder-category-tabs {
    padding: 7px;
  }

  .picker-toolbar {
    padding: 18px 19px 0;
  }

  .picker-guidance {
    margin-inline: 19px;
  }

  .food-options {
    padding: 18px 19px;
  }

  .food-options.bubble-mode {
    grid-template-columns: repeat(4, minmax(100px, 1fr));
  }

  .food-bubble-wrap {
    --bubble-size: 110px;
  }

  .food-bubble-wrap.bubble-variation-1 {
    --bubble-size: 116px;
  }

  .food-bubble-wrap.bubble-variation-2 {
    --bubble-size: 106px;
  }

  .food-bubble-wrap.bubble-variation-3 {
    --bubble-size: 112px;
  }

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

@media (max-width: 359px) {
  .app-header,
  .app-main,
  .confirm-dock {
    padding-inline: 14px;
  }

  .category-filter {
    gap: 1px;
  }

  .category-filter button {
    padding-inline: 3px;
    font-size: 10px;
  }

  .food-detail-dialog,
  .portion-dialog {
    width: calc(100vw - 18px);
    max-height: 90dvh;
  }

  .food-dialog-card,
  .portion-dialog-card {
    max-height: 90dvh;
    border-radius: 18px;
  }

  .food-dialog-header,
  .portion-dialog-header {
    padding: 15px 52px 14px 15px;
  }

  .food-detail-content,
  .portion-dialog-body {
    padding: 15px;
  }

  .quota-panel,
  .recent-section {
    padding: 12px;
  }

  .food-options.bubble-mode {
    grid-template-columns: repeat(2, minmax(96px, 1fr));
  }

  .food-bubble-wrap {
    --bubble-size: 100px;
  }

  .food-bubble-wrap.bubble-variation-1,
  .food-bubble-wrap.bubble-variation-3 {
    --bubble-size: 104px;
  }
}

@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;
  }

  .food-bubble-wrap {
    animation: none !important;
  }
}
