/* ==========================================================================
   ПУЛЬС — платформа мониторинга городской среды
   style.css — дизайн-система: токены, сброс, типографика, базовые компоненты
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Токены
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Плоскости */
  --bg: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f2f2ef;
  --surface-3: #ebebe6;

  /* Чернила */
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;

  /* Линии */
  --line: #e1e0d9;
  --line-2: #c3c2b7;

  /* Акцент */
  --accent: #2a78d6;
  --accent-2: #1c5cab;
  --accent-wash: #eaf2fd;
  --accent-ink: #184f95;

  /* Статусы (фиксированные, не темизируются) */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-wash: #e8f6e8;
  --warning-wash: #fdf3de;
  --serious-wash: #fbeee8;
  --critical-wash: #fae9e9;

  /* Категориальные слоты графиков (порядок фиксирован) */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s6: #008300;

  /* Последовательная шкала (blue 100 → 700) */
  --seq-1: #cde2fb;
  --seq-2: #9ec5f4;
  --seq-3: #6da7ec;
  --seq-4: #3987e5;
  --seq-5: #256abf;
  --seq-6: #184f95;
  --seq-7: #0d366b;

  /* Тени */
  --shadow-1: 0 1px 2px rgba(11, 11, 11, .05);
  --shadow-2: 0 4px 16px -6px rgba(11, 11, 11, .18), 0 1px 2px rgba(11, 11, 11, .05);
  --shadow-3: 0 18px 48px -18px rgba(11, 11, 11, .3), 0 2px 6px rgba(11, 11, 11, .06);

  /* Геометрия */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-full: 999px;

  /* Ритм */
  --gap: 20px;
  --pad-block: clamp(48px, 7vw, 96px);
  --container: 1240px;
  --header-h: calc(64px + env(safe-area-inset-top));

  /* Шрифты */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Движение */
  --ease: cubic-bezier(.2, .6, .3, 1);
  --dur: .22s;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232322;
  --surface-3: #2c2c2a;

  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;

  --line: #2c2c2a;
  --line-2: #383835;

  --accent: #3987e5;
  --accent-2: #6da7ec;
  --accent-wash: #14263c;
  --accent-ink: #9ec5f4;

  --good-wash: #10240f;
  --warning-wash: #2c2410;
  --serious-wash: #2b1c14;
  --critical-wash: #2b1414;

  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s6: #0ca30c;

  --seq-1: #0d366b;
  --seq-2: #184f95;
  --seq-3: #256abf;
  --seq-4: #2a78d6;
  --seq-5: #3987e5;
  --seq-6: #6da7ec;
  --seq-7: #9ec5f4;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 4px 16px -6px rgba(0, 0, 0, .7), 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-3: 0 18px 48px -18px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .5);
}

