/* АвтоСклад: единый файл стилей. Все цвета и размеры через переменные. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --bg: #f5f5f7;
  --card: #ffffff;
  --card-2: #fbfbfd;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.14);
  --field: rgba(0, 0, 0, 0.045);
  --field-hover: rgba(0, 0, 0, 0.065);
  --hover: rgba(0, 0, 0, 0.028);

  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-press: #006edb;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --accent-ring: rgba(0, 113, 227, 0.2);
  --accent-text: #0066cc;

  --green: #34c759;
  --orange: #ff9f0a;
  --red: #ff3b30;
  --green-soft: rgba(52, 199, 89, 0.14);
  --orange-soft: rgba(255, 159, 10, 0.16);
  --red-soft: rgba(255, 59, 48, 0.11);
  --green-text: #1d7f3a;
  --orange-text: #a95500;
  --red-text: #d70015;

  --nav-bg: rgba(255, 255, 255, 0.72);
  --chart-bar: #0071e3;
  --chart-bar-dim: rgba(0, 113, 227, 0.32);
  --chart-grid: rgba(0, 0, 0, 0.07);
  --tip-bg: rgba(29, 29, 31, 0.92);
  --tip-text: #f5f5f7;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-pop: 0 4px 12px rgba(0, 0, 0, 0.08), 0 16px 40px rgba(0, 0, 0, 0.12);
  --radius: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --radius-field: 10px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --t: 180ms;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --card-2: #2c2c2e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #8e8e93;
    --line: rgba(255, 255, 255, 0.1);
    --line-2: rgba(255, 255, 255, 0.18);
    --field: rgba(255, 255, 255, 0.07);
    --field-hover: rgba(255, 255, 255, 0.1);
    --hover: rgba(255, 255, 255, 0.04);
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-press: #0071e3;
    --accent-soft: rgba(10, 132, 255, 0.18);
    --accent-ring: rgba(10, 132, 255, 0.32);
    --accent-text: #4aa3ff;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --green-soft: rgba(48, 209, 88, 0.16);
    --orange-soft: rgba(255, 159, 10, 0.18);
    --red-soft: rgba(255, 69, 58, 0.18);
    --green-text: #30d158;
    --orange-text: #ffb340;
    --red-text: #ff6961;
    --nav-bg: rgba(22, 22, 23, 0.72);
    --chart-bar: #0a84ff;
    --chart-bar-dim: rgba(10, 132, 255, 0.4);
    --chart-grid: rgba(255, 255, 255, 0.09);
    --tip-bg: rgba(242, 242, 247, 0.95);
    --tip-text: #1d1d1f;
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-pop: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 40px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- база */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 19px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 15px;
  font-weight: 600;
}

svg.i {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg.i.sm {
  width: 16px;
  height: 16px;
}

svg.i.lg {
  width: 28px;
  height: 28px;
}

.num,
td.num,
th.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

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

.small {
  font-size: 13px;
}

.nowrap {
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

main {
  flex: 1;
  padding: 36px 0 64px;
}

/* ---------------------------------------------------------------- навигация */

.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(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 52px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
}

.nav-links a {
  display: block;
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--t) var(--ease), background-color var(--t) var(--ease);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--field);
  text-decoration: none;
}

.nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--field);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  background: var(--field);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.role-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}

.icon-btn:hover,
.icon-btn[aria-current="page"] {
  background: var(--field);
  color: var(--text);
}

.menu-toggle {
  display: none;
}

.nav-sheet {
  display: none;
}

@media (max-width: 1080px) {
  .nav-links,
  .nav-right .role-pill {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-sheet {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 250ms var(--ease);
  }

  .nav.open .nav-sheet {
    max-height: 720px;
    border-top: 1px solid var(--line);
  }

  .nav-sheet ul {
    list-style: none;
    margin: 0;
    padding: 8px 0 14px;
  }

  .nav-sheet a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 4px;
    color: var(--text);
    font-size: 17px;
    border-bottom: 1px solid var(--line);
  }

  .nav-sheet li:last-child a {
    border-bottom: 0;
  }

  .nav-sheet a:hover {
    text-decoration: none;
  }

  .nav-sheet a[aria-current="page"] {
    color: var(--accent-text);
    font-weight: 600;
  }

  .nav-sheet .sheet-role {
    padding: 12px 4px 0;
    color: var(--text-2);
    font-size: 13px;
  }
}

