/* ============================================================
   V&L notes — design system
   Themes: light / dark / system (default: system)
   ============================================================ */

:root {
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  --brand-1: #6366f1;
  --brand-2: #8b5cf6;
  --brand-3: #ec4899;
  --brand-grad: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #ec4899);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 8px 30px rgba(16, 24, 40, .14);
  --header-h: 60px;
}

/* ---------- light (default explicit) ---------- */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-soft: #eef0f7;
  --card: #ffffff;
  --card-2: #f8f9fd;
  --border: #e3e6ef;
  --text: #171a26;
  --text-2: #4b5165;
  --text-3: #8a90a6;
  --accent: #6d5ef0;
  --accent-ink: #ffffff;
  --accent-soft: rgba(109, 94, 240, .1);
  --hover: #f1f2fa;
  --ad-slot: rgba(109, 94, 240, .06);
  --ad-border: #d9dcf0;
  --chip: #eceef8;
  --ok: #059669;
  --code-bg: #f1f2f9;
}

/* ---------- dark ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f17;
  --bg-soft: #121522;
  --card: #161a28;
  --card-2: #1a1f30;
  --border: #262c40;
  --text: #e8eaf3;
  --text-2: #a7adc4;
  --text-3: #6b7191;
  --accent: #8b7cf6;
  --accent-ink: #0d0f17;
  --accent-soft: rgba(139, 124, 246, .14);
  --hover: #1d2334;
  --ad-slot: rgba(139, 124, 246, .07);
  --ad-border: #2a3049;
  --chip: #222842;
  --ok: #34d399;
  --code-bg: #1c2133;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .5);
}

/* ---------- system (default) ---------- */
:root[data-theme="system"] {
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #0d0f17;
    --bg-soft: #121522;
    --card: #161a28;
    --card-2: #1a1f30;
    --border: #262c40;
    --text: #e8eaf3;
    --text-2: #a7adc4;
    --text-3: #6b7191;
    --accent: #8b7cf6;
    --accent-ink: #0d0f17;
    --accent-soft: rgba(139, 124, 246, .14);
    --hover: #1d2334;
    --ad-slot: rgba(139, 124, 246, .07);
    --ad-border: #2a3049;
    --chip: #222842;
    --ok: #34d399;
    --code-bg: #1c2133;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .35);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, .5);
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-soft); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand .tld { color: var(--text-3); font-weight: 500; }

.main-nav { display: flex; gap: 2px; margin-left: 6px; }
.main-nav a {
  color: var(--text-2); font-weight: 500; font-size: 14px;
  padding: 7px 12px; border-radius: 8px;
}
.main-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.main-nav a.active { color: var(--text); background: var(--accent-soft); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- social icons (header + footer) ---------- */
.social-icons { display: flex; align-items: center; gap: 6px; }
.so {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-2); background: transparent;
  transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.so svg { width: 17px; height: 17px; }
.so:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); text-decoration: none; }

.search-box { position: relative; }
.search-box input {
  width: 230px; max-width: 46vw;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-soft); color: var(--text);
  font: inherit; font-size: 14px;
  transition: border-color .15s, background .25s;
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.search-box .mag {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-3); pointer-events: none;
}
.search-results {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: min(420px, 92vw); max-height: 60vh; overflow: auto;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; display: none; z-index: 60;
}
.search-results.open { display: block; }
.search-results .sr-item {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--text); font-size: 14px;
}
.search-results .sr-item:hover { background: var(--hover); text-decoration: none; }
.search-results .sr-item small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.search-results .sr-empty { padding: 12px; color: var(--text-3); font-size: 14px; }
.search-results .sr-head { padding: 8px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }

/* ---------- theme menu (лампочка + выпадающий выбор) ---------- */
.theme-menu { position: relative; }
.theme-bulb {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-3);
  width: 34px; height: 34px; padding: 0; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.theme-bulb:hover,
