/* ============================================================================
   ds-components.css — компоненты дизайн-системы (DESIGN.md §6).
   Один вариант каждого компонента + модификаторы. Префикс ds- исключает
   коллизии с Bootstrap/theme.css — старые страницы не затрагиваются.

   ДЕПРЕКАЦИЯ (docs/DEPRECATED-COMPONENTS.md): .metric-card, .kpi-card,
   .stock-kpi, .mg-kpi, .my-btn, .badge-soft, .fc-badge, .badge-risk,
   .action-badge, .wh-chip — заморожены, новые страницы их не используют.
   ============================================================================ */

.ds-scope,
[data-ds] {
    font-family: var(--hp-font);
}

/* ==========================================================================
   Button — DESIGN.md §6.4
   Варианты: primary / secondary / ghost / danger. Размеры: md (36) / sm (32).
   ========================================================================== */
.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    height: 36px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--hp-r-s);
    font-family: var(--hp-font);
    font-size: var(--hp-fs-body-sm);
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--hp-transition), border-color var(--hp-transition),
        color var(--hp-transition), box-shadow var(--hp-transition);
}
.ds-btn:focus-visible {
    outline: none;
    box-shadow: var(--hp-ring);
}
.ds-btn .bi { font-size: 15px; }

.ds-btn--sm { height: 32px; padding: 0 12px; }