/* --------------------------------------------------------------------------
   2. Сброс и база
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

body.is-locked { overflow: hidden; }

img, svg, canvas, video {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

a {
  color: var(--accent-2);
  text-decoration-color: color-mix(in srgb, var(--accent-2) 35%, transparent);
  text-underline-offset: 3px;
}

a:hover { text-decoration-color: currentColor; }

h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 640;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.7vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); }
h4 { font-size: 1rem; letter-spacing: -.01em; }

p { text-wrap: pretty; }

ul, ol { padding-left: 1.2em; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

::selection {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   3. Утилиты
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left)) max(clamp(16px, 4vw, 40px), env(safe-area-inset-right));
}

.container--narrow { max-width: 820px; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 12px; }

.section { padding-block: var(--pad-block); }
.section--tight { padding-block: clamp(32px, 5vw, 60px); }
.section--alt { background: var(--surface-2); }

.stack > * + * { margin-top: var(--flow, 16px); }

.mono {
  font-family: var(--mono);
  font-size: .85em;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

.num { font-variant-numeric: tabular-nums; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--line-2);
}

.lead {
  font-size: clamp(1.02rem, .97rem + .35vw, 1.2rem);
  color: var(--ink-2);
  max-width: 62ch;
}

.text-muted { color: var(--muted); }
.text-ink2 { color: var(--ink-2); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}
.section-head > div { max-width: 68ch; }
.section-head h2 { margin-top: 10px; }
.section-head p { margin-top: 12px; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   4. Кнопки
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface);
  --btn-ink: var(--ink);
  --btn-line: var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 42px;
  border: 1px solid var(--btn-line);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: .92rem;
  font-weight: 580;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform .1s var(--ease);
}
.btn:hover { --btn-bg: var(--surface-2); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.btn--primary {
  --btn-bg: var(--accent);
  --btn-ink: #fff;
  --btn-line: var(--accent);
}
.btn--primary:hover { --btn-bg: var(--accent-2); --btn-line: var(--accent-2); }
:root[data-theme="dark"] .btn--primary:hover { --btn-ink: #0d0d0d; }

.btn--ghost {
  --btn-bg: transparent;
  --btn-line: transparent;
  --btn-ink: var(--ink-2);
}
.btn--ghost:hover { --btn-bg: var(--surface-2); --btn-ink: var(--ink); --btn-line: var(--line); }

.btn--sm { padding: 6px 11px; min-height: 34px; font-size: .84rem; }
.btn--lg { padding: 13px 24px; min-height: 50px; font-size: 1rem; }
.btn--block { width: 100%; }

.btn--icon {
  padding: 0;
  width: 40px;
  min-height: 40px;
  flex: 0 0 auto;
}
.btn--icon.btn--sm { width: 34px; min-height: 34px; }

.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 580;
  text-decoration: none;
  color: var(--accent-2);
}
.link-arrow svg { width: 15px; height: 15px; transition: transform var(--dur) var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   5. Формы
   -------------------------------------------------------------------------- */
.field { display: block; }
.field + .field { margin-top: 16px; }

.field__label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field__hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.field__error {
  display: none;
  font-size: .78rem;
  color: var(--critical);
  margin-top: 6px;
  font-weight: 550;
}
.field.is-invalid .field__error { display: block; }
.field.is-invalid .input,
.field.is-invalid .select { border-color: var(--critical); }

.input, .select, textarea.input {
  width: 100%;
  padding: 10px 12px;
  min-height: 42px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: .93rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder { color: var(--muted); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }

.select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .88rem;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.check input {
  appearance: none;
  width: 18px; height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--surface);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.check input::after {
  content: "";
  width: 10px; height: 10px;
  transform: scale(0);
  transition: transform .12s var(--ease);
  box-shadow: inset 10px 10px #fff;
  clip-path: polygon(14% 44%, 0 65%, 40% 100%, 100% 16%, 84% 0%, 38% 70%);
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { transform: scale(1); }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--ink-2);
  user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 38px; height: 22px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  position: relative;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  flex: 0 0 auto;
}
.switch__track::after {
  content: "";
  position: absolute;
  inset: 2px auto 2px 2px;
  width: 16px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .switch__track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Сегментированный переключатель */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  padding: 6px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2);
  font-size: .84rem;
  font-weight: 570;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

