:root {
  --background: #020617;
  --surface: #0b1326;
  --surface-low: #0f172a;
  --surface-mid: #171f33;
  --surface-high: #1e293b;
  --surface-highest: #2d3449;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: #3e4850;
  --text: #dae2fd;
  --text-muted: #bec8d2;
  --text-dim: #88929b;
  --primary: #89ceff;
  --primary-strong: #0ea5e9;
  --primary-ink: #003751;
  --secondary: #c3c0ff;
  --secondary-strong: #3626ce;
  --success: #00af9d;
  --warning: #f59e0b;
  --danger: #ffb4ab;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.34);
  --sidebar-width: 280px;
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --content-width: 1280px;
  --font-headline: "Geist", "Inter", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", "Geist", "Microsoft YaHei", sans-serif;
  --font-code: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 14% 6%, rgba(14, 165, 233, 0.13), transparent 28rem),
    radial-gradient(circle at 86% 20%, rgba(0, 175, 157, 0.09), transparent 30rem),
    var(--background);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

code,
pre,
.metric-card strong,
.pill-row strong,
.code-md {
  font-family: var(--font-code);
}

h1,
h2,
h3,
h4,
.brand-copy strong,
.hero-copy h1,
.auth-aside-copy h1,
.pane-copy h2,
.console-header-copy h1,
.card-head h2,
.card-head h3,
.detail-card h2,
.list-card h2,
.feature-card h2,
.section-heading h2,
.loading-panel strong {
  font-family: var(--font-headline);
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-size: 22px;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 450, "GRAD" 0, "opsz" 24;
}

.hidden {
  display: none !important;
}

.glass-panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.text-gradient {
  background: linear-gradient(90deg, var(--primary), var(--success));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.button,
.auth-shell button,
.console-shell button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  color: #ffffff;
  background: var(--primary-strong);
  box-shadow: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.button:hover,
.auth-shell button:hover,
.console-shell button:hover {
  transform: translateY(-1px);
}

.button:active,
.auth-shell button:active,
.console-shell button:active {
  transform: translateY(0) scale(0.98);
}

.button.secondary,
.auth-shell button.secondary,
.console-shell button.secondary,
.button.ghost,
.auth-shell button.ghost,
.console-shell button.ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
}

.button.ghost:hover,
.auth-shell button.ghost:hover,
.console-shell button.ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(137, 206, 255, 0.38);
}

.button.danger,
.auth-shell button.danger,
.console-shell button.danger {
  color: var(--danger);
}

.eyebrow,
.card-kicker,
.feature-kicker,
.table-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  background: rgba(6, 14, 32, 0.68);
  padding: 11px 13px;
  outline: none;
}

textarea {
  min-height: 148px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(190, 200, 210, 0.48);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-strong);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: var(--primary-strong);
}

.brand-mark .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: "FILL" 1, "wght" 600, "GRAD" 0, "opsz" 24;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brand-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-copy span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-shell,
.auth-shell {
  width: min(calc(100vw - 32px), var(--content-width));
  margin: 0 auto;
}

.site-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-nav a:not(.button) {
  color: var(--text-muted);
  font-weight: 650;
}

.landing-main {
  display: grid;
  gap: 28px;
  padding: 32px 0 64px;
}

.hero-panel,
.feature-card,
.workflow-section,
.auth-aside,
.auth-card {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 28px;
  overflow: hidden;
  border-radius: 24px;
  padding: 34px;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 18px;
}

.hero-copy h1,
.auth-aside-copy h1 {
  max-width: 12ch;
  color: var(--text);
  font-size: clamp(46px, 5vw, 76px);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.hero-copy p,
.auth-aside-copy p,
.pane-copy p,
.loading-panel p,
.hero-microcopy {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.72;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-preview {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  background:
    radial-gradient(circle at 78% 10%, rgba(137, 206, 255, 0.18), transparent 15rem),
    var(--surface);
}

.preview-topbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 12px;
}

.preview-topbar span,
.preview-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
}

.preview-hero-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: var(--surface-low);
}

.preview-label,
.preview-grid article span,
.flow-grid article span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.preview-hero-card strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-code);
  font-size: 36px;
  letter-spacing: -0.04em;
}

.preview-hero-card p,
.preview-grid article p,
.feature-card p,
.audience-grid article p,
.flow-grid article p {
  margin-top: 9px;
  color: var(--text-muted);
  line-height: 1.62;
}

.preview-badge {
  color: var(--primary);
  white-space: nowrap;
}

.preview-grid,
.feature-band,
.audience-grid,
.flow-grid,
.overview-grid,
.usage-layout,
.billing-layout {
  display: grid;
  gap: 18px;
}

.preview-grid,
.feature-band,
.audience-grid,
.flow-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-grid article,
.audience-grid article,
.flow-grid article {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.preview-grid article strong,
.audience-grid article strong,
.flow-grid article strong {
  display: block;
  margin-top: 9px;
  color: var(--text);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.feature-card,
.workflow-section {
  border-radius: 20px;
  padding: 24px;
}

.feature-card h2,
.section-heading h2 {
  margin-top: 14px;
  max-width: 20ch;
  color: var(--text);
  font-size: 30px;
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.workflow-section {
  display: grid;
  gap: 20px;
}

.section-heading {
  display: grid;
  gap: 10px;
}

.auth-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.72fr);
  gap: 22px;
  align-items: stretch;
  padding: 24px 0;
}

.auth-aside,
.auth-card {
  border-radius: 24px;
  padding: 30px;
}

.auth-aside {
  display: grid;
  align-content: space-between;
  gap: 30px;
  background:
    radial-gradient(circle at 75% 18%, rgba(14, 165, 233, 0.22), transparent 20rem),
    rgba(15, 23, 42, 0.78);
}

.auth-aside-copy {
  display: grid;
  gap: 18px;
}

.auth-aside-notes {
  display: grid;
  gap: 12px;
}

.auth-aside-notes article,
.debug-card,
.flash-message {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.045);
}

.auth-aside-notes p {
  margin-top: 6px;
  color: var(--text-muted);
  line-height: 1.55;
}

.auth-card {
  display: grid;
  align-content: center;
  gap: 20px;
}

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

.auth-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  color: var(--text-muted);
  background: transparent;
  font-size: 13px;
}

.auth-tab.active {
  color: #ffffff;
  border-color: rgba(14, 165, 233, 0.58);
  background: var(--primary-strong);
}

