:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #637083;
  --line: #dfe5ee;
  --brand: #1769e0;
  --brand-dark: #0d4fad;
  --success: #16875f;
  --warning: #a15c00;
  --danger: #b42318;
  --shadow: 0 12px 36px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
table {
  font: inherit;
}

button {
  cursor: pointer;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px 1fr;
}

.sidebar {
  background: #101828;
  color: #f8fbff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #101828;
  font-weight: 800;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid rgba(223, 229, 238, 0.85);
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #aeb8c8;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  text-align: left;
  color: #cbd5e1;
  background: transparent;
}

.nav-item:hover,
.nav-item.active {
  background: #1d2939;
  color: #ffffff;
}

.sidebar-note {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 13px;
}

.sidebar-note code {
  color: #ffffff;
  white-space: normal;
  word-break: break-all;
}

.main-area {
  min-width: 0;
  padding: 28px;
}

.topbar,
.section-heading,
.panel-title,
.topbar-actions,
.filter-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.topbar-actions {
  display: grid;
  gap: 10px;
  justify-content: flex-end;
}

[hidden] {
  display: none !important;
}

.auth-actions,
.tool-actions {
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 10px;
}

.customer-auth-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.customer-auth-info span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-auth-info strong {
  display: block;
  margin-top: 4px;
  max-width: 230px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-button {
  min-height: 40px;
  padding-inline: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
  letter-spacing: 0;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.primary-button,
.ghost-button,
.filter,
.icon-button,
.amount-option {
  min-height: 38px;
  border-radius: 7px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.primary-button {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.ghost-button:hover,
.filter:hover,
.amount-option:hover,
.icon-button:hover {
  border-color: #b7c2d1;
}

.filter-row {
  gap: 8px;
}

.filter.active {
  border-color: var(--brand);
  color: var(--brand);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.onboarding-step {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.onboarding-step span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-bottom: 12px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef4ff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.onboarding-step strong,
.onboarding-step p {
  display: block;
}

.onboarding-step p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.bonus-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #b8d7ff;
  border-radius: 8px;
  background: #edf6ff;
}

.bonus-banner strong,
.bonus-banner span {
  display: block;
}

.bonus-banner span {
  margin-top: 4px;
  color: var(--muted);
}

.metric-card,
.panel,
.table-panel,
.plan-card,
.setup-flow article,
.model-recommendation {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 16px;
}

.metric-card span,
.metric-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 26px;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 16px;
}

.panel {
  padding: 18px;
}

.panel-title {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-title h3 {
  margin: 0;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
}

.usage-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  min-height: 180px;
  align-items: end;
}

.usage-bar {
  display: grid;
  gap: 8px;
  align-items: end;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.usage-bar span {
  display: block;
  min-height: 28px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #2c7be5, #83b6ff);
}

.top-model-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.top-model-item:last-child {
  border-bottom: 0;
}

.top-model-item div div {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.table-panel {
  overflow: auto;
}

.setup-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.setup-flow article {
  padding: 16px;
}

.setup-flow span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef4ff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.setup-flow strong,
.setup-flow p {
  display: block;
}

.setup-flow p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.model-recommendation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
}

.model-recommendation strong,
.model-recommendation p {
  display: block;
}

.model-recommendation p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  background: #f9fbfd;
  font-size: 13px;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.empty-cell,
.empty-state {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.empty-cell {
  padding: 28px 16px;
}

.empty-state {
  display: grid;
  min-height: 120px;
  place-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef4ff;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.status-pill.success {
  background: #e8f7f0;
  color: var(--success);
}

.status-pill.warning {
  background: #fff3dc;
  color: var(--warning);
}

.status-pill.danger {
  background: #ffe8e6;
  color: var(--danger);
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.tool-header strong {
  font-size: 18px;
}

.tool-header span {
  border-radius: 999px;
  padding: 5px 9px;
  background: #f0f4f8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tool-card dl {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px 12px;
  margin: 0;
}

.tool-card dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tool-card dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}

.tool-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.plan-card {
  padding: 18px;
}

.plan-card.highlighted {
  border-color: #7bb5ff;
  box-shadow: 0 16px 44px rgba(23, 105, 224, 0.14);
}

.plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.plan-header strong {
  color: var(--brand);
  font-size: 22px;
  white-space: nowrap;
}

.plan-card p {
  color: var(--muted);
  line-height: 1.6;
}

.plan-card ul {
  margin: 16px 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.9;
}

.plan-action {
  width: 100%;
}

.code-line,
pre {
  display: block;
  width: 100%;
  overflow: auto;
  border-radius: 8px;
  background: #101828;
  color: #f8fbff;
}

.code-line {
  padding: 12px;
  word-break: break-all;
}

pre {
  margin: 0;
  padding: 16px;
  line-height: 1.55;
}

.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.faq-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.faq-item h3 {
  margin-bottom: 8px;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 24, 40, 0.48);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(520px, 100%);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.24);
  padding: 22px;
}

.large-modal {
  width: min(760px, 100%);
}

.modal-header,
.modal-actions,
.payment-options {
  display: flex;
  align-items: center;
}

.modal-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin-bottom: 0;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: #ffffff;
  font-size: 22px;
  line-height: 1;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.amount-option {
  min-height: 44px;
  background: #ffffff;
  font-weight: 800;
}

.amount-option.active {
  border-color: var(--brand);
  color: var(--brand);
  background: #eef4ff;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.amount-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
}

.stacked-label {
  margin-top: 12px;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.wizard-steps span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.wizard-steps .active {
  border-color: var(--brand);
  background: #eef4ff;
  color: var(--brand);
}

.model-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.model-choice {
  min-height: 152px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.model-choice.active {
  border-color: var(--brand);
  background: #eef4ff;
}

.model-choice input {
  margin: 0 0 12px;
}

.model-choice span,
.model-choice strong,
.model-choice em {
  display: block;
}

.model-choice strong {
  word-break: break-word;
}

.model-choice em {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.55;
}

.disabled-choice {
  cursor: not-allowed;
  opacity: 0.62;
}

.config-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.config-preview div {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.config-preview span,
.config-preview strong {
  display: block;
}

.config-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.config-preview strong {
  margin-top: 8px;
  word-break: break-word;
}

.mono-input {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.payment-section {
  margin-top: 16px;
}

.payment-options {
  gap: 10px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  font-weight: 700;
}

.modal-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.strong-note {
  margin: 0 0 16px;
  color: var(--ink);
  background: #edf6ff;
  border: 1px solid #b8d7ff;
  border-radius: 8px;
  padding: 12px;
}

.modal-feedback {
  min-height: 22px;
  margin-top: 12px;
  color: var(--success);
  font-weight: 700;
}

.modal-feedback.error {
  color: var(--danger);
}

.modal-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .main-area {
    padding: 20px;
  }

  .metric-grid,
  .onboarding-steps,
  .panel-grid,
  .docs-layout,
  .plan-grid,
  .tool-grid,
  .setup-flow,
  .model-choice-grid,
  .config-preview {
    grid-template-columns: 1fr;
  }

  .model-recommendation {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .topbar,
  .section-heading,
  .modal-actions,
  .payment-options {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-list {
    grid-template-columns: 1fr 1fr;
  }

  .bonus-banner {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 24px;
  }

  .amount-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tool-card dl {
    grid-template-columns: 1fr;
  }

  .copy-field {
    grid-template-columns: 1fr;
  }

}