/* Чипы */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-full);
  background: var(--surface);
  font-size: .84rem;
  font-weight: 550;
  color: var(--ink-2);
  transition: all var(--dur) var(--ease);
}
button.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--accent-wash);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.chip__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.chip__x {
  display: grid;
  place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 0;
  background: color-mix(in srgb, currentColor 15%, transparent);
  color: inherit;
  font-size: 11px;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   6. Бейджи, статусы
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: .74rem;
  font-weight: 640;
  letter-spacing: .01em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge__icon { width: 12px; height: 12px; flex: 0 0 auto; }

.badge--good     { background: var(--good-wash);     color: #0a6b0a; border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.badge--warning  { background: var(--warning-wash);  color: #8a5f00; border-color: color-mix(in srgb, var(--warning) 40%, transparent); }
.badge--serious  { background: var(--serious-wash);  color: #a8471c; border-color: color-mix(in srgb, var(--serious) 40%, transparent); }
.badge--critical { background: var(--critical-wash); color: #a02020; border-color: color-mix(in srgb, var(--critical) 35%, transparent); }
.badge--neutral  { background: var(--surface-2);     color: var(--ink-2); border-color: var(--line); }
.badge--accent   { background: var(--accent-wash);   color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

:root[data-theme="dark"] .badge--good     { color: #4fce4f; }
:root[data-theme="dark"] .badge--warning  { color: #fac651; }
:root[data-theme="dark"] .badge--serious  { color: #f4a482; }
:root[data-theme="dark"] .badge--critical { color: #ef7676; }

.dot-live {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--good);
  flex: 0 0 auto;
  position: relative;
}
.dot-live::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--good);
  opacity: .6;
  animation: pulse-ring 2.4s var(--ease) infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(.6); opacity: .7; }
  70%, 100% { transform: scale(1.35); opacity: 0; }
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .82rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.delta svg { width: 13px; height: 13px; }
.delta--up { color: #006300; }
.delta--down { color: var(--critical); }
.delta--flat { color: var(--muted); }
:root[data-theme="dark"] .delta--up { color: #0ca30c; }

/* --------------------------------------------------------------------------
   7. Карточки
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  position: relative;
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card__title {
  font-size: .98rem;
  font-weight: 620;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card__sub { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.card__tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card__body { padding: 18px; }
.card__foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card--link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card--link:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

/* Плитка показателя */
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.stat:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.stat__label {
  font-size: .8rem;
  color: var(--ink-2);
  font-weight: 550;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stat__value {
  font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.2rem);
  font-weight: 640;
  letter-spacing: -.03em;
  line-height: 1.05;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.stat__unit { font-size: .8rem; font-weight: 550; color: var(--muted); letter-spacing: 0; }
.stat__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: .78rem;
  color: var(--muted);
}
.stat__spark { height: 34px; width: 100%; }

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px;
}

/* --------------------------------------------------------------------------
   8. Шапка
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-bar {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex: 0 0 auto;
  margin-right: 6px;
}
.brand__mark {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: var(--ink);
  display: grid;
  place-items: center;
}
.brand__mark svg { width: 19px; height: 19px; color: var(--bg); }
.brand__text { display: flex; flex-direction: column; justify-content: center; }
.brand__name {
  display: block;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: .12em;
  line-height: 1;
}
.brand__meta {
  font-size: .62rem;
  letter-spacing: .06em;
  color: var(--muted);
  text-transform: uppercase;
  line-height: 1;
  margin-top: 3px;
}

.nav { display: flex; align-items: center; gap: 2px; margin-left: 4px; }
.nav a {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: .89rem;
  font-weight: 550;
  color: var(--ink-2);
  text-decoration: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface-2);
  font-weight: 620;
}

.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 12px;
  height: 38px;
  min-width: 210px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: .86rem;
  text-align: left;
  transition: border-color var(--dur) var(--ease);
}
.search-trigger:hover { border-color: var(--accent); }
.search-trigger svg { width: 15px; height: 15px; flex: 0 0 auto; }
.search-trigger span { flex: 1; }
.search-trigger kbd {
  font-family: var(--font);
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 6px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
}

.alerts-btn { position: relative; }
.alerts-btn__count {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: #fff;
  font-size: .64rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
}
.alerts-btn__count:empty, .alerts-btn__count[hidden] { display: none; }

.burger { display: none; }

/* Полоса прогресса чтения */
.scroll-progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width .1s linear;
  z-index: 2;
}

/* Тикер под шапкой */
.ticker {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.ticker__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 38px;
  font-size: .8rem;
  color: var(--ink-2);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.ticker__inner::-webkit-scrollbar { display: none; }
.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.ticker__item b { font-weight: 620; font-variant-numeric: tabular-nums; }
.ticker__sep { color: var(--line-2); flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   9. Мобильное меню (drawer)
   -------------------------------------------------------------------------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  visibility: hidden;
}
.drawer[data-open="true"] { visibility: visible; }

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 11, .45);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.drawer[data-open="true"] .drawer__backdrop { opacity: 1; }

.drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(360px, 88vw);
  padding-right: env(safe-area-inset-right);
  background: var(--bg);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform .28s var(--ease);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.drawer[data-open="true"] .drawer__panel { transform: none; }

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.drawer__nav { padding: 10px; display: flex; flex-direction: column; }
.drawer__nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-radius: var(--r-sm);
  color: var(--ink);
  text-decoration: none;
  font-weight: 550;
  font-size: 1rem;
  min-height: 44px;
}
.drawer__nav a:hover { background: var(--surface-2); }
.drawer__nav a[aria-current="page"] { background: var(--accent-wash); color: var(--accent-ink); font-weight: 640; }
.drawer__nav a small { color: var(--muted); font-weight: 450; font-size: .78rem; }
.drawer__nav a svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); }
.drawer__nav a[aria-current="page"] svg { color: var(--accent-ink); }
.drawer__foot {
  margin-top: auto;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   10. Командная палитра / поиск
   -------------------------------------------------------------------------- */
.palette {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
  padding: clamp(12px, 8vh, 90px) 16px 16px;
  justify-content: center;
  align-items: flex-start;
}
.palette[data-open="true"] { display: flex; }
.palette__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 11, .5);
  animation: fade-in .18s var(--ease);
}
.palette__panel {
  position: relative;
  width: min(620px, 100%);
  max-height: min(560px, 80vh);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop-in .2s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(.985); } }

.palette__search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.palette__search svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.palette__search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 1rem;
}
.palette__results { overflow-y: auto; padding: 8px; }
.palette__group-title {
  padding: 10px 10px 6px;
  font-size: .7rem;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.palette__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
  color: var(--ink);
  text-decoration: none;
  font-size: .92rem;
}
.palette__item:hover, .palette__item.is-active { background: var(--surface-2); }
.palette__item.is-active { box-shadow: inset 2px 0 0 var(--accent); }
.palette__item small { display: block; color: var(--muted); font-size: .77rem; }
.palette__item .pi-icon {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.palette__item .pi-icon svg { width: 15px; height: 15px; }
.palette__empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: .9rem; }
.palette__foot {
  border-top: 1px solid var(--line);
  padding: 9px 14px;
  display: flex;
  gap: 16px;
  font-size: .74rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.palette__foot kbd {
  font-family: var(--font);
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--surface-2);
  font-size: .7rem;
}

