/* McTorrent — main.css
   Порядок: шрифты и переменные → сброс → типографика → раскладка → шапка → карточки →
   страница программы → формы и аккаунт → подвал → медиазапросы → доработки страниц. */

/* ===== шрифты ===== */
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/ibm-plex-serif-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif";
  src: url("../fonts/ibm-plex-serif-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --concrete: #eff1f3;
  --concrete-2: #e3e6e9;
  --graphite: #1e2428;
  --slate: #59636a;
  --rule: #d2d5d8;
  --rule-2: #9a9ea3;
  --permit: #1f436f;
  --permit-dark: #173457;
  --permit-tint: #e3e8ef;
  --err: #a3341f;
  --head: "IBM Plex Serif", Georgia, serif;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  --gut: 16px;
}

/* ===== сброс ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; } /* под липкой шапкой */
body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font: 16px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--permit); text-underline-offset: 3px; }
a:hover { color: var(--permit-dark); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--graphite); outline-offset: 2px; }

.ws-sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ws-skip {
  position: absolute;
  left: 12px; top: -80px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--graphite);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 6px 6px;
}
.ws-skip:focus { top: 0; color: #fff; }

/* ===== типографика ===== */
h1, h2 { font-family: var(--head); font-weight: 600; line-height: 1.2; letter-spacing: -0.005em; }
.ws-num, .ws-entry__ver, .ws-unit__ver, .ws-size, time { font-variant-numeric: tabular-nums; }
kbd {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--rule-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 600 0.94em/1.5 var(--ui);
  background: var(--paper);
}

/* ===== раскладка ===== */
.ws-wrap {
  width: 100%;
  max-width: 1248px;
  margin-inline: auto;
  padding-inline: var(--gut);
}
main { display: block; padding-bottom: 24px; }
main:focus { outline: none; }

/* ===== шапка ===== */
.ws-mast {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.ws-mast__in {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  grid-template-areas: "logo who who burger" "find find find find";
  align-items: center;
  gap: 12px;
  padding-block: 12px;
}
.ws-logo {
  grid-area: logo;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--graphite);
  text-decoration: none;
}
.ws-logo:hover { color: var(--graphite); }
.ws-logo__word { font: 700 22px/1 var(--head); letter-spacing: -0.01em; }

.ws-find {
  grid-area: find;
  display: flex;
  align-items: center;
  height: 44px; /* одна высота с Sign in, колокольчиком и бургером */
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  background: var(--paper);
  overflow: hidden;
}
.ws-find:focus-within { border-color: var(--permit); box-shadow: 0 0 0 3px var(--permit-tint); }
.ws-find > .ws-i { flex: none; margin-left: 12px; color: var(--slate); }
.ws-find__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-size: 16px;
}
.ws-find__input:focus { outline: none; }
.ws-find__input::placeholder { color: var(--slate); opacity: 1; }
.ws-find__go {
  flex: none;
  height: 100%;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--rule-2);
  background: var(--concrete);
  font-size: 15px;
  font-weight: 600;
}
.ws-find__go:hover { background: var(--concrete-2); }

.ws-who { grid-area: who; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ws-who__in {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--permit);
  border-radius: 6px;
  background: var(--permit);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.ws-who__in:hover { background: var(--permit-dark); border-color: var(--permit-dark); color: #fff; }
.ws-who__me { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--graphite); text-decoration: none; font-weight: 600; font-size: 15px; }
.ws-who__name, .ws-who__out { display: none; }
.ws-who__out { align-items: center; height: 44px; padding: 0 4px; color: var(--slate); font-size: 15px; }

.ws-bell { position: relative; }
.ws-bell__btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
}
.ws-bell__n {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 22px;
  padding: 0 5px;
  border: 2px solid var(--paper);
  border-radius: 11px;
  background: var(--permit);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
}
.ws-bell__drop {
  position: absolute;
  right: -60px; top: 54px;
  z-index: 100;
  width: min(360px, calc(100vw - 32px));
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(30, 36, 40, 0.16);
}
.ws-bell__list { list-style: none; }
.ws-bell__list li { padding: 12px 16px; border-bottom: 1px solid var(--rule); font-size: 15px; }
.ws-bell__list li.is-new { background: var(--permit-tint); }
.ws-bell__list a { color: var(--graphite); text-decoration: none; }
.ws-bell__list time { display: block; color: var(--slate); font-size: 13px; }
.ws-bell__all { display: block; padding: 12px 16px; font-weight: 600; text-decoration: none; }

