:root {
  color-scheme: dark;
  --bg: #09090a;
  --sidebar: #1f2022;
  --surface: #292a2c;
  --surface-2: #1b1c1e;
  --line: #3b3d42;
  --text: #f7f7f8;
  --muted: #9ba2b2;
  --muted-2: #6f7789;
  --blue: #6a68ff;
  --blue-soft: #8886ff;
  --green: #2fd071;
  --red: #ff6d72;
  --orange: #ffb657;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); overflow-x: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; height: 100vh; display: grid; grid-template-columns: 280px 1fr; grid-template-rows: 80px 1fr; overflow: hidden; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; min-width: 0; padding: 0 30px; background: #232426; border-bottom: 1px solid var(--line); overflow-x: auto; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 280px; font-size: 20px; font-weight: 800; letter-spacing: -.04em; }
.logo { width: 40px; height: 40px; display: grid; place-items: center; background: #070708; color: white; font-size: 12px; letter-spacing: -.08em; }
.topbar-spacer { flex: 1; }
.top-chip { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 14px; background: #1d1e20; border: 1px solid #303238; border-radius: 10px; color: #dfe2ec; font-size: 13px; white-space: nowrap; }
.top-chip strong { color: #fff; font-weight: 700; }
.top-chip .chip-icon { color: var(--blue-soft); font-size: 16px; }
.sign-out { border: 0; background: transparent; color: var(--muted); padding: 10px 0 10px 12px; }
.sidebar { grid-row: 2; display: flex; flex-direction: column; gap: 12px; height: calc(100vh - 80px); padding: 26px 20px 20px; background: var(--sidebar); position: sticky; top: 80px; overflow-y: auto; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border: 0; border-radius: 8px; background: transparent; color: #aab0bf; text-align: left; transition: .18s ease; }
.nav-item:hover, .nav-item.active { background: #2c2d30; color: #fff; }
.nav-item.active .nav-icon { color: var(--blue-soft); }
.nav-icon { width: 21px; color: #aeb5c4; font-size: 18px; text-align: center; }
.help-card { margin-top: auto; padding: 18px 15px; background: #292a2c; border-radius: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.help-card strong { display: block; color: #fff; margin-top: 2px; font-size: 12px; }
.main { grid-column: 2; grid-row: 2; min-width: 0; height: calc(100vh - 80px); padding: 46px 44px 70px; overflow-x: hidden; overflow-y: auto; }
.view { display: none; max-width: 1420px; min-width: 0; margin: 0 auto; }
.view.active { display: block; }
.eyebrow { color: var(--blue-soft); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .11em; }
h1 { margin: 7px 0 7px; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.06; letter-spacing: -.055em; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
h3 { margin: 0; font-size: 16px; }
.lede { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.header-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.header-actions { display: flex; gap: 10px; }
.btn { border: 1px solid var(--line); border-radius: 8px; padding: 11px 16px; background: var(--surface); color: var(--text); font-weight: 700; }
.btn:hover { border-color: var(--blue-soft); }
.btn.primary { border-color: transparent; background: var(--blue); color: white; }
.btn.primary:hover { background: #7977ff; }
.btn.ghost { background: transparent; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card, .panel { background: var(--surface); border: 1px solid transparent; border-radius: 12px; }
.stat-card { padding: 20px 21px; min-height: 126px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { display: block; margin-top: 15px; font-size: 31px; letter-spacing: -.055em; font-weight: 800; }
.stat-foot { color: var(--green); font-size: 12px; margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); gap: 16px; }
.grid-2 > *, .form-layout > *, .pack-grid > *, .feature-grid > * { min-width: 0; }
.panel { min-width: 0; padding: 25px; margin-bottom: 16px; }
.panel-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 22px; }
.panel-title small { color: var(--muted); font-size: 12px; }
.sparkline { width: 100%; height: 212px; }
.chart-grid { stroke: #42444a; stroke-width: 1; }
.chart-label { fill: var(--muted-2); font-size: 4.5px; }
.chart-line { fill: none; stroke: var(--blue-soft); stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: var(--blue-soft); }
.status-row, .activity-row, .key-row, .member-row { display: flex; align-items: center; gap: 13px; padding: 15px 0; border-top: 1px solid var(--line); }
.status-row:first-of-type, .activity-row:first-of-type, .key-row:first-of-type, .member-row:first-of-type { border-top: 0; padding-top: 0; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #2fd0711c; }
.status-dot.warn { background: var(--orange); box-shadow: 0 0 0 4px #ffb6571c; }
.row-main { flex: 1; min-width: 0; }
.row-main strong { display: block; font-size: 14px; }
.row-main span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 9px; background: #36383c; color: var(--muted); font-size: 11px; font-weight: 700; }
.badge.green { background: #163d29; color: var(--green); }
.badge.red { background: #4b2428; color: var(--red); }
.badge.blue { background: #27255b; color: var(--blue-soft); }
.notice { display: flex; align-items: start; gap: 12px; margin-bottom: 20px; padding: 15px 17px; border: 1px solid #4945a5; background: #161534; border-radius: 10px; color: #c9c8ff; font-size: 13px; line-height: 1.45; }
.notice strong { display: block; color: white; margin-bottom: 3px; }
.form-layout { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.35fr); gap: 16px; align-items: start; }
.form-stack { display: grid; gap: 14px; }
.field label { display: block; margin-bottom: 7px; color: #d4d7df; font-size: 12px; font-weight: 700; }
.field input, .field select { width: 100%; border: 1px solid #4b4e55; border-radius: 7px; padding: 12px 13px; background: #202123; color: #f6f6f8; outline: none; }
.field input:focus, .field select:focus { border-color: var(--blue-soft); box-shadow: 0 0 0 3px #6a68ff33; }
.field .hint { display: block; color: var(--muted-2); font-size: 11px; margin-top: 6px; }
.code-panel { min-height: 414px; overflow: hidden; }
.code-tabs { display: flex; gap: 4px; padding: 5px; background: #1f2022; border-radius: 8px; margin-bottom: 14px; }
.code-tab { flex: 1; border: 0; padding: 10px; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 700; }
.code-tab.active { background: #eeeef0; color: #151518; }
pre { margin: 0; min-height: 267px; padding: 20px; border-radius: 8px; background: #171719; color: #e7d0ff; overflow: auto; font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.code-toolbar { display: flex; justify-content: end; gap: 8px; margin-bottom: 10px; }
.mini-btn { border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: transparent; color: var(--muted); font-size: 12px; }
.response-box { min-height: 250px; background: #171719; border-radius: 8px; padding: 18px; overflow: auto; }
.response-box pre { min-height: 0; padding: 0; background: transparent; }
.response-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 740px; }
th, td { padding: 15px 13px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
td { color: #d9dce5; font-size: 13px; }
td code { color: #ddd9ff; background: #1b1b1e; padding: 4px 7px; border-radius: 5px; font-size: 11px; }
.request-row, .usage-row { cursor: pointer; transition: background .16s ease; }
.request-row:hover, .request-row:focus-visible, .usage-row:hover, .usage-row:focus-visible { background: #32343a; outline: none; }
.request-row:focus-visible, .usage-row:focus-visible { box-shadow: inset 3px 0 0 var(--blue-soft); }
.time-cell { white-space: normal; min-width: 86px; }
.time-day, .time-clock { display: block; }
.time-day { color: #d9dce5; font-size: 12px; }
.time-clock { margin-top: 3px; color: var(--muted-2); font-size: 11px; }
.table-hint { margin: 13px 0 0; color: var(--muted-2); font-size: 11px; }
.chart-wrap { position: relative; }
.chart-summary { display: flex; justify-content: space-between; gap: 12px; margin-top: -2px; color: var(--muted-2); font-size: 11px; }
.chart-empty { display: grid; min-height: 212px; place-items: center; color: var(--muted-2); font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.toolbar input, .toolbar select { min-width: 160px; border: 1px solid var(--line); border-radius: 7px; background: #202123; color: var(--text); padding: 11px 12px; }
.key-row { padding: 19px 0; }
.key-icon, .feature-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border-radius: 8px; background: #27255b; color: var(--blue-soft); }
.key-actions { display: flex; gap: 8px; }
.pack-grid, .feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pack, .feature { padding: 21px; border: 1px solid var(--line); border-radius: 10px; background: #242527; }
.pack h3 { font-size: 18px; }
.price { margin: 13px 0 15px; font-size: 31px; font-weight: 800; letter-spacing: -.05em; }
.price small { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.pack p, .feature p { color: var(--muted); font-size: 13px; line-height: 1.5; min-height: 40px; }
.pack .btn { width: 100%; margin-top: 12px; }
.feature { display: flex; gap: 13px; align-items: start; }
.feature h3 { margin-bottom: 5px; }
.feature p { margin: 0; min-height: 0; }
.doc-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 30px; }
.doc-nav { display: grid; gap: 6px; align-content: start; }
.doc-nav button { border: 0; border-radius: 7px; padding: 10px 12px; background: transparent; color: var(--muted); text-align: left; }
.doc-nav button.active, .doc-nav button:hover { background: #123226; color: #4fe29a; }
.doc-content { max-width: 880px; }
.doc-content h2 { font-size: 31px; margin-bottom: 15px; }
.doc-content h3 { margin: 28px 0 11px; font-size: 19px; }
.doc-content p { color: var(--muted); line-height: 1.7; }
.doc-content pre { min-height: 0; margin-top: 12px; color: #c4f2dd; }
.inline-code { color: #b8b6ff; background: #1c1b3c; border-radius: 4px; padding: 3px 6px; font: 12px ui-monospace, monospace; }
.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; padding: 12px 15px; background: #e9e9ee; color: #16161a; border-radius: 8px; box-shadow: 0 12px 30px #0007; font-size: 13px; font-weight: 700; transform: translateY(30px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: #050507b8; backdrop-filter: blur(5px); }
.detail-modal { width: min(560px, 100%); padding: 25px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 25px 80px #000a; }
.detail-modal:focus { outline: none; }
.detail-modal .panel-title { margin-bottom: 22px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--line); }
.detail-grid > div { min-height: 72px; padding: 14px; background: var(--surface-2); }
.detail-grid > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.detail-grid span { display: block; color: var(--muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.detail-grid strong { display: block; margin-top: 8px; color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.detail-hint { margin: 18px 0 0; color: var(--muted-2); font-size: 11px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0%, #24215b 0, var(--bg) 48%); }
.login-card { width: min(430px, 100%); padding: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 70px #0008; }
.login-brand { margin-bottom: 48px; }
.login-card h1 { margin-bottom: 10px; }
.login-card .lede { margin-bottom: 28px; }
.login-card .field { margin-bottom: 17px; }
.login-card form .btn { width: 100%; margin-top: 8px; }
.login-error { min-height: 20px; margin-top: 14px; color: var(--red); font-size: 13px; }
.login-note { margin: 22px 0 0; color: var(--muted-2); font-size: 11px; line-height: 1.5; }
.modal-form { display: grid; gap: 14px; }
.modal-form .btn { width: 100%; }
.modal-actions { display: flex; justify-content: end; gap: 9px; margin-top: 4px; }
.secret-box { display: flex; align-items: center; gap: 10px; padding: 12px; margin: 16px 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.secret-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.doc-nav button { cursor: pointer; }
.integration-card { display: flex; align-items: center; gap: 14px; padding: 17px 0; border-top: 1px solid var(--line); }
.integration-card:first-of-type { border-top: 0; padding-top: 0; }
.integration-card .row-main { flex: 1; }
.integration-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }
.status-copy { color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 230px 1fr; }
  .brand { min-width: 230px; }
  .top-chip.email { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .form-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .topbar { gap: 9px; padding: 0 16px; }
  .brand { min-width: 210px; }
  .topbar .team, .topbar .email { display: none; }
  .top-chip { padding: 0 9px; font-size: 11px; }
  .request-table table { min-width: 0; }
  .request-table th, .request-table td { padding: 12px 8px; }
  .request-table th:nth-child(5), .request-table td:nth-child(5), .request-table th:nth-child(6), .request-table td:nth-child(6), .request-table th:nth-child(7), .request-table td:nth-child(7) { display: none; }
}
@media (max-width: 760px) {
  .app-shell { display: block; height: auto; }
  .topbar { position: sticky; top: 0; z-index: 5; height: 66px; padding: 0 16px; }
  .brand { min-width: 0; font-size: 17px; }
  .logo { width: 34px; height: 34px; }
  .topbar .team, .topbar .email, .sign-out { display: none; }
  .sidebar { position: static; height: auto; overflow: visible; padding: 8px 10px; }
  .sidebar nav { grid-template-columns: repeat(4, 1fr); gap: 3px; }
  .nav-item { justify-content: center; padding: 10px 4px; font-size: 10px; flex-direction: column; gap: 4px; text-align: center; }
  .nav-icon { width: auto; font-size: 16px; }
  .help-card { display: none; }
  .main { height: auto; padding: 28px 16px 50px; overflow: visible; }
  .header-row { display: block; margin-bottom: 23px; }
  .header-actions { margin-top: 16px; }
  .stats, .pack-grid, .feature-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 100px; }
  .stat-value { margin-top: 10px; }
  .panel { padding: 18px; }
  .doc-layout { grid-template-columns: 1fr; gap: 16px; }
  .doc-nav { display: flex; overflow-x: auto; }
  .doc-nav button { white-space: nowrap; }
}
@media (max-width: 520px) {
  .detail-grid { grid-template-columns: 1fr; }
  .top-chip { display: none; }
  .topbar .sign-out { display: block; margin-left: auto; }
}
