/* «Живое питание» — структура и раскладка.
   Цвета, шрифты и скругления живут в themes.css — он собирается из tools/themes.json. */

:root {
  --radius-sm: 12px;
  --tabbar-h: 66px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --shadow: 0 1px 2px rgba(20, 24, 15, .05), 0 6px 20px rgba(20, 24, 15, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); }
}
:root[data-theme="dark"] { --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); }

/* Карточки: тема выбирает, чем они отделяются от фона. */
:root[data-cards="граница"] .card { box-shadow: none; border-color: var(--line-strong); }
:root[data-cards="заливка"] .card { box-shadow: none; border-color: transparent; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  touch-action: pan-x pan-y;
  overscroll-behavior-y: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
:root[data-motion="calm"] * { animation: none !important; transition: none !important; }

.boot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  min-height: 100dvh; color: var(--muted); font-size: 15px;
}
.boot svg { opacity: .8; }

/* ——— Каркас ——— */

#app { min-height: 100dvh; }

.screen {
  padding: calc(var(--safe-top) + 14px) 16px calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  max-width: 560px;
  margin: 0 auto;
}
.screen.plain { padding-bottom: calc(var(--safe-bottom) + 28px); }

.topbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 36px;
}
.topbar .grow { min-width: 0; }
.topbar h1 { margin: 0; font-size: 23px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.topbar .sub { color: var(--muted); font-size: 13.5px; }

.iconbtn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; padding: 0;
}
.iconbtn:active { background: var(--surface-2); }
.iconbtn.bare { border-color: transparent; background: transparent; }

/* ——— Карточки ——— */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
a.card, button.card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: left; color: inherit; text-decoration: none; cursor: pointer; font: inherit;
}
a.card:active, button.card:active { background: var(--surface-2); }
.card.flat { box-shadow: none; }
.card.tight { padding: 12px; }
.card.soft { background: var(--surface-2); box-shadow: none; }

