/* «Звонок до показа»: единая дизайн-система.
   Токены → база → раскладка → компоненты → экраны → адаптив. Тёмная тема через prefers-color-scheme. */

/* ---------- Токены ---------- */
:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --fs-12: 12px; --fs-13: 13px; --fs-15: 15px; --fs-17: 17px; --fs-21: 21px; --fs-28: 28px; --fs-40: 40px; --fs-56: 56px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --field: #f5f5f7;
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.07);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #76767b;
  --sep: rgba(0, 0, 0, 0.08);
  --sep-2: rgba(0, 0, 0, 0.14);

  /* Один спокойный акцент: бирюза */
  --accent: #0b7a71;
  --accent-hover: #096b63;
  --on-accent: #ffffff;
  --accent-text: #0a6f67;
  --accent-tint: rgba(11, 122, 113, 0.09);
  --accent-ring: rgba(11, 122, 113, 0.22);

  --green: #34c759; --green-text: #1d7d36; --green-tint: rgba(52, 199, 89, 0.14);
  --orange: #ff9f0a; --orange-text: #a24a00; --orange-tint: rgba(255, 159, 10, 0.16);
  --red: #ff3b30; --red-text: #c4001a; --red-tint: rgba(255, 59, 48, 0.11);
  --gray-tint: rgba(118, 118, 128, 0.12);

  --nav-bg: rgba(251, 251, 253, 0.78);
  --menu-bg: rgba(255, 255, 255, 0.94);

  --r-card: 22px;
  --r-tile: 16px;
  --r-field: 12px;
  --r-pill: 999px;

  --sh-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
  --sh-raise: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(0, 0, 0, 0.07);
  --sh-pop: 0 2px 6px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.12);

  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --dur: 200ms;
  --content: 1140px;
  --nav-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #232325;
    --field: #2c2c2e;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.14);
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #8d8d93;
    --sep: rgba(255, 255, 255, 0.1);
    --sep-2: rgba(255, 255, 255, 0.18);

    --accent: #2bb3a6;
    --accent-hover: #3cc4b7;
    --on-accent: #00201d;
    --accent-text: #4fd1c4;
    --accent-tint: rgba(43, 179, 166, 0.16);
    --accent-ring: rgba(43, 179, 166, 0.34);

    --green: #30d158; --green-text: #4ade80; --green-tint: rgba(48, 209, 88, 0.18);
    --orange: #ff9f0a; --orange-text: #ffb340; --orange-tint: rgba(255, 159, 10, 0.18);
    --red: #ff453a; --red-text: #ff6961; --red-tint: rgba(255, 69, 58, 0.18);
    --gray-tint: rgba(118, 118, 128, 0.24);

    --nav-bg: rgba(22, 22, 23, 0.72);
    --menu-bg: rgba(44, 44, 46, 0.94);

    --sh-card: 0 0 0 1px rgba(255, 255, 255, 0.05);
    --sh-raise: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.45);
    --sh-pop: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 40px rgba(0, 0, 0, 0.6);
  }
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-15); line-height: 1.47; letter-spacing: -0.009em;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums; overflow-x: hidden;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; color: var(--text); }
h1 { font-size: var(--fs-28); line-height: 1.14; letter-spacing: -0.021em; }
h2 { font-size: var(--fs-17); line-height: 1.3; letter-spacing: -0.016em; }
h3 { font-size: var(--fs-15); line-height: 1.35; }
p { margin: 0 0 var(--s-3); }
p:last-child { margin-bottom: 0; }
code, .mono { font-family: var(--mono); font-size: 0.9em; background: var(--fill-2); padding: 1px 6px; border-radius: 6px; }
ul, ol { margin: 0; padding-left: 20px; }
hr { border: 0; border-top: 1px solid var(--sep); margin: var(--s-5) 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img, svg { max-width: 100%; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: var(--fs-13); line-height: 1.4; }
.caption { font-size: var(--fs-12); line-height: 1.35; color: var(--text-2); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.strong { font-weight: 600; }
.center { text-align: center; }
.mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: var(--s-4); }
.hidden { display: none !important; }

/* ---------- Навигация ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; background: var(--nav-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--sep);
}
.nav-inner { max-width: calc(var(--content) + 2 * var(--s-6)); margin: 0 auto; padding: 0 var(--s-6); height: var(--nav-h); display: flex; align-items: center; gap: var(--s-5); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: var(--fs-15); letter-spacing: -0.016em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: var(--r-pill); color: var(--text-2); font-size: var(--fs-13); font-weight: 500; white-space: nowrap; transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.nav-link:hover { color: var(--text); background: var(--fill-2); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--text); background: var(--fill); }
.nav-right { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.avatar-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px 0 4px; border-radius: var(--r-pill); color: var(--text-2); font-size: var(--fs-13); font-weight: 500; }
.avatar-btn:hover, .menu[open] > .avatar-btn { background: var(--fill-2); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 270px; padding: 6px; z-index: 60;
  background: var(--menu-bg); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--sep); border-radius: var(--r-tile); box-shadow: var(--sh-pop); animation: pop 160ms var(--ease);
}
.menu-head { padding: 10px 10px 12px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--sep); margin-bottom: 6px; }
.menu-head .who { font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border-radius: 9px; color: var(--text); font: inherit; font-size: var(--fs-13); text-align: left; background: none; border: 0; cursor: pointer; }
.menu-item .icon { color: var(--text-2); }
.menu-item:hover { background: var(--fill-2); text-decoration: none; }
.menu-item[aria-current="page"] { background: var(--accent-tint); color: var(--accent-text); }
.menu-item[aria-current="page"] .icon { color: var(--accent-text); }
.menu-sep { height: 1px; background: var(--sep); margin: 6px 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
.nav-burger { display: none; }

/* Плашки над страницей */
.strip { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 8px var(--s-4); font-size: var(--fs-13); font-weight: 500; text-align: center; }
.strip .icon { width: 16px; height: 16px; }
.strip-demo { background: var(--accent-tint); color: var(--accent-text); }
.strip-admin { background: var(--orange-tint); color: var(--orange-text); }
.strip form { display: inline; margin: 0; }

/* ---------- Раскладка ---------- */
main { max-width: calc(var(--content) + 2 * var(--s-6)); margin: 0 auto; padding: var(--s-8) var(--s-6) var(--s-12); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4) var(--s-6); flex-wrap: wrap; margin-bottom: var(--s-6); }
.page-head .lead { margin: 6px 0 0; color: var(--text-2); font-size: var(--fs-15); max-width: 680px; }
.page-head .actions { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-13); font-weight: 500; margin-bottom: var(--s-2); }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.grid-2 { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.grid-3 { display: grid; gap: var(--s-4); grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.grid-2-1 { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.grid-1-2 { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
.section + .section { margin-top: var(--s-4); }
.row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; }
.row-center { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.spacer { flex: 1; }
.inline { display: inline; margin: 0; }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--sh-card); padding: var(--s-6); min-width: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-4); }
.card-head h2 { display: flex; align-items: center; gap: 10px; }
.card-flush > .card-head { padding: var(--s-5) var(--s-6) 0; margin-bottom: var(--s-3); }
.card-foot { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--sep); display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.card-flush > .card-foot { margin: 0; padding: var(--s-4) var(--s-6); }
.h-ico { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--accent-tint); color: var(--accent-text); flex: none; }
.h-ico .icon { width: 16px; height: 16px; }

