/* AppStorent — main.css
   порядок: переменные/сброс → типографика → каркас → компоненты → страницы → медиа
   ------------------------------------------------------------------------- */

/* ==== переменные ==== */
:root {
  --bg: #1f1d1c;
  --panel: #282624;
  --panel-2: #312e2b;
  --hover: #36322f;
  --line: #3b3734;
  --line-soft: #2f2c29;

  --text: #f2eee9;
  --text-2: #d2ccc4;
  --muted: #918a81;

  --accent: #2bb3a0;
  --accent-hi: #45cbb7;
  --accent-ink: #0d2420;
  --dl: #f08c1a;
  --dl-hover: #ff9b2b;
  --ok: #5cc46c;
  --bad: #ef6450;
  --warn: #e7b23f;

  --r: 12px;
  --r-sm: 10px;
  --side-w: 200px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ==== сброс ==== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul[class], ol[class],
nav ul, nav ol { list-style: none; margin: 0; padding: 0; }
figure { margin: 0; }
[hidden] { display: none !important; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  font-weight: 600;
}
.skip:focus { top: 12px; }

/* ==== типографика ==== */
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }           /* 28 */
h2 { font-size: 1.25rem; }           /* 20 */
h3 { font-size: 1.0625rem; }         /* 17 */
p { margin: 0 0 1em; }
small, .small { font-size: 13px; }
code, kbd, pre { font-family: var(--mono); font-size: .9em; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* длинный текст: статьи, about, справка */
.prose {
  max-width: 46rem;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-2);
  overflow-wrap: break-word;
}
.prose > :first-child { margin-top: 0; }
.prose h1 { margin-bottom: .6em; color: var(--text); }
.prose h2 {
  margin: 2em 0 .6em;
  font-size: 1.3125rem;
  color: var(--text);
}
.prose h3 {
  margin: 1.7em 0 .45em;
  font-size: 1.0625rem;
  color: var(--text);
}
.prose p, .prose ul, .prose ol, .prose table, .prose pre, .prose blockquote { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; padding-left: .2em; }
.prose li::marker { color: var(--muted); }
.prose ol li::marker { font-family: var(--mono); font-size: .9em; }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--text); }
.prose a { text-decoration: underline; text-decoration-color: rgba(43, 179, 160, .45); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose code {
  padding: .1em .35em;
  background: var(--panel-2);
  border-radius: 5px;
  color: #f3d9b8;
}
.prose pre {
  padding: 14px 16px;
  background: #171615;
  border-radius: var(--r-sm);
  overflow-x: auto;
  line-height: 1.55;
}
.prose pre code { padding: 0; background: none; }
.prose blockquote {
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.prose th, .prose td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--text); font-weight: 600; background: var(--panel-2); }
.prose .tbl { overflow-x: auto; margin: 0 0 1.1em; }
.prose .tbl table { margin: 0; min-width: 420px; }

/* ==== каркас ==== */
.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "logo usr"
    "srch srch";
  align-items: center;
  gap: 10px 12px;
  padding: 10px 16px 12px;
  background: var(--bg);
}
.bar .logo { grid-area: logo; }
.bar .srch { grid-area: srch; }
.bar .usr { grid-area: usr; }

.side {
  background: var(--bg);
  padding: 28px 10px 24px;
}

.page {
  width: 100%;
  max-width: 1240px;
  padding: 14px 16px 48px;
}

.foot {
  padding: 22px 16px 30px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}
.foot__in { max-width: 1160px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }
.foot__nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.foot__nav a { color: var(--text-2); }
.foot__nav a:hover { color: var(--accent); }
.foot__copy { margin: 0; margin-left: auto; }
.foot__tag { margin: 0; width: 100%; }

/* ==== логотип ==== */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.logo:hover { color: var(--text); }
.logo img { width: 30px; height: 30px; }
.logo b { color: var(--accent); font-weight: 700; }

/* ==== поиск ==== */
.srch {
  position: relative;
  width: 100%;
}
.srch input {
  width: 100%;
  height: 46px;
  padding: 0 52px 0 20px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  outline: 0;
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
}
.srch input::placeholder { color: var(--muted); }
.srch input:focus { border-color: var(--accent); }
.srch input::-webkit-search-cancel-button { display: none; }
.srch__go {
  position: absolute;
  right: 6px; top: 50%;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  padding: 0;
  transform: translateY(-50%);
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
}
.srch__go svg { width: 20px; height: 20px; }
.srch__go:hover { color: var(--text); }

