/* Conty · тема «Observatory».
   Единый источник цветов для CSS и Tailwind: RGB-триплеты в --rgb-*,
   которые Tailwind читает как rgb(var(--rgb-x) / <alpha-value>), а
   компоненты — как rgb(var(--rgb-x)). Менять цвет надо здесь и только здесь. */

:root {
    color-scheme: dark;

    --rgb-canvas: 8 11 18;
    --rgb-surface: 14 18 27;
    --rgb-elevated: 20 26 37;
    --rgb-raised: 27 35 51;
    --rgb-ink: 231 235 243;
    --rgb-ink-dim: 166 176 195;
    --rgb-ink-faint: 108 118 144;
    --rgb-line: 148 163 184;
    --rgb-accent: 61 220 151;
    --rgb-accent-strong: 98 237 181;
    --rgb-accent-dim: 31 183 122;
    --rgb-accent-ink: 5 43 27;
    --rgb-amber: 245 181 68;
    --rgb-rose: 251 113 133;
    --rgb-sky: 125 211 252;
    --rgb-violet: 196 181 253;

    --canvas: rgb(var(--rgb-canvas));
    --surface: rgb(var(--rgb-surface));
    --elevated: rgb(var(--rgb-elevated));
    --raised: rgb(var(--rgb-raised));
    --ink: rgb(var(--rgb-ink));
    --ink-dim: rgb(var(--rgb-ink-dim));
    --ink-faint: rgb(var(--rgb-ink-faint));
    --accent: rgb(var(--rgb-accent));
    --accent-strong: rgb(var(--rgb-accent-strong));
    --accent-dim: rgb(var(--rgb-accent-dim));
    --accent-ink: rgb(var(--rgb-accent-ink));
    --amber: rgb(var(--rgb-amber));
    --rose: rgb(var(--rgb-rose));
    --sky: rgb(var(--rgb-sky));
    --violet: rgb(var(--rgb-violet));
    --line: rgb(var(--rgb-line) / .11);
    --line-strong: rgb(var(--rgb-line) / .2);
    --line-faint: rgb(var(--rgb-line) / .06);

    --font-ui: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Unbounded', 'Onest', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-pop: 0 24px 60px -18px rgb(0 0 0 / .75), 0 2px 8px rgb(0 0 0 / .35);
    --glow-accent: 0 0 26px -6px rgb(var(--rgb-accent) / .5);
    --focus: 0 0 0 3px rgb(var(--rgb-accent) / .3);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { background: var(--canvas); }
body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
/* Тихая аврора и точечная сетка — приборный фон, который не спорит
   с данными. Псевдоэлемент фиксирован и лежит под всем содержимым. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 540px at 88% -12%, rgb(var(--rgb-accent) / .12), transparent 60%),
        radial-gradient(720px 520px at -4% 0%, rgb(var(--rgb-sky) / .07), transparent 58%),
        radial-gradient(rgb(var(--rgb-line) / .09) 1px, transparent 1.2px) 0 0 / 28px 28px;
}
body > * { position: relative; }
[x-cloak] { display: none !important; }
::selection { background: rgb(var(--rgb-accent) / .3); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(var(--rgb-line) / .22); border-radius: 6px; border: 3px solid var(--canvas); }
::-webkit-scrollbar-thumb:hover { background: rgb(var(--rgb-line) / .38); }
* { scrollbar-width: thin; scrollbar-color: rgb(var(--rgb-line) / .28) transparent; }

a { color: inherit; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.7); }
:focus-visible { outline: 2px solid rgb(var(--rgb-accent) / .75); outline-offset: 2px; border-radius: 4px; }

/* ---------- типографика ---------- */

.eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.h1, .page-head h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 21px;
    letter-spacing: -.005em;
    line-height: 1.2;
    color: var(--ink);
}
.h2 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 14px; line-height: 1.3; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.lead { color: var(--ink-dim); font-size: 12.5px; line-height: 1.6; max-width: 64ch; }

/* ---------- страница ---------- */

