/* Цветовые схемы: задают --s-*; режим (светлый/тёмный) выбирает нужные значения ниже */
:root {
  --s-side-text-d: var(--s-side-text); --s-side-strong: #ffffff; --s-side-strong-d: #ffffff;
  --s-accent-ink: #ffffff; --s-accent-ink-d: #0d0c12;
}
:root,
:root[data-scheme="violet"] {
  --s-accent: #6246ea; --s-accent-d: #8b7bff; --s-soft: #ece8ff; --s-soft-d: #2b2550;
  --s-side: #17142a; --s-side-d: #0b0915; --s-side-text: #c9c5e4; --s-side-active: #2a2548; --s-side-active-d: #221d3d; --s-glow: #3a2f8f;
  --s-bg: #f4f3f8; --s-surface-2: #f8f7fc; --s-border: #e4e2ee; --s-grid: #ecebf2;
  --s-bg-d: #110f1c; --s-surface-d: #1b1829; --s-surface-2-d: #221f33; --s-border-d: #2e2a44; --s-grid-d: #2a2740;
}
:root[data-scheme="ocean"] {
  --s-accent: #0b6bcb; --s-accent-d: #4da3ff; --s-soft: #e1eefc; --s-soft-d: #16304f;
  --s-side: #0c1b2e; --s-side-d: #060d17; --s-side-text: #bcd0e6; --s-side-active: #17304f; --s-side-active-d: #132741; --s-glow: #134a8a;
  --s-bg: #f2f5f9; --s-surface-2: #f6f9fc; --s-border: #dfe6ee; --s-grid: #e8edf3;
  --s-bg-d: #0c121b; --s-surface-d: #152030; --s-surface-2-d: #1b283a; --s-border-d: #26364c; --s-grid-d: #223044;
}
:root[data-scheme="emerald"] {
  --s-accent: #0c7f57; --s-accent-d: #3ccf91; --s-soft: #dff3ea; --s-soft-d: #153a2d;
  --s-side: #0d201a; --s-side-d: #06110d; --s-side-text: #b9d8ca; --s-side-active: #173a2e; --s-side-active-d: #132f25; --s-glow: #13624a;
  --s-bg: #f2f6f4; --s-surface-2: #f6faf8; --s-border: #dde8e2; --s-grid: #e6eee9;
  --s-bg-d: #0c1512; --s-surface-d: #14211c; --s-surface-2-d: #1a2a24; --s-border-d: #253a31; --s-grid-d: #21332b;
}
:root[data-scheme="graphite"] {
  --s-accent: #c8461c; --s-accent-d: #ff7f50; --s-soft: #fce8e0; --s-soft-d: #3a2218;
  --s-side: #18181b; --s-side-d: #0a0a0b; --s-side-text: #c8c8cf; --s-side-active: #2a2a30; --s-side-active-d: #222226; --s-glow: #5a2a17;
  --s-bg: #f4f4f5; --s-surface-2: #f8f8f9; --s-border: #e4e4e7; --s-grid: #ececee;
  --s-bg-d: #111113; --s-surface-d: #1b1b1e; --s-surface-2-d: #222226; --s-border-d: #2e2e33; --s-grid-d: #29292e;
}
:root[data-scheme="rose"] {
  --s-accent: #d6336c; --s-accent-d: #f06595; --s-soft: #fce4ee; --s-soft-d: #3d1a2a;
  --s-side: #2a0f1c; --s-side-d: #12070d; --s-side-text: #e5c3d2; --s-side-active: #451a2e; --s-side-active-d: #381626; --s-glow: #7a1f47;
  --s-bg: #f8f3f5; --s-surface-2: #fcf7f9; --s-border: #eee1e6; --s-grid: #f3eaee;
  --s-bg-d: #170e13; --s-surface-d: #22151c; --s-surface-2-d: #2a1b23; --s-border-d: #3b2631; --s-grid-d: #35212b;
}
/* детские схемы */
:root[data-scheme="candy"] {
  --s-accent: #cf2e67; --s-accent-ink: #ffffff; --s-soft: #ffe3ee; --s-glow: #ff8cc6;
  --s-side: #ffdeeb; --s-side-text: #6b1f45; --s-side-strong: #3d0f26; --s-side-active: #fcc2d7;
  --s-bg: #fff4f8; --s-surface-2: #fff8fb; --s-border: #f7d6e4; --s-grid: #fbe7ef;
  --s-accent-d: #f783ac; --s-accent-ink-d: #1a0a12; --s-soft-d: #45182d;
  --s-side-d: #2b1320; --s-side-text-d: #f3c6da; --s-side-strong-d: #ffffff; --s-side-active-d: #4a1f35;
  --s-bg-d: #1a0e14; --s-surface-d: #25141d; --s-surface-2-d: #2e1a25; --s-border-d: #43263a; --s-grid-d: #3a2130;
}
:root[data-scheme="lemon"] {
  --s-accent: #f59f00; --s-accent-ink: #231a00; --s-soft: #fff3bf; --s-glow: #ffd43b;
  --s-side: #fff3bf; --s-side-text: #5c4300; --s-side-strong: #2e2100; --s-side-active: #ffe066;
  --s-bg: #fffbea; --s-surface-2: #fffdf3; --s-border: #f3e6b3; --s-grid: #f7efcf;
  --s-accent-d: #fcc419; --s-accent-ink-d: #231a00; --s-soft-d: #3a300c;
  --s-side-d: #221c07; --s-side-text-d: #f5e3a1; --s-side-strong-d: #ffffff; --s-side-active-d: #3d3310;
  --s-bg-d: #15130a; --s-surface-d: #201d10; --s-surface-2-d: #282414; --s-border-d: #3b3520; --s-grid-d: #332e1b;
}
:root[data-scheme="mint"] {
  --s-accent: #12b886; --s-accent-ink: #042a20; --s-soft: #d3f9ec; --s-glow: #63e6be;
  --s-side: #c3fae8; --s-side-text: #0b4d3c; --s-side-strong: #04291f; --s-side-active: #96f2d7;
  --s-bg: #f1fcf8; --s-surface-2: #f7fefb; --s-border: #cdeee2; --s-grid: #e0f5ec;
  --s-accent-d: #38d9a9; --s-accent-ink-d: #042a20; --s-soft-d: #123d31;
  --s-side-d: #0b231c; --s-side-text-d: #b2f2dc; --s-side-strong-d: #ffffff; --s-side-active-d: #134a3a;
  --s-bg-d: #0b1512; --s-surface-d: #13211c; --s-surface-2-d: #192a24; --s-border-d: #24403a; --s-grid-d: #1f362e;
}
:root[data-scheme="sky"] {
  --s-accent: #1971c2; --s-accent-ink: #ffffff; --s-soft: #dbeeff; --s-glow: #74c0fc;
  --s-side: #d0ebff; --s-side-text: #0b3d66; --s-side-strong: #04213a; --s-side-active: #a5d8ff;
  --s-bg: #f3f9ff; --s-surface-2: #f8fbff; --s-border: #d3e6f7; --s-grid: #e3eef9;
  --s-accent-d: #4dabf7; --s-accent-ink-d: #041526; --s-soft-d: #133456;
  --s-side-d: #0b1d33; --s-side-text-d: #b8dcff; --s-side-strong-d: #ffffff; --s-side-active-d: #16375c;
  --s-bg-d: #0b121c; --s-surface-d: #131e2c; --s-surface-2-d: #192637; --s-border-d: #253a52; --s-grid-d: #203247;
}
:root[data-scheme="rainbow"] {
  --s-accent: #7048e8; --s-accent-ink: #ffffff; --s-soft: #efe9ff; --s-glow: #ff8787;
  --s-side: linear-gradient(180deg, #ffc9c9 0%, #ffec99 25%, #b2f2bb 50%, #a5d8ff 75%, #d0bfff 100%); --s-side-text: #3b2f4a; --s-side-strong: #1d1428; --s-side-active: rgba(255,255,255,.6);
  --s-bg: #fbf8ff; --s-surface-2: #fdfbff; --s-border: #e9e1f5; --s-grid: #f1ecf8;
  --s-accent-d: #9775fa; --s-accent-ink-d: #140c26; --s-soft-d: #2c2150;
  --s-side-d: linear-gradient(180deg, #4a1f24 0%, #4a3d12 25%, #173d22 50%, #15324d 75%, #2d2150 100%); --s-side-text-d: #efe6ff; --s-side-strong-d: #ffffff; --s-side-active-d: rgba(255,255,255,.14);
  --s-bg-d: #120f19; --s-surface-d: #1c1826; --s-surface-2-d: #231f30; --s-border-d: #342d47; --s-grid-d: #2c263d;
}
:root {
  color-scheme: light;
  --bg: var(--s-bg);
  --surface: #ffffff;
  --surface-2: var(--s-surface-2);
  --border: var(--s-border);
  --text: #16151c;
  --text-2: #55535f;
  --muted: #8a8894;
  --accent: var(--s-accent);
  --accent-ink: var(--s-accent-ink);
  --accent-soft: var(--s-soft);
  --side: var(--s-side);
  --side-text: var(--s-side-text);
  --side-strong: var(--s-side-strong);
  --side-active: var(--s-side-active);
  --series-1: #2a78d6;
  --series-2: #e07b24;
  --series-3: #169c6e;
  --series-4: #8a5cd6;
  --neg: #e34948;
  --grid: var(--s-grid);
  --good: #0e8a4f; --good-bg: #e2f5ea;
  --warn: #9a6200; --warn-bg: #fdf0d5;
  --bad: #c0302f;  --bad-bg: #fde5e4;
  --shadow: 0 1px 2px rgba(20, 16, 40, .05), 0 4px 16px rgba(20, 16, 40, .04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: var(--s-bg-d); --surface: var(--s-surface-d); --surface-2: var(--s-surface-2-d); --border: var(--s-border-d);
    --text: #f3f2f7; --text-2: #bdbac9; --muted: #85828f;
    --accent: var(--s-accent-d); --accent-ink: var(--s-accent-ink-d); --accent-soft: var(--s-soft-d);
    --side: var(--s-side-d); --side-active: var(--s-side-active-d); --side-text: var(--s-side-text-d); --side-strong: var(--s-side-strong-d);
    --series-1: #3987e5; --neg: #e66767; --grid: var(--s-grid-d);
    --good: #4cc98a; --good-bg: #16352a; --warn: #f0b64a; --warn-bg: #3a2e14; --bad: #ff7a78; --bad-bg: #3d1c1f;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--s-bg-d); --surface: var(--s-surface-d); --surface-2: var(--s-surface-2-d); --border: var(--s-border-d);
  --text: #f3f2f7; --text-2: #bdbac9; --muted: #85828f;
  --accent: var(--s-accent-d); --accent-ink: var(--s-accent-ink-d); --accent-soft: var(--s-soft-d);
  --side: var(--s-side-d); --side-active: var(--s-side-active-d); --side-text: var(--s-side-text-d); --side-strong: var(--s-side-strong-d);
  --series-1: #3987e5; --neg: #e66767; --grid: var(--s-grid-d);
  --good: #4cc98a; --good-bg: #16352a; --warn: #f0b64a; --warn-bg: #3a2e14; --bad: #ff7a78; --bad-bg: #3d1c1f;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- вход ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% -10%, var(--s-glow) 0%, transparent 60%), var(--side);
}
.login-card {
  width: 100%; max-width: 360px; background: var(--surface); border-radius: 16px;
  padding: 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800;
}
.login-card h1 { font-size: 20px; margin: 24px 0 4px; }
.login-card p { color: var(--text-2); margin: 0 0 20px; }

label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
input[type=password], input[type=text], input[type=date], input[type=search] {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
}
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn {
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border); font-weight: 500; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }

.msg { font-size: 13px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.ok { background: var(--good-bg); color: var(--good); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { color: var(--side-strong); padding: 0 8px 20px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: var(--side-text); cursor: pointer;
}
a.nav-btn { text-decoration: none; font: inherit; box-sizing: border-box; }
.nav-btn svg { width: 18px; height: 18px; flex: none; }
.nav-btn:hover { background: var(--side-active); color: var(--side-strong); }
.nav-btn.active { background: var(--side-active); color: var(--side-strong); box-shadow: inset 3px 0 0 var(--accent); }
.side .spacer { flex: 1; }

.main { padding: 24px 28px 48px; min-width: 0; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.topbar h2 { margin: 0; font-size: 22px; flex: 1; min-width: 160px; }
.period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.seg button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.period input[type=date] { width: 140px; height: 36px; }
.period .dash { color: var(--muted); }

.notice { padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; background: var(--warn-bg); color: var(--warn); }
.notice a { color: inherit; font-weight: 600; }

/* ---------- карточки ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.tile .label { font-size: 12px; color: var(--text-2); }
.tile .value { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.tile .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; flex: 1; }
.card-head .hint { font-size: 12px; color: var(--muted); }
.chart-box { position: relative; height: 260px; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { font-size: 12px; font-weight: 500; color: var(--text-2); position: sticky; top: 0; background: var(--surface); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th .arrow { color: var(--accent); }
td.r, th.r { text-align: right; }
td.name { white-space: normal; min-width: 220px; max-width: 420px; }
td.name .sub { color: var(--muted); font-size: 12px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
.neg { color: var(--bad); }
.pos { color: var(--good); }
.more { margin-top: 10px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.none { background: var(--surface-2); color: var(--muted); }

.funnel { display: grid; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 110px; align-items: center; gap: 12px; font-size: 13px; }
.funnel-row .bar { height: 22px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.funnel-row .bar i { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.funnel-row .v { text-align: right; font-weight: 600; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=search] { width: 240px; height: 34px; }

.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { padding: 16px; border-radius: 12px; background: var(--bad-bg); color: var(--bad); }

.settings { max-width: 560px; }
.settings .card p { color: var(--text-2); margin: 0 0 14px; font-size: 13px; }
.settings a { color: var(--accent); }

/* ---------- мобильные ---------- */
@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { flex-direction: row; overflow-x: auto; padding: 10px 12px; gap: 4px; position: sticky; top: 0; z-index: 5; }
  .side .brand, .side .spacer { display: none; }
  .nav-btn { width: auto; white-space: nowrap; padding: 8px 10px; }
  .nav-btn.active { box-shadow: inset 0 -2px 0 var(--accent); }
  .main { padding: 16px 16px 40px; }
  .tile .value { font-size: 20px; }
  .toolbar input[type=search] { width: 100%; }
  .funnel-row { grid-template-columns: 110px 1fr 80px; }
  .period input[type=date] { width: 128px; }
}

/* ---------- выбор оформления ---------- */
.schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 16px; }
.scheme-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px 10px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; font-size: 13px;
}
.scheme-btn:hover { border-color: var(--muted); }
.scheme-btn[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); font-weight: 600; }
.schemes-title { font-size: 12px; color: var(--text-2); font-weight: 500; margin: 0 0 8px; }
.swatch { width: 56px; height: 36px; border-radius: 8px; overflow: hidden; display: grid; grid-template-columns: 1fr 1.6fr; border: 1px solid var(--border); }
.swatch i:first-child { background: var(--sw-side); }
.swatch i:last-child { background: var(--sw-bg); display: grid; place-items: center; }
.swatch i:last-child::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--sw-accent); }
.settings .mode-label { font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }

