:root {
  --bg: #fff;
  --fg: #0f1115;
  --muted: #6b7280;
  --line: #e5e7eb;
  --card: #fff;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #b91c1c;
  --red-soft: #fef2f2;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d10;
    --fg: #f3f4f6;
    --muted: #9ca3af;
    --line: #1f2937;
    --card: #12151a;
    --accent: #60a5fa;
    --accent-soft: #132033;
    --green: #34d399;
    --green-soft: #0d1f19;
    --amber: #fbbf24;
    --amber-soft: #211a08;
    --red: #f87171;
    --red-soft: #2a1416;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  }
}

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

body {
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.hidden-input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- шапка ---------- */
header { border-bottom: 1px solid var(--line); padding: 18px 0; background: var(--bg); }
.hrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo {
  display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px;
  letter-spacing: -.02em; text-decoration: none; color: var(--fg);
}
.dot {
  width: 26px; height: 26px; border-radius: 8px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800;
}
.tag {
  font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line);
  padding: 4px 9px; border-radius: 99px; white-space: nowrap; text-decoration: none;
}

/* ---------- первый экран ---------- */
.hero { padding: 40px 0 20px; text-align: center; }
h1 {
  font-size: clamp(26px, 5vw, 38px); line-height: 1.15;
  letter-spacing: -.03em; font-weight: 800; margin-bottom: 14px;
}
h1 em { color: var(--accent); font-style: normal; }
.sub { color: var(--muted); font-size: 16px; max-width: 580px; margin: 0 auto; }

/* ---------- подбор ---------- */
details.quiz {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  margin: 26px 0 30px; box-shadow: var(--shadow); overflow: hidden;
}
.quiz__head {
  padding: 18px 20px; cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.quiz__head::-webkit-details-marker { display: none; }
.quiz__label { display: flex; flex-direction: column; gap: 3px; }
.quiz__title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.quiz__sub { font-size: 13px; color: var(--muted); }
.quiz__toggle {
  font-size: 13px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 8px 14px; border-radius: 10px; white-space: nowrap;
}
details.quiz[open] .quiz__toggle::after { content: " ×"; }
.quiz__body { padding: 4px 20px 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.question { margin-bottom: 18px; }
.question:last-child { margin-bottom: 0; }
.question > p { font-size: 13.5px; font-weight: 600; margin-bottom: 9px; }
.options { display: flex; gap: 8px; flex-wrap: wrap; }
.options label {
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  padding: 9px 15px; border-radius: 11px; font-size: 13.5px; font-weight: 500;
  cursor: pointer; user-select: none; flex: 1; text-align: center; min-width: 80px;
}

/* ---------- карточки ---------- */
.section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 12px;
}
.list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 10px; }

details.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden;
}
details.card summary { padding: 17px; cursor: pointer; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }

.card__top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card__top h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; }
.benefit {
  background: var(--green-soft); color: var(--green); font-weight: 700;
  font-size: 13px; padding: 5px 11px; border-radius: 9px; white-space: nowrap;
}
.card__desc { color: var(--muted); font-size: 14px; margin-top: 7px; }
.meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; align-items: center; }

.pill {
  font-size: 11.5px; font-weight: 500; padding: 4px 9px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
}
.pill--live { background: var(--green-soft); color: var(--green); font-weight: 600; }
.pill--warn { background: var(--amber-soft); color: var(--amber); }
.pill--grey { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.pill--fit { background: var(--accent); color: #fff; font-weight: 600; }

.more { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 12px; display: block; }
details[open] .more { display: none; }

.card__body {
  padding: 0 17px 17px; border-top: 1px solid var(--line);
  margin-top: 2px; padding-top: 16px;
}
.block { margin-bottom: 17px; }
.block:last-child { margin-bottom: 0; }
.block h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 10px; font-weight: 700;
}
.block ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.block li { font-size: 14.5px; padding-left: 22px; position: relative; }
.block li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.block ol { padding-left: 19px; display: flex; flex-direction: column; gap: 8px; }
.block ol li { font-size: 14.5px; padding-left: 2px; }
.block ol li::before { display: none; }

.alert { background: var(--red-soft); border-radius: 13px; padding: 15px; margin-bottom: 17px; }
.alert h4 {
  color: var(--red); font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 10px; font-weight: 700;
}
.alert ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.alert li { font-size: 14px; padding-left: 22px; position: relative; }
.alert li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
}