/* --------------------------------------------------------------------------
   11. Модальные окна
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal[data-open="true"] { display: flex; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 11, .5);
  animation: fade-in .18s var(--ease);
}
.modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  animation: pop-in .2s var(--ease);
}
.modal__panel--wide { width: min(900px, 100%); }
.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
}
.modal__head h3 { margin-bottom: 4px; }
.modal__body { padding: 0 22px 22px; }
.modal__foot {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: var(--surface);
}

/* --------------------------------------------------------------------------
   12. Тосты
   -------------------------------------------------------------------------- */
.toasts {
  position: fixed;
  z-index: 160;
  bottom: calc(20px + env(safe-area-inset-bottom));
  right: calc(20px + env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(370px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-2);
  font-size: .88rem;
  pointer-events: auto;
  animation: toast-in .26s var(--ease);
}
.toast.is-out { animation: toast-out .2s var(--ease) forwards; }
.toast--good { border-left-color: var(--good); }
.toast--warn { border-left-color: var(--warning); }
.toast--error { border-left-color: var(--critical); }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-weight: 620; margin-bottom: 2px; }
.toast__text { color: var(--ink-2); font-size: .83rem; }
.toast__close {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  width: 20px; height: 20px;
  flex: 0 0 auto;
  line-height: 1;
  font-size: 16px;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* --------------------------------------------------------------------------
   13. Таблицы
   -------------------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  min-width: 640px;
}
table.table th, table.table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-size: .76rem;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
  z-index: 1;
  border-bottom: 1px solid var(--line-2);
}
table.table tbody tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover { background: var(--surface-2); }
table.table td.num, table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.table.is-compact th, table.table.is-compact td { padding: 6px 12px; font-size: .82rem; }