/* ---------- Метрики ---------- */
.kpis { display: grid; gap: var(--s-4); grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: var(--s-4); }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--sh-card); padding: var(--s-5); min-width: 0; display: flex; flex-direction: column; }
.kpi-label { font-size: var(--fs-13); color: var(--text-2); font-weight: 500; display: flex; align-items: flex-start; gap: 6px; flex: 1; }
.kpi-value { font-size: var(--fs-28); font-weight: 600; letter-spacing: -0.021em; line-height: 1.15; margin-top: var(--s-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value .unit { font-size: var(--fs-15); font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 2px; }
.kpi-note { font-size: var(--fs-13); color: var(--text-2); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi.accent { background: var(--accent); color: var(--on-accent); }
.kpi.accent .kpi-label, .kpi.accent .kpi-note { color: var(--on-accent); }
.kpi.accent .kpi-label { opacity: 0.85; }
/* На бирюзовой плитке красный и зелёный теряются: кладём изменение на светлую «таблетку» */
.kpi.accent .delta { background: var(--surface); padding: 2px 8px; border-radius: var(--r-pill); }
.kpi.accent .delta.flat { color: var(--text-2); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-13); font-weight: 600; }
.delta.up { color: var(--green-text); }
.delta.down { color: var(--red-text); }
.delta.flat { color: var(--text-3); font-weight: 500; }

/* ---------- Кнопки ---------- */
.btn {
  --h: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--h); padding: 0 18px;
  font: inherit; font-size: var(--fs-15); font-weight: 500; line-height: 1; white-space: nowrap;
  color: var(--on-accent); background: var(--accent); border: 0; border-radius: var(--r-pill); cursor: pointer; text-decoration: none;
  transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease), transform 120ms var(--ease);
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
.btn .icon { width: 16px; height: 16px; }
.btn-secondary { color: var(--accent-text); background: var(--accent-tint); }
.btn-secondary:hover { background: var(--accent-ring); }
.btn-gray { color: var(--text); background: var(--fill); }
.btn-gray:hover { background: var(--sep-2); }
.btn-plain { color: var(--accent-text); background: transparent; padding: 0 10px; }
.btn-plain:hover { background: var(--fill-2); }
.btn-danger { color: var(--red-text); background: var(--red-tint); }
.btn-danger:hover { background: var(--red-tint); filter: saturate(1.4); }
.btn-sm { --h: 30px; padding: 0 13px; font-size: var(--fs-13); }
.btn-lg { --h: 48px; padding: 0 26px; font-size: var(--fs-17); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: 0.45; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--fill); color: var(--text); }

