/* ==========================================================================
   TVCodeGuide — site stylesheet
   Brand: tvcodeguide.site
   ========================================================================== */

:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --line: #e5e9f2;
  --line-strong: #d3dae8;

  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --cyan: #06b6d4;
  --brand-soft: #eef0ff;

  --dark: #0b1220;
  --dark-2: #131d35;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 12px 32px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 56px rgba(15, 23, 42, .14);

  --maxw: 1160px;
  --header-h: 74px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25rem; }
button, input { font: inherit; }

.container { width: min(var(--maxw), 92%); margin-inline: auto; }
.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;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 999;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; border-radius: 999px; font-weight: 650; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .18s, box-shadow .18s, background .18s;
  line-height: 1; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 22px rgba(79, 70, 229, .32); }
.btn-primary:hover { box-shadow: 0 12px 30px rgba(79, 70, 229, .42); color: #fff; }
.btn-light { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-light:hover { color: var(--brand); }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.28); }
.btn-ghost:hover { background: rgba(255,255,255,.16); color: #fff; }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-block { width: 100%; }

/* ---------- Top utility bar ---------- */
.topbar { background: var(--dark); color: #cbd5e1; font-size: .8rem; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; }
.topbar-note { margin: 0; display: flex; align-items: center; gap: 8px; }
.topbar-note .dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.15); }
.topbar-links { display: flex; gap: 18px; align-items: center; }
.topbar-links a { color: #e2e8f0; }
.topbar-links a:hover { color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: rgba(255,255,255,.9); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 6px 16px rgba(79,70,229,.32);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-weight: 800; font-size: 1.22rem; letter-spacing: -.03em; }
.brand-name span { color: var(--brand); }
.brand-tag { display: block; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.main-nav > li { position: relative; list-style: none; }
.main-nav a, .main-nav > li > button {
  display: inline-flex; align-items: center; gap: 5px; padding: 9px 12px; border-radius: 9px;
  color: var(--ink-2); font-size: .9rem; font-weight: 550; background: none; border: 0; cursor: pointer;
}
.main-nav a:hover, .main-nav > li > button:hover { color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.main-nav .has-dropdown > button svg { width: 14px; height: 14px; transition: transform .2s; }
.main-nav .has-dropdown.open > button svg { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 8px; display: none;
}
.has-dropdown.open .dropdown { display: block; animation: pop .16s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dropdown a { display: block; padding: 9px 12px; border-radius: 8px; font-size: .88rem; }
.dropdown a:hover { background: var(--brand-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-btn svg { width: 19px; height: 19px; }
.menu-toggle { display: none; }
.header-cta { padding: 10px 18px; font-size: .88rem; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--dark); color: #fff; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(148,163,184,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.07) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero::after {
  content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%;
  right: -160px; top: -260px; background: radial-gradient(circle, rgba(124,58,237,.5), transparent 68%);
  filter: blur(10px);
}
.hero-grid {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1.08fr .92fr;
  gap: 56px; align-items: center; padding: 84px 0 92px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px;
  background: rgba(129,140,248,.14); border: 1px solid rgba(129,140,248,.32);
  color: #c7d2fe; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 22px;
}
.eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: #a5b4fc; box-shadow: 0 0 0 4px rgba(165,180,252,.18); }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5vw, 3.85rem); letter-spacing: -.045em; line-height: 1.07; margin-bottom: 20px; }
.hero h1 .grad { background: linear-gradient(100deg, #a5b4fc, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { color: #b8c4da; font-size: 1.12rem; max-width: 560px; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 22px; }
.hero-trust span { display: inline-flex; align-items: center; gap: 8px; color: #cbd5e1; font-size: .85rem; }
.hero-trust svg { width: 17px; height: 17px; color: #6ee7b7; }

/* Hero device mockup */
.hero-visual { position: relative; z-index: 1; }
.device {
  position: relative; background: linear-gradient(160deg, #1e293b, #0f172a);
  border: 1px solid rgba(148,163,184,.22); border-radius: 22px; padding: 18px;
  box-shadow: 0 30px 70px rgba(0,0,0,.5); transform: perspective(1000px) rotateY(-6deg) rotateX(3deg);
}
.device-screen {
  aspect-ratio: 16 / 10; border-radius: 13px; padding: 26px;
  background: radial-gradient(120% 120% at 100% 0%, #312e81, #0b1220 60%);
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative;
}
.device-screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.06) 50%, transparent 60%); }
.device-top { display: flex; align-items: center; justify-content: space-between; font-size: .72rem; color: #a5b4fc; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.device-top .wifi { display: flex; gap: 3px; align-items: flex-end; height: 14px; }
.device-top .wifi i { width: 3px; background: #a5b4fc; border-radius: 2px; }
.device-top .wifi i:nth-child(1){height:5px}.device-top .wifi i:nth-child(2){height:9px}.device-top .wifi i:nth-child(3){height:14px}
.device-center { text-align: center; }
.device-center .lbl { color: #94a3b8; font-size: .8rem; margin-bottom: 10px; }
.code-box {
  display: inline-flex; gap: 10px; padding: 14px 20px; border-radius: 14px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  font-size: 1.9rem; font-weight: 800; letter-spacing: .18em; color: #fff; font-variant-numeric: tabular-nums;
}
.device-bottom { text-align: center; color: #94a3b8; font-size: .78rem; }
.device-bottom b { color: #67e8f9; }
.device-stand { width: 90px; height: 12px; background: #1e293b; margin: 0 auto; border-radius: 0 0 8px 8px; }
.device-note {
  position: absolute; bottom: -18px; left: -26px; z-index: 2;
  background: var(--surface); color: var(--ink); border-radius: 14px; padding: 13px 17px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 11px; font-size: .84rem; font-weight: 600;
}
.device-note .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.device-note .ic svg { width: 18px; height: 18px; }
.device-note small { display: block; color: var(--muted); font-weight: 500; font-size: .74rem; }

/* ---------- Section basics ---------- */
.section { padding: 80px 0; }
.section-sm { padding: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 38px; }
.section-head .kicker { color: var(--brand); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin: 0; }
.section-head p { color: var(--muted); margin: 8px 0 0; max-width: 560px; }
.section-head .colored { color: var(--brand); }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: .9rem; white-space: nowrap; }
.text-link svg { width: 16px; height: 16px; transition: transform .18s; }
.text-link:hover svg { transform: translateX(4px); }

/* ---------- Brand quick grid ---------- */
.brands { background: var(--surface); border-bottom: 1px solid var(--line); }
.brand-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.brand-tile {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.brand-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); text-decoration: none; }
.brand-tile .b-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: .95rem; flex-shrink: 0; }
.brand-tile .b-text { min-width: 0; }
.brand-tile .b-text strong { display: block; font-size: .9rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tile .b-text span { font-size: .75rem; color: var(--muted); }
.brand-tile .b-arrow { margin-left: auto; color: var(--muted); width: 16px; height: 16px; }

/* ---------- Post cards ---------- */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card-thumb { height: 158px; position: relative; display: grid; place-items: center; overflow: hidden; }
.card-thumb::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1px); background-size: 16px 16px; }
.card-thumb .thumb-icon { font-size: 2.4rem; font-weight: 800; color: #fff; opacity: .92; letter-spacing: -.04em; z-index: 1; text-shadow: 0 2px 12px rgba(0,0,0,.15); }
.card-thumb .cat-pill {
  position: absolute; top: 14px; left: 14px; z-index: 2; background: rgba(255,255,255,.9);
  color: var(--ink); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(6px);
}
.card-body { padding: 22px 22px 20px; display: flex; flex-direction: column; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .76rem; margin-bottom: 10px; }
.card-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.card-body h3 { font-size: 1.12rem; line-height: 1.35; margin: 0 0 10px; }
.card-body h3 a { color: var(--ink); }
.card-body h3 a:hover { color: var(--brand); text-decoration: none; }
.card-body p { color: var(--muted); font-size: .89rem; margin: 0 0 18px; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; }
.card-foot .read { font-size: .84rem; font-weight: 700; color: var(--brand); display: inline-flex; align-items: center; gap: 6px; }
.card-foot .read svg { width: 15px; height: 15px; transition: transform .18s; }
.card:hover .card-foot .read svg { transform: translateX(4px); }
.card-foot .mins { color: var(--muted); font-size: .76rem; }

/* Compact latest cards */
.latest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mini-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 20px;
  display: block; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.mini-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); text-decoration: none; }
.mini-card .m-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.mini-card .m-badge { font-size: .66rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.mini-card .m-date { color: var(--muted); font-size: .74rem; }
.mini-card h3 { font-size: 1.02rem; line-height: 1.38; margin: 0 0 8px; color: var(--ink); }
.mini-card p { color: var(--muted); font-size: .85rem; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-card .m-read { color: var(--brand); font-weight: 700; font-size: .8rem; display: inline-flex; gap: 6px; align-items: center; }
.mini-card .m-read svg { width: 14px; height: 14px; }
/* Fallback: any un-sized inline icon should stay small */
svg use { pointer-events: none; }
.card-body .icon, .mini-card .icon { width: 16px; height: 16px; }

/* ---------- CTA band ---------- */
.cta-band { padding: 0 0 80px; }
.cta-inner {
  position: relative; overflow: hidden; border-radius: 24px; padding: 52px 56px;
  background: linear-gradient(120deg, #312e81, #4f46e5 55%, #7c3aed);
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.cta-inner::after { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; right: -80px; top: -180px; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 68%); }
.cta-inner h2 { color: #fff; font-size: 1.9rem; margin: 0 0 8px; }
.cta-inner p { color: #dfe3ff; margin: 0; max-width: 560px; }
.cta-inner .btn { flex-shrink: 0; position: relative; z-index: 1; }

/* ---------- Disclaimer callout ---------- */
.disclaimer-box {
  background: #fffaf0; border: 1px solid #f6e3b8; border-radius: 16px; padding: 24px 26px;
  display: flex; gap: 16px; align-items: flex-start;
}
.disclaimer-box .ic { flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; background: #fef3c7; color: #b45309; display: grid; place-items: center; }
.disclaimer-box .ic svg { width: 22px; height: 22px; }
.disclaimer-box h3 { font-size: 1.02rem; margin: 0 0 6px; color: #92400e; }
.disclaimer-box p { color: #78532b; font-size: .89rem; margin: 0 0 8px; }
.disclaimer-box a { color: #92400e; font-weight: 700; text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #cbd5e1; padding: 68px 0 0; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 40px; padding-bottom: 48px; }
.foot-brand .brand-name { color: #fff; }
.foot-brand .brand-mark { margin-bottom: 14px; }
.foot-brand p { color: #94a3b8; font-size: .88rem; max-width: 320px; margin-top: 14px; }
.foot-col h4 { color: #fff; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 16px; }
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin-bottom: 10px; }
.foot-col a { color: #a8b4c8; font-size: .88rem; }
.foot-col a:hover { color: #fff; }
.newsletter p { color: #94a3b8; font-size: .86rem; margin-bottom: 14px; }
.newsletter form { display: flex; gap: 8px; }
.newsletter input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 10px; border: 1px solid #334155;
  background: #111a2e; color: #fff; font-size: .86rem; outline: none;
}
.newsletter input:focus { border-color: var(--brand); }
.newsletter button { padding: 11px 16px; border-radius: 10px; background: var(--brand); color: #fff; border: 0; font-weight: 700; cursor: pointer; }
.newsletter button:hover { background: var(--brand-2); }
.newsletter .note { color: #64748b; font-size: .74rem; margin-top: 10px; }
.foot-bottom { border-top: 1px solid #1e293b; padding: 20px 0; display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.foot-bottom p { margin: 0; color: #64748b; font-size: .8rem; }
.foot-bottom .legal-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-bottom a { color: #94a3b8; font-size: .8rem; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { background: var(--surface); border-bottom: 1px solid var(--line); }
.breadcrumbs .container { display: flex; align-items: center; gap: 8px; padding-top: 15px; padding-bottom: 15px; font-size: .8rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { color: var(--line-strong); }
.breadcrumbs .current { color: var(--ink); font-weight: 600; }

/* ---------- Reading progress ---------- */
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--cyan)); width: 0; z-index: 200; transition: width .1s linear; }

/* ---------- Article / guide layout ---------- */
.article-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 52px 0 44px; }
.article-hero .wrap { max-width: 820px; }
.article-hero .badge { display: inline-flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.article-hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: -.035em; margin-bottom: 16px; }
.article-hero .lead { font-size: 1.1rem; color: var(--muted); margin-bottom: 22px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; color: var(--muted); font-size: .82rem; }
.article-meta span { display: inline-flex; align-items: center; gap: 7px; }
.article-meta svg { width: 15px; height: 15px; color: var(--brand); }
.article-meta .author-av { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; font-size: .7rem; font-weight: 800; }

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 52px; align-items: start; padding: 56px 0 80px; }
.article { max-width: 760px; }
.article p { color: var(--ink-2); }
.article h2 { font-size: 1.65rem; margin: 42px 0 14px; padding-top: 8px; }
.article h3 { font-size: 1.18rem; margin: 28px 0 10px; }
.article .intro { font-size: 1.05rem; color: var(--ink-2); }
.article .callout {
  border-left: 4px solid var(--brand); background: var(--brand-soft); padding: 16px 20px;
  border-radius: 0 12px 12px 0; margin: 24px 0; font-size: .92rem; color: var(--ink-2);
}
.article .callout strong { color: var(--brand); }
.steps { list-style: none; padding: 0; margin: 22px 0; counter-reset: step; }
.steps li {
  position: relative; padding: 0 0 24px 58px; margin-bottom: 4px;
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1rem;
  box-shadow: 0 6px 16px rgba(79,70,229,.25);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 19px; top: 46px; bottom: 4px; width: 2px; background: var(--line); }
.steps li strong { display: block; color: var(--ink); margin-bottom: 3px; }
.steps li p { margin: 0; color: var(--muted); font-size: .94rem; }

.trouble-list { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 12px; }
.trouble-list li { display: flex; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 16px 18px; }
.trouble-list .t-ic { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; background: #fef3c7; color: #b45309; display: grid; place-items: center; }
.trouble-list .t-ic svg { width: 17px; height: 17px; }
.trouble-list strong { display: block; font-size: .94rem; color: var(--ink); }
.trouble-list p { margin: 3px 0 0; font-size: .88rem; color: var(--muted); }

.faq { display: grid; gap: 11px; margin: 20px 0; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 16px 0; list-style: none; color: var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.3rem; font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--muted); font-size: .92rem; padding-bottom: 16px; margin: 0; }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.article-tags a { font-size: .76rem; padding: 5px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.article-tags a:hover { border-color: var(--brand); color: var(--brand); }

/* Sidebar */
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 20px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 20px; }
.side-card h4 { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.toc { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 8px 11px; border-radius: 8px; font-size: .86rem; color: var(--ink-2); border-left: 2px solid transparent; }
.toc a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.related-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.related-links li a { display: flex; gap: 11px; align-items: flex-start; }
.related-links .r-badge { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .8rem; flex-shrink: 0; }
.related-links strong { font-size: .84rem; color: var(--ink); display: block; line-height: 1.35; }
.related-links:hover strong { color: var(--brand); }
.related-links small { color: var(--muted); font-size: .74rem; }
.side-help { background: var(--dark) !important; border: 0 !important; color: #fff; }
.side-help h4 { color: #fff; }
.side-help p { color: #a8b4c8; font-size: .86rem; }
.side-help .btn { width: 100%; }

/* ---------- Legal pages ---------- */
.legal-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 54px 0 42px; }
.legal-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 8px; }
.legal-hero p { color: var(--muted); margin: 0; }
.legal-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding: 52px 0 84px; align-items: start; }
.legal-toc { position: sticky; top: calc(var(--header-h) + 24px); }
.legal-toc h4 { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.legal-toc a { display: block; padding: 8px 12px; border-left: 2px solid var(--line); color: var(--ink-2); font-size: .87rem; }
.legal-toc a:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.legal-doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 44px; box-shadow: var(--shadow-sm); }
.legal-doc .updated { color: var(--muted); font-size: .84rem; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 28px; }
.legal-doc h2 { font-size: 1.35rem; margin: 34px 0 10px; }
.legal-doc h2:first-of-type { margin-top: 0; }
.legal-doc h3 { font-size: 1.04rem; margin: 22px 0 8px; }
.legal-doc p, .legal-doc li { color: var(--ink-2); font-size: .94rem; }
.legal-doc ul, .legal-doc ol { margin-bottom: 1.1em; }
.legal-doc li { margin-bottom: 7px; }
.legal-doc .info-note { background: var(--brand-soft); border-radius: 12px; padding: 16px 20px; font-size: .9rem; color: var(--ink-2); margin: 20px 0; }
.legal-doc a { font-weight: 600; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 10px 24px rgba(79,70,229,.35); opacity: 0; visibility: hidden; transform: translateY(10px); transition: .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 20px; height: 20px; }

/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(11,18,32,.62); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 20px 20px;
}
.search-overlay.open { display: flex; animation: pop .18s ease; }
.search-panel { width: min(620px, 100%); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-panel .search-field { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.search-panel .search-field svg { width: 21px; height: 21px; color: var(--muted); }
.search-panel input { flex: 1; border: 0; outline: none; font-size: 1.05rem; color: var(--ink); background: transparent; }
.search-panel .esc { font-size: .72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; }
.search-results { max-height: 52vh; overflow-y: auto; padding: 10px; }
.search-results a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; color: var(--ink); }
.search-results a:hover { background: var(--brand-soft); text-decoration: none; }
.search-results .s-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .8rem; flex-shrink: 0; }
.search-results strong { display: block; font-size: .9rem; }
.search-results small { color: var(--muted); font-size: .76rem; }
.search-results .no-res { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: .88rem;
  z-index: 400; opacity: 0; transition: .25s; pointer-events: none; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .main-nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 12px 4% 18px; }
  .main-nav.open { display: block; }
  .main-nav > li { width: 100%; }
  .main-nav a, .main-nav > li > button { padding: 12px; font-size: .95rem; width: 100%; justify-content: space-between; }
  .dropdown { position: static; box-shadow: none; border: 0; border-left: 2px solid var(--line); margin: 0 0 6px 12px; padding: 4px 0; display: none; }
  .has-dropdown.open .dropdown { display: block; }
  .menu-toggle { display: grid; }
  .hero-grid { grid-template-columns: 1fr; padding: 64px 0 96px; }
  .hero-visual { max-width: 520px; margin-inline: auto; }
  .device { transform: none; }
  .device-note { left: 10px; }
  .content-layout { grid-template-columns: 1fr; gap: 40px; }
  .sidebar { position: static; grid-template-columns: repeat(2, 1fr); }
  .legal-layout { grid-template-columns: 1fr; gap: 28px; }
  .legal-toc { position: static; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .section { padding: 60px 0; }
  .topbar .container { justify-content: center; }
  .topbar-links { display: none; }
  .header-cta { display: none; }
  .brand-tag { display: none; }
  .brand-grid { grid-template-columns: repeat(2, 1fr); }
  .posts-grid, .latest-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .cta-inner { flex-direction: column; text-align: center; padding: 40px 28px; }
  .cta-inner h2 { font-size: 1.6rem; }
  .device-note { position: static; margin: 16px auto 0; width: fit-content; transform: none; }
  .disclaimer-box { flex-direction: column; }
  .article-hero, .legal-hero { padding: 40px 0 32px; }
  .legal-doc { padding: 26px 22px; }
  .article h2 { font-size: 1.4rem; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .foot-bottom { flex-direction: column; text-align: center; }
  .sidebar { grid-template-columns: 1fr; }
  .steps li { padding-left: 52px; }
}
@media (max-width: 420px) {
  .brand-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.1rem; }
  .code-box { font-size: 1.4rem; letter-spacing: .12em; padding: 12px 14px; }
}
