/* Ритм — тёмное liquid glass. Полная замена style.css.
   Разметка не меняется: все селекторы те же, что генерирует app.js. */

:root {
  color-scheme: dark;

  /* фон и текст */
  --bg: #0A120D;
  --on-background: #EAF4EC;
  --muted-on-background: #9FB4A6;
  --ink: #EAF4EC;                 /* текст на стекле */
  --muted: #9FB4A6;               /* второстепенный текст на стекле */
  --faint: #8EA396;               /* подписи шкал, даты графика */
  --disabled: #55675D;

  /* акценты */
  --neon: #B8F24C;
  --accent: #C7F769;              /* иконки и акцентный текст на тёмном */
  --accent-ink: #0C1708;
  --accent-bg: rgba(184, 242, 76, .16);
  --accent-grad: linear-gradient(152deg, #D3FB7C, #A8E83C 58%, #BDF355);
  --water: #6BDCCB;
  --water-bg: rgba(107, 220, 203, .16);
  --energy: #F7B661;
  --danger: #FF8A80;

  /* стекло: одна рецептура, две плотности */
  --glass-layer:
    linear-gradient(152deg,
      rgba(255, 255, 255, .14),
      rgba(255, 255, 255, .035) 42%,
      rgba(255, 255, 255, .02) 64%,
      rgba(255, 255, 255, .09)),
    rgba(20, 34, 26, .52);
  --glass-control:
    linear-gradient(152deg,
      rgba(255, 255, 255, .13),
      rgba(255, 255, 255, .04) 55%,
      rgba(255, 255, 255, .08)),
    rgba(22, 36, 28, .48);
  --glass-nav:
    linear-gradient(152deg,
      rgba(255, 255, 255, .16),
      rgba(255, 255, 255, .04) 44%,
      rgba(255, 255, 255, .02) 66%,
      rgba(255, 255, 255, .11)),
    rgba(14, 26, 19, .92);
  --glass-dialog:
    linear-gradient(152deg,
      rgba(255, 255, 255, .17),
      rgba(255, 255, 255, .045) 40%,
      rgba(255, 255, 255, .02) 64%,
      rgba(255, 255, 255, .10)),
    rgba(17, 29, 22, .95);

  /* плоские поверхности — плитки недели, строки, подложки */
  --flat: rgba(255, 255, 255, .055);
  --sunken: rgba(0, 0, 0, .3);

  /* кромки и тени */
  --edge: rgba(255, 255, 255, .13);
  --edge-soft: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .09);
  --rim: inset 0 1px 0 rgba(255, 255, 255, .26);
  --rim-soft: inset 0 1px 0 rgba(255, 255, 255, .2);
  --lift: 0 14px 34px rgba(0, 0, 0, .45);
  --lift-strong: 0 18px 40px rgba(0, 0, 0, .52);
  --sink: inset 0 1px 2px rgba(0, 0, 0, .4);
  --glow: 0 0 26px rgba(168, 232, 60, .28);

  /* blur по слоям: чем выше слой, тем гуще */
  --blur-control: blur(14px) saturate(140%);
  --blur-card: blur(26px) saturate(165%);
  --blur-nav: blur(32px) saturate(175%);
  --blur-dialog: blur(40px) saturate(180%);

  /* шкалы: 4 / 8 / 12 / 16 / 24 / 32 и три радиуса */
  --r-control: 14px;
  --r-card: 22px;
  --r-pill: 999px;

  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--on-background);
  isolation: isolate;
}