/* ---------- Поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field, .field + .field-row, .field-row + .field, .field-row + .field-row { margin-top: var(--s-4); }
/* поля в одной строке: расстояние задаёт gap, иначе второе поле съезжает вниз */
:is(.field-row, .script-row) > .field + .field { margin-top: 0; }
.field-row { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.label, .field > label { font-size: var(--fs-13); font-weight: 500; color: var(--text-2); }
.hint { font-size: var(--fs-12); color: var(--text-3); line-height: 1.4; }
.input, select, textarea, input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], input[type=search] {
  width: 100%; height: 42px; padding: 0 12px; font: inherit; font-size: var(--fs-15); color: var(--text);
  background: var(--field); border: 1px solid transparent; border-radius: var(--r-field); outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
textarea { height: auto; min-height: 180px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
.input:focus, select:focus, textarea:focus, input:focus:not([type=checkbox]):not([type=radio]) { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
select {
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type=date] { min-width: 0; }
@media (prefers-color-scheme: dark) { input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1); } }
.input-sm, .field-sm select, .field-sm input { height: 34px; font-size: var(--fs-13); }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: var(--fs-15); line-height: 1.4; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { -webkit-appearance: none; appearance: none; margin: 0; flex: none; width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--fill); cursor: pointer; position: relative; transition: background-color var(--dur) var(--ease); }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18); transition: transform var(--dur) var(--ease); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.segmented { display: inline-flex; padding: 2px; border-radius: 11px; background: var(--fill); max-width: 100%; overflow-x: auto; }
.segmented a, .segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 64px; height: 30px; padding: 0 12px; border-radius: 9px; border: 0; background: none; font: inherit; font-size: var(--fs-13); font-weight: 500; color: var(--text); white-space: nowrap; cursor: pointer; }
.segmented a:hover { text-decoration: none; background: var(--fill-2); }
.segmented a[aria-current="true"], .segmented button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.1); }
@media (prefers-color-scheme: dark) { .segmented a[aria-current="true"], .segmented button[aria-pressed="true"] { background: #636366; } }

.file-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: var(--s-10) var(--s-5); border-radius: var(--r-tile); border: 1.5px dashed var(--sep-2); background: var(--surface-2); cursor: pointer; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.file-drop:hover, .file-drop.is-over { border-color: var(--accent); background: var(--accent-tint); }
.file-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-drop:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.file-drop .file-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-text); margin-bottom: 4px; }
.file-drop .file-title { font-weight: 600; }
.file-drop .file-name { font-size: var(--fs-13); color: var(--text-2); word-break: break-word; }
.file-drop.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-tint); }
.file-list { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; gap: 8px; align-items: center; font-size: var(--fs-13); padding: 8px 12px; border-radius: 10px; background: var(--fill-2); min-width: 0; }
.file-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-15); }
th { text-align: left; font-size: var(--fs-12); font-weight: 500; color: var(--text-2); padding: 0 var(--s-3) 10px; white-space: nowrap; border-bottom: 1px solid var(--sep); }
td { padding: 12px var(--s-3); border-bottom: 1px solid var(--sep); vertical-align: middle; }
tr:last-child > td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: var(--s-6); }
th:last-child, td:last-child { padding-right: var(--s-6); }
.card:not(.card-flush) th:first-child, .card:not(.card-flush) td:first-child { padding-left: 0; }
.card:not(.card-flush) th:last-child, .card:not(.card-flush) td:last-child { padding-right: 0; }
th.num, td.num { text-align: right; }
.table-hover tbody tr:hover { background: var(--fill-2); }
.row-link { position: relative; }
.row-link a.stretched::after { content: ""; position: absolute; inset: 0; }
.row-link a.stretched { color: var(--text); font-weight: 500; }
.row-link form, .row-link .above { position: relative; z-index: 1; }
/* Матрица помещается в карточку целиком: колонки равной ширины, длинные названия переносятся */
.matrix { width: 100%; table-layout: fixed; }
.matrix td, .matrix th { text-align: center; padding: 8px 4px; font-size: var(--fs-13); }
.matrix th { white-space: normal; vertical-align: bottom; font-size: var(--fs-12); line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
.matrix td:first-child, .matrix th:first-child { text-align: left; width: 132px; }
.matrix .cell { display: inline-block; min-width: 40px; padding: 3px 4px; border-radius: 7px; font-weight: 600; }
.cell.good { color: var(--green-text); background: var(--green-tint); }
.cell.mid { color: var(--orange-text); background: var(--orange-tint); }
.cell.bad { color: var(--red-text); background: var(--red-tint); }
.cell.none { color: var(--text-3); }

/* ---------- Плашки ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--r-pill); font-size: var(--fs-12); font-weight: 600; line-height: 1; white-space: nowrap; color: var(--text-2); background: var(--gray-tint); }
.pill .icon { width: 12px; height: 12px; stroke-width: 2; }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-green, .risk-low, .v-yes, .st-done { color: var(--green-text); background: var(--green-tint); }
.pill-orange, .risk-medium, .v-partial { color: var(--orange-text); background: var(--orange-tint); }
.pill-red, .risk-high, .v-no, .st-failed { color: var(--red-text); background: var(--red-tint); }
.pill-accent, .st-queued, .st-transcribing, .st-scoring { color: var(--accent-text); background: var(--accent-tint); }
.pill-gray, .v-na { color: var(--text-2); background: var(--gray-tint); }
.st-queued.dot::before, .st-transcribing.dot::before, .st-scoring.dot::before { animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.avatar { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; font-size: 11px; font-weight: 600; color: #fff; background: linear-gradient(180deg, #a1a1a6, #8e8e93); }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.c0 { background: linear-gradient(180deg, #5fd3c7, #0b7a71); }
.avatar.c1 { background: linear-gradient(180deg, #5ac8fa, #0a84ff); }
.avatar.c2 { background: linear-gradient(180deg, #ffb340, #ff9500); }
.avatar.c3 { background: linear-gradient(180deg, #7ad992, #30b350); }
.avatar.c4 { background: linear-gradient(180deg, #c18aff, #9a5cf0); }
.avatar.c5 { background: linear-gradient(180deg, #ff8a8a, #ff4f5e); }
.person { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.person .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Сообщения ---------- */
.flash, .notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-tile); margin-bottom: var(--s-4); background: var(--surface); box-shadow: var(--sh-card); }
.flash .icon, .notice > .icon { margin-top: 1px; }
.flash.ok .icon, .notice.ok > .icon { color: var(--green); }
.flash.error, .notice.error { background: var(--red-tint); box-shadow: none; }
.flash.error .icon, .notice.error > .icon { color: var(--red-text); }
.notice.warn { background: var(--orange-tint); box-shadow: none; }
.notice.warn > .icon { color: var(--orange-text); }
.notice.info { background: var(--accent-tint); box-shadow: none; }
.notice.info > .icon { color: var(--accent-text); }
.notice .notice-body { min-width: 0; flex: 1; }
.notice-actions { margin-top: var(--s-2); display: flex; gap: var(--s-2); flex-wrap: wrap; }
.errors { margin: 0; padding-left: 18px; color: var(--red-text); font-size: var(--fs-13); }
.errors li + li { margin-top: 4px; }
.empty { text-align: center; padding: var(--s-8) var(--s-5); color: var(--text-2); }
.empty-ico { width: 52px; height: 52px; border-radius: 16px; display: inline-grid; place-items: center; background: var(--fill-2); color: var(--text-3); margin-bottom: var(--s-3); }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.empty p { font-size: var(--fs-13); max-width: 380px; margin: 0 auto; }
.empty .btn { margin-top: var(--s-4); }