/* ---------- отчёт ---------- */
.report-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.report-head .meta { flex: 1; min-width: 220px; color: var(--text-2); font-size: 13px; }
.report-head .meta b { color: var(--text); font-size: 15px; display: block; margin-bottom: 2px; }
.report-head select { height: 32px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); padding: 0 8px; }
a.btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
a.btn svg { width: 16px; height: 16px; }
.tile .sub .up { color: var(--good); font-weight: 600; }
.tile .sub .down { color: var(--bad); font-weight: 600; }
.concl { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.concl li { line-height: 1.55; }
.concl li b { font-weight: 650; }
.concl li::marker { color: var(--accent); font-weight: 700; }
.recs { display: grid; gap: 10px; }
.rec { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.rec .top { display: flex; gap: 10px; align-items: flex-start; }
.rec .top .act { flex: 1; font-weight: 600; }
.rec .why { color: var(--text-2); font-size: 13px; margin-top: 6px; }
.rec .where { color: var(--muted); font-size: 12px; margin-top: 4px; }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1.7fr) 1.3fr 48px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .l { line-height: 1.3; }
.hbar .l small { display: block; color: var(--muted); font-size: 11px; }
.tiles.kpi { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tiles.kpi .value { font-size: 22px; white-space: nowrap; }
.hbar .bar { height: 18px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar .bar i { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .v { text-align: right; font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; color: var(--text-2); }
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.abc { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.abc.A { background: var(--good-bg); color: var(--good); }
.abc.B { background: var(--warn-bg); color: var(--warn); }
.abc.C { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 760px) {
  .tiles.kpi { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tiles.kpi .tile { padding: 10px 12px; }
  .tiles.kpi .value { font-size: 16px; white-space: normal; }
  .tiles.kpi .label, .tiles.kpi .sub { font-size: 11px; }
  .hbar { grid-template-columns: minmax(0, 1fr) 1fr 56px; }
}
.seg button:disabled { opacity: .45; cursor: default; }
.hbars.wide .hbar { grid-template-columns: minmax(0, 1.6fr) 1.2fr 92px; }
.hbars.wide .hbar .v { white-space: nowrap; }

/* ---------- главная ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tools-grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.tool-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); color: inherit; text-decoration: none; min-width: 0; }
.tool-card.link { transition: border-color .15s, transform .15s; }
.tool-card.link:hover { border-color: var(--accent); }
.tool-card.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-card h3 { margin: 0; font-size: 15px; }
.tool-card .sub { font-size: 12px; color: var(--muted); }
.tool-card.small .badge { align-self: flex-start; }
.tool-top { display: flex; align-items: center; gap: 12px; }
.tool-top > div { flex: 1; min-width: 0; }
.mp-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex: none; }
.mp-mark.ozon { background: #005bff; }
.mp-mark.wb { background: linear-gradient(135deg, #cb11ab, #481173); }
.tool-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tool-kpis .label { font-size: 11px; color: var(--text-2); line-height: 1.3; }
.tool-kpis .value { font-size: 17px; font-weight: 700; margin-top: 2px; white-space: nowrap; }
.tool-desc { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.tool-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); margin-top: auto; }
.tool-foot .go { color: var(--accent); font-weight: 600; }
.section-title { font-size: 15px; font-weight: 650; margin: 4px 0 10px; display: flex; gap: 10px; align-items: baseline; }
.section-title .hint, a.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
a.hint { color: var(--accent); text-decoration: none; }
.conn-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.conn-row:last-of-type { border-bottom: 0; }
.cmd { display: grid; gap: 4px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.cmd code { display: block; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; overflow-x: auto; white-space: nowrap; color: var(--text); }
@media (max-width: 760px) {
  .tools-grid.two { grid-template-columns: 1fr; }
  .tool-kpis .value { font-size: 15px; }
}

/* ---------- витрина до входа ---------- */
.login { grid-template-columns: minmax(0, 640px) 360px; gap: 40px; align-content: center; justify-content: center; }
.showcase { color: var(--side-text); }
.showcase .brand { color: var(--side-strong); margin-bottom: 28px; }
.showcase h1 { color: var(--side-strong); font-size: 28px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.01em; }
.showcase .lead { margin: 0 0 24px; font-size: 15px; line-height: 1.5; max-width: 520px; }
.showcase-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.show-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; text-decoration: none;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); color: var(--side-text); transition: border-color .15s, background .15s; }
.show-card:hover, .show-card:focus-visible { background: rgba(255,255,255,.10); border-color: var(--accent); outline: none; }
.show-card b { display: block; color: var(--side-strong); font-size: 14px; margin-bottom: 3px; }
.show-card span:not(.mp-mark):not(.ic) { font-size: 12px; line-height: 1.45; }
.show-card .mp-mark { width: 32px; height: 32px; font-size: 12px; }
.show-card .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.12); color: var(--side-strong); font-size: 15px; }
.login-card { align-self: center; }
@media (min-width: 1021px) { .login-card .brand { display: none; } .login-card h1 { margin-top: 0; } }
@media (max-width: 1020px) {
  .login { grid-template-columns: minmax(0, 480px); gap: 24px; padding: 24px 16px; }
  .login-card { order: -1; justify-self: stretch; max-width: none; }
  .showcase .brand { display: none; }
  .showcase h1 { font-size: 22px; }
}
@media (max-width: 520px) { .showcase-grid { grid-template-columns: 1fr; } }