.ws-burger {
  grid-area: burger;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
}

/* полоса рубрик */
.ws-rubrics { background: var(--concrete); border-bottom: 1px solid var(--rule); }
.ws-rubrics__list {
  display: flex;
  gap: 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.ws-rubrics__list::-webkit-scrollbar { display: none; }
.ws-rubrics__a {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 12px;
  color: var(--graphite);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.ws-rubrics__a:hover { color: var(--permit); background: var(--concrete-2); }
.ws-rubrics__a.is-on { color: var(--permit-dark); box-shadow: inset 0 -3px 0 var(--permit); background: var(--paper); }
.ws-rubrics__n { color: var(--slate); font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; }

.ws-drawer { max-height: calc(100vh - 130px); overflow-y: auto; border-top: 1px solid var(--rule); background: var(--paper); padding: 8px var(--gut) 16px; }
.ws-drawer__list { display: grid; grid-template-columns: 1fr 1fr; list-style: none; }
.ws-drawer__list a { display: block; padding: 12px 0; color: var(--graphite); font-weight: 600; text-decoration: none; }
.ws-drawer__list--small { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.ws-drawer__list--small a { color: var(--slate); font-weight: 400; }

/* крошки */
.ws-crumbs { padding-top: 16px; }
.ws-crumbs ol { display: flex; flex-wrap: wrap; list-style: none; font-size: 15px; color: var(--slate); }
.ws-crumbs li + li::before { content: "\203A"; margin: 0 8px; color: var(--rule-2); }
.ws-crumbs a { display: inline-block; padding: 4px 0; min-width: 24px; }

/* ===== главная: вступление ===== */
.ws-lead { display: grid; gap: 20px; padding: 24px 0 20px; }
.ws-lead__title { font-size: 28px; margin-bottom: 12px; }
.ws-lead__text p { font-size: 17px; color: #3a4247; }
.ws-lead__text p + p { margin-top: 8px; }
.ws-author { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--rule); border-radius: 6px; }
.ws-author__name { font-weight: 700; }
.ws-author__bio { color: var(--slate); font-size: 15px; }
.ws-author__log { margin-top: 6px; font-size: 14px; color: var(--permit-dark); font-weight: 600; }
.ws-ava {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--concrete-2);
  color: var(--graphite);
  font-size: 14px;
  font-weight: 700;
}
.ws-ava--lg { width: 48px; height: 48px; font-size: 16px; background: var(--permit); color: #fff; }
.ws-ava--xl { width: 72px; height: 72px; font-size: 24px; }

/* заголовок секции */
.ws-shelf, .ws-feed { margin-top: 32px; }
.ws-shelf__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--graphite);
}
.ws-shelf__title { font-size: 22px; }
.ws-shelf__count { color: var(--slate); font-size: 14px; }
.ws-shelf__more {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-left: auto;
  font-size: 15px;
  font-weight: 600;
}
.ws-shelf .ws-units { margin-top: 16px; }

/* ===== строка программы ===== */
.ws-entry {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 4px 14px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--rule);
  color: var(--graphite);
  text-decoration: none;
}
.ws-entry:hover { background: var(--concrete); color: var(--graphite); }
.ws-entry:hover .ws-entry__name { color: var(--permit-dark); text-decoration: underline; text-decoration-thickness: 1px; }
.ws-entry__ic { grid-row: span 2; width: 56px; height: 56px; }
.ws-entry__main { min-width: 0; }
.ws-entry__name { font-size: 17px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.ws-entry__ver { margin-left: 6px; color: var(--slate); font-size: 15px; overflow-wrap: anywhere; }
.ws-entry__sum {
  display: -webkit-box;
  margin-top: 2px;
  color: var(--slate);
  font-size: 15px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ws-entry__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; color: var(--slate); }
.ws-entry__when { font-size: 13px; }
/* сборка только под Intel */
.ws-arch {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid var(--rule-2);
  border-radius: 3px;
  color: var(--graphite);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: 1px;
}
.ws-app__sub .ws-arch { margin-left: 0; }
/* программа без иконки: заглушка того же размера, сетка не едет */
.ws-noic {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--concrete-2);
  color: var(--slate);
  font: 700 20px/1 var(--head);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.ws-unit .ws-noic { background: var(--paper); }
.ws-app__ic.ws-noic { width: 64px; height: 64px; border-radius: 14px; font-size: 24px; }
.ws-pop__ic.ws-noic { width: 32px; height: 32px; border-radius: 8px; font-size: 13px; }
.ws-size {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--rule-2);
  border-radius: 3px;
  color: var(--graphite);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.ws-fresh {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--permit-tint);
  color: var(--permit-dark);
  font-size: 13px;
  font-weight: 700;
  vertical-align: 1px;
}