.ds-btn--primary {
    background: var(--hp-brand);
    color: #fff;
}
[data-theme='dark'] .ds-btn--primary,
.ds-theme-dark .ds-btn--primary {
    background: var(--hp-brand);
    color: #0D1420;
}
.ds-btn--primary:hover { background: var(--hp-brand-hover); color: #fff; }
.ds-btn--primary:active { background: var(--hp-brand-active); }
[data-theme='dark'] .ds-btn--primary:hover,
.ds-theme-dark .ds-btn--primary:hover { color: #0D1420; }

.ds-btn--secondary {
    background: var(--hp-surface);
    border-color: var(--hp-border-strong);
    color: var(--hp-text-1);
}
.ds-btn--secondary:hover { background: var(--hp-surface-hover); }

.ds-btn--ghost {
    background: transparent;
    color: var(--hp-text-2);
}
.ds-btn--ghost:hover { background: var(--hp-surface-hover); color: var(--hp-text-1); }

.ds-btn--danger {
    background: var(--hp-neg-solid);
    color: #fff;
}
[data-theme='dark'] .ds-btn--danger,
.ds-theme-dark .ds-btn--danger { color: #0D1420; }
.ds-btn--danger:hover { background: var(--hp-neg); }
[data-theme='dark'] .ds-btn--danger:hover,
.ds-theme-dark .ds-btn--danger:hover { background: var(--hp-neg-solid); color: #0D1420; }

/* Disabled — явные цвета, не opacity (без «призрачных» нажатий) */
.ds-btn:disabled,
.ds-btn--disabled {
    background: var(--hp-surface-hover);
    border-color: transparent;
    color: var(--hp-text-3);
    cursor: not-allowed;
    pointer-events: none;
}

/* Loading — спиннер, ширина не прыгает */
.ds-btn.is-loading { pointer-events: none; }
.ds-btn .ds-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ds-spin .7s linear infinite;
    flex: none;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Input / Select / Textarea — DESIGN.md §6.5
   ========================================================================== */
.ds-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 420px;
}
.ds-field--full { max-width: none; }

.ds-label {
    font-size: var(--hp-fs-body-sm);
    font-weight: 500;
    color: var(--hp-text-1);
}
.ds-hint {
    font-size: var(--hp-fs-text-xs);
    color: var(--hp-text-2);
}
.ds-error-text {
    font-size: var(--hp-fs-text-xs);
    color: var(--hp-neg);
}

.ds-input-wrap { position: relative; display: flex; align-items: center; }

.ds-input,
.ds-select,
.ds-textarea {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    background: var(--hp-surface);
    border: 1px solid var(--hp-border-strong);
    border-radius: var(--hp-r-s);
    font-family: var(--hp-font);
    font-size: var(--hp-fs-body-md);
    color: var(--hp-text-1);
    transition: border-color var(--hp-transition), box-shadow var(--hp-transition);
    appearance: none;
}
.ds-textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.ds-input::placeholder,
.ds-textarea::placeholder { color: var(--hp-text-3); }
.ds-input:hover,
.ds-select:hover,
.ds-textarea:hover { border-color: var(--hp-text-3); }
.ds-input:focus,
.ds-select:focus,
.ds-textarea:focus {
    outline: none;
    border-color: var(--hp-brand);
    box-shadow: var(--hp-ring);
}
.ds-input:disabled,
.ds-select:disabled,
.ds-textarea:disabled {
    background: var(--hp-surface-hover);
    border-color: var(--hp-border);
    color: var(--hp-text-3);
    cursor: not-allowed;
}
.ds-input--sm { height: 32px; font-size: var(--hp-fs-body-sm); }

.ds-input--search { padding-left: 34px; }
.ds-input-wrap > .bi {
    position: absolute;
    left: 11px;
    font-size: 15px;
    color: var(--hp-text-3);
    pointer-events: none;
}

.ds-select {
    padding-right: 32px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23667085' viewBox='0 0 16 16'%3E%3Cpath d='M4.2 5.9 8 9.7l3.8-3.8.7.7-4.5 4.5L3.5 6.6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

.ds-field.has-error .ds-input,
.ds-field.has-error .ds-select,
.ds-field.has-error .ds-textarea {
    border-color: var(--hp-neg-solid);
}
.ds-field.has-error .ds-input:focus,
.ds-field.has-error .ds-select:focus {
    box-shadow: 0 0 0 3px var(--hp-neg-tint);
}

/* ==========================================================================
   Badge / Tag — DESIGN.md §6.6
   Тон: positive / negative / warning / neutral / brand / wb / ozon.
   ========================================================================== */
.ds-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 20px;
    padding: 0 8px;
    border-radius: var(--hp-r-xs);
    font-size: var(--hp-fs-text-xs);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}
.ds-badge__dot {
    width: 6px;
    height: 6px;
    border-radius: var(--hp-r-full);
    background: currentColor;
    flex: none;
}

.ds-badge--positive { background: var(--hp-pos-tint); color: var(--hp-pos); }
.ds-badge--negative { background: var(--hp-neg-tint); color: var(--hp-neg); }
.ds-badge--warning  { background: var(--hp-warn-tint); color: var(--hp-warn); }
.ds-badge--brand    { background: var(--hp-brand-tint); color: var(--hp-brand); }
.ds-badge--neutral  { background: var(--hp-surface-hover); color: var(--hp-text-2); }
.ds-badge--wb       { background: var(--hp-wb-tint); color: var(--hp-wb-text); }
.ds-badge--ozon     { background: var(--hp-ozon-tint); color: var(--hp-ozon-text); }
.ds-theme-dark .ds-badge--wb,
[data-theme='dark'] .ds-badge--wb { color: var(--hp-wb-text); }
.ds-theme-dark .ds-badge--ozon,
[data-theme='dark'] .ds-badge--ozon { color: var(--hp-ozon-text); }

/* Тег (чип) — нейтральный по умолчанию, выбранный — brand */
.ds-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-r-full);
    background: var(--hp-surface);
    color: var(--hp-text-2);
    font-size: var(--hp-fs-text-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--hp-transition);
}
.ds-tag:hover { border-color: var(--hp-border-strong); color: var(--hp-text-1); }
.ds-tag.is-selected {
    background: var(--hp-brand-tint);
    border-color: transparent;
    color: var(--hp-brand);
}

/* ==========================================================================
   Card — DESIGN.md §6 (контейнер). Без тени, бордер 1px, радиус 8.
   ========================================================================== */
.ds-card {
    background: var(--hp-surface);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-r-m);
}
.ds-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 14px var(--sp-4);
    border-bottom: 1px solid var(--hp-border);
}
.ds-card__title {
    font-size: var(--hp-fs-title-md);
    font-weight: 600;
    color: var(--hp-ink);
    margin: 0;
}
.ds-card__body { padding: var(--sp-4); }
.ds-card__body--dense { padding: var(--sp-3); }
.ds-card__footer {
    padding: 12px var(--sp-4);
    border-top: 1px solid var(--hp-border);
    background: var(--hp-bg);
    border-radius: 0 0 var(--hp-r-m) var(--hp-r-m);
}

/* ==========================================================================
   KPI — DESIGN.md §6.1. Одна реализация (заменяет 9 старых).
   Состояния: ok / loading / empty / error.
   ========================================================================== */
.ds-kpi {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    padding: var(--sp-4);
    background: var(--hp-surface);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-r-m);
}
.ds-kpi__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--hp-fs-text-xs);
    font-weight: 500;
    color: var(--hp-text-2);
}
.ds-kpi__label .bi { font-size: 13px; color: var(--hp-text-3); cursor: help; }
.ds-kpi__status-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--hp-r-full);
    background: var(--hp-text-3);
    flex: none;
}
.ds-kpi__status-dot--pos { background: var(--hp-pos-solid); }
.ds-kpi__status-dot--neg { background: var(--hp-neg-solid); }
.ds-kpi__status-dot--warn { background: var(--hp-warn-solid); }