.source { font-size: 13.5px; color: var(--muted); }
a.cta {
  display: block; width: 100%; background: var(--accent); color: #fff; padding: 14px;
  border-radius: 13px; font-size: 15px; font-weight: 700; text-align: center;
  margin-top: 8px; text-decoration: none;
}
.cta--off {
  display: block; width: 100%; background: transparent; border: 1px dashed var(--line);
  color: var(--muted); padding: 14px; border-radius: 13px; font-size: 13.5px;
  font-weight: 600; text-align: center; margin-top: 8px;
}

footer {
  border-top: 1px solid var(--line); padding: 22px 0 34px; text-align: center;
  color: var(--muted); font-size: 12.5px; margin-top: 22px; line-height: 1.7;
}

/* ---------- фильтрация подбором, без JS ---------- */
#age-yes:checked ~ main label[for="age-yes"],
#age-no:checked  ~ main label[for="age-no"],
#std-yes:checked ~ main label[for="std-yes"],
#std-no:checked  ~ main label[for="std-no"] {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

#age-no:checked ~ main .needs-age { display: none; }
#std-no:checked ~ main .needs-std { display: none; }

#age-yes:checked ~ main .card.needs-age .fit-age { display: inline-block; }
#std-yes:checked ~ main .card.needs-std .fit-std { display: inline-block; }
.fit-age, .fit-std { display: none; }

@media (max-width: 520px) {
  .card__top { flex-direction: column; gap: 8px; }
  .options label { min-width: 0; }
}

/* =========================================================
   Админка
   ========================================================= */
.admin { max-width: 920px; margin: 0 auto; padding: 24px 20px 70px; }
.admin h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.admin .hint { color: var(--muted); font-size: 14px; }

.toolbar {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; margin-bottom: 20px;
}
.toolbar--split { justify-content: space-between; }

.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  padding: 11px 18px; border-radius: 11px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn--sec { background: var(--card); color: var(--fg); border: 1px solid var(--line); }
.btn--danger { background: var(--red); color: #fff; }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th {
  text-align: left; padding: 10px 12px; color: var(--muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--line);
}
table.grid td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid tr:hover td { background: var(--accent-soft); }
tr.is-hidden td { opacity: .45; }

form.editor label {
  display: block; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin: 18px 0 6px;
}
form.editor input[type="text"],
form.editor input[type="password"],
form.editor textarea,
form.editor select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--card); color: var(--fg); font-size: 15px; font-family: inherit;
}
form.editor textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
form.editor .cols { display: flex; gap: 14px; flex-wrap: wrap; }
form.editor .cols > div { flex: 1; min-width: 200px; }

.checks { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; }
.checks label {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  text-transform: none; letter-spacing: 0; font-weight: 500;
  color: var(--fg); margin: 0;
}
.checks input { width: 18px; height: 18px; }

.flash { padding: 12px 15px; border-radius: 11px; font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.flash--ok { background: var(--green-soft); color: var(--green); }
.flash--error { background: var(--red-soft); color: var(--red); }
.notice {
  background: var(--amber-soft); color: var(--amber); padding: 12px 15px;
  border-radius: 11px; font-size: 13.5px; margin-bottom: 18px;
}

.login-box { max-width: 380px; margin: 90px auto; padding: 0 20px; }
.changes { margin-top: 40px; font-size: 13px; color: var(--muted); }
.changes h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 10px; color: var(--muted);
}
.changes li { list-style: none; padding: 5px 0; border-bottom: 1px solid var(--line); }
