:root {
  color-scheme: dark;
  --bg: #050505;
  --bg-elevated: #0b0b0c;
  --surface: rgba(18, 18, 19, 0.78);
  --surface-2: rgba(28, 28, 30, 0.74);
  --surface-hover: rgba(255, 255, 255, 0.065);
  --border: rgba(255, 255, 255, 0.075);
  --border-light: rgba(255, 255, 255, 0.145);
  --text: #f5f5f7;
  --text-dim: #a1a1a6;
  --text-faint: #66666b;
  --accent: #f5f5f7;
  --accent-soft: rgba(255, 255, 255, 0.095);
  --danger: #f5f5f7;
  --danger-soft: rgba(255, 255, 255, 0.075);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --sidebar-w: 236px;
  --topbar-h: 48px;
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2ee;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-2: rgba(239, 239, 235, 0.96);
  --surface-hover: rgba(0, 0, 0, 0.06);
  --border: rgba(0, 0, 0, 0.13);
  --border-light: rgba(0, 0, 0, 0.20);
  --text: #151515;
  --text-dim: #626267;
  --text-faint: #94949a;
  --accent: #151515;
  --accent-soft: rgba(0, 0, 0, 0.055);
  --danger: #2f2f33;
  --danger-soft: rgba(0, 0, 0, 0.055);
  --shadow: 0 18px 46px rgba(34, 34, 30, 0.11);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { min-height: 100%; background: #030303; }
html[data-theme="light"] { background: #f2f2ee; }
body {
  min-height: 100vh; min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at 50% -10%, rgba(255,255,255,.055), transparent 32%), linear-gradient(180deg, #080808 0%, #050505 46%, #030303 100%);
  color: var(--text); line-height: 1.55; font-size: 14px;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
html[data-theme="light"] body { background: linear-gradient(180deg, #f7f7f4 0%, #f2f2ee 100%); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--text); }
.muted { color: var(--text-dim); }
.logo-mark { display: block; width: 26px; height: 26px; object-fit: contain; }
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(380px, 100%); padding: 44px 40px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(24px) saturate(1.4);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.login-logo { width: 54px; height: 54px; display: grid; place-items: center; }
.login-logo .logo-mark { width: 54px; height: 54px; }
.login-card h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.login-copy, .login-hint { color: var(--text-dim); font-size: 13px; line-height: 1.55; }
.login-hint { color: var(--text-faint); margin-top: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 15px;
  background: var(--surface-2); color: var(--text); cursor: pointer; white-space: nowrap;
  font-size: 13px; font-weight: 600; transition: all var(--transition);
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-light); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--bg); }
.btn.block { width: 100%; }
.btn svg, .ui-icon { width: 17px; height: 17px; flex-shrink: 0; }
.icon-btn {
  width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 12px;
  display: inline-grid; place-items: center; background: transparent; color: var(--text-dim); cursor: pointer;
  transition: all var(--transition);
}
.icon-btn:hover { color: var(--text); background: var(--surface-hover); border-color: var(--border-light); }
.app-shell { min-height: 100vh; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 300; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
  background: rgba(8,8,10,.76); border-bottom: 1px solid var(--border); backdrop-filter: blur(26px) saturate(1.45);
}
html[data-theme="light"] .topbar { background: rgba(255,255,255,.82); }
.topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-brand strong { display: block; font-size: 13px; font-weight: 700; line-height: 1.05; }
.topbar-brand small { display: block; color: var(--text-dim); font-size: 10px; margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: 12px; }
.live-pill span { width: 7px; height: 7px; border-radius: 999px; background: var(--text); box-shadow: 0 0 0 4px var(--accent-soft); }
.me { color: var(--text-dim); font-size: 12px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-body { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
  background: rgba(10,10,14,.72); backdrop-filter: blur(30px) saturate(1.5);
}
html[data-theme="light"] .sidebar { background: rgba(255,255,255,.76); }
.sidebar::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 1px; background: var(--border); }
.nav-section { padding: 14px 12px; }
.nav-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); padding: 0 10px 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; color: var(--text-dim); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--accent); color: var(--bg); }
.content { flex: 1; min-width: 0; padding: 28px; }
.content > section { max-width: 1120px; margin-inline: auto; }
.hero-panel {
  display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 18px;
  padding: 30px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--surface), rgba(255,255,255,.035)); box-shadow: var(--shadow); backdrop-filter: blur(24px) saturate(1.35);
}
.eyebrow { color: var(--text-faint); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.4px; margin-bottom: 8px; }
.hero-copy h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.05; letter-spacing: -0.045em; max-width: 760px; }
.hero-copy p { margin-top: 14px; color: var(--text-dim); max-width: 720px; font-size: 14px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.status-grid, .integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.status-card, .integration-card, .key-card, .panel {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(22px) saturate(1.3);
}
.status-card { padding: 18px; display: flex; align-items: center; gap: 14px; }
.status-icon, .modal-icon {
  width: 42px; height: 42px; border-radius: 14px; background: var(--accent-soft); color: var(--text); display: grid; place-items: center; flex-shrink: 0;
}
.status-card strong { display: block; font-size: 15px; margin: 2px 0; }
.status-card small, .card-label { display: block; color: var(--text-dim); font-size: 12px; }
.card-label { color: var(--text-faint); text-transform: uppercase; letter-spacing: .8px; font-weight: 800; }
.panel { padding: 22px; margin-bottom: 18px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; letter-spacing: -0.02em; }
.section-head p { color: var(--text-dim); font-size: 13px; max-width: 520px; text-align: right; }
.key-list { display: flex; flex-direction: column; gap: 10px; }
.key-card { padding: 17px 18px; display: flex; align-items: center; gap: 14px; box-shadow: none; transition: all var(--transition); }
.key-card:hover { border-color: var(--border-light); transform: translateY(-1px); }
.key-icon { width: 38px; height: 38px; border-radius: 13px; background: var(--accent-soft); display: grid; place-items: center; flex-shrink: 0; }
.key-body { flex: 1; min-width: 0; }
.key-label { font-weight: 700; font-size: 14px; }
.key-prefix { margin-top: 2px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--text-dim); }
.key-meta { color: var(--text-faint); font-size: 12px; margin-top: 4px; }
.key-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.badge { border: 1px solid var(--border); border-radius: 999px; padding: 3px 8px; color: var(--text-dim); font-size: 11px; font-weight: 700; }
.key-actions { display: flex; gap: 6px; }
.empty { color: var(--text-dim); text-align: center; padding: 42px 12px; border: 1px dashed var(--border); border-radius: var(--radius); }
.integration-card { padding: 18px; box-shadow: none; }
.integration-card h3 { font-size: 15px; display: flex; align-items: center; gap: 9px; }
.integration-card p { color: var(--text-dim); margin: 8px 0 14px; font-size: 13px; }
.code-sample { border: 1px solid var(--border); border-radius: 14px; background: rgba(0,0,0,.18); padding: 12px; color: var(--text-dim); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; overflow: auto; min-height: 54px; }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.modal { width: min(680px, 94vw); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-elevated); color: var(--text); padding: 24px; box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.modal::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(5px); }
.modal-title { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.modal-title h3 { font-size: 18px; letter-spacing: -0.02em; }
.modal-title p { color: var(--text-dim); font-size: 13px; margin-top: 3px; }
.field-label { display: block; color: var(--text-dim); font-size: 12px; margin-bottom: 6px; }
.modal input { width: 100%; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); color: var(--text); padding: 12px 13px; }
.modal input:focus { outline: none; border-color: var(--border-light); }
.modal-result { margin-top: 16px; }
.key-once { border: 1px dashed var(--border-light); border-radius: 16px; padding: 14px; background: var(--accent-soft); }
.key-once strong { display: block; margin-bottom: 7px; }
.secret-line { display: flex; gap: 8px; align-items: stretch; }
.secret-value { flex: 1; padding: 11px; border-radius: 12px; background: rgba(0,0,0,.2); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; word-break: break-all; }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.setup-card { border: 1px solid var(--border); border-radius: 16px; padding: 13px; background: var(--surface); }
.setup-card h4 { font-size: 13px; margin-bottom: 6px; }
.setup-card p { color: var(--text-dim); font-size: 12px; margin-bottom: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.confirm-target { border: 1px solid var(--border); border-radius: 14px; padding: 12px; color: var(--text-dim); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.toast { position: fixed; right: 18px; bottom: 18px; min-width: 140px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(8px); transition: all var(--transition); backdrop-filter: blur(18px); z-index: 1000; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 880px) { .sidebar { display: none; } .content { padding: 18px; } .hero-panel, .section-head { flex-direction: column; align-items: flex-start; } .section-head p { text-align: left; } .status-grid, .integration-grid, .setup-grid { grid-template-columns: 1fr; } .me { display: none; } }
@media (max-width: 560px) { .topbar { padding: 0 12px; } .topbar-brand small, .live-pill { display: none; } .btn { padding-inline: 12px; } .hero-panel { padding: 22px; } .panel { padding: 16px; } .secret-line { flex-direction: column; } }
