/* =========================================================================
   htaccess.ru — design system 2026 (Editorial) · Geist · teal · light+dark
   Seeded from design handoff base.css, then retargeted to engine classes.
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  /* type */
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* accent (teal) — shared across themes */
  --accent: #0d9488;
  --accent-bright: #14b8a6;
  --accent-ink: #0f766e;
  --accent-on: #ffffff;

  /* light theme */
  --bg: #ffffff;
  --bg-tint: #f7f8f8;
  --surface: #ffffff;
  --surface-2: #f4f6f6;
  --border: #e7e9e9;
  --border-strong: #d6dad9;
  --text: #0d1117;
  --text-2: #424a52;
  --muted: #79828b;
  --accent-soft: rgba(13, 148, 136, 0.10);
  --accent-line: rgba(13, 148, 136, 0.22);
  --shadow-sm: 0 1px 2px rgba(13, 17, 23, 0.05), 0 1px 3px rgba(13, 17, 23, 0.04);
  --shadow-md: 0 4px 14px rgba(13, 17, 23, 0.06), 0 1px 3px rgba(13, 17, 23, 0.05);
  --shadow-lg: 0 24px 60px -18px rgba(13, 17, 23, 0.18), 0 8px 24px -12px rgba(13, 17, 23, 0.10);
  --code-bg: #0d1117;
  --code-text: #e6edf3;
  --code-surface: #f6f8f8;
}

