/* Нутри — Calm Editorial */
@font-face { font-family: "Lora"; src: url("/static/fonts/lora.woff") format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/static/fonts/lora-italic.woff") format("woff"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-semibold.woff") format("woff"); font-weight: 600; font-display: swap; }

:root {
  --bg: #f5f0eb;
  --paper: #fffdf9;
  --ink: #2c2416;
  --ink-2: #5c4f40;
  --muted: #9b8a7a;
  --line: #e4d9cc;
  --line-soft: #efe7dd;
  --olive: #6f7a55;
  --olive-bg: #eceee3;
  --warn: #9a5b2e;
  --warn-bg: #f6e9dc;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --tabbar: 68px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

/* ─── Каркас ─────────────────────────────────────────── */
.shell { max-width: 640px; margin: 0 auto; padding: 20px 16px calc(var(--tabbar) + 32px); }
.shell--narrow { max-width: 440px; }
.topbar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 24px; }
.brand { font: italic 500 22px/1 var(--serif); text-decoration: none; color: var(--ink); }
@media (min-width: 900px) { [data-mobile-only] { display: none; } }
.topnav { display: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 253, 249, .96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; font-size: 12px; color: var(--muted);
}
.tabbar a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.tabbar a.on { color: var(--ink); }

@media (min-width: 900px) {
  .shell { padding-top: 32px; padding-bottom: 64px; max-width: 720px; }
  .shell--narrow { max-width: 440px; }
  .tabbar { display: none; }
  .topnav { display: flex; gap: 28px; }
  .topnav a { text-decoration: none; color: var(--muted); font-size: 15px; }
  .topnav a.on, .topnav a:hover { color: var(--ink); }
  .topbar { margin-bottom: 40px; }
}