/* живой фон: без него стекло не читается как стекло */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(58% 34% at 88% 2%, rgba(126, 230, 124, .40), transparent 62%),
    radial-gradient(54% 30% at 2% 32%, rgba(62, 182, 166, .28), transparent 64%),
    radial-gradient(64% 32% at 72% 58%, rgba(150, 240, 90, .18), transparent 62%),
    radial-gradient(74% 36% at 40% 104%, rgba(96, 210, 110, .26), transparent 62%),
    linear-gradient(180deg, #0C1811 0%, #0A120D 52%, #081009 100%);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .42; cursor: default; }
svg { flex: none; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ─── типографика ─────────────────────────────────────────── */

h1 {
  font-size: clamp(28px, 8.3vw, 32px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
h2 { font-size: 17px; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
h3 { font-size: 13px; font-weight: 600; }

.muted { color: var(--muted); font-size: 13px; }
.eyebrow {
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

/* ─── каркас ──────────────────────────────────────────────── */

.shell {
  max-width: 510px;
  margin: auto;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(118px + env(safe-area-inset-bottom));
}

header { min-height: 48px; display: flex; align-items: center; margin-bottom: 16px; }
.signed-in header { display: none; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.brand img { border-radius: 10px; }

.heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}
.heading .eyebrow { margin-bottom: 5px; }
.heading > div { min-width: 0; }

.section { margin-top: 24px; }
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* ─── слой 1: карточки ────────────────────────────────────── */

.card {
  background: var(--glass-layer);
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  padding: 18px 16px;
  box-shadow: var(--rim), var(--lift);
  -webkit-backdrop-filter: var(--blur-card);
  backdrop-filter: var(--blur-card);
}

/* ─── слой 2: контролы ────────────────────────────────────── */

.btn {
  min-height: 44px;
  border: 1px solid var(--edge);
  border-radius: var(--r-control);
  padding: 8px 14px;
  background: var(--glass-control);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  text-align: center;
  box-shadow: var(--rim-soft);
  -webkit-backdrop-filter: var(--blur-control);
  backdrop-filter: var(--blur-control);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--edge);
  background: var(--glass-control);
  color: #D7E6DB;
  border-radius: 50%;
  box-shadow: var(--rim-soft);
  -webkit-backdrop-filter: var(--blur-control);
  backdrop-filter: var(--blur-control);
}

.primary {
  min-height: 52px;
  border-radius: 16px;
  color: var(--accent-ink);
  background: var(--accent-grad);
  border-color: rgba(255, 255, 255, .28);
  font-size: 15px;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    0 12px 26px rgba(0, 0, 0, .42),
    0 0 24px rgba(168, 232, 60, .22);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* текстовые кнопки: ни рамки, ни стекла.
   В старом файле их перебивало общее правило по .btn */
.subtle,
.text-button {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.text-button {
  color: var(--muted);
  font-size: 13px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
}

.danger, .error { color: var(--danger); }
.wide { width: 100%; }
.actions { display: flex; gap: 8px; }
.actions > .btn { flex: 1; }

/* ─── календарь: плоский, чтобы неделя не кричала ─────────── */

.calendar { display: grid; gap: 11px; margin-bottom: 24px; }

.week-controls {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.week-controls .icon-button {
  width: 44px;
  height: 44px;
  background: var(--flat);
  border-color: var(--edge-soft);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.week-label { color: var(--muted-on-background); font-size: 13px; font-weight: 600; }

.calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-days button {
  border: 1px solid var(--edge-soft);
  border-radius: 15px;
  min-width: 44px;
  min-height: 56px;
  padding: 3px 0;
  background: var(--flat);
  color: var(--ink);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.calendar-days span { color: inherit; opacity: .74; font-size: 11px; text-transform: lowercase; }
.calendar-days strong { font-size: 15px; font-weight: 600; }
.calendar-days button:disabled { background: transparent; border-color: rgba(255, 255, 255, .05); color: var(--disabled); opacity: 1; }
.calendar-days [aria-pressed="true"] {
  background: var(--accent-grad);
  color: var(--accent-ink);
  border-color: rgba(255, 255, 255, .3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    0 8px 18px rgba(0, 0, 0, .42),
    0 0 22px rgba(168, 232, 60, .26);
}
.calendar-days [aria-pressed="true"] span { color: inherit; opacity: .78; }

.calendar-compact { display: none; }
@media (max-width: 371px) {
  .calendar-days { display: none; }
  .calendar-compact { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 8px; }
}

/* ─── метрики дня ─────────────────────────────────────────── */

.totals { display: grid; gap: 18px; }
.metric { display: grid; gap: 9px; }
.metric-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.metric h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.metric strong {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.metric small,
.weight-summary small { color: var(--muted); font-size: 12px; }

/* калории — главная метрика дня */
.calories { border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.calories strong { font-size: 28px; letter-spacing: -.035em; }
.calories svg { color: var(--energy); }
.protein svg, .push-card h2 svg { color: var(--accent); }
.water svg { color: var(--water); }

progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: rgba(0, 0, 0, .28);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .4);
  --fill: linear-gradient(90deg, #96D53C, #B8F24C);
}
.calories progress { --fill: linear-gradient(90deg, #E99A3E, #F7B661); }
.water progress { --fill: linear-gradient(90deg, #3FB9A8, #6BDCCB); }
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background: var(--fill); border-radius: var(--r-pill); }
progress::-moz-progress-bar { background: var(--fill); border-radius: var(--r-pill); }

.water-actions { margin-top: 2px; }
.totals + .water-actions { margin-top: 12px; } /* когда кнопки вынесены из карточки — см. PATCH.md */
.water-actions .btn {
  background: var(--glass-control);
  color: var(--ink);
  border-color: var(--edge);
  font-size: 14px;
  border-radius: var(--r-control);
}
.water-actions .btn svg { color: var(--water); }

/* ─── списки ──────────────────────────────────────────────── */

.section-list { margin-top: 12px; }
.empty strong { display: block; margin-bottom: 4px; font-size: 15px; }

.rows { padding: 0; overflow: hidden; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 57px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}
.row:last-child { border-bottom: 0; }
.row > svg:last-child { color: #67786E; }
.row-content { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-content strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 2px;
}
.row-content p {
  white-space: pre-line;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-icon {
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
/* строка жидкости — бирюзовая плашка; нужен класс .water из PATCH.md, без него строка просто лаймовая */
.row-icon.water { background: var(--water-bg); color: var(--water); }

details summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  color: var(--muted-on-background);
  font-size: 13px;
}

/* ─── вес и курс ──────────────────────────────────────────── */

.weight-card, .upcoming, .push-card { margin-bottom: 16px; }
.weight-card h2, .push-card h2 { font-size: 17px; }

.weight-summary, .chart-dates, .upcoming-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.weight-summary { margin-top: 16px; }
.weight-summary strong {
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.weight-change {
  background: var(--accent-bg);
  color: var(--accent);
  padding: 7px 12px;
  border-radius: var(--r-pill);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.weight-chart { display: block; width: 100%; height: auto; margin-top: 16px; }
.weight-chart polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.weight-chart circle { fill: var(--accent); }
.weight-chart .chart-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.weight-chart .chart-area { fill: url(#weight-fill); stroke: none; }
.weight-chart .chart-goal { fill: none; stroke: #637569; stroke-width: 1; stroke-dasharray: 4 5; }
.weight-chart .chart-goal-label { fill: var(--faint); font-size: 10px; font-weight: 600; }
.chart-dates { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; margin-top: 4px; }

.upcoming, .estimate { background: var(--glass-layer); }
.upcoming .eyebrow, .estimate .eyebrow { color: var(--accent); margin-bottom: 8px; }
.upcoming-body h2 { overflow-wrap: anywhere; }
.upcoming-body > strong { font-size: 24px; font-weight: 650; letter-spacing: -.03em; }

.push-card, .section + .wide { margin-top: 16px; }
.push-card .muted { margin: 8px 0 12px; }

/* ─── слой 3: навигация ───────────────────────────────────── */

nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 40px), 470px);
  z-index: 1;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: var(--r-pill);
  background: var(--glass-nav);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), var(--lift-strong);
  -webkit-backdrop-filter: var(--blur-nav);
  backdrop-filter: var(--blur-nav);
}
nav button {
  min-height: 52px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  padding: 3px 0;
  display: grid;
  place-items: center;
}
nav button span { display: block; margin-top: 1px; }
nav [aria-current="page"] {
  color: var(--accent);
  background: var(--accent-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
  font-weight: 700;
}

/* камера — не вкладка, а действие: круглая кнопка над баром */
nav .camera-tab {
  width: 56px;
  height: 56px;
  min-height: 0;
  justify-self: center;
  margin-top: -28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .3);
  background: var(--accent-grad);
  color: var(--accent-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    0 12px 26px rgba(0, 0, 0, .5),
    var(--glow);
}
nav .camera-tab span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ─── слой 4: диалог ──────────────────────────────────────── */

dialog {
  width: min(calc(100% - 24px), 490px);
  max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 26px;
  color: var(--ink);
  background: var(--glass-dialog);
  overscroll-behavior: contain;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), 0 22px 52px rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: var(--blur-dialog);
  backdrop-filter: var(--blur-dialog);
}
dialog::backdrop { background: rgba(5, 11, 8, .58); }
dialog .section-title { margin-bottom: 16px; }
dialog .text-button { color: var(--muted); }
dialog .estimate, dialog .vision { margin-bottom: 14px; }

/* ─── формы: утопленные, а не стеклянные ──────────────────── */

form { display: grid; gap: 14px; }
label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
input:not([type="checkbox"]), select, textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  min-height: 48px;
  border: 1px solid var(--edge);
  background: var(--sunken);
  box-shadow: var(--sink);
  color: var(--ink);
  border-radius: 13px;
  font-size: 16px;
  font-weight: 400;
}
input:not([type="checkbox"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--neon);
  box-shadow: var(--sink), 0 0 0 3px rgba(184, 242, 76, .24);
}
textarea { resize: vertical; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.inline { display: flex; align-items: center; gap: 11px; min-height: 44px; }
.inline input { width: 20px; height: 20px; accent-color: var(--neon); }
.error { font-size: 13px; }
.meal-fields { display: grid; gap: 14px; min-width: 0; padding: 0; margin: 0; border: 0; }
.photo-preview { display: grid; gap: 10px; }

input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input, textarea { caret-color: var(--neon); }
::selection { background: var(--neon); color: var(--accent-ink); }

/* ─── вход ────────────────────────────────────────────────── */

.login {
  max-width: 390px;
  margin: 0 auto;
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login form { margin-top: 24px; }
.login .eyebrow, .login label { color: var(--muted-on-background); }
.login .error { color: #FFBDB5; }

/* ─── прочее ──────────────────────────────────────────────── */

#toast {
  position: fixed;
  z-index: 2;
  bottom: calc(100px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass-dialog);
  border: 1px solid var(--edge);
  box-shadow: var(--rim), var(--lift);
  -webkit-backdrop-filter: var(--blur-nav);
  backdrop-filter: var(--blur-nav);
  color: var(--on-background);
  width: max-content;
  max-width: 90vw;
  padding: 12px 16px;
  border-radius: var(--r-control);
  text-align: center;
  font-size: 14px;
}

.vision, .estimate {
  padding: 12px;
  border-radius: 16px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--edge);
  background: var(--glass-control);
  box-shadow: var(--rim-soft);
}
.vision img {
  max-height: 120px;
  width: 100%;
  object-fit: contain;
  background: var(--sunken);
  border-radius: 10px;
}
.estimate h3 { font-size: 17px; }

.header-actions { display: flex; flex: none; gap: 8px; }
.header-actions [aria-current="page"] {
  background: var(--accent-grad);
  color: var(--accent-ink);
  border-color: rgba(255, 255, 255, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}
.section-tools { display: flex; gap: 2px; flex: none; margin-right: -8px; }

/* ─── отчёт ───────────────────────────────────────────────── */

.report-controls { margin-bottom: 24px; }
.report-period { min-width: 0; border: 0; padding: 0; margin: 0; }
.report-period legend { color: var(--muted-on-background); font-size: 13px; font-weight: 650; margin-bottom: 8px; }
.period-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.period-switch label { position: relative; }
.period-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.period-switch span {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 8px 4px;
  border-radius: var(--r-control);
  border: 1px solid var(--edge-soft);
  background: var(--flat);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.period-switch input:checked + span {
  background: var(--accent-grad);
  color: var(--accent-ink);
  border-color: rgba(255, 255, 255, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}
.period-switch input:focus-visible + span { outline: 2px solid var(--neon); outline-offset: 3px; }

.report-result { display: grid; gap: 16px; outline: none; }
.report-result:focus-visible { outline: 2px solid var(--neon); outline-offset: 5px; border-radius: var(--r-card); }
.report-hero { display: grid; gap: 8px; }
.report-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.report-brand img { border-radius: 11px; }
.report-brand .eyebrow { font-size: 10px; letter-spacing: .06em; }
.report-hero h2 { font-size: 24px; letter-spacing: -.025em; }
.report-range { font-size: 16px; line-height: 1.45; font-weight: 600; }
.report-average { display: grid; gap: 5px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; color: var(--muted); }
.report-average strong { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }

.report-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin: 12px 0;
}
.report-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.report-table th, .report-table td { padding: 10px 3px; border-bottom: 1px solid var(--line); text-align: right; overflow-wrap: anywhere; }
.report-table th { font-weight: 600; }
.report-table th:first-child { text-align: left; }
.report-table thead { color: var(--muted); }

.report-course { display: grid; gap: 16px; }
.report-weight { display: grid; gap: 6px; }
.report-weight > strong { font-size: 30px; line-height: 1.15; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.report-weight small { font-size: 13px; font-weight: 500; color: var(--muted); }
.report-entries { display: grid; gap: 12px; }
.report-entry { border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; overflow-wrap: anywhere; }
.report-effects { margin-top: 5px; white-space: pre-wrap; }
.report-footer { text-align: center; color: var(--muted-on-background); }
.report-actions { flex-wrap: wrap; }
.report-actions .btn { min-width: 125px; }
.report-actions a { text-decoration: none; }

/* ─── подписи поверх фона, а не поверх стекла ─────────────── */

.heading .eyebrow,
.section-title > .muted,
label.calendar-compact,
.text-button,
details summary,
#main > p.muted { color: var(--muted-on-background); }
.card .section-title > .muted { color: var(--muted); }

/* ─── движение ────────────────────────────────────────────── */

button, a.btn { touch-action: manipulation; transition: filter 150ms ease-out; }
button:active:not(:disabled), a.btn:active { filter: brightness(1.12); }
@media (hover: hover) {
  button:hover:not(:disabled), a.btn:hover { filter: brightness(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  button, a.btn { transition: none; }
}

/* ─── запасной вариант там, где нет backdrop-filter ───────── */

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .card, .upcoming, .estimate { background: #16241C; }
  .btn:not(.primary):not(.subtle):not(.text-button), .icon-button, .vision { background: #1C2C23; }
  nav { background: #141F19; }
  dialog, #toast { background: #18261E; }
}

/* Порция и расчёт питания — в текущей стеклянной теме. */
.nutrition-mode, .nutrition-inputs { min-width: 0; border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
.nutrition-mode legend { color: var(--muted); font-size: 14px; font-weight: 650; margin-bottom: 8px; }
.nutrition-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nutrition-summary { border-top: 1px solid var(--edge); padding-top: 12px; color: var(--ink); font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calorie-goal { justify-self: start; text-align: left; padding-left: 0; color: var(--muted); }
.estimate-description { white-space: pre-wrap; }

.section-title { flex-wrap: wrap; }
dialog > .section-title { flex-wrap: nowrap; }
.section-title > h2 { min-width: 0; }
dialog::backdrop { background: rgba(5, 11, 8, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.goal-track { height: 5px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .28); }
