/* ------------------------------------------------------------------
   Вьетнамец v9. Главная-прототип.
   Сайт одет в цвета персонажа: тёмный контур (ink), шляпа (hat),
   шорты (red), гавайка (sea). Каждый цвет делает одну работу:
     hat  - бренд и главное действие (кнопка, подложка календаря, табло);
     red  - красное число календаря (вс и выходные) и «хуже обычного»;
     sea  - море, погода и графики аренды;
     ink  - текст и толстый контур у «бумажных» вещей.
   Радиусы, правило одно на всю страницу:
     бумага (листок, табло, справка) - прямые углы;
     то, что нажимают (кнопки, сегменты, чипы) - капсула;
     поля ввода - 10px.
   z-index: 1 стопка листков, 2 персонаж, 3 подсказка графика, 10 шапка.
   ------------------------------------------------------------------ */

:root {
  color-scheme: light;
  --wall: oklch(0.955 0.011 255);
  --wall-2: oklch(0.925 0.014 255);
  --sheet: oklch(0.995 0.002 255);
  --ink: oklch(0.25 0.05 265);
  --ink-2: oklch(0.40 0.04 262);
  --ink-3: oklch(0.49 0.03 262);
  --line: oklch(0.86 0.015 255);
  --line-soft: oklch(0.905 0.012 255);
  --hat: oklch(0.875 0.175 95);
  --hat-deep: oklch(0.80 0.17 85);
  --on-hat: oklch(0.25 0.05 265);
  --red: oklch(0.56 0.21 26);
  --red-wash: oklch(0.94 0.04 26);
  --sea: oklch(0.62 0.14 238);
  --sea-wash: oklch(0.86 0.06 238);
  --sea-ink: oklch(0.42 0.12 245);
  --ok: oklch(0.55 0.14 150);
  --focus: oklch(0.55 0.2 260);
  --shadow: 0 1px 0 oklch(0.25 0.05 265 / 0.08), 0 12px 32px -18px oklch(0.25 0.05 265 / 0.45);

  --display: "Fira Sans Extra Condensed", "Arial Narrow", sans-serif;
  --text: "Geologica", "Segoe UI", sans-serif;

  --maxw: 1240px;
  --gut: clamp(16px, 4vw, 40px);
  --r-field: 10px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --wall: oklch(0.2 0.03 262);
    --wall-2: oklch(0.235 0.032 262);
    --sheet: oklch(0.255 0.035 262);
    --ink: oklch(0.95 0.01 255);
    --ink-2: oklch(0.83 0.02 255);
    --ink-3: oklch(0.74 0.02 255);
    --line: oklch(0.38 0.03 262);
    --line-soft: oklch(0.31 0.03 262);
    --on-hat: oklch(0.22 0.04 265);
    --red: oklch(0.70 0.18 24);
    --red-wash: oklch(0.32 0.07 24);
    --sea: oklch(0.72 0.13 235);
    --sea-wash: oklch(0.42 0.08 238);
    --sea-ink: oklch(0.80 0.10 235);
    --focus: oklch(0.80 0.15 95);
    --shadow: 0 1px 0 oklch(0 0 0 / 0.3), 0 16px 36px -18px oklch(0 0 0 / 0.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --wall: oklch(0.2 0.03 262);
  --wall-2: oklch(0.235 0.032 262);
  --sheet: oklch(0.255 0.035 262);
  --ink: oklch(0.95 0.01 255);
  --ink-2: oklch(0.83 0.02 255);
  --ink-3: oklch(0.74 0.02 255);
  --line: oklch(0.38 0.03 262);
  --line-soft: oklch(0.31 0.03 262);
  --on-hat: oklch(0.22 0.04 265);
  --red: oklch(0.70 0.18 24);
  --red-wash: oklch(0.32 0.07 24);
  --sea: oklch(0.72 0.13 235);
  --sea-wash: oklch(0.42 0.08 238);
  --sea-ink: oklch(0.80 0.10 235);
  --focus: oklch(0.80 0.15 95);
  --shadow: 0 1px 0 oklch(0 0 0 / 0.3), 0 16px 36px -18px oklch(0 0 0 / 0.8);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }

h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; line-height: 0.98; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.6rem); }
h3 { font-size: clamp(1.5rem, 1.25rem + 0.8vw, 1.9rem); line-height: 1.05; }
p { margin: 0; text-wrap: pretty; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; line-height: 1.45; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 2px solid var(--ink);
  background: transparent; color: var(--ink);
  font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), background-color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn i { font-size: 20px; }
