/* Поваренная книга — стили. Мобильная вёрстка по умолчанию, ширше 900px — боковая панель фильтров. */
:root {
  --bg: #fbf5ea; --paper: #fffdf8; --ink: #2f2622; --muted: #6a5d54; --line: #eadfce; --chip: #f4ead9; --chip-on: #b8492c;
  --accent: #b8492c; --accent-ink: #fff; --accent-soft: #fbe9e1; --olive: #566427; --honey: #e3a83a; --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 18px rgba(60, 40, 20, .07);
  --serif: Georgia, Cambria, "Times New Roman", serif; --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 16px; --top: 60px; color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1b1613; --paper: #261f1a; --ink: #f3e9dc; --muted: #bdae9e; --line: #3b3027; --chip: #33291f; --chip-on: #f08a68;
  --accent: #f08a68; --accent-ink: #1b1613; --accent-soft: #3a2a22; --olive: #a9bb66; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1613; --paper: #261f1a; --ink: #f3e9dc; --muted: #bdae9e; --line: #3b3027; --chip: #33291f; --chip-on: #f08a68;
    --accent: #f08a68; --accent-ink: #1b1613; --accent-soft: #3a2a22; --olive: #a9bb66; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 12px); }
@media (min-width: 900px) { html { font-size: 18px; } }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); line-height: 1.55; min-height: 100vh;
  background: var(--bg) radial-gradient(1200px 500px at 85% -10%, rgba(227, 168, 58, .12), transparent 60%), radial-gradient(900px 500px at -10% 0%, rgba(184, 73, 44, .07), transparent 55%);
  background-attachment: fixed; padding-bottom: 76px;
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 700; margin: 0; letter-spacing: -.005em; text-wrap: balance; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 10px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