.page { max-width: 1440px; margin: 0 auto; padding: 26px 28px 40px; }
.page-narrow { max-width: 1100px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head .eyebrow { margin-bottom: 7px; }
.page-head .eyebrow a { text-decoration: none; }
.page-head .eyebrow a:hover { color: var(--accent); }
.page-head .lead { margin-top: 7px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.title-count {
    display: inline-flex; align-items: center; margin-left: 10px; padding: 2px 8px;
    border: 1px solid rgb(var(--rgb-accent) / .3); border-radius: 6px;
    background: rgb(var(--rgb-accent) / .08); color: var(--accent);
    font: 600 12px/1.5 var(--font-mono); letter-spacing: 0; vertical-align: middle;
}

/* ---------- панели ---------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
.panel-pad { padding: 18px 20px; }
.panel-inset { background: rgb(var(--rgb-canvas) / .55); border: 1px solid var(--line-faint); border-radius: var(--radius); }
/* Подсвеченная кромка: стекло, поймавшее свет сверху. */
.panel-glow {
    background-image: linear-gradient(90deg, transparent, rgb(var(--rgb-accent) / .55), transparent);
    background-repeat: no-repeat;
    background-size: 60% 1px;
    background-position: 50% 0;
}
/* Угловые засечки HUD — только на главных readout-панелях и модалках. */
.hud { position: relative; }
.hud::before, .hud::after {
    content: ''; position: absolute; width: 11px; height: 11px;
    border: 0 solid rgb(var(--rgb-accent) / .7); pointer-events: none;
}
.hud::before { top: -1px; left: -1px; border-top-width: 1.5px; border-left-width: 1.5px; border-top-left-radius: 4px; }
.hud::after { right: -1px; bottom: -1px; border-right-width: 1.5px; border-bottom-width: 1.5px; border-bottom-right-radius: 4px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- readout ---------- */

.readout { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.readout-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); }
.readout-value {
    font-family: var(--font-mono); font-size: 26px; font-weight: 600; letter-spacing: -.02em;
    line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink);
    overflow-wrap: anywhere;
}
.readout-value.is-accent { color: var(--accent); text-shadow: 0 0 22px rgb(var(--rgb-accent) / .35); }
.readout-value.is-amber { color: var(--amber); }
.readout-value.is-rose { color: var(--rose); }
.readout-value small { font-family: var(--font-ui); font-size: 13px; font-weight: 400; color: var(--ink-faint); letter-spacing: 0; }
.readout-sub { font-size: 11px; color: var(--ink-faint); line-height: 1.45; }
.readout-sub b { color: var(--ink-dim); font-weight: 600; }
.readout-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.readout-strip > * { padding: 15px 20px; border-left: 1px solid var(--line-faint); min-width: 0; }
.readout-strip > :first-child { border-left: 0; }
.readout-strip .readout-value { font-size: 23px; }

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

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 34px; padding: 0 13px;
    border: 1px solid var(--line-strong); border-radius: 8px;
    background: rgb(var(--rgb-raised) / .55); color: var(--ink-dim);
    font: 600 12.5px/1 var(--font-ui); white-space: nowrap; text-decoration: none;
    cursor: pointer; user-select: none;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.btn:hover { background: var(--raised); color: var(--ink); border-color: rgb(var(--rgb-line) / .32); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: default; transform: none; }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: var(--glow-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); border-color: transparent; box-shadow: 0 0 30px -4px rgb(var(--rgb-accent) / .65); }