.btn--hat { background: var(--hat); color: var(--on-hat); border-color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--wall-2); }
  .btn--hat:hover { background: var(--hat-deep); }
}

/* ---------- шапка ---------- */
.top { position: relative; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; flex: none; }
.logo img { width: 44px; height: auto; }
.logo b { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: 0; }
.nav { display: flex; gap: clamp(14px, 2.4vw, 30px); }
.nav a { text-decoration: none; font-weight: 500; font-size: 16px; padding: 10px 0; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }
.top .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
@media (max-width: 720px) {
  .logo b { display: none; }
  .top .btn { display: none; }
  .top .wrap { gap: 12px; min-height: 60px; }
  /* пять пунктов (с «Статьями») на 375 px не влезают: меню едет вбок, логотип на месте */
  .nav { gap: 16px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { font-size: 15px; padding: 12px 0; }
}

/* ---------- первый экран ---------- */
.hero { padding: clamp(12px, 3vw, 36px) 0 clamp(36px, 4vw, 48px); }
.hero + .sec { border-top: 2px solid var(--ink); }
.hero .wrap {
  display: grid; gap: 28px 32px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "text" "desk";
}
.hero__text { grid-area: text; display: grid; gap: 18px; align-content: start; }
.hero h1 { font-size: clamp(2.3rem, 1.5rem + 3.2vw, 4.2rem); line-height: 0.94; }
.hero h1 .l { display: block; }
.hero__sub { font-size: clamp(17px, 15px + 0.4vw, 20px); color: var(--ink-2); max-width: 34ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.captions {
  min-height: 28px; font-weight: 600; font-size: 18px; color: var(--ink);
}
.captions[hidden] { display: none; }

.desk { grid-area: desk; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0; }
.persona { position: relative; z-index: 2; width: clamp(150px, 20vw, 280px); margin-left: -36px; margin-bottom: -6px; aspect-ratio: 446 / 900; }
.persona img, .persona video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.persona video { opacity: 0; transition: opacity 160ms ease; }
.persona.is-playing video { opacity: 1; }
.persona.is-playing img { opacity: 0; transition: opacity 160ms ease; }

@media (min-width: 1040px) {
  .hero .wrap { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); grid-template-areas: "text desk"; align-items: center; }
  .hero__text { padding-bottom: 40px; }
}
@media (max-width: 640px) {
  .desk { grid-template-columns: minmax(0, 1fr); }
  .persona {
    position: absolute; right: -4px; top: -176px; width: 88px; margin: 0; z-index: 0;
  }
  .hero__cta { padding-right: 108px; }
  .hero__cta .btn { width: 100%; justify-content: center; }
  .hero h1 { font-size: 2.3rem; }
}

/* ---------- отрывной календарь ---------- */
.cal { position: relative; z-index: 1; }
.cal__board {
  position: relative; background: var(--hat); border: 2px solid var(--ink);
  padding: 44px 14px 14px;
  box-shadow: var(--shadow);
}
.cal__board::before {   /* дырка под гвоздь */
  content: ""; position: absolute; top: 12px; left: 50%; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--wall); border: 2px solid var(--ink);
}
.cal__brand { position: absolute; top: 12px; left: 16px; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--on-hat); line-height: 1; }
.cal__year { position: absolute; top: 12px; right: 16px; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--on-hat); line-height: 1; }
/* 🔴 Листки лежат в одной ячейке сетки, а не absolute + inset:0: тогда стопка была
   высотой верхнего листка, и длинный нижний (больше строк погоды или событий)
   вылезал из-под него на кнопки «Вернуть»/«Дальше». Высоту всех 7 листков
   home.js выравнивает по самому длинному — календарь не прыгает при отрыве. */
