/* NeuroCast — дизайн-система панели, админки и лендинга */

:root {
  --bg: #0a0a12;
  --bg-2: #0f0f1a;
  --panel: #14141f;
  --panel-2: #1a1a28;
  --line: #25253a;
  --line-2: #33334d;
  --text: #ececf4;
  --muted: #9494ae;
  --faint: #6b6b85;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --brand: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #22d3ee 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 14.5px/1.55 "Inter", system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: #b9a4ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 10px; }
code, .mono { font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
code { background: var(--bg-2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 7px; word-break: break-all; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12.5px; }
.hidden { display: none !important; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- логотип ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 17px; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--brand); display: grid; place-items: center;
  box-shadow: 0 6px 18px -6px rgba(139, 92, 246, .7); }
.logo-mark svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.logo b { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- каркас приложения ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; background: var(--bg-2); border-right: 1px solid var(--line);
}
.sidebar .logo { padding: 2px 8px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 12px 10px 4px; color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--muted); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, rgba(139, 92, 246, .22), rgba(34, 211, 238, .06)); color: var(--text); }
.nav a.active svg { stroke: #c4b5fd; }
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.avatar-circle { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.user .name { font-weight: 600; line-height: 1.2; }
.user .sub { color: var(--faint); font-size: 12px; }

.main { min-width: 0; padding: 28px 36px 64px; }
.page { max-width: 1080px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.tab { display: none; animation: fade .2s ease; }
.tab.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* мобильная шапка */
.topbar { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; left: 0; width: 264px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; z-index: 20; }
  .main { padding: 20px 16px 48px; }
}

/* ---------- карточки и сетки ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 16px; }
.grid > .card, .grid > .field, .features > .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.card-title { display: flex; align-items: center; gap: 10px; }
.card-title .icon-box { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(139, 92, 246, .14); color: #c4b5fd; flex: none; }
.card.glow { background: radial-gradient(120% 140% at 0% 0%, rgba(139, 92, 246, .16), transparent 55%), radial-gradient(120% 140% at 100% 100%, rgba(34, 211, 238, .09), transparent 55%), var(--panel); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field, .grid + .field, .field + .grid { margin-top: 14px; }
label, .label { color: #c9c9da; font-size: 13px; font-weight: 550; }
.hint { color: var(--faint); font-size: 12.5px; }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=date], textarea, select {
  width: 100%; padding: 10px 12px; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, .22); }
input:disabled, textarea:disabled { opacity: .5; }
input[type=file] { color: var(--muted); font-size: 13px; max-width: 100%; }
input[type=file]::file-selector-button { margin-right: 10px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--violet); }

/* переключатель */
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; cursor: pointer; }
.switch + .switch { border-top: 1px solid var(--line); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 40px; height: 23px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; transition: background .2s; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + .track { background: var(--violet); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(139, 92, 246, .35); }
.switch .text { display: flex; flex-direction: column; gap: 2px; }
.switch .text b { font-weight: 600; }
.switch .text span { color: var(--faint); font-size: 12.5px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid transparent; background: var(--brand); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: filter .15s, transform .05s, background .15s;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.ghost { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.btn.ghost:hover { background: #22223a; filter: none; }
.btn.danger { background: transparent; border-color: rgba(248, 113, 113, .4); color: var(--danger); }
.btn.danger:hover { background: rgba(248, 113, 113, .1); filter: none; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 15.5px; border-radius: 12px; }
.btn.icon-only { padding: 8px; }
.btn.live { background: linear-gradient(135deg, #ef4444, #f97316); }

/* ---------- статусы ---------- */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 550;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.dot.live { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .2); animation: pulse 1.6s infinite; }
.dot.warn { background: var(--warn); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } }
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: rgba(139, 92, 246, .18); color: #d8ccff; }
.badge.ok { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
.badge.warn { background: rgba(251, 191, 36, .14); color: #fcd34d; }
.badge.danger { background: rgba(248, 113, 113, .14); color: #fca5a5; }

.notice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px;
  background: rgba(52, 211, 153, .08); border: 1px solid rgba(52, 211, 153, .3); }
.notice.warn { background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .35); }
.notice.danger { background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .35); }
.notice .spacer { flex: 1; }

/* ---------- статистика ---------- */
.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.stat .sub { color: var(--faint); font-size: 12.5px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar .fill { width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: var(--brand); min-height: 3px; opacity: .9; }
.bar .num { font-size: 12px; font-weight: 600; }
.bar .day { font-size: 11.5px; color: var(--faint); }

/* ---------- таблицы ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--faint); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 0 12px 10px; }
.table td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: rgba(255, 255, 255, .015); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .table-wrap { overflow-x: auto; } .table { min-width: 680px; } }

/* ---------- чек-лист ---------- */
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.check-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); }
.check-item:hover { border-color: var(--line-2); text-decoration: none; }
.check-item .mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; }
.check-item.done .mark { background: var(--ok); border-color: var(--ok); }
.check-item.done .mark::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #06281c; border-bottom: 2px solid #06281c; transform: rotate(-45deg) translate(1px, -1px); }
.check-item b { display: block; font-weight: 600; font-size: 13.5px; }
.check-item .check-hint, .check-item .faint { color: var(--faint); font-size: 12px; line-height: 1.4; }
.check-item.done .check-hint { display: none; }
.check-item.done { border-color: rgba(52, 211, 153, .25); }
.check-item.done b { color: var(--muted); }
.progress { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }

/* ---------- пульт ---------- */
.mic-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mic-btn { width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer; background: var(--panel-2); color: var(--muted);
  display: grid; place-items: center; box-shadow: 0 0 0 1px var(--line-2) inset; transition: all .2s; flex: none; }
.mic-btn svg { width: 26px; height: 26px; }
.mic-btn.on { background: var(--brand); color: #fff; box-shadow: 0 0 0 6px rgba(139, 92, 246, .18); }
.mic-btn:disabled { opacity: .5; cursor: not-allowed; }
.interim { min-height: 24px; color: var(--muted); font-style: italic; margin-top: 12px; }
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; margin-top: 12px; padding-right: 4px; }
.msg { padding: 10px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); max-width: 88%; }
.msg.me { align-self: flex-end; background: rgba(139, 92, 246, .12); border-color: rgba(139, 92, 246, .35); }
.msg .who { font-size: 11.5px; color: var(--faint); margin-bottom: 2px; }
.msg.me .who { color: #c4b5fd; }
.empty { color: var(--faint); text-align: center; padding: 28px 12px; border: 1px dashed var(--line-2); border-radius: 12px; }

/* ---------- OBS и аватар ---------- */
.source { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.source + .source { margin-top: 10px; }
.source .meta { min-width: 0; flex: 1; }
.source code { display: block; margin-top: 4px; background: transparent; border: 0; padding: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-setup { display: grid; grid-template-columns: 260px 1fr; gap: 22px; }
@media (max-width: 700px) { .avatar-setup { grid-template-columns: 1fr; } }
.avatar-setup iframe { width: 260px; height: 325px; border: 1px solid var(--line); border-radius: 14px; max-width: 100%; }
.checker { background: repeating-conic-gradient(#1c1c2a 0% 25%, #141420 0% 50%) 0 0 / 20px 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- генератор и проверка персонажа ---------- */
.generator { display: flex; gap: 10px; flex-wrap: wrap; }
.generator input { flex: 1; min-width: 220px; }
.idea-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.idea-chips button { padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.idea-chips button:hover { color: var(--text); border-color: var(--violet); }
.persona-card { margin-top: 14px; padding: 16px; border-radius: 12px; border: 1px solid rgba(139, 92, 246, .4); background: rgba(139, 92, 246, .07); }
.persona-card .name { font-size: 20px; font-weight: 700; }
.persona-card .tagline { color: var(--muted); margin-bottom: 10px; }
.persona-card .prompt { white-space: pre-wrap; color: #d6d6e4; font-size: 13.5px; max-height: 220px; overflow-y: auto; }
.chat-preview { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- итоги ---------- */
.summary-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.summary-item + .summary-item { margin-top: 10px; }
.summary-item summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: center; }
.summary-item summary::-webkit-details-marker { display: none; }
.summary-item ul { margin: 4px 0 10px; padding-left: 20px; }
.summary-item h3 { font-size: 15px; margin-bottom: 6px; }

/* ---------- всплывающие уведомления ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { padding: 11px 16px; border-radius: 12px; background: #1f1f30; border: 1px solid var(--line-2); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .7);
  display: flex; align-items: center; gap: 10px; animation: toast-in .25s ease; max-width: 360px; }
.toast.ok { border-color: rgba(52, 211, 153, .45); }
.toast.error { border-color: rgba(248, 113, 113, .5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- лендинг ---------- */
.landing { max-width: 1120px; margin: 0 auto; padding: 22px 24px 80px; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 64px; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.05; letter-spacing: -.035em; }
.hero h1 .grad { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 17px; color: var(--muted); margin: 18px 0 28px; max-width: 520px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.hero-visual { position: relative; border-radius: 22px; padding: 22px; border: 1px solid var(--line); background:
  radial-gradient(80% 80% at 20% 10%, rgba(139, 92, 246, .35), transparent 60%),
  radial-gradient(70% 70% at 90% 90%, rgba(34, 211, 238, .22), transparent 60%), var(--panel); overflow: hidden; }
.bubble { padding: 10px 14px; border-radius: 14px; background: rgba(10, 10, 18, .75); border: 1px solid var(--line-2); max-width: 88%; margin-bottom: 10px; backdrop-filter: blur(6px); }
.bubble.ai { margin-left: auto; border-color: rgba(139, 92, 246, .55); }
.bubble small { display: block; color: var(--faint); font-size: 11.5px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 88px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.feature .icon-box { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(139, 92, 246, .14); color: #c4b5fd; margin-bottom: 14px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; }
.center-card { max-width: 520px; margin: 12vh auto 0; text-align: center; }

/* ---------- память ---------- */
.mem-add { display: grid; grid-template-columns: 1fr 150px 190px auto; gap: 8px; }
@media (max-width: 900px) { .mem-add { grid-template-columns: 1fr 1fr; } .mem-add input[name=text] { grid-column: 1 / -1; } }
.mem-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 12px; }
.mem-toolbar .idea-chips { margin: 0; }
.mem-toolbar input { max-width: 240px; }
.idea-chips button.active { color: var(--text); border-color: var(--violet); background: rgba(139, 92, 246, .16); }
.mem-list { display: flex; flex-direction: column; gap: 6px; }
.fact { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); }
.fact:hover { border-color: var(--line-2); }
.fact.pinned { border-color: rgba(139, 92, 246, .45); background: linear-gradient(90deg, rgba(139, 92, 246, .08), transparent 60%), var(--bg-2); }
.fact-body { flex: 1; min-width: 0; }
.fact-text { line-height: 1.45; overflow-wrap: anywhere; }
.fact-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 5px; color: var(--faint); font-size: 12px; }
.fact-meta .badge { font-weight: 600; }
.fact-actions { display: flex; gap: 4px; flex: none; opacity: .55; transition: opacity .15s; }
.fact:hover .fact-actions, .fact.editing .fact-actions { opacity: 1; }
.icon-btn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.icon-btn.on { color: #c4b5fd; }
.icon-btn.del:hover { color: #fca5a5; }
.icon-btn svg { width: 16px; height: 16px; }
.fact-edit { display: grid; grid-template-columns: 1fr 150px 170px auto auto; gap: 6px; width: 100%; }
@media (max-width: 900px) { .fact-edit { grid-template-columns: 1fr 1fr; } .fact-edit input[name=text] { grid-column: 1 / -1; } }
.kind-streamer { background: rgba(34, 211, 238, .14) !important; color: #67e8f9 !important; }
.kind-joke { background: rgba(251, 191, 36, .14) !important; color: #fcd34d !important; }
.kind-moment { background: rgba(244, 114, 182, .14) !important; color: #f9a8d4 !important; }
.kind-game { background: rgba(52, 211, 153, .14) !important; color: #6ee7b7 !important; }
.kind-rule { background: rgba(139, 92, 246, .22) !important; color: #d8ccff !important; }
.kind-other { background: rgba(255, 255, 255, .07) !important; color: var(--muted) !important; }
.viewer-note { width: 100%; min-height: 0; padding: 7px 10px; font-size: 13.5px; }
.viewer-row.off td { opacity: .55; }
.danger-zone { border-color: rgba(248, 113, 113, .25); }

/* ---------- админка: баланс, расходы, здоровье ---------- */
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(248, 113, 113, .18); }
.stat-danger { border-color: rgba(248, 113, 113, .45); }
.stat-danger .value { color: var(--danger); }
.bad { color: var(--danger) !important; }
.billing { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .billing { grid-template-columns: 1fr; } }
.billing-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.billing-figures > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.billing-figures .label { display: block; color: var(--muted); font-size: 12.5px; }
.billing-figures b { font-size: 22px; letter-spacing: -.02em; }
.billing-form { display: grid; gap: 10px; }
.billing-form .field + .field { margin-top: 0; }
.kinds { display: flex; flex-direction: column; gap: 10px; }
.kind-row { display: grid; grid-template-columns: 170px 1fr 90px; gap: 12px; align-items: center; }
@media (max-width: 620px) { .kind-row { grid-template-columns: 1fr 70px; } .kind-bar { grid-column: 1 / -1; order: 3; } }
.kind-label b { display: block; font-size: 13.5px; font-weight: 600; }
.kind-label span, .kind-cost span { font-size: 12px; }
.kind-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.kind-bar div { height: 100%; background: var(--brand); border-radius: 99px; min-width: 2px; }
.kind-cost { text-align: right; font-weight: 600; }
.kind-cost span { display: block; font-weight: 400; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.errlist { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.err { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.err summary { display: flex; gap: 8px; align-items: center; padding: 8px 12px; cursor: pointer; list-style: none; min-width: 0; }
.err summary::-webkit-details-marker { display: none; }
.err-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; font-size: 13px; }
.err-detail { padding: 0 12px 10px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.err.error { border-color: rgba(248, 113, 113, .25); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: rgba(255, 255, 255, .06); color: var(--faint); }
.chip.ok { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
.chip.bad { background: rgba(248, 113, 113, .14); color: #fca5a5; }
.problem { color: var(--warn); font-size: 12px; margin-top: 4px; }
input[type=date] { color-scheme: dark; }
.grid + .card, .card + .grid { margin-top: 16px; }
.table th { white-space: nowrap; }