/* плитка программы */
.ws-units { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ws-unit {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  grid-template-areas: "ic name name" "ic ver size";
  align-items: center;
  gap: 2px 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--concrete);
  color: var(--graphite);
  text-decoration: none;
}
.ws-unit:hover { background: var(--concrete-2); color: var(--graphite); }
.ws-unit__ic { grid-area: ic; width: 56px; height: 56px; }
.ws-unit__name { grid-area: name; align-self: end; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.ws-unit__ver { grid-area: ver; align-self: start; color: var(--slate); font-size: 14px; overflow-wrap: anywhere; }
.ws-unit .ws-size { grid-area: size; align-self: start; background: var(--paper); }

/* рубрика: ведомость */
.ws-cat__head { padding: 12px 0 8px; }
.ws-cat__title { font-size: 28px; margin-bottom: 10px; }
.ws-cat__intro { font-size: 17px; color: #3a4247; }
.ws-cat__count { margin-top: 10px; color: var(--slate); font-size: 15px; }
.ws-ledger { margin-top: 20px; border-top: 2px solid var(--graphite); }
.ws-ledger__cols { display: none; }

.ws-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 32px 0 8px; }
.ws-pager__list { display: flex; gap: 6px; list-style: none; }
.ws-pager a, .ws-pager__gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px; height: 44px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--graphite);
  font-weight: 600;
  text-decoration: none;
}
.ws-pager__gap { border-color: transparent; color: var(--slate); }
.ws-pager a:hover { border-color: var(--graphite); }
.ws-pager a.is-on { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.ws-pager__step { padding: 0 14px !important; }

/* поиск: ничего не найдено */
.ws-none { max-width: 760px; margin-top: 40px; padding: 22px 20px 8px; border: 1px dashed var(--rule-2); border-radius: 6px; }
.ws-none__title { font-size: 22px; overflow-wrap: anywhere; }
.ws-none__text { margin-top: 8px; color: #3a4247; font-size: 17px; }
.ws-none__tips { margin-top: 12px; padding-left: 1.3em; font-size: 16px; }
.ws-none__tips li + li { margin-top: 4px; }
.ws-none__tips li::marker { color: var(--permit); }
.ws-none__tips a { display: inline-block; padding: 2px 0; }
.ws-none__sub { margin: 20px 0 10px; font: 700 17px/1.3 var(--ui); }

/* ===== страница программы ===== */
.ws-prog__top { display: grid; gap: 24px; padding-top: 16px; }
.ws-app { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: start; }
.ws-app__ic { width: 64px; height: 64px; }
.ws-app__title { font-size: 28px; overflow-wrap: anywhere; }
.ws-app__sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; color: var(--slate); font-size: 15px; }
.ws-app__rub {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--permit);
  border-radius: 3px;
  font-weight: 600;
  text-decoration: none;
}
.ws-app__rub:hover { background: var(--permit-tint); }
.ws-app__line { margin-top: 10px; font-size: 17px; color: #3a4247; }
.ws-app__acts { grid-column: 1 / -1; }
.ws-dl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 24px;
  border-radius: 6px;
  background: var(--permit);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.ws-dl:hover { background: var(--permit-dark); color: #fff; }
.ws-dl:active { transform: translateY(1px); }
.ws-dl__size { font-weight: 400; opacity: 0.9; }
.ws-app__more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ws-app__more .ws-act { flex: 1 1 0; justify-content: center; padding: 0 10px; white-space: nowrap; }
.ws-lead .ws-author { display: none; }
.ws-act {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  background: var(--paper);
  color: var(--graphite);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.ws-act:hover { border-color: var(--graphite); color: var(--graphite); }
.ws-act.is-on, .ws-act--fav[aria-pressed="true"] { border-color: var(--permit); background: var(--permit-tint); color: var(--permit-dark); }
.ws-act.is-on .ws-i, .ws-act--fav[aria-pressed="true"] .ws-i { fill: currentColor; }

/* штамп чертежа — характеристики */
.ws-tb { border: 2px solid var(--graphite); background: var(--paper); align-self: start; }
.ws-tb__sheet {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 14px;
  border-bottom: 2px solid var(--graphite);
  font: 600 18px/1.3 var(--head);
}
.ws-tb__no { font: 600 14px/1 var(--ui); color: var(--slate); font-variant-numeric: tabular-nums; }
.ws-tb__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule-2); }
.ws-tb__cell { padding: 8px 14px 10px; background: var(--paper); min-width: 0; }
.ws-tb__cell--wide { grid-column: 1 / -1; }
.ws-tb__k { color: var(--slate); font-size: 13px; line-height: 1.4; }
.ws-tb__v { font-size: 16px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.ws-tb__check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 14px;
  border-top: 2px solid var(--graphite);
  background: var(--permit-tint);
  color: var(--permit-dark);
  font-size: 14px;
  font-weight: 600;
}
.ws-tb__check .ws-i { flex: none; margin-top: 1px; }

/* скриншоты */
.ws-shots { margin-top: 36px; }
.ws-shots__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ws-shots__title { font-size: 22px; }
.ws-shots__nav { display: flex; gap: 8px; }
.ws-shots__btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  background: var(--paper);
}
.ws-shots__btn:hover:not(:disabled) { border-color: var(--graphite); }
.ws-shots__btn:disabled { opacity: 0.4; cursor: default; }
.ws-shots__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 86%;
  gap: 12px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.ws-shots__track::-webkit-scrollbar { display: none; }