/* ---------------------------------------------------------------- заголовок страницы */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.page-head .sub {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.4;
}

.page-head .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  font-size: 15px;
}

/* ---------------------------------------------------------------- карточки и сетки */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  min-width: 0;
}

.card + .card {
  margin-top: 20px;
}

.card.flush {
  padding: 0;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head .meta {
  color: var(--text-2);
  font-size: 13px;
}

.card-head a {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.card.flush .card-head {
  padding: 20px 24px 0;
  margin-bottom: 8px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid + .grid,
.grid + .card,
.card + .grid,
.kpis + .grid,
.kpis + .card,
.ask-hero + .kpis,
.segment-row + .kpis,
.kpis + .buckets,
.buckets + .card,
.notice + .card,
.card + .notice {
  margin-top: 20px;
}

.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cols-main {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

@media (max-width: 900px) {
  .cols-3,
  .cols-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------------------------------------------------------------- плитки показателей */

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.kpis.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  min-width: 0;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

a.kpi:hover {
  text-decoration: none;
  box-shadow: var(--shadow-pop);
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.kpi-label .tone {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.kpi-label .tone.orange {
  background: var(--orange-soft);
  color: var(--orange-text);
}

.kpi-label .tone.red {
  background: var(--red-soft);
  color: var(--red-text);
}

.kpi-label .tone.green {
  background: var(--green-soft);
  color: var(--green-text);
}

.kpi-value {
  margin-top: 14px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.kpi-sub {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.4;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 4px;
  font-weight: 600;
}

.delta.up {
  color: var(--green-text);
}

.delta.down {
  color: var(--red-text);
}

@media (max-width: 1000px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .kpis.three {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .kpis {
    gap: 12px;
  }

  .kpi {
    padding: 16px;
  }

  .kpi-value {
    font-size: 23px;
  }
}

/* ---------------------------------------------------------------- кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.btn:active {
  background: var(--accent-press);
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.btn.secondary {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.btn.secondary:hover {
  background: var(--accent-ring);
}

.btn.plain {
  background: var(--field);
  color: var(--text);
}

.btn.plain:hover {
  background: var(--field-hover);
}

.btn.ghost {
  background: transparent;
  color: var(--accent-text);
  padding: 0 10px;
}

.btn.ghost:hover {
  background: var(--accent-soft);
}

.btn.danger {
  background: transparent;
  color: var(--red-text);
}

.btn.danger:hover {
  background: var(--red-soft);
}

.btn.sm {
  min-height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

.btn.lg {
  min-height: 48px;
  padding: 0 26px;
  font-size: 17px;
}

.btn.block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------------------------------------------------------------- поля ввода */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span,
.field-label {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.field .hint {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.4;
}

.input,
.select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-field);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  letter-spacing: -0.015em;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--text-3);
}

.input:hover,
.select:hover {
  background: var(--field-hover);
}

.input:focus,
.select:focus {
  outline: none;
  background: var(--card);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.input.sm,
.select.sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 15px;
}

.select {
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.select option {
  color: #1d1d1f;
  background: #fff;
}

.input::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
}

.input::-webkit-inner-spin-button {
  opacity: 0;
}

.input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

/* переключатель вместо чекбокса */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  font-size: 15px;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch .track {
  position: relative;
  width: 44px;
  height: 26px;
  flex: none;
  border-radius: 999px;
  background: var(--line-2);
  transition: background-color var(--t) var(--ease);
}

.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform var(--t) var(--ease);
}

.switch input:checked + .track {
  background: var(--green);
}

.switch input:checked + .track::after {
  transform: translateX(18px);
}

.switch input:focus-visible + .track {
  box-shadow: 0 0 0 4px var(--accent-ring);
}

/* сегментированный переключатель */
.segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius-field);
  background: var(--field);
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented a,
.segmented label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 16px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.segmented a:hover,
.segmented label:hover {
  text-decoration: none;
  background: var(--hover);
}

.segmented a[aria-current="true"],
.segmented input:checked + span {
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 3px 8px rgba(0, 0, 0, 0.08);
}

.segmented label {
  padding: 0;
}

.segmented label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 18px;
  border-radius: 8px;
  transition: background-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.segmented label input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.segment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* выбор файла */
.file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 20px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius-md);
  background: var(--card-2);
  text-align: center;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}

.file-drop.drag,
.file-drop:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-drop .file-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.file-drop .file-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}

.file-drop .file-hint {
  font-size: 13px;
  color: var(--text-2);
}

.file-drop .btn {
  pointer-events: none;
}

/* ---------------------------------------------------------------- таблицы */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.table th {
  padding: 10px 12px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.table th.num {
  text-align: right;
}

.table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table th:first-child,
.table td:first-child {
  padding-left: 24px;
}

.table th:last-child,
.table td:last-child {
  padding-right: 24px;
}

.table tbody tr {
  transition: background-color var(--t) var(--ease);
}

.table tbody tr:hover {
  background: var(--hover);
}

.table tr.row-link {
  cursor: pointer;
}

.table .title-cell {
  min-width: 220px;
}

.table .title-cell a {
  color: var(--text);
  font-weight: 500;
}

.table .title-cell .sub {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 1px;
}

.table .art {
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
}

.table .clip {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
  font-size: 13px;
}

.table tfoot td {
  font-weight: 600;
  border-top: 1px solid var(--line-2);
  border-bottom: 0;
}

.table.compact td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.table.dense {
  font-size: 13px;
}

.table.dense th,
.table.dense td {
  padding-left: 8px;
  padding-right: 8px;
}

.table.dense th {
  white-space: normal;
  vertical-align: bottom;
  line-height: 1.3;
}

.table.dense .clip {
  max-width: 170px;
  color: var(--text);
}

.card.flush .table.dense th:first-child,
.card.flush .table.dense td:first-child {
  padding-left: 24px;
}

.card.flush .table.dense th:last-child,
.card.flush .table.dense td:last-child {
  padding-right: 24px;
}

.card:not(.flush) .table th:first-child,
.card:not(.flush) .table td:first-child {
  padding-left: 0;
}

.card:not(.flush) .table th:last-child,
.card:not(.flush) .table td:last-child {
  padding-right: 0;
}

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13px;
}

/* ---------------------------------------------------------------- бейджи и чипы */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--field);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.badge.green {
  background: var(--green-soft);
  color: var(--green-text);
}

.badge.orange {
  background: var(--orange-soft);
  color: var(--orange-text);
}

.badge.red {
  background: var(--red-soft);
  color: var(--red-text);
}

.badge.blue {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.cls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.cls.A {
  background: var(--accent);
  color: #fff;
}

.cls.B {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.cls.C {
  background: var(--field);
  color: var(--text-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--t) var(--ease), box-shadow var(--t) var(--ease), color var(--t) var(--ease);
}

.chip:hover {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px transparent;
  color: var(--accent-text);
  text-decoration: none;
}

.chip.static {
  cursor: default;
  background: var(--field);
  box-shadow: none;
  color: var(--text);
}

.chip.static:hover {
  color: var(--text);
}

/* ---------------------------------------------------------------- вопрос обычным языком */

.ask-hero {
  position: relative;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.ask-form {
  position: relative;
  display: flex;
  align-items: center;
}

.ask-form .lead-icon {
  position: absolute;
  left: 18px;
  color: var(--accent);
  pointer-events: none;
}

.ask-form .input {
  min-height: 56px;
  padding: 14px 128px 14px 52px;
  border-radius: 14px;
  font-size: 19px;
}

.ask-form .btn {
  position: absolute;
  right: 6px;
  min-height: 44px;
}

.ask-hero .chips {
  margin-top: 14px;
}

.ask-hero .ask-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ask-hero .ask-title p {
  color: var(--text-2);
  font-size: 13px;
}

@media (max-width: 520px) {
  .ask-hero {
    padding: 18px;
  }

  .ask-form .input {
    font-size: 17px;
    padding-right: 56px;
    padding-left: 46px;
  }

  .ask-form .lead-icon {
    left: 15px;
  }

  .ask-form .btn {
    width: 44px;
    padding: 0;
  }

  .ask-form .btn .label {
    display: none;
  }
}

.answer-title {
  font-size: 21px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.answer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--text-2);
  font-size: 13px;
}

.trust {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.trust svg {
  color: var(--green-text);
  margin-top: 1px;
}

/* ---------------------------------------------------------------- списки в карточках */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.list li:first-child {
  padding-top: 0;
}

.list .li-main {
  min-width: 0;
}

.list .li-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  color: var(--text);
  font-weight: 500;
  line-height: 1.35;
}

.list a.li-title:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.list .li-sub {
  color: var(--text-2);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list .li-end {
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.list .li-end .muted {
  display: block;
  font-size: 12px;
}

/* ---------------------------------------------------------------- график (столбики на CSS) */

.chart {
  position: relative;
  height: 220px;
  margin: 8px 0 0 56px;
}

.chart.short {
  height: 160px;
}

.chart .grid-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--chart-grid);
}

.chart .grid-line span {
  position: absolute;
  right: calc(100% + 10px);
  top: -8px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.chart .bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  gap: 2px;
}

.chart .col {
  position: relative;
  flex: 1 1 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  outline: none;
  cursor: default;
}

.chart .bar {
  width: 100%;
  max-width: 24px;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--chart-bar-dim);
  transition: background-color var(--t) var(--ease);
}

.chart .col.last .bar,
.chart .col:hover .bar,
.chart .col:focus-visible .bar {
  background: var(--chart-bar);
}

.chart .tick {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-30%);
  color: var(--text-3);
  font-size: 11px;
  white-space: nowrap;
}

.chart .cap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.chart .tip {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--tip-bg);
  color: var(--tip-text);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms var(--ease), transform 150ms var(--ease);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.chart .tip b {
  display: block;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.chart .col:hover .tip,
.chart .col:focus-visible .tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.chart .col:first-child .tip,
.chart .col:nth-child(2) .tip,
.chart .col:nth-child(3) .tip {
  left: 0;
  transform: translate(0, 4px);
}

.chart .col:first-child:hover .tip,
.chart .col:nth-child(2):hover .tip,
.chart .col:nth-child(3):hover .tip {
  transform: translate(0, 0);
}

.chart .col:nth-last-child(-n + 3) .tip {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.chart .col:nth-last-child(-n + 3):hover .tip,
.chart .col:nth-last-child(-n + 3):focus-visible .tip {
  transform: translate(0, 0);
}

.chart-foot {
  margin-top: 34px;
}

details.table-view summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

details.table-view summary::-webkit-details-marker {
  display: none;
}

details.table-view summary svg {
  transition: transform var(--t) var(--ease);
}

details.table-view[open] summary svg {
  transform: rotate(180deg);
}

details.table-view .table-wrap {
  margin-top: 12px;
  max-height: 320px;
  overflow: auto;
}

@media (max-width: 520px) {
  .chart {
    margin-left: 44px;
    height: 180px;
  }

  .chart .bars {
    gap: 1px;
  }

  .chart .cap {
    display: none;
  }
}

/* ---------------------------------------------------------------- шкалы (ABC) */

.meter-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.meter-row + .meter-row {
  border-top: 1px solid var(--line);
}

.meter-row.wide {
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) 112px;
}

@media (max-width: 700px) {
  .meter-row.wide {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .meter-row.wide .meter {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--field);
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--chart-bar);
}

.meter.B > span {
  background: var(--chart-bar-dim);
}

.meter.C > span {
  background: var(--line-2);
}

.meter-label {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}

.meter-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- состояния */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-2);
}

