/* подготовкакэкзаменам.раул.рф — палитра как у рома.раул.рф: светлая (синий акцент), тёмная зелёная, чёрная OLED */
:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #E9EDF3;
  --ink: #14181E;
  --muted: #4A5361;
  --accent: #1D4ED8;
  --accent-soft: #E3EAFC;
  --on-accent: #FFFFFF;
  --border: #D3D9E2;
  --ok: #1F8A47;
  --ok-soft: #DCF5E3;
  --warn-bg: #FFF6D6;
  --warn-line: #B7791F;
  --warn-ink: #5C3B00;
  --ex-line: #1D4ED8;
  --shadow: 0 1px 3px rgba(20, 24, 30, 0.07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161D1A;
    --surface: #1F2924;
    --surface-2: #28352E;
    --ink: #EEF3EC;
    --muted: #B7C4BA;
    --accent: #8FB1FF;
    --accent-soft: #24304A;
    --on-accent: #0E1320;
    --border: #3B4B41;
    --ok: #4CC47A;
    --ok-soft: #173A26;
    --warn-bg: #3B3212;
    --warn-line: #E0B23F;
    --warn-ink: #FFE49A;
    --ex-line: #8FB1FF;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"], :root[data-theme="oled"] {
  --bg: #161D1A;
  --surface: #1F2924;
  --surface-2: #28352E;
  --ink: #EEF3EC;
  --muted: #B7C4BA;
  --accent: #8FB1FF;
  --accent-soft: #24304A;
  --on-accent: #0E1320;
  --border: #3B4B41;
  --ok: #4CC47A;
  --ok-soft: #173A26;
  --warn-bg: #3B3212;
  --warn-line: #E0B23F;
  --warn-ink: #FFE49A;
  --ex-line: #8FB1FF;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
:root[data-theme="oled"] {
  --bg: #000000;
  --surface: #121A16;
  --surface-2: #1C2620;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 "Golos Text", "Segoe UI", Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 32px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 6px 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }
h3 { font-size: 1.02rem; margin: 0 0 8px; }
p { margin: 0 0 10px; }
ul, ol { margin: 0 0 10px; padding-left: 1.3em; }
li { margin: 4px 0; }
b, strong { font-weight: 600; }

/* шапка */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--border); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.brand .mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--ok); color: #fff; font-size: 15px; }
.back { text-decoration: none; font-weight: 500; padding: 8px 0; }
.theme-btn { background: none; border: 1px solid var(--border); color: var(--ink); width: 38px; height: 38px;
  border-radius: 10px; display: grid; place-items: center; cursor: pointer; }

/* карточки */
.card, .event, .task, .steps, .later { background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin: 14px 0; box-shadow: var(--shadow); }
.hero { margin: 18px 0 6px; }
.hero p { color: var(--muted); }

/* «Сегодня» */
.today { border-color: var(--ok); background: var(--ok-soft); }
.today:empty { display: none; }
.today .lead { font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }
.today h2 { margin-bottom: 8px; }
.today ul { list-style: none; padding: 0; margin: 0; }
.today li a { display: flex; gap: 10px; align-items: center; font-weight: 600; text-decoration: none;
  padding: 6px 0; color: var(--ink); }
.today li a::before { content: "→"; color: var(--ok); }
.today li.done a { color: var(--muted); text-decoration: line-through; }

