/* База инцидентов фридайвинга — светлая тема, один акцентный синий.
   Палитра и правила графиков — по методике dataviz (sequential blue). */

:root {
  --bg: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, .10);

  --accent: #2a78d6;      /* series */
  --accent-deep: #1c5cab; /* hover / текстовые акценты (4.5:1) */
  --accent-dark: #104281;
  --accent-soft: #cde2fb;

  --fatal: #d03b3b;       /* статус critical */
  --injury: #ec835a;      /* статус serious */
  --ok: #0ca30c;          /* статус good */

  --report: #ff5a36;      /* акцент CTA «Сообщить о случае» */
  --report-dark: #e04424;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--accent-deep); }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 18px; }

/* ---------- Шапка ---------- */
header.site {
  background: linear-gradient(180deg, #0b2545 0%, #123a6b 60%, #1c5cab 100%);
  color: #fff;
  padding-bottom: 44px;
}
.nav { display: flex; align-items: center; gap: 20px; padding: 16px 0; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: #fff; text-decoration: none; }
.logo svg { display: block; }
.nav .links { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.nav .links a { color: #cfe1f7; text-decoration: none; font-size: 15px; }
.nav .links a:hover, .nav .links a.on { color: #fff; }

/* Акцентная кнопка «Сообщить о случае» в шапке */
.nav .links a.btn-report {
  background: var(--report); color: #fff; font-weight: 700;
  padding: 8px 16px; border-radius: 10px;
  box-shadow: 0 2px 10px rgba(255, 90, 54, .45);
}
.nav .links a.btn-report:hover { background: var(--report-dark); color: #fff; }

.langs { display: flex; gap: 2px; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 2px; }
.langs a { color: #cfe1f7; text-decoration: none; font-size: 12.5px; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
.langs a:hover { color: #fff; }
.langs a.on { background: #fff; color: #123a6b; }

.hero { padding-top: 28px; max-width: 720px; }
.hero h1 { font-size: clamp(26px, 4.5vw, 38px); line-height: 1.2; margin: 0 0 14px; }
.hero p { color: #cfe1f7; margin: 0 0 22px; font-size: 17px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 10px; font-weight: 600;
  text-decoration: none; font-size: 15px; border: 1px solid transparent; cursor: pointer;
}
.btn.primary { background: #fff; color: #123a6b; }
.btn.primary:hover { background: #e9f1fb; }
.btn.ghost { border-color: rgba(255,255,255,.45); color: #fff; }
.btn.ghost:hover { border-color: #fff; }
.btn.accent { background: var(--accent-deep); color: #fff; border-color: var(--accent-deep); }
.btn.accent:hover { background: var(--accent-dark); }

/* Главный CTA — крупная оранжевая кнопка */
.btn.report-cta {
  background: var(--report); color: #fff; border-color: var(--report);
  font-size: 17px; padding: 14px 28px; font-weight: 700;
  box-shadow: 0 4px 18px rgba(255, 90, 54, .45);
}
.btn.report-cta:hover { background: var(--report-dark); border-color: var(--report-dark); }

/* Плавающая кнопка — появляется при прокрутке */
.fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  background: var(--report); color: #fff; font-weight: 700; font-size: 15px;
  padding: 13px 22px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 6px 22px rgba(224, 68, 36, .5);
  opacity: 0; transform: translateY(70px); transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.fab.show { opacity: 1; transform: none; pointer-events: auto; }
.fab:hover { background: var(--report-dark); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: -30px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; box-shadow: 0 6px 18px rgba(11,37,69,.08);
}
.kpi .v { font-size: 32px; font-weight: 700; line-height: 1.15; }
.kpi .l { color: var(--ink2); font-size: 13.5px; margin-top: 2px; }
.kpi .v .unit { font-size: 18px; color: var(--ink2); font-weight: 600; }

/* ---------- Секции ---------- */
section { margin-top: 40px; }
section > h2 { font-size: 24px; margin: 0 0 6px; }
.sub { color: var(--ink2); margin: 0 0 18px; max-width: 760px; }

/* ---------- Фильтры ---------- */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  position: sticky; top: 0; z-index: 5;
}
.filters select, .filters input[type=search] {
  font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--grid);
  border-radius: 8px; background: #fff; color: var(--ink); max-width: 210px;
}
.filters input[type=search] { flex: 1 1 160px; }
.filters .reset { font-size: 14px; background: none; border: none; color: var(--accent-deep); cursor: pointer; padding: 6px; }
.count-note { color: var(--ink2); font-size: 14px; margin: 12px 2px; }
.count-note b { color: var(--ink); }

/* ---------- Графики ---------- */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px 14px;
  min-width: 0;
}
.chart-card.wide { grid-column: 1 / -1; }
.chart-card h3 { margin: 0 0 2px; font-size: 16px; }
.chart-card .hint { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; }

/* горизонтальные бары */
.hbars { display: grid; grid-template-columns: minmax(120px, 42%) 1fr; gap: 7px 10px; align-items: center; font-size: 13.5px; }
.hbars .lbl { color: var(--ink2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbars .bar {
  height: 16px; border-radius: 0 4px 4px 0; background: var(--accent);
  min-width: 2px; transition: width .35s ease;
}
.hbars .bar:hover { background: var(--accent-deep); }
.hbars .val { font-size: 12.5px; color: var(--ink2); font-variant-numeric: tabular-nums; }

/* колонки по годам / глубине */
.cols { display: flex; align-items: flex-end; gap: 2px; height: 150px; border-bottom: 1px solid var(--baseline); padding-bottom: 0; }
.cols .col { flex: 1 1 0; min-width: 3px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.cols .col > i {
  display: block; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px;
  transition: height .35s ease;
}
.cols .col:hover > i { background: var(--accent-deep); }
.cols-x { display: flex; gap: 2px; margin-top: 6px; }
.cols-x span { flex: 1 1 0; text-align: center; font-size: 11px; color: var(--muted); overflow: hidden; white-space: nowrap; }

/* исходы */
.outcomes { display: flex; flex-direction: column; gap: 10px; }
.outcome-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.outcome-row .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.outcome-row .name { width: 46%; color: var(--ink2); }
.outcome-row .bar-track { flex: 1; height: 16px; background: none; display: flex; align-items: center; gap: 8px; }
.outcome-row .bar { height: 16px; border-radius: 0 4px 4px 0; min-width: 2px; }
.outcome-row .val { font-size: 12.5px; color: var(--ink2); font-variant-numeric: tabular-nums; }

/* тултип */
#tip {
  position: fixed; pointer-events: none; z-index: 50; background: #0b0b0b; color: #fff;
  font-size: 12.5px; line-height: 1.4; padding: 7px 10px; border-radius: 8px; max-width: 260px;
  opacity: 0; transition: opacity .12s; transform: translate(-50%, calc(-100% - 10px));
}
#tip b { font-size: 13px; }

/* ---------- Карточки инцидентов ---------- */
.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
}
.card .top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card .victim { font-weight: 700; font-size: 17px; color: var(--accent-dark); }
.card .when { font-weight: 600; font-size: 15px; }
.card .place { color: var(--ink2); font-size: 14px; }
.card .outcome { margin-left: auto; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.card .outcome .dot { width: 9px; height: 9px; border-radius: 50%; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.badge {
  font-size: 12.5px; padding: 3px 10px; border-radius: 12px; border: 1px solid var(--grid);
  background: #fff; color: var(--ink2);
}
.badge.type { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-dark); }
.badge.factor { background: #f4f1ea; border-color: #eae5d9; }
.card .narr { margin: 8px 0 0; color: var(--ink); font-size: 14.5px; }
.card .meta2 { margin-top: 10px; color: var(--muted); font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap; }
.more-btn { margin: 18px auto 0; display: block; }

/* ---------- Форма ---------- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; }
.field label { display: block; font-size: 13.5px; color: var(--ink2); margin-bottom: 5px; }
.field label b { color: var(--fatal); }
.fhint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 9px 10px; border: 1px solid var(--grid);
  border-radius: 8px; background: #fff; color: var(--ink);
}
.field textarea { min-height: 130px; resize: vertical; }
fieldset { border: 1px solid var(--grid); border-radius: 12px; margin: 18px 0 0; padding: 12px 14px 14px; }
legend { font-size: 14px; font-weight: 600; padding: 0 6px; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 14px; }
.chk { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; padding: 3px 0; cursor: pointer; }
.chk input { margin-top: 3px; }
.note { background: #eef4fc; border: 1px solid #cde2fb; color: #123a6b; border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.warn { background: #fdf1ee; border-color: #f5cdc2; color: #7a2e18; }
.form-msg { margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 15px; display: none; }
.form-msg.err { display: block; background: #fdf1ee; border: 1px solid #f5cdc2; color: #9c2b2b; }
.form-msg.ok { display: block; background: #ecf6ec; border: 1px solid #bfe3bf; color: #1c611c; }
.captcha-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.captcha-row .q { font-weight: 700; font-size: 17px; background: #fff; border: 1px dashed var(--baseline); border-radius: 8px; padding: 8px 14px; }
.captcha-row input { width: 90px; }
.hp { position: absolute; left: -9999px; opacity: 0; }

/* ---------- Прочее ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 34px; }
.prose li { margin: 6px 0; }
footer.site {
  margin-top: 60px; padding: 26px 0 40px; border-top: 1px solid var(--grid);
  color: var(--muted); font-size: 13.5px;
}
footer.site .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
.skel { color: var(--muted); padding: 30px 0; text-align: center; }

@media (max-width: 640px) {
  .hbars { grid-template-columns: minmax(110px, 38%) 1fr; }
  .kpi .v { font-size: 26px; }
  .filters { position: static; }
}

/* Пометка машинного перевода описания */
.mt-note {
  display: inline-block; font-size: 11.5px; color: var(--muted);
  border: 1px dashed var(--baseline); border-radius: 8px; padding: 0 7px;
  vertical-align: middle; margin-left: 4px; cursor: help; white-space: nowrap;
}

/* Виджет reCAPTCHA */
#cap-recaptcha { margin: 4px 0 2px; }
#cap-recaptcha:empty { display: none; }
