/* ЧПЧ — mobile-first. Сначала 360px, потом расширяем. */
/* Газетная вёрстка в духе hackertimes.ca: бумага, чёрная краска, засечки в заголовках, тонкие линейки. */
:root {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f5f5f5; --text: #121212; --muted: #666666; --deck: #535353;
  --line: #dedede; --strong: #b8b8b8; --ink: #121212; --accent: #00699e; --accent-2: #00527a; --accent-soft: #e6f1f7;
  --on-accent: #ffffff; --ok: #2f7d4f; --warn: #a76a10; --danger: #b42318; --chip: #f5f5f5; --chip-text: #333333;
  --shadow: none; --radius: 0; --gap: 0; --tap: 44px;
  --font: Arial, Helvetica, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151515; --surface: #151515; --surface-2: #202020; --text: #f2f2f2; --muted: #a3a3a3; --deck: #bdbdbd;
    --line: #363636; --strong: #666666; --ink: #f2f2f2; --accent: #8cc8ee; --accent-2: #b5dcf4; --accent-soft: #1b2a33;
    --on-accent: #151515; --chip: #202020; --chip-text: #dddddd; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151515; --surface: #151515; --surface-2: #202020; --text: #f2f2f2; --muted: #a3a3a3; --deck: #bdbdbd;
  --line: #363636; --strong: #666666; --ink: #f2f2f2; --accent: #8cc8ee; --accent-2: #b5dcf4; --accent-soft: #1b2a33;
  --on-accent: #151515; --chip: #202020; --chip-text: #dddddd; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 var(--font);
  padding-bottom: calc(64px + env(safe-area-inset-bottom)); overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; min-width: 0; }
.wrap > div, .bar > * { min-width: 0; }
.hidden { display: none !important; }

/* Шапка */
.top {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 8px; height: 52px; }
.logo { font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--text); letter-spacing: -.3px; }
.logo span span, .logo .short span { color: var(--accent); }
.logo { white-space: nowrap; }
.logo .full { display: none; }
@media (min-width: 420px) { .logo .full { display: inline; } .logo .short { display: none; } }
.foot { color: var(--muted); font-size: 13px; padding-top: 18px; padding-bottom: 18px; border-top: 1px solid var(--line); margin-top: 24px; }
.foot p { margin: 4px 0; }
.foot a { color: var(--muted); text-decoration: underline; }
.lead-in { color: var(--muted); margin: 0 0 10px; }
.topic-books { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin: 6px 0 12px; }
.topic-books a { flex: 0 0 120px; font-size: 13px; color: var(--text); }
.topic-books a > span:last-child { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.topic-books img { width: 120px; height: 170px; object-fit: cover; border-radius: 6px; display: block; background: var(--line); }
.topic-books .nb { width: 120px; height: 170px; border-radius: 6px; background: var(--line); display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font-family: var(--serif); }
.top-actions { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.icon-btn {
  min-width: var(--tap); height: var(--tap); border: 0; background: none; border-radius: 12px; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; color: var(--text); position: relative;
}
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }
.badge {
  position: absolute; top: 6px; right: 4px; background: var(--accent); color: var(--on-accent); font-size: 11px; line-height: 16px;
  min-width: 16px; padding: 0 4px; border-radius: 8px; text-align: center;
}

/* Чипы-вкладки */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 7px 14px; border-radius: 999px; background: var(--chip); color: var(--chip-text);
  font-size: 15px; white-space: nowrap; scroll-snap-align: start; border: 1px solid transparent;
}
.tab.on { background: var(--text); color: var(--bg); }
.tab:hover { text-decoration: none; border-color: var(--line); }

/* Панель сортировки и фильтров */
.bar { display: flex; gap: 8px; align-items: center; padding: 10px 0; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a { white-space: nowrap; }
.seg a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg a:hover { text-decoration: none; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-size: 15px;
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 14px; }
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-size: 14px; }
.fchip.ex { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }

/* Карточка */
.cards { display: flex; flex-direction: column; gap: var(--gap); padding-bottom: 16px; }
.card {
  overflow-wrap: anywhere; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 10px;
  box-shadow: var(--shadow); position: relative; transition: opacity .2s;
}
.card.read { opacity: .62; }
.card .meta { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.card .meta .src { color: var(--text); font-weight: 600; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card h3 { margin: 6px 0 4px; font-size: 18px; line-height: 1.3; font-weight: 650; }
.card h3 a { color: var(--text); }
.card h1.story-h { margin: 6px 0 4px; font-size: 22px; line-height: 1.25; font-weight: 700; font-family: var(--serif); }
.card .sum { margin: 4px 0; color: var(--text); }
.card .orig { margin: 6px 0; color: var(--muted); font-size: 15px; white-space: pre-line; display: none; }
.card.open .orig { display: block; }
.card .thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 8px 0; }
.card .thumbs img { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.card .thumbs.one img { height: auto; max-height: 360px; object-fit: contain; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chip { font-size: 13px; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--chip-text); }
.chip:hover { text-decoration: none; filter: brightness(.96); }
.chip.book { background: var(--accent-soft); color: var(--accent-2); }
.chip.isbn { font-variant-numeric: tabular-nums; }
.imp { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.actions { display: flex; gap: 2px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.act {
  min-height: 36px; min-width: 40px; padding: 0 8px; border: 0; background: none; color: var(--muted); border-radius: 8px;
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: 14px;
}
.act:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.act.on { color: var(--accent); }
.more-src { font-size: 14px; }

/* Обзор-рубрикатор */
.rubric { margin: 18px 0 8px; }
.rubric h2 { font-family: var(--serif); font-size: 21px; margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; }
.rubric h2 a { color: var(--text); }
.rubric h2 .n { font: 14px var(--font); color: var(--muted); margin-left: auto; }
.mini { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mini a.row { display: flex; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); color: var(--text); align-items: flex-start; }
.mini a.row:first-child { border-top: 0; }
.mini a.row:hover { background: var(--surface-2); text-decoration: none; }
.mini .t { flex: 1; font-size: 16px; line-height: 1.35; }
.mini .s { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mini .t .s { white-space: normal; overflow-wrap: anywhere; }
.mini .t { min-width: 0; overflow-wrap: anywhere; }
.mini img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; flex: none; }

/* Нижняя навигация */
.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); display: flex; justify-content: space-around;
}
.bottom a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 58px;
  font-size: 11px; color: var(--muted);
}
.bottom a.on { color: var(--accent); }
.bottom a:hover { text-decoration: none; }
.bottom svg { width: 24px; height: 24px; }
.fab {
  position: fixed; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 31; width: 54px; height: 54px;
  border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); font-size: 28px;
}
.fab:hover { text-decoration: none; }

/* Плашка «новое» */
.newpill {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 25; background: var(--accent); color: var(--on-accent);
  padding: 8px 16px; border-radius: 999px; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.2); border: 0; cursor: pointer;
}
.divider { text-align: center; font-size: 13px; color: var(--accent); margin: 6px 0; display: flex; gap: 8px; align-items: center; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px dashed var(--accent); }