.empty .empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty .empty-icon.green {
  background: var(--green-soft);
  color: var(--green-text);
}

.empty h3 {
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.empty p {
  max-width: 440px;
}

.empty .chips {
  justify-content: center;
  margin-top: 18px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 15px;
}

.notice svg {
  margin-top: 1px;
}

.notice.ok svg {
  color: var(--green-text);
}

.notice.warn {
  background: var(--orange-soft);
  box-shadow: none;
}

.notice.warn svg {
  color: var(--orange-text);
}

.notice.error {
  background: var(--red-soft);
  box-shadow: none;
}

.notice.error svg {
  color: var(--red-text);
}

.notice.info {
  background: var(--accent-soft);
  box-shadow: none;
}

.notice.info svg {
  color: var(--accent-text);
}

.notice ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.notice .n-title {
  font-weight: 600;
}

.flash {
  margin-bottom: 20px;
}

/* ---------------------------------------------------------------- формы-карточки */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px auto auto;
  gap: 12px;
  align-items: center;
}

@media (max-width: 760px) {
  .toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .toolbar .grow,
  .toolbar .btn {
    grid-column: 1 / -1;
  }
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.search-field .input {
  padding-left: 44px;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-form .input {
  width: 76px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- карточка товара */

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin: 0;
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--text-2);
}

.facts dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 700px) {
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
}