.theme-menu.open .theme-bulb { color: var(--text); background: var(--card); box-shadow: var(--shadow); }
.theme-bulb svg { width: 17px; height: 17px; }
.theme-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 156px; padding: 5px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  display: none; z-index: 70;
}
.theme-menu.open .theme-dropdown { display: block; }
.theme-dropdown::before { /* маленький хвостик */
  content: ""; position: absolute; top: -5px; right: 13px;
  width: 9px; height: 9px; background: var(--card);
  border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  transform: rotate(45deg); border-radius: 2px 0 0 0;
}
.theme-item {
  position: relative; width: 100%; border: 0; background: transparent;
  color: var(--text-2); padding: 8px 10px; border-radius: 7px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 9px; text-align: left;
  transition: background .15s, color .15s;
}
.theme-item:hover { background: var(--hover); color: var(--text); }
.theme-item.on { color: var(--accent); background: var(--accent-soft); }
.theme-item > svg { width: 15px; height: 15px; flex: none; }
.theme-item .check { margin-left: auto; display: flex; opacity: 0; }
.theme-item .check svg { width: 14px; height: 14px; }
.theme-item.on .check { opacity: 1; }

.lang-switch {
  display: flex; border: 1px solid var(--border); border-radius: 999px;
  overflow: hidden; background: var(--bg-soft); padding: 2px; gap: 2px;
}
.lang-switch button {
  border: 0; background: transparent; color: var(--text-3);
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  letter-spacing: .04em; transition: background .15s, color .15s;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.chip-lang { background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.en-note {
  background: var(--accent-soft); color: var(--text-2);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 12px 0 0;
}

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 300px;
  gap: 22px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 18px 60px;
  align-items: start;
}
.col-left, .col-right { position: sticky; top: calc(var(--header-h) + 16px); }
.col-left { display: flex; flex-direction: column; gap: 18px; }

/* ---------- side cards ---------- */
.side-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow);
}
.side-card h3 {
  margin: 0 0 12px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--text-3);
}

/* agent buttons */
.agent-list { display: flex; flex-direction: column; gap: 8px; }
.agent-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--card-2); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 600; text-align: left;
  transition: transform .12s ease, border-color .15s, background .15s;
  width: 100%;
}
.agent-btn:hover { transform: translateY(-1px); border-color: var(--accent); text-decoration: none; }
.agent-btn.active { border-color: var(--accent); background: var(--accent-soft); }
.agent-btn .ico { width: 26px; height: 26px; flex: none; display: grid; place-items: center; }
.agent-btn .ico svg { width: 24px; height: 24px; }
.agent-btn .ico .agent-logo { width: 26px; height: 26px; object-fit: cover; object-position: center; background: var(--card); }

/* OpenCode: логотип зависит от темы (oc-light — тёмный знак для светлой темы) */
.agent-btn .ico .agent-logo.oc-dark { display: none; }
:root[data-theme="dark"] .agent-btn .ico .agent-logo.oc-light { display: none; }
:root[data-theme="dark"] .agent-btn .ico .agent-logo.oc-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .agent-btn .ico .agent-logo.oc-light { display: none; }
  :root[data-theme="system"] .agent-btn .ico .agent-logo.oc-dark { display: block; }
}

/* Логотип V&L: в тёмной теме инвертируется (чёрный квадрат ↔ белый) */
:root[data-theme="dark"] img[src*="logo.svg"] { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] img[src*="logo.svg"] { filter: invert(1); }
}
.agent-btn small { display: block; font-weight: 400; color: var(--text-3); font-size: 11.5px; margin-top: 1px; }

