/* ============================================================
   PainRadar design system v2 — light-first, data-product
   Type: Playfair Display (display) · Onest (UI) · JetBrains Mono (data)
   ============================================================ */

:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --surface-2: #efece6;
  --ink: #1b1c1f;
  --ink-dim: #585c63;
  --ink-faint: #6e727a;
  --line: #e5e1d8;
  --line-strong: #d4cfc4;

  --accent: #cf3f36;
  --accent-hover: #b53229;
  --accent-soft: #f9e9e7;
  --accent-ink: #a12b23;

  --money: #157a52;
  --money-soft: #e4f2ea;
  --ai: #6248c9;
  --ai-soft: #eeebf9;
  --warn: #9a6b00;
  --warn-soft: #f8efd9;

  --navy: #12203a;
  --navy-ink: #e9edf5;
  --navy-dim: #9fadc7;

  --shadow: 0 1px 2px rgba(27, 28, 31, .05), 0 8px 24px -12px rgba(27, 28, 31, .12);
  --shadow-lift: 0 2px 4px rgba(27, 28, 31, .06), 0 16px 32px -16px rgba(27, 28, 31, .18);

  --r: 14px;
  --r-sm: 9px;
  --font: 'Onest', 'Segoe UI', system-ui, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141519;
    --surface: #1d1f24;
    --surface-2: #24262c;
    --ink: #eae8e3;
    --ink-dim: #a3a7ae;
    --ink-faint: #9297a1;
    --line: #2c2f36;
    --line-strong: #3a3e46;
    --accent: #ff6b5e;
    --accent-hover: #ff847a;
    --accent-soft: #35211f;
    --accent-ink: #ff8f86;
    --money: #3ecf8e;
    --money-soft: #16291f;
    --ai: #a78bfa;
    --ai-soft: #251f38;
    --warn: #e2b23e;
    --warn-soft: #2b2413;
    --navy: #0e1728;
    --navy-ink: #e9edf5;
    --navy-dim: #8f9db8;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
    --shadow-lift: 0 2px 4px rgba(0,0,0,.4), 0 16px 32px -16px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --bg: #141519;
  --surface: #1d1f24;
  --surface-2: #24262c;
  --ink: #eae8e3;
  --ink-dim: #a3a7ae;
  --ink-faint: #9297a1;
  --line: #2c2f36;
  --line-strong: #3a3e46;
  --accent: #ff6b5e;
  --accent-hover: #ff847a;
  --accent-soft: #35211f;
  --accent-ink: #ff8f86;
  --money: #3ecf8e;
  --money-soft: #16291f;
  --ai: #a78bfa;
  --ai-soft: #251f38;
  --warn: #e2b23e;
  --warn-soft: #2b2413;
  --navy: #0e1728;
  --navy-ink: #e9edf5;
  --navy-dim: #8f9db8;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  --shadow-lift: 0 2px 4px rgba(0,0,0,.4), 0 16px 32px -16px rgba(0,0,0,.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.fine { font-size: .8rem; color: var(--ink-faint); }
.muted { color: var(--ink-faint); }

/* ---------------- topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 28px; height: 62px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.06rem; letter-spacing: -0.01em; }
.logo-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-soft);
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 7px 13px; border-radius: 9px; font-size: .92rem; font-weight: 500;
  color: var(--ink-dim); transition: background .15s, color .15s;
}
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.on { color: var(--ink); background: var(--surface-2); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.lang-switch { display: flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 600; color: var(--ink-faint); }
.lang-switch a { color: var(--ink-faint); padding: 2px 3px; }
.lang-switch a.on { color: var(--ink); border-bottom: 2px solid var(--accent); }
.lang-switch a:hover { color: var(--ink); }

.topbar-menu { display: flex; align-items: center; gap: 28px; flex: 1; min-width: 0; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-left: auto; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .ic-close { display: none; }

/* Мобильная навигация: раскрывающаяся панель вместо скрытой горизонтальной прокрутки —
   в прокручиваемой полосе половина ссылок была не видна и выглядела недоступной. */
