/* ==========================================================================
   Design system
   ========================================================================== */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --border: #e6e8f0;
  --border-strong: #d5d9e4;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --subtle: #94a3b8;

  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --accent: #06b6d4;

  --success: #16a34a;  --success-50: #ecfdf3;
  --warning: #d97706;  --warning-50: #fffbeb;
  --danger: #dc2626;   --danger-50: #fef2f2;
  --live: #ef4444;

  --sidebar: #0c1222;
  --sidebar-2: #131b2e;
  --sidebar-text: #94a3c4;
  --sidebar-active: #ffffff;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 20px 50px -12px rgba(15, 23, 42, .18);
  --ring: 0 0 0 3px rgba(79, 70, 229, .18);

  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 15px/1.6 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.015em; color: var(--text); }
p { margin: 0 0 1em; }
img, svg { display: block; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff !important; box-shadow: 0 1px 2px rgba(79,70,229,.3); }
.btn-primary:hover { background: var(--primary-600); }
.btn-secondary { background: var(--surface); color: var(--text) !important; border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--subtle); }
.btn-ghost { background: transparent; color: var(--text-2) !important; }
.btn-ghost:hover { background: rgba(15,23,42,.05); }
.btn-danger { background: var(--surface); color: var(--danger) !important; border-color: #f3c4c4; }
.btn-danger:hover { background: var(--danger-50); }
.btn-dark { background: var(--text); color: #fff !important; }
.btn-dark:hover { background: #1e293b; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 6px; font-weight: 500; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: rgba(15,23,42,.06); }

/* ---------- Forms ---------- */
.field { display: block; }
.field + .field { margin-top: 16px; }
.label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.label a { font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); font: 14.5px var(--font); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 12px; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.input-sm { height: 34px; font-size: 13.5px; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.input-icon .input { padding-left: 36px; }
.help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
form.inline { display: inline; margin: 0; }

/* ---------- Cards, badges, alerts ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-body { padding: 22px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.card-header h3 { margin: 0; font-size: 15px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f1f5f9; color: var(--text-2); white-space: nowrap; }
.badge-primary { background: var(--primary-50); color: var(--primary); }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-live { background: var(--live); color: #fff; }
.badge-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--subtle); }
.dot-success { background: var(--success); } .dot-danger { background: var(--danger); } .dot-warning { background: var(--warning); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; border: 1px solid; }
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--success-50); border-color: #bbf0cf; color: #166534; }
.alert-danger { background: var(--danger-50); border-color: #f8caca; color: #991b1b; }
.alert-info { background: var(--primary-50); border-color: var(--primary-100); color: #3730a3; }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  background: var(--surface-2); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbff; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.table .empty { text-align: center; padding: 40px 16px; color: var(--muted); white-space: normal; }
.person { display: flex; align-items: center; gap: 11px; }
.person .name { font-weight: 600; color: var(--text); line-height: 1.3; }
.person .sub { font-size: 12.5px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent)); }
.avatar-sm { width: 28px; height: 28px; font-size: 11.5px; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; display: none; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 7px; border: 0; background: none;
  font: 14px var(--font); color: var(--text-2) !important; text-align: left; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); color: var(--text) !important; }
.dropdown-menu .danger { color: var(--danger) !important; }
.dropdown-menu .divider { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-menu .head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-menu form { margin: 0; }

/* ---------- Misc ---------- */
.copy { display: flex; gap: 6px; align-items: center; }
.copy code { flex: 1; min-width: 0; height: 36px; line-height: 34px; padding: 0 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  overflow-x: auto; white-space: nowrap; color: var(--text); scrollbar-width: none; }
.meter { height: 8px; background: #eef0f6; border-radius: 99px; overflow: hidden; }
.meter > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .icon-wrap { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.empty-state h3 { font-size: 17px; }
.empty-state p { color: var(--muted); max-width: 380px; margin: 0 auto 20px; }
kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 14px 16px; border-top: 1px solid var(--border); }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(16px); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; transition: .2s; pointer-events: none; z-index: 100; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

/* ==========================================================================
   Marketing site
   ========================================================================== */
.site { background: var(--surface); }
.mk-nav { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.mk-nav.scrolled { border-bottom-color: var(--border); }
.mk-nav .container { display: flex; align-items: center; height: 68px; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text) !important; letter-spacing: -.02em; white-space: nowrap; }
.mk-links { display: flex; gap: 4px; flex: 1; }
.mk-links a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-size: 14.5px; font-weight: 500; }
.mk-links a:hover, .mk-links a.active { color: var(--text); background: var(--surface-2); }
.mk-cta { display: flex; gap: 8px; align-items: center; }
.mk-toggle { display: none; }
@media (max-width: 880px) {
  .mk-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: #fff; padding: 12px 24px 20px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); }
  .mk-nav.open .mk-links { display: flex; }
  .mk-toggle { display: inline-grid; }
  .mk-nav .container { justify-content: space-between; }
  .mk-cta .btn-ghost { display: none; }
}
.mk-mobile-only { display: none; }
@media (max-width: 880px) { .mk-mobile-only { display: block; } }
@media (max-width: 480px) {
  .mk-nav .container { gap: 10px; }
  .mk-cta .btn { height: 38px; padding: 0 14px; font-size: 14px; }
  .mk-cta .btn .icon { display: none; }
}

.hero { position: relative; overflow: hidden; padding: 84px 0 96px;
  background: radial-gradient(60% 60% at 80% 0%, rgba(6,182,212,.12), transparent 60%), radial-gradient(60% 70% at 10% 10%, rgba(79,70,229,.12), transparent 60%), #fff; }
.hero .container { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 6px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 500; color: var(--text-2); }
.eyebrow .pill { background: var(--primary); color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 11.5px; font-weight: 700; }
.hero h1 { font-size: clamp(36px, 5vw, 58px); line-height: 1.06; letter-spacing: -.035em; margin: 22px 0 20px; }
.hero h1 .grad { background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 18.5px; color: var(--muted); max-width: 540px; margin-bottom: 30px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .assure { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; font-size: 13.5px; color: var(--muted); }
.hero .assure span { display: inline-flex; align-items: center; gap: 6px; }
.hero .assure .icon { color: var(--success); }
@media (max-width: 980px) { .hero .container { grid-template-columns: minmax(0, 1fr); } .hero { padding: 56px 0 64px; } }

/* Product mockup */
.mockup { border-radius: 16px; background: var(--sidebar); box-shadow: 0 40px 80px -20px rgba(15,23,42,.35), 0 0 0 1px rgba(15,23,42,.08); overflow: hidden; }
.mockup-bar { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; background: #0a0f1c; border-bottom: 1px solid rgba(255,255,255,.06); }
.mockup-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a3247; }
.mockup-bar .url { margin-left: 14px; flex: 1; height: 20px; border-radius: 6px; background: #151c2e; color: #6b7895; font-size: 11px; line-height: 20px; padding: 0 10px; font-family: var(--mono); }
.mockup-body { display: grid; grid-template-columns: 120px 1fr; min-height: 330px; }
.mockup-side { background: var(--sidebar); padding: 14px 10px; border-right: 1px solid rgba(255,255,255,.06); }
.mockup-side div { height: 8px; border-radius: 4px; background: #1f2840; margin: 10px 4px; }
.mockup-side div.on { background: #4f46e5; width: 70%; }
.mockup-main { background: #f6f7fb; padding: 16px; display: grid; gap: 12px; align-content: start; }
.mockup-video { position: relative; aspect-ratio: 16/8; border-radius: 10px; overflow: hidden;
  background: radial-gradient(120% 120% at 20% 10%, #312e81 0%, #0e7490 55%, #0f172a 100%); }
.mockup-video::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 2px, transparent 2px 4px); }
.mockup-video .badge-live { position: absolute; top: 10px; left: 10px; z-index: 1; }
.mockup-video .play { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.85); z-index: 1; }
.mockup-video .ladder { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; z-index: 1; }
.mockup-video .ladder span { font-size: 10px; font-weight: 700; color: #fff; background: rgba(15,23,42,.55); border: 1px solid rgba(255,255,255,.15); padding: 2px 6px; border-radius: 5px; }
.mockup-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mockup-stats div { background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 10px; }
.mockup-stats b { display: block; font-size: 15px; color: var(--text); }
.mockup-stats small { font-size: 10.5px; color: var(--muted); }
.mockup-bars { display: flex; align-items: flex-end; gap: 4px; height: 44px; background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; }
.mockup-bars i { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--primary), var(--accent)); opacity: .85; }

.logos { padding: 30px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.logos .container { display: flex; align-items: center; justify-content: center; gap: 18px 40px; flex-wrap: wrap; }
.logos .label-sm { font-size: 13px; color: var(--muted); font-weight: 500; }
.logos .item { font-size: 15px; font-weight: 700; color: #7b8599; letter-spacing: -.01em; }

.section { padding: 96px 0; }
.section.alt { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin: 0 auto 52px; text-align: center; }
.section-head .kicker { font-size: 13px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.03em; margin: 10px 0 14px; }
.section-head p { font-size: 17px; color: var(--muted); margin: 0; }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } .section { padding: 64px 0; } }
.feature { padding: 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); transition: box-shadow .2s, transform .2s; }
.feature:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.feature .ficon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); margin-bottom: 18px; }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 14.5px; margin: 0; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
@media (max-width: 980px) { .split { grid-template-columns: minmax(0, 1fr); gap: 36px; } }
.split h2 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.03em; }
.split .lead { font-size: 17px; color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 11px; color: var(--text-2); }
.checklist .icon { color: var(--success); margin-top: 3px; }
.settings-card { background: var(--sidebar); color: #cbd5e1; border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-lg); font-family: var(--mono); font-size: 13.5px; }
.settings-card .t { color: #fff; font-family: var(--font); font-weight: 700; font-size: 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.settings-card .kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.07); }
.settings-card .k { color: #7b8aab; }
.settings-card .v { color: #e2e8f0; }
.settings-card .v.hl { color: #a5b4fc; }

.steps { counter-reset: step; }
.step { position: relative; padding: 28px 26px 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 800; }
.step h3 { font-size: 17px; }
.step p { color: var(--muted); font-size: 14.5px; margin: 0; }

.plans { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 980px) { .plans { grid-template-columns: minmax(0, 1fr); max-width: 460px; margin: 0 auto; } }
.plan { position: relative; display: flex; flex-direction: column; padding: 30px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.plan.featured { border: 2px solid var(--primary); box-shadow: 0 30px 60px -20px rgba(79,70,229,.35); }
.plan .ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.plan h3 { font-size: 18px; margin-bottom: 4px; }
.plan .desc { color: var(--muted); font-size: 14px; min-height: 42px; }
.plan .price { font-size: 46px; font-weight: 800; letter-spacing: -.04em; margin: 10px 0 4px; }
.plan .price span { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 11px; flex: 1; }
.plan li { display: flex; gap: 10px; font-size: 14.5px; color: var(--text-2); }
.plan li .icon { color: var(--primary); margin-top: 3px; }

.faq { max-width: 780px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 0; font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform .2s; color: var(--muted); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { color: var(--muted); margin: 0 0 20px; }

.cta-band { position: relative; overflow: hidden; border-radius: 24px; padding: 64px 40px; text-align: center; color: #fff;
  background: radial-gradient(80% 120% at 100% 0%, rgba(6,182,212,.45), transparent 60%), linear-gradient(135deg, #312e81, var(--primary)); }
.cta-band h2 { color: #fff; font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.03em; }
.cta-band p { color: rgba(255,255,255,.8); font-size: 17px; margin-bottom: 28px; }
.cta-band .btn-secondary { border-color: transparent; }

.mk-footer { background: var(--sidebar); color: #8a96b3; padding: 64px 0 28px; }
.mk-footer .cols { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 820px) { .mk-footer .cols { grid-template-columns: 1fr 1fr; } }
.mk-footer .brand { color: #fff !important; }
.mk-footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.mk-footer a { display: block; color: #8a96b3; padding: 4px 0; font-size: 14.5px; }
.mk-footer a:hover { color: #fff; }
.mk-footer .bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13.5px; }

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; background: var(--surface); }
.auth-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 56px; color: #fff;
  background: radial-gradient(70% 60% at 100% 0%, rgba(6,182,212,.35), transparent 60%), radial-gradient(60% 60% at 0% 100%, rgba(124,58,237,.35), transparent 60%), var(--sidebar); }
.auth-aside .brand { color: #fff !important; }
.auth-aside h2 { color: #fff; font-size: 34px; letter-spacing: -.03em; max-width: 460px; }
.auth-aside p { color: #a8b3cf; font-size: 16px; max-width: 440px; }
.auth-aside ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.auth-aside li { display: flex; gap: 12px; color: #dbe2f3; }
.auth-aside li .icon { color: #67e8f9; margin-top: 3px; }
.auth-aside .foot { font-size: 13px; color: #6f7b98; }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 28px; letter-spacing: -.03em; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 28px; }
.auth-card .switch { text-align: center; margin-top: 24px; font-size: 14px; color: var(--muted); }
.auth-mobile-brand { display: none; margin-bottom: 32px; }
@media (max-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-aside { display: none; } .auth-mobile-brand { display: inline-flex; } }

/* ==========================================================================
   App shell (customer + admin)
   ========================================================================== */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar-backdrop { display: none; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--sidebar); color: var(--sidebar-text); padding: 18px 14px; }
.sidebar .brand { color: #fff !important; padding: 4px 10px 22px; font-size: 17px; }
.nav-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #56627e; padding: 18px 12px 8px; }
.nav-item { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border-radius: 8px; color: var(--sidebar-text) !important; font-size: 14.5px; font-weight: 500; position: relative; }
.nav-item:hover { background: var(--sidebar-2); color: #e2e8f0 !important; }
.nav-item.active { background: linear-gradient(90deg, rgba(79,70,229,.35), rgba(79,70,229,.12)); color: var(--sidebar-active) !important; }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #818cf8; }
.nav-item .count { margin-left: auto; font-size: 11.5px; font-weight: 700; color: #c7d2fe; background: rgba(129,140,248,.18); border-radius: 999px; padding: 1px 8px; }
.sidebar-plan { margin-top: auto; padding: 16px; border-radius: 12px; background: var(--sidebar-2); border: 1px solid rgba(255,255,255,.06); }
.sidebar-plan .top { display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.sidebar-plan .meter { background: #222c45; height: 6px; margin: 8px 0 12px; }
.sidebar-plan .small { color: #8a96b3; }
.sidebar-plan .btn { width: 100%; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 28px; background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .menu-toggle { display: none; margin-left: -8px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--subtle); }
.crumbs .current { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-btn { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px 0 4px; border: 1px solid transparent; border-radius: 999px; background: none; cursor: pointer; font: 500 14px var(--font); color: var(--text); }
.user-btn:hover, .dropdown.open .user-btn { background: var(--surface-2); border-color: var(--border); }
.user-btn .icon { color: var(--muted); }
.content { padding: 30px 28px 64px; max-width: 1240px; width: 100%; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-header h1 { font-size: 26px; letter-spacing: -.025em; margin: 0 0 4px; }
.page-header p { color: var(--muted); margin: 0; }
.page-header .tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.stats { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stats { grid-template-columns: minmax(0, 1fr); } }
.stat { padding: 20px; display: flex; gap: 14px; align-items: flex-start; color: inherit !important; }
a.stat:hover { box-shadow: var(--shadow-lg); }
.stat .sicon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.stat .sicon.indigo { background: var(--primary-50); color: var(--primary); }
.stat .sicon.green { background: var(--success-50); color: var(--success); }
.stat .sicon.red { background: var(--danger-50); color: var(--live); }
.stat .sicon.cyan { background: #ecfeff; color: #0891b2; }
.stat .sicon.amber { background: var(--warning-50); color: var(--warning); }
.stat .label-sm { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin-top: 2px; }
.stat .trend { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.grid-main { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 1100px) { .grid-main, .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.toolbar .input-icon { flex: 1; min-width: 220px; max-width: 360px; }

.kv-list { display: grid; gap: 0; }
.kv-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv-list > div:last-child { border-bottom: 0; }
.kv-list dt, .kv-list .k { color: var(--muted); }
.kv-list .v { font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* Stream cards */
.stream-card .card-header { padding: 18px 22px; }
.stream-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stream-title h3 { font-size: 16.5px; margin: 0; }
.stream-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.encoder-box { border: 1px solid var(--primary-100); background: linear-gradient(180deg, #f8f9ff, #fff); border-radius: 12px; padding: 16px; }
.encoder-box .t { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.fields { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.fields.three { grid-template-columns: minmax(0, 2fr) minmax(0, .8fr) minmax(0, 2.4fr); }
.fields .full { grid-column: 1 / -1; }
.fields .label { font-size: 12.5px; margin-bottom: 5px; }
@media (max-width: 820px) { .fields, .fields.three { grid-template-columns: minmax(0, 1fr); } }
details.more summary { cursor: pointer; font-size: 13.5px; color: var(--muted); font-weight: 500; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary .icon { transform: rotate(180deg); }

/* Guide */
.guide-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.guide-tabs button { border: 0; background: none; padding: 14px 14px 12px; font: 600 14px var(--font); color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.guide-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.guide-panel { display: none; }
.guide-panel.active { display: block; }
.guide-panel ol { padding-left: 20px; margin: 0; display: grid; gap: 10px; color: var(--text-2); }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 60; transform: translateX(-100%); transition: transform .22s ease; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 55; display: none; }
  .app.nav-open .sidebar-backdrop { display: block; }
  .topbar { padding: 0 16px; }
  .topbar .menu-toggle { display: inline-grid; }
  .user-btn .uname { display: none; }
  .content { padding: 22px 16px 56px; }
}