.cal__stack { position: relative; display: grid; }
.cal__stack > .sheet { grid-area: 1 / 1; }
.cal__measure { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
.cal__stack::before, .cal__stack::after {  /* торцы листков снизу */
  content: ""; position: absolute; left: 4px; right: 4px; height: 100%; top: 4px;
  background: var(--sheet); border: 2px solid var(--ink); z-index: 0;
}
.cal__stack::after { top: 8px; left: 8px; right: 8px; }
.sheet {
  position: relative; z-index: 1;
  background: var(--sheet); border: 2px solid var(--ink);
  padding: 0 clamp(16px, 2.4vw, 26px) 20px;
  display: flex; flex-direction: column;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
  will-change: transform;
}
.sheet.is-under { z-index: 0; }
.sheet__perf {   /* линия отрыва */
  height: 14px; margin: 0 calc(-1 * clamp(16px, 2.4vw, 26px));
  background-image: radial-gradient(circle at 7px 7px, var(--wall-2) 3px, transparent 3.5px);
  background-size: 14px 14px; background-repeat: repeat-x;
  border-bottom: 1px dashed var(--line);
}
.sheet__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 14px; }
.sheet__month { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: 0.02em; text-transform: uppercase; }
.sheet__vn { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--ink-2); }
.sheet__day {
  font-family: var(--display); font-weight: 800; line-height: 0.8;
  font-size: clamp(7.5rem, 5.5rem + 6vw, 10rem); letter-spacing: -0.02em;
  text-align: center; margin: 14px 0 4px;
}
.sheet.is-red .sheet__day, .sheet.is-red .sheet__wd { color: var(--red); }
.sheet__wd { text-align: center; font-family: var(--display); font-weight: 800; font-size: 30px; text-transform: uppercase; letter-spacing: 0.04em; }
.sheet__lunar { text-align: center; color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.sheet__holiday { text-align: center; margin-top: 10px; font-weight: 600; color: var(--red); }
.sheet__holiday:empty { display: none; }

.sheet__facts { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; margin-top: 18px; border-top: 2px solid var(--ink); }
.fact { padding: 12px 0 4px; }
.fact + .fact { padding-left: 16px; border-left: 1px solid var(--line); }
.fact__k { font-size: 13px; color: var(--ink-2); }
.fact__v { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; margin: 2px 0 4px; }
.fact__v small { font-family: var(--text); font-weight: 600; font-size: 15px; margin-left: 2px; }
.fact__n { font-size: 14px; color: var(--ink-2); line-height: 1.35; }
.fact__n b { color: var(--ink); font-weight: 600; }
.fact__n .bad { color: var(--red); font-weight: 600; }
.fact__n .warn { color: var(--ink); font-weight: 600; }

.sheet__say {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.sheet__quote { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.sheet__sign { display: block; margin-top: 6px; font-family: var(--text); font-weight: 500; font-size: 14px; color: var(--ink-2); }
.sheet__wear { width: 52px; height: 100px; object-fit: contain; object-position: bottom; }
.sheet__events { margin-top: auto; padding-top: 12px; font-size: 14px; color: var(--ink-2); }
.sheet__events a { font-weight: 600; color: var(--ink); }

.cal__controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.cal__hint { text-align: center; font-size: 14px; font-weight: 500; color: var(--on-hat); margin-top: 10px; }
.cal__btn { min-height: 44px; padding: 0 16px; font-size: 15px; background: var(--sheet); }
.cal__btn[disabled] { opacity: 0.4; cursor: default; }
.cal__btn[disabled]:active { transform: none; }

.sheet.is-tearing { transition: transform 260ms var(--ease-out), opacity 260ms var(--ease-out); }
.sheet.is-back { transition: transform 220ms var(--ease-out), opacity 180ms var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  .sheet.is-tearing, .sheet.is-back { transition: opacity 150ms linear; transform: none !important; }
}

/* скелет, пока не пришли данные */
.sk { display: inline-block; min-width: 3ch; border-radius: 4px; background: var(--line-soft); color: transparent !important; }

/* ---------- общие секции ---------- */
.sec { padding: clamp(56px, 7vw, 104px) 0; }
.sec + .sec { border-top: 2px solid var(--ink); }
.sec__head { display: grid; gap: 12px; margin-bottom: clamp(24px, 3vw, 40px); max-width: 60ch; }
.sec__lead { color: var(--ink-2); font-size: 18px; }
.src { font-size: 13px; color: var(--ink-3); margin-top: 14px; }
.src a { color: var(--ink-2); }

/* ---------- курс ---------- */
.money { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .money { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; } }

.board { background: var(--hat); border: 2px solid var(--ink); box-shadow: var(--shadow); color: var(--on-hat); }
.board__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 2px solid var(--ink); }
.board__top label { font-weight: 600; }
.amount { display: inline-flex; align-items: center; gap: 8px; }
.amount input {
  width: 9.5ch; min-height: 44px; padding: 0 12px; font-size: 18px; font-weight: 600;
  border: 2px solid var(--ink); border-radius: var(--r-field); background: oklch(0.995 0.002 255); color: oklch(0.25 0.05 265);
  font-variant-numeric: tabular-nums; text-align: right;
}
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: baseline;
  grid-template-areas: "name rate" "info out";
  padding: 14px 20px; border-top: 1px solid oklch(0.25 0.05 265 / 0.25);
}
.row:first-child { border-top: 0; }
.row__name { grid-area: name; font-weight: 700; font-size: 18px; }
.row__info { grid-area: info; }
.row__how { font-size: 14px; }
.row__rate { grid-area: rate; font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row__rate small { font-family: var(--text); font-size: 15px; font-weight: 600; margin-left: 3px; }
.row__out { grid-area: out; font-size: 15px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; align-self: start; }
.row__meta { font-size: 13px; }
@media (max-width: 560px) {
  .row { grid-template-areas: "name rate" "info info" "out out"; padding: 14px 16px; }
  .row__out { text-align: left; margin-top: 6px; }
  .board__top, .board__foot { padding-inline: 16px; }
}
.tag-ref { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; margin-left: 6px; vertical-align: 2px; }
.board__foot { padding: 14px 20px; border-top: 2px solid var(--ink); font-size: 14px; }

.when { display: grid; gap: 16px; align-content: start; }
.when__card { background: var(--sheet); border: 2px solid var(--ink); padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr) 104px; grid-template-areas: "head stick" "text stick" "chart chart"; gap: 10px 16px; align-items: start; }
.when__head { grid-area: head; }
.when__text { grid-area: text; }
.when__sticker { grid-area: stick; }
@media (max-width: 560px) {
  .when__card { grid-template-columns: minmax(0, 1fr) 76px; grid-template-areas: "head stick" "text text" "chart chart"; padding: 16px; }
  .when__sticker { width: 76px; }
}
.when__title { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; }
.when__text { color: var(--ink-2); }
.when__text b { color: var(--ink); }
.when__sticker { width: 104px; height: auto; }
.when__chart { grid-area: chart; }
.dumb text { font-family: var(--text); font-size: 13px; fill: var(--ink-2); }
.dumb .lbl { font-weight: 600; fill: var(--ink); font-size: 14px; }

.atm { background: var(--sheet); border: 2px solid var(--ink); padding: 18px 20px; }
.atm h3 { font-size: 24px; }
.atm__list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.atm__item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; }
.atm__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); transform: translateY(-1px); }
.atm__dot[data-c="green"] { background: var(--ok); }
.atm__dot[data-c="red"] { background: var(--red); }
.atm__dot[data-c="yellow"] { background: var(--hat-deep); }
.atm__t { font-weight: 600; font-size: 15px; }
.atm__s { grid-column: 2; font-size: 14px; color: var(--ink-2); }