/* --- верхняя панель --- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 14px; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 1.15rem; min-height: 44px; }
.brand svg { width: 34px; height: 34px; flex: none; }
.nav { display: none; margin-left: auto; gap: 4px; }
.nav a, .tabbar a { text-decoration: none; color: var(--muted); border-radius: 12px; }
.nav a { padding: 10px 14px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav a:hover { color: var(--ink); }
.icon-btn { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--paper); border-radius: 50%; display: inline-grid; place-items: center; font-size: 1.15rem; line-height: 1; }
.top .icon-btn { margin-left: auto; }
@media (min-width: 900px) { .nav { display: flex; } .top .icon-btn { margin-left: 8px; } }

/* --- нижняя панель на телефоне --- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--paper); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(60, 40, 20, .08); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; font-size: .78rem; font-weight: 600; }
.tabbar a span:first-child { font-size: 1.35rem; line-height: 1; }
.tabbar a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
@media (min-width: 900px) { .tabbar { display: none; } }

/* --- главная: заголовок и поиск --- */
.hero { padding: 22px 0 8px; }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.5rem); }
.hero p { margin: 6px 0 0; color: var(--muted); }
.search { position: relative; margin: 16px 0 0; }
.search input { width: 100%; height: 56px; border-radius: 28px; border: 1.5px solid var(--line); background: var(--paper); padding: 0 52px 0 52px; font-size: 1.05rem; box-shadow: var(--shadow); }
.search input::placeholder { color: var(--muted); opacity: .85; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.search .glass { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 1.15rem; pointer-events: none; }
.search .clear { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; font-size: 1.2rem; color: var(--muted); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* --- чипы --- */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--chip); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.chip[aria-pressed="true"], .chip.on { background: var(--chip-on); border-color: var(--chip-on); color: var(--accent-ink); }
.chip small { opacity: .75; font-weight: 500; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 14px; margin: 0 -16px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
@media (min-width: 900px) {
  .chips { flex-wrap: wrap; overflow: hidden; margin: 0; padding: 14px 0 6px; max-height: 118px; }
  .chips.open { max-height: none; }
  .chips .chip { min-height: 42px; }
}
.chips-toggle { display: none; }
@media (min-width: 900px) { .chips-toggle { display: inline-block; margin-bottom: 6px; } }

/* --- макет списка --- */
.layout { display: block; }
@media (min-width: 900px) { .layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; } }
.filters { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.filters h2 { font-size: 1.1rem; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.fgroup { padding: 12px 0; border-top: 1px solid var(--line); }
.fgroup:first-of-type { border-top: 0; padding-top: 4px; }
.fgroup > label, .fgroup > .lbl { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 8px; }
.fgroup select, .fgroup input[type="text"] { width: 100%; min-height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); padding: 0 12px; }
.fgroup input[type="range"] { width: 100%; accent-color: var(--accent); height: 36px; }
.rng { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .9rem; }
.rng b { color: var(--accent); min-width: 5.5em; text-align: right; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 600; margin: 0; }
.fgroup .hint { font-size: .8rem; color: var(--muted); margin: -4px 0 6px 32px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--ink); border-radius: 999px; padding: 4px 4px 4px 12px; font-size: .88rem; font-weight: 600; }
.pill.no { background: #f6dcdc; color: #6b1d1d; }
:root[data-theme="dark"] .pill.no { background: #4a2626; color: #ffd9d9; }
.pill button { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 50%; font-size: 1rem; color: inherit; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sugg button { border: 1px dashed var(--line); background: transparent; border-radius: 999px; min-height: 36px; padding: 0 12px; font-size: .88rem; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg button, .seg a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); padding: 0 8px; min-height: 44px; border: 1.5px solid var(--line); background: var(--chip); border-radius: 12px; font-weight: 600; font-size: .9rem; }
.seg button[aria-pressed="true"], .seg a[aria-pressed="true"] { background: var(--chip-on); border-color: var(--chip-on); color: var(--accent-ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }

/* шторка с фильтрами на телефоне */
.fbar { display: flex; gap: 10px; align-items: center; margin: 4px 0 6px; }
.fbar .btn { flex: 1; }
.badge { background: var(--accent-ink); color: var(--accent); border-radius: 999px; min-width: 24px; height: 24px; display: inline-grid; place-items: center; font-size: .8rem; padding: 0 6px; }
@media (max-width: 899px) {
  .filters { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .25s ease; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .filters.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 45; background: rgba(20, 12, 6, .5); }
  .filters .done { position: sticky; bottom: -16px; background: var(--paper); padding: 10px 0 4px; }
}
@media (min-width: 900px) { .fbar, .scrim, .filters .done { display: none !important; } .filters { position: sticky; top: calc(var(--top) + 14px); max-height: calc(100vh - var(--top) - 28px); overflow-y: auto; } }

/* --- результаты --- */
.count { font-weight: 700; margin: 6px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.count select { min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); padding: 0 10px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { position: relative; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(60, 40, 20, .08), 0 12px 26px rgba(60, 40, 20, .12); }
.card a.go { display: block; padding: 14px 16px 14px; color: inherit; text-decoration: none; flex: 1; }
.card .top-line { display: flex; align-items: center; gap: 12px; }
.badge-s { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; flex: none; background: hsl(var(--h) 70% 91%); }
:root[data-theme="dark"] .badge-s { background: hsl(var(--h) 30% 25%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-s { background: hsl(var(--h) 30% 25%); } }
.card h3 { font-size: 1.08rem; padding-right: 34px; overflow-wrap: break-word; hyphens: auto; }
.card .sec { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--ink); }
.tag.k { background: var(--accent-soft); color: var(--accent); }
.tag.ok { background: #e4efd0; color: #34430f; }
:root[data-theme="dark"] .tag.ok { background: #36431c; color: #dbe8b3; }
.fav { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; font-size: 1.4rem; color: var(--muted); }
.fav[aria-pressed="true"] { color: #e0a000; }
.more { display: flex; justify-content: center; margin: 22px 0; }
.empty { text-align: center; padding: 40px 12px; color: var(--muted); }
.empty .big { font-size: 3rem; }

/* --- страница рецепта --- */
.recipe { padding-top: 12px; padding-bottom: 30px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; }
.rhead { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 20px 18px; box-shadow: var(--shadow); margin-top: 6px; background-image: linear-gradient(180deg, hsl(var(--h) 80% 95% / .9), transparent 60%); }
:root[data-theme="dark"] .rhead { background-image: linear-gradient(180deg, hsl(var(--h) 30% 20% / .9), transparent 60%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rhead { background-image: linear-gradient(180deg, hsl(var(--h) 30% 20% / .9), transparent 60%); } }
.rhead h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); margin: 8px 0; }
.rhead .emoji { font-size: 2.4rem; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.acts .btn, .acts .chip { min-height: 46px; }
.cols { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 900px) { .cols { grid-template-columns: 380px 1fr; align-items: start; } .cols .ing { position: sticky; top: calc(var(--top) + 14px); } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.panel h2 { font-size: 1.2rem; margin-bottom: 10px; }
.scale { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.scale .lbl { font-weight: 700; font-size: .9rem; flex-basis: 100%; }
.scale button { min-width: 48px; min-height: 44px; border: 1.5px solid var(--line); background: var(--chip); border-radius: 12px; font-weight: 700; }
.scale button[aria-pressed="true"] { background: var(--chip-on); color: var(--accent-ink); border-color: var(--chip-on); }
.ilist { list-style: none; margin: 0; padding: 0; }
.ing h3 { font-size: 1rem; margin: 16px 0 2px; color: var(--olive); }
.ilist li { border-bottom: 1px dashed var(--line); }
.ilist label { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; cursor: pointer; }
.ilist input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.ilist input:checked + span { text-decoration: line-through; opacity: .55; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.steps li::before { content: counter(s); width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; font-family: var(--serif); }
.steps li.done { opacity: .5; }
.steps li.done::before { content: "✓"; background: var(--olive); color: #fff; }
.note { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; margin-top: 12px; font-size: .95rem; }
.kbju { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 4px; }
.kb { text-align: center; border-radius: 14px; padding: 10px 4px; background: var(--chip); }
.kb b { display: block; font-size: 1.35rem; font-family: var(--serif); font-variant-numeric: tabular-nums; }
.kb span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kb.k { background: var(--accent-soft); } .kb.k b { color: var(--accent); }
.kb-sub { font-size: .88rem; color: var(--muted); margin: 6px 0 0; }
details.fold { margin-top: 10px; }
details.fold summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--accent); }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
table.t th, table.t td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.t th:first-child, table.t td:first-child { text-align: left; white-space: normal; min-width: 160px; }
table.t th { font-size: .8rem; color: var(--muted); text-transform: none; position: sticky; top: 0; background: var(--paper); }
table.t tr.sum td { font-weight: 800; }
.similar { margin-top: 24px; }
.similar h2 { font-size: 1.2rem; margin-bottom: 10px; }
.fine { font-size: .84rem; color: var(--muted); margin-top: 14px; }

/* --- справочник --- */
.page { padding-top: 18px; padding-bottom: 30px; }
.page h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); margin-bottom: 6px; }
.subtabs { display: flex; gap: 8px; overflow-x: auto; margin: 14px -16px 8px; padding: 2px 16px 8px; }
@media (min-width: 900px) { .subtabs { margin: 14px 0 8px; padding: 2px 0 8px; } }
.tool { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .tool { grid-template-columns: 2fr 1fr 1fr; } }
.tool label { font-weight: 700; font-size: .9rem; display: block; margin-bottom: 4px; }
.tool input, .tool select { width: 100%; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); padding: 0 12px; }
.result { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); font-size: 1.05rem; }
.result b { font-family: var(--serif); font-size: 1.5rem; color: var(--accent); }
.sortable th { cursor: pointer; }
.sortable th[aria-sort] { color: var(--accent); }
.acc details { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); margin: 8px 0; padding: 0 16px; box-shadow: var(--shadow); }
.acc summary { min-height: 52px; display: flex; align-items: center; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; cursor: pointer; }
.acc ul { padding-left: 20px; margin: 0 0 12px; }
.group-h { font-family: var(--serif); } .acc li { margin: 6px 0; }
.acc p { margin: 8px 0; }
.group-h { font-size: 1.3rem; margin: 20px 0 4px; color: var(--olive); }
.about p { max-width: 70ch; }

/* --- режим готовки --- */
.cook { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.cook header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cook header b { flex: 1; font-family: var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cook .bar { height: 6px; background: var(--line); } .cook .bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.cook .stage { flex: 1; overflow-y: auto; display: grid; align-content: center; padding: 22px 22px; }
.cook .num { color: var(--accent); font-weight: 800; letter-spacing: .06em; font-size: .9rem; margin-bottom: 10px; }
.cook .text { font-family: var(--serif); font-size: clamp(1.45rem, 4.6vw, 2.2rem); line-height: 1.4; max-width: 34ch; margin: 0 auto; width: 100%; }
.cook .nav2 { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.cook .nav2 .btn { min-height: 60px; font-size: 1.1rem; white-space: nowrap; }
.cook .ingr { padding: 14px 22px; max-height: 45vh; overflow-y: auto; border-top: 1px solid var(--line); background: var(--paper); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; z-index: 120; font-weight: 600; max-width: 90vw; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 26px 16px 10px; }
.foot a { color: inherit; }
.skeleton { height: 120px; border-radius: var(--r); background: linear-gradient(90deg, var(--chip), var(--paper), var(--chip)); background-size: 200% 100%; animation: sh 1.4s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- печать: только рецепт --- */
@media print {
  .top, .tabbar, .acts, .back, .scale, .similar, .foot, .cook, .toast, .fav { display: none !important; }
  body { background: #fff; color: #000; padding: 0; } .rhead, .panel { box-shadow: none; border-color: #bbb; background: #fff; }
  .cols { display: block; } .cols .ing { position: static; } .steps li, .ilist li { break-inside: avoid; }
  details.fold { display: block; } details.fold > summary { display: none; } details.fold:not([open]) > * { display: block; }
}

/* --- выбор книги --- */
.books { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
@media (max-width: 640px) { .books { grid-template-columns: repeat(2, 1fr); } }
.books button, .books a { text-decoration: none; min-height: 54px; border: 1.5px solid var(--line); background: var(--chip); color: var(--ink); border-radius: 14px; font-weight: 700; font-size: .92rem; line-height: 1.15; padding: 6px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.books button small, .books a small { font-weight: 500; opacity: .75; font-size: .78rem; }
.books button[aria-pressed="true"], .books a[aria-pressed="true"] { background: var(--chip-on); border-color: var(--chip-on); color: var(--accent-ink); }
.tag.bk { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.csep { align-self: center; flex: none; padding: 0 2px 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; border-left: 2px solid var(--line); }
.source-note { margin: 18px 0 0; font-size: .85rem; color: var(--muted); }
@media (max-width: 380px) { .books button, .books a { font-size: .84rem; padding: 6px 4px; } }

/* --- рецепты Похлёбкина: основа, указания автора, таблица --- */
.rhead .sub { margin-top: 4px; font-size: .98rem; }
.basebox { background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; font-size: .92rem; line-height: 1.45; }
.basebox a { font-weight: 700; }
.basebox .fold { margin-top: 6px; }
.basebox ul { margin: 6px 0 4px 18px; padding: 0; }
.about-dish { margin: 14px 0 0; }
.about-dish p, .genbox .gen-body p { margin: .55em 0; line-height: 1.55; }
.genpanel { margin-top: 16px; } .genbox { margin-top: 0; }
.t th[scope="row"] { text-align: left; font-weight: 700; white-space: nowrap; }

.cols > * { min-width: 0; }
.tablewrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- чтение --- */
.reader { max-width: 760px; }
.reader .rtext { font-size: calc(1.04rem * var(--rfs, 1)); line-height: 1.72; }
.reader .rtext p { margin: .7em 0; }
.reader .rtext .rh { margin: 1.4em 0 .5em; line-height: 1.25; scroll-margin-top: 80px; }
.reader .rtext h2.rh { font-size: 1.5em; } .reader .rtext h3.rh { font-size: 1.28em; } .reader .rtext h4.rh, .reader .rtext h5.rh { font-size: 1.12em; }
.reader .rb { margin-top: 1.1em; }
.reader .dterm { scroll-margin-top: 80px; }
.reader .dterm b { color: var(--accent); letter-spacing: .02em; }
.reader .flash { animation: flash 2s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.crumbs { font-size: .88rem; color: var(--muted); margin: 6px 0 4px; } .crumbs a { color: var(--accent); }
.rtools { float: right; display: flex; gap: 6px; margin-top: -2px; }
.rcontents ol { margin: 6px 0 0 18px; padding: 0; } .rcontents li { margin: .25em 0; } .rcontents li.l2 { margin-left: 14px; font-size: .95em; }
.rlinks { display: flex; flex-wrap: wrap; gap: 8px; margin: .6em 0 1em; }
.rlink { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: hsl(var(--h) 60% 94%); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; border: 1px solid hsl(var(--h) 40% 85%); }
.rlink small { color: var(--accent); font-weight: 700; }
:root[data-theme="dark"] .rlink { background: hsl(var(--h) 25% 20%); border-color: hsl(var(--h) 25% 30%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rlink { background: hsl(var(--h) 25% 20%); border-color: hsl(var(--h) 25% 30%); } }
.rnav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 28px 0 8px; }
.rnav .btn { max-width: 48%; white-space: normal; text-align: left; }
.rt td, .rt th { font-size: .9rem; }
table.t.rt td, table.t.rt th { white-space: normal; vertical-align: top; text-align: left; }
table.t.rt td:not(:first-child), table.t.rt th:not(:first-child) { min-width: 88px; }
table.t.rt td:first-child, table.t.rt th:first-child { min-width: 110px; }
.rt tr.tg td { font-weight: 700; color: var(--accent); background: var(--chip); text-align: left; }
.rtitle { margin: 1.2em 0 .3em; font-weight: 700; }
.rbooks { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.reader-toc .rpart { margin-top: 16px; } .reader-toc .rpart h2 { margin: 0 0 8px; font-size: 1.25rem; }
.rlist { list-style: none; margin: 0; padding: 0; }
.rlist li a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px; border-bottom: 1px dashed var(--line); text-decoration: none; color: var(--ink); }
.rlist li:last-child a { border-bottom: 0; }
.rlist small { color: var(--muted); white-space: nowrap; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; } .letters .chip { min-width: 44px; justify-content: center; }
.rhits { list-style: none; margin: 12px 0 0; padding: 10px 14px; } .rhits li { padding: 6px 0; border-bottom: 1px dashed var(--line); } .rhits li:last-child { border: 0; }
@media (max-width: 600px) { .rnav .btn { max-width: 100%; width: 100%; } .rlist small { display: none; } }

.tabbar a { min-width: 0; font-size: .7rem; letter-spacing: -.01em; }
.tabbar a span:last-child { overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }

.starnote{margin:12px 0 0;font-size:.82rem;color:var(--muted);line-height:1.45}
.starnote b{color:var(--accent,#c0392b);font-size:1rem}

.rtime{display:flex;flex-wrap:wrap;gap:6px 16px;align-items:baseline;margin-top:10px;font-size:.92rem}
.rtime .ahead{color:var(--ink);background:var(--accent-soft);border-radius:10px;padding:4px 10px}
.rtime .fine{font-size:.78rem;color:var(--muted)}
.tiplist{margin:6px 0 0;padding-left:1.1em;display:grid;gap:10px}
.tiplist li{line-height:1.5}
.tipsrc{display:block;font-size:.78rem;color:var(--muted);margin-top:2px}
.note.mine{background:transparent;border:1px dashed var(--line,#ccc)}
.note.warn{background:color-mix(in srgb,#e8a23a 16%,transparent);border-left:4px solid #e8a23a}

.xref{color:var(--accent,inherit);text-decoration:underline;text-decoration-style:dotted;text-underline-offset:3px}
.xref:hover{text-decoration-style:solid}
.note.swap{border-left:3px solid var(--olive);}
.rtime .eq{flex-basis:100%;}
.gstar{color:var(--muted);font-size:.72em;font-weight:400;margin-left:1px;cursor:help;vertical-align:super;line-height:0}
.rfig { margin: 1.2em auto; text-align: center; max-width: 100%; }
.rfig img { max-width: 100%; max-height: 72vh; width: auto; height: auto; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.12); background: #f4efe4; }
.rfig figcaption { margin-top: 8px; font-size: .9rem; color: var(--muted); line-height: 1.4; max-width: 60ch; margin-left: auto; margin-right: auto; }
.panel .rfig:first-of-type { margin-top: .4em; }
.otherbooks { margin-top: 18px; } .otherbooks ul { margin: 0; padding-left: 1.2em; } .otherbooks li { padding: 4px 0; } .otherbooks small { margin-left: 6px; }
.rhits-h { margin: 16px 0 6px; font-size: 1rem; }

/* server-rendered list (hbs/p, js/ssr.js) */
.grid[data-bk] .tag.bk { display: none; }
.lbl2 { font-size: .82rem; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.seg.seg5 { grid-template-columns: repeat(5, 1fr); }
.more a.btn { text-decoration: none; }
