/* Темы: авто (по системе), светлая, тёмная и секретная «Майка лидера». Выбор — data-theme на <html>. */
:root {
  --bg: #f4f5f7; --surface: #fff; --text: #16181d; --muted: #5b6170; --line: #e5e7eb;
  --accent: #0f766e; --on-accent: #fff; --link: #0f766e; --accent-soft: #ccfbf1; --watch: #b45309; --on-watch: #fff; --watch-soft: #fef3c7;
  --mine: #7c3aed; --err: #b91c1c; --ok: #15803d; --radius: 14px; --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 2px 8px rgb(0 0 0 / .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0e1014; --surface: #171a20; --text: #e7e9ee; --muted: #9aa1ad; --line: #272b33;
    --accent: #2dd4bf; --on-accent: #042f2e; --link: #2dd4bf; --accent-soft: #134e4a; --watch: #fbbf24; --on-watch: #1b1300; --watch-soft: #422006;
    --mine: #a78bfa; --err: #f87171; --ok: #4ade80; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1014; --surface: #171a20; --text: #e7e9ee; --muted: #9aa1ad; --line: #272b33;
  --accent: #2dd4bf; --on-accent: #042f2e; --link: #2dd4bf; --accent-soft: #134e4a; --watch: #fbbf24; --on-watch: #1b1300; --watch-soft: #422006;
  --mine: #a78bfa; --err: #f87171; --ok: #4ade80; --shadow: none;
  color-scheme: dark;
}
/* 🟡 Майка лидера: жёлтый Тур де Франс, чёрный текст на жёлтом */
:root[data-theme="jersey"] {
  --bg: #fff6cc; --surface: #fffdf2; --text: #1b1a12; --muted: #6b5f2a; --line: #f0dd8a;
  --accent: #ffd400; --on-accent: #111; --link: #7a5a00; --accent-soft: #fff0a3; --watch: #c2410c; --on-watch: #fff; --watch-soft: #ffedd5;
  --err: #b91c1c; --ok: #15803d; --shadow: 0 1px 0 #e9cf5c, 0 3px 10px rgb(122 90 0 / .12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 48px; }

.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top);
  transition: transform .25s ease; }
