/* Two modes on the home page: "Стрічка" is a dated list with category chips; "Журнал" follows the editor's sketch (hero, headline stack, squares, wide strips). Phones stack every block into one column. */
/* Theme: deep navy with gold, matching the brain logo. One dark look, set explicitly. Leave the header's right side free for a future owl mascot. */
:root {
  --bg: #070d26;
  --panel: #0e1838;
  --panel-2: #142150;
  --fg: #efe2c2;
  --muted: #a9b3d6;
  --tile: #0e1838;
  --line: #27366a;
  --accent: #e0b04a;
  --accent-ink: #1a1203;
  --free: #7fd9a6;
  --paid: #f0a86a;
  --glow: rgba(224, 176, 74, 0.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60vmax 40vmax at 85% -10%, rgba(224, 176, 74, 0.12), transparent 70%),
    var(--bg);
  color: var(--fg);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 0;
}
a { color: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: 900px; margin: 0 auto; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-mark { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; box-shadow: 0 0 24px var(--glow); }
.logo { font-family: "Unbounded", system-ui, sans-serif; font-weight: 800; font-size: 22px; color: var(--fg); }
.logo i { font-style: normal; color: var(--accent); }

.toggle {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: var(--tile); border: 1px solid var(--line); border-radius: 999px;
}
.toggle button, .chip {
  font: inherit; font-size: 14px; font-weight: 700; color: var(--fg); cursor: pointer;
  background: transparent; border: 0; border-radius: 999px; padding: 8px 16px;
}
.toggle button[aria-pressed="true"], .chip[aria-pressed="true"] { background: linear-gradient(180deg, #f3cf72, #b8862b); color: var(--accent-ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { border: 1px solid var(--line); background: var(--tile); font-size: 13px; padding: 7px 12px; }

/* Стрічка */
.day { margin-bottom: 36px; }
.day h3 { font-size: 17px; font-weight: 700; color: var(--accent); margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.row .cat { font-size: 12px; font-weight: 700; color: var(--muted); }
.row span:last-child { font-size: 16px; line-height: 1.4; }
.row:focus-visible, .tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Журнал */
.journal .home { display: flex; flex-direction: column; gap: 12px; }
.pair { display: grid; gap: 12px; min-width: 0; }
.pair > .stack > .tile { flex: 1 1 0; }  /* плашки стеку ростуть до висоти сусіднього блоку: без пропусків */
.pair.hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.strips { display: grid; gap: 12px; }
.strips.a { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.strips.b { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.tile {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  background: var(--tile); border: 1px solid var(--line); border-radius: 20px; padding: 16px;
  text-decoration: none;
}
.tile.square { aspect-ratio: 1 / 1; }
.tile.big {
  min-height: 320px; justify-content: flex-end; color: var(--fg); border-color: var(--accent);
  background: linear-gradient(160deg, #24398a, var(--panel) 70%);
  box-shadow: 0 0 40px var(--glow);
}
.tile.big h2 { font-size: 24px; }
.tile.big .tag, .tile.big .more { color: var(--accent); opacity: 1; }
.tile.line { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; }
.tile.line h2 { font-size: 15px; }
.tile.line .more { white-space: nowrap; font-size: 12px; }
.tag, .block h3 a { color: var(--accent); }
.tag { font-size: 12px; font-weight: 700; }
.tile h2 { font-size: 16px; line-height: 1.3; margin: 0; text-wrap: balance; }
.more { margin-top: auto; font-size: 13px; color: var(--muted); }

/* Стаття */
.detail { min-width: 0; text-align: justify; hyphens: auto; }
.detail h1 { font-size: 28px; line-height: 1.18; margin: 8px 0 12px; }
.detail .lead { font-size: 17px; line-height: 1.6; margin: 0 0 18px; }
.detail h2 { font-size: 18px; margin: 22px 0 8px; }
.h-emoji { font-variant: normal; margin-right: 4px; }
.detail p { font-size: 16px; line-height: 1.65; margin: 0 0 14px; }
.hero { margin: 0 0 22px; text-align: left; }
.hero img, .hero-art { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.hero figcaption { font-size: 12px; line-height: 1.4; color: var(--muted); margin-top: 6px; }
.kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin: 0; }
.source { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.source-label { color: var(--muted); font-weight: 700; margin-right: 2px; }
.pill {
  display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--fg); text-decoration: none; font-size: 14px;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.static h1 { font-size: 30px; }

/* Футер на всю ширину під усією оболонкою: ліве меню заходить за його верхню лінію. */
.site-footer {
  max-width: 1600px; margin: 0 auto; padding: 22px max(16px, env(safe-area-inset-left, 0px)) 0;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 14px; }
.site-footer a { text-decoration: none; color: var(--fg); }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer p { margin: 0; padding-bottom: 8px; }

@media (max-width: 640px) {
  .pair.hero, .strips.a, .strips.b { grid-template-columns: minmax(0, 1fr); }
  .trio { grid-template-columns: minmax(0, 1fr); }
  .tile.square { aspect-ratio: auto; min-height: 120px; }
  .tile.big { min-height: 240px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Стрічка в стилі новинного порталу: ліва колонка з категоріями, центр з блоками, права з рекламою. */
.side-left { position: sticky; top: env(safe-area-inset-top, 0px); display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.side-left a {
  display: block; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--fg); text-decoration: none; font-weight: 700;
}
.side-left a:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 16px var(--glow); }
.side-left a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.feed-center { min-width: 0; }
.block { margin-bottom: 26px; }
.block h3 { font-size: 20px; margin: 0 0 8px; letter-spacing: -0.01em; }
.block h3 a { text-decoration: none; }
.block .row { grid-template-columns: 52px minmax(0, 1fr); padding: 8px 0; border-bottom: 1px dashed var(--line); }
.block .row time { font-size: 13px; color: var(--muted); }
.headline { font-size: 15px; line-height: 1.4; }
.headline em { font-style: normal; color: var(--muted); font-size: 13px; }
.more-link { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--accent); }
.cat-title { font-size: 26px; margin: 8px 0 14px; }
.side-right { display: flex; flex-direction: column; gap: 16px; position: sticky; top: env(safe-area-inset-top, 0px); }
.ad {
  display: grid; place-items: center; border-radius: 16px; border: 1px dashed var(--accent);
  background: var(--panel-2); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
}
.ad.tall { min-height: 250px; }
.ad.banner { min-height: 90px; margin: 4px 0 22px; }
@media (max-width: 960px) {
  .side-left { display: none; }
}
@media (max-width: 640px) {
  .side-right { position: static; flex-direction: row; }
  .side-right .ad { flex: 1; }
}

/* Одна оболонка для всіх сторінок: розділи зліва, новини по центру, реклама справа від краю. */
.shell { display: grid; grid-template-columns: clamp(150px, 16vw, 200px) minmax(0, 1fr) clamp(170px, 20vw, 300px); gap: clamp(16px, 2vw, 28px); max-width: 1600px; margin: 0 auto; align-items: start; }
/* Сторінки без новинних розділів (гайди, курси, добірки, про нас): текст і реклама справа, без лівої колонки. */
.shell-plain { grid-template-columns: minmax(0, 1fr) clamp(170px, 20vw, 300px); }
.center { min-width: 0; }
.side-left, .side-right { position: sticky; top: env(safe-area-inset-top, 0px); }
.shell > .side-left, .shell > .side-right { align-self: stretch; }  /* обидві колонки тягнуться до лінії футера */
.side-left { display: flex; flex-direction: column; gap: 10px; }
.side-right { display: flex; flex-direction: column; gap: 16px; }
.ad.tall { min-height: 600px; width: 100%; }
.ad.square { min-height: 250px; width: 100%; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side-left { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .side-left a { flex: 0 0 auto; padding: 8px 12px; }
  .side-right { grid-column: 1 / -1; position: static; flex-direction: row; }
  .side-right .ad { flex: 1; }
  .ad.tall { min-height: 250px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .side-left { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .side-left a { flex: 0 0 auto; padding: 8px 12px; }
  .side-right { flex-direction: column; }
  .ad.tall, .ad.square { min-height: 120px; }
}

/* Верхній рядок оболонки: логотип над розділами, перемикач над центром. Розділи і реклама починаються з першого блоку контенту. */

.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-sub { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* Реклама між новинами: на телефоні і планшеті (до 900 px), справа на широких екранах. */
.ad.inline { display: none; margin: 14px 0; }
@media (max-width: 900px) {
  .side-right { display: none; }
  .ad.inline { display: grid; min-height: 250px; }
  .ad.inline.wide { min-height: 120px; }
}
.shell > * { min-width: 0; max-width: 100%; }
@media (max-width: 760px) {
  .shell { width: 100%; }
  .center { width: 100%; }
}

/* Ліве меню на широких екранах: без обмеження висоти, щоб нижній край збігався з футером. */
@media (min-width: 901px) {
  .side-left { padding-right: 4px; }  /* висота меню дорівнює висоті сторінки: нижній край збігається з футером */
}

/* Журнал: різні хвилі — велика плашка зліва або справа, дві половини, квадрати й пари. */
.pair.wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pair.mirror.hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.pair.mirror.wide { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.full-hero .tile.big, .twin .tile.big { min-height: 260px; }
.pair .tile.big { min-height: 0; height: 100%; }  /* велика плашка рівно з висотою стеку, не вища за сусідів */
.quad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.twin, .duo, .grid4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) {
  .pair.mirror.hero, .pair.mirror.wide, .pair.wide { grid-template-columns: minmax(0, 1fr); }
  .twin, .duo { grid-template-columns: minmax(0, 1fr); }
  .quad, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Пошук і заголовки дат у журналі. */
.search { display: flex; gap: 8px; margin: 0 0 16px; }
.search input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); }
.search button { font: inherit; font-weight: 700; padding: 12px 18px; border-radius: 12px; border: 0; background: linear-gradient(180deg, #f3cf72, #b8862b); color: var(--accent-ink); cursor: pointer; }
.day-head { font-size: 17px; color: var(--accent); margin: 18px 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.more-btn { display: block; width: 100%; margin: 12px 0 0; font: inherit; font-weight: 700; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--accent); cursor: pointer; }
.more-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tail { display: grid; gap: 12px; }
.search-filters { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.search-filters select, .search-filters input { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); }
.search-notice { color: var(--accent); margin: 0 0 12px; }

.lang { display: inline-flex; gap: 4px; font-size: 20px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: transparent; font-size: 18px; cursor: pointer; }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pop-wrap { position: relative; }
.pop { position: absolute; right: 0; top: 48px; width: min(300px, 80vw); padding: 14px 16px; border-radius: 14px; background: var(--panel-2); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.45); z-index: 20; font-size: 14px; line-height: 1.5; }
.pop[hidden] { display: none; }
.pop p { margin: 6px 0 0; color: var(--muted); }


/* Режими стрічки і журналу: рядок під пошуком переноситься на вузьких екранах, у налаштуваннях — на всю ширину. */
.toggle { flex-wrap: wrap; max-width: 100%; }
.toggle button { min-height: 40px; }
.mode-bar { display: flex; margin: 0 0 18px; }
.mode-bar button { flex: 0 1 auto; }
.toggle-pop { display: flex; margin: 10px 0 0; border-radius: 14px; }
.toggle-pop button { flex: 1 1 0; padding: 8px 10px; font-size: 13px; }
.pop-label { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.notify-note { margin: 6px 0 0; color: var(--muted); }

/* Сповіщення і налаштування: видимий фокус і великі цілі для дотику. */
.icon-btn { position: relative; }
.pop button:focus-visible, .pop a:focus-visible, .pop-btn:focus-visible, .toggle button:focus-visible, .switch:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.dot { position: absolute; top: 5px; right: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.notify-body { margin-top: 10px; }
.notify-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: 10px; background: var(--panel); }
.notify-item .notify-note { margin-top: 0; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pop-btn {
  font: inherit; font-size: 13px; font-weight: 700; min-height: 36px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--accent); text-decoration: none; cursor: pointer;
}
.switch {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin-top: 12px; padding: 6px 0;
  font: inherit; font-size: 14px; text-align: left; color: var(--fg); background: transparent; border: 0; cursor: pointer;
}
.switch-track { position: relative; flex: 0 0 auto; width: 42px; height: 24px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); transition: background 0.15s; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform 0.15s; }
.switch[aria-checked="true"] .switch-track { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(18px); background: var(--accent-ink); }

/* Скелет під час завантаження. */
.skeleton { display: flex; flex-direction: column; gap: 8px; }
.skeleton span {
  display: block; height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--panel), var(--panel-2), var(--panel)); background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skeleton span:last-child { width: 60%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton span { animation: none; }
  .switch-track, .switch-thumb { transition: none; }
}

/* Вузькі телефони: логотип менший, права частина шапки лишається в рядку. */
@media (max-width: 400px) {
  .logo-mark { width: 40px; height: 40px; }
  .logo { font-size: 18px; }
  .pop { width: min(300px, 86vw); }
}
/* Теги статті, хлібні крихти та пов'язані новини (розділ 9). */
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.crumbs a { color: var(--muted); }
.tags, .related { margin-top: 22px; }
.tags h3, .related h3 { font-size: 14px; margin: 0 0 8px; }
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--fg);
  font-size: 13px;
  text-decoration: none;
}
.pill:hover, .pill:focus-visible { border-color: var(--accent); color: var(--accent); }
.related .row { grid-template-columns: 52px minmax(0, 1fr); padding: 8px 0; border-bottom: 1px dashed var(--line); }
.related .row time { font-size: 13px; color: var(--muted); }
.search { flex-wrap: wrap; }
.search > input[type="search"] { flex: 1 1 260px; }
.search-filters input[type="date"] { min-width: 132px; }
.search-filters { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search-filters .tag-input { min-width: 160px; flex: 1 1 160px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); font-size: 14px; text-decoration: none; }
.chip:hover { border-color: var(--accent); }
.chip-clear { color: var(--accent); background: transparent; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 600px) {
  .search > input[type="search"] { flex-basis: 100%; }
  .search button { flex: 1 1 100%; }
  .search-filters select, .search-filters input { flex: 1 1 calc(50% - 8px); min-width: 0; }
}
/* Журнал: банер «З’явилися нові новини», текст кінця стрічки і порожнього стану. */
.new-bar {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 50%; transform: translateX(-50%);
  z-index: 30; max-width: calc(100vw - 32px); font: inherit; font-size: 14px; font-weight: 700;
  padding: 10px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #f3cf72, #b8862b); color: var(--accent-ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.new-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.journal-end, .journal-empty { margin: 18px 0 0; text-align: center; font-size: 15px; color: var(--muted); }
.search-filters { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.search-filters select, .search-filters input { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); }
.search-notice { color: var(--accent); margin: 0 0 12px; }

/* Пошук згорнутий за замовчуванням: відкривається кнопкою 🔍 у шапці. Режим стрічки/журналу сидить у шапці поруч із логотипом. */
.search-box { margin: 0 0 16px; }
@media (max-width: 640px) {
  .logo { font-size: 20px; }
  .logo-mark { width: 44px; height: 44px; }
  .lang { font-size: 16px; }
}


/* Банер cookies знизу, поверх сторінки, доки немає вибору. Кольори як у шапці: навіга і кремовий текст. */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding: 16px max(16px, env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  color: var(--fg); font-size: 14px; line-height: 1.5;
}
.cookie-banner p { margin: 0; max-width: 62ch; }
.cookie-banner a { color: var(--accent); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie-actions button {
  font: inherit; font-weight: 700; min-height: 44px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); cursor: pointer;
}
.cookie-actions button.cookie-accept { background: linear-gradient(180deg, #f3cf72, #b8862b); color: var(--accent-ink); border-color: transparent; }
.cookie-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.has-cookie-banner { padding-bottom: 170px; }
.site-footer button { font: inherit; color: var(--fg); background: none; border: 0; padding: 0; cursor: pointer; }
.site-footer button:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 640px) {
  .cookie-actions { width: 100%; }
  .cookie-actions button { flex: 1 1 auto; }
  body.has-cookie-banner { padding-bottom: 260px; }
}

/* Гайди: ті самі плашки, чіпи і шрифти, що й новини; тут лише структура сторінки гайду. */
.guide-lede { font-size: 16px; color: var(--muted); margin: 0 0 16px; max-width: 640px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 24px; }
.guide-grid .tile { min-height: 150px; }
.guide-empty { color: var(--muted); }
.guide-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; padding: 12px; background: var(--tile); border: 1px solid var(--line); border-radius: 18px; }
.guide-content { background: var(--tile); border: 1px solid var(--line); border-radius: 22px; padding: 24px clamp(16px, 3.5vw, 32px); }
.guide-tile { position: relative; overflow: hidden; min-height: 150px; }
.guide-tile h2 { max-width: 74%; margin-top: 14px; }
.guide-art { position: absolute; right: -6px; top: -4px; width: 78px; height: 78px; color: var(--accent); opacity: .9; pointer-events: none; }
.guide-owl { width: 100%; height: 100%; display: block; }
.guide-actions .chip { text-decoration: none; }
.guide-detail .lead { color: var(--muted); }
.guide-toc { margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--tile); }
.guide-toc .kicker { margin-bottom: 8px; }
.guide-toc ol { margin: 0; padding-left: 20px; }
.guide-toc li { margin: 2px 0; }
.guide-sec + .guide-sec { margin-top: 24px; }
.guide-detail h2 { scroll-margin-top: 16px; }
.guide-detail ul, .guide-detail ol { padding-left: 22px; }
.guide-detail li { font-size: 16px; line-height: 1.6; margin-bottom: 6px; }
.guide-callout { border-left: 3px solid var(--accent); background: var(--tile); padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-size: 15px; }
.guide-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; margin: 12px 0; }
.guide-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.guide-table th, .guide-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.guide-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.guide-table tr:last-child td { border-bottom: 0; }
.guide-steps, .guide-check { list-style: none; padding: 0; }
.guide-steps li, .guide-check li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.guide-steps p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.guide-step-no { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: linear-gradient(180deg, #f3cf72, #b8862b); color: var(--accent-ink); }
.guide-box { flex: none; width: 18px; height: 18px; margin-top: 4px; border: 2px solid var(--accent); border-radius: 5px; }
.guide-sources h2 { font-size: 16px; }
.footer-ai { font-size: 13px; line-height: 1.5; opacity: .85; margin: 0 0 8px; }
.guide-print-note { display: none; }

/* Картка гайду для сторіс: 1080×1920 окремою сторінкою */
.guide-story-page { margin: 0; background: #070d26; }
.guide-story { width: 1080px; height: 1920px; padding: 120px 110px; display: flex; flex-direction: column; gap: 36px; color: var(--fg);
  background: radial-gradient(70vmax 50vmax at 85% -10%, rgba(224, 176, 74, 0.25), transparent 70%), #070d26; font-family: "Manrope", system-ui, sans-serif; }
.guide-story-top { display: flex; align-items: center; gap: 20px; font-size: 26px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.guide-story-top .guide-owl { width: 150px; height: 150px; flex: none; color: var(--accent); }
.guide-story h1 { font-family: "Unbounded", system-ui, sans-serif; font-size: 92px; line-height: 1.08; margin: 0; }
.guide-story p { font-size: 40px; color: var(--muted); margin: 0; line-height: 1.35; }
.guide-story ul { font-size: 38px; padding-left: 44px; margin: 0; line-height: 1.5; }
.guide-story-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 30px; }

/* Друк і PDF гайду: лише текст без шапки, сайдбарів і кнопок */
/* Друк і «Зберегти PDF»: макет offset у палітрі сайту. Блоки ліворуч з тінню, обкладинка темно-синя з совою */
.guide-print-owl { display: none; }
@media print {
  .guide-page .site-header, .guide-page .side-left, .guide-page .side-right, .guide-page .site-footer,
  .guide-page .guide-actions, .guide-page .guide-toc, .guide-page .kicker a { display: none !important; }
  html, body { background: #f7f0df !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .guide-page .shell { display: block; }
  .guide-detail { text-align: left; color: #070d26; background: #f7f0df; }
  .guide-page .guide-content { background: none; border: 0; padding: 0; }
  .guide-print-note { display: block; margin-top: 24px; font-size: 10pt; color: #555; }
  .guide-head { background: #070d26; color: #f7f0df; padding: 12mm 12mm 10mm; margin: 0 0 8mm; overflow: hidden; break-after: avoid; }
  .guide-head h1 { color: #f7f0df; font-size: 26pt; }
  .guide-head .lead { color: #e0b04a; }
  .guide-head .kicker { color: #e3d6b6; }
  .guide-print-owl { display: block; float: right; width: 34mm; height: 34mm; margin: 0 0 0 6mm; color: #e0b04a; }
  .guide-print-owl svg { width: 100%; height: 100%; }
  .guide-page .detail h2, .guide-page .detail p, .guide-page .detail li { color: #070d26; }
  .guide-sec { background: #fffaf0; border: 0.3mm solid #b8862b; box-shadow: 1.2mm 1.2mm 0 #070d26; border-radius: 0; padding: 5mm 6mm; margin: 0 1.5mm 7mm 0; break-inside: avoid; }
  .guide-sec + .guide-sec { margin-top: 0; }
  .guide-sec h2 { color: #070d26; font-size: 14pt; margin-top: 0; break-after: avoid; }
  .guide-sec.guide-sources { box-shadow: none; border-color: #e3d6b6; }
  .guide-table, .guide-steps li, .guide-check li, .guide-callout { break-inside: avoid; }
}

/* Добірки: /picks, одна сторінка з категоріями */
.picks-index .guide-actions { margin-top: 0; }
.pick-sec { margin: 28px 0 8px; }
.pick-sec h2 { font-family: "Unbounded", sans-serif; font-size: 20px; margin: 0 0 12px; }
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pick { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.pick strong a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--line); }
.pick strong a:hover { border-bottom-color: var(--fg); }
.pick-meta { color: var(--muted); font-size: 14px; }
.pick p { margin: 6px 0 0; line-height: 1.5; }
/* Демо гайду: вікно чату або термінала, рядки з'являються по черзі */
.demo { margin: 16px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #050a1f; }
.demo-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.demo-bar > span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.demo-bar b { margin-left: 8px; font-size: 13px; font-weight: 700; color: var(--muted); flex: 1; }
.demo-replay { font: inherit; font-size: 12px; font-weight: 700; color: var(--fg); background: var(--tile); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.demo-body { padding: 14px 16px; font-size: 15px; line-height: 1.55; font-family: "Manrope", system-ui, sans-serif; min-height: 0; }
.demo-terminal .demo-body { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 14px; }
.demo-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 0; }
.demo-who { flex: none; min-width: 32px; font-weight: 800; color: var(--muted); }
.demo-text { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.demo-user .demo-who { color: var(--accent); }
.demo-assistant .demo-text { color: var(--fg); background: var(--panel); border-radius: 10px; padding: 8px 12px; }
.demo-cmd .demo-who, .demo-cmd .demo-text { color: var(--free); }
.demo-out .demo-text { color: var(--muted); }
.demo-step { flex: none; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink); background: linear-gradient(180deg, #f3cf72, #b8862b); border-radius: 999px; padding: 2px 8px; }
.demo-js .demo-line:not(.is-shown) { opacity: 0; }
.demo-line.is-typing .demo-text::after { content: "▍"; color: var(--accent); animation: demo-blink 1s steps(2, start) infinite; }
@keyframes demo-blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .demo-line.is-typing .demo-text::after { animation: none; } }
@media print {
  .demo-replay { display: none !important; }
  .demo-line { opacity: 1 !important; }
  .demo { break-inside: avoid; background: #fff; }
  .demo-bar, .demo-assistant .demo-text { background: #fff !important; }
  .demo-body, .demo-text, .demo-who { color: #000 !important; }
}

/* Курси: уроки і словничок */
.course-block + .course-block { margin-top: 28px; }
.course-title { font-size: 20px; margin: 0 0 6px; }
.course-terms dl { margin: 0; }
.course-terms div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.course-terms div:last-child { border-bottom: 0; }
.course-terms dt { font-weight: 700; color: var(--accent); }
.course-terms dd { margin: 2px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.course-lesson p { font-size: 16px; line-height: 1.65; margin: 0 0 10px; }
.course-pager { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