.btn-primary:disabled { box-shadow: none; }
.btn-danger { color: var(--rose); border-color: rgb(var(--rgb-rose) / .3); background: rgb(var(--rgb-rose) / .06); }
.btn-danger:hover { color: #ffd0d8; background: rgb(var(--rgb-rose) / .16); border-color: rgb(var(--rgb-rose) / .5); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgb(var(--rgb-raised) / .7); border-color: transparent; }
.btn-sm { min-height: 28px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn-link {
    display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none;
    color: var(--ink-dim); font: 600 12px/1.4 var(--font-ui); cursor: pointer; text-decoration: none;
}
.btn-link:hover { color: var(--accent); }
.btn-link.is-danger:hover { color: var(--rose); }

/* ---------- поля ---------- */

.field {
    display: block; width: 100%; min-height: 34px; padding: 6px 10px;
    border: 1px solid var(--line-strong); border-radius: 8px;
    background: rgb(var(--rgb-canvas) / .6); color: var(--ink);
    font: 400 12.5px/1.45 var(--font-ui); outline: none; box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.field::placeholder { color: var(--ink-faint); }
.field:hover { border-color: rgb(var(--rgb-line) / .3); }
.field:focus { border-color: rgb(var(--rgb-accent) / .6); box-shadow: var(--focus); background: var(--canvas); }
.field:disabled { opacity: .5; }
.field-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.field-sm { min-height: 28px; padding: 3px 8px; font-size: 12px; border-radius: 7px; }
.field-inline { display: inline-block; width: auto; }
select.field {
    appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%236c7690' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='m3 4.5 3 3 3-3'/></svg>");
    background-repeat: no-repeat; background-position: right 10px center;
}
select.field option { background: var(--elevated); color: var(--ink); }
textarea.field { min-height: 72px; resize: vertical; line-height: 1.5; }
.field-label { display: block; margin-bottom: 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.field-help { display: block; margin-top: 6px; font-size: 11px; line-height: 1.5; color: var(--ink-faint); }
.field-error { margin: 10px 0; padding: 9px 12px; border: 1px solid rgb(var(--rgb-rose) / .35); border-radius: 8px; background: rgb(var(--rgb-rose) / .08); color: #ffc6cf; font-size: 12px; line-height: 1.5; }
.field-search { position: relative; }
.field-search > svg { position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.field-search > .field { padding-left: 31px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--ink-dim); }
.check input { width: 14px; height: 14px; margin: 0; flex: none; }
.check:hover { color: var(--ink); }

/* ---------- сегменты, чипы, бейджи ---------- */

.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgb(var(--rgb-canvas) / .55); }
.seg > button, .seg > label, .seg > a {
    display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 0 10px;
    border: 0; border-radius: 6px; background: transparent; color: var(--ink-dim);
    font: 600 11.5px/1 var(--font-ui); white-space: nowrap; cursor: pointer; text-decoration: none;
    transition: background .15s, color .15s, box-shadow .15s;
}
.seg > :hover { color: var(--ink); }
.seg > .is-on, .seg > [aria-pressed=true], .seg > .is-active {
    background: rgb(var(--rgb-accent) / .14); color: var(--accent);
    box-shadow: inset 0 0 0 1px rgb(var(--rgb-accent) / .32);
}
.seg > * > small { padding: 0 5px; border-radius: 4px; background: rgb(var(--rgb-line) / .15); color: var(--ink-faint); font: 600 10px/1.6 var(--font-mono); }
.seg > .is-on > small { background: rgb(var(--rgb-accent) / .2); color: var(--accent); }
.seg-mono > * { font-family: var(--font-mono); font-size: 11px; }

.chip {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
    border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 11px;
    font-size: 12px; color: var(--ink-dim); background: rgb(var(--rgb-raised) / .4);
    transition: border-color .15s, color .15s, background .15s; text-decoration: none; line-height: 1.3;
}
.chip:hover { border-color: rgb(var(--rgb-line) / .38); color: var(--ink); }
.chip-on { background: rgb(var(--rgb-accent) / .12); border-color: rgb(var(--rgb-accent) / .45); color: var(--accent); font-weight: 600; }
.chip:has(input:focus-visible) { outline: 2px solid rgb(var(--rgb-accent) / .6); outline-offset: 2px; }
.chip-sm { padding: 2px 8px; font-size: 11px; }

.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 7px;
    border: 1px solid var(--line); border-radius: 999px;
    background: rgb(var(--rgb-raised) / .5); color: var(--ink-dim);
    font: 600 10px/1.7 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.badge-ok { color: var(--accent); border-color: rgb(var(--rgb-accent) / .35); background: rgb(var(--rgb-accent) / .09); }
.badge-warn { color: var(--amber); border-color: rgb(var(--rgb-amber) / .35); background: rgb(var(--rgb-amber) / .09); }
.badge-danger { color: var(--rose); border-color: rgb(var(--rgb-rose) / .35); background: rgb(var(--rgb-rose) / .09); }
.badge-info { color: var(--sky); border-color: rgb(var(--rgb-sky) / .35); background: rgb(var(--rgb-sky) / .09); }
.badge-plain::before { display: none; }
.badge.is-live::before { animation: pulse 1.5s ease-in-out infinite; }
.count-pill {
    display: inline-flex; align-items: center; border-radius: 999px; padding: 1px 8px;
    font-family: var(--font-mono); font-size: 11px; font-weight: 600;
    background: rgb(var(--rgb-line) / .14); color: var(--ink-dim);
}
.kbd {
    display: inline-block; padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px;
    border-radius: 4px; background: rgb(var(--rgb-canvas) / .7); color: var(--ink-faint);
    font: 500 10px/1.5 var(--font-mono);
}
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.dot-ok { background: var(--accent); box-shadow: 0 0 10px rgb(var(--rgb-accent) / .6); }
.dot-warn { background: var(--amber); box-shadow: 0 0 10px rgb(var(--rgb-amber) / .6); }
.dot-danger { background: var(--rose); box-shadow: 0 0 10px rgb(var(--rgb-rose) / .6); }
.dot.is-live { animation: pulse 1.5s ease-in-out infinite; }

/* ---------- сообщения ---------- */

.notice {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 10px 13px; border: 1px solid rgb(var(--rgb-accent) / .25); border-radius: 9px;
    background: rgb(var(--rgb-accent) / .07); color: #c8f5e2; font-size: 12px; line-height: 1.55;
}
.notice.is-warning { border-color: rgb(var(--rgb-amber) / .3); background: rgb(var(--rgb-amber) / .08); color: #ffe2a8; }
.notice.is-error { border-color: rgb(var(--rgb-rose) / .35); background: rgb(var(--rgb-rose) / .08); color: #ffc6cf; }
.notice.is-muted { border-color: var(--line); background: rgb(var(--rgb-raised) / .4); color: var(--ink-dim); }
.notice button, .notice a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; white-space: nowrap; }
.notice strong { font-weight: 650; }

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

.table-wrap { overflow-x: auto; }
.grid-table { width: 100%; border-collapse: collapse; }
.grid-table th {
    padding: 8px 10px; text-align: left; vertical-align: bottom;
    font: 500 10px/1.5 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
    border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap;
}
.grid-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-faint); color: var(--ink-dim); font-size: 12px; vertical-align: middle; }
.grid-table tbody tr:last-child td { border-bottom: 0; }
.grid-table tbody tr:hover td { background: rgb(var(--rgb-raised) / .35); }
.grid-table tbody tr:hover td, .grid-table tbody tr:hover th { color: var(--ink); }
.grid-table tbody tr.is-selected td { background: rgb(var(--rgb-accent) / .07); }
.grid-table .cell-num, .cell-num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid-table .cell-mono, .cell-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.grid-table .cell-key { color: var(--ink); font-weight: 600; }
.grid-table .cell-faint { color: var(--ink-faint); }
/* Ghost-бар: величина видна раньше, чем прочитана цифра. Ширина — доля от
   максимума колонки, задаётся --w на элементе. */
.cell-bar { position: relative; }
.cell-bar > i {
    position: absolute; top: 7px; bottom: 7px; left: 0; width: var(--w, 0%); max-width: 100%;
    border-radius: 2px; pointer-events: none;
    background: linear-gradient(90deg, rgb(var(--rgb-accent) / .02), rgb(var(--rgb-accent) / .17));
    border-right: 1px solid rgb(var(--rgb-accent) / .38);
}
.cell-bar > i.is-sky { background: linear-gradient(90deg, rgb(var(--rgb-sky) / .02), rgb(var(--rgb-sky) / .15)); border-right-color: rgb(var(--rgb-sky) / .4); }
.cell-bar > *:not(i) { position: relative; }
.type-glyph { display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.type-glyph.is-email { color: var(--sky); }
.type-glyph.is-number { color: var(--accent); }
.type-glyph.is-date { color: var(--amber); }
.type-glyph.is-boolean { color: var(--violet); }
.email-cell { font-family: var(--font-mono); font-size: 11.5px; }
.email-cell .at { color: var(--ink-faint); }

/* ---------- модалки ---------- */

.modal-backdrop {
    position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgb(3 5 10 / .64); backdrop-filter: blur(8px);
}
.modal {
    position: relative; width: 100%; max-width: 480px; max-height: 90dvh; overflow: auto; box-sizing: border-box;
    background: var(--elevated); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
    box-shadow: inset 0 1px 0 rgb(var(--rgb-accent) / .35), var(--shadow-pop);
    animation: modalIn .22s var(--ease) both;
}
.modal-md { max-width: 620px; }
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 920px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.modal-head .eyebrow { margin-bottom: 5px; }
.modal-title { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 500; line-height: 1.3; }
.modal-title.is-danger { color: var(--rose); }
.modal-sub { margin: 5px 0 0; color: var(--ink-dim); font-size: 12px; line-height: 1.55; }
.modal-body { padding: 0 20px 18px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--line-faint); }
.modal-foot.is-split { justify-content: space-between; }
.modal-close {
    display: grid; place-items: center; width: 30px; height: 30px; flex: none; margin: -4px -6px 0 0;
    border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink-faint);
    font-size: 20px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: var(--raised); color: var(--ink); }
.modal-pop { animation: modalIn .22s var(--ease) both; }

/* ---------- тосты ---------- */

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 130; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
    pointer-events: auto; min-width: 240px; max-width: 400px; padding: 10px 14px;
    border: 1px solid var(--line-strong); border-radius: 10px; background: var(--elevated); color: var(--ink);
    box-shadow: var(--shadow-pop); font-size: 12.5px; line-height: 1.5; animation: toastIn .25s var(--ease) both;
}
.toast-ok { border-color: rgb(var(--rgb-accent) / .45); }
.toast-error { border-color: rgb(var(--rgb-rose) / .5); }
.toast-warn { border-color: rgb(var(--rgb-amber) / .5); }

/* ---------- прогресс ---------- */

.bar { height: 5px; border-radius: 999px; background: rgb(var(--rgb-line) / .14); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s var(--ease); }
.bar > i.is-amber { background: var(--amber); }
.bar > i.is-rose { background: var(--rose); }
.bar-live { position: relative; overflow: hidden; }
.bar-live::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .45), transparent); animation: barSweep 1.15s ease-in-out infinite; }
.bar-scan { width: 38%; background: var(--accent); animation: barScan 1.1s ease-in-out infinite; }
.spinner { width: 14px; height: 14px; border: 2px solid rgb(var(--rgb-accent) / .25); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; flex: none; }

