/* «Кого заденет блокировка адресов VPN»: симулятор, схема и разбор */
:root {
  --accent: #8fcbb5; --meh: #d9c38c; --bad: #e0836f; --line: #2b2e33; --text: #e7e7e4; --text-2: #b7b9b6; --muted: #8c8f8c;
  --surface: #1b1d20; --dot: #464a50;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
/* width: 100% — иначе во flex-колонке с margin: auto main сжимается по содержимому, и широкая таблица распирает страницу */
main { box-sizing: border-box; width: 100%; max-width: 760px; margin: 0 auto; padding: 56px 20px 64px; }
h1 { margin: 0 0 14px; font-size: clamp(32px, 6vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
.lead { margin: 0; color: var(--text-2); font-size: 18px; line-height: 1.55; }
.lead a, .prose a, .disc-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.label { display: block; font: 400 13px/1.6 var(--mono); letter-spacing: 0.02em; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ── Квадратик-человек: общий для симулятора, схемы и подписей ── */
.dot { display: block; aspect-ratio: 1; background: var(--dot); border-radius: 1px; transition: background-color .35s var(--d, 0ms), box-shadow .35s var(--d, 0ms); }
.dot.s-switched { background: var(--accent); }
.dot.s-spare { background: transparent; box-shadow: inset 0 0 0 1.5px var(--meh); }
.dot.s-offline { background: var(--bad); }
.dot.edge, .dot.s-edge { box-shadow: 0 0 0 1.5px var(--bad); }
.dot.s-spare.edge { box-shadow: inset 0 0 0 1.5px var(--meh), 0 0 0 1.5px var(--bad); }
.dot.s-edge { background: var(--dot); }

/* ── Симулятор ── */
.sim { margin: 32px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { min-height: 40px; padding: 0 14px; font: 400 15px/1.2 inherit; font-family: inherit; color: var(--text-2); background: none; border: 1px solid var(--line); cursor: pointer; transition: color .2s, border-color .2s, background-color .2s; -webkit-tap-highlight-color: transparent; }
.chip:active { background: rgba(255, 255, 255, 0.04); }
.chip[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: rgba(143, 203, 181, 0.08); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .chip:not([aria-pressed="true"]):hover { border-color: var(--muted); color: var(--text); }
}
.echo { margin: 16px 0 0; font: 400 13px/1.5 var(--mono); color: var(--muted); }
.echo b { font-weight: 400; color: var(--text-2); }

.heads { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; margin: 16px 0 0; }
.head-name { margin: 0; font-size: 17px; font-weight: 600; }
.head-sub { margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: var(--text-2); min-height: 2.9em; }
.head-off { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 0; }
.head-off .dot { width: 10px; align-self: center; }
.head-off b { min-width: 3ch; font-size: clamp(36px, 8vw, 52px); font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; transition: color .3s; }
.head-off span { color: var(--text-2); font-size: 15px; }
.head.bad .head-off b { color: var(--bad); }
.facts { margin: 12px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); font: 400 13px/1.5 var(--mono); }
.facts div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.facts dt { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.facts dt .dot { width: 10px; flex: none; }
.facts dd { margin: 0; min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }
.facts .facts-sep { display: block; height: 0; padding: 0; margin: 5px 0; border-top: 1px dashed var(--line); }

.captions { display: grid; margin: 20px 0 0; padding: 12px 16px; background: var(--surface); border-left: 2px solid var(--accent); font-size: 16px; line-height: 1.55; }
.captions p { grid-area: 1 / 1; margin: 0; visibility: hidden; }
.captions p.on { visibility: visible; }
.assume { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

.maps-label { margin: 28px 0 0; }
.bodies { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; margin: 10px 0 0; }
.body { min-width: 0; }
.body-name { display: none; }
.group + .group { margin-top: 14px; }
.group-head { margin: 0 0 4px; font: 400 13px/1.6 var(--mono); color: var(--muted); }
.row { display: grid; grid-template-columns: 7.6rem minmax(0, 1fr); align-items: center; gap: 0 10px; min-height: 22px; }
.addr { font: 400 13px/1.6 var(--mono); white-space: nowrap; transition: color .3s; }
.addr .ip-net { color: var(--muted); }
.row.down .addr, .row.down .addr .ip-net { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.dots { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 3px; max-width: 260px; }
.em-note { font: 400 12px/1.6 var(--mono); color: var(--muted); }
.row-em .addr .ip-net, .row-em .addr { color: var(--muted); }
.row-em.down .addr, .row-em.down .addr .ip-net { color: var(--bad); }

@media (max-width: 600px) {
  .sim { margin-top: 28px; padding-top: 20px; }
  .chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .chip { min-height: 48px; padding: 6px 8px; font-size: 14px; line-height: 1.25; text-align: left; }
  .echo { min-height: 3em; }
  .heads { gap: 0 16px; }
  .head-name { font-size: 15px; }
  .head-sub { font-size: 13px; }
  .head-off { flex-wrap: wrap; gap: 2px 8px; }
  .head-off b { font-size: 40px; }
  .head-off span { flex-basis: 100%; font-size: 14px; }
  .facts { font-size: 12px; }
  .facts dt { gap: 6px; }
  .facts dt .dot { width: 8px; }
  .captions { font-size: 15px; }
  .bodies { grid-template-columns: minmax(0, 1fr); }
  .body + .body { margin-top: 20px; }
  .body-name { display: block; margin: 0 0 6px; font-size: 15px; font-weight: 600; }
  .row { grid-template-columns: 7rem minmax(0, 1fr); }
  .addr { font-size: 12px; }
  .dots { gap: 2px; }
}

/* ── Коротко ── */
.short { margin: 48px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.short h2 { margin: 0; font-size: clamp(22px, 4vw, 26px); font-weight: 500; letter-spacing: -0.01em; }
.short p { margin: 12px 0 0; font-size: 17px; line-height: 1.6; }
.short p b { font-weight: 600; }
.more-link { display: inline-flex; align-items: center; min-height: 44px; margin: 20px 0 0; padding: 0 18px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 15px; }
.more-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .more-link:hover { border-color: var(--accent); color: var(--accent); } }

.toc { margin: 48px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.toc ol { list-style: none; margin: 10px 0 0; padding: 0; columns: 2; column-gap: 32px; }
.toc li { break-inside: avoid; }
.toc a { display: flex; align-items: center; min-height: 40px; color: var(--text-2); font-size: 15px; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .toc a:hover { color: var(--accent); } }
@media (max-width: 600px) { .toc ol { columns: 1; } }

/* ── Разбор ── */
.prose { font-size: 17px; line-height: 1.65; }
.prose > * { margin: 0; }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 2.4em; font-size: clamp(24px, 4vw, 28px); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; scroll-margin-top: 16px; }
.prose h3 { margin-top: 1.8em; font-size: 18px; font-weight: 600; line-height: 1.4; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose strong { font-weight: 600; }
.prose ul, .disc-body ul { list-style: disc; padding-left: 1.2em; }
.prose ol, .disc-body ol { padding-left: 1.4em; }
.prose li + li, .disc-body li + li { margin-top: 0.4em; }
.prose code, .disc-body code { font: 400 0.88em var(--mono); background: var(--surface); padding: 0.1em 0.35em; }
.ip { font-family: var(--mono); font-size: 0.88em; white-space: nowrap; }
.ip .ip-net { color: var(--muted); }
.note { font-size: 14px; color: var(--muted); }

.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.tbl th, .tbl td { padding: 9px 16px 9px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl thead th { font: 400 12px/1.5 var(--mono); color: var(--muted); border-bottom-color: var(--muted); }
.tbl tbody th { font-weight: 400; color: var(--text-2); }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-wide table { min-width: 640px; font-size: 14px; }

/* ── Раскрывающийся блок: один вид для вопросов, подробностей, словарика и источников ── */
.disc { border: 1px solid var(--line); }
.prose > .disc { margin-top: 1.4em; }
.prose > .disc + * { margin-top: 1.4em; }
.prose > .disc + .disc, .disc + .disc { margin-top: -1px; }
.disc > summary { display: grid; grid-template-columns: minmax(0, 1fr) 28px; column-gap: 16px; align-items: center; min-height: 56px; padding: 10px 12px 10px 16px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.disc > summary::-webkit-details-marker { display: none; }
.disc-label { grid-column: 1; font: 400 13px/1.5 var(--mono); color: var(--muted); }
.disc-title { grid-column: 1; font-size: 16px; font-weight: 500; line-height: 1.4; color: var(--text); }
.disc > summary::after { content: '+'; grid-column: 2; grid-row: 1 / span 2; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); font: 400 16px/1 var(--mono); color: var(--text-2); }
.disc[open] > summary::after { content: '−'; }
.disc[open] { background: var(--surface); border-color: #3a3e44; position: relative; z-index: 1; }
.disc[open] > summary { border-bottom: 1px solid var(--line); }
.disc > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
  .disc > summary:hover::after { border-color: var(--muted); color: var(--text); }
  .disc:not([open]) > summary:hover { background: rgba(255, 255, 255, 0.02); }
}
.disc-body { padding: 14px 16px 16px; color: var(--text-2); font-size: 16px; line-height: 1.6; }
.disc-body > * { margin: 0; }
.disc-body > * + * { margin-top: 0.8em; }
.disc-body .tbl { margin-left: -16px; margin-right: -16px; padding: 0 16px; }
.disc-body dl div { display: grid; grid-template-columns: 11rem 1fr; gap: 0 16px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.55; }
.disc-body dl div:first-child { border-top: 0; padding-top: 0; }
.disc-body dt { font-weight: 500; color: var(--text); }
.disc-body dd { margin: 0; }
@media (max-width: 600px) { .disc-body dl div { grid-template-columns: 1fr; } }
.end { margin: 48px 0 0; }

/* ── Схема «люди → шарды → адреса» ── */
.scheme { margin: 1.6em 0 0; }
.scheme-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sc-col { min-width: 0; padding: 10px 8px 8px; border: 1px solid var(--line); }
.sc-col.hit { border-color: var(--muted); }
.sc-name { margin: 0 0 8px; font: 400 12px/1.4 var(--mono); color: var(--muted); }
.sc-col.hit .sc-name { color: var(--text); }
.sc-people { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; max-width: 140px; }
.sc-addr { margin: 10px 0 0; padding: 4px 6px; border: 1px solid var(--line); font: 400 12px/1.4 var(--mono); }
.sc-addr + .sc-addr { margin-top: 4px; }
.sc-addr .ip { font-size: 1em; }
.sc-addr small { display: block; font-size: 11px; color: var(--muted); }
.sc-addr.down, .sc-addr.down .ip-net, .sc-addr.down small { color: var(--bad); }
.sc-addr.down .ip { text-decoration: line-through; text-decoration-thickness: 1px; }
.sc-em { grid-column: 1 / span 2; margin: 0; padding: 6px 8px; border: 1px dashed var(--muted); font: 400 12px/1.4 var(--mono); color: var(--text-2); }
.scheme figcaption { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
@media (max-width: 600px) {
  .sc-col { padding: 8px 6px 6px; }
  .sc-addr { padding: 3px 4px; font-size: 11px; }
  .sc-addr small { font-size: 10px; }
}
@media (max-width: 360px) {
  .sc-addr .ip-net { display: none; }
  .facts div { display: block; padding: 2px 0 3px; }
  .facts dd { min-width: 0; padding-left: 14px; text-align: left; color: var(--text); }
}

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 40px 0 0; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; font: 500 15px/1 inherit; font-family: inherit; color: #141517; background: var(--accent); border: 0; cursor: pointer; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .btn:hover { filter: brightness(1.08); } }
.toast { margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }

/* ── Куда дальше: наверх, все штуки, главная — чтобы не листать длинную статью обратно ── */
.end-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 32px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.end-nav a { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 6px 10px; border: 1px solid var(--line); color: var(--text-2); font-size: 15px; line-height: 1.25; text-align: center; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.end-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .end-nav a:hover { border-color: var(--accent); color: var(--accent); } }

@media (prefers-reduced-motion: reduce) {
  .dot, .chip, .addr, .head-off b { transition: none; }
  html { scroll-behavior: auto; }
}