.ds-kpi__value {
    font-size: var(--hp-fs-kpi);
    line-height: var(--hp-lh-kpi);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--hp-kpi-value);
    font-variant-numeric: tabular-nums;
}
.ds-kpi__value .ds-kpi__unit {
    font-size: var(--hp-fs-body-md);
    font-weight: 500;
    color: var(--hp-text-3);
    margin-left: 2px;
}
.ds-kpi__value--empty { color: var(--hp-text-3); }

.ds-kpi__delta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--hp-fs-text-xs);
    font-weight: 500;
}
.ds-kpi__delta .bi { font-size: 13px; }
.ds-kpi__delta--up { color: var(--hp-pos); }
.ds-kpi__delta--down { color: var(--hp-neg); }
.ds-kpi__delta-note { font-weight: 400; color: var(--hp-text-3); }
.ds-kpi__error-note { font-size: var(--hp-fs-text-xs); color: var(--hp-neg); }

.ds-kpi--skeleton .ds-kpi__value {
    color: transparent;
    background: var(--hp-skeleton);
    border-radius: var(--hp-r-xs);
    animation: ds-pulse 1.6s ease-in-out infinite;
    width: fit-content;
    min-width: 120px;
}

/* KPI как ссылка (кликабельная карточка-переход) */
a.ds-kpi { text-decoration: none; color: inherit; }
a.ds-kpi:hover { border-color: var(--hp-border-strong); }
a.ds-kpi:hover .ds-kpi__value { color: var(--hp-brand); }
[data-theme='dark'] a.ds-kpi:hover .ds-kpi__value,
.ds-theme-dark a.ds-kpi:hover .ds-kpi__value { color: var(--hp-brand); }

/* ==========================================================================
   Segmented control — переключатель периодов/табов (DESIGN.md §6.4)
   ========================================================================== */
.ds-seg {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: var(--hp-surface-hover);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-r-s);
}
.ds-seg a,
.ds-seg button {
    padding: 4px 10px;
    border: none;
    border-radius: var(--hp-r-xs);
    background: transparent;
    font-family: var(--hp-font);
    font-size: var(--hp-fs-body-sm);
    font-weight: 500;
    line-height: 20px;
    color: var(--hp-text-2);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--hp-transition);
}
.ds-seg a:hover,
.ds-seg button:hover { color: var(--hp-text-1); }
.ds-seg .is-active {
    background: var(--hp-surface);
    color: var(--hp-brand);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .10);
}

/* ==========================================================================
   Table — DESIGN.md §6.2
   ========================================================================== */
.ds-table-wrap {
    background: var(--hp-surface);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-r-m);
    overflow: auto;
}
.ds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--hp-fs-body-sm);
    color: var(--hp-text-1);
}
.ds-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 9px 12px;
    background: var(--hp-surface-hover);
    border-bottom: 1px solid var(--hp-border-strong);
    font-size: var(--hp-fs-overline);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--hp-text-2);
    text-align: left;
    white-space: nowrap;
}
.ds-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--hp-border);
    vertical-align: middle;
}
.ds-table tbody tr:last-child td { border-bottom: none; }
.ds-table tbody tr { transition: background-color var(--hp-transition); }
.ds-table tbody tr:hover { background: var(--hp-brand-wash); }
.ds-table tbody tr.is-selected { background: var(--hp-brand-wash); }
.ds-table .num,
.ds-table td.num { text-align: right; }
.ds-table tfoot td {
    background: var(--hp-bg);
    border-top: 1px solid var(--hp-border-strong);
    border-bottom: none;
    font-weight: 500;
}
.ds-table--dense th,
.ds-table--dense td { padding: 6px 12px; }
.ds-table__empty { text-align: center; padding: var(--sp-7) var(--sp-4) !important; }

/* Закреплённая первая колонка: горизонтальный скролл не теряет контекст строки */
.ds-table--sticky-col th:first-child,
.ds-table--sticky-col td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--hp-surface-hover);
}
.ds-table--sticky-col td:first-child {
    background: var(--hp-surface);
    box-shadow: 1px 0 0 var(--hp-border);
}
.ds-table--sticky-col tbody tr:hover td:first-child { background: var(--hp-brand-wash); }
.ds-table--sticky-col tfoot td:first-child { background: var(--hp-bg); box-shadow: 1px 0 0 var(--hp-border-strong); }