.auth-pane,
.pane-copy,
.stack-form,
.stack-grid,
.field-stack {
  display: grid;
  gap: 14px;
}

.pane-copy h2 {
  color: var(--text);
  font-size: 30px;
  letter-spacing: -0.04em;
}

.stack-form label,
.field-stack label {
  display: grid;
  gap: 8px;
}

.stack-form span,
.field-stack span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-line {
  min-height: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.status-line.error,
.flash-message.error {
  color: var(--danger);
}

.status-line.success,
.flash-message.success {
  color: var(--success);
}

.debug-card code {
  display: block;
  margin-top: 10px;
  color: var(--primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.console-shell {
  min-height: 100dvh;
}

.console-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-mid);
  padding: 24px;
}

.console-sidebar-top {
  display: grid;
  gap: 22px;
}

.workspace-card,
.sidebar-summary,
.sidebar-user {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.workspace-card strong,
.sidebar-summary strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.workspace-card span:last-child,
.sidebar-summary span:last-child,
.sidebar-user span {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.console-nav {
  display: grid;
  gap: 8px;
}

.console-nav-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 650;
  transition:
    color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.console-nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.console-nav-link.active {
  color: var(--primary-ink);
  background: var(--primary-strong);
}

.console-nav-link.active .material-symbols-outlined {
  font-variation-settings: "FILL" 1, "wght" 600, "GRAD" 0, "opsz" 24;
}

.sidebar-summary {
  margin-top: auto;
}

.sidebar-user {
  display: grid;
  gap: 12px;
}

.sidebar-user strong {
  overflow-wrap: anywhere;
}

.sidebar-user .button {
  width: 100%;
}

.console-main {
  min-height: 100dvh;
  margin-left: var(--sidebar-width);
}

.console-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.82);
  padding: 0 32px;
  backdrop-filter: blur(16px);
}

.console-search {
  position: relative;
  width: min(380px, 48vw);
}

.console-search .material-symbols-outlined {
  position: absolute;
  left: 13px;
  top: 50%;
  color: var(--text-dim);
  transform: translateY(-50%);
}

.console-search input {
  min-height: 40px;
  padding-left: 42px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
}

.console-topnav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 650;
}

.console-topnav a:hover {
  color: var(--primary);
}

.console-header {
  display: flex;
  width: min(calc(100% - 64px), var(--content-width));
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 32px 0 24px;
}

.console-header-copy {
  display: grid;
  gap: 10px;
}

.console-header-copy h1 {
  color: var(--text);
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.console-header-copy p {
  max-width: 66ch;
  color: var(--text-muted);
  line-height: 1.6;
}

.console-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-chip {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.78);
  font-size: 14px;
}

.flash-message {
  width: min(calc(100% - 64px), var(--content-width));
  margin: 0 auto 16px;
}

.page-frame {
  width: min(calc(100% - 64px), var(--content-width));
  margin: 0 auto;
  padding-bottom: 64px;
}

.loading-panel,
.overview-grid > article,
.usage-layout > article,
.billing-layout > article,
.api-layout .list-card,
.api-layout .detail-card,
.page-frame > article {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(15, 23, 42, 0.82);
  box-shadow: var(--shadow);
}

.loading-panel {
  padding: 30px;
  text-align: center;
}

.loading-panel strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-grid > article,
.usage-layout > article,
.billing-layout > article,
.api-layout .list-card,
.api-layout .detail-card,
.page-frame > article {
  padding: 22px;
}

.metric-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
}

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

.metric-card,
.pill-row article,
.provider-list li,
.project-button {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.035);
}

.metric-card {
  padding: 18px;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 30px;
  letter-spacing: -0.045em;
}