.h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.h3 { margin: 0 0 3px; font-size: 15.5px; font-weight: 650; }
.small { font-size: 13.5px; }
.muted { color: var(--muted); }
.strong { font-weight: 650; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.row-gap { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 12px; }
.mb0 { margin-bottom: 0; }

.section-title {
  margin: 22px 0 9px; font-size: 12.5px; font-weight: 650; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
}
.section-title:first-child { margin-top: 4px; }

/* ——— Кнопки ——— */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 46px; padding: 0 18px; border-radius: 13px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:active { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn-small { min-height: 38px; padding: 0 13px; font-size: 14px; border-radius: 11px; }
.btn-wide { width: 100%; }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn:disabled { opacity: .45; cursor: default; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
}
.chip.soft { background: var(--surface-2); border-color: transparent; }
/* Выбранное состояние сильнее «мягкого» — иначе отбор не видно. */
.chip[aria-pressed="true"], .chip.on, .chip.soft.on, .chip.soft[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600;
}

/* Ряд отбора: одна строка с прокруткой, а не три строки чипсов на пол-экрана. */
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row > .chip { flex: none; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); color: var(--muted);
}
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-yellow { background: var(--yellow-soft); color: var(--yellow); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-sky { background: var(--sky-soft); color: var(--sky-ink); }
.tag-earth { background: var(--earth-soft); color: var(--earth-ink); }
.tag-lock { background: var(--sun-soft); color: var(--sun-ink); }

/* ——— Поля ——— */

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
input[type="text"], input[type="time"], input[type="number"], input[type="search"], textarea, select {
  width: 100%; padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus-visible, textarea:focus-visible, select:focus-visible,
.btn:focus-visible, .chip:focus-visible, .card:focus-visible, .iconbtn:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
::placeholder { color: var(--muted); opacity: .75; }

/* ——— Нижние вкладки ——— */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar-h); border: 0; background: none; color: var(--muted);
  font: inherit; font-size: 10.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  padding: 0 2px;
}
.tab .ic { width: 23px; height: 23px; }
.tab[aria-current="page"] { color: var(--accent); }
.tab span { letter-spacing: -.01em; }

/* ——— Кольца дня ——— */

.rings { display: block; }
.ring-track { fill: none; stroke: var(--track); stroke-width: 8; }
.ring-arc { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .7s cubic-bezier(.3, .9, .3, 1); }
.ring-body { stroke: var(--ring-body); }
.ring-food { stroke: var(--ring-food); }
.ring-spirit { stroke: var(--ring-spirit); }

.rings-card { display: flex; align-items: center; gap: 16px; }
.rings-legend { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.rings-legend b { font-weight: 650; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.dot-body { background: var(--ring-body); }
.dot-food { background: var(--ring-food); }
.dot-spirit { background: var(--ring-spirit); }

/* ——— Шкала воспаления ——— */

.balance { margin-top: 4px; }
.balance-bar {
  position: relative; height: 12px; border-radius: 999px; overflow: hidden;
  background: linear-gradient(90deg, var(--red) 0%, var(--yellow) 50%, var(--green) 100%);
  opacity: .9;
}
.balance-pin {
  position: absolute; top: -4px; width: 4px; height: 20px; border-radius: 3px;
  background: var(--text); box-shadow: 0 0 0 3px var(--surface);
  transition: left .6s cubic-bezier(.3, .9, .3, 1);
}
.balance-ends { display: flex; justify-content: space-between; margin-top: 7px; font-size: 12.5px; color: var(--muted); }

/* ——— Полоски прогресса ——— */

.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .5s ease; }
.bar.green > i { background: var(--green); }
.bar.sun > i { background: var(--sun); }
.bar.earth > i { background: var(--earth); }

/* ——— Дорожная карта ——— */

.road { position: relative; padding-left: 34px; }
.road::before {
  content: ''; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--line-strong), var(--line));
}
.road-step { position: relative; margin-bottom: 12px; }
.road-node {
  position: absolute; left: -34px; top: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 2px solid var(--line-strong);
  color: var(--muted); font-size: 13px; font-weight: 700;
}
.road-step.done .road-node { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.road-step.now .road-node { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.road-step.locked { opacity: .62; }
.road-step.locked .card { box-shadow: none; }

/* ——— Светофор тарелки ——— */

.plate-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.plate-cell { padding: 11px 6px; border-radius: 13px; background: var(--surface-2); }
.plate-cell b { display: block; font-size: 21px; line-height: 1.2; }
.plate-cell.g { background: var(--green-soft); color: var(--green); }
.plate-cell.y { background: var(--yellow-soft); color: var(--yellow); }
.plate-cell.r { background: var(--red-soft); color: var(--red); }
.plate-cell span { font-size: 12px; color: inherit; opacity: .85; }
/* Та же форма-подсказка, что и на метках еды. */
.plate-cell::before {
  content: ''; display: block; width: 9px; height: 9px; margin: 0 auto 5px; background: currentColor;
}
.plate-cell.g::before { border-radius: 50%; }
.plate-cell.y::before { border-radius: 1px; transform: rotate(45deg); }
.plate-cell.r::before { border-radius: 1px; }

.meal { display: flex; gap: 11px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.meal:last-child { border-bottom: 0; padding-bottom: 0; }
.meal-time { flex: none; width: 46px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.meal-items { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.food-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 13px; background: var(--surface-2);
}
/* Метка различается не только цветом, но и формой: круг — зелёное, ромб — жёлтое,
   квадрат — красное. Иначе человек с нарушением цветовосприятия не прочитает тарелку. */
.food-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.food-pill.g { background: var(--green-soft); color: var(--green); }
.food-pill.g::before { background: var(--green); border-radius: 50%; }
.food-pill.y { background: var(--yellow-soft); color: var(--yellow); }
.food-pill.y::before { background: var(--yellow); border-radius: 1px; transform: rotate(45deg); }
.food-pill.r { background: var(--red-soft); color: var(--red); }
.food-pill.r::before { background: var(--red); border-radius: 1px; }

/* В кладовой таблетка — кнопка «убрать»: снимаем рамку браузера. */
button.food-pill {
  border: 0; font: inherit; font-size: 13px; cursor: pointer; color: inherit;
  padding: 5px 10px;
}
button.food-pill .pill-x { margin-left: 2px; opacity: .55; font-size: 11px; }
button.food-pill:hover .pill-x { opacity: 1; }


/* ——— Набор дня ——— */

.dozen { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.dozen-item {
  border: 1px solid var(--line); border-radius: 13px; background: var(--surface);
  padding: 10px 9px; text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.dozen-item.full { background: var(--green-soft); border-color: transparent; }
.dozen-item .n { font-size: 12px; color: var(--muted); }
.dozen-item .t { font-size: 13.5px; font-weight: 600; line-height: 1.25; margin-bottom: 6px; }
.dozen-pips { display: flex; gap: 3px; }
.dozen-pips i { width: 9px; height: 9px; border-radius: 50%; background: var(--track); }
.dozen-pips i.on { background: var(--green); }

/* ——— Счётчики ——— */

.counter { display: flex; align-items: center; gap: 12px; }
.counter b { font-size: 25px; font-weight: 700; min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.stepper button:active { background: var(--surface-2); }

/* ——— Шкалы самочувствия ——— */

.scale { display: flex; gap: 6px; }
.scale button {
  flex: 1; min-height: 42px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font: inherit; font-weight: 600; cursor: pointer;
}
.scale button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.scale-ends { display: flex; justify-content: space-between; margin-top: 5px; font-size: 12.5px; color: var(--muted); }

.body-map { display: flex; flex-wrap: wrap; gap: 7px; }

/* ——— Окно голода ——— */

.fast-ring { display: flex; align-items: center; gap: 15px; }
.fast-dial { position: relative; flex: none; }
.fast-dial .val {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.fast-dial .val b { font-size: 23px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.fast-dial .val span { font-size: 11.5px; color: var(--muted); }

/* ——— Библиотека ——— */

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lib-card {
  display: flex; flex-direction: column; gap: 5px; padding: 13px;
  border-radius: 15px; border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; color: inherit; cursor: pointer; text-align: left; font: inherit;
}
.lib-card .t { font-weight: 650; font-size: 14.5px; line-height: 1.25; }
.lib-card .d { font-size: 12.5px; color: var(--muted); }

.search-row { position: relative; margin-bottom: 12px; }
.search-row .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-row input { padding-left: 40px; }

.list-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  background: none; border-left: 0; border-right: 0; border-top: 0;
  text-align: left; color: inherit; font: inherit; cursor: pointer; text-decoration: none;
}
.list-row:last-child { border-bottom: 0; }
.list-row:active { opacity: .7; }

/* ——— Уведомления, подсказки ——— */

.note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 13px; border-radius: 14px; background: var(--sun-soft); color: var(--sun-ink);
  font-size: 13.5px; line-height: 1.45; margin-bottom: 12px;
}
.note .ic { flex: none; margin-top: 1px; }
.note-care { background: var(--danger-soft); color: var(--danger); }
.note-info { background: var(--sky-soft); color: var(--sky-ink); }
.note-ok { background: var(--accent-soft); color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%); z-index: 60;
  padding: 11px 17px; border-radius: 13px; max-width: 90vw;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .25);
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ——— Модальное окно ——— */

.sheet-back {
  position: fixed; inset: 0; z-index: 50; background: rgba(20, 24, 15, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(var(--safe-bottom) + 20px);
  animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1);
}
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-grip { width: 40px; height: 4px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 14px; }
.sheet h2 { margin: 0 0 10px; font-size: 19px; }

/* ——— Онбординг ——— */

.intro { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(var(--safe-top) + 20px) 20px calc(var(--safe-bottom) + 20px); max-width: 560px; margin: 0 auto; }
.intro-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.intro h1 { font-family: var(--serif); font-size: 31px; line-height: 1.15; margin: 0 0 10px; font-weight: 600; }
.intro p.lead { font-size: 16px; color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.intro-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.intro-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.intro-dots i.on { background: var(--accent); width: 18px; border-radius: 3px; }

.pick-list { display: flex; flex-direction: column; gap: 9px; }
.pick {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px;
  border-radius: 15px; border: 1.5px solid var(--line); background: var(--surface);
  cursor: pointer; font: inherit; color: inherit; text-align: left; width: 100%;
}
.pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pick .pick-mark {
  flex: none; width: 22px; height: 22px; border-radius: 7px; margin-top: 1px;
  border: 1.5px solid var(--line-strong); display: flex; align-items: center; justify-content: center;
  color: transparent;
}
.pick[aria-pressed="true"] .pick-mark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pick.round .pick-mark { border-radius: 50%; }
.pick b { display: block; font-weight: 650; font-size: 15.5px; }
.pick span.d { font-size: 13.5px; color: var(--muted); line-height: 1.4; }

/* ——— Развилка «вегетарианец / мясоед» ——— */

.fork { display: grid; gap: 10px; }
.fork-card {
  padding: 17px; border-radius: 17px; border: 1.5px solid var(--line);
  background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit;
}
.fork-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.fork-card .ic { color: var(--accent); margin-bottom: 7px; }
.fork-card b { display: block; font-size: 17px; margin-bottom: 3px; }
.fork-card span { font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* ——— Календарь-полоска ——— */

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.week-day {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 2px; border-radius: 12px; border: 1px solid transparent;
  background: none; font: inherit; color: var(--muted); cursor: pointer; font-size: 11.5px;
}
.week-day b { font-size: 14px; color: var(--text); font-weight: 600; }
.week-day.today { border-color: var(--accent); }
.week-day.sel { background: var(--accent); color: var(--accent-ink); }
.week-day.sel b { color: var(--accent-ink); }
.week-day .mark { width: 6px; height: 6px; border-radius: 50%; background: var(--track); }
.week-day .mark.on { background: var(--green); }
.week-day.sel .mark.on { background: var(--accent-ink); }

/* ——— График ——— */

.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .plot { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .plot-2 { stroke: var(--earth); }
.chart .area { fill: var(--accent-soft); opacity: .7; }
.chart .pt { fill: var(--accent); }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--sans); }

/* ——— Платное ——— */

.pro-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 999px; background: var(--sun-soft); color: var(--sun-ink);
  font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.locked-card { position: relative; overflow: hidden; }
.locked-card .veil {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(3px);
}

.price-grid { display: grid; gap: 10px; }
.price {
  padding: 16px; border-radius: 17px; border: 1.5px solid var(--line); background: var(--surface);
  text-align: left; cursor: pointer; font: inherit; color: inherit; position: relative;
}
.price[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.price .amt { font-size: 24px; font-weight: 700; }
.price .per { font-size: 13.5px; color: var(--muted); }
.price .save { position: absolute; right: 14px; top: 14px; }

/* ——— Разбор съеденного ——— */

/* Плашка, которую нельзя свернуть и пролистать мимо. Разбор человек читает
   каждый день, и граница «это сведения, а не приём у врача» должна быть
   на экране, а не в настройках, куда заходят один раз. */
.pinned-note {
  margin: 0 0 12px; padding: 9px 12px; border-radius: 11px;
  background: var(--sky-soft); color: var(--sky-ink);
  font-size: 13px; line-height: 1.45;
}


/* Каждое правило свёрнуто: на экране записи еды человеку нужен ответ
   «есть ли тут что-то важное», а не стена текста. Подробности — по нажатию. */
.rule {
  border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px;
  margin-bottom: 8px; background: var(--surface);
}
.rule > summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  list-style: none; font-size: 14.5px;
}
.rule > summary::-webkit-details-marker { display: none; }
.rule > summary::after {
  content: ''; flex: none; width: 8px; height: 8px; margin-left: 2px;
  border-right: 1.7px solid var(--muted); border-bottom: 1.7px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s;
}
.rule[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.rule b { font-weight: 650; }

/* График по дням. Столбцы, а не линия: пропуск в записях — это факт,
   и его должно быть видно как пустое место, а не как соединённую линию. */
.spark {
  position: relative; height: 84px; margin-top: 6px;
  border-bottom: 1px solid var(--line);
}
.spark-bar {
  position: absolute; bottom: 0; min-height: 2px;
  background: var(--green); border-radius: 2px 2px 0 0; opacity: .8;
}
.spark-bar.over { background: var(--yellow); opacity: 1; }
.spark-line {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 1px dashed var(--yellow); opacity: .7;
}

/* ——— Снимки еды ——— */

/* Кнопка-кружок рядом с микрофоном: тот же размер, спокойнее цветом —
   фотография помогает, но главный способ записи всё-таки голос. */
.mic.soft { background: var(--sky-soft); color: var(--sky-ink); }

.meal-shots { display: flex; gap: 6px; margin-top: 7px; }
.meal-shots img {
  width: 46px; height: 46px; object-fit: cover; border-radius: 10px;
  background: var(--surface-2);
}

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.shot { position: relative; margin: 0; }
.shot img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  border-radius: 14px; background: var(--surface-2);
}
.shot-x {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; cursor: pointer; font: inherit; font-size: 13px; line-height: 1;
  background: rgba(20, 20, 18, .62); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.shot figcaption { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip.tiny { padding: 3px 9px; font-size: 12px; }

/* Строка черновика. Рамка говорит то же, что и текст: сплошная — узнал,
   пунктир — под вопросом, серая — не разобрал. Одним цветом тут обойтись нельзя. */
.draft-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 12px;
  border: 1.5px solid var(--line); border-radius: 15px; margin-bottom: 9px;
  background: var(--surface);
}
.draft-row .pick { border: 0; padding: 0; background: none; }
.draft-row.dashed { border-style: dashed; border-color: var(--yellow); background: var(--yellow-soft); }
.draft-row.grey { border-color: var(--line); background: var(--surface-2); }
.draft-row b { font-weight: 650; font-size: 15px; }
.draft-row .food-pill { padding: 0; width: 14px; height: 14px; border-radius: 50%; }
.draft-row .food-pill::before { width: 14px; height: 14px; }

/* ——— Голос ——— */

.mic-card { display: flex; align-items: center; gap: 14px; }
.mic {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  border: 0; background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.mic:active { background: var(--accent-hover); }
.mic-on { background: var(--danger); }
.mic-on::after {
  content: ''; position: absolute; width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--danger); animation: mic-pulse 1.4s ease-out infinite;
}
.mic-card { position: relative; }
@keyframes mic-pulse {
  from { transform: scale(1); opacity: .7; }
  to { transform: scale(1.5); opacity: 0; }
}
.mic-wave { display: flex; align-items: center; gap: 3px; height: 22px; }
.mic-wave i {
  display: block; width: 3px; border-radius: 2px; background: currentColor;
  animation: mic-bar .9s ease-in-out infinite;
}
.mic-wave i:nth-child(1) { height: 8px;  animation-delay: 0s; }
.mic-wave i:nth-child(2) { height: 16px; animation-delay: .12s; }
.mic-wave i:nth-child(3) { height: 22px; animation-delay: .24s; }
.mic-wave i:nth-child(4) { height: 16px; animation-delay: .36s; }
.mic-wave i:nth-child(5) { height: 8px;  animation-delay: .48s; }
@keyframes mic-bar { 0%, 100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }

/* ——— Чего не хватает сегодня ——— */

.gap-card { display: flex; align-items: flex-start; gap: 12px; }
.gap-icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.gap-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gap-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px;
  border-radius: 999px; background: var(--surface-2); font-size: 13px; color: var(--muted);
  border: 0; font-family: inherit; cursor: pointer;
}
.gap-pill b { color: var(--text); font-weight: 600; }

/* ——— Выбор оформления ——— */

.skins { display: flex; flex-direction: column; gap: 9px; }
.skin {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px;
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.skin[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.skin b { display: block; font-weight: 650; font-size: 15px; }
.skin .d { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
/* Образец темы: квадратик её фона, внутри — карточка и три цвета. */
.skin-swatch {
  flex: none; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line-strong);
  display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 6px;
  overflow: hidden; position: relative;
}
.skin-swatch i:nth-child(1) { position: absolute; inset: 0; }                    /* фон */
.skin-swatch i:nth-child(2) { position: absolute; left: 4px; right: 4px; top: 4px; height: 13px; border-radius: 4px; } /* карточка */
.skin-swatch i:nth-child(n+3) { position: relative; width: 9px; height: 9px; border-radius: 50%; }

/* ——— Разное ——— */

.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; border-radius: 14px; background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 21px; font-weight: 700; letter-spacing: .13em;
}

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ic { opacity: .45; margin-bottom: 10px; width: 34px; height: 34px; }
.empty p { margin: 0 0 4px; font-size: 14.5px; }

.quote {
  font-family: var(--serif); font-size: 19px; line-height: 1.42; font-style: italic;
}
.quote-src { display: block; margin-top: 8px; font-family: var(--sans); font-style: normal; font-size: 12.5px; color: var(--muted); }

hr.rule { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv b { font-weight: 650; }

ul.bullets { margin: 6px 0 0; padding-left: 19px; }
ul.bullets li { margin-bottom: 5px; font-size: 14px; line-height: 1.45; }

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

.disclaimer {
  font-size: 12px; color: var(--muted); line-height: 1.45;
  padding: 12px 13px; border-radius: 12px; background: var(--surface-2); margin-top: 14px;
}