.kv { display: grid; grid-template-columns: auto 1fr; margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--sep); }
.kv dt { color: var(--text-2); padding-right: var(--s-4); }
.kv dd { text-align: right; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: var(--s-3); padding: 12px 0; border-bottom: 1px solid var(--sep); min-width: 0; }
.list > li:first-child { padding-top: 0; }
.list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }

/* ---------- Графики (inline SVG) ---------- */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--sep); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .line-2 { fill: none; stroke: var(--text-3); stroke-width: 2; stroke-dasharray: 4 4; stroke-linecap: round; }
.chart .area { fill: var(--accent-tint); }
.chart .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.chart .val { fill: var(--text); font-size: 11px; font-weight: 600; font-family: var(--font); }
.chart .bar-col { fill: var(--accent); opacity: 0.85; }
.legend { display: flex; gap: var(--s-4); flex-wrap: wrap; margin-top: var(--s-3); font-size: var(--fs-12); color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.legend i.dash { background: var(--text-3); }
svg.bar { display: block; width: 100%; height: 8px; overflow: visible; }
svg.bar .track { fill: var(--fill-2); }
svg.bar .val { fill: var(--accent); }
svg.bar.good .val { fill: var(--green); }
svg.bar.mid .val { fill: var(--orange); }
svg.bar.bad .val { fill: var(--red); }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-4); }
.bar-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); margin-bottom: 6px; font-size: var(--fs-13); }
.bar-top .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-top .v { font-weight: 600; white-space: nowrap; }