th.sortable {
  cursor: pointer;
  user-select: none;
}
th.sortable:hover { color: var(--ink); }
th.sortable .sort-ind {
  display: inline-block;
  width: 12px;
  opacity: .35;
  font-size: .8em;
}
th.sortable[aria-sort] .sort-ind { opacity: 1; color: var(--accent); }

/* Мини-шкала в ячейке */
.cell-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 130px;
}
.cell-bar__track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
  min-width: 46px;
}
.cell-bar__fill { height: 100%; border-radius: 3px; background: var(--accent); }

/* --------------------------------------------------------------------------
   14. Графики (общая обвязка)
   -------------------------------------------------------------------------- */
.chart {
  position: relative;
  width: 100%;
}
.chart canvas { width: 100%; display: block; touch-action: pan-y; }

.chart__tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-2);
  padding: 9px 11px;
  font-size: .8rem;
  min-width: 132px;
  opacity: 0;
  transform: translate(-50%, -108%);
  transition: opacity .12s var(--ease);
  white-space: nowrap;
}
.chart__tip[data-show="true"] { opacity: 1; }
.chart__tip-title {
  font-size: .72rem;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.chart__tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}
.chart__tip-row .k { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.chart__tip-row .v { margin-left: auto; font-weight: 640; font-variant-numeric: tabular-nums; }
.swatch {
  width: 9px; height: 9px;
  border-radius: 2px;
  flex: 0 0 auto;
}
.swatch--line { width: 12px; height: 2px; border-radius: 1px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding-top: 12px;
}
.legend button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  padding: 3px 2px;
  font-size: .81rem;
  color: var(--ink-2);
  border-radius: 4px;
}
.legend button:hover { color: var(--ink); }
.legend button[aria-pressed="false"] { opacity: .38; text-decoration: line-through; }

.chart-skeleton {
  position: absolute;
  inset: 0;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.chart-empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  font-size: .88rem;
}

/* Развёрнутая карточка графика */
.card.is-expanded {
  position: fixed;
  inset: 12px;
  z-index: 125;
  overflow: auto;
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
}
.card.is-expanded .card__body { flex: 1; display: flex; flex-direction: column; }
.card.is-expanded .chart { flex: 1; }
.expand-backdrop {
  position: fixed;
  inset: 0;
  z-index: 124;
  background: rgba(11, 11, 11, .5);
}

/* --------------------------------------------------------------------------
   15. Хлебные крошки, страница-шапка
   -------------------------------------------------------------------------- */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--muted);
  padding-top: 22px;
  flex-wrap: wrap;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs svg { width: 12px; height: 12px; opacity: .6; }

.page-head { padding: 18px 0 26px; border-bottom: 1px solid var(--line); }
.page-head__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: clamp(1.7rem, 1.3rem + 1.7vw, 2.5rem); }
.page-head p { color: var(--ink-2); margin-top: 10px; max-width: 68ch; }

/* --------------------------------------------------------------------------
   16. Аккордеон, табы, таймлайн
   -------------------------------------------------------------------------- */
.accordion { border-top: 1px solid var(--line); }
.accordion__item { border-bottom: 1px solid var(--line); }
.accordion__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 4px;
  background: transparent;
  border: 0;
  text-align: left;
  font-size: 1.02rem;
  font-weight: 580;
  color: var(--ink);
  letter-spacing: -.01em;
}
.accordion__btn:hover { color: var(--accent-2); }
.accordion__icon {
  width: 22px; height: 22px;
  flex: 0 0 auto;
  position: relative;
}
.accordion__icon::before, .accordion__icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.accordion__icon::before { inset: 50% 3px auto 3px; height: 1.5px; transform: translateY(-50%); }
.accordion__icon::after { inset: 3px auto 3px 50%; width: 1.5px; transform: translateX(-50%); }
.accordion__btn[aria-expanded="true"] .accordion__icon::after { transform: translateX(-50%) rotate(90deg); opacity: 0; }
.accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s var(--ease);
}
.accordion__panel > div { overflow: hidden; }
.accordion__item.is-open .accordion__panel { grid-template-rows: 1fr; }
.accordion__panel p { padding-bottom: 18px; color: var(--ink-2); max-width: 76ch; }