/* ---------- пустые состояния ---------- */

.empty { padding: 48px 20px; text-align: center; color: var(--ink-faint); }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 12px; background: rgb(var(--rgb-accent) / .1); box-shadow: inset 0 0 0 1px rgb(var(--rgb-accent) / .3); color: var(--accent); }
.empty-icon svg { width: 20px; height: 20px; }
.empty h3 { margin: 0; font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--ink); }
.empty p { margin: 6px 0 16px; font-size: 12px; }

/* ---------- анимация ---------- */

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes barSweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes barScan { 0% { margin-left: -38%; } 100% { margin-left: 100%; } }
@keyframes ringPulse { 0% { box-shadow: 0 0 0 0 rgb(var(--rgb-accent) / .4); } 100% { box-shadow: 0 0 0 16px rgb(var(--rgb-accent) / 0); } }
.fade-up { animation: fadeUp .4s var(--ease) both; }
.ring-pulse { animation: ringPulse .8s ease-out both; }
.accent-dot { animation: pulse 2.4s ease-in-out infinite; }
.card-row { transition: border-color .2s, background .2s, box-shadow .2s; }
.card-row:hover { border-color: rgb(var(--rgb-accent) / .4); background: var(--elevated); box-shadow: 0 0 0 1px rgb(var(--rgb-accent) / .12), var(--glow-accent); }
.grid-lines {
    background-image:
        linear-gradient(rgb(var(--rgb-line) / .045) 1px, transparent 1px),
        linear-gradient(90deg, rgb(var(--rgb-line) / .045) 1px, transparent 1px);
    background-size: 36px 36px;
}
.enrich-mark { box-shadow: inset 3px 0 0 rgb(var(--rgb-accent) / .6); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .bar-scan { width: 100%; opacity: .45; }
}

@media (max-width: 767px) {
    .page { padding: 18px 16px 32px; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .readout-strip { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
    .readout-strip > * { border-left: 0; border-top: 1px solid var(--line-faint); padding: 13px 14px; }
    .readout-strip > :nth-child(-n+2) { border-top: 0; }
    .readout-strip > :nth-child(even) { border-left: 1px solid var(--line-faint); }
    .modal-backdrop { padding: 12px; align-items: flex-end; }
    .toast-stack { right: 12px; left: 12px; bottom: 12px; }
}