/* Воронка */
.funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.funnel li { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 110px; gap: var(--s-4); align-items: center; padding: 8px 12px; border-radius: 14px; }
.funnel li.worst { background: var(--red-tint); }
.funnel .f-label { font-weight: 500; }
.funnel .f-label small { display: block; font-weight: 400; font-size: var(--fs-12); color: var(--text-3); }
.funnel svg { display: block; width: 100%; height: 28px; }
.funnel svg .track { fill: var(--fill-2); }
.funnel svg .val { fill: var(--accent); }
.funnel li.manual svg .val { fill: var(--text-3); }
.funnel li.worst svg .val { fill: var(--red); }
.funnel .f-num { text-align: right; font-weight: 600; font-size: var(--fs-17); white-space: nowrap; }
.funnel .f-num small { display: block; font-size: var(--fs-12); font-weight: 500; color: var(--text-2); }
.funnel .f-label small.f-explain { color: var(--text-2); }
.funnel-note { margin: var(--s-3) 0 0; }
.drop-callout { display: flex; gap: var(--s-4); align-items: center; padding: var(--s-5); border-radius: var(--r-tile); background: var(--red-tint); margin-bottom: var(--s-5); }
.drop-callout .big { font-size: var(--fs-40); font-weight: 700; letter-spacing: -0.03em; color: var(--red-text); line-height: 1; }