/* ==========================================================================
   Modal — DESIGN.md §5.3/6. Слой shadow-lg, радиус 12.
   ========================================================================== */
.ds-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
}
.ds-modal.is-open { display: flex; }
.ds-modal__overlay {
    position: absolute;
    inset: 0;
    background: var(--hp-overlay);
    animation: ds-fade-in 150ms ease-out;
}
.ds-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    background: var(--hp-surface);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-r-l);
    box-shadow: var(--hp-shadow-lg);
    animation: ds-pop-in 150ms ease-out;
}
.ds-modal__dialog--wide { max-width: 720px; }
.ds-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-bottom: 1px solid var(--hp-border);
}
.ds-modal__title {
    font-size: var(--hp-fs-title-md);
    font-weight: 600;
    color: var(--hp-ink);
    margin: 0;
}
.ds-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--hp-r-s);
    background: transparent;
    color: var(--hp-text-2);
    cursor: pointer;
    transition: all var(--hp-transition);
}
.ds-modal__close:hover { background: var(--hp-surface-hover); color: var(--hp-text-1); }
.ds-modal__body { padding: var(--sp-4); overflow-y: auto; }
.ds-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-2);
    padding: 12px var(--sp-4);
    border-top: 1px solid var(--hp-border);
}
@keyframes ds-fade-in { from { opacity: 0; } }
@keyframes ds-pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ==========================================================================
   Tooltip — CSS-only через data-ds-tooltip
   ========================================================================== */
[data-ds-tooltip] { position: relative; }
[data-ds-tooltip]::after {
    content: attr(data-ds-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    padding: 5px 8px;
    background: var(--hp-ink);
    color: var(--hp-surface);
    border-radius: var(--hp-r-s);
    font-size: var(--hp-fs-text-xs);
    font-weight: 400;
    line-height: var(--hp-lh-text-xs);
    white-space: normal;
    width: max-content;
    max-width: 280px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--hp-transition);
    z-index: 1090;
}
[data-ds-tooltip]:hover::after,
[data-ds-tooltip]:focus-visible::after { opacity: 1; }

/* ==========================================================================
   Toast — DESIGN.md §6.7. Стек справа внизу, JS: DsToast.show({...})
   ========================================================================== */
.ds-toast-stack {
    position: fixed;
    right: var(--sp-4);
    bottom: var(--sp-4);
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    max-width: 360px;
}
.ds-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--hp-ink);
    color: var(--hp-surface);
    border-radius: var(--hp-r-m);
    box-shadow: var(--hp-shadow-md);
    font-size: var(--hp-fs-body-sm);
    animation: ds-toast-in 150ms ease-out;
}
.ds-theme-dark .ds-toast,
[data-theme='dark'] .ds-toast {
    background: #1A2537;
    color: #E9EFF7;
    border: 1px solid var(--hp-border-strong);
}
.ds-toast .bi { font-size: 15px; margin-top: 1px; flex: none; }
.ds-toast--success .bi { color: var(--hp-pos-solid); }
.ds-toast--error .bi { color: var(--hp-neg-solid); }
.ds-toast--warning .bi { color: var(--hp-warn-solid); }
.ds-toast--info .bi { color: var(--hp-brand-steel); }
.ds-toast__content { flex: 1; min-width: 0; }
.ds-toast__title { font-weight: 500; }
.ds-toast__text { color: inherit; opacity: .75; margin-top: 2px; }
.ds-toast__close {
    border: none;
    background: transparent;
    color: inherit;
    opacity: .6;
    cursor: pointer;
    padding: 2px;
    font-size: 14px;
    line-height: 1;
}
.ds-toast__close:hover { opacity: 1; }
.ds-toast.is-hiding { opacity: 0; transition: opacity 200ms ease-in; }
@keyframes ds-toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ==========================================================================
   EmptyState — DESIGN.md §6.7
   ========================================================================== */
.ds-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-6) var(--sp-4);
    text-align: center;
}
.ds-empty .bi {
    font-size: 24px;
    color: var(--hp-text-3);
}
.ds-empty__title {
    font-size: var(--hp-fs-body-md);
    font-weight: 600;
    color: var(--hp-text-1);
}
.ds-empty__text {
    font-size: var(--hp-fs-body-sm);
    color: var(--hp-text-2);
    max-width: 320px;
}
.ds-empty .ds-btn { margin-top: var(--sp-2); }

/* ==========================================================================
   Skeleton — DESIGN.md §6.7
   ========================================================================== */
