:root {
  color-scheme: dark;
  --bg: #07080f;
  --panel: #101421;
  --panel-2: #151b2b;
  --text: #edf2ff;
  --muted: #a6b0c3;
  --line: rgba(203, 213, 225, 0.16);
  --accent: #b8ff3d;
  --cyan: #47e6ff;
  --warning: #ffd166;
  --danger: #ff6b86;
  --btn-text: #07080f;
}

/* Светлая (синяя) тема — переключается кнопкой в шапке */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f4f7fc;
  --panel-2: #eaf0fb;
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, 0.12);
  --accent: #2563eb;
  --cyan: #0ea5e9;
  --warning: #b45309;
  --danger: #dc2626;
  --btn-text: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  padding-bottom: 0;
}

a { color: inherit; }
.site-header, .footer, .trust-bar, .section, .hero {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}
.site-header, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-header {
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}
.brand, .nav, .footer { display: flex; align-items: center; gap: 16px; }
.brand { text-decoration: none; font-weight: 800; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: #071006;
  font-size: 13px;
}
.nav a, .footer a, .secondary-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.nav a:hover, .footer a:hover, .secondary-link:hover { color: var(--text); }
.auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.auth-actions .secondary-button {
  padding: 10px 12px;
  font-size: 13px;
}
.auth-user {
  max-width: 220px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 40px;
  align-items: center;
  padding: 56px 0;
}
.eyebrow {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 820px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1;
  letter-spacing: 0;
  margin-bottom: 24px;
}
h2 { font-size: clamp(28px, 4vw, 46px); line-height: 1.05; margin-bottom: 18px; }
h3 { margin-bottom: 10px; }
.lead { max-width: 760px; color: var(--muted); font-size: 19px; }
.disclaimer, .next-step {
  max-width: 760px;
  color: var(--warning);
  background: rgba(255, 209, 102, .08);
  border: 1px solid rgba(255, 209, 102, .24);
  border-radius: 8px;
  padding: 14px 16px;
}

.domain-form {
  margin-top: 28px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.domain-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}
.input-row { display: flex; gap: 10px; }
input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  background: #080c16;
  color: var(--text);
  border-radius: 8px;
  padding: 15px 14px;
  font: inherit;
}
input:focus {
  outline: 2px solid rgba(71, 230, 255, .25);
  border-color: var(--cyan);
}
button, .telegram-button, .secondary-button, .mobile-sticky-cta {
  border: 0;
  border-radius: 8px;
  padding: 15px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
button, .telegram-button, .mobile-sticky-cta {
  background: var(--accent);
  color: #071006;
}
button:disabled { opacity: .62; cursor: wait; }
.secondary-button {
  display: inline-flex;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.microcopy { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.form-message { min-height: 22px; margin: 10px 0 0; color: var(--danger); font-size: 14px; }
.form-hint { margin: -4px 0 2px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.secondary-link { display: inline-flex; margin-top: 14px; }

.result-card {
  min-height: 520px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}
.card-label {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.fact-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}
.fact-meta div, .blocked, .answer-grid article, .cards-six article, .steps article, .plans article, .fit-grid article, details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, .03);
}
dt { color: var(--muted); font-size: 12px; text-transform: uppercase; }
dd { margin: 4px 0 0; font-weight: 800; }
.limitation { color: var(--muted); }
.blocked ul { margin-bottom: 0; padding-left: 18px; color: var(--muted); }
.telegram-button { display: inline-flex; margin-top: 20px; }
.save-check-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(71, 230, 255, .06);
}
.save-check-panel p {
  margin-bottom: 8px;
}
.save-check-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.auth-inline-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--cyan);
  font-size: 13px;
}
.hidden { display: none !important; }
.loader {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, .12);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.trust-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 0 72px;
}
.trust-bar div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.trust-bar strong { display: block; color: var(--accent); margin-bottom: 4px; }
.trust-bar span, .section p, .steps p, .cards-six p, .answer-grid p, .fit-grid li, .faq p { color: var(--muted); }

