:root {
  --bg: #070b16;
  --bg-2: #0a1020;
  --panel: #0d1424;
  --panel-2: #111a2e;
  --line: rgba(148, 163, 184, .12);
  --line-strong: rgba(148, 163, 184, .22);
  --text: #e7eefb;
  --muted: #8c9ab7;
  --dim: #5f6f8c;
  --accent: #5b8cff;
  --accent-2: #8b5cf6;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --info: #38bdf8;
  --radius: 16px;
  --sidebar: 236px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 8% -12%, rgba(91, 140, 255, .16), transparent 60%),
    radial-gradient(760px 440px at 102% -4%, rgba(139, 92, 246, .12), transparent 55%),
    var(--bg);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: #9db8ff; text-decoration: none; }
a:hover { color: #c3d3ff; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
code, pre, .mono { font-family: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(91, 140, 255, .35); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .2); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.ic { flex: 0 0 auto; vertical-align: -3px; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30;
  display: flex; flex-direction: column;
  padding: 20px 14px 14px;
  background: linear-gradient(180deg, rgba(13, 20, 36, .92), rgba(7, 11, 22, .96));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, #5b8cff, #8b5cf6 70%);
  box-shadow: 0 8px 24px rgba(91, 140, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
  font-weight: 800; font-size: 20px; color: #fff; flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 15px; letter-spacing: .2px; }
.brand-text em { font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: .4px; }
.brand.big { padding: 0 0 30px; }
.brand.big .brand-mark { width: 44px; height: 44px; font-size: 24px; }
.brand.big .brand-text b { font-size: 18px; }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; padding-right: 2px; }
.nav-section { font-size: 10px; letter-spacing: .14em; color: var(--dim); padding: 16px 12px 6px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 11px;
  color: var(--muted); border-radius: 10px; font-size: 13.5px; position: relative;
  border: 1px solid transparent; transition: .16s;
}
.nav-item:hover { color: var(--text); background: rgba(148, 163, 184, .07); }
.nav-item.active {
  color: #fff; background: linear-gradient(90deg, rgba(91, 140, 255, .18), rgba(139, 92, 246, .08));
  border-color: rgba(91, 140, 255, .25);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: linear-gradient(#5b8cff, #8b5cf6);
}
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-left: auto; box-shadow: 0 0 8px var(--ok); }
.sidebar-foot { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; color: var(--text); }
.user-chip span { display: flex; flex-direction: column; min-width: 0; }
.user-chip b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip em { font-style: normal; font-size: 10.5px; color: var(--dim); }
.logout-form { margin: 0; }

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 15px 30px; min-height: 74px;
  background: rgba(7, 11, 22, .72); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-title h1 { font-size: 20px; }
.topbar-title p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }
.pill {
  font-size: 11px; color: var(--muted); border: 1px solid var(--line);
  padding: 4px 9px; border-radius: 999px; background: rgba(148, 163, 184, .05); white-space: nowrap;
}
.pill.demo { color: #c4b5fd; border-color: rgba(139, 92, 246, .35); background: rgba(139, 92, 246, .12); }
.content { padding: 26px 30px 40px; width: 100%; max-width: 1400px; margin: 0 auto; flex: 1; }
.foot { color: var(--dim); font-size: 11px; text-align: center; padding: 10px 20px 26px; }

/* ---------- common ---------- */
.page-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.narrow { max-width: 820px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.dim { color: var(--dim); }
.nowrap { white-space: nowrap; }
.clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-bad { color: var(--bad); }
.text-ok { color: var(--ok); }
.mono { font-size: 12px; }
.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input { height: 30px; width: 130px; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
  min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 0; }
.card-head h3 { font-size: 14.5px; }
.card-head p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.card-body { padding: 18px 20px 20px; }
.card-body > :first-child { margin-top: 0; }
.card-body > :last-child { margin-bottom: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-strong); background: rgba(148, 163, 184, .07);
  color: var(--text); font-size: 13px; font-weight: 550; white-space: nowrap;
  transition: .15s; text-decoration: none;
}
.btn:hover { background: rgba(148, 163, 184, .13); border-color: rgba(148, 163, 184, .35); color: #fff; }
.btn.primary {
  background: linear-gradient(135deg, #5b8cff, #7c66ff 60%, #8b5cf6);
  border-color: transparent; color: #fff; box-shadow: 0 8px 22px rgba(91, 140, 255, .25);
}
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 10px 28px rgba(91, 140, 255, .35); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--text); border-color: var(--line-strong); background: rgba(148, 163, 184, .07); }
.btn.danger { color: #fecdd3; border-color: rgba(251, 113, 133, .35); background: rgba(251, 113, 133, .1); }
.btn.danger:hover { background: rgba(251, 113, 133, .18); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn.lg { height: 46px; font-size: 15px; border-radius: 12px; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; transition: .15s;
}
.icon-btn:hover { background: rgba(148, 163, 184, .1); color: var(--text); }
.icon-btn.danger:hover { color: var(--bad); background: rgba(251, 113, 133, .1); }

/* ---------- hero ---------- */
.hero {
  position: relative; display: flex; gap: 26px; justify-content: space-between; align-items: flex-end;
  padding: 28px 30px; border-radius: 20px; margin-bottom: 20px; overflow: hidden;
  background:
    radial-gradient(600px 260px at 100% 0%, rgba(139, 92, 246, .2), transparent 65%),
    linear-gradient(120deg, rgba(91, 140, 255, .16), rgba(91, 140, 255, .03) 55%, rgba(139, 92, 246, .08));
  border: 1px solid rgba(110, 140, 255, .24);
}
.hero::after {
  content: ""; position: absolute; right: -70px; top: -90px; width: 260px; height: 260px;
  border-radius: 50%; border: 1px solid rgba(148, 163, 184, .16);
  box-shadow: 0 0 0 40px rgba(148, 163, 184, .03), 0 0 0 90px rgba(148, 163, 184, .02);
}
.hero-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: .16em; color: #a5b9ff; margin-bottom: 9px; }
.hero h2 { font-size: 27px; margin-bottom: 8px; }
.hero p { color: #a9b7d2; max-width: 580px; font-size: 13.5px; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; }
.hero-side { position: relative; z-index: 1; text-align: right; min-width: 220px; }
.hero-side span { display: block; font-size: 10.5px; letter-spacing: .12em; color: var(--dim); }
.hero-side code {
  display: block; margin: 5px 0 10px; font-size: 12px; color: #bcd0ff;
  background: rgba(7, 11, 22, .45); border: 1px solid var(--line); padding: 7px 10px; border-radius: 8px;
  max-width: 300px; overflow: hidden; text-overflow: ellipsis;
}
.hero-side-note { font-size: 11px; color: var(--muted); max-width: 260px; margin-left: auto; }

/* ---------- stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  display: flex; gap: 13px; align-items: center; padding: 17px 18px; border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .012));
  border: 1px solid var(--line);
}
.stat-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(91, 140, 255, .13); color: #9db8ff; border: 1px solid rgba(91, 140, 255, .2);
}
.stat.good .stat-icon { background: rgba(52, 211, 153, .1); color: var(--ok); border-color: rgba(52, 211, 153, .2); }
.stat.warn .stat-icon { background: rgba(251, 191, 36, .1); color: var(--warn); border-color: rgba(251, 191, 36, .2); }
.stat.bad .stat-icon { background: rgba(251, 113, 133, .1); color: var(--bad); border-color: rgba(251, 113, 133, .2); }
.stat-meta { display: flex; flex-direction: column; min-width: 0; }
.stat-meta span { font-size: 11.5px; color: var(--muted); }
.stat-meta strong { font-size: 22px; line-height: 1.3; letter-spacing: -.02em; }
.stat-meta em { font-style: normal; font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- chart ---------- */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 210px; padding: 18px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.chart-val { font-size: 10.5px; color: var(--muted); height: 14px; }
.chart-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; border-radius: 7px; background: rgba(148, 163, 184, .05); }
.chart-track i {
  display: block; width: 100%; border-radius: 7px;
  background: linear-gradient(180deg, #7aa2ff, #5b8cff 55%, rgba(139, 92, 246, .8));
  box-shadow: 0 0 18px rgba(91, 140, 255, .18);
  min-height: 3px; transition: .3s;
}
.chart-label { font-size: 10.5px; color: var(--dim); }

/* ---------- checklist ---------- */
.checklist { display: flex; flex-direction: column; gap: 3px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 10px 9px; border-radius: 9px; color: var(--muted); font-size: 12.5px; }
.check-item:hover { background: rgba(148, 163, 184, .06); color: var(--text); }
.check-item .ic:last-child { opacity: .4; margin-left: auto; }
.check-mark {
  width: 19px; height: 19px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: grid; place-items: center; flex: 0 0 auto; color: #0a1020;
}
.check-item.done { color: var(--text); }
.check-item.done .check-mark { background: var(--ok); border-color: var(--ok); }

/* ---------- table ---------- */
.table-wrap { width: 100%; overflow-x: auto; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left; font-weight: 500; color: var(--dim); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(148, 163, 184, .035); }
.table-empty { padding: 30px 10px; text-align: center; color: var(--dim); font-size: 12.5px; }
td .sub { font-size: 10.5px; color: var(--dim); margin-top: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px;
  padding: 2px 8px; font-size: 10.5px; font-weight: 500; white-space: nowrap;
  color: var(--muted); background: rgba(148, 163, 184, .1); border: 1px solid rgba(148, 163, 184, .16);
}
.badge.ok { color: #86efac; background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .24); }
.badge.warn { color: #fde68a; background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .24); }
.badge.bad { color: #fecdd3; background: rgba(251, 113, 133, .1); border-color: rgba(251, 113, 133, .26); }
.badge.info { color: #bae6fd; background: rgba(56, 189, 248, .1); border-color: rgba(56, 189, 248, .24); }
.badge.violet { color: #ddd6fe; background: rgba(139, 92, 246, .12); border-color: rgba(139, 92, 246, .28); }

.code-box {
  display: flex; align-items: center; gap: 10px; background: #080e1b;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px 9px 13px;
  overflow: hidden;
}
.code-box code { flex: 1; font-size: 11.5px; color: #a9c1f5; overflow-x: auto; white-space: nowrap; padding: 2px 0; }
.code-box.wrap code { white-space: pre-wrap; word-break: break-all; }
.code-box .btn { flex: 0 0 auto; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; color: #b9c6dd; font-weight: 500; }
.field label i { color: var(--bad); font-style: normal; }
.field small { font-size: 10.5px; color: var(--dim); line-height: 1.5; }
input[type="text"], input[type="password"], input[type="number"], input[type="url"], input:not([type]), select, textarea {
  width: 100%; background: #080e1b; border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 9px 11px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
  min-height: 38px;
}
textarea { resize: vertical; line-height: 1.6; font-size: 12.5px; }
input:focus, select:focus, textarea:focus { border-color: rgba(91, 140, 255, .65); box-shadow: 0 0 0 3px rgba(91, 140, 255, .12); }
input:disabled { opacity: .6; }
input::placeholder, textarea::placeholder { color: #465670; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #7c8ba6 50%), linear-gradient(135deg, #7c8ba6 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.form-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding-top: 4px; }
.switch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.switch-field { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; cursor: pointer; }
.switch-field input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  width: 34px; height: 20px; border-radius: 999px; background: rgba(148, 163, 184, .18);
  position: relative; flex: 0 0 auto; margin-top: 1px; transition: .18s; border: 1px solid var(--line-strong);
}
.switch::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #93a3bd;
  top: 2px; left: 2px; transition: .18s;
}
.switch-field input:checked + .switch { background: linear-gradient(135deg, #5b8cff, #8b5cf6); border-color: transparent; }
.switch-field input:checked + .switch::after { transform: translateX(14px); background: #fff; }
.switch-text { display: flex; flex-direction: column; font-size: 12.5px; }
.switch-text b { font-weight: 500; }
.switch-text small { color: var(--dim); font-size: 10.5px; margin-top: 1px; }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); }
.check-line input { margin-top: 3px; accent-color: var(--accent); }

.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-form select { width: auto; min-width: 118px; height: 36px; min-height: 36px; }
.search { position: relative; display: flex; align-items: center; }
.search span { position: absolute; left: 11px; color: var(--dim); display: flex; }
.search input { width: 240px; padding-left: 34px; height: 36px; min-height: 36px; }

/* ---------- bots ---------- */
.bot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bot-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: .18s; }
.bot-card:hover { border-color: rgba(91, 140, 255, .3); transform: translateY(-1px); box-shadow: 0 18px 40px rgba(0, 0, 0, .25); }
.bot-card-top { display: flex; align-items: center; gap: 11px; }
.bot-card-name { flex: 1; min-width: 0; }
.bot-card-name h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-card-name span { font-size: 10.5px; color: var(--dim); }
.bot-desc { color: var(--muted); font-size: 12px; min-height: 34px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bot-metrics { display: flex; gap: 14px; border-top: 1px solid var(--line); padding-top: 11px; }
.bot-metrics span { font-size: 11px; color: var(--dim); }
.bot-metrics b { color: var(--text); font-size: 13px; font-weight: 600; margin-right: 2px; }
.bot-card-foot { display: flex; gap: 6px; align-items: center; margin-top: auto; }
.bot-card-foot form { margin: 0 0 0 auto; }

.avatar {
  width: 44px; height: 44px; border-radius: 13px; display: inline-grid; place-items: center;
  font-weight: 700; font-size: 18px; color: #fff; position: relative; flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.avatar.g1 { background: linear-gradient(135deg, #5b8cff, #7c5cff); }
.avatar.g2 { background: linear-gradient(135deg, #22d3ee, #3b82f6); }
.avatar.g3 { background: linear-gradient(135deg, #f472b6, #8b5cf6); }
.avatar.g4 { background: linear-gradient(135deg, #34d399, #0ea5e9); }
.avatar.g5 { background: linear-gradient(135deg, #fbbf24, #f97316); }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.avatar.xs { width: 20px; height: 20px; border-radius: 6px; font-size: 10px; display: inline-grid; vertical-align: -5px; }
.avatar i { position: absolute; bottom: -5px; right: -5px; font-style: normal; font-size: 6.5px; letter-spacing: .5px; background: #8b5cf6; color: #fff; padding: 1px 3px; border-radius: 4px; }

.bot-hero {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; margin-bottom: 18px;
  border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(110deg, rgba(91, 140, 255, .12), rgba(139, 92, 246, .06) 60%, rgba(255, 255, 255, .02));
}
.bot-hero .avatar { width: 60px; height: 60px; border-radius: 17px; font-size: 25px; }
.bot-hero-main { flex: 1; min-width: 0; }
.bot-hero-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bot-hero-title h2 { font-size: 21px; }
.bot-hero-main p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.bot-hero-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; color: var(--dim); font-size: 11px; }
.bot-hero-meta span { display: inline-flex; align-items: center; gap: 5px; }
.bot-hero-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.bot-hero-actions form { margin: 0; }

/* ---------- bind / qr ---------- */
.bind-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qr-img { width: 250px; height: 250px; border-radius: 14px; background: #fff; padding: 8px; box-shadow: 0 14px 40px rgba(0, 0, 0, .35); }
.qr-meta { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; color: var(--dim); font-size: 10.5px; }
.qr-empty {
  height: 250px; border: 1px dashed var(--line-strong); border-radius: 14px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--dim);
  text-align: center; padding: 20px;
}
.qr-empty p { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.qr-empty span { font-size: 10.5px; }
.bind-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bind-url { margin-top: 2px; }
.bind-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bind-actions form { margin: 0; }
.tip-inline { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: st; }
.steps li { display: flex; flex-direction: column; gap: 2px; padding-left: 30px; position: relative; }
.steps li::before {
  counter-increment: st; content: counter(st); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; color: #bcd0ff; background: rgba(91, 140, 255, .12); border: 1px solid rgba(91, 140, 255, .3);
}
.steps li b { font-size: 12.5px; font-weight: 600; }
.steps li span { font-size: 11px; color: var(--dim); }
.steps.compact { gap: 10px; }

.inline-hints { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; color: var(--dim); font-size: 11px; }
.inline-hints span { display: inline-flex; align-items: center; gap: 5px; }
.inline-hints a { text-decoration: underline; text-decoration-color: rgba(157, 184, 255, .3); }

/* ---------- API ---------- */
.cmd { background: rgba(91, 140, 255, .1); border: 1px solid rgba(91, 140, 255, .22); color: #bcd0ff; border-radius: 6px; padding: 2px 7px; font-size: 12px; }
.method { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; padding: 2px 5px; border-radius: 4px; border: 1px solid; }
.method.get { color: #86efac; border-color: rgba(52, 211, 153, .3); background: rgba(52, 211, 153, .08); }
.method.post { color: #bae6fd; border-color: rgba(56, 189, 248, .3); background: rgba(56, 189, 248, .08); }
.method.put, .method.patch { color: #fde68a; border-color: rgba(251, 191, 36, .3); background: rgba(251, 191, 36, .08); }
.method.delete { color: #fecdd3; border-color: rgba(251, 113, 133, .3); background: rgba(251, 113, 133, .08); }
.api-edit-grid { align-items: start; }
.api-form .card-body { display: flex; flex-direction: column; gap: 14px; }
.var-list { display: flex; flex-direction: column; gap: 7px; }
.var-list > div { display: flex; align-items: baseline; gap: 9px; font-size: 11px; }
.var-list code { flex: 0 0 118px; color: #bcd0ff; background: rgba(91, 140, 255, .08); border-radius: 5px; padding: 2px 6px; font-size: 10.5px; }
.var-list span { color: var(--dim); }
.test-console { display: flex; gap: 8px; }
.test-console input { flex: 1; }
.pre {
  margin: 0; background: #070c17; border: 1px solid var(--line); border-radius: 9px;
  padding: 12px; font-size: 12px; color: #c3d3ec; white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow: auto;
}
.test-out {
  margin: 10px 0 0; background: #070c17; border: 1px solid var(--line); border-radius: 9px;
  padding: 11px; font-size: 11px; color: #a9b9d6; white-space: pre-wrap; word-break: break-word;
  max-height: 260px; overflow: auto; min-height: 60px;
}
.mini-list { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11.5px; }
.mini-list code { color: #bcd0ff; font-size: 10.5px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 6px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-size: 12px; background: rgba(148, 163, 184, .04);
}
.pill-btn:hover { color: var(--text); border-color: var(--line-strong); }
.pill-btn.active { color: #fff; border-color: rgba(91, 140, 255, .5); background: rgba(91, 140, 255, .12); }

/* ---------- misc ---------- */
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 22px; }
.kv-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv-grid span { color: var(--dim); font-size: 10.5px; }
.kv-grid b { font-weight: 550; font-size: 12.5px; overflow-wrap: anywhere; }
.mini-kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.mini-kv span { color: var(--dim); }
.mini-kv b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 46px 20px; gap: 8px; }
.empty-ic { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: rgba(91, 140, 255, .08); border: 1px solid rgba(91, 140, 255, .18); color: #9db8ff; margin-bottom: 6px; }
.empty h3 { font-size: 15px; }
.empty p { color: var(--muted); font-size: 12.5px; max-width: 420px; }
.empty-action { margin-top: 10px; }
.alert { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 9px; font-size: 12px; margin-bottom: 12px; }
.alert.bad { color: #fecdd3; background: rgba(251, 113, 133, .1); border: 1px solid rgba(251, 113, 133, .25); }
.callout { display: flex; gap: 9px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 12px; line-height: 1.6; margin: 14px 0; border: 1px solid var(--line); background: rgba(148, 163, 184, .05); color: var(--muted); }
.callout.info { border-color: rgba(56, 189, 248, .22); background: rgba(56, 189, 248, .06); color: #bae6fd; }
.callout.warn { border-color: rgba(251, 191, 36, .22); background: rgba(251, 191, 36, .06); color: #fde68a; }
.callout .ic { margin-top: 2px; }
.toast {
  position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; align-items: center; gap: 8px;
  padding: 11px 15px; border-radius: 10px; font-size: 12.5px; color: #d7fbe8;
  background: rgba(8, 20, 24, .95); border: 1px solid rgba(52, 211, 153, .35);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45); animation: toastIn .25s ease;
}
.toast.bad { color: #ffe4e8; border-color: rgba(251, 113, 133, .4); background: rgba(28, 10, 16, .96); }
.toast .ic { color: currentColor; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } }
.pager { display: flex; align-items: center; gap: 5px; padding-top: 16px; flex-wrap: wrap; }
.page { min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; padding: 0 9px; }
.page:hover { color: var(--text); border-color: var(--line-strong); }
.page.active { color: #fff; border-color: rgba(91, 140, 255, .5); background: rgba(91, 140, 255, .16); }
.page-info { margin-left: 8px; color: var(--dim); font-size: 10.5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 9px 13px; color: var(--muted); font-size: 12.5px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: #fff; border-bottom-color: var(--accent); }
.tab span { margin-left: 5px; font-size: 10px; color: var(--dim); }

.modal {
  width: min(680px, calc(100vw - 32px)); border-radius: 16px; border: 1px solid var(--line-strong);
  background: #0c1322; color: var(--text); padding: 0; box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(3, 6, 14, .72); backdrop-filter: blur(4px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 14px; }
.modal-body { padding: 18px; }

/* ---------- auth ---------- */
body.standalone { background: #070b16; }
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); min-height: 100vh; }
.auth-art {
  position: relative; padding: 54px 58px; display: flex; flex-direction: column; justify-content: center;
  background:
    radial-gradient(600px 420px at 20% 20%, rgba(91, 140, 255, .22), transparent 65%),
    radial-gradient(500px 380px at 80% 75%, rgba(139, 92, 246, .18), transparent 65%),
    linear-gradient(160deg, #0a1122, #070b16);
  border-right: 1px solid var(--line); overflow: hidden;
}
.auth-art::after {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  right: -140px; bottom: -160px; border: 1px solid rgba(148, 163, 184, .12);
  box-shadow: 0 0 0 60px rgba(148, 163, 184, .025), 0 0 0 140px rgba(148, 163, 184, .02);
}
.auth-art h1 { font-size: 40px; line-height: 1.22; letter-spacing: -.03em; margin: 0 0 16px; }
.auth-art h1 span { background: linear-gradient(100deg, #8fb3ff, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art > p { color: var(--muted); font-size: 14px; max-width: 460px; }
.auth-features { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-direction: column; gap: 14px; }
.auth-features li { display: flex; align-items: center; gap: 11px; color: #c6d3e8; font-size: 13px; }
.auth-features .ic { color: #9db8ff; }
.auth-foot { position: absolute; bottom: 30px; left: 58px; color: var(--dim); font-size: 11px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 24px; margin-bottom: 4px; }
.auth-card > .muted { font-size: 12.5px; margin-bottom: 22px; }
.auth-card .form { gap: 15px; }
.auth-switch { margin-top: 18px; text-align: center; color: var(--dim); font-size: 12px; }
.auth-switch a { color: #a9c1f5; }
.demo-hint {
  display: flex; align-items: center; gap: 7px; margin-top: 16px; padding: 9px 11px; border-radius: 9px;
  background: rgba(139, 92, 246, .08); border: 1px solid rgba(139, 92, 246, .22);
  color: #c4b5fd; font-size: 11.5px;
}
.demo-hint code { color: #fff; background: rgba(255, 255, 255, .08); padding: 1px 5px; border-radius: 4px; }

/* ---------- bind page ---------- */
.bind-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px 18px; gap: 16px;
  background:
    radial-gradient(700px 420px at 50% -10%, rgba(91, 140, 255, .2), transparent 60%),
    radial-gradient(500px 320px at 90% 100%, rgba(139, 92, 246, .12), transparent 60%);
}
.bind-card {
  width: 100%; max-width: 420px; border-radius: 22px; padding: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  border: 1px solid rgba(148, 163, 184, .2); box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.bind-brand { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; letter-spacing: .06em; align-self: flex-start; margin-bottom: 22px; }
.bind-brand .brand-mark { width: 24px; height: 24px; border-radius: 7px; font-size: 13px; }
.bind-avatar .avatar { width: 76px; height: 76px; border-radius: 22px; font-size: 32px; }
.bind-card h1 { font-size: 23px; margin: 14px 0 4px; }
.bind-desc { color: var(--muted); font-size: 12.5px; max-width: 320px; }
.bind-status { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 22px 0 14px; }
.bind-status .ic { color: var(--warn); }
.bind-status b { font-size: 15px; }
.bind-status span { color: var(--dim); font-size: 11.5px; }
.bind-status.ok .ic { color: var(--ok); }
.bind-status.muted .ic { color: var(--dim); }
.bind-qr { background: #fff; padding: 8px; border-radius: 14px; margin: 4px 0 6px; }
.bind-qr img { display: block; width: 190px; height: 190px; }
.bind-or { color: var(--dim); font-size: 11px; margin-top: 18px; }
.bind-manual { margin: 4px 0 10px; }
.bind-note { margin-top: 12px; color: var(--dim); font-size: 11px; display: flex; gap: 6px; align-items: center; text-align: left; }
.bind-meta { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); width: 100%; justify-content: center; color: var(--dim); font-size: 10.5px; }
.bind-footer { color: var(--dim); font-size: 10.5px; }
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.error-code { font-size: 78px; font-weight: 800; letter-spacing: -.05em; background: linear-gradient(120deg, #8fb3ff, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.error-page h1 { font-size: 22px; }
.error-page p { color: var(--muted); margin-bottom: 10px; }

/* ---------- docs ---------- */
.docs-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 30px; align-items: start; }
.docs-toc { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); padding-left: 12px; }
.docs-toc a { color: var(--dim); font-size: 12px; padding: 5px 0; }
.docs-toc a:hover { color: var(--text); }
.docs { max-width: 880px; min-width: 0; }
.docs section { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.docs section:last-child { border-bottom: 0; }
.docs h2 { font-size: 21px; margin-bottom: 12px; }
.docs h3 { font-size: 14px; margin: 22px 0 9px; color: #d6e2f7; }
.docs p { color: var(--muted); font-size: 13px; margin: 9px 0; line-height: 1.75; }
.docs code { color: #bcd0ff; background: rgba(91, 140, 255, .08); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.docs .code-box { margin: 12px 0; }
.docs .code-box code { background: none; padding: 0; }
.doc-list { margin: 10px 0; padding-left: 20px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.doc-list code { color: #bcd0ff; }
.steps.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.step-card { padding: 16px; border-radius: 13px; border: 1px solid var(--line); background: rgba(148, 163, 184, .03); }
.step-card b { font-size: 11px; color: #8fb3ff; letter-spacing: .08em; }
.step-card h3 { margin: 6px 0 4px; font-size: 13.5px; }
.step-card p { margin: 0; font-size: 12px; }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.flow > div { flex: 1; min-width: 120px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(91, 140, 255, .05); display: flex; flex-direction: column; gap: 3px; }
.flow b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; background: rgba(91, 140, 255, .18); color: #bcd0ff; }
.flow span { font-size: 11.5px; color: var(--muted); }
.flow i { color: var(--dim); font-style: normal; }
.faq details { border-bottom: 1px solid var(--line); padding: 11px 0; }
.faq summary { cursor: pointer; font-size: 13px; color: #cfdaec; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: "+"; color: var(--dim); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 8px 0 2px; }

/* ---------- simulator ---------- */
.sim-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr); gap: 18px; align-items: start; }
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 190px); min-height: 520px; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 11px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-head > div:nth-child(2) { display: flex; flex-direction: column; }
.chat-head b { font-size: 13.5px; }
.chat-head span { color: var(--dim); font-size: 10.5px; }
.chat-scene { margin-left: auto; display: flex; background: rgba(148, 163, 184, .07); border-radius: 8px; padding: 2px; }
.scene-btn { border: 0; background: none; color: var(--muted); font-size: 11px; padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.scene-btn.active { background: rgba(91, 140, 255, .2); color: #fff; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 13px; background: radial-gradient(700px 300px at 50% 0%, rgba(91, 140, 255, .05), transparent 70%); }
.msg { display: flex; gap: 8px; max-width: 82%; }
.msg .bubble { padding: 9px 13px; border-radius: 13px; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.msg.bot .bubble { background: rgba(148, 163, 184, .1); border: 1px solid var(--line); border-top-left-radius: 4px; color: #dbe6f8; }
.msg.user { align-self: flex-end; }
.msg.user .bubble { background: linear-gradient(135deg, #4f7cff, #7c66ff); color: #fff; border-top-right-radius: 4px; }
.msg .meta { font-size: 9.5px; color: var(--dim); margin-top: 4px; }
.msg.err .bubble { border-color: rgba(251, 113, 133, .3); background: rgba(251, 113, 133, .08); color: #fecdd3; }
.chat-input { display: flex; gap: 9px; padding: 13px 16px; border-top: 1px solid var(--line); background: rgba(7, 11, 22, .35); }
.chat-input input { flex: 1; }
.chat-foot { text-align: center; color: var(--dim); font-size: 10px; padding: 0 0 9px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 10px;
  border-radius: 8px; border: 1px solid var(--line); background: rgba(148, 163, 184, .04);
  color: var(--muted); font-size: 11px; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: rgba(91, 140, 255, .4); color: var(--text); }
.chip code { color: #9db8ff; font-size: 10px; }
.sim-qr { display: flex; align-items: center; justify-content: center; min-height: 160px; border: 1px dashed var(--line-strong); border-radius: 12px; margin-bottom: 10px; padding: 8px; }
.sim-qr img { width: 190px; height: 190px; border-radius: 8px; background: #fff; padding: 6px; }
.sim-log { margin-top: 10px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.sim-log .ok { color: var(--ok); }
.sim-log .bad { color: var(--bad); }

/* ---------- install wizard ---------- */
.install-body {
  background:
    radial-gradient(760px 520px at 12% 0%, rgba(91, 140, 255, .22), transparent 60%),
    radial-gradient(600px 420px at 92% 100%, rgba(139, 92, 246, .16), transparent 60%),
    #070b16;
}
.install-shell { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); min-height: 100vh; }
.install-aside {
  padding: 52px 48px; display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(10, 17, 34, .7), rgba(7, 11, 22, .3));
}
.install-aside h1 { font-size: 37px; line-height: 1.2; letter-spacing: -.03em; margin: 0 0 14px; }
.install-aside > p { color: var(--muted); font-size: 13.5px; max-width: 440px; line-height: 1.75; }
.install-aside .auth-features { margin-top: 26px; }
.install-aside-foot { margin-top: 40px; display: flex; flex-direction: column; gap: 4px; color: var(--dim); font-size: 10.5px; }
.install-aside-foot code { color: #9db8ff; word-break: break-all; font-size: 10.5px; }
.install-main { display: flex; align-items: center; justify-content: center; padding: 40px 26px; }
.install-card {
  width: 100%; max-width: 680px; padding: 26px 30px 20px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  border: 1px solid rgba(148, 163, 184, .2); box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
}
.install-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.install-kicker { font-size: 9.5px; letter-spacing: .2em; color: #8fb3ff; }
.install-head h2 { font-size: 22px; margin-top: 4px; }
.wizard-dots { display: flex; gap: 4px; list-style: none; padding: 0; margin: 20px 0 22px; }
.wizard-dot { flex: 1; display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 10.5px; padding-bottom: 8px; border-bottom: 2px solid var(--line); min-width: 0; }
.wizard-dot span { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); font-size: 10px; flex: 0 0 auto; }
.wizard-dot em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wizard-dot.active { color: #fff; border-bottom-color: var(--accent); }
.wizard-dot.active span { background: linear-gradient(135deg, #5b8cff, #8b5cf6); border-color: transparent; color: #fff; }
.wizard-dot.done span { background: rgba(52, 211, 153, .16); border-color: rgba(52, 211, 153, .4); color: var(--ok); }
.wizard.ready .wizard-step { display: none; }
.wizard.ready .wizard-step.active { display: block; animation: stepIn .2s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateY(4px); } }
.wizard-step h3 { font-size: 17px; margin-bottom: 3px; }
.wizard-step > p { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.check-list { display: flex; flex-direction: column; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.check-row.ok .check-ic { color: var(--ok); background: rgba(52, 211, 153, .12); }
.check-row.bad .check-ic { color: var(--bad); background: rgba(251, 113, 133, .12); }
.check-row b { display: block; font-size: 12.5px; font-weight: 550; }
.check-row small { display: block; color: var(--dim); font-size: 10.5px; margin-top: 1px; }
.check-row code { margin-left: auto; color: var(--muted); font-size: 10.5px; max-width: 44%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wizard-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; }
.wizard-actions .btn.primary { margin-left: auto; }
.db-choice { display: flex; align-items: center; gap: 13px; padding: 14px; border-radius: 13px; border: 1px solid rgba(91, 140, 255, .4); background: rgba(91, 140, 255, .07); }
.db-logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: rgba(91, 140, 255, .14); color: #9db8ff; border: 1px solid rgba(91, 140, 255, .25); flex: 0 0 auto; }
.db-meta { flex: 1; }
.db-meta b { font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.db-meta p { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.db-check { color: var(--ok); }
.db-kv { margin-top: 14px; }
.db-kv b { font-size: 11px; }
.install-card .form-grid { gap: 13px; }
.install-card .field input { background: #080e1b; }
.install-switches { margin-top: 14px; }
.install-foot { text-align: center; color: var(--dim); font-size: 10px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.alert.ok { color: #bbf7d0; background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .3); }

@media (max-width: 1080px) {
  .install-aside { padding: 40px 32px; }
  .install-aside h1 { font-size: 31px; }
}
@media (max-width: 860px) {
  .install-shell { grid-template-columns: 1fr; }
  .install-aside { display: none; }
  .install-main { padding: 22px 14px; min-height: 100vh; }
  .install-card { padding: 22px 18px 16px; }
  .wizard-dot em { display: none; }
  .wizard-dot { justify-content: center; }
  .check-row code { display: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .bot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
  .api-edit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  :root { --sidebar: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; width: 248px; }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 30px 0 80px rgba(0, 0, 0, .5); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 25; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 30px; }
  .cols-2, .cols-3, .bot-grid, .stats-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .hero-side { text-align: left; }
  .hero-side-note { margin-left: 0; }
  .bot-hero { flex-wrap: wrap; }
  .bot-hero-actions { width: 100%; justify-content: flex-start; }
  .bind-layout { grid-template-columns: 1fr; }
  .qr-wrap { align-items: flex-start; }
  .form-grid, .switch-grid, .kv-grid { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; flex-direction: row; flex-wrap: wrap; border-left: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; gap: 12px; }
  .steps.cards { grid-template-columns: 1fr; }
  .sim-layout { grid-template-columns: 1fr; }
  .chat-card { height: 66vh; min-height: 440px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .filter-form .search input { width: 100%; }
  .search { flex: 1; }
  .topbar-right .pill:not(.demo) { display: none; }
}
@media (max-width: 560px) {
  .topbar-title p { display: none; }
  .topbar-title h1 { font-size: 17px; }
  .card-head { padding: 15px 15px 0; }
  .card-body { padding: 15px; }
  .hero h2 { font-size: 23px; }
  .chart { gap: 6px; }
  .bot-card-foot { flex-wrap: wrap; }
  .bot-card-foot form { margin-left: 0; }
  .qr-img { width: 220px; height: 220px; }
}

/* ---------- PHP install database options & QR ---------- */
.db-options { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 6px; }
.db-choice { cursor: pointer; position: relative; }
.db-choice input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.db-choice .db-check { opacity: 0; transition: .15s; }
.db-choice.selected .db-check { opacity: 1; }
.db-choice.selected { border-color: rgba(91, 140, 255, .6); background: rgba(91, 140, 255, .1); }
.db-panel { margin-top: 12px; }
.db-panel[hidden] { display: none; }
.qr-box {
  width: 230px; height: 230px; background: #fff; border-radius: 14px; padding: 8px;
  display: grid; place-items: center; box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
}
.qr-box img, .qr-box canvas { display: block; max-width: 100%; height: auto !important; }
.bind-qr .qr-box { width: 190px; height: 190px; padding: 8px; }
.sim-qr .qr-box { width: 190px; height: 190px; }
.sim-qr { flex-direction: column; }
.bind-qr { background: transparent; padding: 0; }