/* Кольцо балла */
.ring { position: relative; width: 140px; height: 140px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--fill-2); stroke-width: 11; }
.ring .val { fill: none; stroke-width: 11; stroke-linecap: round; stroke: var(--accent); }
.ring.good .val { stroke: var(--green); }
.ring.mid .val { stroke: var(--orange); }
.ring.bad .val { stroke: var(--red); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-num { font-size: var(--fs-40); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.ring-of { display: block; font-size: var(--fs-12); color: var(--text-3); font-weight: 500; margin-top: 4px; }
.score-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 26px; padding: 0 8px; border-radius: 8px; font-weight: 600; font-size: var(--fs-15); background: var(--fill-2); color: var(--text-2); }
.score-chip.good { color: var(--green-text); background: var(--green-tint); }
.score-chip.mid { color: var(--orange-text); background: var(--orange-tint); }
.score-chip.bad { color: var(--red-text); background: var(--red-tint); }

/* ---------- Лендинг ---------- */
.hero { text-align: center; padding: var(--s-16) var(--s-4) var(--s-12); max-width: 860px; margin: 0 auto; }
.hero .eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: var(--r-pill); background: var(--accent-tint); color: var(--accent-text); font-size: var(--fs-13); font-weight: 600; margin-bottom: var(--s-5); }
.hero h1 { font-size: var(--fs-56); line-height: 1.05; letter-spacing: -0.035em; }
.hero p.lead { font-size: var(--fs-21); color: var(--text-2); margin: var(--s-5) auto 0; max-width: 680px; line-height: 1.4; }
.hero .cta { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; margin-top: var(--s-8); }
.pills { display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: center; margin-top: var(--s-8); }
.pills span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--sh-card); font-size: var(--fs-13); font-weight: 500; }
.pills .icon { color: var(--accent-text); width: 15px; height: 15px; }
.l-section { padding: var(--s-12) 0; }
.l-section > h2 { font-size: var(--fs-40); letter-spacing: -0.03em; line-height: 1.1; text-align: center; margin-bottom: var(--s-3); }
.l-section > .sub { text-align: center; color: var(--text-2); font-size: var(--fs-17); max-width: 640px; margin: 0 auto var(--s-8); }
.step-num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 700; margin-bottom: var(--s-4); }
.feature h3 { font-size: var(--fs-17); margin-bottom: 6px; }
.feature p { color: var(--text-2); }
.example { border: 2px dashed var(--accent-ring); }
.example .tag { display: inline-flex; padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-12); font-weight: 700; background: var(--orange-tint); color: var(--orange-text); margin-bottom: var(--s-3); }
.plans { display: grid; gap: var(--s-4); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plan { display: flex; flex-direction: column; gap: var(--s-2); }
.plan .price { font-size: var(--fs-40); font-weight: 700; letter-spacing: -0.03em; line-height: 1; margin: var(--s-3) 0 0; }
.plan .price small { font-size: var(--fs-15); font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: var(--s-3) 0 var(--s-4); display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: var(--fs-15); flex: 1; }
.plan li { display: flex; gap: 8px; }
.plan li .icon { color: var(--accent-text); margin-top: 2px; }
.plan.featured { box-shadow: 0 0 0 2px var(--accent), var(--sh-raise); }
.faq details { border-bottom: 1px solid var(--sep); padding: var(--s-4) 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { list-style: none; cursor: pointer; font-weight: 600; font-size: var(--fs-17); display: flex; justify-content: space-between; gap: var(--s-3); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-text); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: var(--s-3); color: var(--text-2); }
.footer { border-top: 1px solid var(--sep); padding: var(--s-8) var(--s-6); text-align: center; color: var(--text-3); font-size: var(--fs-13); }
.footer a { color: var(--text-2); }
.doc { max-width: 760px; margin: 0 auto; }
.doc h2 { margin: var(--s-6) 0 var(--s-2); }
.doc p, .doc li { color: var(--text); }
.template-note { padding: 12px 16px; border-radius: var(--r-tile); background: var(--orange-tint); color: var(--orange-text); font-weight: 600; margin-bottom: var(--s-6); }

/* ---------- Вход ---------- */
.auth { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: var(--s-6) var(--s-4); }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border-radius: 26px; box-shadow: var(--sh-raise); padding: var(--s-10) var(--s-8) var(--s-8); }
.auth-logo { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: var(--s-8); }
.auth-logo .brand-mark { width: 56px; height: 56px; margin-bottom: var(--s-4); }
.auth-logo p { color: var(--text-2); margin-top: 6px; }
.auth .btn { margin-top: var(--s-6); }
.auth-foot { text-align: center; margin-top: var(--s-6); font-size: var(--fs-13); color: var(--text-3); }