/* ─── Типографика ────────────────────────────────────── */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 34px; line-height: 1.12; }
h2 { font-size: 24px; line-height: 1.2; }
h3 { font-size: 19px; line-height: 1.3; }
p { margin: 0 0 12px; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 34em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.page-head { margin-bottom: 24px; }
.page-head h1 + p { margin-top: 10px; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head a { font-size: 14px; color: var(--ink-2); }

/* ─── Кнопки и поля ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); font: 500 15px/1 var(--sans);
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s;
}
.btn:hover { background: #42372a; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--paper); border-color: var(--muted); }
.btn--small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--block { width: 100%; }
.btn--danger { background: transparent; color: var(--warn); border-color: #e3c9b4; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=search], textarea, select {
  width: 100%; font: 400 16px/1.4 var(--sans); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; appearance: none;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink-2); }
.field { margin-bottom: 18px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.code-input { font: 500 28px/1 var(--sans) !important; letter-spacing: .35em; text-align: center; padding: 16px !important; }

/* ─── Сообщения ──────────────────────────────────────── */
.note { padding: 14px 16px; border-radius: var(--r-md); background: var(--olive-bg); color: #3f4630; font-size: 15px; margin-bottom: 16px; }
.note--warn { background: var(--warn-bg); color: var(--warn); }
.note--test { background: #fff6d8; color: #6b5310; border: 1px dashed #d9c27a; }

/* ─── Поверхности ────────────────────────────────────── */
.paper { background: var(--paper); border-radius: var(--r-lg); padding: 22px; border: 1px solid var(--line-soft); }
.paper + .paper { margin-top: 12px; }

/* ─── Меню-карта (главный элемент) ─────────────────────── */
.carte { background: var(--paper); border-radius: var(--r-lg); border: 1px solid var(--line-soft); padding: 26px 22px 18px; }
.carte__date { font: italic 400 15px/1.3 var(--serif); color: var(--muted); margin-bottom: 4px; }
.carte__title { font-size: 28px; margin-bottom: 18px; }
.course { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 0; border-top: 1px solid var(--line-soft); align-items: baseline; }
.course:first-of-type { border-top: 0; }
.course__meal { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.course__name { font: 500 18px/1.35 var(--serif); text-decoration: none; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.course__name::after { content: ""; flex: 1; border-bottom: 1px dotted var(--muted); transform: translateY(-4px); min-width: 16px; }
.course__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.course__kcal { font: 500 15px/1 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.course__kcal small { color: var(--muted); font-weight: 400; font-size: 13px; }
.course__tools { grid-column: 1 / -1; display: flex; gap: 16px; margin-top: 4px; }
.course__tools form { display: inline; }
.course__tools .linkbtn { font-size: 13px; color: var(--muted); }
.course--empty .course__name { color: var(--muted); font-style: italic; }

.totals { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.ring { width: 76px; height: 76px; position: relative; }
.ring svg { width: 76px; height: 76px; transform: rotate(-90deg); }
.ring__val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font: 600 17px/1 var(--sans); font-variant-numeric: tabular-nums; }
.ring__val small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.macro b { display: block; font: 600 17px/1.1 var(--sans); font-variant-numeric: tabular-nums; }
.macro span { font-size: 13px; color: var(--muted); }
.macro i { display: block; height: 3px; border-radius: 2px; background: var(--line-soft); margin-top: 8px; overflow: hidden; }
.macro i::before { content: ""; display: block; height: 100%; width: var(--w, 0%); background: var(--c, var(--muted)); }

/* ─── Быстрые действия ───────────────────────────────── */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action { display: flex; flex-direction: column; justify-content: space-between; min-height: 104px; padding: 16px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line-soft); text-decoration: none; transition: border-color .15s; }
.action:hover { border-color: var(--muted); }
.action b { font: 500 17px/1.25 var(--serif); }
.action span { font-size: 13px; color: var(--muted); }
.action--dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.action--dark span { color: #c9bba9; }

/* ─── Список рецептов ────────────────────────────────── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px 18px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chip { flex: none; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 14px; color: var(--ink-2); background: transparent; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dish-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border-radius: var(--r-lg); border: 1px solid var(--line-soft); }
.dish { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 16px 20px; border-top: 1px solid var(--line-soft); text-decoration: none; }
li:first-child > .dish { border-top: 0; }
.dish:hover .dish__name { text-decoration: underline; text-underline-offset: 3px; }
.dish__name { font: 500 17px/1.35 var(--serif); }
.dish__meta { font-size: 13px; color: var(--muted); }
.dish__kcal { font: 500 15px/1.35 var(--sans); font-variant-numeric: tabular-nums; text-align: right; }
.lock { display: inline-flex; align-items: center; gap: 4px; font: 500 12px/1 var(--sans); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; vertical-align: 2px; }

.random-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 28px; }
.random-row a { text-align: center; padding: 14px 6px; border-radius: var(--r-md); border: 1px dashed var(--muted); text-decoration: none; font-size: 14px; }
.random-row a:hover { background: var(--paper); border-style: solid; }
@media (max-width: 420px) { .random-row { grid-template-columns: repeat(2, 1fr); } }

/* ─── Страница рецепта ───────────────────────────────── */
.recipe-head { margin-bottom: 22px; }
.recipe-head .muted { font: italic 400 16px/1.3 var(--serif); margin-bottom: 8px; }
.kbju-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-md); margin-bottom: 26px; }
.kbju-strip div { padding: 14px 8px; text-align: center; border-left: 1px solid var(--line-soft); }
.kbju-strip div:first-child { border-left: 0; }
.kbju-strip b { display: block; font: 600 20px/1.1 var(--sans); font-variant-numeric: tabular-nums; }
.kbju-strip span { font-size: 12px; color: var(--muted); }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.ing-list li:last-child { border-bottom: 0; }
.ing-list span:last-child { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.steps { font: 400 17px/1.7 var(--serif); color: var(--ink); max-width: 36em; white-space: pre-line; }
.locked-box { text-align: center; padding: 32px 22px; }

/* ─── Неделя ─────────────────────────────────────────── */
.segmented { display: inline-grid; grid-auto-flow: column; background: var(--line-soft); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.segmented a { padding: 9px 18px; border-radius: 999px; text-decoration: none; font-size: 14px; color: var(--ink-2); }
.segmented a.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(44, 36, 22, .08); }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
.week-strip a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0; border-radius: var(--r-sm); text-decoration: none; font-size: 13px; color: var(--ink-2); border: 1px solid transparent; }
.week-strip a b { font: 500 17px/1.1 var(--serif); color: var(--ink); }
.week-strip a.on { background: var(--paper); border-color: var(--line); }
.week-strip a.bulk-start { position: relative; }
.mode-pick { display: grid; gap: 10px; }
.mode-pick button { text-align: left; padding: 18px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--paper); cursor: pointer; font: inherit; color: var(--ink); }
.mode-pick button:hover { border-color: var(--ink-2); }
.mode-pick b { display: block; font: 500 18px/1.3 var(--serif); margin-bottom: 4px; }
.mode-pick span { font-size: 14px; color: var(--muted); }
.pill { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--line-soft); color: var(--ink-2); }

/* ─── Список покупок ─────────────────────────────────── */
.shop { list-style: none; padding: 0; margin: 0; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-lg); }
.shop li { border-top: 1px solid var(--line-soft); }
.shop li:first-child { border-top: 0; }
.shop label { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 0; cursor: pointer; font-size: 16px; color: var(--ink); }
.shop input { width: 22px; height: 22px; accent-color: var(--olive); flex: none; }
.shop .q { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }
.shop input:checked ~ .n, .shop input:checked ~ .q { color: var(--muted); text-decoration: line-through; }
.progress { height: 4px; background: var(--line-soft); border-radius: 2px; overflow: hidden; margin: 10px 0 18px; }
.progress i { display: block; height: 100%; background: var(--olive); width: 0; transition: width .25s; }

/* ─── Тарифы ─────────────────────────────────────────── */
.plans { display: grid; gap: 10px; }
.plan { display: grid; grid-template-columns: 1fr auto; align-items: baseline; padding: 18px 20px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.plan b { font: 500 18px/1.3 var(--serif); }
.plan .price { font: 600 18px/1 var(--sans); font-variant-numeric: tabular-nums; }
.plan .per { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin-top: 4px; }
.plan--best { border-color: var(--ink); }

/* ─── Профиль / прочее ───────────────────────────────── */
.menu-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-lg); }
.menu-list li + li { border-top: 1px solid var(--line-soft); }
.menu-list a, .menu-list button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 16px 20px; text-decoration: none; background: none; border: 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.menu-list a span:last-child { color: var(--muted); font-size: 14px; }
.legal { font: 400 16px/1.7 var(--serif); }
.legal h2 { font-size: 20px; margin: 28px 0 10px; }
.legal ul { padding-left: 20px; }
.empty { text-align: center; padding: 36px 20px; }
.empty h3 { margin-bottom: 8px; }
.empty p { color: var(--ink-2); }

/* ─── Вход ───────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; align-content: center; padding: 32px 16px; }
.auth__mark { font: italic 400 18px/1 var(--serif); color: var(--muted); margin-bottom: 18px; }
.auth h1 { font-size: 38px; margin-bottom: 12px; }
.auth .lead { margin-bottom: 28px; }

/* ─── Админка ────────────────────────────────────────── */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-nav a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 14px; color: var(--ink-2); }
.admin-nav a.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 16px; text-decoration: none; }
.stat b { display: block; font: 600 26px/1.1 var(--sans); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: 13px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td form { display: inline; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--line-soft); color: var(--ink-2); white-space: nowrap; }
.tag--ok { background: var(--olive-bg); color: #3f4630; }
.tag--warn { background: var(--warn-bg); color: var(--warn); }
.report li { margin-bottom: 6px; }
.split { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .split { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ─── Режим приложения (иконка на экране «Домой») ───────── */
html { -webkit-tap-highlight-color: transparent; }
.tabbar { -webkit-user-select: none; user-select: none; }
.is-app body { overscroll-behavior-y: none; }
.is-app .hide-in-app { display: none; }
.is-app .shell { padding-top: max(20px, env(safe-area-inset-top)); }
.install-hint { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 12px 12px 14px; margin-bottom: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); }
.install-hint[hidden] { display: none; }
.install-hint img { border-radius: 10px; }
.install-hint b { display: block; font: 500 16px/1.3 var(--serif); }
.install-hint span { display: block; font-size: 13px; color: var(--muted); }
.install-hint a { font-size: 13px; }
.install-hint button { background: none; border: 0; font-size: 16px; color: var(--muted); width: 36px; height: 36px; cursor: pointer; }
.install-steps { margin: 0; padding-left: 22px; }
.install-steps li { margin-bottom: 8px; }
.ico { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ─── Ближайший приём, время, иконки плиток ─────────────── */
.next-meal { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 18px; margin-bottom: 12px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-lg); text-decoration: none; }
.next-meal:hover { border-color: var(--muted); }
.next-meal__ico { width: 40px; height: 40px; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.next-meal__label { font-size: 13px; color: var(--muted); }
.next-meal__name { font: 500 18px/1.3 var(--serif); margin-top: 2px; }
.next-meal__kcal { font: 600 20px/1 var(--sans); font-variant-numeric: tabular-nums; text-align: right; }
.next-meal__kcal small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 4px; }
.course__time { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: var(--line-soft); color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.action { justify-content: flex-start; gap: 4px; }
.action__ico { width: 26px; height: 26px; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: auto; padding-bottom: 6px; box-sizing: content-box; }
.action--dark .action__ico { stroke: #c9bba9; }
.action { min-height: 124px; }

.shop-cat { font: 500 17px/1.3 var(--serif); margin: 22px 4px 8px; color: var(--ink-2); }
.shop-cat:first-child { margin-top: 0; }

/* ─── Настройки времени и знакомство ─────────────────── */
.times { display: grid; gap: 0; }
.time-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; margin: 0; border-bottom: 1px solid var(--line-soft); font-size: 16px; color: var(--ink); }
.time-row:last-child { border-bottom: 0; }
.time-row input { width: auto; min-width: 116px; text-align: center; font-variant-numeric: tabular-nums; padding: 10px 12px; }
.tour { min-height: 100vh; padding-top: env(safe-area-inset-top); }
.tour__top { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-bottom: 18px; }
.tour__dots { display: flex; gap: 6px; }
.tour__dots i { width: 22px; height: 4px; border-radius: 2px; background: var(--line); }
.tour__dots i.on { background: var(--ink); }
.tour__stage { pointer-events: none; padding: 18px; margin-bottom: 26px; border-radius: var(--r-lg); background: var(--line-soft); }
.tour__stage .carte, .tour__stage .next-meal, .tour__stage .shop { box-shadow: 0 1px 2px rgba(44, 36, 22, .05); }
.tour h1 { font-size: 30px; margin-bottom: 12px; }
.tour__pulse { color: var(--ink) !important; text-decoration-color: var(--ink); }

/* ─── «Я не ем», продукты, создатели ──────────────────── */
.chips-wrap { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips-wrap legend { margin-bottom: 10px; padding: 0; }
.chipbox { margin: 0; cursor: pointer; }
.chipbox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chipbox span { display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 14px; color: var(--ink-2); }
.chipbox input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chipbox input:checked + span::before { content: "✕ "; font-size: 11px; }
.chipbox input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.plist { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 6px 18px 12px; }
.plist__group h4 { font: 500 15px/1.3 var(--serif); color: var(--ink-2); margin: 14px 0 6px; }
.plist__group[hidden], .pitem[hidden] { display: none; }
.pitem { display: flex; align-items: center; gap: 12px; padding: 9px 0; margin: 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; color: var(--ink); cursor: pointer; }
.plist__group .pitem:last-child { border-bottom: 0; }
.pitem input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.sticky-save { position: sticky; bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); padding-top: 14px; margin-top: 8px; background: linear-gradient(to bottom, transparent, var(--bg) 40%); }
.tour .sticky-save { bottom: 12px; }
@media (min-width: 900px) { .sticky-save { bottom: 16px; } }
.filter-bar { display: flex; align-items: flex-start; gap: 10px; }
.filter-bar .chips { flex: 1; min-width: 0; margin-right: 0; }
.products-btn { flex: none; gap: 6px; }
.products-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.products-btn.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.want-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 16px; }
.want-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--olive-bg); color: #3f4630; text-decoration: none; font-size: 14px; }
.want-chip span { font-size: 11px; }
.creators__title { font-size: 24px; margin-bottom: 14px; }
.creators__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.creator-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-lg); text-decoration: none; }
.creator-card:hover { border-color: var(--muted); }
.creator-card__photo { width: 100%; aspect-ratio: 1; border-radius: var(--r-md); object-fit: cover; margin-bottom: 10px; }
.creator-card__photo--empty { display: grid; place-items: center; background: var(--line-soft); font: italic 500 44px/1 var(--serif); color: var(--muted); }
.creator-card b { font: 500 18px/1.2 var(--serif); }
.creator-card span { font-size: 13px; color: var(--muted); line-height: 1.35; }
.creator__photo { width: 100%; max-width: 360px; aspect-ratio: 4 / 5; border-radius: var(--r-lg); object-fit: cover; margin-bottom: 22px; }
.creator__photo--empty { display: grid; place-content: center; text-align: center; background: var(--line-soft); }
.creator__photo--empty span { font: italic 500 80px/1 var(--serif); color: var(--muted); }
.creator__photo--empty small { font-size: 13px; color: var(--muted); margin-top: 8px; }
.creator__role { color: var(--muted); font: italic 400 17px/1.4 var(--serif); margin-top: 6px; }
.creator-card .creator-card__photo--empty { font: italic 500 44px/1 var(--serif); color: var(--muted); }
.creator-card .creator-card__role { font-size: 13px; color: var(--muted); line-height: 1.35; }
@media (max-width: 899px) {
  .filter-bar { flex-direction: column; align-items: stretch; gap: 4px; }
  .filter-bar .chips { margin-left: -16px; margin-right: -16px; }
  .products-btn { align-self: flex-start; margin-bottom: 14px; }
}