.stock-hero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.stock-hero .big {
  font-size: 48px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.formula {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
}

.formula b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- вход */

.auth {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 30px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-card .logo-big {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: block;
}

.auth-card h1 {
  font-size: 28px;
}

.auth-card .sub {
  margin: 8px 0 24px;
  color: var(--text-2);
}

.auth-card form {
  text-align: left;
}

.auth-card .segmented {
  display: flex;
  margin-bottom: 14px;
}

.auth-card .segmented label {
  flex: 1;
}

.auth-card .segmented label span {
  width: 100%;
  justify-content: center;
}

.auth-card .divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--text-3);
  font-size: 12px;
}

.auth-card .divider::before,
.auth-card .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.demo-buttons {
  display: grid;
  gap: 10px;
}

/* ---------------------------------------------------------------- подвал */

.footer {
  padding: 22px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12px;
}

.footer .container {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- мобильная версия */

@media (max-width: 700px) {
  .container {
    padding: 0 16px;
  }

  main {
    padding: 24px 0 48px;
  }

  h1 {
    font-size: 28px;
  }

  .page-head {
    margin-bottom: 20px;
  }

  .page-head .sub {
    font-size: 15px;
  }

  .card {
    padding: 18px;
    border-radius: 16px;
  }

  .card.flush .card-head {
    padding: 18px 18px 0;
  }

  .table th:first-child,
  .table td:first-child {
    padding-left: 18px;
  }

  .table th:last-child,
  .table td:last-child {
    padding-right: 18px;
  }

  .table-foot {
    padding: 14px 18px 16px;
  }

  .grid,
  .kpis {
    gap: 12px;
  }

  .grid + .grid,
  .grid + .card,
  .card + .grid,
  .kpis + .grid,
  .kpis + .card,
  .ask-hero + .kpis,
  .segment-row + .kpis,
  .kpis + .buckets,
  .buckets + .card,
  .card + .card {
    margin-top: 12px;
  }

  .hide-mobile {
    display: none;
  }

  .btn {
    min-height: 44px;
  }

  .btn.sm {
    min-height: 36px;
  }
}

/* Таблицы на телефоне превращаются в список: название слева, главное число справа,
   остальные колонки строками «подпись: значение» */
@media (max-width: 700px) {
  .table.stack thead {
    display: none;
  }

  .table.stack,
  .table.stack tbody,
  .table.stack tfoot {
    display: block;
    width: 100%;
  }

  .table.stack tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 14px;
    row-gap: 2px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
  }

  .table.stack tbody tr:last-child {
    border-bottom: 0;
  }

  .table.stack td,
  .table.stack td:first-child,
  .table.stack td:last-child {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
    min-width: 0;
  }

  .table.stack td.title-cell {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .table.stack td.primary {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    align-self: start;
    font-weight: 600;
  }

  .table.stack td[data-label] {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--text-2);
    font-size: 13px;
    white-space: normal;
    max-width: none;
  }

  .table.stack td[data-label]::before {
    content: attr(data-label);
    color: var(--text-3);
    flex: none;
  }

  .table.stack td[data-label]:first-of-type {
    margin-top: 0;
  }

  .table.stack td.title-cell + td[data-label] {
    margin-top: 6px;
  }

  .table.stack td.empty-cell {
    display: none;
  }

  .table.stack tfoot tr {
    border-top: 1px solid var(--line-2);
    border-bottom: 0;
  }

  .table.stack tfoot td[colspan] {
    grid-column: 1;
    grid-row: 1;
  }

  .table.stack tfoot td.num {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .table.stack .inline-form .input {
    width: 70px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