/* ---------- жильё ---------- */
.rent { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1040px) { .rent { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; } }
.check { background: var(--sheet); border: 2px solid var(--ink); box-shadow: var(--shadow); padding: clamp(18px, 2.4vw, 28px); display: grid; gap: 18px; }
.check h3 { font-size: clamp(1.7rem, 1.3rem + 1vw, 2.2rem); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.seg legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px;
  border: 2px solid var(--ink); font-weight: 600; font-size: 15px; background: transparent;
}
.seg input:checked + span { background: var(--ink); color: var(--sheet); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; }
.field__row { display: flex; align-items: center; gap: 10px; }
.field input, .field select {
  min-height: 48px; padding: 0 14px; font-size: 18px; border: 2px solid var(--ink); border-radius: var(--r-field);
  background: var(--sheet); color: var(--ink); width: 100%;
}
.field input::placeholder { color: var(--ink-3); }
.field__unit { font-weight: 600; white-space: nowrap; }
.field__help { font-size: 14px; color: var(--ink-2); }
.field__err { font-size: 14px; color: var(--red); font-weight: 600; }
.field__err:empty { display: none; }

.verdict { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 14px; align-items: center; padding-top: 16px; border-top: 2px solid var(--ink); }
.verdict__big { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem); line-height: 0.98; }
.verdict__text { margin-top: 8px; color: var(--ink-2); font-size: 16px; }
.verdict__text b { color: var(--ink); }
.verdict img { width: 96px; }
.verdict[hidden] { display: none; }

.ruler text { font-family: var(--text); font-size: 12px; fill: var(--ink-2); }
.ruler .rl-strong { font-weight: 700; fill: var(--ink); font-size: 13px; }

