:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f5f5f7;
  background: #0d0f12;
  --panel: #15181d;
  --panel-2: #1b1f25;
  --border: #2a2f37;
  --muted: #9298a3;
  --text: #f5f5f7;
  --accent: #e9ecf1;
  --accent-text: #111318;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: #0d0f12; color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(430px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 24px; padding: 32px; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.brand { font-size: 24px; font-weight: 800; letter-spacing: -.04em; }
.brand span { font-weight: 500; color: var(--muted); }
.brand.compact { font-size: 20px; }
h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.02; letter-spacing: -.055em; margin: 34px 0 14px; }
h2, h3 { margin: 0; letter-spacing: -.03em; }
p { color: var(--muted); line-height: 1.55; }

.button { width: 100%; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); padding: 12px 16px; border-radius: 12px; font-weight: 650; }
.button:hover { filter: brightness(1.08); }
.button.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.button.ghost { background: transparent; margin-top: 10px; }
.button.small { width: auto; padding: 9px 13px; }
.text-button { border: 0; background: none; color: var(--muted); padding: 0; }

form { display: grid; gap: 10px; }
input, select { width: 100%; border: 1px solid var(--border); color: var(--text); background: #101318; border-radius: 12px; padding: 12px 14px; outline: none; }
input:focus, select:focus { border-color: #59616d; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.error { color: #ff8c8c; margin-bottom: 0; }

.product-shell { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--border); padding: 24px 18px; display: flex; flex-direction: column; background: #101216; }
nav { margin-top: 34px; display: grid; gap: 6px; }
.nav-item { text-align: left; border: 0; color: var(--muted); background: transparent; border-radius: 10px; padding: 10px 12px; }
.nav-item.active { color: var(--text); background: var(--panel-2); }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border); padding-top: 16px; display: grid; gap: 8px; overflow: hidden; }
#account-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--muted); }
main { padding: 34px clamp(20px, 5vw, 72px) 70px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.topbar p { margin: 4px 0 0; }
.notice { margin: -12px 0 24px; border: 1px solid var(--border); background: var(--panel); border-radius: 12px; padding: 12px 14px; }
.filters { display: grid; grid-template-columns: minmax(220px, 1fr) 180px 180px; gap: 10px; }
.summary { color: var(--muted); font-size: 14px; margin: 18px 0; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.library-card, .integration-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 18px; }
.library-card { min-height: 170px; display: flex; flex-direction: column; gap: 8px; }
.library-card .kind { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.library-card h3 { font-size: 19px; }
.library-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.pill { font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 5px 8px; }
.empty-state { border: 1px dashed var(--border); border-radius: 18px; padding: 42px; text-align: center; margin-top: 20px; }
.empty-state .button { width: auto; }
.section-intro { max-width: 680px; margin-bottom: 24px; }
.section-intro p { margin-bottom: 0; }
.integration-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.integration-card { display: grid; gap: 14px; }
.integration-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.integration-status { font-size: 12px; color: var(--muted); }
.integration-actions { display: flex; gap: 8px; }
.integration-actions .button { width: auto; }
.integration-actions .danger { color: #ff9c9c; }

@media (max-width: 760px) {
  .product-shell { display: block; }
  .sidebar { position: fixed; z-index: 20; bottom: 0; top: auto; height: auto; width: 100%; border-right: 0; border-top: 1px solid var(--border); padding: 10px 14px; flex-direction: row; align-items: center; }
  .sidebar .brand, .sidebar-footer { display: none; }
  nav { margin: 0; display: flex; width: 100%; }
  .nav-item { flex: 1; text-align: center; }
  main { padding: 24px 16px 92px; }
  .filters { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
}