/* ---------- Карточка звонка ---------- */
.verdict-hero { display: flex; gap: var(--s-6); align-items: center; }
.verdict-hero .body { flex: 1; min-width: 0; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: var(--s-4); font-size: var(--fs-13); color: var(--text-2); }
.callout { margin-top: var(--s-4); padding: var(--s-4) var(--s-5); border-radius: var(--r-tile); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--sep); }
.callout.accent { background: var(--accent-tint); box-shadow: none; }
.callout-title { font-size: var(--fs-12); font-weight: 600; color: var(--text-2); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.callout.accent .callout-title { color: var(--accent-text); }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 0 var(--s-3); padding: var(--s-4) 0; border-top: 1px solid var(--sep); }
.item:first-child { border-top: 0; padding-top: 0; }
.v-ico { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.v-ico .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.v-ico.v-yes { color: #fff; background: var(--green); }
.v-ico.v-partial { color: #fff; background: var(--orange); }
.v-ico.v-no { color: #fff; background: var(--red); }
.v-ico.v-na { color: var(--text-3); background: var(--fill); }
.item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-title { font-weight: 600; }
.item-weight { font-size: var(--fs-12); color: var(--text-3); }
.quote { display: block; width: 100%; text-align: left; font: inherit; margin: var(--s-2) 0 0; padding: 8px 12px; border: 0; border-left: 3px solid var(--sep-2); border-radius: 10px; background: var(--fill-2); color: var(--text); line-height: 1.45; }
button.quote { cursor: pointer; }
button.quote:hover { background: var(--accent-tint); border-left-color: var(--accent); }
.q-flag { margin-top: 6px; display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-12); font-weight: 600; }
.q-flag.ok { color: var(--green-text); }
.q-flag.bad { color: var(--orange-text); }
.q-flag .icon { width: 14px; height: 14px; }
.item-comment { margin-top: 6px; font-size: var(--fs-13); color: var(--text-2); }
.transcript { display: flex; flex-direction: column; gap: var(--s-2); }
.seg { display: flex; flex-direction: column; max-width: 80%; scroll-margin: 120px; }
.seg.agent { align-self: flex-end; align-items: flex-end; }
.seg.client, .seg.unknown { align-self: flex-start; align-items: flex-start; }
.seg .who { font-size: var(--fs-12); color: var(--text-3); margin: 0 12px 4px; }
.bubble { padding: 9px 14px; border-radius: 18px; line-height: 1.42; background: var(--fill-2); overflow-wrap: anywhere; transition: box-shadow 300ms var(--ease); }
.seg.agent .bubble { background: var(--accent-tint); border-bottom-right-radius: 6px; }
.seg.client .bubble, .seg.unknown .bubble { border-bottom-left-radius: 6px; }
.seg.flash-on .bubble { box-shadow: 0 0 0 3px var(--accent-ring), inset 0 0 0 1.5px var(--accent); }
.seg .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font-size: var(--fs-12); font-weight: 500; color: var(--accent-text); background: var(--accent-tint); }
audio { width: 100%; height: 40px; margin-top: var(--s-4); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.fact { padding: var(--s-3) var(--s-4); border-radius: 14px; background: var(--fill-2); min-width: 0; }
.fact .k { font-size: var(--fs-12); color: var(--text-2); font-weight: 500; }
.fact .v { margin-top: 2px; overflow-wrap: anywhere; }
.actions-grid { display: grid; gap: var(--s-3); }
.actions-grid form { margin: 0; }

/* Чеклист подключения */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: var(--s-5) var(--s-6); border-top: 1px solid var(--sep); }
.step:first-child { border-top: 0; }
.step-mark { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--text-2); font-weight: 600; font-size: var(--fs-13); }
.step.done .step-mark { background: var(--green); color: #fff; }
.step.done .step-title { color: var(--text-2); }
.step-title { font-weight: 600; font-size: var(--fs-17); }
.progress { display: flex; align-items: center; gap: var(--s-3); }
.progress svg { flex: 1; height: 8px; }

/* Скрипт */
.script-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 70px 150px 70px 70px; gap: var(--s-2); align-items: start; padding: var(--s-3) 0; border-top: 1px solid var(--sep); }
.script-row:first-of-type { border-top: 0; }
.script-row .wide { grid-column: 1 / 3; }
.script-head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 70px 150px 70px 70px; gap: var(--s-2); font-size: var(--fs-12); color: var(--text-2); font-weight: 500; }
.cbox { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); padding-top: 4px; }
.cbox input { width: 20px; height: 20px; accent-color: var(--accent); }