/* top lists */
.top-list { display: flex; flex-direction: column; gap: 4px; }
.top-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px; border-radius: var(--radius-sm);
  color: var(--text);
}
.top-item:hover { background: var(--hover); text-decoration: none; }
.top-rank {
  flex: none; width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--chip); color: var(--text-2);
  font-size: 12px; font-weight: 700; margin-top: 1px;
}
.top-item:nth-child(1) .top-rank { background: var(--brand-grad); color: #fff; }
.top-item:nth-child(2) .top-rank, .top-item:nth-child(3) .top-rank { background: var(--accent-soft); color: var(--accent); }
.top-item .ti-body { min-width: 0; }
.top-item .ti-title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.35; }
.top-item .ti-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.top-item .ti-desc { font-size: 12.5px; color: var(--text-2); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.top-more { display: block; text-align: center; font-size: 13px; padding: 8px; border-radius: 8px; color: var(--accent); font-weight: 600; }
.top-more:hover { background: var(--accent-soft); text-decoration: none; }

/* nav list in left column */
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-list a, .nav-list button {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; font-weight: 500;
  background: none; border: 0; width: 100%; text-align: left;
}
.nav-list a:hover, .nav-list button:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-list a.active, .nav-list button.active { background: var(--accent-soft); color: var(--accent); }
.nav-list svg { width: 16px; height: 16px; flex: none; }

/* ---------- main feed ---------- */
.feed-head { display: flex; align-items: baseline; gap: 12px; margin: 2px 0 14px; flex-wrap: wrap; }
.feed-head h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
.feed-head .sub { color: var(--text-3); font-size: 13px; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

.post-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
  color: var(--text);
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); text-decoration: none; }
.post-card .pc-cover { aspect-ratio: 16/9; background: var(--bg-soft); overflow: hidden; }
.post-card .pc-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.post-card:hover .pc-cover img { transform: scale(1.03); }
.post-card .pc-body { padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--chip); color: var(--text-2);
}
.chip.cat { background: var(--accent-soft); color: var(--accent); }
.post-card h2 { margin: 0; font-size: 16.5px; line-height: 1.35; letter-spacing: -.01em; }
.post-card .pc-excerpt { margin: 0; font-size: 13.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-meta { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); }
.pc-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