.ds-skeleton {
    background: var(--hp-skeleton);
    border-radius: var(--hp-r-xs);
    animation: ds-pulse 1.6s ease-in-out infinite;
    color: transparent !important;
    user-select: none;
    pointer-events: none;
}
.ds-skeleton--text { height: 14px; width: 120px; }
.ds-skeleton--title { height: 22px; width: 180px; }
.ds-skeleton--line { height: 14px; width: 100%; }
.ds-skeleton--btn { height: 36px; width: 120px; border-radius: var(--hp-r-s); }
.ds-skeleton--circle { width: 32px; height: 32px; border-radius: var(--hp-r-full); }
.ds-skeleton--kpi { height: 140px; border-radius: var(--hp-r-m); }
@keyframes ds-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}

/* ==========================================================================
   Alert (инлайн-ошибка/уведомление) — DESIGN.md §6.7
   ========================================================================== */
.ds-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--hp-r-s);
    font-size: var(--hp-fs-body-sm);
}
.ds-alert .bi { font-size: 15px; margin-top: 1px; flex: none; }
.ds-alert--error { background: var(--hp-neg-tint); color: var(--hp-neg); }
.ds-alert--warning { background: var(--hp-warn-tint); color: var(--hp-warn); }
.ds-alert--info { background: var(--hp-brand-tint); color: var(--hp-brand); }
.ds-alert__content { flex: 1; }
.ds-alert .ds-btn { margin-top: 8px; }

/* ==========================================================================
   Типографика (утилиты шкалы, DESIGN.md §3.3) — для Adoption на страницах
   ========================================================================== */
.ds-t-display-1 { font-size: var(--hp-fs-display-1); line-height: var(--hp-lh-display-1); font-weight: 600; letter-spacing: -0.01em; color: var(--hp-ink); }
.ds-t-title-xl  { font-size: var(--hp-fs-title-xl);  line-height: var(--hp-lh-title-xl);  font-weight: 600; letter-spacing: -0.01em; color: var(--hp-ink); }
.ds-t-title-lg  { font-size: var(--hp-fs-title-lg);  line-height: var(--hp-lh-title-lg);  font-weight: 600; letter-spacing: -0.01em; color: var(--hp-ink); }
.ds-t-title-md  { font-size: var(--hp-fs-title-md);  line-height: var(--hp-lh-title-md);  font-weight: 600; color: var(--hp-ink); }
.ds-t-body-md   { font-size: var(--hp-fs-body-md);   line-height: var(--hp-lh-body-md);   color: var(--hp-text-1); }
.ds-t-body-sm   { font-size: var(--hp-fs-body-sm);   line-height: var(--hp-lh-body-sm);   color: var(--hp-text-1); }
.ds-t-xs        { font-size: var(--hp-fs-text-xs);   line-height: var(--hp-lh-text-xs);   color: var(--hp-text-2); }
.ds-t-overline  { font-size: var(--hp-fs-overline);  line-height: var(--hp-lh-overline);  font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--hp-text-2); }
.ds-mono        { font-family: var(--hp-font-mono); font-size: var(--hp-fs-body-sm); color: var(--hp-text-1); }

/* Контейнер страницы дизайн-системы (демо поверх/вместо старого chrome) */
.ds-page {
    font-family: var(--hp-font);
    background: var(--hp-bg);
    color: var(--hp-text-1);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-r-l);
    padding: var(--sp-5);
    transition: background-color var(--hp-transition), border-color var(--hp-transition);
}
.ds-page__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    flex-wrap: wrap;
    margin-bottom: var(--sp-2);
}
.ds-section { margin-top: var(--sp-6); }
.ds-section__title {
    font-size: var(--hp-fs-title-lg);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--hp-ink);
    margin: 0 0 var(--sp-1);
}
.ds-section__note { font-size: var(--hp-fs-body-sm); color: var(--hp-text-2); margin: 0 0 var(--sp-4); }
.ds-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    align-items: flex-end;
}
.ds-grid-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--sp-4);
}
.ds-code {
    background: var(--hp-surface);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-r-m);
    padding: var(--sp-4);
    font-family: var(--hp-font-mono);
    font-size: 12px;
    line-height: 18px;
    color: var(--hp-text-1);
    overflow-x: auto;
    white-space: pre;
    margin: 0;
}
.ds-swatch {
    border-radius: var(--hp-r-s);
    border: 1px solid var(--hp-border);
    overflow: hidden;
    min-width: 120px;
}
.ds-swatch__color { height: 44px; }
.ds-swatch__meta {
    padding: 8px 10px;
    background: var(--hp-surface);
    font-family: var(--hp-font-mono);
    font-size: 11px;
    line-height: 15px;
    color: var(--hp-text-2);
}