/* ==== блок пользователя ==== */
.usr { display: flex; align-items: center; gap: 6px; justify-self: end; min-width: 0; }
.usr__in {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.usr__in svg { width: 16px; height: 16px; color: var(--accent); }
.usr__in:hover { background: var(--hover); color: var(--text); }
.usr__me {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.usr__me:hover { color: var(--accent); }
.usr__name { display: none; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usr__outf { margin: 0; }
.usr__out {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 13px;
}
.usr__out span { display: none; }
.usr__out svg { width: 20px; height: 20px; }
.usr__out:hover { color: var(--text); }

.ava {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #2f7f72;
  color: #e8fbf7;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
}
.ava--b { background: #8a5a35; color: #fdeee0; }
.ava--c { background: #4f4f66; color: #ececf7; }
.ava--d { background: #5b6b32; color: #f1f7dc; }
.ava--lg { width: 72px; height: 72px; font-size: 24px; }

/* колокольчик */
.bell { position: relative; }
.bell__btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--text-2);
}
.bell__btn svg { width: 22px; height: 22px; }
.bell__btn:hover, .bell__btn[aria-expanded="true"] { background: var(--panel); color: var(--text); }
.bell__n {
  position: absolute;
  top: 4px; right: 3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--dl);
  color: #2a1704;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.bell__drop {
  position: absolute;
  right: -90px;
  top: calc(100% + 10px);
  z-index: 60;
  width: 340px;
  max-width: calc(100vw - 24px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.bell__head {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
}
.bell__head span { color: var(--muted); font-weight: 400; font-size: 13px; }
.bell__all {
  display: block;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.bell__all:hover { background: var(--panel-2); }

/* список уведомлений — в дропдауне и в профиле */
.ntf { max-height: 360px; overflow-y: auto; }
.ntf__i { position: relative; border-bottom: 1px solid var(--line-soft); }
.ntf__i:last-child { border-bottom: 0; }
.ntf__i a {
  display: block;
  padding: 11px 16px 11px 30px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}
.ntf__i a:hover { background: var(--panel-2); color: var(--text); }
.ntf__i time { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.ntf__i.is-new { background: rgba(43, 179, 160, .06); }
.ntf__i.is-new a { color: var(--text); }
.ntf__i.is-new::before {
  content: "";
  position: absolute;
  left: 13px; top: 17px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* ==== сайдбар ==== */
.side .logo { display: none; margin: 0 8px 30px; }
.nav li + li { margin-top: 2px; }
.nav__a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  padding: 8px 8px 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}
.nav__a svg { flex: 0 0 auto; width: 22px; height: 22px; color: #807970; }
.nav__a > span:not(.nav__n) { overflow: hidden; text-overflow: ellipsis; }
.nav__a:hover { background: var(--panel); color: var(--text); }
.nav__a:hover svg { color: var(--text-2); }
.nav__a.is-on { background: var(--panel); color: var(--text); }
.nav__a.is-on svg { color: var(--accent); }
.nav__n {
  margin-left: auto;
  min-width: 24px;
  padding: 1px 5px;
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--muted);
  font: 500 10.5px/18px var(--mono);
  text-align: center;
}
.nav__a.is-on .nav__n { background: var(--hover); }

.nav--sub { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }

.favs { margin-top: 26px; padding: 0 10px; }
.favs__h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.favs__h a {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--text-2);
}
.favs__h a svg { width: 14px; height: 14px; }
.favs__h a:hover { background: var(--hover); color: var(--text); }
.favs__list { display: flex; gap: 10px; }
.favs__list a { display: block; border-radius: 10px; }
.favs__list img { width: 42px; height: 42px; border-radius: 10px; }
.favs__list a:hover img { opacity: .8; }

.side__tag { margin: 26px 10px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* ==== нижняя панель (мобильные) ==== */
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: space-around;
  height: 62px;
  padding: 0 4px env(safe-area-inset-bottom);
  background: #252321;
  border-top: 1px solid var(--line-soft);
}
.dock__a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}
.dock__a svg { width: 22px; height: 22px; }
.dock__a.is-on { color: var(--accent); }
.dock__a:hover { color: var(--text); }
.no-js .dock__menu { display: none; }

/* ==== кнопки ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--panel-2);
  border: 0;
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.btn:hover { background: var(--hover); color: var(--text); }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn--dl { min-height: 50px; background: var(--dl); color: #2b1602; font-weight: 700; }
.btn--dl:hover { background: var(--dl-hover); color: #2b1602; }
.btn--acc { background: var(--accent); color: var(--accent-ink); }
.btn--acc:hover { background: var(--accent-hi); color: var(--accent-ink); }
.btn--wide { width: 100%; }
.btn--sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* кнопка-ссылка (избранное, оф. сайт) */
.linkbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  background: none;
  border: 0;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
}
.linkbtn svg { width: 19px; height: 19px; flex: 0 0 auto; }
.linkbtn:hover { color: var(--text); }

/* избранное: два состояния */
.fav-btn svg .on { display: none; }
.fav-btn[aria-pressed="true"],
.fav-btn.is-on { color: var(--dl); }
.fav-btn[aria-pressed="true"] svg .on,
.fav-btn.is-on svg .on { display: inline; }
.fav-btn[aria-pressed="true"] svg .off,
.fav-btn.is-on svg .off { display: none; }
.fav-btn .t-on { display: none; }
.fav-btn[aria-pressed="true"] .t-on,
.fav-btn.is-on .t-on { display: inline; }
.fav-btn[aria-pressed="true"] .t-off,
.fav-btn.is-on .t-off { display: none; }

/* ==== бейджи, метки ==== */
.badge {
  display: inline-block;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 19px;
  white-space: nowrap;
}
.badge--upd { background: rgba(43, 179, 160, .15); color: var(--accent); }
.badge--mod { background: rgba(231, 178, 63, .15); color: var(--warn); }
.badge--no { background: rgba(239, 100, 80, .15); color: var(--bad); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 9px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}
.tag svg { width: 16px; height: 16px; color: var(--accent); }
.tag:hover { background: var(--hover); color: var(--text); }

/* ==== хлебные крошки ==== */
.crumbs { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li { display: flex; align-items: center; gap: 4px; min-width: 0; }
.crumbs li + li::before { content: "›"; color: #6b655e; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--muted); overflow-wrap: anywhere; }

/* ==== карточка-подложка ==== */
.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}

/* ==== плитка программы ==== */
/* мобильные: список в одной карточке, как в оригинале */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
}
.grid > li + li { border-top: 1px solid var(--line-soft); }
.tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 12px 16px;
  color: inherit;
  transition: background-color .15s;
}
.tile:hover { background: var(--hover); color: inherit; }
.tile__ico { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 11px; background: var(--panel-2); }
.tile__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tile__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.tile__ver {
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tile__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
}
.tile__as {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
}
.tile__as::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 2px rgba(92, 196, 108, .18);
}

/* ==== секции ==== */
.sec { margin-top: 36px; }
.sec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.sec__head h2 { display: flex; align-items: center; gap: 10px; font-size: 1.3125rem; }
.sec__head h2 svg { width: 22px; height: 22px; color: var(--accent); }
.sec__more { flex: 0 0 auto; font-size: 13px; font-weight: 500; white-space: nowrap; }

.intro {
  padding: 24px 20px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.intro h1 { margin-bottom: 12px; font-size: 1.75rem; }
.intro .prose { max-width: 52rem; }
.intro .prose > :last-child { margin-bottom: 0; }

/* ==== пагинация ==== */
.pager { margin-top: 32px; }
.pager ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pager a,
.pager span {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}
.pager a:hover { background: var(--hover); color: var(--text); }
.pager [aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pager .is-off { opacity: .4; }
.pager .gap { background: none; border: 0; min-width: 20px; padding: 0; }

/* ==== вкладки ==== */
.tabs { padding: 0 16px 20px; }
.tabs__list {
  display: flex;
  gap: 26px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs__list::-webkit-scrollbar { display: none; }
.tabs__btn {
  position: relative;
  flex: 0 0 auto;
  padding: 18px 0 14px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
.tabs__btn:hover { color: var(--text-2); }
.tabs__btn[aria-selected="true"] { color: var(--text); }
.tabs__btn[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}
.tabs__h { margin-bottom: 14px; }
.js .tabs__h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.js .tabs__h + h2 { margin-top: 0; }
.tabs__panel { padding-top: 6px; }
/* без js: все панели подряд, кнопки не нужны */
.no-js .tabs { padding-top: 20px; }
.no-js .tabs__list { display: none; }
.no-js .tabs__panel[hidden] { display: block !important; margin-top: 30px; }

/* ==== скриншоты ==== */
.shots { position: relative; margin-bottom: 20px; }
.shots__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.shots__track::-webkit-scrollbar { display: none; }
.shots__item { flex: 0 0 100%; scroll-snap-align: start; }
.shots__item a { display: block; border-radius: var(--r-sm); overflow: hidden; background: var(--bg); }
.shots__item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.shots__nav {
  position: absolute;
  top: 50%;
  display: none;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  transform: translateY(-50%);
  background: rgba(31, 29, 28, .82);
  border: 0;
  border-radius: 50%;
  color: var(--text);
}
.shots__nav svg { width: 18px; height: 18px; }
.shots__nav:hover { background: var(--panel-2); }
.shots__nav[disabled] { opacity: 0; pointer-events: none; }
.shots__nav--prev { left: 12px; }
.shots__nav--next { right: 12px; }
.js .shots__nav { display: grid; }

/* пусто */
.empty {
  padding: 28px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}
.empty svg { width: 30px; height: 30px; margin: 0 auto 8px; color: #645e57; }
.empty p { margin: 0; }
.empty p + p { margin-top: 6px; }
.empty strong { color: var(--text-2); }

/* ==== help-desk note ==== */
.note {
  position: relative;
  margin: 0 0 22px;
  padding: 14px 18px 14px 22px;
  background: var(--bg);
  border-radius: var(--r-sm);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}
.note::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
}
.note__h {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.note__h svg { width: 15px; height: 15px; }
.note p { margin: 0; }
.note code { padding: .05em .3em; background: var(--panel-2); border-radius: 4px; color: #f3d9b8; }

/* ==== FAQ ==== */
.faq { margin-top: 28px; padding: 22px 16px 8px; }
.faq h2 { margin-bottom: 10px; font-size: 1.3125rem; }
.faq__i { border-bottom: 1px solid var(--line); }
.faq__i:last-child { border-bottom: 0; }
.faq__i summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.faq__i summary:hover { color: var(--accent-hi); }
.faq__i summary::-webkit-details-marker { display: none; }
.faq__i summary::after {
  content: "+";
  flex: 0 0 auto;
  font: 300 24px/1 var(--sans);
  transition: transform .2s;
}
.faq__i[open] summary::after { transform: rotate(45deg); }
.faq__a { padding: 0 0 16px; color: var(--text-2); font-size: 14.5px; line-height: 1.7; }
.faq__a p:last-child { margin-bottom: 0; }

/* ==== боковая колонка программы ==== */
.box {
  margin: 0 0 16px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.box__h { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.side__h {
  margin: 26px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.box--row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding-top: 14px; padding-bottom: 14px; }
.box--row .linkbtn { font-size: 14px; }
.box--upd { color: var(--muted); font-size: 13px; }
.box--upd time { color: var(--accent); }

.specs { margin: 0 0 22px; }
.specs__row + .specs__row { margin-top: 14px; }
.specs dt { color: var(--muted); font-size: 14px; }
.specs dd { margin: 2px 0 0; color: var(--text); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.specs .silicon::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 7px;
  vertical-align: 2px;
  border-radius: 50%;
  background: var(--ok);
}
.acts { display: grid; gap: 12px; }

.glance { width: 100%; border-collapse: collapse; font-size: 13px; }
.glance th, .glance td { padding: 6px 0; border-bottom: 1px solid var(--line-soft); text-align: left; }
.glance th { color: var(--muted); font-weight: 500; }
.glance td { text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.glance tr:last-child > * { border-bottom: 0; }
.glance .y { color: var(--ok); }
.glance .n { color: var(--bad); }

.pop__list { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.pop__i + .pop__i { border-top: 1px solid var(--line-soft); }
.pop__i a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}
.pop__i a:hover { background: var(--hover); color: var(--text); }
.pop__i img { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 8px; }
.pop__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop__ver { flex: 0 0 auto; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font: 400 12px var(--mono); }

/* ==== комментарии ==== */
.cmts { margin-top: 36px; }
.cmts__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.cmts__head h2 { font-size: 1.375rem; }
.cmts__head h2 span { color: var(--muted); font-weight: 500; }
.sort { display: flex; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
.sort button {
  padding: 5px 12px;
  background: none;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.sort button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }

.cform { margin-bottom: 24px; }
.cform > form {
  padding: 18px 20px 16px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.cform__guest {
  margin: 0;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 15px;
}
.cform__guest a { font-weight: 600; }
.cform textarea {
  display: block;
  width: 100%;
  min-height: 72px;
  padding: 4px 0 12px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  resize: vertical;
  font-size: 15px;
  line-height: 1.55;
  outline: 0;
}
.cform textarea::placeholder { color: var(--muted); }
.cform textarea:focus { border-bottom-color: var(--accent); }
.cform__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.cform__hint { margin: 0; color: var(--muted); font-size: 12.5px; }
.cform__err { margin: 8px 0 0; color: var(--bad); font-size: 13px; }
.cform__err:empty { display: none; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cmts__list > .cmt {
  margin-bottom: 24px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
}
.cmt__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 18px 16px 0; }
.cmt__who { flex: 1 1 150px; min-width: 0; line-height: 1.35; }
.cmt__name { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.cmt__name--staff { color: var(--dl); }
.cmt__to { color: var(--muted); font-weight: 500; font-size: 14px; }
.cmt__meta { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.cmt__acts { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; margin-left: auto; }
.cmt__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.cmt__btn svg { width: 18px; height: 18px; }
.cmt__btn:hover { color: var(--text); background: var(--panel-2); }
.cmt__like { font-size: 15px; }
.cmt__like span { font-size: 13px; }
.cmt__like.is-on,
.cmt__like[aria-pressed="true"] { color: var(--bad); }
.cmt__text { padding: 12px 16px 18px; color: var(--text); font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.cmt__text p { margin: 0 0 .5em; }
.cmt__text p:last-child { margin: 0; }
.cmt__mac { margin: 0; padding: 7px 16px 9px; background: rgba(255, 255, 255, .03); color: var(--muted); font-size: 12px; }
.cmt__replies:empty { display: none; }
.cmt__replies .cmt { border-top: 1px solid var(--line-soft); }
.cmt__replies .cmt__top,
.cmt__replies .cmt__text,
.cmt__replies .cmt__mac { padding-left: 34px; }
.cmt--mod { opacity: .55; }
.cmt__rform { margin: 0 16px 18px; }
.cmt__rform textarea { min-height: 60px; }

/* ==== формы (вход, регистрация, настройки) ==== */
.auth {
  max-width: 440px;
  margin: 24px auto 0;
  padding: 28px 22px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.auth h1 { font-size: 1.625rem; margin-bottom: 6px; }
.auth__lead { color: var(--muted); font-size: 14px; }
.auth__alt { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; text-align: center; }

.fld { margin-bottom: 16px; }
.fld label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.fld input {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: var(--panel-2);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 15px;
}
.fld input:focus { border-color: var(--accent); outline: 0; }
.fld--err input { border-color: var(--bad); }
.fld__err { margin: 6px 0 0; color: var(--bad); font-size: 12.5px; }
.fld__hint { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.fld__line { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 13px; }

.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); }
.chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

.alert {
  margin: 0 0 18px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 1.5;
}
.alert--err { background: rgba(239, 100, 80, .13); color: #f5a497; }
.alert--ok { background: rgba(92, 196, 108, .13); color: #9fe0a9; }

/* ==== модалка ==== */
.mdl {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}
.mdl__bg { position: absolute; inset: 0; background: rgba(10, 9, 8, .74); }
.mdl__box {
  position: relative;
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  outline: 0;
}
.mdl--wide .mdl__box { max-width: 1100px; }
.mdl__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 16px 22px;
  border-bottom: 1px solid var(--line);
}
.mdl__title { font-size: 1.125rem; }
.mdl__x {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px; height: 36px;
  padding: 0;
  background: var(--panel-2);
  border: 0;
  border-radius: 9px;
  color: var(--text-2);
}
.mdl__x svg { width: 16px; height: 16px; }
.mdl__x:hover { background: var(--hover); color: var(--text); }
.mdl__body { padding: 20px 22px 24px; overflow-y: auto; font-size: 14.5px; color: var(--text-2); }
.mdl__body img { width: 100%; border-radius: var(--r-sm); }
html.is-locked { overflow: hidden; }

/* без js: «модалки» скачивания — якоря :target */
.sheet { display: none; }
.sheet:target {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 9, 8, .74);
}
.sheet__box {
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--panel);
  border-radius: var(--r);
}
.sheet__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.sheet__head h2 { font-size: 1.125rem; }
.sheet__body { padding: 20px 22px 24px; font-size: 14.5px; color: var(--text-2); }

/* содержимое модалок скачивания */
.steps { margin: 0 0 18px; padding-left: 0; counter-reset: st; list-style: none; }
.steps li {
  position: relative;
  margin-bottom: 10px;
  padding-left: 34px;
  line-height: 1.55;
  counter-increment: st;
}
.steps li::before {
  content: counter(st);
  position: absolute;
  left: 0; top: 0;
  width: 23px; height: 23px;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--accent);
  font: 700 12px/23px var(--mono);
  text-align: center;
}
.steps code { padding: .05em .3em; background: var(--panel-2); border-radius: 4px; color: #f3d9b8; }
.mirrors { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.mirrors__h { margin: 0 0 10px; color: var(--text); font-size: 14px; font-weight: 700; }
.mirrors__h small { color: var(--muted); font-weight: 400; font-family: var(--mono); }
.mirrors__list { display: flex; flex-wrap: wrap; gap: 8px; }
.mirrors__list .btn { flex: 1 1 190px; }
.mirrors__list .btn--dl { min-height: 44px; font-size: 14px; }

.older__i { padding: 14px 0; border-bottom: 1px solid var(--line); }
.older__i:first-child { padding-top: 0; }
.older__i:last-child { border-bottom: 0; }
.older__i h3 { margin: 0 0 10px; font-size: 15px; color: var(--text); overflow-wrap: anywhere; }

/* ==== кнопка «наверх» ==== */
.totop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 16px 80px;
  color: var(--muted);
  font-size: 13px;
}
.totop svg { width: 16px; height: 16px; }
.js .totop {
  position: fixed;
  right: 16px; bottom: 78px;
  z-index: 20;
  justify-content: center;
  width: 44px; height: 44px;
  margin: 0;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.js .totop span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.js .totop.is-on { opacity: 1; visibility: visible; transform: none; }
.js .totop:hover { background: var(--accent); color: var(--accent-ink); }

/* ==== страницы: программа ==== */
.prog { display: grid; gap: 20px; }
.prog__head { display: flex; align-items: center; gap: 16px; min-width: 0; }
.prog__ico { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 15px; }
.prog__title { min-width: 0; }
.prog__title h1 { font-size: 1.625rem; overflow-wrap: anywhere; }
.prog__title h1 .mono { font-size: .8em; font-weight: 500; color: var(--text-2); }
.prog__sub { margin: 4px 0 0; color: var(--accent); font-size: 15px; }
.prog__body { min-width: 0; }
.prog__side { min-width: 0; }

.more { margin-top: 36px; }

/* ==== профиль ==== */
.acc__head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.acc__head h1 { overflow-wrap: anywhere; }
.acc__head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.acc__tabs { display: flex; gap: 26px; margin-bottom: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.acc__tabs a {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 0 13px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}
.acc__tabs a:hover { color: var(--text-2); }
.acc__tabs a[aria-current] { color: var(--text); }
.acc__tabs a[aria-current]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}
.acc__tabs .badge { background: var(--dl); color: #2b1602; }
.acc__form { max-width: 480px; padding: 24px 22px; }
.acc__form fieldset { margin: 0 0 22px; padding: 0; border: 0; }
.acc__form legend { margin-bottom: 12px; font-size: 16px; font-weight: 700; }

.ntf--page { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); max-height: none; }
.ntf--page .ntf__i a { padding: 14px 18px 14px 34px; font-size: 14.5px; }
.ntf--page .ntf__i.is-new::before { left: 15px; top: 21px; }

.mycm__i { padding: 16px 18px; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); }
.mycm__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; font-size: 13px; }
.mycm__top a { font-weight: 600; font-size: 14px; }
.mycm__top time { color: var(--muted); }
.mycm__i p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }

/* ==== справка: оглавление ==== */
.doc { display: grid; gap: 24px; }
.doc > * { min-width: 0; }
.toc { padding: 16px 18px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); font-size: 14px; }
.toc h2 { margin-bottom: 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.toc ol { counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: block; padding: 4px 0; color: var(--text-2); }
.toc a::before { content: counter(t) ". "; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.toc a:hover { color: var(--accent); }
.doc__meta { margin: 6px 0 22px; color: var(--muted); font-size: 13px; }

/* ==== ошибки 404/500 ==== */
.err { max-width: 640px; margin: 30px auto 0; text-align: center; }
.err__code {
  margin: 0 0 4px;
  color: var(--accent);
  font: 700 72px/1 var(--mono);
  letter-spacing: -.04em;
}
.err h1 { margin-bottom: 12px; }
.err p { color: var(--text-2); }
.err .srch { margin: 24px auto; }
.err__cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }

/* ==== медиа ==== */
@media (min-width: 600px) {
  .page { padding: 18px 24px 56px; }
  .bar { padding: 14px 24px; }
  .usr__name { display: block; }
  .bell__drop { right: 0; }
  .intro { padding: 32px 36px; }
  .foot { padding-left: 24px; padding-right: 24px; }
  .auth { padding: 32px 34px; }
  .tabs, .faq { padding-left: 24px; padding-right: 24px; }
  .cmt__top { padding: 22px 24px 0; }
  .cmt__text { padding: 14px 24px 22px; }
  .cmt__mac { padding-left: 24px; padding-right: 24px; }
  .cmt__replies .cmt__top { padding-left: 48px; }
  .cmt__replies .cmt__text,
  .cmt__replies .cmt__mac { padding-left: 102px; }
  .cmt__rform { margin: 0 24px 22px; }
  .prog__title h1 { font-size: 1.875rem; }

  /* сетка плиток — отдельные карточки */
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    background: none;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }
  .grid > li + li { border-top: 0; }
  .tile {
    align-items: flex-start;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
  }
  .tile__ico { flex-basis: 56px; width: 56px; height: 56px; border-radius: 13px; }
}

@media (max-width: 1023.98px) {
  body { padding-bottom: 62px; }

  /* меню выезжает слева (только с js) */
  .js .side {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    width: 272px;
    max-width: 86vw;
    overflow-y: auto;
    border-right: 1px solid var(--line-soft);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .25s ease, visibility .25s;
  }
  .js .side.is-open { transform: none; visibility: visible; box-shadow: 10px 0 40px rgba(0, 0, 0, .5); }
  .js .side .logo { display: inline-flex; }
  html.nav-open body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(10, 9, 8, .6);
  }

  /* без js: меню лентой под шапкой */
  .no-js .side { padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
  .no-js .nav ul { display: flex; flex-wrap: wrap; gap: 4px; }
  .no-js .nav li + li { margin-top: 0; }
  .no-js .nav--sub { margin-top: 6px; padding-top: 6px; }
  .no-js .nav__a { min-height: 0; padding: 6px 10px; }
  .no-js .favs, .no-js .side__tag, .no-js .nav__n { display: none; }

  /* программа: кнопки скачивания сразу под заголовком, характеристики ниже,
     «популярное» и glance — после статьи */
  .prog__side { display: contents; }
  .prog__side > .box { margin: 0; }
  .prog__body { order: 2; }
  .box--late { order: 3; }
  .pop .side__h { margin-top: 0; }
  .box--main { display: flex; flex-direction: column; gap: 16px; }
  .box--main .acts { order: -1; }
  .box--main .specs { margin: 0; }
  .specs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .specs__row + .specs__row { margin-top: 0; }
}

@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--side-w) minmax(0, 1240px) minmax(0, 1fr);
    align-items: start;
  }
  .hdr { display: contents; }
  .bar {
    position: static;
    grid-column: 3;
    grid-row: 1;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "srch usr";
    gap: 24px;
    padding: 30px 40px 6px;
  }
  .page,
  .foot { grid-column: 3; }
  .page { grid-row: 2; }
  .foot { grid-row: 3; }
  .page { width: 100%; }
  .bar .logo, .dock { display: none; }
  .side {
    position: sticky;
    top: 0;
    grid-column: 2;
    grid-row: 1 / span 8;
    align-self: start;
    z-index: 35;
    width: var(--side-w);
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    border-right: 1px solid var(--line-soft);
  }
  .side .logo { display: inline-flex; }
  .srch input { height: 50px; }
  .page { padding: 26px 40px 64px; }
  .foot { padding-left: 40px; padding-right: 40px; }
  .foot__in { margin-inline: auto; }
  .totop { margin-bottom: 24px; }
  .js .totop { bottom: 24px; right: 24px; }

  .prog {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: auto 1fr;
    gap: 26px 32px;
    align-items: start;
  }
  .prog__side { grid-column: 2; grid-row: 1 / span 2; }
  .prog__head, .prog__body { grid-column: 1; }
  .prog__title h1 { font-size: 2rem; }

  .doc { grid-template-columns: minmax(0, 1fr) 240px; }
  .doc .toc { grid-column: 2; grid-row: 1; position: sticky; top: 24px; align-self: start; }
  .doc__main { grid-column: 1; grid-row: 1; }
  .intro { padding: 38px 40px; }
  .intro h1 { font-size: 2rem; }
}

@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 24px; }
  .more .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* safari: иначе прыгает колонка при открытой модалке */
.is-locked .prog__side { position: static; }

/* ==== доработки конкретных страниц ==== */
.p-home .sec:first-of-type { margin-top: 30px; }
.p-cat .intro { padding-top: 22px; padding-bottom: 22px; }
.p-cat .intro h1 { font-size: 1.625rem; }
.p-cat .cat__count { color: var(--muted); font-weight: 500; margin-left: 4px; }
.p-prog .shots-empty { margin-bottom: 20px; }
.p-err .err .srch input { background: var(--panel); }

/* форма DMCA: textarea как поля, переключатели и галочки — обычного размера */
.fld textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 15px;
  resize: vertical;
}
.fld textarea:focus { border-color: var(--accent); outline: 0; }
.fld--err textarea { border-color: var(--bad); }
.fld .chk { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text); margin: 0 0 10px; }
.fld .chk input { display: inline-block; width: auto; height: auto; margin-top: 3px; flex: 0 0 auto; }
#notice { max-width: 640px; margin-top: 36px; }

/* главная: наверху H1 и одна фраза, сразу каталог; полный текст — внизу */
.intro--top { padding-top: 18px; padding-bottom: 18px; margin-bottom: 18px; }
.intro--top h1 { margin-bottom: 6px; }
.intro__lede { margin: 0; color: var(--muted); max-width: 52rem; }
.intro--about { margin-top: 32px; }
.intro--about h2 { margin: 0 0 12px; font-size: 1.375rem; }

/* сеть: вход заметный, одной высоты с поиском */
.usr__in { height: 46px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 0 18px; }
.usr__in svg { color: currentColor; }
.usr__in:hover { background: var(--accent-hi); color: var(--accent-ink); }
.acts .btn { min-height: 50px; }
.acts .fav-btn { margin-top: 0; }

/* сеть: популярное на главной */
.hot__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
.hot__item { display: grid; grid-template-columns: 28px 52px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-sm); color: var(--text); text-decoration: none; }
.hot__item:hover { border-color: var(--accent); }
.hot__n { font-size: 22px; font-weight: 800; color: var(--accent); text-align: center; }
.hot__item img { width: 52px; height: 52px; border-radius: 12px; }
.hot__copy { min-width: 0; display: grid; gap: 2px; }
.hot__copy small { color: var(--muted); font-size: 12.5px; }
.hot__copy em { font-style: normal; color: var(--muted); font-size: 13.5px; line-height: 1.35; }
@media (min-width: 760px) { .hot__list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .hot__list { grid-template-columns: 1fr 1fr 1fr; } }

/* сеть: скриншоты как «истории» — полоски-сегменты, тап слева/справа, автолистание 5 с */
.story { margin: 0 0 18px; outline-offset: 4px; }
.story__bars { display: flex; gap: 4px; margin-bottom: 8px; }
.story__bars span { flex: 1; height: 4px; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.story__bars i { display: block; height: 100%; width: 0; background: var(--accent); }
.story__bars span.is-done i { width: 100%; }
.story__bars span.is-run i { animation: story-run 5s linear forwards; }
.story.is-paused .story__bars span.is-run i { animation-play-state: paused; }
@keyframes story-run { to { width: 100%; } }
.story__view { position: relative; border-radius: var(--r-sm); overflow: hidden; background: var(--panel); border: 1px solid var(--line-soft); }
.story__view img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: contain; }
.story__hit { position: absolute; top: 0; bottom: 0; width: 34%; border: 0; background: transparent; cursor: pointer; }
.story__hit--l { left: 0; cursor: w-resize; }
.story__hit--r { right: 0; cursor: e-resize; }
.story__hit:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.story__zoom { position: absolute; right: 10px; bottom: 10px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12.5px; font-weight: 600; cursor: zoom-in; }
.story__cap { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .story__bars span.is-run i { animation: none; width: 100%; } }
.story__bars span { height: 5px; background: rgba(255, 255, 255, .16); }
.hot__ph { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: var(--hover); color: var(--text); font-size: 20px; }

/* сеть: шапка с поиском липнет на всех ширинах */
@media (max-width: 1023px) { .hdr { position: sticky; top: 0; z-index: 30; } .bar { position: static; } }
@media (min-width: 1024px) { .bar { position: sticky; top: 0; z-index: 30; background: var(--bg, #1b1b1b); padding-bottom: 10px; } }