@media (max-width: 860px) {
  .topbar-in { height: 56px; gap: 12px; }
  .nav-toggle { display: inline-flex; }
  .topbar-in.open .nav-toggle .ic-open { display: none; }
  .topbar-in.open .nav-toggle .ic-close { display: block; }

  .topbar-menu {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 20px 18px; background: var(--surface);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lift);
    max-height: calc(100dvh - 56px); overflow-y: auto;
  }
  .topbar-in.open .topbar-menu { display: flex; }
  .nav { flex-direction: column; gap: 2px; width: 100%; }
  .nav-link {
    display: flex; align-items: center; min-height: 48px;
    padding: 10px 12px; font-size: 1rem; border-radius: 10px;
  }
  .topbar-right {
    flex-wrap: wrap; gap: 14px; margin-top: 12px; padding-top: 14px;
    border-top: 1px solid var(--line);
  }
  .topbar-right .btn { flex: 1 1 100%; min-height: 48px; order: 3; }
  .lang-switch { font-size: .95rem; }
  .lang-switch a { padding: 10px 8px; }
  .user-menu { width: 100%; justify-content: space-between; }
}

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 10px;
  font-family: var(--font); font-size: .93rem; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: all .15s; line-height: 1.3;
}
.btn:hover { border-color: var(--ink-faint); box-shadow: var(--shadow); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: var(--shadow-lift); }
.btn-money { background: var(--money); border-color: var(--money); color: #fff; }
.btn-money:hover { filter: brightness(1.08); box-shadow: var(--shadow-lift); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 8px 16px; font-size: .86rem; }
.btn-block { width: 100%; }

/* ---------------- hero ---------------- */
.hero { padding: 68px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } }
.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 3.3rem); line-height: 1.12;
  letter-spacing: -0.015em; text-wrap: balance; margin-bottom: 20px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .sub { font-size: 1.06rem; color: var(--ink-dim); max-width: 56ch; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 34px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hstat b { display: block; font-family: var(--mono); font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.hstat span { font-size: .78rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .07em; }

/* live preview card in hero */
.live-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lift); padding: 26px; position: relative;
}
.live-card .lc-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent); margin-bottom: 14px;
}
.lc-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }
.live-card h3 { font-size: 1.18rem; font-weight: 700; line-height: 1.3; margin-bottom: 8px; letter-spacing: -0.01em; }
.live-card .lc-pitch { color: var(--ink-dim); font-size: .93rem; margin-bottom: 18px; }
.lc-score-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.lc-score-num { font-family: var(--mono); font-weight: 600; font-size: 1.05rem; color: var(--money); }

/* ---------------- meters & chips ---------------- */
.meter { flex: 1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 3px; background: var(--money); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-dim); white-space: nowrap;
}
.chip.ai { background: var(--ai-soft); color: var(--ai); }
.chip.money { background: var(--money-soft); color: var(--money); }
.chip.acc { background: var(--accent-soft); color: var(--accent-ink); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.src { font-family: var(--mono); font-size: .7rem; font-weight: 500; }

/* ---------------- sections ---------------- */
.section { padding: 52px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.sec-head h2 { font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 1.85rem); font-weight: 700; letter-spacing: -0.01em; }
.sec-head .more { font-size: .9rem; font-weight: 600; color: var(--accent); }
.sec-head .more:hover { text-decoration: underline; }

/* source strip */
.src-strip {
  display: flex; align-items: center; gap: 10px 26px; flex-wrap: wrap;
  padding: 14px 0; border-top: 1px solid var(--line);
  color: var(--ink-faint); font-size: .84rem;
}
.src-strip b { color: var(--ink-dim); font-weight: 600; }

/* ---------------- cards ---------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }

.icard {
  display: flex; flex-direction: column; gap: 11px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; transition: box-shadow .18s, transform .18s, border-color .18s;
}
a.icard:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: var(--line-strong); }
.icard .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.icard h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.icard .pitch {
  color: var(--ink-dim); font-size: .9rem; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.icard-foot { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.icard-foot .score-num { font-family: var(--mono); font-size: .92rem; font-weight: 600; }
.icard-foot .meta { margin-left: auto; display: flex; gap: 10px; font-size: .78rem; color: var(--ink-faint); white-space: nowrap; }

/* category cards */
.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.ccard {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 16px 18px; transition: box-shadow .15s, border-color .15s;
}
.ccard:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.ccard .cc-top { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; }
.ccard .cc-count { margin-left: auto; font-family: var(--mono); font-size: .8rem; color: var(--ink-faint); }
.ccard .cc-desc { font-size: .8rem; color: var(--ink-faint); line-height: 1.45; }

/* request cards */
.rcard {
  display: flex; flex-direction: column; gap: 11px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--money);
  border-radius: var(--r); padding: 22px; transition: box-shadow .18s, transform .18s;
}
a.rcard:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.rcard h3 { font-size: 1.04rem; font-weight: 700; line-height: 1.35; }
.rcard .pitch { color: var(--ink-dim); font-size: .9rem; flex: 1; }
.pledge { font-family: var(--mono); font-weight: 600; color: var(--money); font-size: 1.08rem; white-space: nowrap; }
.pledge small { display: block; font-size: .68rem; color: var(--ink-faint); font-weight: 400; }
.rcard-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.req-meta { display: flex; gap: 14px; font-size: .79rem; color: var(--ink-faint); flex-wrap: wrap; }