/* ---------- right rail ---------- */
.col-right { display: flex; flex-direction: column; gap: 18px; }
.rail-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px;
  box-shadow: var(--shadow);
}
.rail-card h3 { margin: 0 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.rail-post { display: flex; gap: 10px; padding: 7px 6px; border-radius: var(--radius-sm); color: var(--text); align-items: center; }
.rail-post:hover { background: var(--hover); text-decoration: none; }
.rail-post img { width: 64px; height: 40px; object-fit: cover; border-radius: 7px; flex: none; background: var(--bg-soft); }
.rail-post .rp-t { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rail-post .rp-d { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.rail-post .rp-ph { width: 64px; height: 40px; border-radius: 7px; background: var(--bg-soft); flex: none; }

/* ---------- similar posts (post page) ---------- */
.similar-posts { margin-top: 28px; }
.similar-posts h2 { font-size: 18px; margin: 0 0 14px; }

/* ---------- ad slots ---------- */
.ad-slot {
  position: relative; border: 1px dashed var(--ad-border);
  background: var(--ad-slot); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); text-align: center;
  overflow: hidden;
}
.ad-slot .ad-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px; background: var(--chip); color: var(--text-3);
  position: absolute; top: 6px; left: 8px; z-index: 2;
}
.ad-slot .ad-body { font-size: 12.5px; padding: 8px 14px; }
.ad-leader { height: 90px; margin-bottom: 18px; }
.ad-rail { height: 250px; }
.ad-infeed { min-height: 100px; margin: 4px 0 18px; grid-column: 1 / -1; }
.ad-footer { height: 70px; margin-top: 26px; }

/* ---------- article page ---------- */
.article { max-width: 760px; margin: 0 auto; }
.article .back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.article h1 { font-size: 27px; line-height: 1.25; letter-spacing: -.02em; margin: 6px 0 10px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--text-3); font-size: 13px; margin-bottom: 18px; }
.article-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 22px; border: 1px solid var(--border); }
.article-cover img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.article-body { font-size: 15.5px; line-height: 1.72; color: var(--text); }
.article-body h2 { font-size: 19px; margin: 28px 0 10px; letter-spacing: -.01em; }
.article-body h3 { font-size: 16px; margin: 22px 0 8px; }
.article-body p { margin: 0 0 14px; color: var(--text-2); }
.article-body ul, .article-body ol { margin: 0 0 14px; padding-left: 22px; color: var(--text-2); }
.article-body li { margin-bottom: 6px; }
.article-body code { background: var(--code-bg); padding: 2px 6px; border-radius: 6px; font-size: 13.5px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.article-body pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 15px; overflow: auto; font-size: 13px; line-height: 1.55; }
.article-body pre code { background: none; padding: 0; }
.code-block { position: relative; margin: 0 0 14px; }
.code-block pre { margin: 0; padding-right: 96px; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  border: 1px solid var(--border); background: var(--card); color: var(--text-2);
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 8px;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.copy-btn.copied { background: var(--ok); border-color: var(--ok); color: #fff; }
.article-body blockquote { margin: 0 0 14px; padding: 4px 0 4px 14px; border-left: 3px solid var(--accent); color: var(--text-2); }
.article-body a { font-weight: 500; }
.article-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 22px; }
.tag-chip { color: var(--text-2); }
.tag-chip:hover { color: var(--accent); text-decoration: none; background: var(--accent-soft); }
.views { white-space: nowrap; }

/* ---------- skills / agent pages ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.skill-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s, border-color .15s;
}
.skill-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.skill-card h3 { margin: 0; font-size: 15.5px; }
.skill-card p { margin: 0; font-size: 13.5px; color: var(--text-2); flex: 1; }
.skill-card .sc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }

/* ---------- services page ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.svc-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 9px;
}
.svc-card h3 { margin: 0; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.svc-card .badge-free { font-size: 11px; font-weight: 700; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); padding: 2px 8px; border-radius: 999px; }
.svc-card p { margin: 0; font-size: 13.5px; color: var(--text-2); flex: 1; }
.svc-card .svc-link { font-size: 13.5px; font-weight: 600; }
.svc-card .svc-note { font-size: 12px; color: var(--text-3); }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 80px 20px; }
.notfound h1 { font-size: 40px; margin: 0 0 8px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 26px 18px 34px; text-align: center; color: var(--text-3); font-size: 13px; }
.site-footer .flinks { display: flex; gap: 16px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.site-footer .social-icons { justify-content: center; margin: 6px 0 12px; }
.site-footer a { color: var(--text-2); }

/* ---------- mobile drawer ---------- */
.burger { display: none; width: 38px; height: 38px; border: 1px solid var(--border); background: var(--card); border-radius: 9px; place-items: center; color: var(--text); }
.burger svg { width: 18px; height: 18px; }
.drawer-backdrop { display: none; position: fixed; inset: 0; background: rgba(8, 10, 18, .5); z-index: 90; opacity: 0; transition: opacity .2s; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 84vw); z-index: 95;
  background: var(--card); border-right: 1px solid var(--border);
  transform: translateX(-105%); transition: transform .25s ease;
  padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 16px;
}
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-backdrop { display: block; opacity: 1; }
.drawer .d-head { display: flex; align-items: center; justify-content: space-between; }
.drawer .d-close { border: 0; background: var(--bg-soft); color: var(--text); width: 34px; height: 34px; border-radius: 9px; font-size: 17px; }
.drawer .agent-list { flex-direction: row; flex-wrap: wrap; }
.drawer .agent-btn { width: calc(50% - 4px); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr) 260px; gap: 16px; }
  /* compact header: smaller search */
  .search-box input { width: 160px; }
}
@media (max-width: 1020px) {
  .layout { grid-template-columns: 210px minmax(0, 1fr); }
  .col-right { display: none; }
  .ad-rail { display: none; }
  .main-nav { display: none; }
  .burger { display: grid; }
}
@media (max-width: 760px) {
  .site-header { gap: 8px; padding: 0 12px; }
  .search-box input { width: 130px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 14px 12px 50px; }
  .col-left { position: static; display: none; }
  .col-left.mobile-show { display: flex; }
  .feed-head h1 { font-size: 19px; }
  .post-grid { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .svc-grid { grid-template-columns: 1fr; }
  .article h1 { font-size: 22px; }
  .ad-leader { height: 70px; }
}
@media (max-width: 400px) {
  .brand span.name { display: none; }
  .search-box input { width: 92px; }
  .lang-switch button { padding: 5px 7px; }
  .theme-bulb { width: 32px; height: 32px; }
  .site-header .social-icons { display: none; } /* на узких экранах соц. остаются только в футере */
}

/* ---------- consent banner ---------- */
.consent-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 120;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--card); border-top: 1px solid var(--border);
  padding: 12px 18px; font-size: 13px; color: var(--text-2);
  box-shadow: 0 -4px 20px rgba(0,0,0,.12);
}
.consent-banner span:first-child { max-width: 760px; }
.consent-btns { display: flex; gap: 8px; flex: none; }

/* ---------- misc ---------- */
.hidden { display: none !important; }
.empty-state { text-align: center; color: var(--text-3); padding: 60px 20px; }
kbd { background: var(--chip); border-radius: 5px; padding: 1px 6px; font-size: 12px; font-family: ui-monospace, monospace; }