.ws-shots__item { scroll-snap-align: start; }
.ws-shots__item a { display: block; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.ws-shots__item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
/* один скриншот: без стрелок, на ширину колонки текста */
.ws-shots--one .ws-shots__track { grid-auto-columns: 100%; max-width: 760px; overflow: visible; }

/* тело: статья + боковая */
.ws-prog__body { display: grid; gap: 32px; margin-top: 36px; }
.ws-prog__main { min-width: 0; }
.ws-prog__side { display: none; }

.ws-tabs__bar { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 2px solid var(--rule); }
.ws-tabs__btn {
  flex: none;
  height: 48px;
  padding: 0 16px;
  border: 0;
  background: none;
  color: var(--slate);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: -2px;
}
.ws-tabs__btn:hover { color: var(--graphite); }
.ws-tabs__btn[aria-selected="true"] { color: var(--graphite); box-shadow: inset 0 -3px 0 var(--permit); }
.ws-tabs__panel { padding-top: 20px; }

/* длинный текст */
.ws-prose { max-width: 68ch; font-size: 17px; line-height: 1.7; }
.ws-prose > * + * { margin-top: 1em; }
.ws-prose h2 { margin-top: 1.9em; font-size: 24px; scroll-margin-top: 16px; }
.ws-prose h3 { margin-top: 1.6em; font: 700 19px/1.35 var(--ui); }
.ws-prose h2 + *, .ws-prose h3 + * { margin-top: 0.5em; }
.ws-prose ul, .ws-prose ol { padding-left: 1.4em; }
.ws-prose li + li { margin-top: 0.35em; }
.ws-prose li::marker { color: var(--permit); }
.ws-prose__lead { font-size: 19px; color: #3a4247; }
.ws-prose code, .ws-prose pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.94em;
  background: var(--concrete);
  border-radius: 3px;
}
.ws-prose code { padding: 1px 5px; }
.ws-prose pre { padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
.ws-prose pre code { padding: 0; background: none; }
.ws-prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
.ws-prose caption { padding-bottom: 8px; text-align: left; color: var(--slate); font-size: 15px; }
.ws-prose th, .ws-prose td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.ws-prose thead th { border-bottom: 2px solid var(--graphite); font-weight: 700; }
.ws-prose tbody th { font-weight: 600; white-space: nowrap; }

/* оглавление */
.ws-toc { padding-left: 16px; border-left: 2px solid var(--graphite); }
.ws-toc__title { font-size: 18px; margin-bottom: 6px; }
.ws-toc__list { list-style: none; counter-reset: toc; }
.ws-toc__list a {
  display: block;
  padding: 6px 0;
  color: var(--graphite);
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
}
.ws-toc__list a:hover { color: var(--permit-dark); text-decoration: underline; }
.ws-toc--inline { margin: 20px 0 28px; }
.ws-author--side { margin-top: 28px; }

/* FAQ */
.ws-faq { margin-top: 44px; max-width: 68ch; }
.ws-faq__title { font-size: 22px; margin-bottom: 8px; }
.ws-faq__item { border-top: 1px solid var(--rule); }
.ws-faq__item:last-child { border-bottom: 1px solid var(--rule); }
.ws-faq__item summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  font-size: 17px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.ws-faq__item summary::-webkit-details-marker { display: none; }
.ws-faq__item summary::after {
  content: "+";
  flex: none;
  width: 24px;
  color: var(--permit);
  font-size: 22px;
  line-height: 1;
  text-align: center;
  transition: transform 0.18s ease-out;
}
.ws-faq__item[open] summary::after { transform: rotate(45deg); }
.ws-faq__item p { padding: 0 0 16px; color: #3a4247; font-size: 17px; line-height: 1.65; }

/* комментарии */
.ws-talk { margin-top: 44px; max-width: 760px; scroll-margin-top: 16px; }
.ws-talk__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--graphite); }
.ws-talk__title { font-size: 22px; }
.ws-talk__n { color: var(--slate); font: 400 18px var(--ui); }
.ws-talk__sort { display: flex; border: 1px solid var(--rule-2); border-radius: 6px; overflow: hidden; }
.ws-talk__sortbtn { height: 38px; padding: 0 14px; border: 0; background: var(--paper); font-size: 15px; font-weight: 600; color: var(--slate); }
.ws-talk__sortbtn + .ws-talk__sortbtn { border-left: 1px solid var(--rule-2); }
.ws-talk__sortbtn.is-on { background: var(--graphite); color: #fff; }
.ws-talk__form { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.ws-talk__guest { font-size: 16px; }
.ws-talk__item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.ws-talk__replies .ws-talk__item { border-bottom: 0; padding-bottom: 0; }
.ws-talk__replies:not(:empty) { margin-top: 6px; padding-left: 16px; border-left: 2px solid var(--rule); }
.ws-talk__who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.ws-talk__who time { color: var(--slate); font-size: 14px; }
.ws-talk__body > p { font-size: 16px; line-height: 1.6; }
.ws-talk__acts { display: flex; gap: 6px; margin-top: 8px; }
.ws-talk__like, .ws-talk__reply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--slate);
  font-size: 15px;
  font-weight: 600;
}
.ws-talk__like:hover, .ws-talk__reply:hover { border-color: var(--rule-2); color: var(--graphite); }
.ws-talk__like.is-on { color: var(--err); }
.ws-talk__like.is-on .ws-i { fill: currentColor; }
.ws-talk__item.is-pending { opacity: 0.65; }
.ws-talk__empty { padding: 20px 0; color: var(--slate); }
.ws-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  background: #fbeedd;
  color: #7f4600;
  font-size: 13px;
  font-weight: 700;
}
.ws-badge--off { background: #f8e4df; color: var(--err); }

.ws-cform__label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.ws-cform__text {
  display: block;
  width: 100%;
  min-height: 112px;
  padding: 10px 12px;
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}
.ws-cform__text:focus { outline: none; border-color: var(--permit); box-shadow: 0 0 0 3px var(--permit-tint); }
.ws-cform__err { margin-top: 8px; color: var(--err); font-size: 15px; }
.ws-cform__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.ws-cform__hint { color: var(--slate); font-size: 14px; }
.ws-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ws-trap input { opacity: 0; }

/* пустые состояния */
.ws-nothing {
  padding: 18px 20px;
  border: 1px dashed var(--rule-2);
  border-radius: 6px;
  color: var(--slate);
  font-size: 16px;
}
.ws-nothing--shots { margin-top: 32px; max-width: 760px; }

/* ===== модалка ===== */
.ws-dialog { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; }
.ws-dialog__bg { position: absolute; inset: 0; background: rgba(30, 36, 40, 0.55); }
.ws-dialog__box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px 22px 24px;
  border-top: 4px solid var(--permit);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(30, 36, 40, 0.3);
  animation: lift 0.2s ease-out;
}
@keyframes lift { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ws-dialog__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.ws-dialog__title { font-size: 22px; padding-top: 6px; }
.ws-dialog__x {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin: -4px -8px 0 0;
  border: 0;
  border-radius: 6px;
  background: none;
}
.ws-dialog__x:hover { background: var(--concrete); }
.ws-dialog__body > p + p { margin-top: 10px; }
.ws-dialog__help { margin-top: 16px; font-size: 15px; color: var(--slate); }

.ws-steps { list-style: none; counter-reset: step; margin-bottom: 18px; }
.ws-steps li { position: relative; padding: 4px 0 10px 40px; counter-increment: step; }
.ws-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 2px;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border: 2px solid var(--graphite);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
}
.ws-build { margin-top: 10px; padding: 14px; border: 1px solid var(--rule); border-radius: 6px; }
.ws-build__name { font-weight: 700; }
.ws-build__meta { display: block; color: var(--slate); font-size: 14px; font-weight: 400; }
.ws-build__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ws-mirror {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  color: var(--graphite);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.ws-mirror:hover { border-color: var(--graphite); color: var(--graphite); }
.ws-mirror--main { border-color: var(--permit); background: var(--permit); color: #fff; }
.ws-mirror--main:hover { background: var(--permit-dark); color: #fff; }

/* ===== формы, вход, аккаунт ===== */
.ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 6px;
  background: var(--permit);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}
.ws-btn:hover { background: var(--permit-dark); }
.ws-btn--wide { width: 100%; }

.ws-auth { padding-top: 32px; }
.ws-auth__box { max-width: 440px; margin: 0 auto; padding: 24px 20px; border: 1px solid var(--rule); border-top: 4px solid var(--graphite); border-radius: 6px; }
.ws-auth__title { font-size: 26px; margin-bottom: 18px; }
.ws-auth__foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 15px; }
.ws-form { display: grid; gap: 16px; }
.ws-form__err, .ws-form__ok { padding: 12px 14px; border-left: 3px solid var(--err); background: #fbece8; color: var(--err); font-size: 15px; }
.ws-form__ok { display: flex; align-items: center; gap: 8px; border-left-color: var(--permit); background: var(--permit-tint); color: var(--permit-dark); margin-bottom: 16px; }
.ws-form__alt { font-size: 15px; }
.ws-field__label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.ws-field__input {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  font-size: 16px;
}
.ws-field__input:focus { outline: none; border-color: var(--permit); box-shadow: 0 0 0 3px var(--permit-tint); }
.ws-field__input[aria-invalid="true"] { border-color: var(--err); }
.ws-field__hint { margin-top: 4px; color: var(--slate); font-size: 14px; }
.ws-field__err { margin-top: 4px; color: var(--err); font-size: 14px; font-weight: 600; }
.ws-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.ws-check input { width: 24px; height: 24px; margin: 0; accent-color: var(--permit); }

.ws-acct__head { display: flex; align-items: center; gap: 18px; padding: 28px 0 20px; }
.ws-acct__title { font-size: 26px; }
.ws-acct__since { color: var(--slate); font-size: 15px; }
.ws-acct__tabs { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 2px solid var(--rule); }
.ws-acct__tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 16px;
  margin-bottom: -2px;
  color: var(--slate);
  font-weight: 600;
  text-decoration: none;
}
.ws-acct__tab:hover { color: var(--graphite); }
.ws-acct__tab.is-on { color: var(--graphite); box-shadow: inset 0 -3px 0 var(--permit); }
.ws-acct__panel { padding-top: 24px; }
.ws-acct__panel > .ws-nothing { margin-top: 16px; }
.ws-notes { list-style: none; max-width: 760px; }
.ws-notes__item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.ws-notes__item a { color: var(--graphite); text-decoration: none; }
.ws-notes__item a:hover { color: var(--permit-dark); text-decoration: underline; }
.ws-notes__item.is-new a { font-weight: 700; }
.ws-notes__item.is-new a::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--permit); vertical-align: 2px; }
.ws-notes__item time { color: var(--slate); font-size: 14px; }
.ws-mine { list-style: none; max-width: 760px; }
.ws-mine__item { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.ws-mine__where { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 4px; font-weight: 600; }
.ws-mine__where time { color: var(--slate); font-size: 14px; font-weight: 400; }
.ws-form--settings { max-width: 440px; }

/* служебные страницы и ошибки */
.ws-doc__body { max-width: 760px; padding-top: 16px; }
.ws-doc__title { font-size: 30px; margin-bottom: 18px; }
.ws-oops { max-width: 760px; padding-top: 48px; }
.ws-oops__code { color: var(--permit-dark); font-size: 15px; font-weight: 700; }
.ws-oops__title { margin: 6px 0 12px; font-size: 30px; }
.ws-oops__text { font-size: 18px; color: #3a4247; }
.ws-oops__sub { margin: 32px 0 12px; font-size: 20px; }
.ws-oops__rubs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-bottom: 24px; }
.ws-unit-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--concrete);
  color: var(--graphite);
  font-weight: 600;
  text-decoration: none;
}
.ws-unit-link span { color: var(--slate); font-size: 14px; font-weight: 400; }
.ws-unit-link:hover { background: var(--concrete-2); color: var(--graphite); }
.ws-find--big { display: block; height: auto; margin-top: 24px; border: 0; overflow: visible; }
.ws-find__label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.ws-find__row { display: flex; gap: 8px; }
.ws-find--big .ws-find__input { height: 46px; border: 1px solid var(--rule-2); border-radius: 6px; padding: 0 12px; }
.ws-find--big .ws-find__input:focus { border-color: var(--permit); box-shadow: 0 0 0 3px var(--permit-tint); }

