:root {
  --bg: #fafaf7; --fg: #1f2328; --muted: #6a737d; --line: #e3e3dc; --card: #fff;
  --accent: #2f5d8a; --accent-soft: #e6eef7; --plus: #2e7d32; --minus: #b3261e; --warn: #fff1e6;
}
/* Тема: по системе, пока владелец устройства не выбрал сам (data-theme на <html>, выбор — в localStorage). */
:root { color-scheme: light; }
:root[data-theme="dark"] { --bg: #16181b; --fg: #e6e6e6; --muted: #9aa0a6; --line: #2c3036; --card: #1e2125;
  --accent: #7fb0e0; --accent-soft: #23344a; --plus: #81c784; --minus: #ef9a9a; --warn: #3a2b1f; color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #16181b; --fg: #e6e6e6; --muted: #9aa0a6; --line: #2c3036; --card: #1e2125;
  --accent: #7fb0e0; --accent-soft: #23344a; --plus: #81c784; --minus: #ef9a9a; --warn: #3a2b1f; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--fg); }
header { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line);
         padding: max(10px, env(safe-area-inset-top)) 14px 0; }
h1 { font-size: 19px; margin: 0 0 8px; }
#owner-badge { font-size: 13px; color: var(--muted); font-weight: normal; }
nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
nav button { border: 0; background: none; padding: 8px 10px; font: inherit; font-size: 15px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
nav .nav-more { display: none; }
nav button.active { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
main { max-width: 980px; margin: 0 auto; padding: 12px 14px 60px; }
.tab { display: none; } .tab.active { display: block; }
input[type=search] { width: 100%; padding: 12px 14px; font: inherit; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--fg); }
.understood { margin: 8px 2px; font-size: 14px; color: var(--muted); min-height: 1em; }
.understood .chip { cursor: default; }
.filters { margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; background: var(--card); }
.filters summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.fgroup h3 { font-size: 14px; margin: 12px 0 6px; } .fgroup small { font-weight: normal; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 14px; cursor: pointer; user-select: none; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); }
.chip.plus { background: var(--accent-soft); border-color: var(--plus); } .chip.plus::before { content: "＋ "; color: var(--plus); }
.chip.minus { border-color: var(--minus); } .chip.minus::before { content: "− "; color: var(--minus); }
.chip.warn { background: var(--warn); }
.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 10px 0; }
.count { color: var(--muted); font-size: 14px; margin: 8px 2px; }
.list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.book { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; }
.book img { width: 62px; height: 92px; object-fit: cover; border-radius: 4px; background: var(--line); flex: none; }
.book .t { font-weight: 600; line-height: 1.25; } .book .a { color: var(--muted); font-size: 14px; }
.book .s { font-size: 14px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.book .why { font-size: 13px; color: var(--accent); margin-top: 4px; }
.stars { color: #e0a800; font-size: 13px; letter-spacing: 1px; }
.hint { color: var(--muted); }
.suggest { border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; background: var(--card); max-height: 280px; overflow: auto; }
.suggest:empty { display: none; }
.suggest div { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.suggest div:hover { background: var(--accent-soft); }
.chosen { margin: 10px 0; }
dialog { border: 0; border-radius: 16px; padding: 0; max-width: 640px; width: calc(100% - 24px); background: var(--card); color: var(--fg); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.cardbody { padding: 18px; } .cardhead { display: flex; gap: 14px; }
.cardhead img { width: 110px; border-radius: 6px; align-self: flex-start; }
.cardbody h2 { margin: 0 0 4px; font-size: 20px; }
.meta { color: var(--muted); font-size: 14px; }
.scales { display: grid; grid-template-columns: auto auto; gap: 2px 14px; font-size: 14px; margin: 10px 0; }
.dots { color: var(--accent); letter-spacing: 2px; }
.close { position: absolute; right: 10px; top: 8px; font-size: 22px; background: none; border: 0; color: var(--muted); cursor: pointer; }
.contains { font-size: 13px; color: var(--muted); }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }
.book .ser { font-size: 12px; color: var(--muted); margin-top: 2px; }
.series { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.series ol { margin: 6px 0 0; padding-left: 26px; max-height: 220px; overflow: auto; }
.series li.cur { font-weight: 600; }
.series a { color: var(--accent); }
.nocover { display: flex; flex-direction: column; justify-content: space-between; color: #fff; border-radius: 4px;
           padding: 6px; overflow: hidden; flex: none; box-shadow: inset 4px 0 0 rgba(0,0,0,.18); }
.nocover.thumb { width: 62px; height: 92px; font-size: 9px; line-height: 1.15; }
.nocover.big { width: 110px; height: 165px; font-size: 13px; line-height: 1.2; }
.nocover .nct { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.nocover .nca { opacity: .85; }
.tgroup { margin: 4px 0; } .tgroup summary { cursor: pointer; font-size: 14px; color: var(--muted); padding: 2px 0; }
.tgroup .chips { margin: 4px 0 8px; }
.book.rec { cursor: default; }
.book.rec .t a { color: inherit; }
.recbtns { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.recbtns .chip { font-size: 12px; padding: 2px 8px; }
#tab-me h3 { margin: 18px 2px 6px; }
#me-src { margin: 2px 0 8px; }
.aw-names { margin-top: 8px; }
.aw-pick { display: none; width: 100%; margin-top: 10px; padding: 9px 10px; font: inherit; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.aw-only { display: block; margin: 10px 2px 0; font-size: 14px; color: var(--muted); }
.aw-year { font-weight: 600; margin: 14px 2px 4px; color: var(--muted); }
.aw-row { padding: 3px 2px; font-size: 15px; }
.aw-row.read { color: var(--plus); }
.aw-row.read a { color: inherit; }
.aw-mark { display: inline-block; width: 1.4em; }
.aw-y { display: inline-block; width: 3.2em; color: var(--muted); font-variant-numeric: tabular-nums; }
.all-tools { margin: 8px 2px; font-size: 14px; color: var(--muted); }
.all-tools select { font: inherit; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.more { display: block; margin: 12px auto; padding: 8px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--accent); font: inherit; cursor: pointer; }
.sg-form { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.sg-form input, .sg-form textarea { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.sg-form .more { margin: 4px 0; align-self: flex-start; }
.sg-picked { font-size: 14px; color: var(--minus); }
.sg-item { cursor: default; margin-bottom: 8px; }
.sg-hidden { opacity: 0.45; }
.qz-filters { margin: 10px 0; }
.qz-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 8px 0; }
.qz-q { font-size: 17px; line-height: 1.45; }
.qz-a { font-size: 16px; }
.more[hidden], [hidden] { display: none !important; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; margin: 6px 0 10px; }
.tile { cursor: pointer; font-size: 13px; line-height: 1.25; }
.tile .tile-img { width: 100%; aspect-ratio: 2 / 3; height: auto; object-fit: cover; border-radius: 6px; background: var(--line); display: block; }
.tile.read .tile-t { color: var(--plus); }
.tile-t { margin-top: 4px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-a { color: var(--muted); font-size: 12px; }
.nocover.tile-img { display: flex; flex-direction: column; justify-content: space-between; padding: 8px; font-size: 11px; box-sizing: border-box; }
.aw-only { display: inline-block; margin-right: 14px; }
.fav-authors { margin: 4px 0 12px; padding-left: 1.6em; }
.fav-authors li { padding: 2px 0; }
#tab-fav h3 small { font-weight: normal; }
.nom { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; align-self: start; }
.nom h3 { margin: 4px 0 2px; }
.share { position: absolute; right: 14px; top: max(8px, env(safe-area-inset-top)); border: 1px solid var(--line); background: var(--card); color: var(--accent); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 14px; cursor: pointer; }
.theme { position: absolute; right: 136px; top: max(8px, env(safe-area-inset-top)); border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 999px; width: 30px; height: 28px; padding: 0; font-size: 15px; cursor: pointer; }
@media (max-width: 560px) { .share span { display: none; } .theme { right: 58px; } h1 { padding-right: 92px; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 8px 16px; border-radius: 10px; font-size: 14px; z-index: 20; }
.friend { font-size: 13px; margin-top: 4px; }
.me-hidden { margin: 18px 2px; } .me-hidden summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* статистика */
.tip { position: fixed; z-index: 30; pointer-events: none; background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.12); max-width: 260px; }
.tip b { font-size: 15px; } .tip div { color: var(--muted); }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.tile-stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.ts-l { font-size: 13px; color: var(--muted); } .ts-v { font-size: 24px; font-weight: 600; line-height: 1.3; } .ts-s { font-size: 12px; color: var(--muted); }
.st-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; min-width: 0; }
.st-card h3 { margin: 2px 0 2px; font-size: 16px; } .st-card > .chips { margin: 10px 0 4px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.st-grid .st-card { margin-bottom: 0; }
.cc { position: relative; height: 190px; margin: 26px 0 26px 30px; }
.cc.cc-short { height: 140px; }
.cc-grid { position: absolute; inset: 0; }
.cc-tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.cc-tick span { position: absolute; right: calc(100% + 6px); transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cc-cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.cc-col { flex: 1; height: 100%; position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; }
/* перечитанное — поверх столбика другим цветом; нижняя часть под ней без скругления */
.cc-bar.rr, .swatch.rr { background: color-mix(in srgb, #e0a800 70%, var(--card)); }
.cc-bar.rr + .cc-bar { border-radius: 0; }
.cc-col.click { cursor: pointer; }
.cc-bar { width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 1px; }
.cc-col:hover .cc-bar, .cc-col:focus-visible .cc-bar { filter: brightness(1.18); }
.cc-col:focus-visible { background: var(--accent-soft); border-radius: 4px; }
.cc-col.sel .cc-bar { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--fg); }
.cc-val { position: absolute; left: 50%; transform: translate(-50%, -3px); font-size: 12px; font-weight: 600; white-space: nowrap; }
.cc-x { position: absolute; top: 100%; margin-top: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
/* эпохи: дневник — сплошная заливка, «по памяти» — светлее, школа — штриховка под 45° */
.cc-bar.memory, .swatch.memory { background: color-mix(in srgb, var(--accent) 55%, var(--card)); }
.cc-bar.school, .swatch.school { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--accent) 55%, var(--card)) 0 3px, color-mix(in srgb, var(--accent) 18%, var(--card)) 3px 6px); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--accent); margin-right: 8px; vertical-align: -1px; }
.epochs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 22px; margin-top: 8px; }
.epoch p { margin: 4px 0 0; font-style: italic; font-family: Georgia, "Times New Roman", serif; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.st-table { margin-top: 10px; font-size: 14px; } .st-table summary { cursor: pointer; color: var(--muted); }
.st-table table { border-collapse: collapse; margin-top: 6px; } .st-table th, .st-table td { padding: 1px 12px 1px 0; text-align: left; font-variant-numeric: tabular-nums; }
#st-year h3 .link { padding: 0 0 0 8px; font-size: 14px; }
.hb { margin-top: 8px; }
.hb-row { display: grid; grid-template-columns: minmax(84px, 38%) 1fr; gap: 8px; align-items: center; padding: 3px 0; font-size: 14px; outline: none; border-radius: 4px; }
.hb-row.click { cursor: pointer; } .hb-row:hover, .hb-row:focus-visible { background: var(--accent-soft); }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hb-bar { height: 14px; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.hb-v { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.heat-wrap { overflow-x: auto; margin-top: 8px; }
.heat { border-collapse: separate; border-spacing: 2px; font-size: 12px; }
.heat thead th { font-weight: normal; color: var(--muted); padding: 0 0 2px; min-width: 24px; }
.heat tbody th { text-align: right; font-weight: normal; padding-right: 8px; white-space: nowrap; font-size: 13px; }
.heat td { width: 26px; height: 22px; border-radius: 3px; outline: none; }
.heat td:hover, .heat td:focus-visible { box-shadow: 0 0 0 2px var(--fg); }
.pending { border: 1px solid var(--line); background: var(--warn); color: var(--fg); border-radius: 999px; padding: 1px 9px; font: inherit; font-size: 12px; font-weight: normal; cursor: pointer; vertical-align: 2px; }

/* сейчас читаю */
.now-reading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.nr-h { color: var(--muted); }
.nr-book { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.nr-book img, .nr-book .nr-cover { width: 28px; height: 42px; object-fit: cover; border-radius: 3px; flex: none; }
.nocover.nr-cover { padding: 2px; font-size: 5px; }
/* в планах: обложки в один ряд, листаются вбок; выбранная раскрывается карточкой под рядом */
#me-plan-h::after { content: " · " attr(data-n); color: var(--muted); font-weight: 400; }
.shelf { position: relative; }
/* scroll-padding — иначе прилипание к первой обложке ставит начало ряда на 3 px (отступ), и вылезает стрелка «назад» */
.shelf-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 3px; overscroll-behavior-x: contain; scrollbar-width: thin; padding: 5px 3px 8px; }
.shelf-tile { flex: none; width: 96px; scroll-snap-align: start; background: none; border: 0; padding: 0; color: inherit; font-family: inherit; text-align: left; }
.shelf-tile .tile-t { -webkit-line-clamp: 2; }
.shelf-tile .tile-a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-tile.on .tile-img { outline: 3px solid var(--accent); outline-offset: 2px; }
.shelf-tile.on .tile-t { color: var(--accent); }
.shelf-arrow { position: absolute; top: 56px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--accent); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.shelf-arrow.prev { left: -6px; } .shelf-arrow.next { right: -6px; }
@media (hover: none) { .shelf-arrow { display: none; } }
#me-plan > .book { margin-top: 6px; max-width: 680px; }
.me-add { margin: 10px 0 4px; }
.me-add-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; cursor: default !important; }
.me-add-row .recbtns { margin: 0; }
#tab-me h3#me-reading-h { margin-top: 14px; }
/* итоги года */
.st-nav { margin: 4px 0 12px; }
.review-hero { text-align: center; padding: 22px 16px; }
.hero-v { font-size: 52px; font-weight: 600; line-height: 1.1; }
.hero-s { color: var(--muted); margin-top: 4px; }
.review-mood { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 17px; margin: 14px auto 6px; max-width: 620px; }
.review-list { margin: 6px 0 0; padding-left: 1.2em; } .review-list li { padding: 2px 0; }
.review-author { margin: 8px 0 2px; font-size: 17px; }
.dice-main .book { max-width: 680px; margin: 0 auto; }
.dice-main .book img, .dice-main .nocover.thumb { width: 110px; height: 165px; font-size: 13px; }
.dice-main .book .s { -webkit-line-clamp: 10; }
.dice-from { max-width: 680px; margin: 0 auto 6px; color: var(--muted); font-size: 13px; }
.dice-set { margin: 8px 0 4px; }
.dice-set summary { cursor: pointer; color: var(--accent); }
.dice-set-h { font-weight: 600; margin: 10px 2px 2px; font-size: 14px; }
.dice-day { font-weight: 600; margin: 12px 2px 6px; color: var(--muted); }
.where { font-size: 12px; color: var(--muted); margin-top: 4px; }
.where a { color: var(--muted); }

/* карточка непрочитанной книги: низ («где взять» и кнопки) — во всю ширину, под обложкой */
.book.rec { flex-wrap: wrap; row-gap: 6px; align-content: space-between; }   /* в сетке кнопки соседних карточек — на одной высоте */
.rec-main { flex: 1 1 0; min-width: 0; }
.rec-foot { flex: 1 0 100%; min-width: 0; }
.rec-foot .where { margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.where.free { color: var(--plus); white-space: normal; } .where.free a { color: var(--plus); } .where.free .meta { font-size: 12px; }
.rec-foot .recbtns { margin-top: 6px; }
.about summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 4px; width: max-content; }
.about[open] .s { display: block; }
/* «Мне почитать»: владельцу пояснение свёрнуто, гостю — открыто и без заголовка */
.how > summary { cursor: pointer; color: var(--muted); font-size: 14px; margin: 2px 2px 8px; width: max-content; }
.how:not(.fold) > summary { display: none; }
/* «Похоже на…»: подсказки, пока ничего не выбрано */
.starters { margin: 12px 2px; } .starters .chips { margin-top: 6px; }
/* премии и полка обложками */
.tile-y { margin-top: 4px; font-size: 12px; color: var(--muted); }
.tile-y + .tile-t { margin-top: 0; }
.tiles.people { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.tile.person { text-align: center; }
.tile.person .tile-img { width: 72px; height: 72px; aspect-ratio: auto; margin: 0 auto; border-radius: 50%; object-fit: cover; object-position: center 25%; }
.tile-img.ini { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; font-weight: 600; letter-spacing: 1px; }
/* карточка книги: когда прочитана и перечитана */
.reads { margin: 12px 0 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.rr-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 2px 0 3px; }
.rr-btns { margin-top: 6px; align-items: center; }
.rr-undated { margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.rr-undated .chip { padding: 0 10px; } .rr-n { min-width: 2em; text-align: center; color: var(--fg); }
.rr-month { font: inherit; font-size: 14px; padding: 3px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
/* дочитано кнопкой «дочитал», на полку приедет после обновления */
.me-done { margin: 10px 2px 0; font-size: 14px; color: var(--muted); }
/* замечания о сайте */
#fb textarea { width: 100%; font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); margin-top: 6px; }
#fb .fb-send { margin: 10px 0 6px; }
#pend .pend-why { background: var(--warn); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
#pend .pend-why .chip { margin-left: 4px; }
#pend .pend-item { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
#pend .pend-item .link { flex: none; }
#pend .more { margin-top: 10px; }
.fb-item { border-top: 1px solid var(--line); padding: 8px 0; } .fb-item.done { opacity: .75; }
.fb-item .link { padding: 2px 0; font-size: 13px; color: var(--muted); }
/* нет ключа данных — ниже плашки «новая версия», чтобы не перекрывали друг друга */
.update-bar.gh-bar { top: calc(max(8px, env(safe-area-inset-top)) + 46px); }
/* перечитывания в карточке книги */
.rr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; font-size: 14px; }
.rr-l { min-width: 7.5em; color: var(--muted); }
.rr-row .chip { padding: 0 11px; }
.rr-sel { font: inherit; font-size: 14px; padding: 3px 4px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg); margin-right: 4px; } .rr-date { display: inline-flex; align-items: center; gap: 2px; }
/* подсказка с «Отменить» */
.toast { display: flex; align-items: center; gap: 12px; }
.toast-act { border: 0; background: none; color: var(--accent-soft); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
/* ⓘ — что скрыто от гостей */
.info-btn { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0 2px; }
.hidden-why { display: block; margin-top: 4px; color: var(--muted); } .hidden-why[hidden] { display: none; }
/* вышла новая версия сайта */
.update-bar { position: fixed; z-index: 25; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  background: var(--fg); color: var(--bg); border-radius: 999px; padding: 6px 8px 6px 16px; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.2); white-space: nowrap; }
.update-bar button { border: 0; border-radius: 999px; padding: 4px 12px; font: inherit; font-weight: 600; background: var(--accent); color: #fff; cursor: pointer; }
/* выдвижная панель «Ещё» */
dialog.nav-sheet:focus { outline: none; }
dialog.nav-sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; }
.sheet-btn.on { border-color: var(--accent); background: var(--accent-soft); }
.sheet-i { font-size: 24px; line-height: 1.2; }

/* Телефон: вкладки — панелью внизу экрана (значок и короткая подпись), шапка уезжает при прокрутке. */
@media (max-width: 760px) {
  header { position: relative; padding-bottom: 8px; }
  h1 { margin: 0; font-size: 18px; white-space: nowrap; }
  #owner-badge { font-size: 0; } #owner-badge::after { content: "🔑"; font-size: 14px; }
  .pending { position: fixed; z-index: 9; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); }
  nav { position: fixed; z-index: 8; left: 0; right: 0; bottom: 0; gap: 0; overflow: visible; background: var(--card); border-top: 1px solid var(--line); padding: 0 2px env(safe-area-inset-bottom); }
  nav button { display: none; flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; padding: 5px 2px 4px; font-size: 0; border-bottom: 0; border-top: 2px solid transparent; }
  nav button.prio, nav .nav-more { display: flex; }
  nav button.prio { order: var(--o); } nav .nav-more { order: 9; }
  nav button::before { content: attr(data-icon); font-size: 20px; line-height: 26px; filter: grayscale(1); opacity: .6; }
  nav button::after { content: attr(data-short); font-size: 11px; line-height: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  nav button.active { border-top-color: var(--accent); color: var(--accent); }
  nav button.active::before { filter: none; opacity: 1; }
  footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .st-nav, .scroll-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .st-nav .chip, .scroll-row .chip { flex: none; }
  #aw-list { display: none; } .aw-pick { display: block; }
}
/* Узкий экран: подписи полос в статистике — над полосой, иначе «Россия и бывший СССР» обрезается до «Россия и бы…». */
@media (max-width: 560px) {
  .hb-row { grid-template-columns: 1fr; gap: 1px; padding: 4px 0; }
}
