/* PULSE VPN — графит, тёплый «бумажный» белый и сигнальный оранжево-красный */
:root {
  --bg: #0c0e0d;
  --bg-2: #121513;
  --bg-3: #191d1a;
  --line: #232825;
  --line-2: #313733;
  --text: #ece8df;
  --muted: #8d928d;
  --dim: #5c625d;
  --accent: #ff5b37;
  --accent-hover: #ff7454;
  --accent-ink: #1c0903;
  --ok: #7fd9a2;
  --warn: #f0c45a;
  --err: #ff7068;
  --paper: #ece7dc;
  --paper-2: #e1dbcd;
  --paper-line: #cfc7b6;
  --ink: #121412;
  --ink-muted: #5f6159;

  --f: 'Geologica', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --m: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', monospace;
  --r: 14px;
  --r-sm: 8px;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f);
  font-size: 16px;
  font-weight: 380;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.025em; line-height: 1.05; }
code, .mono { font-family: var(--m); font-size: 0.86em; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 860px; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

.label {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--m); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.label b { color: var(--accent); font-weight: 500; }

.display { font-size: clamp(56px, 11vw, 168px); font-weight: 720; letter-spacing: -0.055em; line-height: 0.88; }
.h1 { font-size: clamp(40px, 6.4vw, 92px); font-weight: 680; letter-spacing: -0.045em; line-height: 0.95; }
.h2 { font-size: clamp(30px, 4vw, 54px); font-weight: 640; letter-spacing: -0.035em; line-height: 1; }
.h3 { font-size: 26px; font-weight: 620; }
.lead { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.5; color: color-mix(in srgb, var(--text) 82%, var(--bg)); max-width: 46ch; }

/* ---------- Кнопки ---------- */
.btn {
  --h: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 22px;
  border: 1px solid transparent; border-radius: 999px;
  font: 520 15px/1 var(--f); letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .18s, border-color .18s, color .18s, transform .18s;
  color: var(--text); background: none;
}
.btn:active { transform: translateY(1px); }
.btn-sm { --h: 38px; padding: 0 16px; font-size: 14px; }
.btn-lg { --h: 56px; padding: 0 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #262a27; }
.btn-line { border-color: var(--line-2); }
.btn-line:hover { border-color: var(--text); }
.btn-ghost { color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--err); border-color: color-mix(in srgb, var(--err) 50%, transparent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row form { margin: 0; }

.link-arrow { font-size: 15px; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.link-arrow::after { content: '→'; transition: transform .2s; }
.link-arrow:hover::after { transform: translateX(4px); }
.link-back { font-size: 14px; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 10px; }

/* ---------- Шапка ---------- */
.hdr { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 94%, transparent); border-bottom: 1px solid var(--line); }
.hdr-in { display: flex; align-items: center; gap: 32px; height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 720; font-size: 19px; letter-spacing: -0.02em; color: var(--text); }
.logo-mark { width: 30px; height: 30px; color: var(--accent); flex: none; }
.logo em { font-style: normal; font-family: var(--m); font-weight: 500; font-size: 11px; letter-spacing: 0.1em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 5px; }
.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a { padding: 8px 12px; border-radius: 999px; font-size: 15px; color: var(--muted); text-decoration: none; transition: color .15s; }
.nav a:hover, .nav a.is-active { color: var(--text); }
.nav a.is-active { background: var(--bg-3); }
.hdr-right { display: flex; align-items: center; gap: 14px; }
.hdr-link { font-size: 15px; color: var(--muted); text-decoration: none; }
.hdr-link:hover { color: var(--text); }
.burger { display: none; width: 42px; height: 42px; border: 1px solid var(--line-2); border-radius: 999px; background: none; cursor: pointer; padding: 0; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.burger span { display: block; width: 16px; height: 1.5px; background: var(--text); transition: transform .2s; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.flash { border-bottom: 1px solid var(--line); padding: 14px 0; font-size: 15px; }
.flash-ok { background: color-mix(in srgb, var(--ok) 10%, var(--bg)); color: var(--ok); }
.flash-err { background: color-mix(in srgb, var(--err) 10%, var(--bg)); color: var(--err); }

/* ---------- Пульс ---------- */
.ecg { width: 100%; height: 160px; overflow: visible; }
.ecg path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ecg-base { stroke: var(--line-2); }
.ecg-run { stroke: var(--accent); stroke-dasharray: 110 1000; stroke-dashoffset: 1110; animation: ecg 3.4s linear infinite; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent)); }
.ecg-flat .ecg-run { animation-duration: 6s; opacity: .5; }
@keyframes ecg { to { stroke-dashoffset: 0; } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot-live { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: live 2s ease-out infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Главная ---------- */
.hero { padding: clamp(48px, 8vw, 96px) 0 48px; border-bottom: 1px solid var(--line); }
.hero-status { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); margin-bottom: clamp(28px, 4vw, 44px); padding: 7px 14px 7px 12px; border: 1px solid var(--line); border-radius: 999px; }
.hero-row { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; margin-top: clamp(28px, 4vw, 48px); }
.hero-row .lead { margin: 0; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-ecg { margin: 48px 0 12px; }
.readout { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid var(--line); }
.readout div { padding: 22px 0 0; border-right: 1px solid var(--line); padding-left: 20px; }
.readout div:first-child { padding-left: 0; }
.readout div:last-child { border-right: 0; }
.readout dt { font: 500 12px var(--m); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.readout dd { margin: 0; font-size: clamp(26px, 3.4vw, 42px); font-weight: 620; letter-spacing: -0.03em; line-height: 1; }
.readout small { font: 400 13px var(--m); color: var(--muted); margin-left: 8px; letter-spacing: 0; }

.sec { padding: clamp(72px, 10vw, 128px) 0; }
.sec-tight { padding-top: 0; }
.sec-flush { padding-top: 0; }
.sec-top-line { border-top: 1px solid var(--line); }
.sec-head { margin-bottom: clamp(36px, 5vw, 64px); display: grid; gap: 18px; }
.sec-head-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.sec-head-row > div { display: grid; gap: 18px; }

.sec-paper { background: var(--paper); color: var(--ink); }
.sec-paper .label { color: var(--ink-muted); }
.sec-paper .label b { color: #d2401f; }
.sec-paper .link-arrow { color: var(--ink); }
.sec-flush.sec-paper { padding-top: clamp(40px, 6vw, 72px); }

.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.feat { padding: 28px 28px 8px 0; border-right: 1px solid var(--line); }
.feat + .feat { padding-left: 28px; }
.feat:last-child { border-right: 0; padding-right: 0; }
.feat-n { color: var(--accent); display: block; margin-bottom: 40px; }
.feat h3 { font-size: 21px; margin-bottom: 14px; letter-spacing: -0.02em; }
.feat p { color: var(--muted); font-size: 15px; }

.loc-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.loc-strip li { background: var(--bg); padding: 20px; display: grid; gap: 6px; }
.loc-code { color: var(--accent); }
.loc-city { font-size: 18px; font-weight: 560; letter-spacing: -0.015em; }
.loc-ping { color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.steps li { border: 1px solid var(--line); border-radius: var(--r); padding: 28px; background: var(--bg-2); }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); font: 500 15px var(--m); margin-bottom: 40px; }
.steps li:last-child .step-n { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.steps h3 { font-size: 22px; margin-bottom: 10px; }
.steps p { color: var(--muted); margin: 0; }

.band { border-top: 1px solid var(--line); background: var(--bg-2); padding: clamp(56px, 8vw, 96px) 0; }
.band-in { display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; }
.band-in > div { display: grid; gap: 18px; }

/* ---------- Тарифы ---------- */
.pc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pc { display: flex; flex-direction: column; background: #f6f2ea; color: var(--ink); border: 1px solid var(--paper-line); border-radius: 18px; padding: 26px; }
.pc-feat { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 28px; }
.pc-name { font-weight: 600; font-size: 17px; }
.pc-badge { font: 500 11px var(--m); text-transform: uppercase; letter-spacing: .06em; padding: 5px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.pc-price { display: flex; align-items: flex-start; gap: 4px; margin: 34px 0 6px; }
.pc-num { font-size: 64px; font-weight: 700; letter-spacing: -0.05em; line-height: .9; }
.pc-cur { font-size: 24px; font-weight: 600; margin-top: 4px; }
.pc-meta { display: grid; gap: 2px; font-size: 14px; color: var(--ink-muted); min-height: 44px; }
.pc-feat .pc-meta { color: #a5a69e; }
.pc-save { font-family: var(--m); font-size: 12px; }
.pc-feat .pc-save, .pc .pc-save { color: #c63c1c; }
.pc-feat .pc-save { color: var(--accent); }
.pc-list { list-style: none; padding: 20px 0 0; margin: 20px 0 26px; border-top: 1px solid var(--paper-line); display: grid; gap: 10px; font-size: 15px; flex: 1; }
.pc-feat .pc-list { border-color: #2c312d; }
.pc-list li { display: flex; gap: 10px; align-items: baseline; }
.pc-list li::before { content: ''; width: 10px; height: 2px; background: currentColor; opacity: .45; flex: none; transform: translateY(-4px); }
.pc form { margin: 0; }
.pc-feat .btn-accent { color: var(--accent-ink); }

/* ---------- Внутренние страницы ---------- */
.phead { padding: clamp(56px, 9vw, 112px) 0 clamp(40px, 6vw, 72px); }
.phead .wrap { display: grid; gap: 24px; }
.phead .lead { margin: 6px 0 0; }
.phead .lead a { color: var(--accent); }

.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.split > div:first-child { display: grid; gap: 18px; position: sticky; top: 104px; }
.split-gap { margin-top: clamp(56px, 8vw, 96px); }
.prose { font-size: 17px; color: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.prose a { color: var(--accent); }
.prose code { background: var(--bg-3); padding: 2px 6px; border-radius: 4px; }
.prose-legal h3 { font-size: 20px; margin: 36px 0 12px; }
.prose-legal h3:first-child { margin-top: 0; }
.note { color: var(--muted); font-size: 15px; margin-top: 24px; }
.note a { color: var(--text); }

.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { text-align: left; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl thead th { font: 500 11px var(--m); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-top: 0; }
.tbl tbody tr:last-child td, .tbl tbody tr:last-child th { border-bottom: 0; }
.tbl td form { margin: 0; }
.tbl-spec th { font-weight: 420; color: var(--muted); width: 38%; }
.tbl-spec { border-top: 1px solid var(--line); }
.tbl-spec tbody tr:first-child th, .tbl-spec tbody tr:first-child td { padding-top: 14px; }
.tbl-loc td:first-child { width: 72px; }
.tbl-loc strong { font-weight: 560; font-size: 17px; }
.tbl-compact th, .tbl-compact td { padding: 11px 14px 11px 0; font-size: 14px; }
.tbl tr.is-blocked td { opacity: .6; }

.sig { display: inline-flex; gap: 3px; align-items: flex-end; height: 16px; }
.sig i { width: 4px; background: var(--line-2); border-radius: 1px; }
.sig i:nth-child(1) { height: 25%; } .sig i:nth-child(2) { height: 50%; } .sig i:nth-child(3) { height: 75%; } .sig i:nth-child(4) { height: 100%; }
.sig-fast i.on { background: var(--ok); } .sig-mid i.on { background: var(--warn); } .sig-far i.on { background: var(--accent); }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; font: 500 12px var(--m); border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; }
.pill-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.pill-wait { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.pill-off { color: var(--dim); }
.pill-err { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.pill-accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.tech-diagram { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 0; padding: clamp(28px, 5vw, 56px); border: 1px solid var(--line); border-radius: 20px; background: var(--bg-2); }
.td-node { width: clamp(64px, 9vw, 110px); aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; background: var(--bg); font-size: 14px; }
.td-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.td-wire { position: relative; height: 1px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px); margin: 0 12px; }
.td-wire span { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap; color: var(--muted); font-size: 12px; }

.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 80px 4fr 7fr; gap: 24px; padding: 32px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.row h3 { font-size: 24px; }
.row p { margin: 0; color: var(--muted); font-size: 17px; }

.app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.app { border: 1px solid var(--line); border-radius: var(--r); padding: 28px; background: var(--bg-2); display: grid; gap: 22px; align-content: start; }
.app-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.app-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.app-list a, .app-list strong { font-weight: 560; font-size: 18px; color: var(--text); }
.app-list .muted { font-size: 14px; text-align: right; }
.app-steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 12px; }
.app-steps li { counter-increment: st; display: grid; grid-template-columns: 28px 1fr; gap: 10px; color: color-mix(in srgb, var(--text) 82%, var(--bg)); }
.app-steps li::before { content: counter(st, decimal-leading-zero); font: 500 12px/1.9 var(--m); color: var(--accent); }
.app-steps-lg li { font-size: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }

.qa { border-bottom: 1px solid var(--line); }
.qa:first-child { border-top: 1px solid var(--line); }
.qa summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 48px 1fr 24px; gap: 12px; padding: 24px 0; font-size: clamp(18px, 2vw, 22px); font-weight: 540; letter-spacing: -0.015em; align-items: baseline; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: '+'; font: 400 22px var(--m); color: var(--muted); transition: transform .2s; }
.qa[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.qa summary .mono { color: var(--accent); font-size: 13px; }
.qa p { padding: 0 36px 26px 60px; color: var(--muted); font-size: 17px; max-width: 72ch; margin: 0; }

.support-card { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; padding: clamp(28px, 5vw, 48px); border-radius: 20px; background: var(--accent); color: var(--accent-ink); }
.support-card .label, .support-card .muted { color: color-mix(in srgb, var(--accent-ink) 70%, var(--accent)); }
.support-card .muted { margin: 8px 0 0; }
.support-handle { display: block; font-size: clamp(36px, 6vw, 76px); font-weight: 700; letter-spacing: -0.045em; text-decoration: none; margin-top: 10px; line-height: 1; word-break: break-all; }
.support-card .btn-accent { background: var(--accent-ink); color: var(--accent); }
.support-card .btn-accent:hover { background: #000; }

.nf { padding: clamp(72px, 12vw, 160px) 0; }
.nf .wrap { display: grid; gap: 28px; justify-items: start; }
.nf-ecg { width: 100%; }

/* ---------- Авторизация ---------- */
.is-auth main { min-height: 100vh; }
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 40px clamp(24px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; overflow: hidden; }
.auth-side-text { display: grid; gap: 16px; }
.auth-ecg { margin: 0 calc(-1 * clamp(24px, 4vw, 56px)); }
.ecg-sm { height: 110px; }
.auth-main { display: grid; place-items: center; padding: 40px var(--gutter); }

.form { display: grid; gap: 18px; width: 100%; max-width: 420px; }
.form .h3 { margin-bottom: 6px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 14px; color: var(--muted); }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=search], input:not([type]), select {
  width: 100%; height: 50px; padding: 0 16px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px;
  font: 400 16px var(--f); transition: border-color .15s;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
input:hover, select:hover { border-color: var(--dim); }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check a { color: var(--text); }
.form-alt { margin: 0; text-align: center; font-size: 15px; color: var(--muted); }
.form-alt a { color: var(--text); }

.alert { padding: 14px 16px; border-radius: 10px; font-size: 15px; border: 1px solid; margin-bottom: 20px; }
.form .alert { margin: 0; }
.alert a { color: inherit; font-weight: 560; }
.alert-err { color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); background: color-mix(in srgb, var(--err) 7%, transparent); }
.alert-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.alert-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: color-mix(in srgb, var(--ok) 7%, transparent); }

/* ---------- Кабинет ---------- */
.cab, .adm { padding: 40px 0 96px; }
.cab-in { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.cab-side { position: sticky; top: 104px; display: grid; gap: 24px; }
.cab-user { display: grid; gap: 6px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.cab-user strong { font-weight: 520; font-size: 15px; word-break: break-all; }
.cab-nav { display: grid; gap: 2px; }
.cab-nav a { padding: 10px 14px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 15px; }
.cab-nav a:hover { color: var(--text); background: var(--bg-2); }
.cab-nav a.is-active { color: var(--text); background: var(--bg-3); }
.cab-nav .cab-admin { color: var(--accent); margin-top: 8px; border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent); }
.cab-side form { margin: 0; }
.cab-main { display: grid; gap: 16px; min-width: 0; }
.cab-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.cab-lead { margin: -4px 0 8px; }
.cab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.card { border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); padding: 24px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.card.form { max-width: none; }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card .btn { justify-self: start; }
.card-sub { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card-sub-top { display: flex; justify-content: space-between; align-items: center; }
.card-sub-off { border-style: dashed; }
.card-sub-off .h3 { font-size: 24px; }
.card-sub p, .card p { margin: 0; }
.sub-days { display: flex; align-items: flex-end; gap: 14px; }
.sub-num { font-size: 72px; font-weight: 700; letter-spacing: -0.05em; line-height: .82; }
.sub-days > span:last-child { font-size: 14px; color: var(--muted); line-height: 1.25; padding-bottom: 2px; }
.meter { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .8s cubic-bezier(.2,.7,.2,1); }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; }
.card-help { grid-template-columns: 1fr auto; align-items: center; }
.card-help .btn { justify-self: end; }
.empty { padding: 8px 0; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }

.dev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dev { border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); padding: 24px; display: grid; gap: 18px; align-content: start; min-width: 0; }
.dev-empty { border-style: dashed; background: none; }
.dev-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dev-head > div { display: grid; gap: 6px; min-width: 0; }
.dev-head h3 { font-size: 22px; word-break: break-word; }
.dev-head .muted { font-size: 14px; }
.dev-head form { margin: 0; }
.dev-key { display: grid; gap: 12px; }
.key { display: block; padding: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: 12px; line-height: 1.5; word-break: break-all; color: var(--muted); max-height: 92px; overflow: auto; user-select: all; }
.dev-key .btn { justify-self: start; }
.btn.is-copied { background: var(--ok); color: var(--ink); }
.dev-qr summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.dev-qr summary:hover { color: var(--text); }
.qr { margin-top: 14px; width: 220px; max-width: 100%; border-radius: 12px; overflow: hidden; }
.dev-form { display: grid; gap: 14px; }
.dev-form .btn { justify-self: start; }
.pc-grid-cab { grid-template-columns: repeat(2, 1fr); }
.card-pay { max-width: 640px; }
.key-inline { background: var(--bg); padding: 3px 8px; border-radius: 6px; color: var(--text); user-select: all; }

/* ---------- Админка ---------- */
.adm-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 12px; margin-bottom: 32px; }
.adm-nav, .tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.adm-nav a, .tabs a { padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); text-decoration: none; }
.adm-nav a:hover, .tabs a:hover { color: var(--text); }
.adm-nav a.is-active, .tabs a.is-active { background: var(--bg-3); color: var(--text); }
.tabs { margin-bottom: 16px; }
.adm .card { margin-bottom: 16px; }
.adm .cab-grid { margin-bottom: 16px; }
.adm .cab-grid .card { margin-bottom: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat { border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--bg-2); display: grid; gap: 10px; }
.stat strong { font-size: clamp(28px, 3vw, 40px); font-weight: 660; letter-spacing: -0.035em; line-height: 1; }
.stat .muted { font-size: 13px; font-family: var(--m); }
.adm-filter { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.adm-filter input { flex: 1 1 260px; height: 42px; }
.adm-filter select { width: auto; height: 42px; flex: 0 0 auto; }
.adm-filter .btn { height: 42px; }
.adm-actions form { margin: 0; }
.inline-form { display: flex; gap: 10px; }
.inline-form input { width: 110px; height: 38px; }

/* ---------- Подвал ---------- */
.ftr { border-top: 1px solid var(--line); padding: 64px 0 32px; }
.ftr-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 32px; }
.ftr-brand p { color: var(--muted); max-width: 30ch; margin-top: 18px; }
.ftr-col { display: grid; gap: 10px; align-content: start; }
.ftr-col .label { margin-bottom: 6px; }
.ftr-col a { color: color-mix(in srgb, var(--text) 80%, var(--bg)); text-decoration: none; font-size: 15px; }
.ftr-col a:hover { color: var(--accent); }
.ftr-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .pc-grid { grid-template-columns: repeat(2, 1fr); }
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .feat:nth-child(2) { border-right: 0; }
  .feat:nth-child(3) { padding-left: 0; }
  .feat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .loc-strip { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .nav a { padding: 8px 9px; font-size: 14px; }
}

@media (max-width: 900px) {
  .hdr-in { gap: 12px; height: 64px; }
  .burger { display: inline-flex; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 12px var(--gutter) 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; font-size: 18px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a.is-active { background: none; color: var(--accent); }
  .hdr-right { margin-left: auto; }
  .hero-row { grid-template-columns: 1fr; gap: 28px; }
  .readout { grid-template-columns: repeat(2, 1fr); }
  .readout div:nth-child(2) { border-right: 0; }
  .readout div:nth-child(3) { padding-left: 0; }
  .readout div:nth-child(n+3) { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split > div:first-child { position: static; }
  .row { grid-template-columns: 1fr; gap: 10px; }
  .app-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 0; }
  .auth-side-text .h2 { font-size: 30px; }
  .cab-in { grid-template-columns: 1fr; gap: 24px; }
  .cab-side { position: static; }
  .cab-nav { display: flex; overflow-x: auto; gap: 4px; }
  .cab-nav a { white-space: nowrap; }
  .cab-nav .cab-admin { margin-top: 0; }
  .ftr-top { grid-template-columns: 1fr 1fr; }
  .ftr-brand { grid-column: 1 / -1; }
  .tech-diagram { grid-template-columns: 1fr; justify-items: center; }
  .td-wire { width: 1px; height: 64px; margin: 8px 0; background: repeating-linear-gradient(180deg, var(--line-2) 0 6px, transparent 6px 12px); }
  .td-wire span { left: 16px; bottom: 50%; transform: translateY(50%); }
}

@media (max-width: 640px) {
  .hdr-link { display: none; }
  .hdr-right .btn { padding: 0 14px; }
  .logo em { display: none; }
  .pc-grid, .pc-grid-cab { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr; }
  .feat, .feat + .feat { padding: 24px 0; border-right: 0; border-top: 1px solid var(--line); }
  .feat:first-child { border-top: 0; }
  .feat-n { margin-bottom: 18px; }
  .loc-strip { grid-template-columns: repeat(2, 1fr); }
  .cab-grid, .dev-grid, .stat-grid { grid-template-columns: 1fr; }
  .card-help { grid-template-columns: 1fr; }
  .card-help .btn { justify-self: start; }
  .hero-cta .btn { width: 100%; }
  .qa summary { grid-template-columns: 34px 1fr 20px; }
  .qa p { padding: 0 0 22px 46px; }
  .tbl-loc th:nth-child(4), .tbl-loc td:nth-child(4) { display: none; }
  .app-list li { flex-direction: column; gap: 2px; }
  .app-list .muted { text-align: left; }
  .ftr-top { grid-template-columns: 1fr; }
  .band-in .btn { width: 100%; }
}

/* ---------- Анимации ---------- */
.ticker { border-bottom: 1px solid var(--line); overflow: hidden; padding: 16px 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: flex; width: max-content; animation: ticker 40s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tk-item { display: inline-flex; align-items: baseline; gap: 10px; padding: 0 28px; font-size: 18px; font-weight: 520; letter-spacing: -0.01em; white-space: nowrap; }
.tk-item::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); margin-left: 28px; align-self: center; }
.tk-item b { font: 500 12px var(--m); color: var(--accent); }
.tk-item i { font: 400 13px var(--m); font-style: normal; color: var(--muted); }
@keyframes ticker { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: no-preference) {
  /* Плавные переходы между страницами (View Transitions API) */
  @view-transition { navigation: auto; }
  .hdr { view-transition-name: hdr; }
  ::view-transition-old(root) { animation: vt-out .22s ease both; }
  ::view-transition-new(root) { animation: vt-in .45s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

  /* Заголовок героя выезжает построчно */
  .hero-title .ln { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
  .hero-title .ln > span { display: inline-block; animation: rise 1s cubic-bezier(.2, .8, .2, 1) both; }
  .hero-title .ln:nth-child(2) > span { animation-delay: .1s; }
  .hero-status { animation: fade-up .8s .05s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-row { animation: fade-up .9s .35s cubic-bezier(.2, .7, .2, 1) both; }
  .readout { animation: fade-up .9s .6s cubic-bezier(.2, .7, .2, 1) both; }
  .phead .wrap > * { animation: fade-up .8s cubic-bezier(.2, .7, .2, 1) both; }
  .phead .wrap > :nth-child(2) { animation-delay: .08s; }
  .phead .wrap > :nth-child(3) { animation-delay: .18s; }
  @keyframes rise { from { transform: translateY(105%); } }
  @keyframes fade-up { from { opacity: 0; transform: translateY(18px); } }

  /* Пульс сначала прорисовывается, потом бежит */
  .ecg-base { stroke-dasharray: 1000; animation: draw 1.8s .25s cubic-bezier(.6, 0, .2, 1) both; }
  @keyframes draw { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }

  /* Медленное свечение за героем */
  .hero { position: relative; overflow: hidden; isolation: isolate; }
  .hero::before { content: ''; position: absolute; z-index: -1; width: 720px; height: 720px; right: -200px; top: -260px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%); filter: blur(40px); animation: drift 16s ease-in-out infinite alternate; pointer-events: none; }
  @keyframes drift { to { transform: translate(-180px, 140px) scale(1.15); } }

  /* Появление блоков при прокрутке (класс ставит JS) */
  .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 80ms); }
  .reveal.is-in { opacity: 1; transform: none; }

  /* Полоса прогресса чтения под шапкой (scroll-driven animation) */
  @supports (animation-timeline: scroll()) {
    .hdr::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform-origin: 0 50%; animation: progress linear both; animation-timeline: scroll(root); }
    @keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  }

  /* Плавное раскрытие вопросов */
  :root { interpolate-size: allow-keywords; }
  .qa::details-content { block-size: 0; overflow: hidden; transition: block-size .4s cubic-bezier(.2, .7, .2, 1), content-visibility .4s allow-discrete; }
  .qa[open]::details-content { block-size: auto; }

  .btn-mag { transition: transform .35s cubic-bezier(.2, .7, .2, 1), background-color .18s, border-color .18s, color .18s; }
}

/* Подсветка карточек за курсором */
.spot { position: relative; isolation: isolate; }
.spot::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s; background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 13%, transparent), transparent 65%); }
.spot:hover::after { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ecg-run { stroke-dasharray: none; stroke-dashoffset: 0; opacity: .7; }
}