/* ===== подвал ===== */
.ws-foot { margin-top: 56px; padding: 28px 0 32px; background: var(--concrete); border-top: 1px solid var(--rule); }
.ws-foot__in { display: grid; gap: 16px; }
.ws-foot__about { max-width: 52ch; color: #3a4247; font-size: 15px; }
.ws-foot__nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.ws-foot__nav a { display: inline-block; padding: 8px 0; color: var(--graphite); font-size: 15px; font-weight: 600; text-decoration: none; }
.ws-foot__nav a:hover { color: var(--permit-dark); text-decoration: underline; }
.ws-foot__copy { color: var(--slate); font-size: 14px; }

.ws-totop {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--graphite);
  color: #fff;
}

/* ===== медиазапросы ===== */
@media (min-width: 560px) {
  .ws-units { grid-template-columns: 1fr 1fr; }
  .ws-entry { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .ws-entry__ic { grid-row: auto; }
  .ws-entry__meta { flex-direction: column; align-items: flex-end; justify-content: center; gap: 4px; text-align: right; }
}

@media (min-width: 768px) {
  :root { --gut: 24px; }
  html { scroll-padding-top: 90px; }
  .ws-mast__in { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "logo find who burger"; gap: 20px; }
  .ws-who__out { display: inline-flex; }
  .ws-lead .ws-author { display: flex; }
  .ws-app__more .ws-act { flex: none; padding: 0 14px; }
  .ws-lead { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; padding-top: 32px; }
  .ws-lead__title, .ws-cat__title, .ws-app__title { font-size: 34px; }
  .ws-units { grid-template-columns: repeat(3, 1fr); }
  .ws-auth__box { padding: 32px; }
  .ws-foot__in { grid-template-columns: 1fr auto; align-items: start; }
  .ws-foot__copy { grid-column: 1 / -1; }
}

@media (min-width: 1024px) {
  .ws-burger, .ws-drawer { display: none !important; }
  .ws-find { max-width: 620px; }
  .ws-who__name { display: inline; }
  .ws-rubrics__a { padding: 0 14px; font-size: 16px; }
  .ws-lead { grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; }
  .ws-lead__title { font-size: 36px; }
  .ws-feed__list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .ws-units { grid-template-columns: repeat(4, 1fr); }

  .ws-prog__top { grid-template-columns: minmax(0, 1fr) 420px; gap: 48px; align-items: start; }
  .ws-app { grid-template-columns: 64px minmax(0, 1fr); gap: 20px; }
  .ws-app__acts { grid-column: 2; margin-top: 8px; }
  .ws-dl { display: inline-flex; }
  .ws-shots__track { grid-auto-columns: calc((100% - 24px) / 2.4); }
  .ws-prog__body { grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; }
  .ws-prog__body--solo { grid-template-columns: minmax(0, 1fr); }
  .ws-prog__side { display: block; }
  .ws-prog__side .ws-toc { position: sticky; top: 94px; }
  .ws-bell__drop { right: 0; }

  /* ведомость рубрики: колонки */
  .ws-ledger { border-top: 0; }
  .ws-ledger__cols {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 120px 96px 96px;
    gap: 16px;
    padding: 0 8px 8px;
    border-bottom: 2px solid var(--graphite);
    color: var(--slate);
    font-size: 14px;
    font-weight: 600;
  }
  .ws-ledger__cols span:first-child { grid-column: 1 / 3; }
  .ws-ledger .ws-entry { grid-template-columns: 56px minmax(0, 1fr) 120px 96px 96px; gap: 16px; align-items: center; }
  .ws-ledger .ws-entry__meta { display: contents; }
  .ws-ledger .ws-entry__rub { font-size: 15px; color: var(--slate); }
  .ws-ledger .ws-size { justify-self: start; }
  .ws-ledger .ws-entry__when { font-size: 15px; color: var(--slate); }
  .ws-ledger .ws-entry__sum { -webkit-line-clamp: 1; }
}

@media (min-width: 1440px) {
  .ws-shots__track { grid-auto-columns: calc((100% - 24px) / 2.6); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===== доработки страниц ===== */
/* safari: без min-width у колонки ведомости длинная версия «26H1 (25388279)» распирает строку */
.ws-ledger .ws-entry__main { min-width: 0; }
/* главная: у ленты без верхней линии первая строка прилипала к заголовку */
.ws-feed__list { margin-top: 4px; }
.ws-home .ws-shelf { margin-top: 40px; }

/* главная: Popular — лента на телефоне, три колонки с 768 */
.ws-pop { margin-top: 40px; }
.ws-pop__list {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(5, auto);
  grid-auto-columns: 84%;
  column-gap: 24px;
  margin-top: 4px;
  list-style: none;
  counter-reset: pop;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.ws-pop__list::-webkit-scrollbar { display: none; }
.ws-pop__item { counter-increment: pop; scroll-snap-align: start; border-bottom: 1px solid var(--rule); min-width: 0; }
.ws-pop__a {
  display: grid;
  grid-template-columns: 22px 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 6px 8px 0;
  color: var(--graphite);
  text-decoration: none;
}
.ws-pop__a::before { content: counter(pop); color: var(--slate); font: 600 15px/1 var(--head); text-align: right; font-variant-numeric: tabular-nums; }
.ws-pop__a:hover { background: var(--concrete); color: var(--graphite); }
.ws-pop__a:hover .ws-pop__name { color: var(--permit-dark); text-decoration: underline; text-decoration-thickness: 1px; }
.ws-pop__ic { width: 32px; height: 32px; }
.ws-pop__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-pop__ver { color: var(--slate); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* главная: длинный текст о каталоге — после первых блоков программ */
.ws-about { margin-top: 40px; }
.ws-about__title { padding-bottom: 6px; border-bottom: 2px solid var(--graphite); }
.ws-about__text { margin-top: 14px; }

/* DMCA */
.ws-dmca__msg { margin: 24px 0 0; max-width: 640px; }
.ws-form__ok > .ws-i { flex: none; } /* иначе галочка сжимается в точку на длинном тексте */
.ws-dmca { max-width: 640px; margin-top: 28px; gap: 28px; }
.ws-dmca__set { display: grid; gap: 16px; min-width: 0; margin: 0; padding: 0; border: 0; }
.ws-dmca__legend { width: 100%; margin-bottom: 16px; padding: 0 0 6px; border-bottom: 2px solid var(--graphite); font: 600 20px/1.3 var(--head); }
.ws-dmca__two { display: grid; gap: 16px; }
.ws-dmca__send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.ws-field__opt { color: var(--slate); font-weight: 400; }
.ws-field__input--area { height: auto; min-height: 128px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select.ws-field__input { background: var(--paper); }
.ws-check--top { align-items: flex-start; line-height: 1.45; }
.ws-check--top input { flex: none; margin-top: 1px; }

@media (min-width: 768px) {
  .ws-pop__list { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-columns: auto; overflow: visible; }
  .ws-dmca__two { grid-template-columns: 1fr 1fr; }
}

/* ===== сеть: правки после проверки на живых данных (не макет) ===== */
/* иконки программ из базы бывают не квадратными: не растягивать */
img.ws-entry__ic, img.ws-unit__ic, img.ws-pop__ic, img.ws-app__ic { object-fit: contain; }
/* правило владельца: текст программы во всю ширину рабочей колонки (в макете 68ch оставлял пустую полосу до оглавления) */
.ws-prog__main .ws-prose, .ws-prog__main .ws-faq, .ws-prog__main .ws-talk { max-width: none; }

/* программа без иконки: вместо букв — обложка (скриншот), обрезанная в квадрат иконки */
img.is-cover { object-fit: cover; object-position: center top; }