/* ---------------- filters ---------------- */
.filter-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; margin-bottom: 26px; display: flex; flex-direction: column; gap: 14px;
}
.cat-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.cat-pill {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; font-size: .85rem; font-weight: 500;
  background: var(--surface-2); color: var(--ink-dim); border: 1px solid transparent;
  transition: all .15s;
}
.cat-pill:hover { color: var(--ink); border-color: var(--line-strong); }
.cat-pill.on { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-row select, .filter-row input[type=text] {
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--ink);
  padding: 9px 13px; border-radius: 9px; font-family: var(--font); font-size: .89rem;
}
.filter-row input[type=text] { min-width: 210px; flex: 1; max-width: 320px; }
.filter-row select:focus, .filter-row input:focus { outline: none; border-color: var(--accent); }
/* на телефоне разнокалиберные селекты выглядели рвано — растягиваем на всю ширину */
@media (max-width: 560px) {
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-row select, .filter-row input[type=text] { width: 100%; max-width: none; min-height: 46px; }
  .search-box { max-width: none; min-width: 0; }
}

/* ---------------- detail pages ---------------- */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: .84rem; color: var(--ink-faint); padding: 26px 0 0; }
.crumbs a { color: var(--ink-faint); }
.crumbs a:hover { color: var(--accent); }

.detail-head { padding: 18px 0 10px; }
.detail-head h1 {
  font-family: var(--serif); font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 700; line-height: 1.18; letter-spacing: -0.015em;
  text-wrap: balance; margin: 12px 0 14px;
}
.detail-head .pitch { font-size: 1.08rem; color: var(--ink-dim); max-width: 66ch; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }

.detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 26px; padding: 30px 0 60px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.sticky-col { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 900px) { .sticky-col { position: static; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; margin-bottom: 18px; }
.sticky-col .panel { margin-bottom: 0; }
.panel > h3 {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-faint); margin-bottom: 16px; font-weight: 700;
}
.panel p { margin-bottom: 10px; }
.panel p:last-child { margin-bottom: 0; }

.gap-box {
  background: var(--money-soft); border: 1px solid color-mix(in srgb, var(--money) 30%, transparent);
  border-radius: var(--r-sm); padding: 14px 16px; font-size: .92rem; margin-top: 14px;
}

/* score bars */
.score-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.score-big { font-family: var(--mono); font-size: 1.7rem; font-weight: 600; color: var(--money); }
.score-cap { font-size: .8rem; color: var(--ink-faint); }
.sbars { display: flex; flex-direction: column; gap: 9px; }
.sb { display: grid; grid-template-columns: 148px 1fr 24px; align-items: center; gap: 10px; font-size: .84rem; }
.sb .sl { color: var(--ink-dim); }
.sb .sv { font-family: var(--mono); font-size: .8rem; text-align: right; color: var(--ink-dim); }

/* economics box */
.econ-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .89rem; }
.econ-row:last-child { border-bottom: none; }
.econ-row .el { color: var(--ink-dim); }
.econ-row .ev { font-family: var(--mono); font-weight: 600; }

/* evidence */
.evidence-item { border-left: 3px solid var(--line-strong); padding: 4px 0 4px 16px; margin-bottom: 16px; }
.evidence-item .summary { font-size: .95rem; margin-bottom: 5px; }
.evidence-item .src-line { font-size: .8rem; color: var(--ink-faint); }
.evidence-item .src-line a { color: var(--accent); font-weight: 500; }
.evidence-item details { margin-top: 6px; }
.evidence-item summary { cursor: pointer; font-size: .8rem; color: var(--ink-faint); }
.evidence-item blockquote { font-size: .86rem; color: var(--ink-dim); padding: 8px 0 0 2px; white-space: pre-wrap; }