.section {
  padding: 84px 0;
  border-top: 1px solid var(--line);
}
.definition p { max-width: 860px; font-size: 19px; }
.answer-grid, .cards-six {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.cards-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.steps span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(71, 230, 255, .1);
  color: var(--cyan);
  font-weight: 800;
  margin-bottom: 16px;
}
.proof-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.proof-table div {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}
.proof-table div + div { border-top: 1px solid var(--line); }
.proof-table span, .proof-table strong {
  padding: 16px;
  border-right: 1px solid var(--line);
}
.proof-table span:last-child, .proof-table strong:last-child { border-right: 0; }
.proof-table strong { color: var(--cyan); background: rgba(71, 230, 255, .06); }
.proof-table span { color: var(--muted); }

.no-overclaim {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  background: rgba(255, 107, 134, .06);
  border: 1px solid rgba(255, 107, 134, .22);
  border-radius: 8px;
  padding: 34px;
}
.no-overclaim ul {
  margin: 0;
  display: grid;
  gap: 10px;
  color: var(--muted);
}
.no-overclaim li::marker { color: var(--danger); }
.fit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.faq-list {
  display: grid;
  gap: 10px;
}
summary { cursor: pointer; font-weight: 800; }
details p { margin: 12px 0 0; }
.final-cta {
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding-left: 24px;
  padding-right: 24px;
}
.final-cta .domain-form {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
.footer {
  min-height: 84px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.wrap {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 80;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #071006;
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }
.header {
  border-bottom: 1px solid var(--line);
}
.header-bar {
  min-height: 72px;
  display: flex;
  align-items: center;
}
.header .nav {
  width: 100%;
  justify-content: space-between;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.nav-links a,
.breadcrumb a,
.footer-grid a {
  color: var(--muted);
  text-decoration: none;
}
.nav-links a:hover,
.breadcrumb a:hover,
.footer-grid a:hover { color: var(--text); }
.header-cta { margin-left: auto; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(184, 255, 61, .3);
  background: var(--accent);
  color: #071006;
  font-weight: 800;
  text-decoration: none;
}
.breadcrumb {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.page-hero {
  padding: 56px 0 34px;
}
.page-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
}
.grid {
  display: grid;
  gap: 16px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card,
.level-row,
.note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.card { padding: 18px; }
.card.acid {
  border-color: rgba(184, 255, 61, .3);
  background: rgba(184, 255, 61, .08);
}
.muted,
.small { color: var(--muted); }
.small { font-size: 14px; }
.soft {
  background: rgba(255, 255, 255, .02);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-head {
  max-width: 820px;
  margin-bottom: 24px;
}
.kv {
  display: grid;
  grid-template-columns: minmax(160px, .35fr) 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.kv dt,
.kv dd {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.kv dt {
  color: var(--text);
  font-weight: 800;
  background: var(--panel-2);
}
.kv dd { color: var(--muted); }
.kv dt:last-of-type,
.kv dd:last-of-type { border-bottom: 0; }
.e-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #071006;
  background: var(--accent);
}
/* status chips: fixed light pastel backgrounds + dark base text,
   so contrast passes in BOTH themes (danger was light-on-light = 2.43). */
.e-chip.warn { background: #ffd166; }
.e-chip.ok { background: #8ff0a4; }
.e-chip.danger { background: #ffb3c1; }
.level-row,
.note {
  padding: 16px;
  margin-bottom: 12px;
}
.footer .wrap { width: 100%; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
  width: 100%;
  padding: 28px 0 20px;
}
.footer-grid h4 {
  margin: 0 0 10px;
  color: var(--text);
}
.footer-grid a {
  display: block;
  margin: 7px 0;
  font-size: 14px;
}
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 14px 0 22px;
  color: var(--muted);
  font-size: 14px;
}
.mobile-sticky-cta { display: none; }
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 8, 15, .78);
}
.auth-dialog {
  width: min(440px, 100%);
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 26px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .46);
}
.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.auth-copy {
  color: var(--muted);
}
.auth-form {
  display: grid;
  gap: 10px;
}
.auth-form label {
  color: var(--muted);
  font-size: 14px;
}
.auth-link {
  background: none;
  border: none;
  color: var(--accent);
  padding: 4px 0;
  font-size: 14px;
  width: auto;
  cursor: pointer;
  text-align: left;
  justify-self: start;
}
.auth-link:hover { text-decoration: underline; }
.consent-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.consent-row input { width: auto; margin-top: 2px; flex: none; }
.consent-row a { color: var(--accent); }
.reset-channel { display: flex; gap: 16px; font-size: 14px; color: var(--muted); }
.reset-channel label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.reset-channel input { width: auto; flex: none; }
.check-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.check-list li { padding-left: 24px; position: relative; color: var(--text); }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

@media (max-width: 980px) {
  .nav { display: none; }
  .header .nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
  }
  .nav-links { display: none; }
  .hero, .no-overclaim, .fit-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .trust-bar, .cards-six, .steps, .grid-3, .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  body { padding-bottom: 76px; }
  .input-row { flex-direction: column; }
  button, .telegram-button, .secondary-button { width: 100%; justify-content: center; }
  .trust-bar, .answer-grid, .cards-six, .steps, .fact-meta { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .footer-grid, .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; }
  .kv dd { padding-top: 0; }
  .header-bar { min-height: 64px; }
  .header-cta { margin-left: 0; width: 100%; }
  .header-cta .btn { width: 100%; }
  .page-hero { padding-top: 34px; }
  .proof-table div { grid-template-columns: 1fr; }
  .proof-table span, .proof-table strong { border-right: 0; border-bottom: 1px solid var(--line); }
  .proof-table span:last-child, .proof-table strong:last-child { border-bottom: 0; }
  .site-header { min-height: 64px; }
  .auth-actions { gap: 8px; }
  .auth-user { max-width: 150px; }
  .auth-actions .secondary-button { width: auto; padding: 9px 10px; }
  .auth-close { width: 34px; }
  .hero { padding-top: 34px; }
  h1 { font-size: 38px; }
  .save-check-actions { display: grid; }
  .mobile-sticky-cta {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 14px;
    z-index: 20;
    display: flex;
    justify-content: center;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .38);
  }
}

/* ---- a11y fixes (Этап A) ---- */
/* CTA button text was rendering muted (#a6b0c3) on lime (#b8ff3d) = 1.8:1 fail.
   Theme-aware text: dark on lime (dark theme), white on blue (light theme). */
a.btn,
.btn { color: var(--btn-text); }
/* Footer column headings styled small so semantic <h3> can replace <h4>
   (fixes heading-order skip h2 -> h4 on subpages). */
.footer .footer-h {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

/* ---- theme toggle (Этап A) ---- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.theme-toggle .theme-toggle-icon { font-size: 15px; line-height: 1; }
/* show the right label/icon per active theme */
.theme-toggle .theme-on-dark { display: inline; }
.theme-toggle .theme-on-light { display: none; }
:root[data-theme="light"] .theme-toggle .theme-on-dark { display: none; }
:root[data-theme="light"] .theme-toggle .theme-on-light { display: inline; }

/* ---- comparison table .matrix (Этап A: used by compare.php) ---- */
.matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
}
.matrix th,
.matrix td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 15px;
}
.matrix th { background: var(--panel-2); font-weight: 700; color: var(--text); }
.matrix tr:last-child td { border-bottom: 0; }
.matrix td { color: var(--muted); }
.matrix b { color: var(--text); }
.matrix .hl,
.matrix th.hl {
  background: var(--panel-2);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.matrix th.hl { color: var(--text); }
@media (max-width: 640px) {
  .matrix { font-size: 13px; }
  .matrix th, .matrix td { padding: 10px; }
}

/* ---- DQS upload widget (П2, verify.php) ---- */
.dqs-form { display: grid; gap: 10px; max-width: 560px; }
.dqs-form select,
.dqs-form input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
.dqs-form label { font-weight: 700; font-size: 14px; }
.dqs-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.dqs-status { font-size: 14px; min-height: 1em; }
.dqs-status.ok { color: var(--accent); }
.dqs-status.warn { color: var(--warning); }
.dqs-verdict { border-left: 4px solid var(--line); }
.dqs-verdict.dqs-green { border-left-color: #16a34a; }
.dqs-verdict.dqs-yellow { border-left-color: #d97706; }
.dqs-verdict.dqs-red { border-left-color: #dc2626; }
.dqs-verdict h3 { font-size: 17px; }