.metric-card span:first-child {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-card span:last-child {
  display: block;
  margin-top: 8px;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.split-card,
.api-layout,
.usage-layout,
.billing-layout {
  display: grid;
  gap: 18px;
}

.split-card {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.api-layout {
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
}

.usage-layout {
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
}

.billing-layout {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
}

.chart-card,
.list-card,
.detail-card {
  display: grid;
  gap: 18px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.card-head h2,
.card-head h3,
.detail-card h2,
.list-card h2 {
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.card-head p,
.section-copy,
.detail-card p,
.list-card p,
.table-wrap td,
.provider-list li span,
.subject-list td,
.project-button span,
.ranking-row span {
  color: var(--text-muted);
  line-height: 1.55;
}

.chart-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-toggle button {
  min-height: 36px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.chart-toggle button.active {
  color: #ffffff;
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.chart-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(14, 165, 233, 0.1), rgba(14, 165, 233, 0)),
    rgba(6, 14, 32, 0.8);
  padding: 16px;
}

.chart-wrap svg path[stroke] {
  stroke: var(--primary-strong);
}

.chart-wrap svg circle {
  fill: var(--primary-strong);
}

.table-wrap,
.subject-list {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap th,
.subject-list th {
  padding: 0 0 12px;
  color: var(--text-muted);
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.table-wrap td,
.subject-list td {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.table-title {
  color: var(--text);
  font-weight: 700;
}

.provider-list,
.project-list,
.ranking-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.provider-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 15px;
  list-style: none;
}

.provider-list li strong,
.ranking-row strong {
  display: block;
  color: var(--text);
}

.empty-state {
  border: 1px dashed rgba(190, 200, 210, 0.25);
  border-radius: var(--radius-lg);
  padding: 26px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}

.project-button {
  display: grid;
  min-height: auto;
  width: 100%;
  justify-content: stretch;
  gap: 4px;
  padding: 16px;
  color: var(--text);
  text-align: left;
}

.project-button:hover {
  border-color: rgba(137, 206, 255, 0.34);
  background: rgba(255, 255, 255, 0.055);
}

.project-button.active {
  border-color: rgba(14, 165, 233, 0.64);
  background: rgba(14, 165, 233, 0.13);
}

.project-button strong {
  color: var(--text);
  font-size: 17px;
  letter-spacing: -0.025em;
}

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

.pill-row article {
  padding: 14px;
}

.pill-row span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pill-row strong {
  display: block;
  margin-top: 9px;
  color: var(--text);
  font-size: 20px;
  letter-spacing: -0.035em;
}

.field-grid,
.pricing-grid {
  display: grid;
  gap: 12px;
}

.field-grid,
.pricing-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.code-block {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text);
  background: #000000;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ranking-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.ranking-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.subject-list-wrap {
  overflow-x: auto;
}

/* Project workbench translated from the Stitch export, backed by the live console APIs. */
.project-workbench {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 640px;
  overflow: hidden;
  border: 1px solid rgba(141, 160, 195, 0.18);
  border-radius: 18px;
  background: #0d1426;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.project-pane {
  min-height: 100%;
  border-right: 1px solid rgba(141, 160, 195, 0.16);
  background: #0b1221;
  padding: 20px 14px;
}

.project-pane-heading,
.project-detail-header,
.stitch-section-head,
.gateway-token-card,
.panel-title,
.credit-adjustment-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.project-pane h2,
.project-detail h1,
.stitch-section-head h2,
.panel-title h3,
.empty-project-header h1 {
  margin: 0;
  color: #f5f8ff;
  letter-spacing: -0.045em;
}

.project-pane h2 { font-size: 23px; }
.field-caption {
  display: block;
  color: #7d8aa2;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.project-new-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  color: #07111f;
  background: #58c5f4;
  font-size: 24px;
  line-height: 1;
}

.project-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 14px;
  border: 1px solid rgba(141, 160, 195, 0.22);
  border-radius: 9px;
  background: #101a2d;
  padding: 0 10px;
}

.project-search .material-symbols-outlined { color: #77849a; font-size: 19px; }
.project-search input {
  width: 100%;
  min-height: 38px;
  border: 0;
  outline: 0;
  color: #eaf1ff;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.project-pane-list { display: grid; gap: 7px; }
.project-pane-item {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #dce7fa;
  background: transparent;
  padding: 9px;
  text-align: left;
}
.project-pane-item:hover { background: rgba(255, 255, 255, 0.05); }
.project-pane-item.active { border-color: rgba(83, 195, 240, 0.35); background: rgba(40, 161, 217, 0.15); }
.project-pane-item > span:last-child { display: grid; gap: 3px; min-width: 0; }
.project-pane-item strong { overflow: hidden; color: #f4f8ff; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.project-pane-item small { overflow: hidden; color: #8090a9; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.project-pane-mark,
.project-identity-mark,
.account-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #091426;
  background: linear-gradient(135deg, #7adeff, #4c86ff);
  font-weight: 800;
}
.project-pane-mark { width: 34px; height: 34px; font-size: 13px; }
.project-pane-empty {
  border: 1px dashed rgba(141, 160, 195, 0.24);
  border-radius: 10px;
  color: #8190a8;
  font-size: 13px;
  line-height: 1.55;
  padding: 18px;
}

.project-detail { min-width: 0; padding: 30px 34px 36px; }
.project-detail-header { align-items: flex-start; padding-bottom: 25px; }
.project-identity { display: flex; align-items: center; gap: 14px; }
.project-identity-mark { width: 48px; height: 48px; border-radius: 12px; font-size: 18px; }
.project-identity h1 { margin-top: 2px; font-size: clamp(26px, 3vw, 34px); }
.project-identity p,
.stitch-section-head p,
.empty-project-header p,
.model-default-note p { margin: 7px 0 0; color: #8998ae; line-height: 1.55; }
.project-status { display: flex; align-items: center; gap: 6px; color: #7e8da5; font-size: 12px; text-transform: capitalize; }
.project-status i { width: 7px; height: 7px; border-radius: 999px; background: #6f7b90; }
.project-status i.online { background: #42d39a; box-shadow: 0 0 0 3px rgba(66, 211, 154, 0.12); }

.project-detail-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid rgba(141, 160, 195, 0.17);
  overflow-x: auto;
}
.project-detail-tab {
  min-height: 47px;
  flex: 0 0 auto;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #8492a7;
  background: transparent;
  padding: 0 2px;
  font-size: 14px;
  font-weight: 650;
}
.project-detail-tab.active { border-bottom-color: #52c3f2; color: #eef7ff; }
.project-tab-body { padding-top: 28px; }
.stitch-section-head { align-items: flex-start; margin-bottom: 22px; }
.stitch-section-head h2 { font-size: 24px; }
.stitch-form { display: grid; gap: 17px; max-width: 860px; }
.stitch-form label { display: grid; gap: 8px; color: #b7c3d4; font-size: 13px; font-weight: 650; }
.stitch-form label > span em { margin-left: 5px; color: #77869f; font-size: 11px; font-style: normal; font-weight: 500; }
.stitch-form input,
.stitch-form select,
.credit-adjustment-form input,
.credit-adjustment-form select {
  width: 100%;
  min-height: 43px;
  border: 1px solid rgba(141, 160, 195, 0.25);
  border-radius: 8px;
  color: #edf5ff;
  background: #111c30;
  padding: 9px 11px;
}
.stitch-form input:focus,
.stitch-form select:focus,
.credit-adjustment-form input:focus,
.credit-adjustment-form select:focus { border-color: #55c4f4; box-shadow: 0 0 0 3px rgba(85, 196, 244, 0.13); }
.stitch-form small { color: #7d8ba2; font-size: 12px; line-height: 1.5; }
.stitch-form-row,
.stitch-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stitch-form-actions { display: flex; justify-content: flex-end; padding-top: 4px; }
.protocol-fields { display: grid; gap: 13px; border: 1px solid rgba(141, 160, 195, 0.2); border-radius: 10px; padding: 15px; }
.protocol-fields:disabled { opacity: 0.48; }
.protocol-fields legend { color: #9aabc3; font-size: 13px; font-weight: 700; padding: 0 6px; }
.model-default-note { border-left: 3px solid #4abff1; border-radius: 0 8px 8px 0; background: rgba(51, 153, 217, 0.09); padding: 14px 16px; }
.model-default-note strong { color: #e9f6ff; }

.gateway-token-card,
.stitch-panel,
.project-summary-strip,
.credit-adjustment-form {
  border: 1px solid rgba(141, 160, 195, 0.19);
  border-radius: 12px;
  background: #101a2c;
}
.gateway-token-card { align-items: flex-start; margin-bottom: 18px; padding: 18px; }
.gateway-token-card code { display: block; overflow: hidden; max-width: 620px; margin: 7px 0; color: #8ddcff; font-family: var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.gateway-token-card small { color: #8492a7; font-size: 12px; }
.stitch-panel { min-width: 0; padding: 18px; }
.panel-title { align-items: flex-start; margin-bottom: 14px; }
.panel-title h3 { margin-top: 4px; font-size: 18px; }
.text-button { min-height: auto; border: 0; color: #6fd1f8; background: transparent; padding: 0; font-size: 13px; font-weight: 700; }
.account-preview-list { display: grid; }
.account-preview-list > div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border-top: 1px solid rgba(141, 160, 195, 0.14); padding: 11px 0; }
.account-preview-list > div:first-child { border-top: 0; padding-top: 0; }
.account-preview-list > div > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.account-avatar { width: 29px; height: 29px; border-radius: 50%; font-size: 12px; }
.account-preview-list strong { overflow: hidden; color: #eaf3ff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-preview-list small { color: #7f8ea5; font-size: 11px; }
.account-preview-list b { color: #c5d9ef; font-size: 13px; }
.project-summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.project-summary-strip span { display: grid; gap: 5px; border-right: 1px solid rgba(141, 160, 195, 0.16); color: #8291a8; font-size: 12px; padding: 14px 16px; }
.project-summary-strip span:last-child { border-right: 0; }
.project-summary-strip b { color: #f0f6ff; font-size: 18px; }
.customer-table-wrap { overflow-x: auto; border: 1px solid rgba(141, 160, 195, 0.19); border-radius: 12px; }
.customer-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.customer-table th { color: #7f8fa6; font-size: 11px; letter-spacing: 0.06em; text-align: left; text-transform: uppercase; padding: 13px 16px; }
.customer-table td { border-top: 1px solid rgba(141, 160, 195, 0.14); color: #d2dfef; font-size: 13px; padding: 15px 16px; }
.customer-table td strong,
.customer-table td small { display: block; }
.customer-table td strong { color: #edf6ff; }
.customer-table td small { margin-top: 3px; color: #7f8fa6; font-size: 11px; }
.credit-adjustment-form { display: grid; grid-template-columns: 1.2fr 1fr 0.75fr auto; align-items: end; gap: 10px; margin-top: 16px; padding: 14px; }
.credit-adjustment-form strong { align-self: center; color: #e9f5ff; font-size: 14px; }
.empty-project-header { max-width: 620px; margin-bottom: 28px; }
.empty-project-header h1 { margin-top: 8px; font-size: 34px; }

@media (max-width: 960px) {
  .project-workbench { grid-template-columns: 1fr; }
  .project-pane { min-height: auto; border-right: 0; border-bottom: 1px solid rgba(141, 160, 195, 0.16); }
  .project-pane-list { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}

@media (max-width: 680px) {
  .project-detail { padding: 24px 18px; }
  .project-detail-header, .gateway-token-card { flex-direction: column; }
  .stitch-form-row, .stitch-two-column, .project-summary-strip, .credit-adjustment-form { grid-template-columns: 1fr; }
  .project-summary-strip span { border-right: 0; border-bottom: 1px solid rgba(141, 160, 195, 0.16); }
  .project-summary-strip span:last-child { border-bottom: 0; }
}

/* Stitch workspace overview: source-matched application shell and dashboard rhythm. */
body[data-route-kind="app"] {
  --text: #dae2fd;
  --text-muted: #bec8d2;
  --line: #3e4850;
  --primary-strong: #0ea5e9;
  --success: #3cddc7;
  background: #020617;
  color: #dae2fd;
}
body[data-route-kind="app"] .console-shell { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); background: #020617; }
body[data-route-kind="app"] .console-sidebar { position: sticky; top: 0; height: 100vh; width: auto; border-right: 1px solid #3e4850; border-radius: 0; background: #171f33; box-shadow: none; padding: 24px; }
body[data-route-kind="app"] .console-sidebar-top { display: flex; min-height: 0; flex-direction: column; gap: 26px; }
body[data-route-kind="app"] .console-sidebar .brand,
body[data-route-kind="app"] .sidebar-summary { display: none; }
body[data-route-kind="app"] .workspace-card { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0; }
body[data-route-kind="app"] .workspace-initial { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 4px; color: #ffffff; background: #0ea5e9; font: 700 14px var(--font-headline); }
body[data-route-kind="app"] .workspace-title-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
body[data-route-kind="app"] .workspace-title-row strong { overflow: hidden; color: #dae2fd; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
body[data-route-kind="app"] .workspace-title-row span { border: 1px solid #3e4850; border-radius: 4px; color: #bec8d2; font-size: 9px; font-weight: 700; letter-spacing: .06em; padding: 2px 5px; text-transform: uppercase; }
body[data-route-kind="app"] .workspace-card > div > span { display: block; overflow: hidden; margin-top: 2px; color: #bec8d2; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
body[data-route-kind="app"] .workspace-expand { color: #bec8d2; font-size: 18px; }
body[data-route-kind="app"] .console-nav { display: grid; gap: 4px; }
body[data-route-kind="app"] .console-nav-link { min-height: 40px; border-radius: 8px; color: #bec8d2; padding: 8px 12px; font-weight: 500; }
body[data-route-kind="app"] .console-nav-link:hover { color: #dae2fd; background: #2d3449; }
body[data-route-kind="app"] .console-nav-link.active { color: #b3b1ff; background: #3626ce; }
body[data-route-kind="app"] .console-nav-link .material-symbols-outlined { font-size: 20px; }
body[data-route-kind="app"] .sidebar-user { display: grid; grid-template-columns: 24px minmax(0, 1fr) 24px; align-items: center; gap: 10px; border-top: 1px solid rgba(62,72,80,.45); border-radius: 0; background: transparent; padding: 16px 8px 0; }
body[data-route-kind="app"] .user-avatar { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid #3e4850; border-radius: 50%; color: #bec8d2; background: #0b1326; font-size: 11px; }
body[data-route-kind="app"] .sidebar-user strong { overflow: hidden; color: #dae2fd; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
body[data-route-kind="app"] .sidebar-user .icon-button { min-height: 24px; width: 24px; border: 0; border-radius: 4px; color: #bec8d2; background: transparent; padding: 0; }
body[data-route-kind="app"] .sidebar-user .icon-button:hover { background: #2d3449; }
body[data-route-kind="app"] .console-main { min-width: 0; background: #020617; }
body[data-route-kind="app"] .console-topbar { position: sticky; top: 0; z-index: 10; height: 64px; min-height: 64px; justify-content: space-between; border-bottom: 1px solid rgba(62,72,80,.55); background: rgba(15,23,42,.88); box-shadow: none; padding: 0 24px; backdrop-filter: blur(12px); }
body[data-route-kind="app"] .console-breadcrumb { display: flex; align-items: center; gap: 8px; color: #bec8d2; font-size: 14px; }
body[data-route-kind="app"] .console-breadcrumb .material-symbols-outlined { color: #7c8799; font-size: 16px; }
body[data-route-kind="app"] .console-breadcrumb strong { color: #dae2fd; font-weight: 600; }
body[data-route-kind="app"] .console-topnav { display: block; color: #bec8d2; font-size: 12px; font-weight: 600; border: 1px solid rgba(62,72,80,.6); border-radius: 6px; background: rgba(45,52,73,.5); padding: 7px 12px; }
body[data-route-kind="app"] .console-header { display: none; }
body[data-route-kind="app"] .page-frame { width: min(100% - 64px, 1280px); margin: 0 auto; padding: 32px 0 48px; }
body[data-route-kind="app"] .flash-message { width: min(100% - 64px, 1280px); }

.stitch-overview { display: grid; gap: 24px; }
.stitch-overview > h1 { margin: 0; color: #dae2fd; font-size: 32px; letter-spacing: -.01em; }
.stitch-onboarding { display: flex; align-items: center; border: 1px solid rgba(62,72,80,.65); border-radius: 12px; background: #0f172a; padding: 16px; }
.stitch-onboarding-step { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; }
.stitch-onboarding-step i { display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; border: 1px solid #3e4850; border-radius: 50%; color: #bec8d2; background: #2d3449; font: 500 12px var(--font-mono); font-style: normal; }
.stitch-onboarding-step i.done { border-color: #0ea5e9; color: #0ea5e9; background: rgba(14,165,233,.12); }
.stitch-onboarding-step i .material-symbols-outlined { font-size: 14px; }
.stitch-onboarding-step b { color: #dae2fd; font-size: 14px; font-weight: 600; white-space: nowrap; }
.stitch-step-line { height: 1px; flex: 1; background: rgba(62,72,80,.55); margin: 0 16px; }
.stitch-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stitch-kpi { display: grid; gap: 12px; min-height: 132px; border: 1px solid rgba(62,72,80,.7); border-radius: 12px; background: #0f172a; padding: 16px; }
.stitch-kpi > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #bec8d2; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.stitch-kpi > div .material-symbols-outlined { color: rgba(190,200,210,.52); font-size: 16px; }
.stitch-kpi > strong { color: #dae2fd; font-family: var(--font-mono); font-size: 24px; letter-spacing: -.04em; }
.stitch-kpi p { display: flex; align-items: center; gap: 3px; margin: 0; color: #bec8d2; font-size: 11px; }
.stitch-kpi p .material-symbols-outlined, .stitch-kpi p b { color: #3cddc7; font-size: 13px; }
.stitch-kpi p b { font-weight: 600; }.stitch-kpi p em { font-style: normal; }
.stitch-overview-grid { display: grid; grid-template-columns: minmax(0, 1.78fr) minmax(300px, .9fr); gap: 16px; }
.stitch-chart-panel,.stitch-project-cost,.stitch-ledger { border: 1px solid rgba(62,72,80,.7); border-radius: 12px; background: #0f172a; padding: 16px; }
.stitch-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }.stitch-card-heading h2,.stitch-project-cost h2 { margin: 0; color: #dae2fd; font-size: 15px; font-weight: 600; }.stitch-card-heading a { display: inline-flex; align-items: center; gap: 4px; color: #0ea5e9; font-size: 12px; font-weight: 600; }.stitch-card-heading a .material-symbols-outlined { font-size: 14px; }
.stitch-segmented { display: flex; border-radius: 5px; background: #10192d; padding: 3px; }.stitch-segmented button { min-height: 27px; border: 0; border-radius: 4px; color: #bec8d2; background: transparent; font-size: 11px; padding: 4px 9px; }.stitch-segmented button.active { color: #dceaff; background: #242d42; }
.stitch-chart-panel .chart-wrap { border: 0; border-radius: 0; background: transparent; padding: 0; }.stitch-chart-panel .chart-wrap svg { height: 262px; }.stitch-chart-panel .preview-topbar { border-top: 0; padding-top: 0; color: #8490a4; font-size: 10px; }.stitch-chart-panel .chart-wrap svg path[stroke] { stroke: #0ea5e9; stroke-width: 2px; }.stitch-chart-panel .chart-wrap svg circle { fill: #0ea5e9; }
.stitch-project-cost { padding: 0 0 8px; overflow: hidden; }.stitch-project-cost h2 { padding: 16px; }.stitch-project-header,.stitch-project-row { display: grid; grid-template-columns: 1.35fr .8fr 1fr; align-items: center; gap: 12px; padding: 11px 16px; }.stitch-project-header { border-top: 1px solid rgba(62,72,80,.5); color: #bec8d2; font-size: 10px; font-weight: 600; }.stitch-project-row { border-top: 1px solid rgba(62,72,80,.35); color: #bec8d2; font-size: 12px; }.stitch-project-row strong { color: #dae2fd; line-height: 1.3; }.stitch-project-row b { color: #d6e3f7; font-family: var(--font-mono); font-size: 11px; font-weight: 500; }.stitch-project-row span { display: flex; align-items: center; gap: 7px; font-size: 11px; }.stitch-project-row i { display: block; width: 38px; height: 5px; overflow: hidden; border-radius: 8px; background: #2d3449; }.stitch-project-row i em { display: block; height: 100%; border-radius: inherit; background: #0ea5e9; }
.stitch-ledger { padding: 0; overflow: hidden; }.stitch-ledger .stitch-card-heading { margin: 0; padding: 16px; }.stitch-ledger .table-wrap { min-width: 720px; }.stitch-ledger .table-wrap th { border-top: 1px solid rgba(62,72,80,.5); color: #bec8d2; font-size: 10px; padding: 12px 16px; }.stitch-ledger .table-wrap td { border-top: 1px solid rgba(62,72,80,.35); color: #bec8d2; font-family: var(--font-mono); font-size: 11px; padding: 11px 16px; }.stitch-ledger .table-title { color: #dae2fd; font-family: var(--font-body); font-size: 12px; }.stitch-ledger .empty-state { margin: 0 16px 16px; }
@media (max-width: 1040px) { .stitch-kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }.stitch-overview-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { body[data-route-kind="app"] .console-shell { grid-template-columns: 1fr; } body[data-route-kind="app"] .console-sidebar { position: static; height: auto; padding: 16px; } body[data-route-kind="app"] .console-nav { grid-template-columns: repeat(4, 1fr); } body[data-route-kind="app"] .console-nav-link { justify-content: center; padding: 8px; } body[data-route-kind="app"] .console-nav-link span:last-child { display: none; } body[data-route-kind="app"] .sidebar-user { display: none; } body[data-route-kind="app"] .page-frame { width: min(100% - 32px,1280px); padding: 24px 0; } .stitch-onboarding { align-items: flex-start; flex-direction: column; gap: 12px; } .stitch-step-line { display:none; }.stitch-onboarding-step { flex: 0; }.stitch-kpi-grid { grid-template-columns: 1fr; } }

/* Stitch homepage fallback: renders correctly even when Tailwind CDN is unavailable. */
body[data-route-kind="marketing"] {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 25% 32%, rgba(14, 165, 233, 0.12), transparent 24rem),
    #020617;
  color: var(--text);
}

body[data-route-kind="marketing"] > nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 19, 38, 0.84);
  backdrop-filter: blur(16px);
}

body[data-route-kind="marketing"] > nav > div,
body[data-route-kind="marketing"] main > section,
body[data-route-kind="marketing"] footer > div {
  width: min(calc(100vw - 64px), var(--content-width));
  margin: 0 auto;
}

body[data-route-kind="marketing"] > nav > div {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

body[data-route-kind="marketing"] > nav > div > div,
body[data-route-kind="marketing"] > nav > div > div > div,
body[data-route-kind="marketing"] > nav a,
body[data-route-kind="marketing"] > nav button {
  display: flex !important;
  align-items: center;
}

body[data-route-kind="marketing"] > nav .marketing-brand {
  color: var(--primary);
  font-family: var(--font-headline);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

body[data-route-kind="marketing"] > nav > div > div:first-child {
  gap: 40px;
}

body[data-route-kind="marketing"] > nav > div > div:first-child > div {
  gap: 18px;
}

body[data-route-kind="marketing"] > nav > div > div:last-child {
  gap: 14px;
}

body[data-route-kind="marketing"] > nav a:not(.marketing-brand) {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 650;
}

body[data-route-kind="marketing"] > nav a:not(:first-child):hover,
body[data-route-kind="marketing"] > nav button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

body[data-route-kind="marketing"] > nav a[data-console-link] {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 16px;
  color: #ffffff;
  background: var(--primary-strong);
}

body[data-route-kind="marketing"] > nav button {
  width: 36px;
  height: 36px;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  color: var(--text-muted);
  background: transparent;
}

body[data-route-kind="marketing"] main {
  padding: 96px 0 64px;
}

body[data-route-kind="marketing"] main > section {
  padding: 64px 0;
}

body[data-route-kind="marketing"] main > section:first-child {
  position: relative;
  display: grid;
  min-height: 650px;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.95fr);
  gap: 64px;
  align-items: center;
}

body[data-route-kind="marketing"] main > section:first-child > div:first-child {
  display: block;
}

body[data-route-kind="marketing"] main > section:first-child > div:nth-child(2) {
  display: grid;
  gap: 24px;
}

body[data-route-kind="marketing"] main > section:first-child h1 {
  max-width: 12ch;
  color: var(--text);
  font-family: var(--font-headline);
  font-size: clamp(44px, 5vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

body[data-route-kind="marketing"] main > section:first-child p {
  max-width: 590px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.55;
}

body[data-route-kind="marketing"] main > section:first-child > div:nth-child(2) > div:last-child {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

body[data-route-kind="marketing"] main > section:first-child > div:nth-child(2) a {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 12px 24px;
  color: #ffffff;
  background: var(--primary-strong);
  font-weight: 750;
}

body[data-route-kind="marketing"] main > section:first-child > div:nth-child(2) a:last-child {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: rgba(30, 41, 59, 0.42);
}

body[data-route-kind="marketing"] #api-reference {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.42);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

body[data-route-kind="marketing"] #api-reference > div:first-child {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(19, 27, 46, 0.82);
  padding: 0 18px;
}

body[data-route-kind="marketing"] #api-reference > div:first-child > div {
  display: flex;
  gap: 8px;
}

body[data-route-kind="marketing"] #api-reference > div:first-child > div > div {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

body[data-route-kind="marketing"] #api-reference > div:first-child > div > div:nth-child(1) {
  background: var(--danger);
}

body[data-route-kind="marketing"] #api-reference > div:first-child > div > div:nth-child(2) {
  background: var(--success);
}

body[data-route-kind="marketing"] #api-reference > div:first-child > div > div:nth-child(3) {
  background: var(--primary-strong);
}

body[data-route-kind="marketing"] #api-reference > div:first-child span {
  color: var(--text-muted);
  font-family: var(--font-code);
  font-size: 14px;
}

body[data-route-kind="marketing"] #api-reference .code-block {
  min-height: 470px;
  border: 0;
  border-radius: 0;
  background: #000000;
  padding: 30px;
}

body[data-route-kind="marketing"] #api-reference pre {
  margin: 0;
  color: var(--text);
  font-family: var(--font-code);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
  white-space: pre-wrap;
}

body[data-route-kind="marketing"] .text-primary {
  color: var(--primary);
}

body[data-route-kind="marketing"] .text-tertiary {
  color: var(--success);
}

body[data-route-kind="marketing"] .text-on-surface-variant {
  color: var(--text-muted);
}

body[data-route-kind="marketing"] #documentation > div:first-child,
body[data-route-kind="marketing"] #pricing > div:nth-child(2) {
  margin-bottom: 40px;
  text-align: center;
}

body[data-route-kind="marketing"] #documentation h2,
body[data-route-kind="marketing"] #pricing h2 {
  color: var(--text);
  font-family: var(--font-headline);
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

body[data-route-kind="marketing"] #documentation > div:first-child p,
body[data-route-kind="marketing"] #pricing > div:nth-child(2) p {
  margin-top: 8px;
  color: var(--text-muted);
}

body[data-route-kind="marketing"] #documentation > div:last-child,
body[data-route-kind="marketing"] #pricing > div:last-child {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

body[data-route-kind="marketing"] #documentation > div:last-child > div,
body[data-route-kind="marketing"] #pricing > div:last-child > div {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  padding: 40px;
}

body[data-route-kind="marketing"] #documentation > div:last-child > div > div:first-child {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-highest);
}

body[data-route-kind="marketing"] .material-symbols-outlined {
  overflow: hidden;
  width: 22px;
  height: 22px;
  color: var(--primary);
  font-size: 0;
}

body[data-route-kind="marketing"] .material-symbols-outlined::before {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: currentColor;
  content: "";
  opacity: 0.92;
  transform: scale(0.72);
}

body[data-route-kind="marketing"] #documentation h3,
body[data-route-kind="marketing"] #pricing h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-family: var(--font-headline);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

body[data-route-kind="marketing"] #documentation p,
body[data-route-kind="marketing"] #pricing p,
body[data-route-kind="marketing"] #pricing li {
  color: var(--text-muted);
  line-height: 1.55;
}

body[data-route-kind="marketing"] #pricing {
  position: relative;
}

body[data-route-kind="marketing"] #pricing ul {
  display: grid;
  gap: 8px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

body[data-route-kind="marketing"] #pricing li {
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-route-kind="marketing"] #pricing a {
  display: block;
  margin-top: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  text-align: center;
  font-weight: 650;
}

body[data-route-kind="marketing"] footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 40px 0;
}

body[data-route-kind="marketing"] footer > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

body[data-route-kind="marketing"] footer > div > div {
  display: flex;
  gap: 16px;
}

body[data-route-kind="marketing"] footer,
body[data-route-kind="marketing"] footer a,
body[data-route-kind="marketing"] footer span {
  color: var(--text-muted);
}

/* Stitch landing page controls: preserve the dark visual by default and offer a deliberate light surface. */
body[data-route-kind="marketing"] .marketing-brand {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
}

body[data-route-kind="marketing"] .marketing-logo {
  width: 44px;
  height: 44px;
  border-radius: 0;
  object-fit: contain;
  mix-blend-mode: normal;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.28));
}

body[data-route-kind="marketing"] .theme-toggle,
body[data-route-kind="marketing"] #themeDarkButton,
body[data-route-kind="marketing"] #themeLightButton {
  display: inline-flex !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-route-kind="marketing"] .theme-toggle.is-active {
  color: var(--primary);
}

body[data-route-kind="marketing"] .theme-toggle .material-symbols-outlined {
  display: block;
  width: 20px;
  height: 20px;
  overflow: visible;
  color: currentColor;
  font-size: 20px !important;
  line-height: 20px;
}

body[data-route-kind="marketing"] .theme-toggle .material-symbols-outlined::before {
  display: none !important;
  content: none !important;
}

body[data-route-kind="marketing"] .marketing-nav-link {
  color: var(--text-muted) !important;
  font-weight: 400 !important;
}

body[data-route-kind="marketing"] .theme-toggle:hover {
  background: transparent !important;
}

body[data-route-kind="marketing"] .pricing-card {
  position: relative;
  min-height: 482px !important;
  cursor: default;
  transform: translateY(0);
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

body[data-route-kind="marketing"] .pricing-card:not(.is-active) {
  border-color: var(--line) !important;
  background: rgba(15, 23, 42, 0.9) !important;
  box-shadow: none !important;
  transform: translateY(0) !important;
}

body[data-route-kind="marketing"] .pricing-card:not(.is-active) a {
  color: var(--text) !important;
  border-color: var(--line-strong) !important;
  background: transparent !important;
}

body[data-route-kind="marketing"] .pricing-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

body[data-route-kind="marketing"] .pricing-state-label {
  position: absolute;
  top: 0;
  left: 50%;
  display: none;
  border-radius: 999px;
  padding: 6px 12px;
  color: #ffffff;
  background: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
}

body[data-route-kind="marketing"] .pricing-card.is-active {
  z-index: 1;
  border-color: rgba(137, 206, 255, 0.62) !important;
  background: #1e293b !important;
  box-shadow: 0 4px 30px rgba(14, 165, 233, 0.2);
  transform: translateY(-16px);
}

body[data-route-kind="marketing"] .pricing-card.is-active .pricing-state-label {
  display: block;
}

body[data-route-kind="marketing"] .pricing-card.is-active h3 {
  color: var(--primary) !important;
}

body[data-route-kind="marketing"] .pricing-card.is-active a {
  border-color: transparent !important;
  color: #ffffff !important;
  background: var(--primary-strong) !important;
}

body[data-route-kind="marketing"][data-theme="light"] {
  --text: #13213d;
  --text-muted: #52617a;
  --line: rgba(19, 33, 61, 0.14);
  --line-strong: #a9b5c7;
  --surface: #f5f8fc;
  --surface-low: #edf3f9;
  --surface-mid: #e3ebf5;
  --surface-high: #d6e1ee;
  --surface-highest: #c8d5e5;
  --primary: #006d9f;
  --primary-strong: #007cb8;
  background: #f5f8fc;
  color: #13213d;
}

body[data-route-kind="marketing"][data-theme="light"] > nav,
body[data-route-kind="marketing"][data-theme="light"] footer {
  border-color: rgba(19, 33, 61, 0.12) !important;
  background: rgba(245, 248, 252, 0.88) !important;
}

body[data-route-kind="marketing"][data-theme="light"] #api-reference,
body[data-route-kind="marketing"][data-theme="light"] #documentation > div:last-child > div,
body[data-route-kind="marketing"][data-theme="light"] #pricing > div:last-child > div {
  border-color: rgba(19, 33, 61, 0.14) !important;
  background: #ffffff !important;
  box-shadow: 0 16px 44px rgba(28, 58, 94, 0.1);
}

body[data-route-kind="marketing"][data-theme="light"] #api-reference > div:first-child {
  background: #eaf1f8 !important;
}

body[data-route-kind="marketing"][data-theme="light"] #api-reference .code-block {
  background: #102032;
}

body[data-route-kind="marketing"][data-theme="light"] .marketing-logo {
  mix-blend-mode: normal;
}

/* MUI sign-in template adaptation: keep the existing auth handlers behind a focused card. */
body[data-route-kind="auth"] {
  min-height: 100vh;
  color: #1b1d22;
  background: radial-gradient(ellipse at 50% 45%, #edf6ff 0%, #f9fbfe 46%, #ffffff 100%);
}

body[data-route-kind="auth"] .auth-template-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 16px;
}

body[data-route-kind="auth"] .auth-template-card {
  width: min(100%, 452px);
  padding: 32px;
  border: 1px solid rgba(27, 31, 39, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(32, 49, 74, 0.11), 0 5px 14px rgba(32, 49, 74, 0.06);
}

body[data-route-kind="auth"] .auth-template-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 22px;
  color: #4d78dc;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

body[data-route-kind="auth"] .auth-template-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

body[data-route-kind="auth"] .auth-pane {
  display: grid;
  gap: 16px;
}

body[data-route-kind="auth"] .auth-pane.hidden {
  display: none;
}

body[data-route-kind="auth"] .auth-pane h1 {
  margin: 0;
  color: #17191f;
  font-family: var(--font-headline);
  font-size: clamp(30px, 7vw, 35px);
  line-height: 1.1;
  letter-spacing: -0.045em;
  text-align: center;
}

body[data-route-kind="auth"] .auth-template-copy {
  margin: -4px 0 2px;
  color: #667085;
  font-size: 14px;
  line-height: 1.6;
}

body[data-route-kind="auth"] .auth-template-form {
  display: grid;
  gap: 16px;
}

body[data-route-kind="auth"] .auth-template-field {
  display: grid;
  gap: 8px;
}

body[data-route-kind="auth"] .auth-template-field > span {
  color: #4b5565;
  font-size: 14px;
  font-weight: 500;
}

body[data-route-kind="auth"] .auth-template-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  color: #1b1d22;
  background: #fbfbfc;
  box-shadow: inset 0 1px 2px rgba(18, 24, 40, 0.03);
  padding: 11px 13px;
}

body[data-route-kind="auth"] .auth-template-field input:focus {
  border-color: #4d78dc;
  box-shadow: 0 0 0 3px rgba(77, 120, 220, 0.14);
}

body[data-route-kind="auth"] .auth-template-remember {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #3e4652;
  font-size: 14px;
}

body[data-route-kind="auth"] .auth-template-remember input[type="checkbox"] {
  width: 20px !important;
  min-width: 20px;
  max-width: 20px;
  height: 20px !important;
  min-height: 20px !important;
  flex: 0 0 20px;
  margin: 0;
  padding: 0;
  appearance: auto;
  accent-color: #1b1d22;
}

body[data-route-kind="auth"] .auth-template-submit {
  min-height: 46px;
  border: 1px solid #121722;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(180deg, #384154 0%, #111622 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
  font-weight: 650;
}

body[data-route-kind="auth"] .auth-template-submit:hover {
  background: #111622;
}

body[data-route-kind="auth"] .auth-template-action,
body[data-route-kind="auth"] .auth-template-switch button {
  width: auto;
  min-height: auto;
  border: 0;
  border-radius: 0;
  color: #1f2937;
  background: transparent;
  box-shadow: none;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body[data-route-kind="auth"] .auth-template-action {
  justify-self: center;
}

body[data-route-kind="auth"] .auth-template-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  color: #667085;
  font-size: 14px;
}

body[data-route-kind="auth"] .auth-template-divider span {
  height: 1px;
  background: #e5e7eb;
}

body[data-route-kind="auth"] .auth-template-divider b {
  font-weight: 400;
}

body[data-route-kind="auth"] .auth-template-provider-actions {
  display: grid;
  gap: 12px;
}

body[data-route-kind="auth"] .auth-template-provider {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  color: #202530;
  background: #ffffff;
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
}

body[data-route-kind="auth"] .auth-template-provider:hover {
  border-color: #cbd2dd;
  background: #fafbfc;
}

body[data-route-kind="auth"] .auth-template-provider img {
  width: 20px;
  height: 20px;
}

body[data-route-kind="auth"] .auth-template-switch {
  margin: 4px 0 0;
  color: #4b5565;
  font-size: 14px;
  text-align: center;
}

body[data-route-kind="auth"] .status-line {
  min-height: 0;
  color: #667085;
  font-size: 13px;
  text-align: center;
}

body[data-route-kind="auth"] .debug-card {
  border-color: #d7dce5;
  border-radius: 8px;
  color: #1b1d22;
  background: #f6f8fb;
}

@media (max-width: 520px) {
  body[data-route-kind="auth"] .auth-template-shell {
    padding: 16px;
  }

  body[data-route-kind="auth"] .auth-template-card {
    padding: 28px 22px;
  }
}

@media (max-width: 1180px) {
  .hero-panel,
  .auth-shell,
  .overview-grid,
  .api-layout,
  .usage-layout,
  .billing-layout,
  .split-card {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .feature-band,
  .audience-grid,
  .flow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .console-sidebar {
    position: static;
    width: auto;
  }

  .console-main {
    margin-left: 0;
  }

  .console-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .console-nav-link {
    justify-content: center;
  }

  .console-nav-link span:last-child {
    display: none;
  }

  .console-header,
  .page-frame,
  .flash-message {
    width: min(calc(100% - 32px), var(--content-width));
  }

  .console-topbar {
    padding: 0 16px;
  }
}

@media (max-width: 720px) {
  .site-shell,
  .auth-shell {
    width: min(calc(100vw - 20px), var(--content-width));
  }

  .site-header,
  .console-header,
  .console-topbar,
  .card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav,
  .console-topnav {
    display: none;
  }

  .console-search {
    width: 100%;
  }

  .hero-panel,
  .feature-card,
  .workflow-section,
  .auth-aside,
  .auth-card,
  .overview-grid > article,
  .usage-layout > article,
  .billing-layout > article,
  .api-layout .list-card,
  .api-layout .detail-card,
  .page-frame > article {
    padding: 18px;
  }

  .hero-copy h1,
  .auth-aside-copy h1 {
    max-width: none;
  }

  .preview-grid,
  .feature-band,
  .audience-grid,
  .flow-grid,
  .metric-grid,
  .field-grid,
  .pricing-grid,
  .pill-row {
    grid-template-columns: 1fr;
  }

  .auth-tabs {
    grid-template-columns: 1fr;
  }
}

/* Keep the selected customer-billing connector unmistakable in both console themes. */
[data-billing-connector-choice] {
  position: relative;
}

[data-billing-connector-choice].is-selected {
  border-color: #0284c7 !important;
  background: #e0f2fe !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.16);
}

[data-billing-connector-choice].is-selected::after {
  content: "Selected";
  position: absolute;
  top: 12px;
  right: 12px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #0284c7;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

html.dark [data-billing-connector-choice].is-selected {
  border-color: #38bdf8 !important;
  background: rgba(14, 165, 233, 0.16) !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.16);
}

html.dark [data-billing-connector-choice].is-selected::after {
  background: #0ea5e9;
}