/* competitors */
.comp-item { display: flex; flex-direction: column; gap: 3px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.comp-item:last-child { border-bottom: none; padding-bottom: 0; }
.comp-item .comp-name { font-weight: 600; }
.comp-item .comp-name a { border-bottom: 1px dotted var(--ink-faint); }
.comp-item .comp-name a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.comp-item .plus { color: var(--money); }
.comp-item .minus { color: var(--accent-ink); }

/* brief */
.brief-content { font-size: .93rem; line-height: 1.62; background: var(--surface-2); border-radius: var(--r-sm); padding: 20px 24px; overflow-x: auto; }
.brief-content h2 { font-family: var(--font); font-size: 1rem; margin: 18px 0 8px; color: var(--accent-ink); font-weight: 700; }
.brief-content h2:first-child { margin-top: 0; }
.brief-content h3 { font-size: .95rem; margin: 14px 0 6px; font-weight: 700; }
.brief-content ul, .brief-content ol { padding-left: 22px; margin: 8px 0; }
.brief-content li { margin-bottom: 4px; }
.brief-content p { margin: 8px 0; }
.brief-content code { font-family: var(--mono); font-size: .84em; background: var(--surface); padding: 1px 6px; border-radius: 5px; }

/* ---------------- how it works ---------------- */
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.how-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.how-step .hnum { font-family: var(--mono); font-size: .78rem; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.how-step h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.how-step p { font-size: .88rem; color: var(--ink-dim); }

/* ---------------- navy band ---------------- */
.band { background: var(--navy); color: var(--navy-ink); padding: 58px 0; }
.band-in { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.band h2 { font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px; text-wrap: balance; }
.band p { color: var(--navy-dim); max-width: 56ch; }
.band .btn { flex-shrink: 0; }

/* ---------------- forms ---------------- */
.form-wrap { max-width: 660px; margin: 0 auto; padding: 46px 0 72px; }
.form-wrap.wide { max-width: 820px; }
.form-wrap h1 { font-family: var(--serif); font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 700; margin-bottom: 10px; letter-spacing: -0.01em; }
.form-wrap .sub { color: var(--ink-dim); margin-bottom: 30px; max-width: 58ch; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: .78rem; color: var(--ink-faint); margin-top: 5px; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
  padding: 12px 14px; border-radius: 10px; font-family: var(--font); font-size: .95rem;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; }

.notice { background: var(--money-soft); border: 1px solid color-mix(in srgb, var(--money) 30%, transparent); border-radius: var(--r-sm); padding: 14px 18px; margin-bottom: 18px; font-size: .92rem; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }

/* ---------------- match page ---------------- */
.match-hero { text-align: center; padding: 54px 0 8px; }
.match-hero h1 { font-family: var(--serif); font-size: clamp(1.7rem, 3.8vw, 2.5rem); font-weight: 700; letter-spacing: -0.015em; margin-bottom: 12px; text-wrap: balance; }
.match-hero p { color: var(--ink-dim); max-width: 60ch; margin: 0 auto 8px; }
.examples { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 18px 0 4px; }
.example-chip {
  font-size: .82rem; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-dim);
  transition: all .15s; font-family: var(--font);
}
.example-chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.match-result { margin-bottom: 18px; }
.match-reason {
  background: var(--ai-soft); border-radius: var(--r-sm);
  padding: 12px 16px; font-size: .9rem; color: var(--ink); margin-top: 10px;
}
.match-reason b { color: var(--ai); }

/* ---------------- tables (admin) ---------------- */
.tablebox { overflow-x: auto; }
table.admin { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.admin th, table.admin td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.admin th { color: var(--ink-faint); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.inline-form { display: inline; }

/* ---------------- footer ---------------- */
.footer { background: var(--navy); color: var(--navy-ink); margin-top: 56px; padding: 46px 0 40px; }
.footer .logo { color: var(--navy-ink); }
.footer-in { display: grid; grid-template-columns: 1.4fr .6fr; gap: 40px; }
/* без min-width:0 колонка грида растягивается по min-content формы подписки
   и на узких экранах вылезает горизонтальная прокрутка страницы */
.footer-in > * { min-width: 0; }
@media (max-width: 700px) { .footer-in { grid-template-columns: 1fr; } }
.footer-brand p { color: var(--navy-dim); font-size: .88rem; max-width: 52ch; margin-top: 14px; }
.footer-brand .fine { color: color-mix(in srgb, var(--navy-dim) 70%, transparent); margin-top: 8px; }
.footer-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--navy-dim); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--navy-ink); font-size: .9rem; padding: 4px 0; opacity: .85; }
.footer-col a:hover { opacity: 1; color: #fff; }

/* ---------------- error ---------------- */
.error-wrap { text-align: center; padding: 90px 0; }
.error-wrap .code { font-family: var(--mono); font-size: 3.6rem; font-weight: 600; color: var(--accent); }
.error-wrap p { color: var(--ink-dim); margin: 10px 0 26px; }

/* ---------------- icons ---------------- */
.ic { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -3px; }
.chip .ic, .m-item .ic { width: 13px; height: 13px; vertical-align: -2px; }
.btn .ic { width: 17px; height: 17px; }
.logo-ic { width: 22px; height: 22px; color: var(--accent); vertical-align: -5px; margin-right: 8px; }
.panel > h3 .ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.src-strip .ic { width: 15px; height: 15px; vertical-align: -3px; margin-right: 3px; }
.cc-top .ic { width: 17px; height: 17px; color: var(--ink-dim); }
.cat-pill .ic { width: 14px; height: 14px; vertical-align: -2px; }
.empty-ic { width: 40px; height: 40px; color: var(--ink-faint); }

/* ---------------- header: user ---------------- */
.user-menu { display: flex; align-items: center; gap: 8px; }
.user-name { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--ink-dim); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--ink-faint); cursor: pointer; transition: all .15s;
}
.btn-icon:hover { background: var(--surface-2); color: var(--ink); }