/* событие и список рецептов */
.ev-top { margin-bottom: 4px; }
.count { display: inline-block; font-size: 0.85rem; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); }
.count.soon { background: var(--warn-bg); color: var(--warn-ink); }
.count.small { font-size: 0.78rem; padding: 1px 8px; white-space: nowrap; }
.event h2 { font-size: 1.3rem; margin: 6px 0 2px; }
.when { color: var(--muted); font-size: 0.92rem; }
.approx { display: block; font-size: 0.82rem; }
.progress { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; }
.progress .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s; }
.ptext { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.recipes { list-style: none; padding: 0; margin: 8px 0 4px; }
.recipes li { margin: 0; border-top: 1px solid var(--border); }
.recipes a { display: flex; align-items: center; gap: 12px; padding: 12px 2px; text-decoration: none; color: var(--ink); }
.recipes .num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); font-weight: 600; font-size: 0.9rem; }
.recipes .t { flex: 1; font-weight: 500; line-height: 1.3; }
.recipes .min { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.recipes .tick { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); }
.recipes li.done .tick { background: var(--ok); border-color: var(--ok); position: relative; }
.recipes li.done .tick::after { content: "✓"; color: #fff; position: absolute; inset: 0; display: grid;
  place-items: center; font-size: 14px; font-weight: 700; }
.recipes li.done .num { background: var(--ok-soft); color: var(--ok); }
.variant-link { display: block; margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--accent);
  color: var(--on-accent); text-decoration: none; font-weight: 600; text-align: center; }
.later ul { list-style: none; padding: 0; margin: 0; }
.later li { padding: 10px 0; border-top: 1px solid var(--border); margin: 0; }
.later li:first-child { border-top: 0; padding-top: 0; }
.later li b { display: block; margin-top: 4px; }
.later .when { display: block; }
.later .status { display: block; font-size: 0.82rem; color: var(--muted); font-style: italic; }
@media (max-width: 420px) { .katex-display > .katex { font-size: 0.98em; } }
.how ol { padding-left: 1.2em; }
.foot { color: var(--muted); font-size: 0.9rem; padding-top: 8px; padding-bottom: 40px; }

/* страница рецепта */
.crumb { font-size: 0.85rem; color: var(--muted); margin: 18px 0 0; }
.for { color: var(--muted); font-size: 0.92rem; }
.intro { font-size: 1.05rem; }
.remember { border-left: 4px solid var(--ok); }
.steps ol { list-style: none; padding: 0; counter-reset: st; margin: 0; }
.steps ol > li { counter-increment: st; position: relative; padding: 2px 0 12px 44px; margin: 0; }
.steps ol > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 30px; height: 30px;
  border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center;
  font-weight: 700; font-size: 0.95rem; }
.steps ol > li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 2px;
  width: 2px; background: var(--border); }
.example { border-left: 4px solid var(--ex-line); }
.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.warn h2 { color: var(--warn-ink); }
.practice > h2 { margin-top: 26px; }
.hint { color: var(--muted); font-size: 0.92rem; }
.task h3 { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.task .tag { font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.task .from { font-size: 0.85rem; color: var(--muted); }
details { margin-top: 8px; border-radius: 10px; background: var(--surface-2); }
details > summary { cursor: pointer; padding: 10px 12px; font-weight: 600; color: var(--accent); list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; }
details[open] > summary::before { content: "▾ "; }
.reveal { padding: 0 12px 10px; }
.done-row { margin: 22px 0 10px; }
.done-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px;
  border-radius: 12px; border: 2px solid var(--ok); background: var(--surface); color: var(--ok);
  font: inherit; font-weight: 600; cursor: pointer; }
.done-btn .box { width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--ok); display: grid; place-items: center; }
.done-btn.on { background: var(--ok); color: #fff; }
.done-btn.on .box { border-color: #fff; }
.done-btn.on .box::after { content: "✓"; font-size: 13px; font-weight: 700; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.pager a { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  text-decoration: none; color: var(--ink); background: var(--surface); font-size: 0.92rem; line-height: 1.3; }
.pager a small { display: block; color: var(--accent); font-weight: 600; }
.pager .next { text-align: right; }

/* формулы */
.katex { font-size: 1.06em; }
.mathd, .katex-display { overflow-x: auto; overflow-y: hidden; max-width: 100%; }
.mathd { margin: 8px 0 12px; }
.katex-display { margin: 0.4em 0; padding: 2px 0; }