.chartcard { display: grid; gap: 14px; }
.chartcard__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; align-items: baseline; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-bar { width: 18px; height: 10px; border-radius: 2px; background: var(--sea-wash); }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sea-ink); }
.lg-line { width: 2px; height: 14px; background: var(--red); }
.lg-ref { width: 2px; height: 14px; background: var(--ink-3); }
.zk { position: relative; }
.zk svg { width: 100%; height: auto; overflow: visible; }
.zk text { font-family: var(--text); font-size: 13px; fill: var(--ink-2); }
.zk .zk-name { fill: var(--ink); font-weight: 500; font-size: 14px; }
.zk .zk-row:hover .zk-name, .zk .zk-row:focus .zk-name { font-weight: 700; }
.zk .zk-row:focus { outline: none; }
.zk .zk-row:focus .zk-hit { stroke: var(--focus); stroke-width: 2; }
.tip {
  position: absolute; z-index: 3; pointer-events: none; min-width: 180px;
  background: var(--sheet); border: 2px solid var(--ink); padding: 10px 12px; font-size: 14px; line-height: 1.4;
  box-shadow: var(--shadow);
}
.tip[hidden] { display: none; }
.tip b { font-family: var(--display); font-size: 22px; font-weight: 800; display: block; line-height: 1.05; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-top: 8px; }
.stat__v { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; }
.stat__k { font-size: 14px; color: var(--ink-2); margin-top: 4px; }

/* ---------- город ---------- */
.city { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1040px) { .city { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px 56px; } }
.city__side { display: grid; gap: 48px; align-content: start; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin-bottom: 8px; }
.days::-webkit-scrollbar { display: none; }
.days button {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--ink);
  background: transparent; font-weight: 600; font-size: 15px; cursor: pointer;
  transition: transform 120ms var(--ease-out);
}
.days button:active { transform: scale(0.97); }
.days button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.ev { list-style: none; margin: 0; padding: 0; }
.ev li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ev__t { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ev__t.is-long { font-size: 15px; font-family: var(--text); font-weight: 600; color: var(--ink-2); line-height: 1.3; padding-top: 4px; }
.ev__title { font-weight: 600; font-size: 17px; line-height: 1.3; }
.ev__title a { text-decoration: none; }
.ev__title a:hover { text-decoration: underline; }
.ev__meta { grid-column: 2; font-size: 14px; color: var(--ink-2); }
.ev__more { margin-top: 18px; }
.empty { padding: 20px 0; color: var(--ink-2); }

.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.news li { display: grid; gap: 4px; }
.news__tag { font-size: 13px; font-weight: 600; color: var(--sea-ink); }
.news__title { font-weight: 600; line-height: 1.3; }
.news__title a { text-decoration: none; }
.news__title a:hover { text-decoration: underline; }
.news__meta { font-size: 13px; color: var(--ink-2); }

.ask__big { font-family: var(--display); font-weight: 800; font-size: clamp(3rem, 2.4rem + 2vw, 4.2rem); line-height: 0.9; }
.ask__sub { color: var(--ink-2); margin: 6px 0 16px; }
.bars text { font-family: var(--text); font-size: 13px; fill: var(--ink-2); }
.bars .b-name { fill: var(--ink); font-size: 14px; }
.bars .b-val { fill: var(--ink); font-weight: 600; }

/* ---------- посчитать ---------- */
.tools { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.visa { background: var(--sheet); border: 2px solid var(--ink); box-shadow: var(--shadow); padding: clamp(18px, 2.4vw, 28px); display: grid; gap: 16px; }
.visa__out { padding-top: 14px; border-top: 2px solid var(--ink); }
.visa__date { font-family: var(--display); font-weight: 800; font-size: clamp(2.4rem, 2rem + 1.6vw, 3.4rem); line-height: 1; }
.visa__left { margin-top: 6px; font-weight: 600; }
.visa__left.bad { color: var(--red); }
.links { list-style: none; margin: 0; padding: 0; }
.links li + li { border-top: 1px solid var(--line); }
.links a {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 16px; align-items: center;
  padding: 12px 0; text-decoration: none;
}
.links img { width: 76px; height: 76px; object-fit: contain; grid-row: span 2; }
.links b { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; align-self: end; }
.links span { font-size: 15px; color: var(--ink-2); align-self: start; }
@media (hover: hover) and (pointer: fine) { .links a:hover b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; } }

/* ---------- подвал ---------- */
.foot { border-top: 2px solid var(--ink); padding: 48px 0 64px; background: var(--wall-2); }
.foot__grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .foot__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.foot__me { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: start; }
.foot__me img { width: 72px; height: 72px; object-fit: contain; }
.foot__fresh { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.foot__fresh b { color: var(--ink); font-weight: 600; }
.foot__note { font-size: 13px; color: var(--ink-3); margin-top: 18px; }
.foot__soc { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; padding-left: 88px; font-size: 15px; font-weight: 600; }
.foot__soc a { color: var(--ink); }

.snapnote { background: var(--red-wash); color: var(--ink); font-size: 14px; padding: 8px 0; }
.snapnote[hidden] { display: none; }

/* Стикеры как в телеграме: белая вырубка по контуру, чтобы тёмные буквы читались и на тёмной теме. */
.when__sticker, .verdict img, .foot__me img {
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff);
}

/* ---------- боевая главная (после прототипа v9) ---------- */
/* Иконки — инлайн-SVG вместо шрифта Phosphor с unpkg: ничего с чужих серверов. */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-play path { fill: currentColor; stroke: none; }
#play .ic-pause { display: none; }
#play[aria-pressed="true"] .ic-play { display: none; }
#play[aria-pressed="true"] .ic-pause { display: block; }

/* Табло: обменник — с кнопкой «Заказать», устаревшая строка приглушена. */
.tag-ex { border-style: dashed; }
.row.is-stale .row__rate, .row.is-stale .row__name { opacity: 0.55; }
.row__out { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 12px; }
.row__go {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 2px solid var(--on-hat); background: oklch(0.995 0.002 255); color: oklch(0.25 0.05 265);
  font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: transform 120ms var(--ease-out);
}
.row__go:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .row__go:hover { background: var(--on-hat); color: var(--hat); } }
@media (max-width: 560px) { .row__out { justify-content: space-between; } }
.board__foot:empty { display: none; }

