:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #13202f;
  --muted: #526173;
  --border: #dbe2ea;
  --brand: #0f6b5c;
  --brand-strong: #0a5246;
  --accent: #19b36b;
  --accent-soft: #e3f7ec;
  --warn: #b4561a;
  --warn-soft: #fdf0e6;
  --navy: #0d1b2a;
  --navy-2: #16283b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(13, 27, 42, .08);
  --max: 1140px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b141e;
  --surface: #122030;
  --surface-2: #182a3d;
  --text: #e8eef5;
  --muted: #9fb0c3;
  --border: #253a50;
  --brand: #3cc9a5;
  --brand-strong: #6fe0c2;
  --accent: #34d17f;
  --accent-soft: #123526;
  --warn: #f0a46c;
  --warn-soft: #3a2616;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.logo svg { width: 32px; height: 32px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .95rem; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--brand); font-weight: 600; background: var(--accent-soft); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center;
}
.icon-btn svg { width: 20px; height: 20px; }
.menu-toggle { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 1rem;
  text-decoration: none; border: 2px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #062514; }
.btn-primary:hover { background: #14a05f; color: #062514; }
.btn-outline { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-cta {
  font-size: 1.15rem; padding: 18px 34px; letter-spacing: .04em; text-transform: uppercase;
  background: var(--accent); color: #062514; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(25, 179, 107, .35);
}
.btn-cta:hover { background: #14a05f; color: #062514; }

/* Hero */
.hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 60%, #10402f 100%); color: #e8eef5; padding: 72px 0 84px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero p.lead { color: #c3d0dd; font-size: 1.15rem; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; align-items: center; }
.hero .btn-outline { background: transparent; color: #e8eef5; border-color: #3a5470; }
.hero .btn-outline:hover { border-color: #7ee2b0; color: #7ee2b0; }
.updated { font-size: .9rem; color: var(--muted); }
.hero .updated { color: #9fb0c3; margin-top: 18px; }

/* Laptop */
.laptop { width: 100%; max-width: 560px; margin: 0 auto; filter: drop-shadow(0 30px 40px rgba(0,0,0,.45)); }
.laptop .pulse { animation: pulse 2.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(1); } 50% { opacity: .08; transform: scale(1.25); } }
.laptop .check-in { animation: pop .6s ease-out 1; transform-box: fill-box; transform-origin: center; }
.laptop .d1 { animation-delay: .3s; } .laptop .d2 { animation-delay: .6s; } .laptop .d3 { animation-delay: .9s; } .laptop .d4 { animation-delay: 1.2s; }
@keyframes pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .laptop .pulse, .laptop .check-in { animation: none; } html { scroll-behavior: auto; } }

/* Sections */
section { padding: 72px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.page-hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #e8eef5; padding: 56px 0; }
.page-hero p { color: #c3d0dd; max-width: 46em; font-size: 1.1rem; margin: 0; }
.breadcrumb { font-size: .9rem; margin-bottom: 14px; color: #9fb0c3; }
.breadcrumb a { color: #9fb0c3; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.section-alt .card { background: var(--bg); box-shadow: none; }
.card p:last-child { margin-bottom: 0; }
.card-link { text-decoration: none; color: inherit; display: block; transition: transform .15s ease, border-color .15s ease; }
.card-link:hover { transform: translateY(-3px); border-color: var(--brand); color: inherit; }
.card-link .more { color: var(--brand); font-weight: 600; }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.steps > li { position: relative; padding: 24px 24px 24px 84px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 22px; top: 22px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #062514; font-weight: 700; display: grid; place-items: center; font-size: 1.15rem;
}
.steps h3 { margin-bottom: .35em; }
.steps p:last-child, .steps ul:last-child { margin-bottom: 0; }
.mini-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: ms; list-style: none; padding: 0; margin: 0; }
.mini-steps li { counter-increment: ms; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.mini-steps li::before { content: "Step " counter(ms); display: block; font-size: .8rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }

/* Callouts */
.callout { border: 1px solid var(--border); background: var(--accent-soft); padding: 16px 20px; border-radius: 10px; margin: 20px 0; }
.callout.warn { border-color: var(--warn); border-left: 4px solid var(--warn); border-radius: 0 10px 10px 0; background: var(--warn-soft); }
.callout p:last-child { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .97rem; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.yes { color: var(--accent); font-weight: 700; }
.no { color: var(--warn); font-weight: 700; }

/* Diagram */
.diagram { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.diagram svg { width: 100%; height: auto; }
.diagram figcaption { font-size: .92rem; color: var(--muted); margin-top: 10px; }
.d-text { fill: var(--text); font: 600 14px "Segoe UI", system-ui, sans-serif; }
.d-sub { fill: var(--muted); font: 12px "Segoe UI", system-ui, sans-serif; }
.d-box { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.5; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tab { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: 600 .95rem inherit; font-family: inherit; }
.tab[aria-selected="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
:root[data-theme="dark"] .tab[aria-selected="true"] { color: #062514; }
.tab-panel[hidden] { display: none; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 18px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--brand); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding-bottom: 18px; color: var(--muted); }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; cursor: pointer; }
.checklist input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 16px 0 6px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.progress-label { font-size: .92rem; color: var(--muted); }

/* CTA band */
.cta-band { background: linear-gradient(135deg, var(--navy) 0%, #10402f 100%); color: #e8eef5; text-align: center; padding: 64px 0; }
.cta-band p { color: #c3d0dd; max-width: 40em; margin: 0 auto 26px; }

/* Legal */
.legal { max-width: 820px; }
.legal h2 { font-size: 1.4rem; margin-top: 1.8em; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: .4em; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 28px; }
.toc ol { margin: 0; padding-left: 1.2em; columns: 2; }

/* Footer */
.site-footer { background: var(--navy); color: #c3d0dd; padding: 56px 0 28px; font-size: .95rem; }
.site-footer a { color: #e8eef5; text-decoration: none; }
.site-footer a:hover { color: #7ee2b0; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid .footer-h { color: #fff; font-size: 1rem; font-weight: 700; margin: 0 0 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-legal-bar { margin-top: 40px; padding-top: 20px; border-top: 1px solid #253a50; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-legal-bar nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-legal-bar strong a { color: #7ee2b0; }
.link-btn { background: none; border: 0; padding: 0; color: #e8eef5; font: inherit; cursor: pointer; }
.link-btn:hover { color: #7ee2b0; text-decoration: underline; }
.site-footer .logo { color: #fff; margin-bottom: 12px; }

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 300;
  max-width: 760px; margin: 0 auto; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); padding: 22px 24px;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner .cookie-title { font-size: 1.15rem; font-weight: 700; color: var(--text) !important; margin-bottom: .4em; }
.cookie-banner p { font-size: .95rem; color: var(--muted); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.cookie-actions .btn { padding: 10px 18px; font-size: .95rem; flex: 1 1 150px; }
.cookie-prefs { margin-top: 14px; display: grid; gap: 10px; }
.cookie-prefs[hidden] { display: none; }
.pref-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.pref-row p { margin: 2px 0 0; font-size: .88rem; }
.pref-row input { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; margin-top: 2px; }

/* Responsive */
@media (max-width: 980px) {
  .hero-grid, .grid-2 { grid-template-columns: 1fr; }
  .grid-3, .grid-4, .mini-steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .menu-toggle { display: grid; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  section { padding: 52px 0; }
  .hero { padding: 48px 0 60px; }
  .grid-3, .grid-4, .mini-steps, .footer-grid { grid-template-columns: 1fr; }
  .steps > li { padding: 76px 18px 20px; }
  .steps > li::before { left: 18px; top: 18px; }
  .btn-cta { width: 100%; padding: 16px 20px; font-size: 1.02rem; }
  .toc ol { columns: 1; }
}

/* ---- v2 additions ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h2.h3 { font-size: 1.18rem; }
.byline { margin-top: 16px !important; font-size: .92rem !important; color: #9fb0c3 !important; }
.byline a { color: #7ee2b0; }
.link-inline { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.link-inline:hover { color: var(--brand-strong); }
.faq summary .faq-q { font-size: 1.05rem; margin: 0; line-height: 1.4; }

/* Data journey */
.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.flow li { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.flow li strong { display: block; font-size: 1.08rem; margin-bottom: 6px; }
.flow li span { color: var(--muted); font-size: .95rem; }
.flow li:not(:last-child)::after { content: "\2192"; position: absolute; right: -22px; top: 50%; transform: translateY(-50%); color: var(--accent); font-weight: 700; font-size: 1.2rem; }
.flow .flow-tunnel { background: var(--accent-soft); border-color: var(--accent); }

/* Phone mockup */
.phone-wrap { background: linear-gradient(160deg, #0d1b2a, #10402f); border-radius: 16px; padding: 28px; }
.phone { width: 100%; max-width: 260px; margin: 0 auto; filter: drop-shadow(0 24px 30px rgba(0,0,0,.45)); }
.phone .pulse { animation: pulse 2.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@media (prefers-reduced-motion: reduce) { .phone .pulse { animation: none; } }
.signs { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.signs li { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }

.related h2 { margin-bottom: 24px; }

@media (max-width: 980px) {
  .flow { grid-template-columns: 1fr 1fr; }
  .flow li:nth-child(2)::after { content: none; }
}
@media (max-width: 620px) {
  .flow { grid-template-columns: 1fr; gap: 26px; }
  .flow li:not(:last-child)::after { content: "\2193"; right: auto; left: 50%; top: auto; bottom: -24px; transform: translateX(-50%); }
  .flow li:nth-child(2)::after { content: "\2193"; }
  .cookie-banner { left: 8px; right: 8px; bottom: 8px; padding: 14px 16px; }
  .cookie-banner p { font-size: .85rem; margin-bottom: .5em; }
  .cookie-banner .cookie-title { font-size: 1rem; }
  .cookie-actions { gap: 6px; margin-top: 8px; }
  .cookie-actions .btn { padding: 8px 10px; font-size: .85rem; flex: 1 1 30%; }
}

/* ---- v3: device guides, checks, protocols, glossary ---- */
pre { background: var(--navy); color: #dfe8f1; padding: 12px 16px; border-radius: 10px; overflow-x: auto; font-size: .92rem; margin: 8px 0 12px; }
code { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: .92em; }
:not(pre) > code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
kbd { font-family: inherit; font-size: .85em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface); }
.path-figure { margin: 0 0 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.path-figure figcaption { font-weight: 600; margin-bottom: 12px; }
.path { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.path li { background: var(--accent-soft); color: var(--text); border: 1px solid var(--accent); border-radius: 8px; padding: 6px 12px; font-weight: 600; font-size: .95rem; }
.path li:not(:last-child)::after { content: "\203A"; margin-left: 14px; color: var(--muted); }
.path li:last-child { background: var(--accent); color: #062514; }
.panel-more { margin-top: 18px; }
.rating { color: var(--accent); letter-spacing: 2px; white-space: nowrap; }
.rating-off { color: var(--border); }
.result-card { max-width: 760px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.result-row { display: flex; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.result-row:last-child { border-bottom: 0; }
.result-row > span { font-weight: 700; width: 18px; flex-shrink: 0; }
.warn-row { background: var(--warn-soft); }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; position: sticky; top: 68px; background: var(--bg); padding: 10px 0; z-index: 5; }
.az a { display: grid; place-items: center; min-width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-decoration: none; font-weight: 700; }
.az a:hover { border-color: var(--brand); }
.az-letter { font-size: 1.6rem; color: var(--brand); border-bottom: 2px solid var(--border); padding-bottom: 6px; margin-top: 30px; scroll-margin-top: 130px; }
.glossary { margin: 0; display: grid; gap: 12px; }
.glossary .term { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; scroll-margin-top: 130px; }
.glossary .term:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.glossary dt { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }
.glossary dd { margin: 0; color: var(--muted); }
[id^="step-"], #verify, #troubleshooting, #ip-test, #dns-test, #webrtc-test, #ipv6-test, #killswitch-test, #speed-test { scroll-margin-top: 84px; }

/* Guide illustrations and screenshots */
.shot { margin: 0 0 28px; }
.shot img { display: block; width: 100%; max-width: 760px; height: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.shot figcaption { font-size: .92rem; color: var(--muted); margin-top: 10px; max-width: 760px; }
/* Sources lists */
.sources { padding-left: 1.2em; }
.sources li { margin-bottom: 8px; }
.src-pub { color: var(--muted); font-size: .9rem; }