/* Шторка фильтров */
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--surface); border-radius: 18px 18px 0 0;
  max-height: 86vh; overflow-y: auto; padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,.2);
}
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 6px auto 10px; }
.sheet h3 { margin: 14px 0 8px; font-size: 15px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--chip); color: var(--chip-text); font-size: 14px; }
.opt.on { background: var(--text); color: var(--bg); }
.opt.ex { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.opt .c { font-size: 12px; opacity: .7; }
.opt:hover { text-decoration: none; }
.opt-x { font-size: 12px; color: var(--muted); padding: 2px 6px; }
.sheet-foot { position: sticky; bottom: 0; background: var(--surface); padding-top: 10px; display: flex; gap: 8px; }

/* Формы */
.form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.form label { font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
input[type=text], input[type=password], input[type=url], input[type=search], textarea, select {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
textarea { min-height: 110px; resize: vertical; }
.search { position: relative; }
.search input { padding-left: 38px; }
.search svg { position: absolute; left: 11px; top: 12px; width: 20px; height: 20px; color: var(--muted); }

/* Комментарии */
.comments { margin-top: 16px; }
.comment { padding: 10px 0 4px; border-top: 1px solid var(--line); }
.comment .head { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.comment .body { margin: 4px 0; white-space: pre-line; overflow-wrap: anywhere; }
.comment .kids { margin-left: 14px; padding-left: 10px; border-left: 2px solid var(--line); }
.comment.collapsed .body, .comment.collapsed .kids, .comment.collapsed .cact { display: none; }

/* Таблицы → карточки на телефоне */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; }
@media (max-width: 640px) {
  .tbl.cardify thead { display: none; }
  .tbl.cardify tr { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; padding: 6px 10px; }
  .tbl.cardify td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 4px 0; }
  .tbl.cardify td::before { content: attr(data-l); color: var(--muted); }
}
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.tile .k { font-size: 13px; color: var(--muted); }
.tile .v { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.notice { background: var(--accent-soft); color: var(--accent-2); border-radius: 12px; padding: 10px 14px; margin: 10px 0; font-size: 15px; }

/* Мемы */
.memes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.memes a { display: block; border-radius: 12px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1; }
.memes img { width: 100%; height: 100%; object-fit: cover; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.96); z-index: 60; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100vw; max-height: 86vh; object-fit: contain; }
.lightbox .cap { position: absolute; bottom: 16px; left: 16px; right: 16px; color: #eee; font-size: 14px; }

/* Пульс */
.pulse-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.pulse-row .name { flex: 1; font-weight: 600; }
.pulse-row .why { font-size: 14px; color: var(--muted); }
.spark { width: 90px; height: 28px; flex: none; }
.up { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Книга */
.book-head { display: flex; gap: 14px; margin: 14px 0; }
.book-head img { width: 110px; border-radius: 8px; flex: none; box-shadow: var(--shadow); }
.book-head h1 { font-family: var(--serif); font-size: 24px; line-height: 1.2; margin: 0 0 6px; }
.editions .ed { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 12px; }
.timeline .ev { margin: 10px 0; position: relative; }
.timeline .ev::before { content: ""; position: absolute; left: -18px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

h1.page { font-family: var(--serif); font-size: 26px; margin: 14px 0 6px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.loader { text-align: center; color: var(--muted); padding: 16px; }
.digest { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.digest h2 { font-family: var(--serif); font-size: 20px; margin: 14px 0 6px; }
.digest ul { padding-left: 20px; margin: 6px 0; }
.digest li { margin: 6px 0; }

/* Широкие экраны: две колонки и боковая панель фильтров */
@media (min-width: 1000px) {
  .wrap.wide { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }
  .side { display: block !important; position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 80px); overflow-y: auto; }
  .side .sheet { position: static; box-shadow: none; border: 1px solid var(--line); border-radius: var(--radius); max-height: none; }
  .side .grab, .side .sheet-foot { display: none; }
  .filter-btn { display: none !important; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .memes { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1000px) { body { padding-bottom: 0; } .bottom { display: none; } .fab { bottom: 24px; } .desk-nav { display: flex !important; } }
.desk-nav { display: none; gap: 2px; margin-left: 12px; }
.desk-nav a { padding: 8px 10px; border-radius: 8px; color: var(--muted); font-size: 15px; }
.desk-nav a.on { color: var(--text); background: var(--surface-2); }
.side { display: none; }
.home-h { font-family: var(--serif); font-size: 22px; margin: 12px 0 2px; }
a.loader { display: block; text-align: center; color: var(--muted); }

/* ---------- Газета ---------- */
body { font: 17px/1.5 var(--serif); padding-bottom: 0; }
a { color: inherit; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1000px; padding: 0 19px; }
.btn, .act, .seg, .tab, .chip, .fchip, .opt, .pill, .meta, .small, .muted, .foot, input, select, textarea, .tbl, .notice, .tile .k { font-family: var(--font); }

/* Шапка-масthead: дата слева, название по центру, действия справа; ниже — разделы с подчёркиванием */
.top { position: static; background: var(--bg); backdrop-filter: none; border: 0; }
.masthead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 96px; padding: 18px 19px 14px; gap: 8px; }
.mast-date { font: 10px/1.5 var(--font); color: var(--muted); align-self: end; padding-bottom: 6px; max-width: 140px; }
.logo { font: 700 44px/1 var(--serif); letter-spacing: -1.4px; color: var(--ink); text-align: center; }
.logo:hover { text-decoration: none; }
.logo span span, .logo .short span { color: inherit; }
.logo .full { display: inline; } .logo .short { display: none; }
.mast-sub { display: block; font: 10px/1.4 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; text-align: center; }
.top-actions { justify-self: end; margin: 0; }
.icon-btn { border-radius: 0; color: var(--ink); }
.icon-btn:hover { background: none; color: var(--muted); }
.badge { border-radius: 0; }
.sections-wrap { position: sticky; top: 0; z-index: 20; background: var(--bg); }
.sec-bar { display: grid; grid-template-columns: minmax(0, 1fr) 48px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sections { grid-column: 1; display: flex; justify-content: flex-start; gap: 30px; overflow-x: auto; scrollbar-width: none; }
.sec-star { grid-column: 2; display: flex; align-items: center; justify-content: flex-end; min-height: 48px; color: var(--muted); }
.sec-star:hover, .sec-star.on { color: #d4a017; }
.sec-star.on svg { fill: currentColor; }
.sections::-webkit-scrollbar { display: none; }
.sections a { position: relative; display: flex; align-items: center; min-height: 48px; padding: 0 2px; font: 13px var(--font); color: var(--muted); white-space: nowrap; }
.sections a:hover { color: var(--ink); text-decoration: none; }
.sections a.on { font-weight: 700; color: var(--ink); }
.sections a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--ink); }
.desk-nav, .bottom { display: none !important; }
.theme-btn { font: 11px var(--font); color: var(--muted); background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 0 6px; min-height: var(--tap); }
.theme-btn:hover { color: var(--ink); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .lbl { display: none; }
@media (max-width: 760px) {
  .masthead { grid-template-columns: 1fr auto; min-height: 68px; padding: 12px 19px 8px; }
  .masthead .logo { text-align: left; }
  .mast-date { display: none; }
  .mast-left { display: block; }
  .logo { font-size: 30px; letter-spacing: -.8px; }
  .mast-sub { display: none; }
  .sec-bar { grid-template-columns: minmax(0, 1fr) 44px; border-top: 0; }
  .sections { grid-column: 1; justify-content: flex-start; gap: 22px; }
  .sec-star { grid-column: 2; min-height: 50px; }
  .sections a { font-size: 14px; min-height: 50px; }
}
@media (max-width: 380px) { .logo .full { display: none; } .logo .short { display: inline; } }

/* Чипы-вкладки — строкой мелким гротеском */
.tabs { gap: 18px; padding: 0 19px; scroll-padding-inline: 19px; max-width: 1000px; margin: 0 auto; border-bottom: 1px solid var(--line); }
.tab { padding: 12px 0; border-radius: 0; background: none; color: var(--muted); font-size: 12px; border: 0; position: relative; }
.tab.on { background: none; color: var(--ink); font-weight: 700; }
.tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }
.tab:hover { color: var(--ink); }
/* на компьютере строки вкладок без жеста-свайпа — тонкая полоса прокрутки и колесо мыши (app.js) */
@media (hover: hover) and (pointer: fine) {
  .tabs { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .tabs::-webkit-scrollbar { display: block; height: 6px; }
  .tabs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
  .tabs:hover { scrollbar-color: var(--muted) transparent; }
  .tabs:hover::-webkit-scrollbar-thumb { background: var(--muted); }
}

/* Кнопки и сегменты */
.btn { border-radius: 0; border-color: var(--strong); background: none; font-size: 13px; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.seg { border-radius: 0; background: none; padding: 0; gap: 14px; }
.seg a { padding: 6px 0; border-radius: 0; font-size: 13px; }
.seg a.on { background: none; box-shadow: none; color: var(--ink); font-weight: 700; border-bottom: 2px solid var(--ink); }
.fchip, .chip, .opt, .pill { border-radius: 0; }
.chip { font-size: 11px; padding: 2px 7px; background: none; border: 1px solid var(--line); color: var(--muted); }
.chip:hover { color: var(--ink); border-color: var(--strong); filter: none; }
.chip.book { background: none; color: var(--ink); border-color: var(--strong); }

/* Статья вместо карточки */
.cards { gap: 0; }
.card { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 20px 0 14px; box-shadow: none; }
.card:first-child { padding-top: 22px; }
.card .meta { font-size: 11px; gap: 6px; }
.card .meta .src { color: var(--ink); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.card h3 { font: 700 23px/1.16 var(--serif); letter-spacing: -.35px; margin: 6px 0 8px; }
.card h3 a { color: var(--ink); }
.card h1.story-h { font-size: 38px; line-height: 1.08; letter-spacing: -1.1px; margin: 8px 0 12px; }
.card .sum { font-size: 16px; line-height: 1.45; color: var(--deck); }
.card .orig { font-family: var(--serif); }
.card .thumbs img { border-radius: 0; }
.card .thumbs.one img { width: 100%; max-height: 460px; background: var(--surface-2); }
.imp { border-radius: 0; width: 7px; height: 7px; background: var(--ink); }
.actions { margin-top: 6px; }
.act { font-size: 12px; min-height: 34px; padding: 0 6px; border-radius: 0; }
.act:hover { background: none; color: var(--ink); }
.act.on { color: var(--ink); font-weight: 700; }
.act svg { width: 16px; height: 16px; }
@media (min-width: 761px) { .cards > .card:first-child h3 { font-size: 40px; line-height: 1.07; letter-spacing: -1.2px; } .cards > .card:first-child .sum { font-size: 19px; } }

/* Главная: рубрики как полосы газеты */
.home-h { font: 700 29px/1.1 var(--serif); letter-spacing: -.6px; margin: 26px 0 4px; }
.lead-in { font: 13px var(--font); }
.rubric { border-top: 2px solid var(--ink); padding-top: 18px; margin: 30px 0 6px; }
.rubric h2 { font: 700 27px/1.1 var(--serif); letter-spacing: -.5px; margin: 0 0 14px; }
.rubric h2 .n { font: 11px var(--font); }
.rubric h2 .n a { color: var(--muted); }
.rubric.rubric-top { border-top: 0; padding-top: 0; margin-top: 22px; }
.tb-h a { font-weight: 400; margin-left: 6px; }
.mini { background: none; border: 0; border-radius: 0; display: grid; grid-template-columns: 1fr; }
.mini a.row { padding: 14px 0; border-top: 1px solid var(--line); gap: 14px; }
.mini a.row:first-child { border-top: 0; padding-top: 0; }
.mini a.row:hover { background: none; }
.mini a.row:hover .t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.mini .t { font: 700 19px/1.2 var(--serif); letter-spacing: -.2px; }
.mini .s { font: 400 11px/1.6 var(--font); color: var(--muted); letter-spacing: 0; }
.mini img { width: 84px; height: 64px; border-radius: 0; order: 2; }
@media (min-width: 761px) {
  .mini { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 32px; }
  .mini a.row:first-child { grid-row: span 4; border-right: 1px solid var(--line); padding-right: 32px; flex-direction: column; }
  .mini a.row:first-child .t { font-size: 30px; line-height: 1.1; letter-spacing: -.7px; }
  .mini a.row:first-child img { order: 2; width: 100%; height: auto; max-height: 300px; object-fit: cover; }
  .mini a.row:nth-child(2) { border-top: 0; padding-top: 0; }
}
.digest { background: none; border: 0; border-radius: 0; padding: 0; font-size: 16px; color: var(--deck); }

/* Прочее */
h1.page { font: 700 34px/1.1 var(--serif); letter-spacing: -.8px; margin: 26px 0 10px; }
.book-head img, .memes a, .tile, .notice, .sheet, input[type=text], input[type=password], input[type=url], input[type=search], textarea, select { border-radius: 0; }
.tile { border-width: 1px 0 0; padding: 12px 0; }
.notice { border-left: 3px solid var(--accent); }
.sheet { border-top: 2px solid var(--ink); }
.fab { border-radius: 0; width: 50px; height: 50px; bottom: calc(18px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.newpill { border-radius: 0; top: 58px; background: var(--ink); color: var(--bg); font-family: var(--font); }
.foot { border-top: 2px solid var(--ink); font-size: 12px; margin-top: 36px; padding-bottom: 80px; }
.foot .foot-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.foot .foot-row a { text-decoration: none; }

@media (min-width: 1000px) { .wrap.wide { max-width: 1000px; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; } .side .sheet { border: 0; border-left: 1px solid var(--line); border-top: 0; } }
.theme-btn .i-light, .theme-btn .i-dark { display: none; }
:root[data-theme="light"] .theme-btn .i-light, :root[data-theme="dark"] .theme-btn .i-dark { display: inline-flex; }
:root:not([data-theme]) .theme-btn .i-light { display: inline-flex; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .theme-btn .i-light { display: none; } :root:not([data-theme]) .theme-btn .i-dark { display: inline-flex; } }
.mast-date::first-letter { text-transform: uppercase; }
.sheet h3 { font-family: var(--font); font-size: 11px; letter-spacing: .08em; }

/* ---------- Админка ---------- */
.adm-nav { display: flex; gap: 2px 16px; overflow-x: auto; scrollbar-width: none; font: 13px var(--font); padding-top: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.adm-nav a { color: var(--muted); text-decoration: none; white-space: nowrap; padding: 4px 0; }
.adm-nav a.on { color: var(--text); font-weight: 700; box-shadow: inset 0 -2px 0 var(--ink); }
.adm { max-width: 1000px; }
.adm code, .adm-code, .adm-log { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.adm code { font-size: .9em; }
.adm-toc { margin: 4px 0 6px; }
.adm-field { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-family: var(--font); }
.adm-field > label { font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.adm-field input[type=text], .adm-field input[type=password] { width: 100%; max-width: 560px; }
.adm-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.adm-row input[type=password] { flex: 1 1 260px; }
.adm-check { display: inline-flex; gap: 6px; align-items: center; font: 14px var(--font); }
.adm-save { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 8px; z-index: 2; }
.adm-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; font-family: var(--font); }
.adm-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); flex: 1 1 200px; max-width: 360px; }
.adm-form label.adm-check { flex: 0 0 auto; flex-direction: row; color: var(--text); }
.adm-form textarea { min-height: 70px; }
.adm-cmd h2 code { font-weight: 400; color: var(--muted); }
.adm-log { background: var(--surface-2); padding: 12px; font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; max-height: 75vh; overflow: auto; }
.adm-log.qr { line-height: 1; white-space: pre; word-break: normal; font-size: 11px; }
.adm-code { width: 100%; min-height: 70vh; font-size: 13px; line-height: 1.45; tab-size: 2; white-space: pre; overflow: auto; }
.adm-notices { border-left: 3px solid var(--accent); padding: 8px 12px; margin: 10px 0; font: 14px var(--font); background: var(--surface-2); }
.adm-notices summary { cursor: pointer; font-weight: 700; }
.adm-notices ul { margin: 8px 0; padding-left: 18px; }
.adm-notices li { margin: 4px 0; }
.adm-notices li.warn { color: var(--danger); }
.adm-files .pill { margin-left: 4px; }
.adm-files .t { font: 15px/1.4 var(--font); }

/* Лог в админке */
.log-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.log-filter input { flex: 1 1 200px; min-width: 0; }
.log-list { display: flex; flex-direction: column; gap: 6px; }
.log-row { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.log-row summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; }
.log-row summary::-webkit-details-marker { display: none; }
.log-comp { font-weight: 600; font-size: 13px; }
.log-msg { flex-basis: 100%; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row[open] .log-msg { display: none; }
.log-full { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-family: ui-monospace, monospace; font-size: 12px; }

/* ---------- Лента строками (как на HN): только заголовки, клик — на оригинал ---------- */
.wrap.wide { display: block; max-width: 1180px; }
.rows { display: flex; flex-direction: column; padding-bottom: 16px; }
.row-item { display: flex; gap: 6px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row-item:first-child { padding-top: 12px; }
.vote-dot { flex: none; width: 28px; height: 28px; margin-top: 1px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--strong); cursor: pointer; padding: 0; }
.vote-dot:hover, .vote-dot.on { color: var(--ink); }
.ri { min-width: 0; flex: 1; }
.ri-t { font: 650 17px/1.3 var(--serif); color: var(--ink); overflow-wrap: anywhere; }
.ri-t .imp { margin-right: 6px; vertical-align: middle; }
.ri-t:visited { color: var(--muted); }
.ri-dom { font: 12px var(--font); color: var(--muted); white-space: nowrap; }
.ri-m { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font: 12px/1.6 var(--font); color: var(--muted); margin-top: 3px; }
.ri-m a { color: var(--muted); }
.ri-m a:hover { color: var(--ink); }
.ri-star, .ri-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; font: 12px var(--font); display: inline-flex; min-height: 24px; align-items: center; }
.ri-star:hover, .ri-x:hover { color: var(--ink); }
.js-star.on { color: #d29b00; }
.js-star.on svg { fill: currentColor; }
.run { border-bottom: 1px solid var(--line); }
.run > summary { cursor: pointer; list-style: none; padding: 8px 0 8px 34px; font: 12px var(--font); color: var(--muted); }
.run > summary::-webkit-details-marker { display: none; }
.run > summary::before { content: "▸ "; }
.run[open] > summary::before { content: "▾ "; }
.run > .row-item { padding-left: 14px; }
.run > .row-item:last-child { border-bottom: 0; }

/* ---------- Главная: сетка плиток ---------- */
.tiles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; padding: 8px 0 16px; grid-auto-flow: dense; }
.tile { display: flex; flex-direction: column; gap: 6px; border: 0; border-top: 1px solid var(--line); padding: 10px 0 0; min-width: 0; }
.tile.big { grid-column: span 2; border-top: 2px solid var(--ink); }
.tile-img { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface-2); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.big .tile-img { aspect-ratio: 16 / 9; }
.tile-rub { font: 700 10px/1.4 var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.tile-t { font: 700 15px/1.25 var(--serif); color: var(--ink); overflow-wrap: anywhere; }
.tile.big .tile-t { font-size: 22px; line-height: 1.15; letter-spacing: -.3px; }
.tile.noimg:not(.big) .tile-t { font-size: 16px; }
.tile-s { margin: 0; font-size: 15px; line-height: 1.4; color: var(--deck); }
.tile .ri-m { gap: 2px 8px; font-size: 11px; }
@media (min-width: 761px) {
  .tiles-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 24px; }
  .tile-t { font-size: 18px; }
  .tile.big .tile-t { font-size: 30px; line-height: 1.08; letter-spacing: -.7px; }
}
@media (min-width: 1100px) { .tiles-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Шторка фильтров: снизу на телефоне, справа на десктопе ---------- */
.side { display: none !important; }
.filter-btn { display: inline-flex !important; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; font: 700 16px var(--font); }
.optw { display: inline-flex; align-items: stretch; }
.optw .opt { padding-right: 8px; }
.opt-x { display: inline-flex; align-items: center; padding: 0 9px; background: var(--surface-2); color: var(--muted); font-size: 15px; }
.opt-x:hover { color: var(--ink); text-decoration: none; }
.opt.ex + .opt-x { background: var(--ink); color: var(--bg); }
.opt.preset { background: none; border: 1px solid var(--line); }
.opt.preset.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.switch { display: flex; align-items: center; gap: 10px; margin: 16px 0 2px; font: 14px var(--font); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { flex: none; width: 40px; height: 22px; border-radius: 11px; background: var(--strong); position: relative; transition: background .15s; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .sw { background: var(--ink); }
.switch input:checked + .sw::after { transform: translateX(18px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 761px) {
  .sheet { left: auto; top: 0; width: 440px; max-height: none; border-radius: 0; border-top: 0; border-left: 2px solid var(--ink); }
  .sheet .grab { display: none; }
}

/* ---------- Страница истории ---------- */
.story .card { border-bottom: 0; }
.story-meta { font-size: 12px; }
.story-meta a:first-child { color: var(--ink); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.story-h { font: 700 32px/1.1 var(--serif); letter-spacing: -.8px; margin: 8px 0 12px; overflow-wrap: anywhere; }
.story-sum { font-size: 18px; line-height: 1.5; color: var(--deck); margin: 10px 0; }
.story-text { white-space: pre-line; overflow-wrap: anywhere; font-size: 17px; line-height: 1.55; margin: 10px 0; }
.story-full > summary { cursor: pointer; font: 13px var(--font); color: var(--muted); }
.story-imgs { display: grid; gap: 8px; margin: 14px 0; }
.story-imgs a { display: block; cursor: zoom-in; background: var(--surface-2); }
.story-imgs img { width: 100%; height: auto; max-height: 80vh; object-fit: contain; display: block; }
.h2s { font: 700 20px/1.2 var(--serif); margin: 22px 0 8px; }
.bookgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 16px 12px; }
.bk { display: flex; flex-direction: column; gap: 3px; color: var(--ink); min-width: 0; }
.bk:hover { text-decoration: none; }
.bk:hover .bk-t { text-decoration: underline; }
.bk img, .bk .nb { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: var(--surface-2); display: block; }
.bk-t { font: 700 13px/1.25 var(--serif); overflow-wrap: anywhere; }
.bk-a { font: 12px var(--font); color: var(--deck); }
.bk-m { font: 11px var(--font); color: var(--muted); overflow-wrap: anywhere; }
@media (min-width: 761px) { .story-h { font-size: 40px; } .bookgrid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); } }
.me-links { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-btn.on { color: var(--accent); }

/* Админка: таблица источников не шире экрана */
.tbl { table-layout: auto; }
.tbl td { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .tbl.cardify tr { max-width: 100%; }
  .tbl.cardify td { min-width: 0; }
  .tbl.cardify td::before { flex: none; }
  .tbl.cardify td > * { min-width: 0; }
}
.tile-rub { display: block; }
@media (max-width: 560px) { .logo .full { display: none; } .logo .short { display: inline; } .top-actions .icon-btn, .top-actions .theme-btn { padding: 0 4px; min-width: 36px; } }
.tiles-grid { align-items: start; }
@media (min-width: 761px) { .tile.big { grid-row: span 2; } }

/* ---------- v11: шапка, вид ленты, полосы, книги в карточках, карусель ---------- */
.icon-btn { position: relative; }
.icon-btn .dot { position: absolute; top: 9px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.lang { display: inline-block; white-space: nowrap; flex: none; font: 700 9.5px/1 var(--font); letter-spacing: .04em; padding: 2px 3px; border: 1px solid var(--line); color: var(--muted); vertical-align: 2px; }
.viewsw { display: inline-flex; border: 1px solid var(--line); }
.viewsw a { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 32px; color: var(--muted); }
.viewsw a.on { color: var(--ink); background: var(--surface-2); }
.viewsw a:hover { text-decoration: none; color: var(--ink); }

/* книги в карточках */
.bl { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 5px 0 1px; font: 12.5px/1.35 var(--font); }
.bl-b { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); min-width: 0; max-width: 100%; }
.bl-b:hover { text-decoration: none; color: var(--accent); }
.bl-b img { width: 22px; height: 32px; object-fit: cover; flex: none; background: var(--surface-2); }
.bl-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.bl-a { color: var(--muted); }
.bl-more { color: var(--muted); font-size: 12px; align-self: center; }
.tile .bl { flex-direction: column; gap: 4px; }
.tile .bl-t { max-width: 100%; }

/* плитки: текстовая (без картинки), мем, видео */
.tile.k-text { border-top: 3px solid var(--ink); padding-top: 12px; }
.tile.k-text .tile-t { font-size: 21px; line-height: 1.15; letter-spacing: -.3px; }
.tile.k-text .tile-s { font-size: 14px; color: var(--deck); }
.tile.k-meme .tile-img { aspect-ratio: auto; max-height: 520px; cursor: zoom-in; }
.tile.k-meme .tile-img img { height: auto; max-height: 520px; object-fit: contain; }
.tile-cap { font: 14px/1.35 var(--font); color: var(--ink); }
.tile-img { position: relative; }
.play { position: absolute; left: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; }

/* полоса заголовков без картинок — на всю ширину сетки */
.strip { grid-column: 1 / -1; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr; }
.strip-i { padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.strip-i:first-child { border-top: 0; }
.strip-t { font: 650 19px/1.25 var(--serif); color: var(--ink); overflow-wrap: anywhere; }
.strip-t:hover { text-decoration: underline; }
.strip-i .ri-m { font-size: 11px; gap: 2px 8px; }
@media (min-width: 761px) {
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .strip-i:nth-child(2) { border-top: 0; }
  .strip-t { font-size: 21px; }
  .tile.k-text .tile-t { font-size: 25px; }
}
@media (min-width: 1100px) { .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } .strip-i:nth-child(3) { border-top: 0; } }

/* «Сейчас обсуждают» на главной */
.pulse-mini { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font: 13px var(--font); }
.pm-h { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--ink); text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }
.pm-i { color: var(--ink); }
.pm-i .up { color: var(--accent); font-size: 11px; }

/* карусель картинок истории */
.gallery { position: relative; margin: 14px 0; background: var(--surface-2); }
.g-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.g-track::-webkit-scrollbar { display: none; }
.g-track a { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; cursor: zoom-in; }
.g-track img { max-width: 100%; max-height: 70vh; height: auto; display: block; object-fit: contain; }
.g-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.g-nav.prev { left: 8px; } .g-nav.next { right: 8px; }
.g-count { position: absolute; right: 10px; bottom: 8px; padding: 2px 7px; background: rgba(0,0,0,.55); color: #fff; font: 12px var(--font); }
@media (hover: none) { .g-nav { display: none; } }

/* админка: действия в строке источника */
.src-acts { white-space: nowrap; }
.src-acts .btn { margin: 2px 0; }
tr.flash td { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--accent-soft, #fde9c8); } to { background: transparent; } }
.digest-mini { font: 14px/1.4 var(--font); }
.digest-mini ul { margin: 4px 0 6px; padding-left: 18px; }
.digest-mini li { margin: 3px 0; }
.digest-mini li a { color: var(--ink); }
.digest-mini .more { font-size: 13px; }

.bl { align-items: center; }

/* v15: нижняя строка плитки — одна строка; избранное и обсуждение справа, зона нажатия больше видимой иконки */
.tile-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tm { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; font: 11px/1.4 var(--font); color: var(--muted); margin-top: 2px; }
.tm a { color: var(--muted); }
.tm a:hover { color: var(--ink); text-decoration: none; }
.tm-src { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.tm-n, .tm-t { flex: none; }
.tm-act { margin-left: auto; display: flex; align-items: center; flex: none; }
.tm-act > button, .tm-act > a { display: inline-flex; align-items: center; gap: 3px; border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit;
  padding: 10px 7px; margin: -10px 0; } /* 44px по высоте для пальца, визуально строка не растёт */
.tm-act > a:last-child { padding-right: 0; }
.tm-act > button:hover, .tm-act > a:hover { color: var(--ink); }
.tm-act .js-star.on { color: #d4a017; }
.tm-act .js-star.on svg { fill: currentColor; }
.tm-act > .js-share, .tm-act > .js-star { opacity: .5; } /* вторичные кнопки поста — вдвое тусклее */
.tm-act > .js-share:hover, .tm-act > .js-star:hover, .tm-act > .js-star.on, .tm-act > .js-share.done { opacity: 1; }

/* книги в плитке — во всю ширину плитки */
.tile .bl, .strip .bl { width: 100%; flex-direction: column; align-items: stretch; gap: 4px; }
.tile .bl-r, .strip .bl-r { width: 100%; }
.tile .bl-b, .strip .bl-b { flex: 1; min-width: 0; }
.tile .bl-t, .strip .bl-t { flex: 1; min-width: 0; max-width: none; }

/* телефон: больше записей во всю ширину, пары в две колонки — изредка; текст поста — только во всю ширину */
@media (max-width: 760px) {
  .tile.k-text { grid-column: 1 / -1; }
  .tile.l-wide { grid-column: 1 / -1; }
  .tile.l-wide .tile-main { flex-direction: row; gap: 12px; align-items: flex-start; }
  .tile.l-wide .tile-img { flex: 0 0 40%; aspect-ratio: 4 / 3; }
  .tile.l-wide .tile-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .tile.l-wide .tile-t { font-size: 17px; line-height: 1.22; }
  .tile.l-half .tile-s { display: none; }
}
.bar .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.bar .seg::-webkit-scrollbar { display: none; }
.bar .seg a { flex: none; white-space: nowrap; }
.bar .seg { min-width: 0; flex: 0 1 auto; }
@media (max-width: 760px) { .bar .seg { flex-basis: 100%; } }

/* журнал API в админке */
.apiform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.apiform select, .apiform input[type=search] { min-width: 0; flex: 1 1 200px; }
.apirow { border-top: 1px solid var(--line); padding: 6px 0; }
.apirow summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; list-style: none; }
.apirow summary::-webkit-details-marker { display: none; }
.apim { font: 700 11px var(--font); }
.apiu { font: 12px/1.4 ui-monospace, monospace; overflow-wrap: anywhere; flex: 1 1 260px; min-width: 0; }
pre.apibody { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; background: var(--surface-2); padding: 8px; font-size: 12px; }

/* v18: строка управления лентой — порядок и вид списками, фильтры иконкой, всё в одну строку */
.bar { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.ctl { display: flex; gap: 8px; align-items: center; min-width: 0; flex: 1; }
.ctl select { min-width: 0; max-width: 60%; padding: 6px 28px 6px 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 14px var(--font); border-radius: 0; }
.filter-ico { position: relative; flex: none; margin-left: auto; border: 1px solid var(--line); width: 40px; height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.filter-ico .cnt { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font: 700 10px/17px var(--font); text-align: center; }
.active-chips { margin: 8px 0 0; }
.src-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.src-head .page { margin-right: auto; }
.src-acts { display: inline-flex; gap: 6px; }
.me-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.me-head .page { margin-right: auto; }
.me-acts { display: flex; gap: 6px; align-items: center; }
.me-acts form { margin: 0; }

/* панель фильтров: группы сворачиваются, «Слежу» и «Скрываю» */
.sheet-note { margin: 0 0 8px; }
.sheet .fg { border-top: 1px solid var(--line); padding: 8px 0; }
.sheet .fg > summary { cursor: pointer; font: 700 13px var(--font); list-style: none; display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.sheet .fg > summary::-webkit-details-marker { display: none; }
.sheet .fg > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.sheet .fg:not([open]) > summary::after { content: "▸"; }
.fg-n { min-width: 18px; height: 18px; border-radius: 9px; background: var(--ink); color: var(--bg); font: 700 10px/18px var(--font); text-align: center; padding: 0 5px; }
.sheet .presets { margin-bottom: 6px; }
.sub { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; border: 1px solid var(--line); font: 13px var(--font); }
.sub.ex { text-decoration: line-through; text-decoration-color: var(--muted); }
.sub button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 6px; }
.sub button:hover { color: var(--ink); }
.subs-add { display: flex; gap: 6px; margin-top: 8px; }
.subs-add input { flex: 1; min-width: 0; }

/* первые записи главной — «обложка» и две крупные */
.tile.l-hero { grid-column: 1 / -1; grid-row: auto !important; border-top: 3px solid var(--ink); padding-top: 12px; }
.tile.l-hero .tile-t { font-size: 28px; line-height: 1.08; letter-spacing: -.5px; }
.tile.l-hero .tile-img { aspect-ratio: 4 / 3; }
.tile.l-hero .tile-s { font-size: 16px; }
.tile.l-lead { grid-column: 1 / -1; grid-row: auto !important; }
.tile.l-lead .tile-t { font-size: 22px; line-height: 1.15; }
@media (min-width: 761px) {
  .tile.l-hero .tile-main { flex-direction: row; gap: 28px; align-items: flex-start; }
  .tile.l-hero .tile-img { flex: 0 0 58%; aspect-ratio: 16 / 10; }
  .tile.l-hero .tile-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
  .tile.l-hero .tile-t { font-size: 40px; letter-spacing: -.9px; }
  .tile.l-hero .tile-s { font-size: 18px; line-height: 1.45; }
  .tile.l-lead { grid-column: span 2; }
  .tile.l-lead .tile-t { font-size: 26px; }
}
@media (max-width: 760px) { .tile.l-lead .tile-img { aspect-ratio: 16 / 9; } }


/* v19: заголовок определяет высоту своей строки сам (у обёртки нет своего шрифта) — интерлиньяж одинаковый
   у плиток одной ширины, какой бы ни была длина и вид записи */
.ttl { font-size: 0; line-height: 0; }
.ttl .lang { margin-left: 6px; vertical-align: 3px; }
.ttl .ri-dom { margin-left: 6px; }
.lang { align-self: flex-start; }

/* больше воздуха в ленте */
.tiles-grid { gap: 30px 14px; padding-top: 12px; }
.tile { gap: 8px; padding-top: 14px; }
.tile-b { display: flex; flex-direction: column; gap: 6px; }
.row-item { padding: 14px 0; }
.ri .bl, .ri .tm { margin-top: 6px; }
@media (min-width: 761px) { .tiles-grid { gap: 40px 26px; } }

/* книга без обложки — заглушка того же формата */
.bl-nc { width: 22px; height: 32px; flex: none; background: var(--surface-2); border: 1px solid var(--line);
  background-image: linear-gradient(90deg, transparent 3px, var(--line) 3px, var(--line) 4px, transparent 4px); }

/* подборка: стопка от одного источника — карусель из 3–5 карточек */
.bundle { grid-column: 1 / -1; border-top: 2px solid var(--ink); padding-top: 10px; min-width: 0; }
.bundle-h { display: flex; align-items: center; gap: 8px; font: 13px var(--font); margin-bottom: 10px; }
.bundle-h a, .bundle-h > span:last-child { color: var(--ink); font-weight: 650; }
.bundle-h .tile-rub { margin: 0; }
.bundle-track { display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: 14px; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
.bundle-track::-webkit-scrollbar { display: none; }
.bundle-i.card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 0; border: 0; margin: 0; background: none; box-shadow: none; }
.bundle-img { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.bundle-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bundle-img.ph { background: var(--surface-2) linear-gradient(135deg, transparent 48%, var(--line) 48%, var(--line) 52%, transparent 52%); }
.bundle-row { display: flex; align-items: flex-start; gap: 6px; }
.bundle-row .ttl { flex: 1; min-width: 0; }
.bundle-row .tile-t { font-size: 15px; line-height: 1.25; }
.bundle-row .tm-act { margin-left: 0; margin-top: -2px; }
@media (min-width: 761px) {
  .bundle-track { grid-auto-columns: minmax(0, 1fr); overflow-x: visible; }
  .bundle-track.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bundle-track.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bundle-track.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .bundle-row .tile-t { font-size: 16px; }
}

/* переключатель вида — иконками */
.viewsw { flex: none; }
.viewsw a { width: 38px; height: 36px; }

/* книги на странице записи — карточками с обложкой */
.bookcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 8px 0 14px; }
.bookcard { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); color: var(--ink); min-width: 0; }
.bookcard:hover { text-decoration: none; border-color: var(--strong); }
.bookcard img, .bookcard .nb { width: 72px; height: 104px; object-fit: cover; flex: none; background: var(--surface-2); }
.bookcard .nb { border: 1px solid var(--line); }
.bc-b { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bc-t { font: 700 17px/1.2 var(--serif); }
.bc-a { font: 14px var(--font); color: var(--deck); }
.bc-m { font: 12px var(--font); color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.bc-go { margin-top: auto; font: 12px var(--font); color: var(--accent); }
.tile.k-text.noimg .tile-t { font-size: 21px; line-height: 1.15; }
@media (min-width: 761px) { .tile.k-text.noimg .tile-t { font-size: 25px; } }
.bundle-more { display: inline-block; margin-top: 10px; font: 13px var(--font); }
/* подборка без единой картинки — одними заголовками, без пустых заглушек */
.bundle-track.noimgs { grid-auto-columns: 80%; }
.bundle-track.noimgs .bundle-i.card { border-left: 2px solid var(--line); padding-left: 10px; }
.bundle-track.noimgs .bundle-row .tile-t { font-size: 17px; }
.bl-more { align-self: flex-start; }

/* v23: десктоп как у газетной полосы (ср. hackertimes.ca): ширина ~1040, не больше трёх колонок,
   «обложка» на две колонки с линейкой, две крупные — стопкой справа; заголовки крупнее */
.wrap.wide { max-width: 1040px; }
@media (min-width: 761px) {
  .tiles-grid, .tiles-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 32px; }
  .tile-t { font-size: 22px; line-height: 1.15; letter-spacing: -.2px; }
  .tile.big .tile-t { font-size: 29px; line-height: 1.12; letter-spacing: -.5px; }
  .tile-s { font-size: 15px; line-height: 1.45; }
  .tile.l-hero { grid-column: 1 / span 2; grid-row: span 2 !important; padding-right: 32px; border-right: 1px solid var(--line); }
  .tile.l-hero .tile-main { flex-direction: column; gap: 12px; }
  .tile.l-hero .tile-img { flex: none; aspect-ratio: 16 / 9; }
  .tile.l-hero .tile-t { font-size: 46px; line-height: 1.06; letter-spacing: -1.3px; }
  .tile.l-hero .tile-s { font-size: 19px; line-height: 1.42; }
  .tile.l-lead { grid-column: 3; grid-row: auto !important; }
  .tile.l-lead .tile-t { font-size: 25px; line-height: 1.13; }
  .tile.l-lead .tile-s { display: none; }
  .bundle-row .tile-t { font-size: 17px; }
}
@media (min-width: 1100px) { .tiles-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 761px) { .tile.l-hero .tile-img { width: 100%; } }
.ctl select { width: auto; max-width: 100%; flex: 0 1 auto; }
.tile-img, .bundle-img { min-height: 0; } /* иначе высокая картинка растягивает блок с заданными пропорциями */
.tile-img img { min-height: 0; }
@media (min-width: 761px) { .tile.l-hero .tile-img { aspect-ratio: 16 / 9; height: auto; } }

/* v26: десктоп шире (как полоса hackertimes.ca — до 1280 с полями 38px), шапка той же ширины */
@media (min-width: 1100px) {
  .wrap.wide, .wrap.masthead, .wrap.sec-bar { max-width: 1280px; padding: 0 38px; }
}

/* типографика по ширине плитки: крупная (две колонки) — газетный заголовок с врезкой, малая — сдержаннее */
@media (min-width: 761px) {
  .tile-t { font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -.1px; }
  .tile.k-text .tile-t, .tile.k-text.noimg .tile-t { font-size: 24px; line-height: 1.14; letter-spacing: -.3px; }
  .tile.big .tile-t { font-size: 34px; line-height: 1.08; letter-spacing: -.8px; }
  .tile.big .tile-s { font-size: 17px; line-height: 1.45; }
  .tile.big .tile-rub { font-size: 11px; }
  .tile.l-hero .tile-t { font-size: 46px; line-height: 1.06; letter-spacing: -1.3px; }
  .tile.l-hero .tile-s { font-size: 19px; line-height: 1.42; }
  .tile.l-lead .tile-t { font-size: 24px; line-height: 1.14; letter-spacing: -.3px; }
  .tile.long .tile-t { font-size: 18px; line-height: 1.25; letter-spacing: 0; }
  .tile.big.long .tile-t { font-size: 26px; line-height: 1.15; letter-spacing: -.4px; }
  .tile.l-hero.long .tile-t { font-size: 34px; }
  .tile.k-text.long .tile-t { font-size: 20px; }
  .strip-t { font-size: 19px; line-height: 1.22; }
}
.tile.long .tile-t { font-size: 15px; }
.tile.k-text.long .tile-t { font-size: 18px; }
@media (max-width: 760px) { .tile.big.long .tile-t { font-size: 19px; line-height: 1.2; letter-spacing: -.2px; } }

/* крупная плитка и колонка рядом: маленькая с картинкой и одна-две строки без картинки — под крупной нет дыры */
.duo, .duo-side { display: contents; }
.duo .tile.big { grid-row: auto; }
.side-i { grid-column: 1 / -1; }
@media (min-width: 761px) {
  .duo { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: start; }
  .duo > .tile.big { grid-column: 1 / span 2; padding-right: 32px; border-right: 1px solid var(--line); }
  .duo-side { display: flex; flex-direction: column; gap: 18px; grid-column: 3; min-width: 0; }
  .duo.solo > .tile.big { grid-column: 1 / -1; padding-right: 0; border-right: 0; }
  .duo.solo > .tile.big .tile-main { flex-direction: row; gap: 28px; }
  .duo.solo > .tile.big .tile-img { flex: 0 0 62%; }
  .duo.solo > .tile.big .tile-b { flex: 1; min-width: 0; }
  .duo:nth-of-type(even) > .tile.big { grid-column: 2 / span 2; order: 2; padding-right: 0; border-right: 0; padding-left: 32px; border-left: 1px solid var(--line); }
  .duo:nth-of-type(even) > .duo-side { grid-column: 1; order: 1; grid-row: 1; }
  .duo-side .tile { padding-top: 0; border-top: 0; }
  .side-i { padding: 12px 0 0; border-top: 1px solid var(--line); }
  .side-i .strip-t { font-size: 18px; line-height: 1.22; }
}
@media (max-width: 760px) {
  .side-i { border-top: 1px solid var(--line); padding-top: 12px; }
  .side-i .strip-t { font-size: 18px; }
}

/* квадратная или вертикальная картинка в крупной плитке — кадр целиком сбоку, без обрезки */
.tile.sq .tile-img { aspect-ratio: auto !important; }
.tile.sq .tile-img img { height: auto; max-height: 420px; object-fit: contain; }
@media (min-width: 761px) {
  .tile.big.sq .tile-main, .tile.l-hero.sq .tile-main { flex-direction: row; gap: 24px; align-items: flex-start; }
  .tile.big.sq .tile-img, .tile.l-hero.sq .tile-img { flex: 0 0 38%; width: auto; }
  .tile.big.sq .tile-b, .tile.l-hero.sq .tile-b { flex: 1; min-width: 0; }
  .tile.l-lead.sq .tile-main { flex-direction: column; }
  .tile.l-lead.sq .tile-img { flex: none; width: 100%; background: var(--surface-2); }
  .tile.l-lead.sq .tile-img img { max-height: 240px; }
}
@media (max-width: 760px) {
  .tile.sq .tile-main { flex-direction: row; gap: 12px; align-items: flex-start; }
  .tile.sq .tile-img { flex: 0 0 40%; }
  .tile.sq .tile-b { flex: 1; min-width: 0; }
  .tile.sq .tile-t { font-size: 18px !important; line-height: 1.2; }
  .tile.sq .tile-s { display: none; }
}
@media (max-width: 760px) { .duo-side .tile .tile-s { display: none; } }

/* «Поделиться»: на компьютере ссылка копируется, плашка снизу подтверждает */
.tm-act .js-share.done { color: var(--accent); }
#toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 90;
  padding: 10px 16px; background: var(--ink); color: var(--bg); font: 14px var(--font); max-width: calc(100vw - 32px);
  overflow-wrap: anywhere; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 761px) { #toast { bottom: 28px; } }

/* книги в карточке: бейдж языка по центру строки, «ещё N книг» — нормальная ссылка с зоной нажатия */
.bl-b .lang, .bl .lang { align-self: center; vertical-align: 0; }
.bl-more { display: inline-flex; align-items: center; min-height: 32px; padding: 0 2px; font: 13px var(--font); color: var(--accent); align-self: flex-start; }
.bl-more:hover { text-decoration: underline; }

/* профиль: пояснение к карме */
.me-karma { margin: 0 0 1em; }
.karma-help { display: inline-block; position: relative; margin-left: 4px; vertical-align: 1px; }
.karma-help > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  border: 1px solid var(--muted); border-radius: 50%; font: 700 11px/1 var(--font); color: var(--muted); }
.karma-help > summary::-webkit-details-marker { display: none; }
.karma-help[open] > summary { color: var(--ink); border-color: var(--ink); }
.kh-pop { position: absolute; left: -8px; top: 26px; z-index: 30; width: min(360px, calc(100vw - 32px)); padding: 12px 14px; background: var(--bg);
  border: 1px solid var(--strong, var(--line)); box-shadow: 0 6px 24px rgba(0,0,0,.12); font: 13px/1.45 var(--font); color: var(--ink); }
.kh-pop p { margin: 0 0 6px; }
.kh-pop ul { margin: 0; padding-left: 18px; }
.kh-pop li { margin: 3px 0; }

/* v29: звезда книги — избранное = слежка за книгой */
.book-star { display: inline-flex; align-items: center; gap: 6px; }
.book-star.on { color: #d4a017; border-color: currentColor; }
.book-star.on svg { fill: currentColor; }

/* v30: логотип в h1 на главной — без отступов и размеров заголовка */
.mast-h { margin: 0; font: inherit; line-height: 1; }

/* v31: шапка — логотип слева, без даты и подзаголовка */
.masthead { grid-template-columns: 1fr auto; min-height: 80px; }
.mast-h { justify-self: start; }
.logo { text-align: left; }

/* кнопки книги — как у поста: поделиться, избранное (= слежка), обсуждение */
.bk-act { margin-left: auto; display: inline-flex; align-items: center; flex: none; }
.bk-act > button, .bk-act > a { display: inline-flex; align-items: center; justify-content: center; gap: 3px; border: 0; background: none;
  color: var(--muted); cursor: pointer; font: 12px var(--font); min-width: 32px; min-height: 32px; padding: 0 5px; }
.bk-act > a:last-child { padding-right: 0; }
.bk-act > button:hover, .bk-act > a:hover { color: var(--ink); text-decoration: none; }
.bk-act .js-bstar.on { color: #d4a017; }
.bk-act .js-bstar.on svg { fill: currentColor; }
.bk-act .js-share.done { color: var(--accent); }
.bl-r { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; }
.bl-r .bl-b { flex: 1; min-width: 0; }
.bl-r .bl-t { max-width: none; }

/* карточка книги в посте: обложка и название — ссылки, внизу три иконки */
.bookcard .bc-img { flex: none; line-height: 0; }
.bookcard .bc-t { color: var(--ink); }
.bookcard .bc-t:hover { color: var(--accent); text-decoration: none; }
.bc-foot { margin-top: auto; display: flex; align-items: center; }
.bc-foot .bk-act { margin-left: -5px; }

/* страница книги: иконки под автором, компактные издания и упоминания под спойлером */
.bh-acts { margin-top: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bh-acts .bk-act + .bk-act { margin-left: -10px; }
.bk-act .js-breport.done { color: var(--accent); cursor: default; }
.bh-acts .bk-act { margin-left: -5px; }
.bh-acts .bk-act > button, .bh-acts .bk-act > a { min-width: 40px; min-height: 40px; font-size: 14px; }
.bk-h { font: 700 16px var(--font); margin: 18px 0 6px; }
.bk-h .muted { font-weight: 400; }
.editions .ed { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 5px 0; font: 13px/1.35 var(--font); font-variant-numeric: tabular-nums; }
.editions .ed b { font-weight: 600; min-width: 140px; }
.ed-isbn { display: inline-flex; align-items: center; gap: 5px; min-width: 140px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: copy; text-align: left; }
.editions .ed .ed-isbn b { min-width: 0; }
.ed-isbn svg { color: var(--muted); flex: none; }
.ed-isbn:hover svg, .ed-isbn.done svg { color: var(--accent); }
.ed-m { color: var(--muted); }
.more-box > summary { cursor: pointer; font: 13px var(--font); color: var(--accent); padding: 6px 0; list-style: none; }
.more-box > summary::-webkit-details-marker { display: none; }
.more-box > summary::after { content: " ▾"; }
.more-box[open] > summary::after { content: " ▴"; }
.timeline .ev { margin: 6px 0; font-size: 14px; }
.timeline .more-box > summary { margin-left: 0; }

/* «Главное за сутки»: прошлые дни лентой */
.digest-older-h { margin-top: 28px; }
.digest-day { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; }
.dd-h { font: 700 20px var(--serif); margin: 4px 0 6px; }
.digest-day h3 { font: 700 15px var(--font); margin: 12px 0 4px; }
.bookcard .bc-img, .bookcard .bc-img .nb { display: block; }

/* Каталог /books: строки с обложкой 60×90 и звездой; на десктопе — 3 колонки */
.books-grid { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 28px; }
.bk-row { display: flex; align-items: flex-start; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.bk-link { display: flex; gap: 12px; flex: 1; min-width: 0; color: var(--text); }
.bk-link:hover { text-decoration: none; }
.bk-link:hover .t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.bk-link img, .bk-nc { width: 60px; height: 90px; object-fit: cover; flex: none; background: var(--surface-2); }
.bk-row .t { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 700 16px/1.25 var(--serif); }
.bk-row .s { font: 400 11px/1.55 var(--font); color: var(--muted); display: block; margin-top: 3px; }
.bk-tt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bk-row .bk-act { margin-left: 0; }
.bk-row .bk-act > button { min-width: 36px; min-height: 36px; }
.books-grid > .loader { grid-column: 1 / -1; }
@media (min-width: 600px) { .books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .books-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Только для экранных читалок */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Заголовки карточек — h2/h3 ради структуры страницы; вид задают .ttl и ссылки внутри */
:where(h2.ttl, h3.ttl, h2.cap-h) { margin: 0; font: inherit; }
a.tm-t, a.tm-t:hover { color: inherit; }
a.tm-t:hover { text-decoration: underline; }

/* Ссылка «К содержанию» — видна только при переходе с клавиатуры */
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 8px 14px; background: var(--ink); color: var(--bg); }
.skip:focus { top: 8px; }

/* Хлебные крошки: та же цепочка, что в BreadcrumbList */
.crumbs ol { list-style: none; margin: 14px auto 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font: 12px/1.5 var(--font); color: var(--muted); }
.crumbs li { min-width: 0; }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: var(--muted); }
.crumbs li:last-child span { display: inline-block; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
main:focus { outline: none; }
.story-sum .sum-l { display: block; font: 600 11px/1.6 var(--font); letter-spacing: .3px; text-transform: uppercase; color: var(--muted); }
.book-head img { height: auto; align-self: flex-start; }
.foot nav.foot-row { margin: 8px 0; }
.foot .foot-topics a { text-decoration: none; }
.bh-genres { margin-top: 4px; }
.bh-genres a { color: var(--muted); }
.related { margin-top: 28px; }

/* Цели нажатия не меньше 24px (Lighthouse/axe target-size), вид строк прежний: поля компенсируются отрицательными отступами */
.tile-rub { padding: 5px 0; margin-top: -5px; margin-bottom: -5px; }
.bundle-h .tile-rub { padding: 0; }
.tm-src, a.tm-t, a.tm-n { padding: 5px 0; margin: -5px 0; }
a.tm-t, a.tm-n { min-width: 24px; text-align: center; }
.tm-act > a:last-child { min-width: 24px; justify-content: flex-end; }

/* Сюжет на карточке: ссылка на все его истории */
.thr { display: inline-flex; align-items: center; min-height: 24px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11.5px/1.4 var(--font); color: var(--accent); margin-top: 3px; }
.thr:hover { text-decoration: underline; }

/* Профиль: «Ваши интересы» */
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 24px; margin: 8px 0 12px; }
.int-g h3 { margin: 10px 0 4px; font-weight: 400; }
.int-r { display: grid; grid-template-columns: minmax(0, 1fr) 80px 28px; gap: 8px; align-items: center; font-size: 14px; min-height: 26px; }
.int-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.int-b { height: 6px; background: var(--surface-2); }
.int-b i { display: block; height: 100%; background: var(--accent); }
.int-r.man .int-b i { background: var(--text); opacity: .55; }
.int-x { width: 28px; height: 28px; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 4px; }
.int-x:hover { color: var(--text); background: var(--surface-2); }
.int-more > summary { list-style: none; cursor: pointer; color: var(--accent); font: 14px var(--font); display: inline-block; padding: 4px 0; }
.int-more > summary::-webkit-details-marker { display: none; }
.int-more .int-hide, .int-more[open] .int-show { display: none; }
.int-more[open] .int-hide { display: inline; }
.int-neg { margin: 4px 0 12px; }
.int-neg h3 { margin: 10px 0 4px; font-weight: 400; }
.int-n { display: inline-flex; align-items: center; gap: 2px; margin: 0 10px 4px 0; font: 14px var(--font); color: var(--muted); }
.int-add { position: relative; margin: 8px 0 4px; max-width: 520px; }
.int-add input[type=search] { width: 100%; box-sizing: border-box; }
.int-sug { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; background: var(--bg); border: 1px solid var(--line); border-top: 0; max-height: 320px; box-shadow: var(--shadow); overflow: auto; }
.int-sug:empty { display: none; }
.int-s { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; color: var(--text); font: 14px var(--font); cursor: pointer; }
.int-s:hover, .int-s:focus { background: var(--surface-2); }
/* Просмотр картинок: закрыть, листать, счётчик картинок поста на плитке */
.lightbox .cap a { color: #fff; text-decoration: underline; }
.lb-x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; font-size: 30px; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; font-size: 34px; color: #fff; background: rgba(0,0,0,.35); border: 0; cursor: pointer; }
.lb-nav.prev { left: 6px; } .lb-nav.next { right: 6px; }
@media (pointer: coarse) { .lb-nav { display: none; } }
.tile-img { position: relative; cursor: zoom-in; }
.img-n { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; background: rgba(0,0,0,.6); color: #fff; font: 12px var(--font); }
/* Админка → Задачи */
.job-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.job-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.job-head .job-acts { margin-left: auto; }
.job-err { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-run { border-top: 1px solid var(--line); padding: 6px 0; }
.job-run > summary { cursor: pointer; font: 14px var(--font); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.job-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; flex: 1 1 200px; }
.job-log { font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; background: var(--surface); border: 1px solid var(--line); padding: 8px 10px; margin: 6px 0; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }
.job-log.bad { color: var(--warn); }
.job-ev { margin: 6px 0; }
@media (max-width: 760px) {
  .tbl.cardify.jobs-t, .tbl.cardify.jobs-t tbody { display: block; width: 100%; }
  .tbl.cardify.jobs-t td { display: block; overflow-wrap: anywhere; }
  .tbl.cardify.jobs-t td::before { display: block; font-size: 12px; }
  .tbl.cardify.jobs-t td:first-child::before, .tbl.cardify.jobs-t td:last-child::before, .tbl.cardify.jobs-t td:empty { display: none; }
  .jobs-t .job-acts { justify-content: flex-start; padding-top: 6px; }
  .job-err { max-width: 100%; }
}
/* подзаголовок шапки — случайный теглайн из настроек */
/* шапка: знак, название и теглайн. На компьютере теглайн — мелко справа сверху от названия, в строку;
   на телефоне знак и «ЧПЧ», теглайн висит под ними и не сдвигает знак с линии иконок */
.mast-brand { position: relative; display: flex; align-items: center; min-width: 0; }
.logo { display: inline-flex; align-items: center; gap: .2em; }
.logo .mark { width: .92em; height: .92em; flex: none; padding: 5px; margin-bottom: -1px; }
.mast-tag { font: 11px/1 var(--font); color: var(--muted); letter-spacing: .2px; width: 150px; white-space: normal;
  margin: -12px 0 0 12px; }
@media (max-width: 560px) {
  .logo .mark { width: 34px; height: 34px; }
  .mast-tag { position: absolute; left: 0; top: 100%; width: auto; white-space: nowrap; line-height: 1.2; margin: 3px 0 0; }
}
/* подвал — знак блёкло, по центру в самом низу */
.foot-mark { display: flex; justify-content: center; margin-top: 22px; color: var(--ink); opacity: .14; }
.foot-mark .mark { width: 34px; height: 34px; }
/* заглушки обложек и картинок — блёклый знак */
.bl-nc, .bk-nc, .nb:empty, .bundle-img.ph { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='60 60 390 390'%3E%3Cpath fill='%23888' fill-opacity='.28' d='M431.8,426.1v-222.8c0-49.5-32.1-81.9-81.1-81.9h-22.2v-39.1l15-10.3v-.4h0v-11.1h-174.1v11.1h0v.4l15,10.3v286.6h-24.5c-30.1,0-40.4-26.9-40.4-55V83.8l17.8-12.3v-11.1H60.6v11.1l17.8,12.3v230c0,49.5,32.1,81.9,81.1,81.9h24.9v30.4l-17.8,12.3v11.1h0v.4h75.6v-11.5l-1.7-.9-16.2-11.4V84.2h61.3v343.9l-15,10.3v11.1h.4v.4h75.2v-11.5l-17.8-9.5V148.2h21.8c30.1,0,40.4,26.9,40.4,55v222.8l-17.8,12.3v11.1h76.8v-11.1l-17.8-12.3Z'/%3E%3C/svg%3E"); background-repeat: no-repeat;
  background-position: center; background-size: 46%; }
.bl-nc { background-size: 70%; }
/* сводка каталога в ленте: карусель обложек книг дня */
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 96px; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: none; margin: 8px 0 2px; padding-bottom: 2px; }
.shelf::-webkit-scrollbar { display: none; }
.shelf-i { scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--ink); font: 12px/1.3 var(--font); }
.shelf-i:hover { text-decoration: none; color: var(--accent); }
.shelf-i img, .shelf-i .nb { width: 100%; aspect-ratio: 2 / 3; height: auto; object-fit: cover; background: var(--surface-2); display: block; }
.shelf-t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; }
.shelf-a { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-more { justify-content: center; align-items: center; aspect-ratio: 2 / 3; background: var(--surface-2); font-weight: 600; text-align: center; padding: 8px; }
.tile.l-shelf { grid-column: 1 / -1; }
.row-item .shelf { grid-auto-columns: 84px; }

/* Свои тексты ЧПЧ: обзор темы, хроника сюжета, «О книге», строка о книге в карточке */
.own-note { margin: 6px 0 16px; }
.own-note .story-sum { font-size: 17px; }
.own-note .story-sum p { margin: 0 0 8px; }
.own-note .small.muted { margin: 4px 0 0; }
.picks { margin: 4px 0 8px; padding-left: 18px; font-size: 15px; line-height: 1.45; }
.picks li { margin: 4px 0; }
.bc-d { font: 13px/1.35 var(--font); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