.topbar-hidden { transform: translateY(-100%); box-shadow: none; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.logo { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.topnav a { font-size: 14px; text-decoration: none; }

.search input { width: 100%; padding: 10px 14px; font-size: 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); }
.search input:focus { border-color: var(--link); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 14px; white-space: nowrap; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-watch { color: var(--watch); }
.chip-watch.active { background: var(--watch); border-color: var(--watch); color: var(--on-watch); }

.feed { display: grid; gap: 14px; padding-top: 14px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.card-watch { border-color: color-mix(in srgb, var(--watch) 55%, var(--line)); }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-img { aspect-ratio: 16 / 9; background: var(--line); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 12px 14px 4px; }
.card h2 { font-size: 18px; line-height: 1.3; margin: 6px 0 6px; }
.card-link:hover h2 { color: var(--accent); }
.summary { margin: 0 0 8px; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--link); font-weight: 600; }
.badge-watch { background: var(--watch-soft); color: var(--watch); }
.card-foot { display: flex; gap: 10px; align-items: center; padding: 8px 14px 12px; font-size: 13px; color: var(--muted); }
.card-foot .source { font-weight: 600; text-decoration: none; padding: 12px 0; margin: -12px 0; }
.card-foot .host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.more { display: block; text-align: center; padding: 14px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.more.loading { opacity: .6; pointer-events: none; }
.empty, .filter-note { color: var(--muted); padding: 24px 4px 0; text-align: center; }
.filter-note { padding: 14px 0 0; text-align: left; }
.footnote { color: var(--muted); font-size: 13px; text-align: center; margin-top: 24px; }

/* формы и админка */
.flash { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); }
.flash-error { background: color-mix(in srgb, var(--err) 18%, var(--surface)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 14px; }
.panel h1, .panel h2 { margin: 0 0 10px; font-size: 20px; }
.narrow { max-width: 420px; margin: 40px auto 0; }
.stack { display: grid; gap: 12px; margin-top: 12px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
input, select, textarea { font: inherit; font-size: 16px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); width: 100%; }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; font-size: 14px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid-cat { display: grid; gap: 8px; grid-template-columns: 1fr 80px; margin-bottom: 6px; }
.btn { font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 10px; border: 0; background: var(--accent); color: var(--on-accent); cursor: pointer; }
.btn:disabled { opacity: .6; }
.btn-danger { background: var(--err); }
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: inherit; }
.link-btn.danger { color: var(--err); }
.icon-btn { font-size: 18px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
form.inline { display: inline; margin: 0; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
code { font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 6px; word-break: break-all; }
.muted { color: var(--muted); } .small { font-size: 13px; } .err { color: var(--err); word-break: break-word; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
details summary { cursor: pointer; }
.tabs { position: relative; display: flex; gap: 6px; padding-top: 14px; overflow-x: auto; align-items: center; }
.tabs a { padding: 7px 12px; border-radius: 10px; text-decoration: none; white-space: nowrap; font-size: 14px; color: var(--text); }
.tabs a.active { background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.tabs .push { margin-left: auto; font-size: 14px; }
.list { display: grid; gap: 8px; margin-top: 14px; }
.src { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.src-off { opacity: .55; }
.src-main { flex: 1; min-width: 0; }
.src-title { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.src-title a { color: var(--text); text-decoration: none; }
.src-actions { display: flex; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; display: inline-block; }
.dot-ok, .dot-not_modified { background: var(--ok); } .dot-error { background: var(--err); } .dot-off { background: var(--line); }
.section { font-size: 17px; margin: 28px 0 0; }
.log-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.cat { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 4px; }
.sticky-save { position: sticky; bottom: 12px; margin-bottom: 12px; box-shadow: 0 4px 14px rgb(0 0 0 / .2); }

@media (min-width: 640px) {
  .card-link { display: grid; grid-template-columns: 220px 1fr; }
  .card-img { aspect-ratio: auto; height: 100%; min-height: 150px; }
  .card-link:not(:has(.card-img)) { display: block; }
}
@media (max-width: 380px) { .grid2 { grid-template-columns: 1fr; } }

/* видео, действия, подборка */
.card-video { position: relative; cursor: pointer; }
.card-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.card-short .card-video { aspect-ratio: 9 / 16; max-height: 70vh; margin: 0 auto; }
.play { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 64px; height: 64px;
  border-radius: 50%; border: 0; background: rgb(0 0 0 / .65); color: #fff; font-size: 26px; cursor: pointer; }
.badge-video { background: color-mix(in srgb, #dc2626 18%, var(--surface)); color: #dc2626; }
.chip-foryou { color: #db2777; }
.chip-foryou.active { background: #db2777; border-color: #db2777; color: #fff; }
.reasons { margin: 0 0 8px; font-size: 13px; color: #db2777; }
.more-src { font-weight: 600; text-decoration: none; white-space: nowrap; }
.card-actions { display: flex; gap: 6px; padding: 0 10px 10px; align-items: center; flex-wrap: wrap; }
.card-actions:empty { display: none; }
.act { font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); text-decoration: none; cursor: pointer; line-height: 1.2; }
.act.on { background: var(--accent-soft); border-color: var(--accent); }
.fb { display: inline-flex; gap: 6px; }
.card-disliked { opacity: .5; }
.logo-sub { color: var(--link); }

.badge-tr { background: var(--bg); color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.orig { padding: 0 14px 4px; font-size: 13px; color: var(--muted); }
.orig summary { cursor: pointer; width: fit-content; padding: 12px 0; margin: -8px 0 -6px; }
.orig p { margin: 6px 0 4px; }

/* режим чтения */
.reader { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.reader h1 { font-size: 24px; line-height: 1.25; margin: 6px 0 8px; }
.reader-meta { font-size: 13px; color: var(--muted); margin: 0; }
.reader-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 16px; align-items: center; }
.reader-body { font-size: 17px; line-height: 1.6; overflow-wrap: anywhere; }
.reader-body img, .reader-cover { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 12px auto; }
.reader-body figure { margin: 16px 0; }
.reader-body figcaption { font-size: 13px; color: var(--muted); text-align: center; }
.reader-body blockquote { margin: 12px 0; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--muted); }
.reader-body table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.reader-body td, .reader-body th { border: 1px solid var(--line); padding: 4px 8px; }
.reader-body pre { overflow-x: auto; }
.reader-video { margin: 0 -16px 12px; }

.gist { margin: 0 0 8px; font-size: 15px; }
.gist-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--link); }
.gist ul { margin: 4px 0 0; padding-left: 18px; color: var(--text); }
.gist li { margin: 2px 0; }
.gist li::marker { color: var(--accent); }

.chips-cats { padding-top: 0; }
.chips-cats .chip { font-size: 13px; padding: 5px 11px; }
.chip-video.active { background: #dc2626; border-color: #dc2626; color: #fff; }

/* панель чтения поверх ленты */
.sheet { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; }
.sheet-bar { position: sticky; top: 0; z-index: 2; padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.sheet-close { font: inherit; font-weight: 600; background: none; border: 0; color: var(--link); cursor: pointer; padding: 6px 0; }
.sheet-body { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; }
.sheet-loading { padding: 40px 0; text-align: center; }
body.sheet-open { overflow: hidden; }
.reader-gist { padding-left: 20px; font-size: 16px; line-height: 1.5; }
.reader-gist li { margin: 4px 0; }
.panel .btn { display: inline-block; text-decoration: none; margin: 6px 10px 0 0; }

.chip-mine { color: var(--mine); }
.chip-mine.active { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.topic { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); background: var(--bg); cursor: pointer; }
.topic input { width: 18px; height: 18px; }
code.copy { display: block; padding: 8px 10px; user-select: all; }

/* переключатель темы и пасхалка */
.topnav { display: flex; align-items: center; gap: 12px; }
.theme-btn { font: inherit; font-size: 18px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); cursor: pointer; line-height: 1; }
.logo { user-select: none; -webkit-tap-highlight-color: transparent; }
.rider { position: fixed; top: calc(14px + env(safe-area-inset-top)); left: -60px; z-index: 60; font-size: 30px;
  animation: ride 2.6s cubic-bezier(.45,.05,.55,.95) forwards; pointer-events: none; transform: scaleX(-1); }
@keyframes ride { to { left: calc(100vw + 60px); } }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 20px rgb(0 0 0 / .25); animation: toast 3.2s ease forwards; white-space: nowrap; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
:root[data-theme="jersey"] .topbar { border-bottom: 3px solid var(--accent); }
:root[data-theme="jersey"] .card-watch { border-color: #e0b800; }
@media (prefers-reduced-motion: reduce) { .rider { display: none; } .toast { animation: none; } }


/* поделиться */
.share-sheet { position: fixed; inset: 0; z-index: 70; background: rgb(0 0 0 / .45); display: flex; align-items: flex-end; justify-content: center; }
.share-sheet[hidden] { display: none; }
.share-box { background: var(--surface); width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.share-title { margin: 0 0 12px; font-weight: 600; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.share-actions .act { font-size: 15px; padding: 10px 14px; }
.share-cancel { display: block; margin: 4px auto 0; }
/* словарик */
.term { text-decoration: underline dotted var(--link); text-underline-offset: 3px; cursor: help; }
.term-tip { position: absolute; z-index: 65; max-width: min(320px, calc(100vw - 24px)); background: var(--text); color: var(--bg);
  padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4; box-shadow: 0 6px 20px rgb(0 0 0 / .25); }
/* первое знакомство и главное */
.hello { position: relative; margin-top: 14px; padding: 12px 36px 12px 14px; border-radius: var(--radius); background: var(--accent-soft);
  font-size: 14px; line-height: 1.45; }
.hello-close { position: absolute; top: 6px; right: 6px; border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 6px; }
.top { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.top-title { font-size: 15px; margin: 2px 0 6px; }
.top-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 15px; line-height: 1.3; }
.top-item:first-of-type { border-top: 0; }
.top-n { flex: none; font-size: 12px; color: var(--muted); align-self: center; }
/* прочитанное */
.card-read h2 { color: var(--muted); font-weight: 600; }
.card-read .card-img img { opacity: .6; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.share-btn .icon { display: block; flex: none; }
.source-plain { color: var(--text); }

/* ряды чипов: листаются до края экрана, край растворяется — видно, что дальше есть ещё */
.chips { margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-padding: 0 16px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 32px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 32px), transparent 100%); }
.chips::after { content: ""; flex: none; width: 4px; }  /* последний чип не прилипает к краю */
/* на компьютере свайпа нет: стрелки ‹ › по краям ряда (видны, только когда есть куда листать) и колесо мыши */
.chips-wrap { position: relative; }
.chips-arrow { display: none; }
@media (hover: hover) and (pointer: fine) {
  .chips-arrow { display: flex; align-items: center; justify-content: center; position: absolute; top: 50%; z-index: 3;
    width: 30px; height: 30px; margin-top: -16px; border-radius: 50%; border: 1px solid var(--line);
    background: var(--surface); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer;
    box-shadow: 0 2px 8px rgb(0 0 0 / .15); }
  .chips-arrow[hidden] { display: none; }
  .chips-arrow.prev { left: -6px; }
  .chips-arrow.next { right: -6px; }
}

/* разделы, старты, карта */
.sections { display: flex; gap: 18px; padding-top: 2px; padding-bottom: 8px; font-size: 15px; }
.sections a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 10px 0 4px; margin-top: -8px; border-bottom: 2px solid transparent; }
.sections a.active { color: var(--text); border-bottom-color: var(--accent); }
.page-title { font-size: 22px; margin: 16px 0 4px; }
.events-filter { display: flex; gap: 8px; align-items: center; margin: 4px 0 8px; }
.events-filter select { width: auto; max-width: 60%; font-size: 14px; padding: 7px 10px; }
.month { font-size: 16px; margin: 20px 0 8px; color: var(--muted); text-transform: capitalize; }
.events-list { display: grid; gap: 8px; }
.event { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; }
.event-date { flex: none; width: 74px; font-weight: 700; font-size: 14px; color: var(--link); }
.event-main { flex: 1; min-width: 0; }
.event h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.3; }
.event h3 a { color: var(--text); text-decoration: none; }
.event p { margin: 2px 0; }
.event-cal { flex: none; font-size: 16px; }
.map-search { display: flex; gap: 8px; margin: 8px 0; }
.map-kinds { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; margin-bottom: 8px; }
.map-kind { display: flex; align-items: center; gap: 6px; color: var(--text); }
.map-kind input { width: 16px; height: 16px; }
.pin { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pin-trail { background: #16a34a; } .pin-pump { background: #ea580c; } .pin-park { background: #7c3aed; }
.pin-track { background: #0284c7; } .pin-bmx { background: #dc2626; }
.map { height: 62vh; min-height: 320px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }
.map-status { margin: 6px 0; }
.leaflet-popup-content { font: 14px/1.4 system-ui, sans-serif; }
.leaflet-popup-content a { color: #0f766e; }

/* ===== по чек-листу ui-ux-pro-max: иконки, зоны нажатия, фокус, отклик, движение ===== */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.fill, .on .i, [aria-pressed="true"] .i { fill: currentColor; }
.i.sm { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.logo { display: inline-flex; align-items: center; gap: 6px; }
.logo-icon { width: 24px; height: 24px; color: var(--link); }
.theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
.page-title, .top-title, .panel h1 { display: flex; align-items: center; gap: 8px; }
.page-title .i { width: 22px; height: 22px; color: var(--link); }
.top-title .i { color: #ea580c; }
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; }
.chip .i { width: 15px; height: 15px; }
.badge { display: inline-flex; align-items: center; gap: 3px; }
.badge .i { width: 12px; height: 12px; }
.play { display: flex; align-items: center; justify-content: center; }
.play .i { width: 26px; height: 26px; margin-left: 3px; }
/* зоны нажатия ≥44px */
.act { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; }
.card-actions { gap: 8px; }
.hello-close { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; top: 0; right: 0; }
.event-cal { padding: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* видимый фокус для клавиатуры */
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px; }
.card-link:focus-visible { outline-offset: -2px; border-radius: var(--radius); }
/* отклик: плавные переходы и нажатие без сдвига раскладки */
.act, .chip, .btn, .theme-btn, .icon-btn, .more, .top-item, .card-link h2, .source, .sections a {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, opacity .15s ease; }
.act:hover, .chip:hover, .theme-btn:hover { border-color: var(--link); }
.act:active, .chip:active, .btn:active, .theme-btn:active, .more:active, .play:active { opacity: .65; }
.btn:hover { filter: brightness(1.08); }
button, .act, .chip, .theme-btn, summary, .term { cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
  .toast { animation: none !important; }  /* иначе мгновенно «доиграет» до прозрачности 0 и исчезнет */
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }  /* не display:none — иначе <use> в части браузеров не рисует */

/* личный кабинет */
.me-link { font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.login-box h1 { display: flex; align-items: center; gap: 8px; }
.login-box .btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.topics-field { border: 0; padding: 0; margin: 0; }
.topics-field legend { font-size: 14px; color: var(--muted); margin-bottom: 6px; }

/* меню рубрик */
.topbar-row { gap: 4px; }
.logo { margin-right: auto; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -10px;
  border: 0; background: none; color: var(--text); border-radius: 10px; }
.menu-btn .i { width: 22px; height: 22px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgb(0 0 0 / .45); }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; z-index: 81; width: min(360px, 88vw); background: var(--surface);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; transform: translateX(-100%);
  transition: transform .2s ease; padding-top: env(safe-area-inset-top); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--line); }
.drawer-close { border: 0; background: none; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0; }
.drawer-loading { padding: 16px; }
.drawer-foot { display: flex; gap: 4px; padding: 8px; border-top: 1px solid var(--line); padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.drawer-foot a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: 12px; min-height: 44px; }
.drawer-foot a:hover { background: var(--bg); }
.menu-sec { border-bottom: 1px solid var(--line); }
.menu-sec summary { display: flex; align-items: center; gap: 8px; padding: 0 16px; min-height: 48px; list-style: none; font-weight: 600; }
.menu-sec summary::-webkit-details-marker { display: none; }
.menu-name { flex: 1; }
.menu-count { font-size: 12px; font-weight: 700; color: var(--link); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.menu-chevron { color: var(--muted); transition: transform .2s ease; }
.menu-sec[open] .menu-chevron { transform: rotate(180deg); }
.menu-items { list-style: none; margin: 0; padding: 0 8px 4px; }
.menu-items a { display: block; padding: 9px 8px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.35; }
.menu-items a:hover { background: var(--bg); }
.menu-time { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.menu-all { display: block; padding: 6px 16px 12px; font-size: 14px; font-weight: 600; text-decoration: none; }
.plain { list-style: none; padding: 0; margin: 6px 0 0; } .plain li { padding: 2px 0; }
.user-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-top: 1px solid var(--line); }
.user-row:first-of-type { border-top: 0; }
.role-form { display: flex; gap: 6px; align-items: center; }
.role-form select { width: auto; font-size: 14px; padding: 7px 10px; }

/* админка: разделы сбоку */
.admin-head { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.admin-head h1 { font-size: 20px; margin: 0; }
.admin-menu { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.admin-menu .i { width: 18px; height: 18px; }
.admin-links { list-style: none; margin: 0; padding: 4px 0; }
.admin-links a, .admin-links .link-btn { display: flex; align-items: center; min-height: 44px; padding: 0 16px; width: 100%;
  color: var(--text); text-decoration: none; font-size: 15px; text-align: left; }
.admin-links a.active { color: var(--link); font-weight: 600; background: var(--accent-soft); }
.admin-links li:nth-last-child(2) { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.admin-side { display: none; }
@media (min-width: 1180px) {  /* место слева от колонки 720px — меню всегда на виду */
  .admin-menu { display: none; }
  .admin-side { display: block; position: fixed; top: 120px; left: calc(50% - 360px - 220px); width: 200px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
}