.code { font-family: var(--mono); font-size: var(--fs-28); letter-spacing: 0.18em; font-weight: 600; padding: 10px 18px; border-radius: 12px; background: var(--fill-2); display: inline-block; }
.pre { white-space: pre-wrap; font-family: var(--font); font-size: var(--fs-13); line-height: 1.55; padding: var(--s-4) var(--s-5); border-radius: var(--r-tile); background: var(--fill-2); margin: 0; overflow-wrap: anywhere; }
.pager { display: flex; gap: 4px; justify-content: center; padding: var(--s-4); flex-wrap: wrap; }
.pager a, .pager span { min-width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; font-size: var(--fs-13); font-weight: 500; padding: 0 8px; }
.pager a { color: var(--text); }
.pager a:hover { background: var(--fill-2); text-decoration: none; }
.pager span[aria-current] { background: var(--text); color: var(--surface); }
.filter-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.rank-pos { width: 22px; color: var(--text-3); font-weight: 600; font-size: var(--fs-13); text-align: right; flex: none; }
.tip-quote { margin-top: var(--s-2); padding: 10px 14px; border-radius: 12px; background: var(--green-tint); color: var(--text); font-size: var(--fs-15); }
.tip-quote::before { content: "«"; } .tip-quote::after { content: "»"; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .nav-link .icon { display: none; }
  .nav-link { padding: 0 9px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .grid-2, .grid-3, .grid-2-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr); }
  .kpis, .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .script-head { display: none; }
  .script-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .script-row .wide { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .nav-links, .nav-right .menu-desktop { display: none; }
  .nav-burger { display: block; }
  .nav-burger > summary { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
  .nav-burger .menu-panel { position: fixed; left: 8px; right: 8px; top: calc(var(--nav-h) + 4px); width: auto; max-height: calc(100vh - var(--nav-h) - 16px); overflow-y: auto; }
  .nav-burger .menu-item { min-height: 44px; font-size: var(--fs-15); }
}
@media (max-width: 640px) {
  :root { --nav-h: 52px; }
  .nav-inner { padding: 0 var(--s-4); gap: var(--s-2); }
  main { padding: var(--s-6) var(--s-4) var(--s-10); }
  h1 { font-size: 26px; }
  .hero { padding: var(--s-10) 0 var(--s-8); }
  .hero h1 { font-size: 36px; }
  .hero p.lead { font-size: var(--fs-17); }
  .l-section > h2 { font-size: 28px; }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .page-head .actions { width: 100%; }
  .card { padding: var(--s-5); border-radius: 18px; }
  .card-flush { padding: 0; }
  .card-flush > .card-head { padding: var(--s-4) var(--s-5) 0; }
  .card-flush > .card-foot { padding: var(--s-4) var(--s-5); }
  th:first-child, td:first-child { padding-left: var(--s-5); }
  th:last-child, td:last-child { padding-right: var(--s-5); }
  .kpis, .kpis.k4, .kpis.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .kpi { padding: var(--s-4); border-radius: 18px; }
  .kpi-value { font-size: 24px; }
  .btn { --h: 42px; }
  .btn-sm { --h: 36px; }
  input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], select, .input, textarea { font-size: 16px; }
  .verdict-hero { flex-direction: column; align-items: flex-start; gap: var(--s-4); }
  .ring { width: 116px; height: 116px; }
  .ring-num { font-size: 34px; }
  .seg { max-width: 94%; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .funnel li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--s-3); }
  .funnel svg { grid-column: 1 / -1; grid-row: 2; }
  .step { grid-template-columns: 36px minmax(0, 1fr); padding: var(--s-4) var(--s-5); }
  .step .btn { grid-column: 2; justify-self: start; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: var(--s-8) var(--s-5) var(--s-6); box-shadow: var(--sh-card); }
  .drop-callout { flex-direction: column; align-items: flex-start; }
  .segmented { display: flex; width: 100%; }
  .segmented a, .segmented button { flex: 1; min-width: 0; padding: 0 8px; }

  /* Таблицы превращаются в карточки */
  table.rtable, table.rtable tbody, table.rtable tr, table.rtable td { display: block; width: 100%; }
  table.rtable thead { display: none; }
  table.rtable tr { padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--sep); }
  table.rtable tr:last-child { border-bottom: 0; }
  .card:not(.card-flush) table.rtable tr { padding-left: 0; padding-right: 0; }
  table.rtable td { border: 0; padding: 3px 0 !important; display: flex; justify-content: space-between; gap: var(--s-3); text-align: right; align-items: center; }
  table.rtable td::before { content: attr(data-label); color: var(--text-2); font-size: var(--fs-13); text-align: left; flex: none; max-width: 50%; }
  table.rtable td:not([data-label])::before, table.rtable td[data-label=""]::before { display: none; }
  table.rtable td.primary { font-weight: 600; justify-content: flex-start; text-align: left; font-size: var(--fs-17); }
  table.rtable td.num { text-align: right; }
  .matrix-wrap { overflow-x: auto; }
  .matrix { min-width: 760px; }
}

@media print {
  .nav, .strip, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  main { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
.linklike { padding: 0; border: 0; background: none; font: inherit; color: var(--accent-text); text-align: left; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
textarea.short { min-height: 84px; }