/* Банкоматы: отметиться прямо в списке. */
.atm__btns { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.atm__btns button {
  min-height: 36px; padding: 0 12px; border-radius: 999px; border: 2px solid var(--ink);
  background: transparent; font-weight: 600; font-size: 14px; cursor: pointer;
}
.atm__btns button[disabled] { opacity: 0.5; cursor: default; }
@media (max-width: 420px) { .atm__btns { gap: 4px; } .atm__btns button { padding: 0 9px; font-size: 13px; } }
@media (hover: hover) and (pointer: fine) { .atm__btns button:not([disabled]):hover { background: var(--wall-2); } }
.atm__msg { grid-column: 2; font-size: 14px; font-weight: 600; }
.atm__msg:empty { display: none; }
.atm__ex a { font-weight: 600; color: var(--ink); }
.atm__note { margin-top: 12px; }
.atm__item + .atm__item { padding-top: 10px; border-top: 1px solid var(--line); }

/* Пререндер для поисковиков: список ЖК, пока JS не нарисовал график. */
.zk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.zk-list b { font-weight: 600; }

/* Справка-картинка по итогам проверки — рисует www/js/spravka.js. */
.spravka-go { margin-top: 14px; min-height: 44px; padding: 0 18px; font-size: 15px; }
.spravka-go[hidden] { display: none; }

/* Лента детектора «О чём говорит город»: появляется, только когда есть события. */
.citynow { margin-bottom: 40px; }
.citynow[hidden] { display: none; }
.ev__tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; margin-right: 6px; color: var(--sea-ink); }
.ev__tag.is-warn { color: var(--red); }
.ev__t small { display: block; font-family: var(--text); font-size: 12px; font-weight: 500; color: var(--ink-2); }

/* Волна по дням под календарём: высота важнее остального прогноза (Антон, 21.10). */
.waves { margin-top: 14px; color: var(--on-hat); }
.waves__t { font-size: 13px; font-weight: 600; text-align: center; }
.waves__row { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wave {
  display: grid; justify-items: center; gap: 1px; width: 100%; min-height: 48px; padding: 5px 0;
  border: 2px solid var(--ink); border-radius: 10px; background: var(--sheet); color: var(--ink);
  font: inherit; cursor: pointer;
}
span.wave { cursor: default; }
.wave__d { font-size: 11px; line-height: 1.2; white-space: nowrap; }
.wave__v { font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1; font-variant-numeric: tabular-nums; }
.wave.is-rough { background: var(--sea-wash); }
.wave.is-storm { background: var(--red); border-color: var(--red); color: oklch(0.99 0 0); }
.wave[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--on-hat); outline: 2px solid var(--sheet); outline-offset: -4px; }
.waves__key { font-size: 12px; text-align: center; margin-top: 6px; }