[data-theme="dark"] {
  --accent: #2dd4bf;
  --accent-bright: #5eead4;
  --accent-ink: #14b8a6;
  --accent-on: #04201c;

  --bg: #0a0c0e;
  --bg-tint: #0d1013;
  --surface: #111418;
  --surface-2: #161a1f;
  --border: #232a30;
  --border-strong: #2e373f;
  --text: #f0f3f4;
  --text-2: #b3bcc4;
  --muted: #7b858e;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-line: rgba(45, 212, 191, 0.26);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 28px 70px -20px rgba(0, 0, 0, 0.7), 0 10px 30px -14px rgba(0, 0, 0, 0.5);
  --code-bg: #05080a;
  --code-text: #d7e2e0;
  --code-surface: #0d1013;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-feature-settings: "cv01", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg { display: block; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 28px; }

/* ---------- code syntax (shared) ---------- */
.t-dir { color: #7ee2c8; }      /* directive */
.t-key { color: #8ab4ff; }      /* flag / key */
.t-str { color: #f0b67f; }      /* string / value */
.t-com { color: #6b7785; }      /* comment */
.t-op  { color: #c9d1d9; }      /* punctuation */

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em;
  padding: 0 18px; height: 44px; border-radius: 11px;
  transition: transform .12s ease, box-shadow .2s, background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--accent); color: var(--accent-on);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { background: var(--accent-ink); box-shadow: 0 6px 18px var(--accent-soft); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 9px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15.5px; border-radius: 12px; }
/* A .btn keeps its own text colour even inside prose — otherwise a broad content link
   rule (e.g. .ref-content a) tints the button text to the accent colour and it blends
   into a filled (accent-background) button. */
.ref-content a.btn { color: var(--accent-on); }
.ref-content a.btn-ghost { color: var(--text); }

/* shared section heading */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--accent); letter-spacing: .02em; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.reveal { animation: reveal-in .65s cubic-bezier(.22,.61,.36,1) both; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* === SITE HEADER (engine classes) === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner { display: flex; align-items: center; gap: 24px; height: 64px; max-width: 1200px; margin-inline: auto; padding-inline: 28px; }

.site-logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.site-logo-mark svg { width: 30px; height: 30px; display: block; box-shadow: 0 2px 8px var(--accent-soft); border-radius: 9px; }
.site-logo-word { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; }
.site-logo-dot { color: var(--accent); }
.site-logo-ru { color: var(--muted); font-weight: 600; }

.site-nav-main > ul { display: flex; align-items: center; gap: 2px; list-style: none; }
.site-nav-main .site-nav-top {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 14.5px; font-weight: 500; color: var(--text-2);
  padding: 8px 12px; border-radius: 8px; transition: color .15s, background .15s;
}
.site-nav-main .site-nav-top:hover { color: var(--text); background: var(--surface-2); }
.site-nav-main .caret { font-size: 10px; opacity: .55; transition: transform .2s; }
.has-mega { position: relative; }

.megamenu {
  position: absolute; top: calc(100% + 8px); left: 0;
  display: grid; grid-template-columns: repeat(var(--mm-cols, 4), minmax(180px, 1fr)); gap: 8px;
  padding: 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.has-mega:hover .megamenu { opacity: 1; visibility: visible; transform: translateY(0); }
.has-mega:hover .caret { transform: rotate(180deg); }
.megamenu-col h4 { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 8px 8px 6px; }
.megamenu-col ul { list-style: none; }
.megamenu-col li a { display: block; padding: 7px 10px; border-radius: 9px; font-size: 14px; color: var(--text-2); transition: background .14s, color .14s; }
.megamenu-col li a:hover { background: var(--surface-2); color: var(--text); }
.megamenu-text { font-size: 13px; color: var(--muted); padding: 0 10px; line-height: 1.55; }
.megamenu-text a, .megamenu-footer a { color: var(--accent); }
.megamenu-footer { padding: 8px 10px 0; font-size: 13px; font-weight: 600; }

.site-search {
  position: relative; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px; min-width: 220px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); transition: border-color .15s, background .15s;
}
.site-search:focus-within { border-color: var(--accent-line); background: var(--surface); }
.site-search-icon { width: 16px; height: 16px; flex: none; }
.site-search input { flex: 1; min-width: 0; border: none; background: none; outline: none; font: inherit; font-size: 13.5px; color: var(--text); }
.site-search input::placeholder { color: var(--muted); }
.site-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 120;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 60vh; overflow-y: auto;
}
.site-search-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 9px; }
.site-search-item:hover, .site-search-item.is-active { background: var(--surface-2); }
.site-search-title { font-size: 14px; font-weight: 600; color: var(--text); }
.site-search-url { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.site-search-empty { padding: 12px; font-size: 13.5px; color: var(--muted); text-align: center; }

.site-theme-toggle {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  border: 1px solid var(--border); background: var(--surface-2);
  display: grid; place-items: center; color: var(--text-2);
  transition: border-color .15s, color .15s, background .15s;
}
.site-theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.site-theme-toggle svg { width: 17px; height: 17px; }
.site-theme-toggle .ic-sun { display: none; }
[data-theme="dark"] .site-theme-toggle .ic-sun { display: block; }
[data-theme="dark"] .site-theme-toggle .ic-moon { display: none; }

.site-burger { display: none; }
@media (max-width: 900px) {
  .site-nav-main, .site-search { display: none; }
  .site-burger {
    display: inline-flex; flex-direction: column; gap: 4px; margin-left: auto;
    width: 38px; height: 38px; border-radius: 10px; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--surface-2);
  }
  .site-burger span { width: 18px; height: 2px; background: var(--text-2); border-radius: 2px; }
  .site-nav-main.is-open {
    display: block; position: fixed; left: 0; right: 0; top: 64px; z-index: 99;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
    padding: 16px 20px 22px; max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .site-nav-main.is-open > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav-main.is-open .site-nav-top { justify-content: space-between; padding: 14px 6px; font-size: 17px; border-bottom: 1px solid var(--border); }
  .site-nav-main.is-open .megamenu { position: static; display: none; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding: 4px 0 10px; background: none; grid-template-columns: 1fr; }
  .site-nav-main.is-open .has-mega.is-open .megamenu { display: grid; }
  body.nav-open { overflow: hidden; }
}

/* === SITE FOOTER (engine classes) === */
.site-footer { background: var(--bg-tint); border-top: 1px solid var(--border); padding: 64px 0 28px; margin-top: 80px; }
.site-footer-inner { max-width: 1200px; margin-inline: auto; padding-inline: 28px; }
.site-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.site-footer-brand .site-logo { margin-bottom: 16px; }
.site-footer-tag { font-size: 13.5px; color: var(--muted); max-width: 280px; line-height: 1.6; }
.site-footer-col h4 { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.site-footer-col ul { list-style: none; }
.site-footer-col a { display: block; font-size: 14px; color: var(--text-2); padding: 5px 0; transition: color .14s; }
.site-footer-col a:hover { color: var(--accent); }
.site-footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.site-footer-bottom a { color: var(--accent); font-weight: 500; }
@media (max-width: 860px) { .site-footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 520px) { .site-footer-grid { grid-template-columns: 1fr; } }

/* === SITE MAIN spacing === */
.site-main { display: block; }

/* === COMPONENTS === */

/* code block (server-highlighted) */
.code { position: relative; border-radius: 13px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--code-bg); margin: 0 0 24px; }
.code .cbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.07); }
.code .cbar .fn { font-family: var(--font-mono); font-size: 12px; color: #8b97a3; }
.code .cbar .cp { margin-left: auto; display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11.5px; color: #8b97a3; cursor: pointer; padding: 5px 9px; border-radius: 7px; border: 1px solid rgba(255,255,255,.1); transition: .14s; }
.code .cbar .cp:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.code .cbar .cp svg { width: 12px; height: 12px; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.9; color: var(--code-text); }
.code pre .cl { white-space: pre; }
/* numbered variant */
.code pre .oln { display: grid; grid-template-columns: 38px 1fr; }
.code pre .oln .ln { text-align: right; padding-right: 14px; color: #3a444e; user-select: none; }
.code pre .oln .cl { white-space: pre-wrap; word-break: break-word; padding-right: 16px; }

/* notes / callouts */
.note { display: flex; gap: 14px; padding: 18px 20px; border-radius: 13px; background: var(--accent-soft); border: 1px solid var(--accent-line); margin: 0 0 24px; }
.note .ni { color: var(--accent); flex: none; }
.note .ni svg { width: 20px; height: 20px; }
.note .nb b { display: block; font-size: 14.5px; font-weight: 650; color: var(--accent-ink); margin-bottom: 3px; }
.note .nb p { font-size: 14.5px; color: var(--text-2); line-height: 1.55; margin: 0; }
.note.warn { background: color-mix(in srgb, #e5a23d 12%, transparent); border-color: color-mix(in srgb, #e5a23d 36%, transparent); }
.note.warn .ni { color: #d98a1f; }
.note.warn .nb b { color: #b9740f; }
[data-theme="dark"] .note.warn .nb b { color: #f0b86a; }

/* form controls */
.switch { position: relative; width: 42px; height: 24px; flex: none; display: inline-block; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background .18s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }

.input-mono { height: 40px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-family: var(--font-mono); font-size: 13px; width: 100%; transition: border-color .15s, box-shadow .15s; }
.input-mono:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-mono::placeholder { color: var(--muted); font-family: var(--font-sans); }

.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented label { font-size: 12.5px; font-weight: 500; color: var(--text-2); padding: 6px 12px; border-radius: 7px; cursor: pointer; transition: .14s; white-space: nowrap; }
.segmented input { display: none; }
.segmented input:checked + label { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-sm); }

/* native <details> accordion */
.accordion { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 12px 0; background: var(--surface); }
.accordion > summary { font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary::after { content: "▾"; color: var(--muted); transition: transform .2s; }
.accordion[open] > summary::after { transform: rotate(180deg); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .12s ease, border-color .2s; }
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
a.card:hover { transform: translateY(-2px); }

/* chips / pills */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 13px; font-weight: 550; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: .14s; }
.chip:hover { border-color: var(--border-strong); }
.chip.on { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.chip .ct { font-family: var(--font-mono); opacity: .65; margin-left: 5px; }

/* section heading «§ 0N» */
.shead { display: flex; align-items: baseline; gap: 12px; padding-bottom: 14px; margin: 0 0 24px; border-bottom: 2px solid var(--text); }
.shead .sn { font-family: var(--font-mono); font-size: 14px; color: var(--accent); font-weight: 500; }
.shead h2 { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; color: var(--text); }

/* breadcrumbs */
.crumbs { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--accent); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14.5px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tbl th { color: var(--muted); font-weight: 600; }

/* content page hero (eyebrow reused from SP0) */
.page-hero { padding: 56px 0 28px; }
.page-hero h1 { font-size: clamp(30px, 4.5vw, 46px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; color: var(--text); margin: 14px 0 0; }
.page-hero .lead { margin-top: 14px; font-size: 17px; color: var(--text-2); max-width: 760px; line-height: 1.6; }

/* inline code */
.ic { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; color: var(--accent-ink); }

/* === PAGE: HOME (editorial) === */
.home .wrap { max-width: 1140px; }

.home .hero { padding: 64px 0 40px; }
.home .hero-meta { display: flex; align-items: center; gap: 16px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); letter-spacing: .02em; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.home .hero-meta b { color: var(--accent); font-weight: 500; }
.home .hero-meta .sp { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.home .hero-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 50px; align-items: end; padding-top: 38px; }
.home h1.head { font-size: clamp(44px, 6vw, 82px); line-height: 0.96; letter-spacing: -0.045em; font-weight: 800; }
.home h1.head .ac { color: var(--accent); }
.home h1.head .lead { color: var(--accent); }
.home .hero-side { padding-bottom: 8px; }
.home .hero-side p { font-size: 17.5px; line-height: 1.62; color: var(--text-2); margin-bottom: 24px; }
.home .hero-side .btns { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.home .feature { margin-top: 56px; border-radius: 22px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-md); display: grid; grid-template-columns: 1.15fr 1fr; }
.home .feature-l { padding: 44px 46px; display: flex; flex-direction: column; justify-content: center; }
.home .feature-l .tag { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; }
.home .feature-l h2 { font-size: 34px; letter-spacing: -0.03em; font-weight: 750; line-height: 1.08; }
.home .feature-l p { font-size: 16px; color: var(--text-2); line-height: 1.6; margin: 14px 0 26px; max-width: 42ch; }
.home .feature-r { background: var(--code-bg); padding: 30px 32px; font-family: var(--font-mono); font-size: 13px; line-height: 2; color: var(--code-text); position: relative; }
.home .feature-r::before { content: "~/public_html/.htaccess"; position: absolute; top: 14px; right: 20px; font-size: 11px; color: #5a6671; }
.home .feature-r .l { white-space: pre; }

.home section.block { padding: 88px 0; }
.home .hsec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 22px; margin-bottom: 38px; border-bottom: 2px solid var(--text); }
.home .hsec-head .lhs { display: flex; align-items: baseline; gap: 18px; }
.home .hsec-head .sn { font-family: var(--font-mono); font-size: 15px; color: var(--accent); font-weight: 500; }
.home .hsec-head h2 { font-size: clamp(30px, 3.6vw, 46px); letter-spacing: -0.035em; font-weight: 800; line-height: 1; }
.home .hsec-head .rhs { font-size: 14.5px; color: var(--muted); white-space: nowrap; }
.home .hsec-head .rhs a { color: var(--accent); font-weight: 500; }

.home .index { display: grid; grid-template-columns: 1fr 1fr; gap: 0 64px; }
.home .ixrow { display: grid; grid-template-columns: 30px 1fr auto; gap: 16px; align-items: baseline; padding: 17px 0; border-bottom: 1px solid var(--border); transition: padding .16s, color .16s; }
.home .ixrow:hover { padding-left: 8px; }
.home .ixrow .ixn { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.home .ixrow .ixname { font-family: var(--font-mono); font-size: 16px; font-weight: 500; color: var(--text); }
.home .ixrow:hover .ixname { color: var(--accent-ink); }
.home .ixrow .ixd { font-size: 13px; color: var(--muted); text-align: right; }

.home .gcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.home .gcard { display: flex; flex-direction: column; padding-top: 22px; border-top: 2px solid var(--text); transition: border-color .18s; }
.home .gcard:hover { border-color: var(--accent); }
.home .gcard .gk { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 16px; }
.home .gcard h3 { font-size: 23px; letter-spacing: -0.02em; font-weight: 700; line-height: 1.14; }
.home .gcard p { font-size: 14.5px; color: var(--text-2); line-height: 1.58; margin: 12px 0 20px; flex: 1; }
.home .gcard .gmeta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.home .gcard .gmeta .read { font-family: var(--font-mono); }
.home .gcard .arrow { margin-left: auto; transition: transform .16s; color: var(--text); }
.home .gcard:hover .arrow { transform: translateX(4px); color: var(--accent); }

.home .toolrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.home .tcard { padding: 24px 22px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); transition: transform .16s, box-shadow .18s, border-color .18s; }
.home .tcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.home .tcard .tn { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.home .tcard h4 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin: 14px 0 6px; }
.home .tcard p { font-size: 13px; color: var(--muted); line-height: 1.5; }

.home .cms-ed { display: grid; grid-template-columns: 1fr 1.25fr; gap: 50px; align-items: center; }
.home .cms-ed h2 { font-size: clamp(30px,3.4vw,42px); letter-spacing: -0.035em; font-weight: 800; line-height: 1.04; }
.home .cms-ed p { font-size: 16.5px; color: var(--text-2); line-height: 1.6; margin: 18px 0 26px; }
.home .cms-list { display: flex; flex-direction: column; }
.home .cms-li { display: flex; align-items: center; justify-content: space-between; padding: 16px 4px; border-top: 1px solid var(--border); font-size: 17px; font-weight: 550; transition: padding .15s, color .15s; }
.home .cms-li:last-child { border-bottom: 1px solid var(--border); }
.home .cms-li:hover { padding-left: 12px; color: var(--accent-ink); }
.home .cms-li .v { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); font-weight: 400; }

@media (max-width: 920px) {
  .home .hero-grid, .home .feature, .home .cms-ed { grid-template-columns: 1fr; gap: 30px; }
  .home .index { grid-template-columns: 1fr; gap: 0; }
  .home .gcards { grid-template-columns: 1fr; gap: 18px; }
  .home .toolrow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .home .hero { padding: 32px 0 28px; }
  .home .hero-meta { flex-wrap: wrap; gap: 8px 14px; }
  .home .hsec-head { flex-wrap: wrap; gap: 10px 16px; align-items: baseline; }
  .home .hsec-head .rhs { width: 100%; }
  .home .feature-l { padding: 30px 26px; }
  .home .feature-r { padding: 24px 22px; }
  .home .toolrow { grid-template-columns: 1fr; }
  .home section.block { padding: 56px 0; }
}

/* === PAGE: TOOLS === */
.tool-hero { padding: 48px 0 10px; }
.tool-hero h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.04; color: var(--text); }
.tool-hero .lead { margin-top: 14px; font-size: 17px; color: var(--text-2); line-height: 1.6; max-width: 760px; }
.tool-hero p { font-size: 14.5px; color: var(--muted); line-height: 1.6; margin-top: 10px; max-width: 820px; }
.tool-hero a { color: var(--accent); font-weight: 500; }

.tool-body { padding: 28px 0 64px; }

/* analyzer (single input -> result) */
.analyzer { max-width: 860px; }
.analyzer label.fld { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.analyzer textarea { width: 100%; min-height: 280px; resize: vertical; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-family: var(--font-mono); font-size: 13px; line-height: 1.7; transition: border-color .15s, box-shadow .15s; }
.analyzer textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.analyzer .submit-row { margin-top: 16px; }
.result-block { margin: 28px 0 0; }
.result-summary { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.result-summary.ok { color: var(--accent-ink); }
.finding { display: grid; gap: 6px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 10px; background: var(--surface); }
.finding.error { border-color: color-mix(in srgb, #e5484d 40%, var(--border)); }
.finding.warn { border-color: color-mix(in srgb, #e5a23d 40%, var(--border)); }
.finding .ln-no { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.finding .ln-code { font-family: var(--font-mono); font-size: 12.5px; background: var(--code-bg); color: var(--code-text); padding: 8px 12px; border-radius: 8px; overflow-x: auto; margin: 0; }
.finding .msg { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.finding-group h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 18px 0 10px; }
.finding .sev { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-bottom: 4px; }
.finding .sev-high { background: color-mix(in srgb, #e5484d 16%, transparent); color: #c92a2f; }
.finding .sev-medium { background: color-mix(in srgb, #e5a23d 18%, transparent); color: #b9740f; }
.finding .sev-low { background: var(--surface-2); color: var(--muted); }
[data-theme="dark"] .finding .sev-high { color: #ff8a8e; }
[data-theme="dark"] .finding .sev-medium { color: #f0b86a; }

/* builder (generator) - 2 columns */
.layout { display: grid; grid-template-columns: 1fr 462px; gap: 28px; align-items: start; }
.builder { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.preset { font-size: 13px; font-weight: 550; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; transition: .15s; }
.preset:hover { border-color: var(--accent); color: var(--accent-ink); }
.block2 { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.block2 > summary { display: flex; align-items: center; gap: 14px; padding: 18px 22px; cursor: pointer; user-select: none; list-style: none; }
.block2 > summary::-webkit-details-marker { display: none; }
.block2 .bt { font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; }
.block2 .chev2 { margin-left: auto; color: var(--muted); transition: transform .2s; }
.block2[open] .chev2 { transform: rotate(180deg); }
.b-body { padding: 4px 22px 18px; }
.row2 { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.row2:first-child { border-top: none; }
.row2 .grow { flex: 1; min-width: 0; }
.row2 .lbl { font-size: 14.5px; font-weight: 500; color: var(--text); }
.row2 .hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row2 select { height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-family: var(--font-mono); font-size: 13px; }
/* Rows whose control is a full-width text field stack the field BELOW its label, so the
   100%-wide input never overlaps/squeezes the label (numeric & select fields keep their
   fixed inline width and stay inline). */
.row2:has(> input[type="text"].input-mono):not(:has(> .switch)) { flex-direction: column; align-items: stretch; gap: 8px; }
.row2:has(> input[type="text"].input-mono):has(> .switch) { display: grid; grid-template-columns: 1fr auto; column-gap: 14px; row-gap: 8px; align-items: center; }
.row2:has(> input[type="text"].input-mono):has(> .switch) > .grow { grid-column: 1; grid-row: 1; }
.row2:has(> input[type="text"].input-mono):has(> .switch) > .switch { grid-column: 2; grid-row: 1; }
.row2:has(> input[type="text"].input-mono):has(> .switch) > .input-mono { grid-column: 1 / -1; grid-row: 2; }
.sub-fields { padding: 6px 0 2px; display: grid; gap: 8px; }
.sub-fields.hide { display: none; }

/* output panel (sticky) */
.out-panel { position: sticky; top: 84px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--code-bg); box-shadow: var(--shadow-lg); }
.out-bar { display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.07); }
.out-bar .fn { font-family: var(--font-mono); font-size: 13px; color: #cdd6df; }
.out-bar .ct { font-family: var(--font-mono); font-size: 11.5px; color: #6b7785; }
.out-acts { margin-left: auto; display: flex; gap: 8px; }
.out-acts button { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; color: #cdd6df; padding: 7px 11px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); cursor: pointer; transition: .14s; }
.out-acts button:hover { border-color: rgba(255,255,255,.3); color: #fff; }
.out-acts button.primary { background: var(--accent); color: var(--accent-on); border-color: transparent; }
.out-acts button svg { width: 13px; height: 13px; }
.out-code { padding: 16px 0; max-height: calc(100vh - 200px); overflow: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.95; }
.out-code .oln { display: grid; grid-template-columns: 38px 1fr; }
.out-code .oln .ln { text-align: right; padding-right: 14px; color: #3a444e; user-select: none; }
.out-code .oln .cl { white-space: pre-wrap; word-break: break-word; color: var(--code-text); padding-right: 16px; }
.out-empty { padding: 30px 20px; color: #6b7785; font-family: var(--font-mono); font-size: 12.5px; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; gap: 24px; }
  .out-panel { position: static; }
  .out-code { max-height: 440px; }
}

/* explain tool */
.explain-list { display: flex; flex-direction: column; gap: 4px; }
.explain-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.explain-row:last-child { border-bottom: none; }
.explain-row .ln-no { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-right: 6px; }
.explain-row .msg { font-size: 14px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }

/* --- diff tool --- */
.diff-list { display: flex; flex-direction: column; gap: 2px; margin: 12px 0; }
.diff-row { font-family: var(--font-mono); font-size: 13px; padding: 6px 10px; border-radius: 7px; background: var(--surface-2); color: var(--text); }
.diff-row.diff-add { background: rgba(13, 148, 136, 0.08); color: var(--text); }
.diff-row.diff-del { background: rgba(220, 38, 38, 0.07); color: var(--text); }
.diff-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.diff-two textarea { width: 100%; min-height: 240px; resize: vertical; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-family: var(--font-mono); font-size: 13px; line-height: 1.7; box-sizing: border-box; }
.diff-two textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 720px) { .diff-two { grid-template-columns: 1fr; } }

/* unified status markers */
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st-ok { color: var(--accent-ink); } .st-ok::before { background: var(--accent); }
.st-warn { color: #b9740f; } .st-warn::before { background: #e5a23d; }
.st-bad { color: #c92a2f; } .st-bad::before { background: #e5484d; }
.st-info { color: var(--muted); } .st-info::before { background: var(--muted); }
[data-theme="dark"] .st-warn { color: #f0b86a; }
[data-theme="dark"] .st-bad { color: #ff8a8e; }

/* --- sandbox panels & trace --- */
.sandbox-panel { padding: 22px 0; border-top: 1px solid var(--border); }
.sandbox-panel:first-of-type { border-top: none; padding-top: 0; }
.sandbox-panel > h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin-bottom: 14px; }
.trace-report { display: flex; flex-direction: column; gap: 10px; }
.trace-final { font-weight: 600; color: var(--text); padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.trace-step { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.trace-step.is-match { border-color: var(--accent-line); }
.trace-step.is-skip { opacity: .65; }
.trace-step .trace-line { color: var(--muted); }
.trace-cond { color: var(--text-2); padding-left: 12px; }
.trace-step .ok, .trace-report .ok { color: var(--accent-ink); font-weight: 600; }
.trace-step .no, .trace-report .no { color: #c92a2f; font-weight: 600; }
[data-theme="dark"] .trace-step .no, [data-theme="dark"] .trace-report .no { color: #ff8a8e; }
.trace-notes { margin: 6px 0 0 18px; font-size: 13px; color: var(--muted); }
.trace-step code, .trace-cond code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

/* check-grid (geo-block country list) */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; margin: 10px 0; }
.check-grid label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }

/* builder (SP3d) */
.builder-row { gap: 10px; }
.builder-order { width: 56px; flex: none; text-align: center; padding: 0 6px; }
.builder-params { margin: 0 0 12px 66px; }
.builder-params label { display: block; margin-bottom: 6px; }
.builder-params .input-mono { max-width: 22em; margin-top: 3px; }

/* === PAGE: REFERENCE === */
.ref-layout { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; padding: 28px 0 64px; }
.ref-toc { position: sticky; top: 84px; align-self: start; }
.ref-toc .ref-toc-title { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.ref-toc .ref-toc-group { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.ref-toc .ref-toc-group:first-of-type { margin-top: 4px; }
.ref-toc a { display: block; padding: 6px 10px; border-left: 2px solid var(--border); font-size: 13.5px; color: var(--text-2); transition: color .14s, border-color .14s; line-height: 1.4; }
.ref-toc a:hover { color: var(--text); }
.ref-toc a.on { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 600; }
.ref-toc .cn { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-left: 6px; }
.ref-content { min-width: 0; }
.ref-content > h2 { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; color: var(--text); margin: 40px 0 14px; scroll-margin-top: 88px; }
.ref-content > h2:first-child { margin-top: 0; }
.ref-content p { font-size: 15.5px; color: var(--text-2); line-height: 1.7; margin: 12px 0; }
.ref-content ul { list-style: none; margin: 12px 0; }
.ref-content > ul > li { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15px; color: var(--text-2); line-height: 1.7; }
.ref-content > ul > li:last-child { border-bottom: none; }
.ref-content a { color: var(--accent); font-weight: 500; }
.ref-syntax { font-family: var(--font-mono); font-size: 13px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; margin: 6px 0; display: inline-block; }

/* cheatsheet */
.sheet-search { position: sticky; top: 64px; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); padding: 14px 0; }
.sheet-search input { width: 100%; max-width: 480px; height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 15px; }
.sheet-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sheet-group { padding: 8px 0 12px; scroll-margin-top: 130px; }
.sheet-group > h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin: 20px 0 14px; }
.snips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.snip { display: flex; flex-direction: column; gap: 8px; }
.snip-head { font-size: 14.5px; font-weight: 600; color: var(--text); }
.sheet-empty { padding: 30px 0; color: var(--muted); font-size: 14px; }

/* tools hub grid */
.toolgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.toolgrid a.card { text-decoration: none; }

@media (max-width: 920px) {
  .ref-layout { grid-template-columns: 1fr; gap: 20px; }
  .ref-toc { position: static; }
  .snips { grid-template-columns: 1fr; }
}

/* === PAGE: ARTICLE === */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: transparent; pointer-events: none; }
.reading-progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .08s linear; }
.article-prose { max-width: 820px; margin: 0 auto; padding: 28px 0 64px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item > summary { list-style: none; cursor: pointer; padding: 16px 0; font-size: 16px; font-weight: 600; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: "+"; font-family: var(--font-mono); font-size: 18px; color: var(--muted); transition: transform .15s; }
.faq-item[open] > summary::after { content: "\2212"; }
.faq-item > summary:hover { color: var(--accent-ink); }
.faq-item .faq-a { padding: 0 0 18px; font-size: 15.5px; color: var(--text-2); line-height: 1.7; }
.faq-item .faq-a a { color: var(--accent); font-weight: 500; }

/* === LEGACY BRIDGE (temporary — removed per migrated group) ===
   Старая структурная разметка шаблонов до их миграции в SP2–SP7.
   Удалять блоками по мере перевода каждой группы страниц. */

/* контейнер и каркас страницы */
#main { display: block; }
#main .container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 28px; }

/* hero (#insight) */
#insight { padding: 56px 0 28px; }
#insight h1 { font-size: clamp(30px, 4.5vw, 46px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; color: var(--text); }
#insight p { margin-top: 14px; font-size: 17px; color: var(--text-2); max-width: 760px; line-height: 1.6; }
#insight a { color: var(--accent); font-weight: 500; }

/* контентные секции */
#track, #unbiased { padding: 28px 0; }
#track .copy, #unbiased .copy { max-width: 820px; }
.copy h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 36px 0 14px; color: var(--text); }
.copy h3 { font-size: 20px; font-weight: 700; margin: 28px 0 10px; color: var(--text); }
.copy p { font-size: 16px; color: var(--text-2); line-height: 1.7; margin: 12px 0; }
.copy ul, .copy ol { margin: 12px 0 12px 22px; }
.copy li { font-size: 16px; color: var(--text-2); line-height: 1.7; margin: 6px 0; }
.copy a { color: var(--accent); font-weight: 500; }
.copy a:hover { color: var(--accent-ink); }

/* inline code + блоки кода */
.copy code, #insight code, .info-list code {
  font-family: var(--font-mono); font-size: .9em;
  background: var(--accent-soft); color: var(--accent-ink);
  padding: 2px 6px; border-radius: 6px;
}
pre, .copy pre {
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6;
  background: var(--code-bg); color: var(--code-text);
  padding: 16px 18px; border-radius: 14px; overflow-x: auto; margin: 16px 0;
}
pre code { background: none; color: inherit; padding: 0; }

/* списки-ссылки в info/* */
.info-list { list-style: none; margin: 14px 0; }
.info-list li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 15.5px; color: var(--text-2); line-height: 1.6; }
.info-list li:last-child { border-bottom: none; }
.info-list b { color: var(--text); }

/* старые кнопки */
.btn:not(.btn-primary):not(.btn-ghost):not(.generator) { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn:not(.btn-primary):not(.btn-ghost):not(.generator):hover { background: var(--surface-2); border-color: var(--muted); }
.btn.generator { background: var(--accent); color: var(--accent-on); }

/* генератор (.gen-*) — минимальная читабельность до SP3 */
.gen { max-width: 860px; }
.gen-lead { font-size: 15px; color: var(--text-2); margin: 12px 0 20px; line-height: 1.6; }
.gen-section { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 12px 0; background: var(--surface); }
.gen-section > summary { font-weight: 600; color: var(--text); cursor: pointer; }
.gen-output { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin: 16px 0; }
.gen-output-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.gen-output-title { font-weight: 600; font-size: 14px; }
.gen-output-code { font-family: var(--font-mono); font-size: 13.5px; background: var(--code-bg); color: var(--code-text); padding: 16px 18px; overflow-x: auto; }
.gen-copy { background: var(--accent); color: var(--accent-on); padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.gen-error, .gen-errors { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--text); padding: 12px 14px; border-radius: 12px; margin: 12px 0; }

/* старые таблицы */
.copy table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14.5px; }
.copy th, .copy td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.copy th { color: var(--muted); font-weight: 600; }
