/* Центр управления — дизайн-система.
   Тема задаётся атрибутом data-theme на <html> (скрипт в index.html выбирает её до первой отрисовки).
   Всё движение отключается при prefers-reduced-motion. */

:root {
  color-scheme: dark;
  --bg: #06070b;
  --bg-2: #0b0d14;
  --surface: rgba(255, 255, 255, .032);
  --surface-2: rgba(255, 255, 255, .055);
  --surface-3: rgba(255, 255, 255, .085);
  --solid: #0f1219;
  --solid-2: #151924;
  --glass: rgba(12, 14, 21, .72);
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --line-3: rgba(255, 255, 255, .2);
  --text: #eef0f8;
  --text-2: #b4bacb;
  --muted: #7c8499;
  --faint: #4e566b;
  --accent: #8d8bff;
  --accent-2: #c084fc;
  --accent-ink: #0b0a1f;
  --accent-soft: rgba(141, 139, 255, .14);
  --grad: linear-gradient(135deg, #7b86ff 0%, #a78bfa 48%, #f0abfc 100%);
  --grad-warm: linear-gradient(135deg, #fbbf24, #f97316);
  --grad-hot: linear-gradient(135deg, #fb7185, #e11d48);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .13);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .13);
  --err: #fb7185; --err-soft: rgba(251, 113, 133, .13);
  --info: #60a5fa; --info-soft: rgba(96, 165, 250, .13);
  --claude: #e0875f;
  --claude-soft: rgba(224, 135, 95, .14);
  --term-bg: #07080c;
  --r-xl: 24px; --r-lg: 20px; --r: 16px; --r-sm: 12px; --r-xs: 9px;
  --sh-1: 0 1px 0 rgba(255, 255, 255, .035) inset;
  --sh-2: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 12px 32px -14px rgba(0, 0, 0, .75);
  --sh-3: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 40px 90px -24px rgba(0, 0, 0, .85), 0 8px 24px rgba(0, 0, 0, .35);
  --glow: 0 0 0 1px rgba(141, 139, 255, .35), 0 8px 30px -6px rgba(141, 139, 255, .45);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.5, .64, 1);
  --sidebar: 252px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, 'JetBrains Mono', Menlo, Consolas, monospace;
  --mesh-1: rgba(99, 102, 241, .16);
  --mesh-2: rgba(192, 132, 252, .11);
  --mesh-3: rgba(224, 135, 95, .07);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f9;
  --bg-2: #eaecf4;
  --surface: rgba(255, 255, 255, .72);
  --surface-2: rgba(255, 255, 255, .92);
  --surface-3: #ffffff;
  --solid: #ffffff;
  --solid-2: #f5f6fb;
  --glass: rgba(250, 250, 253, .78);
  --line: rgba(20, 24, 45, .08);
  --line-2: rgba(20, 24, 45, .13);
  --line-3: rgba(20, 24, 45, .22);
  --text: #0e1122;
  --text-2: #3b4259;
  --muted: #697089;
  --faint: #a1a7b9;
  --accent: #5b5bf0;
  --accent-2: #9b5cf6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(91, 91, 240, .1);
  --grad: linear-gradient(135deg, #5b63f6 0%, #8b5cf6 50%, #d946ef 100%);
  --ok: #059669; --ok-soft: rgba(5, 150, 105, .1);
  --warn: #c07a06; --warn-soft: rgba(217, 139, 6, .12);
  --err: #e11d48; --err-soft: rgba(225, 29, 72, .09);
  --info: #2563eb; --info-soft: rgba(37, 99, 235, .09);
  --claude: #c2572b;
  --claude-soft: rgba(194, 87, 43, .1);
  --term-bg: #fbfbfd;
  --sh-1: 0 1px 2px rgba(20, 24, 45, .04);
  --sh-2: 0 1px 2px rgba(20, 24, 45, .05), 0 10px 30px -14px rgba(20, 24, 45, .22);
  --sh-3: 0 30px 80px -20px rgba(20, 24, 45, .35), 0 6px 16px rgba(20, 24, 45, .08);
  --glow: 0 0 0 1px rgba(91, 91, 240, .3), 0 8px 26px -8px rgba(91, 91, 240, .45);
  --mesh-1: rgba(99, 102, 241, .13);
  --mesh-2: rgba(217, 70, 239, .08);
  --mesh-3: rgba(249, 115, 22, .06);
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
  overflow-wrap: break-word; /* длинные ссылки и названия без пробелов не распирают экран телефона */
}
body::before {
  content: ''; position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vmax 34vmax at 12% 8%, var(--mesh-1), transparent 70%),
    radial-gradient(34vmax 30vmax at 88% 14%, var(--mesh-2), transparent 70%),
    radial-gradient(40vmax 30vmax at 70% 96%, var(--mesh-3), transparent 70%);
  animation: drift 38s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3vmax, 2vmax, 0) rotate(3deg) scale(1.05); } }
::selection { background: var(--accent-soft); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
img, svg { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: .86em; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 15px; height: 15px; }
.i.lg { width: 22px; height: 22px; }
.i.xl { width: 28px; height: 28px; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; z-index: 30;
  display: flex; flex-direction: column; gap: 6px; padding: 18px 14px 14px;
  border-right: 1px solid var(--line); background: linear-gradient(180deg, var(--glass), transparent 140%);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 14px; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--grad); box-shadow: var(--glow); color: #fff; }
.brand-mark svg { width: 19px; height: 19px; stroke-width: 2.1; }
.brand-name { font: 700 15px/1.1 var(--display); letter-spacing: -.02em; }
.brand-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-group { font-size: 10.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--faint);
  padding: 14px 12px 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 530; font-size: 14.2px; transition: background .2s var(--ease), color .2s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { color: var(--text); background: var(--surface-3); box-shadow: var(--sh-1); }
.nav a.active::before { content: ''; position: absolute; left: -4px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px;
  background: var(--grad); }
.nav a.active .i { color: var(--accent); }
.nav a .i { opacity: .92; }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.badge:empty { display: none; }
.badge.hot { background: var(--grad); color: #fff; }
.badge.live { background: var(--ok-soft); color: var(--ok); }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.side-limits { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line); }
.side-limits:hover { border-color: var(--line-2); }
.lim-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 12px; }
.lim-row .nm { color: var(--text-2); font-weight: 560; display: flex; align-items: center; gap: 6px; min-width: 0; }
.lim-row .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lim-row .pc { color: var(--muted); font-variant-numeric: tabular-nums; }
.lim-row .meter { grid-column: 1 / -1; }
.side-actions { display: flex; gap: 6px; }
.side-actions button, .side-actions a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); position: relative; font-size: 12.5px; }
.side-actions button:hover { background: var(--surface-2); color: var(--text); }
.side-actions .badge { position: absolute; top: -6px; right: -4px; margin: 0; }
.conn { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); padding: 0 6px; }
.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); transition: .3s; }
.conn.live .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.conn.dead .dot { background: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }

main { min-width: 0; width: 100%; max-width: 1480px; margin: 0 auto; padding: 30px 38px 90px; }
main.wide { max-width: none; padding: 18px 20px 18px; }
.view { animation: viewIn .45s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }

.topbar, .tabbar { display: none; }

/* ---------- заголовки страниц ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head > * { min-width: 0; max-width: 100%; }
.page-head h1 { margin: 0; font: 750 30px/1.1 var(--display); letter-spacing: -.035em; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 7px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.crumb:hover { color: var(--text); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 34px 0 14px; }
.section-head h2 { margin: 0; font: 680 17px/1.2 var(--display); letter-spacing: -.02em; display: flex; align-items: center; gap: 9px; }
.section-head h2 .i { color: var(--muted); }
.link { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; flex: none; transition: color .2s; }
.link:hover { color: var(--accent); }
.link .i { width: 14px; height: 14px; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- сетки ---------- */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.between { justify-content: space-between; }

/* ---------- карточки ---------- */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--sh-1);
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
}
.card.flat { backdrop-filter: none; -webkit-backdrop-filter: none; }
.card.pad-lg { padding: 24px; }
.card.tight { padding: 12px 14px; }
.card.click { cursor: pointer; }
.card.click:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--sh-2); background: var(--surface-2); }
.card.click:active { transform: translateY(0) scale(.99); }
.card h3 { margin: 0; font: 650 15.5px/1.3 var(--display); letter-spacing: -.015em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head h3 .i { color: var(--muted); }
.card .desc { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.card.accent { background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--surface); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.card.warn { background: linear-gradient(160deg, var(--warn-soft), transparent 60%), var(--surface); border-color: color-mix(in srgb, var(--warn) 28%, var(--line)); }
.card.err { background: linear-gradient(160deg, var(--err-soft), transparent 60%), var(--surface); border-color: color-mix(in srgb, var(--err) 28%, var(--line)); }
.card.ok { background: linear-gradient(160deg, var(--ok-soft), transparent 60%), var(--surface); border-color: color-mix(in srgb, var(--ok) 26%, var(--line)); }
.card .stripe { position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }

.stagger > * { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* ---------- статистика ---------- */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 560; display: flex; align-items: center; gap: 7px; }
.stat .label .i { width: 15px; height: 15px; }
.stat .value { font: 750 30px/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: -.01em; margin-left: 3px; }
.stat .hint { font-size: 12.5px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 650; padding: 1px 7px; border-radius: 999px; }
.delta.up { color: var(--ok); background: var(--ok-soft); }
.delta.down { color: var(--err); background: var(--err-soft); }
.delta.flat { color: var(--muted); background: var(--surface-2); }

/* ---------- кольца, полосы, графики ---------- */
.ring-svg { transform: rotate(-90deg); overflow: visible; }
.ring-svg .track { stroke: var(--surface-3); }
:root[data-theme="light"] .ring-svg .track { stroke: rgba(20, 24, 45, .09); }
.ring-svg .val { stroke: url(#grad-ring); transition: stroke-dashoffset 1.2s var(--ease); }
.ring-svg .val.warn { stroke: url(#grad-warm); }
.ring-svg .val.err { stroke: url(#grad-hot); }
.ring-svg .val2 { stroke: var(--info); opacity: .85; transition: stroke-dashoffset 1.2s var(--ease); }
.ring-wrap { position: relative; display: grid; place-items: center; flex: none; }
.ring-wrap .ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-label b { display: block; font: 750 21px/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ring-label span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }

.meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--grad); width: 0;
  transition: width 1s var(--ease); }
.meter.warn > i { background: var(--grad-warm); }
.meter.err > i { background: var(--grad-hot); }
.meter.ok > i { background: linear-gradient(90deg, #10b981, #34d399); }
.meter.info > i { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.meter.thin { height: 4px; }
.meter.thick { height: 9px; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; min-width: 0; }
.bars .b i { display: block; border-radius: 5px 5px 2px 2px; background: var(--surface-3); min-height: 3px;
  transform-origin: bottom; animation: barUp .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
.bars .b.on i { background: var(--grad); }
.bars .b.now i { box-shadow: 0 0 0 2px var(--accent-soft); }
.bars .b:hover i { filter: brightness(1.25); }
.bars .b .c { position: absolute; left: 50%; bottom: calc(100% + 2px); transform: translateX(-50%); width: 6px; height: 6px;
  border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
@keyframes barUp { from { transform: scaleY(0); } }
.axis { display: flex; justify-content: space-between; gap: 3px; margin-top: 8px; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.axis span { flex: 1; text-align: center; min-width: 0; white-space: nowrap; }

.spark { width: 100%; height: 44px; }
.spark path.fill { fill: url(#grad-area); }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- метки ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.8px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; border: 1px solid transparent; }
.pill .i { width: 13px; height: 13px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.claude { background: var(--claude-soft); color: var(--claude); }
.pill.outline { background: transparent; border-color: var(--line-2); color: var(--muted); }
.pill.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.err { background: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }
.dot.accent { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot.live { animation: pulse 1.6s infinite; }
.kbd { font: 600 11px/1 var(--mono); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); background: var(--surface); }

/* ---------- кнопки ---------- */
.btn, button.primary, button.ghost, button.danger, a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 12px; font-weight: 600; font-size: 14px; white-space: nowrap; border: 1px solid transparent;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .25s, filter .2s; user-select: none;
}
.btn:active:not(:disabled), button:active:not(:disabled).primary, button:active:not(:disabled).ghost { transform: scale(.97); }
.btn.primary, button.primary { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.btn.primary:hover, button.primary:hover { filter: brightness(1.08) saturate(1.1); }
.btn.ghost, button.ghost, a.btn.ghost { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-3); border-color: var(--line-2); }
.btn.danger, button.danger { background: var(--err-soft); color: var(--err); border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.btn.quiet, button.quiet { background: transparent; border-color: transparent; color: var(--muted); height: 34px; padding: 0 10px; border-radius: 10px; }
button.quiet:hover { background: var(--surface-2); color: var(--text); }
.btn.sm, button.sm { height: 30px; padding: 0 11px; font-size: 12.8px; border-radius: 10px; gap: 6px; }
.btn.lg, button.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.btn.icon, button.icon { width: 38px; padding: 0; }
.btn.icon.sm, button.icon.sm { width: 30px; }
.btn.block { width: 100%; }

/* ---------- поля ---------- */
input, select, textarea {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 13px; transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface-2); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8499' stroke-width='2.4' 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 12px center; }
select option, select optgroup { background: var(--solid); color: var(--text); }
textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=range] { padding: 0; border: 0; background: transparent; accent-color: var(--accent); box-shadow: none; }
label.field { display: block; margin-bottom: 14px; }
label.field > span, .field-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.8px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.fields-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; padding: 6px 0; }

.switch { position: relative; width: 42px; height: 25px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: .25s var(--ease); }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .3s var(--spring); }
.switch input:checked + i { background: var(--grad); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(17px); }

/* сегментированный переключатель */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); gap: 2px; flex: none; }
.seg button { border: 0; background: transparent; color: var(--muted); height: 30px; padding: 0 13px; border-radius: 9px; font-size: 13px; font-weight: 600;
  transition: background .2s, color .2s; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: var(--sh-2); }
.seg.sm button { height: 26px; padding: 0 10px; font-size: 12px; }

/* плитки-варианты (выбор «кто выполняет», «когда») */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 11px 12px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: .2s var(--ease); min-width: 0; }
.choice:hover { border-color: var(--line-2); background: var(--surface-2); }
.choice.on { border-color: var(--accent); background: linear-gradient(160deg, var(--accent-soft), transparent 80%), var(--surface-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice .t { font-weight: 650; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.choice .t .i { color: var(--accent); width: 16px; height: 16px; }
.choice .d { font-size: 11.8px; color: var(--muted); line-height: 1.35; }

/* фильтры-вкладки */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 600; transition: .2s; display: inline-flex; align-items: center; gap: 6px; }
.tabs button:hover { color: var(--text); border-color: var(--line-2); }
.tabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs button .n { font-size: 11.5px; opacity: .7; }
.scroll-x { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x .tabs { flex-wrap: nowrap; }

/* ---------- списки ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.item:last-child { border-bottom: 0; }
.item.click { cursor: pointer; border-radius: 12px; padding-left: 10px; padding-right: 10px; margin: 0 -6px; border-bottom-color: transparent;
  transition: background .2s; }
.item.click:hover { background: var(--surface-2); }
.item .title { font-weight: 560; font-size: 14.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.item .sub.wrap, .item .title.wrap { white-space: normal; }
.item .end { display: flex; align-items: center; gap: 6px; flex: none; color: var(--muted); font-size: 12.5px; }
.ico-box { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface-2);
  color: var(--text-2); border: 1px solid var(--line); }
.ico-box.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.ico-box.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.ico-box.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.ico-box.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.ico-box.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.ico-box.claude { background: var(--claude-soft); color: var(--claude); border-color: transparent; }
.ico-box.sm { width: 30px; height: 30px; border-radius: 9px; }
.ico-box.lg { width: 44px; height: 44px; border-radius: 14px; }
.emoji { font-size: 17px; line-height: 1; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; font-weight: 650; }
td { padding: 11px 10px; border-top: 1px solid var(--line); }

.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .ico-box { margin: 0 auto 14px; width: 54px; height: 54px; border-radius: 18px; }
.empty .ico-box .i { width: 24px; height: 24px; }
.empty h3 { color: var(--text); margin: 0 0 6px; font: 650 17px/1.3 var(--display); }
.empty p { margin: 0 auto 16px; max-width: 420px; font-size: 14px; }

.skeleton { border-radius: var(--r-lg); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-3) 50%, var(--surface) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -150% 0; } }
.loading-view { display: grid; gap: 14px; }
.loading-view .skeleton:nth-child(1) { height: 64px; width: 42%; }
.loading-view .skeleton:nth-child(2) { height: 150px; }
.loading-view .skeleton:nth-child(3) { height: 240px; }

.spinner { width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .75s linear infinite; flex: none; }
.spinner.claude { border-top-color: var(--claude); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- окна и шторки ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; }
.sheet-bg { position: absolute; inset: 0; background: rgba(3, 4, 8, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .25s var(--ease) both; }
:root[data-theme="light"] .sheet-bg { background: rgba(20, 24, 45, .28); }
.sheet { position: relative; width: min(600px, 100%); max-height: min(88dvh, 900px); display: flex; flex-direction: column;
  background: var(--solid); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--sh-3);
  animation: pop .35s var(--spring) both; overflow: hidden; }
.sheet.wide { width: min(820px, 100%); }
.sheet-grip { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.sheet-head h2 { margin: 0; font: 700 19px/1.25 var(--display); letter-spacing: -.025em; }
.sheet-body { padding: 10px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px calc(16px + var(--safe-b)); border-top: 1px solid var(--line);
  background: var(--solid); flex-wrap: wrap; }
.sheet-foot .spacer { flex: 1; }
.sheet-root.closing .sheet { animation: popOut .2s var(--ease) both; }
.sheet-root.closing .sheet-bg { animation: fade .2s var(--ease) reverse both; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes popOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* всплывающее меню */
.menu { position: fixed; z-index: 90; min-width: 220px; max-width: min(320px, calc(100vw - 20px)); padding: 6px; border-radius: 16px;
  max-height: calc(100dvh - 20px); overflow-y: auto; overscroll-behavior: contain;  /* длинный список проектов — прокручивается */
  background: var(--solid); border: 1px solid var(--line-2); box-shadow: var(--sh-3); animation: pop .22s var(--spring) both; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; background: transparent;
  border-radius: 10px; text-align: left; font-size: 14px; color: var(--text); }
.menu button:hover, .menu button.on { background: var(--surface-3); }
.menu button .i { color: var(--muted); }
.menu button small { display: block; color: var(--muted); font-size: 12px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu .menu-title { font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 8px 11px 4px; }

/* уведомления-тосты */
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 100; pointer-events: none; }
.toast { pointer-events: auto; position: relative; display: flex; gap: 11px; align-items: flex-start; min-width: 280px; max-width: 380px;
  background: var(--solid); border: 1px solid var(--line-2); border-radius: 16px; padding: 12px 14px 14px; box-shadow: var(--sh-3);
  animation: toastIn .45s var(--spring) both; overflow: hidden; }
.toast .ico-box { width: 30px; height: 30px; border-radius: 10px; }
.toast b { display: block; font-size: 14px; font-weight: 650; }
.toast span { display: block; font-size: 12.8px; color: var(--muted); margin-top: 2px; }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--grad); animation: toastBar 6s linear both; }
.toast.out { animation: toastOut .3s var(--ease) both; }
.toast a { color: var(--accent); font-weight: 600; font-size: 12.8px; margin-top: 4px; display: inline-block; }
@keyframes toastIn { from { opacity: 0; transform: translateY(18px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes toastBar { from { width: 100%; } to { width: 0; } }

/* лента уведомлений — боковая панель */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 75; display: flex; flex-direction: column;
  background: var(--solid); border-left: 1px solid var(--line-2); box-shadow: var(--sh-3); animation: slideIn .35s var(--ease) both; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: calc(16px + var(--safe-t)) 18px 12px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font: 700 18px/1.2 var(--display); }
.drawer-body { overflow-y: auto; padding: 8px 14px calc(20px + var(--safe-b)); flex: 1; }
.drawer-day { font-size: 11.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 14px 6px 6px; }
.notif { display: flex; gap: 11px; padding: 11px 8px; border-radius: 12px; }
.notif.click { cursor: pointer; }
.notif.click:hover { background: var(--surface-2); }
.notif .t { font-weight: 600; font-size: 13.8px; }
.notif .s { font-size: 12.8px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notif .w { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.notif.unread .t::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 7px; vertical-align: middle; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }

/* палитра команд */
.pal-root { position: fixed; inset: 0; z-index: 95; display: flex; justify-content: center; padding: 11vh 16px 16px; }
.pal-root .sheet-bg { position: fixed; }
.pal { position: relative; width: min(640px, 100%); height: fit-content; max-height: 72dvh; display: flex; flex-direction: column;
  background: var(--solid); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--sh-3); overflow: hidden; animation: pop .3s var(--spring) both; }
.pal-top { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.pal-top .i { color: var(--muted); }
.pal-input { border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 18px 0; font-size: 17px; }
.pal-list { overflow-y: auto; padding: 6px; }
.pal-group { font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 10px 12px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; cursor: pointer; }
.pal-item .ico-box { width: 32px; height: 32px; border-radius: 10px; }
.pal-item.on { background: var(--surface-3); }
.pal-item .title { font-weight: 560; font-size: 14.2px; }
.pal-item .sub { font-size: 12.3px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------- вход ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); text-align: center; padding: 34px 28px; border-radius: 26px; background: var(--glass);
  border: 1px solid var(--line-2); box-shadow: var(--sh-3); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); animation: pop .5s var(--spring) both; }
.login-card .brand-mark { width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 18px; }
.login-card .brand-mark svg { width: 30px; height: 30px; }
.login-card h1 { margin: 0 0 6px; font: 750 24px/1.2 var(--display); letter-spacing: -.03em; }
.login-card input { margin: 22px 0 12px; text-align: center; height: 48px; font-size: 16px; }
.login-card button { width: 100%; height: 48px; }
.login-error { color: var(--err); font-size: 13px; margin-top: 12px; min-height: 18px; }
.login-card.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- главная ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.hero h1 { margin: 0; font: 780 36px/1.05 var(--display); letter-spacing: -.045em; }
.hero .sub { color: var(--muted); margin-top: 8px; font-size: 14.5px; }
.hero .lead { color: var(--text-2); margin-top: 10px; font-size: 15px; max-width: 720px; line-height: 1.55; }
.hero .lead b { color: var(--text); font-weight: 650; }

.ask { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 18px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--sh-2); transition: border-color .2s, box-shadow .25s; margin-bottom: 18px; }
.ask:focus-within { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft), var(--sh-2); }
.ask .i.lead-i { color: var(--accent); }
.ask input { border: 0; background: transparent; box-shadow: none !important; padding: 12px 4px; font-size: 16px; }
.ask input:focus { background: transparent; }
.ask select { width: auto; max-width: 180px; height: 40px; padding-top: 0; padding-bottom: 0; background-color: var(--surface); border-radius: 12px; font-size: 13.5px; }
.ask .btn { height: 42px; }

.subs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 14px; }
.sub-card { display: flex; gap: 20px; align-items: center; }
.sub-card .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sub-card .name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sub-card .name h3 { font-size: 17px; }
.sub-card .kv { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.sub-card .kv b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

.suggest { display: flex; gap: 12px; align-items: flex-start; }
.suggest .grow .t { font-weight: 620; font-size: 14.2px; line-height: 1.35; }
.suggest .grow .d { font-size: 12.8px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.suggest .btn { flex: none; }

.timeline { position: relative; }
.tl-item { position: relative; display: flex; gap: 14px; padding: 0 0 16px 0; }
.tl-item::before { content: ''; position: absolute; left: 17px; top: 38px; bottom: 0; width: 2px; background: var(--line); border-radius: 2px; }
.tl-item:last-child::before { display: none; }
.tl-item .tl-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- планировщик ---------- */
.plan-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 10px; margin-bottom: 18px; }
.plan-sub { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.plan-sub .grow b { font-size: 13.8px; }
.plan-sub .grow div { font-size: 12.3px; color: var(--muted); }
.clock { font: 700 15px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.horizon { position: relative; height: 92px; margin: 4px 0 6px; }
.horizon .axis-line { position: absolute; left: 0; right: 0; top: 52px; height: 2px; background: var(--line-2); border-radius: 2px; }
.horizon .tick { position: absolute; top: 60px; font-size: 10.5px; color: var(--faint); transform: translateX(-50%); font-variant-numeric: tabular-nums; white-space: nowrap; }
.horizon .tick::before { content: ''; position: absolute; left: 50%; top: -9px; width: 1px; height: 6px; background: var(--line-2); }
.horizon .now { position: absolute; top: 20px; bottom: 16px; width: 2px; background: var(--accent); border-radius: 2px; box-shadow: 0 0 12px var(--accent); }
.horizon .now::after { content: 'сейчас'; position: absolute; bottom: -18px; left: 0; font-size: 10.5px; font-weight: 650; color: var(--accent); }
.horizon .reset { position: absolute; top: 34px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.horizon .reset i { width: 10px; height: 10px; border-radius: 3px; transform: rotate(45deg); background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.horizon .reset span { position: absolute; top: calc(-20px - var(--lift, 0px)); white-space: nowrap; font-size: 10.5px; color: var(--ok); font-weight: 650; }
.horizon .job { position: absolute; top: 45px; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--grad);
  border: 3px solid var(--solid); box-shadow: 0 0 0 1px var(--accent); cursor: pointer; transition: transform .2s var(--spring); }
.horizon .job:hover { transform: translateX(-50%) scale(1.35); }
.horizon .job.recurring { background: var(--info); box-shadow: 0 0 0 1px var(--info); }

.task-card { display: flex; gap: 14px; align-items: flex-start; }
.task-card .grow .t { font-weight: 620; font-size: 14.8px; line-height: 1.35; overflow-wrap: anywhere; }
.task-card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.task-card .when { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.task-card .acts { display: flex; gap: 4px; flex: none; }
.card.waiting { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card.running { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.card.running::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), transparent 70%, var(--ok) 85%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: orbit 2.6s linear infinite; }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes orbit { to { --ang: 360deg; } }
.preview-line { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft);
  color: var(--text); font-size: 13.5px; margin: 4px 0 2px; }
.preview-line .i { color: var(--accent); }
.preview-line.bad { background: var(--err-soft); }

/* ---------- отчёты ---------- */
.period { display: flex; align-items: center; gap: 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.kpi { padding: 16px 18px; }
.kpi .value { font-size: 28px; }
.proj-work summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.proj-work summary::-webkit-details-marker { display: none; }
.proj-work .chev { transition: transform .25s var(--ease); color: var(--muted); }
.proj-work[open] .chev { transform: rotate(90deg); }
.proj-work .body { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.work-col h4 { margin: 0 0 6px; font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.commit { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; font-size: 13.4px; }
.commit .h { font-family: var(--mono); font-size: 11.5px; color: var(--accent); flex: none; }
.commit .s { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.commit .st { font-family: var(--mono); font-size: 11px; color: var(--muted); flex: none; }
.commit .st .add { color: var(--ok); } .commit .st .del { color: var(--err); }
.share-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.share-bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.status-tile { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.status-tile b { font-size: 14px; display: block; }
.status-tile span { font-size: 12.3px; color: var(--muted); }

/* ---------- проекты ---------- */
.proj-card { display: flex; flex-direction: column; gap: 10px; min-height: 172px; overflow: hidden; }
.proj-card .top { display: flex; align-items: flex-start; gap: 12px; }
.proj-card .summary { color: var(--muted); font-size: 13.2px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proj-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.3px; color: var(--muted); }
.kind-hackathon { --k: #f59e0b; } .kind-game { --k: #ec4899; } .kind-roblox { --k: #22d3ee; } .kind-product { --k: #8b5cf6; } .kind-research { --k: #10b981; }
.proj-card .kind-dot { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--k, var(--accent)) 16%, transparent); color: var(--k, var(--accent)); }
.task-check { display: flex; align-items: flex-start; gap: 11px; padding: 9px 6px; border-radius: 10px; cursor: pointer; }
.task-check:hover { background: var(--surface-2); }
.task-check .box { width: 20px; height: 20px; border-radius: 7px; border: 2px solid var(--line-3); flex: none; display: grid; place-items: center; margin-top: 1px; transition: .2s var(--spring); }
.task-check.done .box { background: var(--grad); border-color: transparent; color: #fff; }
.task-check.done .box .i { width: 12px; height: 12px; stroke-width: 3; }
.task-check.done .tt { color: var(--muted); text-decoration: line-through; }
.task-check .tt { font-size: 14px; line-height: 1.4; }

/* ---------- игры ---------- */
.game-card .cover { height: 90px; margin: -18px -20px 14px; border-radius: var(--r-lg) var(--r-lg) 0 0; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--k, var(--accent)) 55%, transparent), transparent 60%),
              radial-gradient(120% 140% at 100% 100%, color-mix(in srgb, var(--accent-2) 40%, transparent), transparent 60%), var(--surface-2); }
.game-card .cover .glyph { position: absolute; right: 14px; bottom: -12px; font-size: 76px; opacity: .22; line-height: 1; font-weight: 800; }
.game-card .cover .pill { position: absolute; left: 14px; top: 12px; backdrop-filter: blur(8px); }

/* ---------- консоль ---------- */
.console { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; height: calc(100dvh - 36px); }
.chat-list { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; }
.chat-list-top { padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 10px; }
.chat-list-top .row { flex-wrap: nowrap; }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search input { padding-left: 36px; height: 38px; font-size: 13.8px; border-radius: 12px; }
.chat-filters { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chat-filters::-webkit-scrollbar { display: none; }
.chat-filters .chip { flex: none; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.chat-filters .chip:hover { color: var(--text); }
.chat-filters .chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chat-items { flex: 1; overflow-y: auto; padding: 4px 8px 12px; overscroll-behavior: contain; }
.chat-group { margin-top: 6px; }
.chat-group-title { display: flex; align-items: center; gap: 7px; width: 100%; background: none; border: 0; padding: 8px 8px 5px;
  color: var(--faint); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; }
.chat-group-title:hover { color: var(--text-2); }
.chat-group-title .i { width: 12px; height: 12px; transition: transform .2s var(--ease); }
.chat-group.off .chat-group-title .i { transform: rotate(-90deg); }
.chat-group-title .nm { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-group.off .chat-group-body { display: none; }
.chat-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 12px; margin-bottom: 1px; transition: background .15s; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.on { background: var(--surface-3); box-shadow: var(--sh-1); }
.chat-item .title { font-size: 13.6px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .sub { font-size: 11.8px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; }
.chat-item .av { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--faint); }
.chat-item .av.run { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: pulse 1.6s infinite; }
.chat-item .av.cc { background: var(--claude); }
.chat-item .av.err { background: var(--err); }
.chat-item .av.new { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); min-height: 60px; }
.chat-head .back { display: none; }
.chat-head .ttl { flex: 1; min-width: 0; }
.chat-title { background: transparent; border: 0; padding: 2px 0; font: 650 15.5px/1.3 var(--display); letter-spacing: -.015em; width: 100%; border-radius: 6px; }
.chat-title:hover { background: transparent; border: 0; }
.chat-title:focus { box-shadow: none; background: var(--surface-2); padding: 2px 6px; }
.chat-where { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.chat-head .tools { display: flex; align-items: center; gap: 6px; flex: none; }
.chat-note { font-size: 12.8px; color: var(--text-2); background: var(--claude-soft); border-bottom: 1px solid var(--line); padding: 9px 16px; }

.chat-feed { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.chat-feed.cc { background: var(--term-bg); padding: 16px 18px 24px; font-family: var(--mono); font-size: 12.8px; line-height: 1.6; }
:root[data-theme="light"] .chat-feed.cc { background: #fbfbfd; }
.chat-empty { margin: 8vh auto 0; text-align: center; max-width: 440px; padding: 20px; font-family: var(--font); }
.chat-empty .ico-box { margin: 0 auto 16px; width: 56px; height: 56px; border-radius: 18px; }
.chat-empty h2 { font: 700 20px/1.3 var(--display); margin: 0 0 8px; letter-spacing: -.02em; }
.chat-empty p { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.starters { display: grid; gap: 8px; margin-top: 18px; text-align: left; }
.starters button { text-align: left; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; color: var(--text-2); display: flex; gap: 10px; align-items: center; transition: .2s; }
.starters button:hover { border-color: var(--line-2); color: var(--text); background: var(--surface-2); }

.cc-row { padding: 1px 0 8px; animation: fadeUp .3s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } }
.cc-line { display: flex; align-items: flex-start; gap: 9px; }
.cc-mark { flex: none; width: 12px; text-align: center; color: var(--faint); }
.cc-mark.dot { color: var(--claude); font-size: .9em; }
.cc-text { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cc-user { color: var(--text-2); }
.cc-user .cc-text { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 7px 11px; font-family: var(--font); font-size: 13.8px; color: var(--text); }
.cc-user .cc-mark { color: var(--accent); padding-top: 7px; }
.cc-assistant .cc-text { color: var(--text); font-family: var(--font); font-size: 14.2px; line-height: 1.6; }
.cc-assistant .cc-text b { font-weight: 650; }
.cc-assistant .cc-text pre { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin: 8px 0; overflow-x: auto; white-space: pre-wrap; }
.cc-assistant .cc-text code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.cc-assistant .code { position: relative; }
.cc-assistant .code .copy { position: absolute; top: 14px; right: 6px; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--solid); color: var(--muted); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.cc-assistant .code:hover .copy { opacity: 1; }
@media (hover: none) { .cc-assistant .code .copy { opacity: .8; } }
.md-table { overflow-x: auto; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; }
.md-table table { font-size: 13px; white-space: normal; }
.md-table th { text-transform: none; letter-spacing: 0; font-size: 12.5px; background: var(--surface-2); color: var(--text-2); }
.md-table td, .md-table th { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.cc-tool .cc-text b { font-weight: 650; color: var(--text); }
.cc-args { color: var(--muted); }
.cc-think { color: var(--muted); }
.cc-think .cc-out { margin-left: 21px; opacity: .85; }
.cc-cost { color: var(--faint); }
.cc-sys { color: var(--muted); font-family: var(--font); font-size: 12.8px; }
.cc-sys .cc-text { background: var(--surface); border: 1px dashed var(--line-2); border-radius: 10px; padding: 5px 10px; }
.cc-sys.bad, .cc-sys.bad .cc-mark { color: var(--err); }
.cc-sys.bad .cc-text { border-color: color-mix(in srgb, var(--err) 35%, transparent); background: var(--err-soft); }
.cc-res { display: flex; align-items: flex-start; gap: 8px; margin: 3px 0 0 21px; color: var(--muted); }
.cc-res.bad { color: var(--err); }
.cc-elbow { flex: none; color: var(--faint); }
.cc-out { flex: 1; min-width: 0; }
.cc-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.fold > .cc-out, .fold .cc-out { max-height: 5.2em; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
.cc-row.cc-user.fold .cc-text, .cc-row.cc-assistant.fold .cc-text { max-height: 14em; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent); mask-image: linear-gradient(180deg, #000 72%, transparent); }
.cc-more { display: inline-flex; background: none; border: 0; padding: 2px 0 0; margin-left: 21px; color: var(--faint); font: inherit; font-size: 11.5px; }
.cc-more:hover { color: var(--accent); }
.fold > .cc-more::before { content: '▸ '; }
.cc-row:not(.fold) > .cc-more::before, .cc-res:not(.fold) > .cc-more::before { content: '▾ '; }
.cc-res .cc-more { margin-left: 0; }
.cc-earlier { display: block; width: 100%; background: var(--surface); border: 1px dashed var(--line-2); color: var(--muted); border-radius: 12px;
  padding: 8px; margin-bottom: 14px; font: inherit; font-size: 12px; }
.cc-earlier:hover { border-color: var(--claude); color: var(--text); }
.cc.dense .cc-res, .cc.dense .cc-think .cc-out, .cc.dense .cc-think .cc-more, .cc.dense .cc-cost { display: none; }
.cc.dense .cc-row { padding-bottom: 4px; }
.cc.bare .cc-tool, .cc.bare .cc-think, .cc.bare .cc-cost, .cc.bare .cc-sys { display: none; }
.cc.bare .cc-row { padding-bottom: 12px; }

.chat-input { border-top: 1px solid var(--line); padding: 10px 12px 12px; background: var(--surface); }
.composer { display: flex; align-items: flex-end; gap: 8px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 18px;
  padding: 6px 6px 6px 14px; transition: border-color .2s, box-shadow .25s; }
.composer:focus-within { border-color: var(--claude); box-shadow: 0 0 0 4px var(--claude-soft); }
.composer textarea { flex: 1; border: 0; background: transparent !important; box-shadow: none !important; padding: 9px 0; margin: 0; resize: none;
  min-height: 40px; max-height: 220px; font-size: 14.5px; line-height: 1.45; }
.composer .send { width: 40px; height: 40px; border-radius: 13px; padding: 0; background: var(--claude); color: #fff; border: 0; box-shadow: 0 6px 18px -6px var(--claude);
  display: grid; place-items: center; flex: none; }
.composer .send:hover { filter: brightness(1.1); }
.composer .later { width: 40px; height: 40px; border-radius: 13px; padding: 0; }
.chat-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.opt { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: 12.3px; font-weight: 560; max-width: 240px; }
.opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }
.opt .i { width: 14px; height: 14px; }
.opt.on { color: var(--claude); border-color: color-mix(in srgb, var(--claude) 40%, transparent); background: var(--claude-soft); }
.cc-lim { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.cc-lim.warn { color: var(--warn); } .cc-lim.err { color: var(--err); }
.cc-lim + .cc-lim { margin-left: 12px; }
.cc-lim:empty { display: none; }
.cc-lim:empty + .cc-lim { margin-left: auto; }
.chat-working { display: flex; align-items: center; gap: 9px; font-size: 12.8px; color: var(--text-2); padding: 0 4px 8px; }
.chat-working .dots { display: inline-flex; gap: 3px; }
.chat-working .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--claude); animation: bounce 1.2s infinite; }
.chat-working .dots i:nth-child(2) { animation-delay: .15s; } .chat-working .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---------- сайты ---------- */
.site-card .state-ring { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.site-card.up .state-ring { background: var(--ok-soft); color: var(--ok); }
.site-card.down .state-ring { background: var(--err-soft); color: var(--err); }
.site-card.idle .state-ring { background: var(--surface-2); color: var(--muted); }
.containers { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------- настройки ---------- */
.settings-nav { display: flex; gap: 6px; margin-bottom: 18px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .grow .t { font-weight: 600; font-size: 14.2px; }
.set-row .grow .d { font-size: 12.8px; color: var(--muted); margin-top: 2px; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-pick button { border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 8px;
  align-items: center; font-size: 13px; font-weight: 600; color: var(--text-2); transition: .2s; }
.theme-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--text); }
.theme-pick .sw { width: 100%; height: 54px; border-radius: 10px; border: 1px solid var(--line); }
.theme-pick .sw.dark { background: linear-gradient(135deg, #0b0d14 55%, #7b86ff); }
.theme-pick .sw.light { background: linear-gradient(135deg, #f3f4f9 55%, #8b5cf6); }
.theme-pick .sw.auto { background: linear-gradient(110deg, #0b0d14 50%, #f3f4f9 50%); }

/* ---------- планшет: узкая боковая панель ---------- */
@media (max-width: 1180px) and (min-width: 761px) {
  :root { --sidebar: 78px; }
  .sidebar { padding: 16px 10px 12px; align-items: stretch; }
  .brand { justify-content: center; padding: 4px 0 12px; }
  .brand-text, .nav-group, .nav a .lbl, .side-limits, .conn span:not(.dot), .side-actions .lbl { display: none; }
  .nav a { justify-content: center; padding: 11px 0; }
  .nav a .badge { position: absolute; top: 3px; right: 6px; min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
  .nav a.active::before { left: -10px; }
  .side-actions { flex-direction: column; }
  .conn { justify-content: center; }
  main { padding: 26px 26px 80px; }
  .console { grid-template-columns: 260px minmax(0, 1fr); }
  .chat-head .tools .seg { display: none; }   /* вид ленты есть и в меню «…» — шапке диалога не хватает места */
}

/* ---------- телефон ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { display: block; }
  .sidebar { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 40; align-items: center; gap: 10px;
    padding: calc(8px + var(--safe-t)) 12px 8px; min-height: calc(56px + var(--safe-t));
    background: var(--glass); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
    border-bottom: 1px solid var(--line); }
  .topbar .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .topbar .brand-mark svg { width: 17px; height: 17px; }
  .topbar .tb-title { flex: 1; min-width: 0; font: 700 17px/1.2 var(--display); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    opacity: 0; transform: translateY(6px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
  body.scrolled .topbar .tb-title, body.no-hero .topbar .tb-title { opacity: 1; transform: none; }
  .card-head .legend-m { display: none; }
  .horizon-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .horizon-wrap::-webkit-scrollbar { display: none; }
  .horizon-wrap .horizon { min-width: 640px; }
  .topbar .tb-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-2); position: relative; }
  .topbar .tb-btn:active { background: var(--surface-2); }
  .topbar .tb-btn .badge { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
  .topbar .tb-lim { display: flex; gap: 4px; align-items: center; }
  .tb-lim .mini { width: 26px; height: 26px; }

  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 6px 8px calc(6px + var(--safe-b)); background: var(--glass); border-top: 1px solid var(--line);
    backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); transition: transform .3s var(--ease); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 52px; border: 0; background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 600; border-radius: 14px; }
  .tabbar a .i, .tabbar button .i { width: 23px; height: 23px; transition: transform .25s var(--spring); }
  .tabbar a.active { color: var(--text); }
  .tabbar a.active .i { color: var(--accent); transform: translateY(-1px) scale(1.06); }
  .tabbar a:active .i { transform: scale(.88); }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; margin: 0; }
  .tabbar .fab { align-self: center; justify-self: center; width: 54px; height: 54px; border-radius: 18px; background: var(--grad); color: #fff;
    box-shadow: var(--glow); transform: translateY(-10px); }
  .tabbar .fab .i { width: 26px; height: 26px; stroke-width: 2.3; }
  .tabbar .fab:active { transform: translateY(-10px) scale(.92); }
  body.chat-open .tabbar { transform: translateY(110%); }

  main { padding: 18px 14px calc(96px + var(--safe-b)); }
  main.wide { padding: 0; }
  .page-head { margin-bottom: 18px; }
  .page-head h1 { font-size: 26px; }
  .page-head .actions { width: 100%; }
  .page-head .actions > * { flex: 1; }
  .page-head .actions > .seg, .page-head .actions > .tabs { flex: none; }
  .hero h1 { font-size: 30px; }
  .card { padding: 16px; border-radius: 18px; }
  .section-head { margin: 26px 0 12px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .fields-2 { grid-template-columns: minmax(0, 1fr); }
  .stat .value { font-size: 26px; }
  .ask { flex-wrap: wrap; padding: 8px; border-radius: 18px; }
  .ask input { flex: 1 1 100%; padding: 8px 6px; }
  .ask .i.lead-i { display: none; }
  .ask select { flex: 1; max-width: none; min-width: 0; }
  .ask .btn.primary { width: 42px; padding: 0; }
  .ask .btn.primary span { display: none; }
  .sub-card { gap: 14px; }
  /* подписи «Окно 5 ч», «Неделя» — одной строкой, переносится значение справа */
  .sub-card .kv { grid-template-columns: auto auto minmax(0, 1fr); }
  .sub-card .kv > span:not(.dot) { white-space: nowrap; }
  .toasts { left: 12px; right: 12px; bottom: calc(84px + var(--safe-b)); align-items: stretch; }
  .toast { min-width: 0; max-width: none; }
  body.chat-open .toasts { bottom: calc(96px + var(--safe-b)); }

  /* окна становятся шторками снизу */
  .sheet-root { place-items: end stretch; padding: 0; }
  .sheet { width: 100%; max-height: 92dvh; border-radius: 26px 26px 0 0; border-bottom: 0; animation: sheetUp .42s var(--ease) both; }
  .sheet.wide { width: 100%; }
  .sheet-grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-3); margin: 8px auto 0; flex: none; touch-action: none; }
  .sheet-head { padding: 10px 18px 4px; touch-action: none; }
  .sheet-body { padding: 8px 18px calc(18px + var(--safe-b)); }
  .sheet-foot { padding: 12px 16px calc(12px + var(--safe-b)); }
  .sheet-foot .btn, .sheet-foot button { flex: 1; height: 46px; }
  .sheet-root.closing .sheet { animation: sheetDown .25s var(--ease) both; }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  @keyframes sheetDown { to { transform: translateY(100%); } }
  .menu { left: 10px !important; right: 10px !important; top: auto !important; bottom: calc(10px + var(--safe-b)) !important; max-width: none; border-radius: 22px;
    max-height: calc(100dvh - 30px - var(--safe-t) - var(--safe-b)); animation: sheetUp .35s var(--ease) both; }
  .menu button { padding: 13px 14px; font-size: 15px; }
  .pal-root { padding: calc(10px + var(--safe-t)) 10px 10px; }
  .pal { max-height: 80dvh; }
  .pal-foot { display: none; }
  .drawer { width: 100vw; }

  /* консоль: список и диалог — два экрана */
  .console { display: block; height: auto; }
  .console .chat-list { border-radius: 0; border: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .console .chat-items { padding: 0 8px calc(100px + var(--safe-b)); }
  .console .chat-list-top { padding: 14px 14px 6px; }
  .console.show-chat .chat-list { display: none; }
  .console.show-list .chat-main { display: none; }
  .console.show-chat .chat-main { position: fixed; inset: 0; z-index: 50; border-radius: 0; border: 0; background: var(--bg); }
  .chat-head { padding: calc(6px + var(--safe-t)) 8px 6px; min-height: calc(56px + var(--safe-t)); background: var(--glass);
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
  .chat-head .back { display: grid; }
  .chat-head .tools .hide-m { display: none; }
  .chat-feed.cc { padding: 12px 12px 18px; font-size: 12.3px; }
  .cc-assistant .cc-text { font-size: 14.8px; }
  .cc-user .cc-text { font-size: 14.8px; }
  .chat-input { padding: 8px 10px calc(8px + var(--safe-b)); background: var(--glass); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
  .composer textarea { font-size: 16px; }
  .chat-opts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 8px -10px 0; padding: 0 10px; }
  .chat-opts::-webkit-scrollbar { display: none; }
  .opt { flex: none; }
  .sheet .seg { max-width: 100%; }
  .sheet .seg button { flex: 1 1 0; min-width: 0; padding: 0 6px; justify-content: center; }
}
@media (max-width: 420px) {
  .sheet .seg button .i { display: none; }
  .cc-lim { margin-left: 4px; }
}
/* самые узкие телефоны: цифры подписки — под кольцом, а не в тесной колонке рядом */
@media (max-width: 340px) {
  .sub-card { flex-wrap: wrap; }
  .sub-card .info { flex-basis: 100%; }
}

/* потянуть вниз — обновить */
.ptr { position: fixed; top: calc(60px + var(--safe-t)); left: 50%; z-index: 60; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: var(--solid); border: 1px solid var(--line-2); box-shadow: var(--sh-2);
  color: var(--muted); transform: translate(-50%, -120px); opacity: 0; transition: transform .25s var(--ease), color .2s, opacity .2s; pointer-events: none; }
.ptr.pulling, .ptr.spin { opacity: 1; }
.ptr.ready { color: var(--accent); }
.ptr.spin { transform: translate(-50%, 40px) !important; }
.ptr.spin .i { animation: spin .7s linear infinite; }
/* свайп назад: страница чуть сдвигается за пальцем */
@media (max-width: 760px) {
  body[style*="--swipe"] .console.show-chat .chat-main,
  body[style*="--swipe"] main > .view:not(:has(.console)) { transform: translateX(calc(var(--swipe, 0px) * .35)); }
}
/* нет связи */
.offline-bar { position: fixed; left: 50%; top: calc(10px + var(--safe-t)); z-index: 120; transform: translate(-50%, calc(-100% - 20px - var(--safe-t)));
  width: max-content; max-width: calc(100vw - 24px); opacity: 0;
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--solid); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); box-shadow: var(--sh-3);
  transition: transform .35s var(--spring), opacity .2s; pointer-events: none; }
body.offline .offline-bar { transform: translate(-50%, 0); opacity: 1; }

@media (hover: none) {
  .card.click:hover { transform: none; box-shadow: var(--sh-1); background: var(--surface); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  body::before { animation: none; }
}

/* ---------- радары: плитки на главной и точка статуса в меню ---------- */
.radars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; margin: 16px 0; }
.radars:empty { display: none; }
.radar-card { display: flex; flex-direction: column; gap: 14px; }
.radar-card.off { opacity: .85; }
.radar-card .rc-head { display: flex; align-items: center; gap: 12px; color: inherit; }
.radar-card .rc-head h3 { margin: 0; font-size: 15.5px; }
.radar-card .rc-head .muted { font-size: 12.5px; margin-top: 2px; }
.radar-card .rc-head:hover h3 { color: var(--accent); }
.rc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; }
.rc-stats div { display: flex; flex-direction: column; gap: 2px; }
.rc-stats b { font: 700 20px/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rc-stats b.hot { color: var(--accent); }
.rc-stats span { font-size: 12px; color: var(--muted); }
.nav a .rdot { margin-left: auto; }
.nav a .rdot:not(.ok):not(.err) { visibility: hidden; }