/* ════════════════════════════════════════════════════════════════
   Тема «как на референсе»: системный шрифт без засечек, мягкий бежевый
   фон, белые карточки с тенью, цветные иконки. Перекрывает всё выше.
   ════════════════════════════════════════════════════════════════ */
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-light.woff") format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-extralight.woff") format("woff"); font-weight: 200; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-bold.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f1e9df;
  --paper: #ffffff;
  --ink: #221c15;
  --ink-2: #574b3f;
  --muted: #9a8b7b;
  --line: #e6dcd0;
  --line-soft: #f1eae1;
  --accent: #a68b70;
  --pill: #f4ece2;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --serif: var(--sans);
  --shadow: 0 1px 2px rgba(90, 66, 38, .05), 0 6px 22px rgba(90, 66, 38, .08);
  --shadow-sm: 0 1px 2px rgba(90, 66, 38, .05), 0 3px 10px rgba(90, 66, 38, .06);
  --r-lg: 22px;
  --r-md: 18px;
  --r-sm: 12px;
}
body {
  background: linear-gradient(165deg, #f7f2eb 0%, #efe6db 55%, #e9ded1 100%) fixed;
  background-color: var(--bg);
  font-family: var(--sans);
  color: var(--ink);
}

/* Типографика без засечек */
h1, h2, h3 { font-family: var(--display); letter-spacing: -.015em; }
h1 { font-weight: 300; font-size: 36px; line-height: 1.12; }
h2 { font-weight: 500; font-size: 22px; }
h3 { font-weight: 600; font-size: 17px; }
.brand { font: 500 15px/1 var(--sans); color: var(--muted); letter-spacing: 0; }
.is-home .brand { visibility: hidden; }
.lead { color: var(--ink-2); }
.carte__date, .auth__mark, .recipe-head .muted, .creator__role { font-family: var(--sans); font-style: normal; }
.auth__mark { font-size: 15px; font-weight: 500; }
.auth h1 { font-weight: 300; font-size: 40px; }
.legal, .steps { font-family: var(--sans); font-size: 16px; line-height: 1.7; }
.section-title { font: 500 22px/1.2 var(--display); margin: 0 0 14px 4px; letter-spacing: -.01em; }

/* Шапка главной */
.hero { text-align: center; margin: 4px 0 26px; }
.hero__over { margin: 0 0 4px; font-size: 16px; color: var(--ink-2); }
.hero__title { font: 300 46px/1.05 var(--display); letter-spacing: -.025em; margin: 0; }
@media (max-width: 380px) { .hero__title { font-size: 40px; } }

/* Карточки: белые, без рамок, с мягкой тенью */
.card, .paper, .carte, .next-meal, .action, .dish-list, .shop, .plist, .menu-list, .kbju-strip, .plan,
.stat, .table-wrap, .install-hint, .creator-card, .mode-pick button, .totals-card {
  background: var(--paper); border: 0; box-shadow: var(--shadow);
}
.card { border-radius: var(--r-lg); padding: 18px; }
.paper { border-radius: var(--r-lg); }
.plan--best { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }

/* Ближайший приём */
.next-meal { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: var(--r-lg); margin-bottom: 14px; }
.next-meal__ico { font-size: 40px; line-height: 1; width: auto; height: auto; flex: none; }
.next-meal__label { font: 400 18px/1.3 var(--sans); color: var(--ink); }
.next-meal .next-meal__name { font: 400 15px/1.4 var(--sans); color: var(--muted); margin-top: 3px; }

/* Плитки 2×2 */
.actions { gap: 14px; margin-bottom: 30px; }
.action { min-height: 132px; padding: 18px 12px; border-radius: var(--r-lg); align-items: center; justify-content: center; text-align: center; gap: 12px; }
.action .action__emoji { font-size: 38px; line-height: 1; letter-spacing: -4px; color: initial; }
.action b { font: 500 16px/1.25 var(--sans); }
.action--dark { background: var(--paper); color: var(--ink); }

/* Приёмы пищи — отдельные карточки */
.carte { background: transparent; box-shadow: none; padding: 0; border-radius: 0; }
.carte__title { font: 500 22px/1.2 var(--display); margin: 0 0 14px 4px; }
.carte__date { margin-left: 4px; }
.course { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  padding: 14px 16px; margin-bottom: 10px; border: 0; border-radius: var(--r-md); background: var(--paper); box-shadow: var(--shadow-sm); }
.course:first-of-type { border-top: 0; }
.course__ico { font-size: 30px; line-height: 1; text-align: center; }
.course__body { min-width: 0; }
.course__meal { grid-column: auto; font: 600 17px/1.3 var(--sans); color: var(--ink); display: flex; align-items: center; gap: 8px; }
.course__time { margin: 0; padding: 2px 8px; border-radius: 7px; background: var(--pill); color: var(--ink-2); font: 500 12px/1.4 var(--sans); }
.course__name { display: block; font: 400 14px/1.4 var(--sans); color: var(--ink-2); margin-top: 3px; text-decoration: none; }
.course__name::after { content: none; }
.course__name:hover { text-decoration: underline; }
.course__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.course__kcal { font: 500 15px/1.2 var(--sans); white-space: nowrap; }
.course__swap { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 0; border-radius: 8px; background: var(--pill);
  color: var(--ink-2); font: 500 12px/1 var(--sans); cursor: pointer; }
.course__swap svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.course__swap:hover { background: #ebe0d2; }
.course--empty .course__name { font-style: normal; }
.totals-card { border-radius: var(--r-md); padding: 6px 18px 16px; margin-top: 4px; }
.carte > .totals, .totals-card .totals { border-top: 0; }
.carte > .totals { background: var(--paper); border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--shadow-sm); margin-top: 4px; }
.empty-today { text-align: center; padding: 26px 22px; }
.empty-today__ico { font-size: 44px; display: block; margin-bottom: 10px; }
.empty-today p { color: var(--ink-2); }

/* Кнопки, поля, чипы */
.btn { font-family: var(--sans); font-weight: 500; }
.btn--ghost { background: var(--paper); border-color: transparent; box-shadow: var(--shadow-sm); }
.btn--ghost:hover { background: #fffaf5; border-color: transparent; }
input[type=text], input[type=email], input[type=search], input[type=time], textarea, select { background: #fff; border-color: var(--line); border-radius: var(--r-sm); }
.chip { background: var(--paper); border-color: transparent; box-shadow: var(--shadow-sm); color: var(--ink-2); }
.chip.on { background: var(--ink); color: #fff; }
.chipbox span { background: var(--paper); border-color: transparent; box-shadow: var(--shadow-sm); }
.segmented { background: #e8ded2; }
.random-row a { border: 0; background: var(--paper); box-shadow: var(--shadow-sm); border-radius: var(--r-md); font-weight: 500; }
.random-row a:hover { background: #fffaf5; }

/* Остальные элементы без засечек */
.dish__name, .plan b, .mode-pick b, .creator-card b, .install-hint b { font-family: var(--sans); font-weight: 600; }
.dish__name { font-size: 16px; }
.shop-cat, .plist__group h4 { font: 600 15px/1.3 var(--sans); color: var(--ink-2); }
.week-strip b { font: 600 17px/1.1 var(--sans); }
.week-strip a.on { background: var(--paper); border-color: transparent; box-shadow: var(--shadow-sm); }
.creator-card .creator-card__photo--empty, .creator__photo--empty span { font-family: var(--display); font-style: normal; font-weight: 200; }
.creator-card__photo--empty, .creator__photo--empty { background: var(--pill); }
.tour__stage { background: rgba(255, 255, 255, .45); }
.tour h1 { font-weight: 300; }

/* Нижнее меню */
.tabbar { background: rgba(255, 255, 255, .97); border-top: 1px solid #eee5da; }
.tabbar a { color: #9d9186; font-weight: 500; }
.tabbar a.on { color: var(--accent); }
.tabbar a.on svg { fill: currentColor; fill-opacity: .9; stroke: currentColor; }
.topnav a.on { color: var(--accent); }

.tour-recipe { padding: 16px 18px; }
.tour-recipe__meal { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.tour-recipe__title { display: block; font: 600 18px/1.3 var(--sans); }

.random-row--mini { grid-template-columns: repeat(4, 1fr) !important; gap: 6px; }
.random-row--mini a { padding: 10px 2px; font-size: 13px; }
.tour__stage .kbju-strip div { padding: 10px 4px; }
.tour__stage .kbju-strip b { font-size: 18px; }
.tour__stage .dish { padding: 12px 18px; }

/* Плашка под КБЖУ и шторка «Как мы собираем рацион» */
.kcal-info { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; width: 100%; margin-top: 12px; padding: 10px 14px;
  border: 0; border-radius: 12px; background: var(--pill); color: var(--ink-2); font: 400 14px/1.3 var(--sans);
  text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; }
.kcal-info__sep { color: var(--muted); }
.kcal-info__link { color: var(--accent); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.kcal-info:hover { background: #ece2d5; }
.sheet { width: 100%; max-width: 560px; margin: auto auto 0; padding: 10px 22px calc(22px + env(safe-area-inset-bottom));
  border: 0; border-radius: 24px 24px 0 0; background: var(--paper); color: var(--ink); box-shadow: 0 -8px 40px rgba(60, 44, 25, .18); }
.sheet::backdrop { background: rgba(34, 28, 21, .35); }
.sheet[open] { animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 16px; }
.sheet__title { font: 500 21px/1.25 var(--display); margin: 0 0 12px; }
.sheet p { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin: 0 0 10px; }
.sheet .btn { margin-top: 10px; }
.sheet__close { margin-top: 8px !important; }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 24px; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }

/* Сопровождение: форматы ведения */
.full-note { display: flex; gap: 14px; align-items: flex-start; }
.full-note__ico { font-size: 30px; line-height: 1; }
.full-note b { font-size: 17px; }
.full-note p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.plans-coach { display: grid; gap: 10px; }
.coach-plan { padding: 0; overflow: hidden; }
.coach-plan summary { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 16px 18px; cursor: pointer; list-style: none; }
.coach-plan summary::-webkit-details-marker { display: none; }
.coach-plan summary::after { content: "›"; grid-column: 2; grid-row: 1; justify-self: end; display: none; }
.coach-plan__title { font: 600 16px/1.3 var(--sans); }
.coach-plan__price { font: 600 17px/1.2 var(--sans); white-space: nowrap; text-align: right; }
.coach-plan__price small { font-weight: 400; font-size: 12px; color: var(--muted); }
.coach-plan[open] summary { border-bottom: 1px solid var(--line-soft); }
.coach-plan h4 { margin: 14px 18px 6px; font: 600 13px/1.3 var(--sans); color: var(--muted); }
.coach-plan ul { margin: 0 18px; padding: 0; list-style: none; }
.coach-plan li { position: relative; padding: 4px 0 4px 24px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.checks li::before { content: "✓"; position: absolute; left: 2px; color: var(--olive); font-weight: 600; }
.needs li::before { content: "•"; position: absolute; left: 6px; color: var(--accent); }
.coach-plan .btn { margin: 14px 18px 18px; }

/* Страница создателя */
.creator__lead { font-size: 17px; line-height: 1.5; color: var(--ink); margin: 14px 0 0; }
.creator__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.creator__facts .card { padding: 14px 16px; border-radius: var(--r-md); }
.creator__facts span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.creator__facts b { font: 600 15px/1.3 var(--sans); }