/* ---------------- search box ---------------- */
.search-box { position: relative; display: flex; align-items: center; flex: 1; max-width: 340px; min-width: 220px; }
.search-box > .ic { position: absolute; left: 12px; color: var(--ink-faint); pointer-events: none; }
.search-box input[type=text] {
  width: 100%; max-width: none; min-width: 0;
  padding: 10px 38px 10px 38px;
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--ink);
  border-radius: 9px; font-family: var(--font); font-size: .89rem;
}
.search-box input[type=text]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box .clear-q { position: absolute; right: 4px; width: 30px; height: 30px; }

/* ---------------- active filters ---------------- */
.active-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.af-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-ink); transition: all .15s;
}
.af-chip .ic { width: 12px; height: 12px; }
.af-chip:hover { background: var(--accent); color: #fff; }
.af-reset { font-size: .8rem; color: var(--ink-faint); text-decoration: underline; }
.af-reset:hover { color: var(--accent); }

/* ---------------- like ---------------- */
.head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-top: 16px; flex-wrap: wrap; }
.like-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-family: var(--mono); font-size: .95rem; font-weight: 600; color: var(--ink-dim);
  transition: all .15s; min-height: 44px;
}
.like-btn .ic { width: 18px; height: 18px; }
.like-btn:hover { border-color: var(--accent); color: var(--accent); }
.like-btn.liked { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.icard-foot .meta .m-item { display: inline-flex; align-items: center; gap: 4px; }
/* на узких экранах nowrap-мета (контакты, email) вылезала за карточку */
@media (max-width: 560px) {
  .icard-foot { flex-wrap: wrap; }
  .icard-foot .meta { margin-left: 0; white-space: normal; min-width: 0; }
  .icard-foot .meta .m-item { overflow-wrap: anywhere; }
}
.m-item.good { color: var(--money); }

/* ---------------- builders ---------------- */
.builder-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.builder-item {
  display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.builder-item:last-child { border-bottom: none; }
.b-ava {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-dim);
}
.b-ava .ic { width: 18px; height: 18px; }
.b-info { display: flex; flex-direction: column; gap: 3px; }
.b-name { font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.b-note { font-size: .88rem; color: var(--ink-dim); }
.b-info .fine .ic { width: 12px; height: 12px; vertical-align: -2px; }
.build-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

.mode-toggle { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-opt {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 16px; border-radius: 10px; font-size: .9rem; font-weight: 500;
  border: 1px solid var(--line-strong); background: var(--bg); min-height: 44px;
  transition: all .15s;
}
.mode-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.mode-opt input { accent-color: var(--accent); }
.mode-opt .ic { width: 15px; height: 15px; }

/* ---------------- empty state ---------------- */
.empty-state {
  text-align: center; padding: 56px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  color: var(--ink-dim);
}

/* ---------------- pager ---------------- */
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 34px; flex-wrap: wrap; }
.pager-link, .pager-cur {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 8px; border-radius: 9px;
  font-family: var(--mono); font-size: .88rem; font-weight: 600;
}
.pager-link { color: var(--ink-dim); border: 1px solid var(--line); background: var(--surface); }
.pager-link:hover { border-color: var(--accent); color: var(--accent); }
.pager-cur { background: var(--accent); color: #fff; }
.pager-dots { color: var(--ink-faint); padding: 0 2px; }

/* ---------------- финальные a11y/UX твики ---------------- */
.page-h1 { font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 1.85rem); font-weight: 700; letter-spacing: -0.01em; }
.evidence-item blockquote { overflow-wrap: anywhere; }
.lang-switch a { padding: 8px 6px; }

/* тёмная тема: тёмный текст на ярком акценте (2.79:1 -> 6.5:1) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { color: #141519; }
  :root:not([data-theme="light"]) .af-chip:hover { color: #141519; }
  :root:not([data-theme="light"]) .pager-cur { color: #141519; }
}
:root[data-theme="dark"] .btn-primary { color: #141519; }
:root[data-theme="dark"] .af-chip:hover { color: #141519; }
:root[data-theme="dark"] .pager-cur { color: #141519; }

/* iOS: 16px в полях, чтобы Safari не зумил */
@media (pointer: coarse) {
  .field input, .field textarea, .field select,
  .filter-row select, .search-box input[type=text], .sub-form input { font-size: 16px; }
}

/* подписка в футере */
.footer-sub { margin: 18px 0; padding: 16px; background: color-mix(in srgb, #ffffff 6%, transparent); border-radius: var(--r-sm); max-width: min(420px, 100%); }
.footer-sub h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--navy-ink); margin: 0; }
.sub-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media (max-width: 560px) { .sub-form input[type=email] { flex: 1 1 100%; } .sub-form .btn { flex: 1; } }
.sub-form input[type=email] {
  flex: 1; min-width: 0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2);
  color: var(--navy-ink); padding: 9px 13px; border-radius: 9px; font-family: var(--font); font-size: .9rem;
}
.sub-form input[type=email]::placeholder { color: var(--navy-dim); }
.sub-form input[type=email]:focus { outline: none; border-color: var(--accent); }
.sub-ok { color: var(--money); font-weight: 600; margin-top: 10px; }

/* та же форма на светлом фоне (страница тарифов) */
.sub-form-light input[type=email] {
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
}
.sub-form-light input[type=email]::placeholder { color: var(--ink-faint); }

/* ---------- тарифы ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 18px; align-items: start; }
.plan {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px 22px; box-shadow: var(--shadow);
}
.plan.featured { border-color: var(--accent); box-shadow: var(--shadow-lift); }
.plan-badge {
  position: absolute; top: -11px; left: 22px; background: var(--accent); color: #fff;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 99px;
}
.plan-name { font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
/* Playfair: знак валюты наезжает на цифру при отрицательном трекинге — держим нейтральный */
.plan-price .amount {
  font-family: var(--serif); font-size: 2.5rem; font-weight: 700; line-height: 1;
  letter-spacing: 0; font-variant-numeric: lining-nums tabular-nums;
}
.plan-price .cur { font-family: var(--font); font-size: 1.25rem; font-weight: 600; color: var(--ink-dim); align-self: flex-start; margin: 6px 3px 0 0; }
.plan-price .per { font-size: .95rem; color: var(--ink-faint); }
.plan-feat { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 4px 0 6px; font-size: .9rem; }
.plan-feat li { display: flex; gap: 9px; align-items: flex-start; line-height: 1.45; }
.plan-feat svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 3px; color: var(--money); }
.plan .btn { margin-top: auto; }
.plan-life {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 18px; padding: 16px 22px; border: 1px dashed var(--line-strong);
  border-radius: var(--r); background: var(--surface-2);
}
.plan-status {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  margin-bottom: 24px; padding: 16px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
}
.plan-now { display: block; font-size: 1.05rem; margin-top: 2px; }
.quota-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.quota { font-family: var(--mono); font-size: .84rem; color: var(--ink-dim); }
.quota b { color: var(--ink); }
.plan-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
