:root {
  color-scheme: dark;
  --bg: #0c0d0f; --surface: #121417; --surface-2: #181a1e;
  --border: #292c31; --border-strong: #3a3e45; --text: #f2f3f5;
  --muted: #92979f; --soft: #6f747c; --success: #83c99a;
  --warning: #d7b66b; --danger: #d88383; --radius: 10px; --sidebar: 238px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
h1 { margin-bottom: 8px; font-size: 32px; line-height: 1.15; }
h2 { margin-bottom: 4px; font-size: 22px; }
h3 { margin-bottom: 4px; font-size: 16px; }
small { color: var(--muted); }
code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.hidden { display: none !important; }
.svg-icons { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted, .subtle, .panel-description, .notice { color: var(--muted); }
.tiny { font-size: 12px; }
.row { display: flex; }
.wide { width: 100%; }

/* Sign in */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-showcase { display: none; }
.login-side { width: 100%; max-width: 390px; }
.login-card { padding: 32px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 60px rgba(0,0,0,.22); }
.login-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.brand-symbol { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--text); color: #101114; font-size: 15px; font-weight: 800; }
.login-card h2 { margin: 8px 0 10px; font-size: 28px; }
.login-card .muted { margin-bottom: 28px; }
.login-card label { display: block; margin: 16px 0 7px; color: #c9ccd1; font-size: 12px; font-weight: 600; }
.login-card input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; outline: none; background: #0e1012; color: var(--text); }
.login-card input:focus { border-color: #737982; box-shadow: 0 0 0 3px rgba(255,255,255,.05); }
.login-submit { margin-top: 22px; }
.login-divider, .login-side-footer { display: none; }
.login-footnote { display: flex; gap: 8px; margin: 22px 0 0; }
.eyebrow { margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* App shell */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); }
.sidebar { grid-column: 1; grid-row: 1; position: sticky; top: 0; z-index: 10; display: flex; flex-direction: column; width: var(--sidebar); height: 100vh; padding: 22px 14px 16px; border-right: 1px solid var(--border); background: #0f1012; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; }
.brand-words { display: grid; }
.brand-words strong { font-size: 14px; letter-spacing: .04em; }
.brand-words span { color: var(--soft); font-size: 9px; letter-spacing: .08em; }
.brand-accent { color: var(--muted) !important; }
.sidebar-section-label { margin: 5px 8px 8px; color: var(--soft); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.nav-label { margin-top: 22px; }
.label-dash { display: none; }
.hub-picker label { display: none; }
.select-wrap { position: relative; min-width: 0; }
.select-wrap select { width: 100%; appearance: none; padding-right: 34px; }
.select-wrap > .icon { position: absolute; top: 50%; right: 11px; width: 13px; height: 13px; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
select, input, textarea { border: 1px solid var(--border); border-radius: 8px; outline: none; background: #0e1012; color: var(--text); }
select:focus, input:focus, textarea:focus { border-color: #666b73; }
.hub-picker select { height: 40px; padding-left: 11px; }
.ghost-button { display: flex; align-items: center; gap: 7px; width: 100%; margin-top: 7px; padding: 8px 10px; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-align: left; }
.ghost-button:hover { color: var(--text); }
.ghost-button .icon { width: 14px; height: 14px; }
nav { display: grid; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; height: 40px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item .icon { width: 16px; height: 16px; }
.sidebar-bottom { margin-top: auto; }
.workspace-state { display: flex; align-items: center; gap: 9px; margin: 0 8px 12px; }
.workspace-state div { display: grid; min-width: 0; }
.workspace-state strong { font-size: 11px; font-weight: 600; }
.workspace-state small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.signal-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(131,201,154,.09); }
.logout-button { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--muted); }
.logout-button:hover { color: var(--text); border-color: var(--border-strong); }
.logout-button .right-icon { margin-left: auto; }
.main { grid-column: 2; grid-row: 1; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 66px; padding: 0 30px; border-bottom: 1px solid var(--border); background: rgba(12,13,15,.92); backdrop-filter: blur(12px); }
.topbar-title { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.topbar-title strong { color: var(--text); font-weight: 600; }
.breadcrumb-divider { color: var(--border-strong); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.workspace-live { display: none; }
.content-shell { width: min(1320px,100%); margin: 0 auto; padding: 34px 30px 48px; }
.system-ribbon { display: none; }
.page { display: none; }
.page.active { display: block; }
.page-intro { margin: 4px 0 28px; }
.page-intro .eyebrow { margin-bottom: 9px; }
.page-intro p { max-width: 620px; margin-bottom: 0; color: var(--muted); }
.title-period { display: none; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--soft); font-size: 11px; }

/* Buttons */
.button, .icon-button, .mini, .text-link, .subtle-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 7px; font-weight: 600; }
.button { min-height: 38px; padding: 0 13px; border: 1px solid transparent; }
.button.primary { background: var(--text); color: #101114; }
.button.primary:hover { background: #d7d9dc; }
.button.secondary { border-color: var(--border); background: var(--surface); color: #d3d6da; }
.button.secondary:hover { border-color: var(--border-strong); background: var(--surface-2); }
.subtle-button { min-height: 38px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); }
.subtle-button:hover { color: var(--text); }
.icon-button { width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.icon-button:hover { color: var(--text); }
.mobile-open, .mobile-close { display: none; }
.text-link { padding: 6px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.text-link:hover { color: var(--text); }
.text-link .icon { width: 13px; }
.mini { min-height: 28px; padding: 0 8px; border: 1px solid var(--border); background: transparent; color: #c7cacf; font-size: 11px; }
.mini:hover { border-color: var(--border-strong); background: var(--surface-2); }
.mini.danger { color: #d9a0a0; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: #b7bbc1; font-size: 10px; font-weight: 600; text-transform: capitalize; }
.badge.good { color: var(--success); }
.badge.suspended, .badge.warning { color: var(--warning); }
.badge.revoked { color: var(--danger); }
.badge.neutral { color: var(--muted); }

/* Overview */
.overview-hero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; min-height: 0; margin-bottom: 34px; padding: 30px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.hero-pattern, .hero-mark, .hero-display { display: none; }
.hero-copy { max-width: 670px; }
.hero-kicker { display: block; margin-bottom: 14px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.hero-kicker .icon { display: none; }
.hero-copy h1 { margin-bottom: 12px; font-size: clamp(34px,5vw,50px); line-height: 1; }
.hero-copy h1 br { display: none; }
.hero-copy h1 span { color: var(--muted); }
.hero-copy p { max-width: 560px; margin-bottom: 22px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 0 0 15px; }
.section-heading .eyebrow { display: none; }
.section-heading h2 { margin: 0; }
.section-aside { color: var(--muted); font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.metric { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.metric-header { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.metric-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--surface-2); color: var(--muted); }
.metric-icon .icon { width: 15px; }
.metric > strong { display: block; margin: 14px 0 2px; font-size: 27px; line-height: 1.1; }
.metric > small { font-size: 11px; }
.two-col { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.overview-panels { margin-top: 14px; }

/* Panels and data */
.panel { min-width: 0; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-head h3, .panel-head p:last-child { margin-bottom: 0; }
.panel-head .eyebrow { display: none; }
.pipeline-top-icon { display: none; }
.activity-row, .pipeline > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--border); }
.activity-row:first-child, .pipeline > div:first-child { border-top: 0; }
.activity-row div, .pipeline > div > div { display: grid; }
.activity-row strong, .pipeline strong { font-size: 12px; font-weight: 600; text-transform: capitalize; }
.activity-row small, .pipeline small { font-size: 11px; }
.pipeline > div > span { width: 22px; color: var(--soft); font: 10px "SFMono-Regular",Consolas,monospace; }
.pipeline > div > div { flex: 1; }
.pipeline-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.empty { padding: 35px 12px !important; color: var(--muted); text-align: center; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel > .panel-head { margin: 0; padding: 20px 22px; }
.panel-tools, .action-wrap, .loader-form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.search-field { display: flex; align-items: center; gap: 8px; min-width: 220px; height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 7px; background: #0e1012; color: var(--muted); }
.search-field input { width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; }
.search-field input:focus { border: 0; }
.search-field .icon { width: 14px; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--soft); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
td { color: #c8cbd0; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: var(--text); font-weight: 600; }
.table-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.license-key { display: flex; align-items: center; gap: 8px; }
.license-key code { color: var(--text); user-select: all; }
.secret-box code { white-space: pre-wrap; }

/* Forms and editor */
.form-grid { display: grid; gap: 16px; }
.form-grid > label:not(.toggle-row) { display: grid; gap: 7px; color: #c9ccd1; font-size: 12px; font-weight: 600; }
.form-grid input:not([type="checkbox"]), .form-grid select { width: 100%; min-height: 42px; padding: 9px 11px; }
.form-grid select[multiple] { min-height: 140px; }
.form-grid label small { font-weight: 400; line-height: 1.5; }
.settings-grid { align-items: start; }
.full-span { grid-column: 1 / -1; }
.details { margin: 0; }
.details > div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-top: 1px solid var(--border); }
.details > div:first-child { border-top: 0; }
.details dt { color: var(--muted); font-size: 12px; }
.details dd { margin: 0; text-align: right; }
.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.toggle-row div { display: grid; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle { position: relative; width: 36px; height: 21px; border-radius: 999px; background: #373b42; transition: .2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #afb3b9; transition: .2s; }
.toggle-row input:checked + .toggle { background: var(--text); }
.toggle-row input:checked + .toggle::after { transform: translateX(15px); background: #1a1b1e; }
.editor-panel { padding: 22px; }
.script-toolbar { align-items: center; flex-wrap: wrap; gap: 10px; margin: 18px 0 12px; }
.script-toolbar > label { color: var(--soft); font-size: 10px; font-weight: 700; }
.script-toolbar .select-wrap { width: min(300px,100%); }
.script-toolbar select { height: 38px; padding-left: 11px; }
.script-toolbar code { color: var(--muted); }
.editor-frame { overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: #0a0b0d; }
.editor-chrome { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 13px; border-bottom: 1px solid var(--border); color: var(--muted); font: 10px "SFMono-Regular",Consolas,monospace; }
.editor-language { margin-left: auto; }
.editor-dots { display: flex; gap: 4px; }
.editor-dots i { width: 6px; height: 6px; border-radius: 50%; background: #555960; }
.code-editor { display: block; width: 100%; min-height: 450px; padding: 16px; resize: vertical; border: 0; border-radius: 0; background: #0a0b0d; color: #d9dce0; font: 12px/1.7 "SFMono-Regular",Consolas,monospace; }
.code-short { min-height: 90px; border: 1px solid var(--border); border-radius: 8px; }
.notice { margin: 14px 0 0; font-size: 11px; }
.build-result { margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 7px; background: #101712; color: #b9d9c2; font: 11px/1.5 "SFMono-Regular",Consolas,monospace; }

/* Loader preview */
.loader-studio-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(340px,.8fr); gap: 14px; align-items: start; }
.loader-config-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
.loader-config-form > label:nth-child(3), .loader-config-form > label:nth-child(4), .loader-form-actions { grid-column: 1 / -1; }
.loader-stage { display: grid; place-items: center; min-height: 405px; border: 1px solid var(--border); border-radius: 8px; background: #0b0c0e; }
.loader-window { --loader-accent: #bcbcbc; width: min(320px,calc(100% - 32px)); padding: 25px; border: 1px solid #363940; border-radius: 8px; background: #15171a; box-shadow: 0 18px 50px rgba(0,0,0,.3); text-align: center; }
.loader-preview-icon { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 13px; border: 1px solid #3d4148; border-radius: 8px; color: var(--loader-accent); font-size: 20px; font-weight: 700; }
.loader-preview-title { font-size: 17px; font-weight: 700; }
.loader-preview-caption, .loader-preview-invite { margin-top: 5px; color: #858991; font-size: 10px; }
.loader-preview-field { margin-top: 20px; padding: 10px; border: 1px solid #34373d; border-radius: 6px; color: #777c84; font-size: 11px; text-align: left; }
.loader-preview-button { margin-top: 14px; padding: 10px; border-radius: 6px; background: var(--loader-accent); color: #111214; font-size: 11px; font-weight: 700; }

/* Overlays */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.modal { width: min(470px,100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 24px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.45); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.secret-box { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #0d0f11; }
.secret-box code { flex: 1; overflow-wrap: anywhere; color: var(--text); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 80; max-width: min(380px,calc(100vw - 44px)); padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: #202329; color: var(--text); box-shadow: 0 12px 40px rgba(0,0,0,.35); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #714848; color: #efb1b1; }

@media (max-width: 1000px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .loader-studio-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar { grid-column: auto; grid-row: auto; position: fixed; left: 0; top: 0; width: min(280px,86vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 18px 0 55px rgba(0,0,0,.4); }
  .sidebar.open { transform: translateX(0); }
  .main { grid-column: auto; grid-row: auto; }
  .mobile-shade.open { position: fixed; inset: 0; z-index: 9; display: block; background: rgba(0,0,0,.65); }
  .mobile-open, .mobile-close { display: inline-flex; }
  .mobile-close { margin-left: auto; }
  .topbar { height: 62px; padding: 0 17px; }
  .topbar-title > span { display: none; }
  .top-actions .icon-text span { display: none; }
  .top-actions .icon-text { width: 38px; padding: 0; }
  .content-shell { padding: 24px 17px 36px; }
  .overview-hero { padding: 24px; }
  .hero-copy h1 { font-size: 34px; }
  .two-col, .loader-config-form { grid-template-columns: 1fr; }
  .loader-config-form > label, .loader-form-actions { grid-column: auto !important; }
  .full-span { grid-column: auto; }
  .panel-head { flex-wrap: wrap; }
  .action-wrap { width: 100%; }
  .site-footer { display: none; }
}
@media (max-width: 520px) {
  .login-wrap { padding: 16px; }
  .login-card { padding: 24px; }
  .metric-grid { grid-template-columns: 1fr; }
  .section-aside { display: none; }
  .panel { padding: 18px; }
  .table-panel { padding: 0; }
  .table-panel > .panel-head { padding: 18px; }
  .panel-tools, .search-field { width: 100%; }
  #topNewLicense span { display: none; }
  #topNewLicense { width: 38px; padding: 0; }
  .overview-hero { padding: 21px; }
  .hero-actions .button, .hero-actions .subtle-button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