.tabs__list {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs__list::-webkit-scrollbar { display: none; }
.tabs__list button {
  padding: 11px 15px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: .9rem;
  font-weight: 570;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tabs__list button:hover { color: var(--ink); }
.tabs__list button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs__panel { padding-top: 22px; }
.tabs__panel[hidden] { display: none; }

.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--line-2);
}
.timeline__item { position: relative; padding-bottom: 28px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -27px; top: 7px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-2);
}
.timeline__item.is-done::before { background: var(--accent); border-color: var(--accent); }
.timeline__date {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--muted);
  letter-spacing: -.01em;
}
.timeline__title { font-weight: 620; margin: 3px 0 5px; }
.timeline__text { color: var(--ink-2); font-size: .9rem; max-width: 66ch; }

/* Код */
pre.code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.65;
  color: var(--ink-2);
  tab-size: 2;
}
pre.code .k { color: var(--accent-2); }
pre.code .s { color: #0a6b0a; }
pre.code .c { color: var(--muted); }
:root[data-theme="dark"] pre.code .s { color: #4fce4f; }

/* --------------------------------------------------------------------------
   17. Подвал
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-top: 56px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(140px, 1fr));
  gap: 36px 28px;
  padding-bottom: 44px;
}
.footer-col h4 {
  font-size: .76rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 650;
}
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 9px; }
.footer-col a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: .89rem;
}
.footer-col a:hover { color: var(--ink); text-decoration: underline; }
.footer-about p { font-size: .88rem; color: var(--ink-2); margin-top: 14px; max-width: 40ch; }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 20px 0 calc(28px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--muted);
}
.footer-note {
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 12px 14px;
  font-size: .8rem;
  color: var(--ink-2);
  margin-bottom: 26px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.footer-note svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--muted); margin-top: 2px; }

/* Наверх */
.to-top {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 80;
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--shadow-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--dur) var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 17px; height: 17px; }

/* --------------------------------------------------------------------------
   18. Анимация появления
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .07s; }
.reveal[data-delay="2"] { transition-delay: .14s; }
.reveal[data-delay="3"] { transition-delay: .21s; }
.reveal[data-delay="4"] { transition-delay: .28s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   19. Адаптив — общие правила
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .search-trigger { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
}

@media (max-width: 1023px) {
  .nav { display: none; }
  .burger { display: inline-flex; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  :root { --header-h: calc(58px + env(safe-area-inset-top)); }
  .brand__meta { display: none; }
  .toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: none; }
  .to-top { right: calc(12px + env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); }
  .card.is-expanded { inset: 0; border-radius: 0; }
  .card__body { padding: 14px; }
  .card__head { padding: 14px; }
}

/* Очень узкие экраны: шапка должна помещаться без прокрутки.
   Переключатель темы остаётся доступен в меню и в командной палитре. */
@media (max-width: 460px) {
  .header-bar { gap: 8px; }
  .header-tools { gap: 4px; }
  .header-tools [data-theme-toggle] { display: none; }
  .btn--icon { width: 36px; min-height: 36px; }
  .search-trigger { width: 36px; height: 36px; }
  .brand__mark { width: 27px; height: 27px; border-radius: 6px; }
  .brand__mark svg { width: 17px; height: 17px; }
  .brand__name { font-size: .95rem; letter-spacing: .08em; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .modal__foot { flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
  .grid-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 13px; }
  .stat__value { font-size: 1.45rem; }
  .stat__spark { height: 26px; }
}

@media (max-width: 380px) {
  .grid-stats { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .site-footer, .to-top, .toasts, .drawer, .palette, .card__tools { display: none !important; }
  body { background: #fff; }
  .card { break-inside: avoid; border-color: #ccc; }
}
