:root {
  --black: #0b0b0d;
  --ink: #171717;
  --muted: #5d5d5f;
  --white: #ffffff;
  --paper: #f6f5f1;
  --line: #dedbd2;
  --silver: #c8c8c8;
  --gold: #c7a14a;
  --gold-strong: #9b7a2f;
  --success: #1f7a4d;
  --warning: #9a6700;
  --danger: #b42318;
}

* { box-sizing: border-box; }

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

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

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 10px 14px;
  cursor: pointer;
}

button:hover { border-color: var(--gold); }
button:disabled { opacity: .55; cursor: not-allowed; }

.primary {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.ghost {
  background: transparent;
  color: var(--silver);
  border-color: #333;
}

.full { width: 100%; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 11px 12px;
  color: var(--ink);
}

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

.file-input {
  background: #fbfbfa;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  background: var(--black);
  color: var(--white);
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: var(--black);
  font-weight: 900;
}

.brand h1, .brand p, h2, h3 { margin: 0; }
.brand p { color: var(--silver); margin-top: 3px; }

.access-panel, .runtime-card {
  display: grid;
  gap: 12px;
  background: #151516;
  border: 1px solid #2e2e30;
  border-radius: 8px;
  padding: 16px;
}

.sidebar input {
  background: #101011;
  color: var(--white);
  border-color: #353538;
}

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

.nav-item {
  background: transparent;
  color: var(--silver);
  border-color: #303033;
  text-align: left;
}

.nav-item.active {
  background: rgba(199, 161, 74, .16);
  color: var(--white);
  border-color: var(--gold);
}

.runtime-card span {
  color: var(--silver);
  font-size: 12px;
}

.runtime-card strong {
  color: var(--white);
}

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

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

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

.eyebrow {
  display: block;
  color: var(--gold-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.eyebrow.dark { color: var(--gold); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric, .panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(10, 10, 10, .04);
}

.metric {
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  font-size: 24px;
  margin-top: 4px;
}

.panel {
  padding: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.panel-head p {
  color: var(--muted);
  margin: 5px 0 0;
}

.view { display: none; }
.view.active { display: block; }

.studio-grid {
  display: grid;
  grid-template-columns: minmax(260px, 350px) minmax(340px, 1fr);
  gap: 16px;
  align-items: start;
}

.products-list, .editor-panel, .preview-panel, .stack {
  display: grid;
  gap: 10px;
}

.preview-panel {
  grid-column: 2;
}

.product-button {
  width: 100%;
  display: grid;
  gap: 5px;
  text-align: left;
}

.product-button.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(199, 161, 74, .18);
}

.product-title { font-weight: 800; }

.product-meta {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.product-state {
  justify-self: flex-start;
  white-space: nowrap;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pill {
  border: 1px solid var(--line);
  color: var(--muted);
  background: #f8f8f6;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.pill.gold { border-color: var(--gold); color: var(--gold-strong); background: #fff8e2; }
.pill.ok { border-color: #a9d8be; color: var(--success); background: #eef9f2; }
.pill.warn { border-color: #e6c36d; color: var(--warning); background: #fff8e2; }
.pill.bad { border-color: #efb4ad; color: var(--danger); background: #fff1ef; }

.status {
  color: var(--silver);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.main .status { color: var(--muted); }

pre {
  margin: 0;
  background: #101011;
  color: #f3f3f3;
  border: 1px solid #292929;
  border-radius: 8px;
  padding: 14px;
  min-height: 250px;
  overflow: auto;
  white-space: pre-wrap;
}

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

.wide { grid-column: 1 / -1; }

.info-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.info-row span {
  color: var(--muted);
  font-size: 12px;
}

.info-row strong {
  font-size: 15px;
}

.hidden { display: none !important; }

.loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  background: rgba(11, 11, 13, .34);
  color: var(--white);
  z-index: 10;
}

.loader {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .metrics { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .studio-grid, .preview-panel, .dashboard-grid { grid-template-columns: 1fr; grid-column: auto; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; justify-content: space-between; }
}

@media (max-width: 560px) {
  .main, .sidebar { padding: 16px; }
  .metrics { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  .actions button { width: 100%; }
}


.auth-gate {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(199, 161, 74, .2), transparent 34%),
    linear-gradient(145deg, rgba(11, 11, 13, .98), rgba(24, 24, 25, .96)),
    var(--black);
  color: var(--white);
}

.auth-stage {
  min-height: 100vh;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 34px 22px 42px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 24px;
}

.auth-brand {
  justify-self: center;
}

.auth-brand .brand-mark {
  background: var(--gold);
}

.auth-headline {
  max-width: 880px;
  text-align: center;
}

.auth-headline h2 {
  font-size: 48px;
  line-height: 1.04;
  max-width: 900px;
  margin: 0 auto;
}

.auth-headline p {
  color: var(--silver);
  font-size: 17px;
  line-height: 1.55;
  max-width: 720px;
  margin: 16px auto 0;
}

.auth-promises {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-promises article {
  border: 1px solid rgba(199, 161, 74, .22);
  background: rgba(255, 255, 255, .045);
  border-radius: 8px;
  padding: 14px;
}

.auth-promises span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.auth-promises strong {
  display: block;
  margin-top: 8px;
  color: var(--white);
}

.auth-promises p {
  margin: 6px 0 0;
  color: var(--silver);
  line-height: 1.45;
  font-size: 13px;
}

.auth-card {
  width: min(420px, 100%);
  background: rgba(246, 245, 241, .98);
  color: var(--ink);
  padding: 28px;
  display: grid;
  gap: 14px;
  border: 1px solid rgba(199, 161, 74, .4);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .32);
}

.google-button {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.google-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from 20deg, #4285f4, #34a853, #fbbc05, #ea4335, #4285f4);
  color: var(--white);
  font-weight: 900;
  font-size: 14px;
}.auth-separator {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  height: 1px;
  background: var(--line);
}

@media (max-width: 860px) {
  .auth-stage {
    align-content: start;
    padding: 24px 16px 28px;
  }

  .auth-headline h2 {
    font-size: 34px;
  }

  .auth-headline p {
    font-size: 15px;
  }

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

  .auth-card {
    padding: 20px;
  }
}


.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

.ghost-light {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}


.auth-helper {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
  font-size: 13px;
}


.auth-secondary {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.auth-card input {
  min-height: 46px;
}

.auth-card .primary {
  min-height: 46px;
  font-weight: 800;
}.password-rules {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfa;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.password-rules strong {
  color: var(--ink);
  font-size: 12px;
}

.account-row,
.lock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.account-row strong,
.lock-row strong {
  color: var(--ink);
  text-align: right;
}

.account-row.ok strong {
  color: var(--success);
}

.account-row.warn strong,
.lock-row.warning strong {
  color: var(--warning);
}

.usage-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ececea;
}

.usage-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #111);
}

.pricing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
}

.pricing-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fbfbfa;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.lock-row.active.block strong {
  color: var(--danger);
}

.lock-row.active.guardrail strong {
  color: var(--gold-strong);
}

.lock-row.inactive strong {
  color: var(--success);
}


.billing-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.billing-grid .wide {
  grid-column: 1 / -1;
}


.platform-billing-grid {
  grid-template-columns: minmax(260px, 360px) 1fr;
}

.platform-billing-grid .wide {
  grid-column: auto;
}

.platform-tenant-list {
  gap: 12px;
}

.platform-tenant-row {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.platform-tenant-head,
.platform-tenant-meta,
.signal-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.platform-tenant-head {
  justify-content: space-between;
}

.platform-tenant-head strong {
  color: var(--ink);
}

.platform-tenant-head span,
.platform-tenant-meta span {
  color: var(--muted);
  font-size: 12px;
}

.signal-pill {
  padding: 4px 8px;
  border: 1px solid #e6c36d;
  border-radius: 999px;
  background: #fff8e2;
  color: var(--warning);
  font-size: 11px;
  font-weight: 700;
}

.signal-pill.neutral {
  border-color: var(--line);
  background: #fbfbfa;
  color: var(--muted);
}

@media (max-width: 860px) {
  .platform-billing-grid {
    grid-template-columns: 1fr;
  }
}


.billing-alerts {
  gap: 10px;
}

.billing-alert {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfa;
}

.billing-alert strong {
  color: var(--ink);
}

.billing-alert span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.billing-alert.ok {
  border-color: #a9d8be;
  background: #eef9f2;
}

.billing-alert.warning {
  border-color: #e6c36d;
  background: #fff8e2;
}

.billing-alert.danger {
  border-color: #efb4ad;
  background: #fff1ef;
}

.billing-alert.info {
  border-color: var(--line);
  background: #fbfbfa;
}


.business-health {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfa;
}

.business-health strong {
  color: var(--ink);
  font-size: 13px;
}

.business-health span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.business-health.critical {
  border-color: #d9a2a2;
  background: #fff7f7;
}

.business-health.attention {
  border-color: #d8c47f;
  background: #fffaf0;
}

.business-health.opportunity {
  border-color: #9fc0a7;
  background: #f5fbf6;
}


.business-health .manual-action {
  color: var(--ink);
  font-weight: 700;
}


.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.billing-plan-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.billing-plan-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.billing-plan-card h4 {
  margin: 0 0 6px;
}

.billing-plan-card ul {
  margin: 12px 0;
  padding-left: 18px;
}

.billing-addon-list {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.billing-addon-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.billing-addon-row span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.billing-addon-row input {
  width: 84px;
}

.billing-checkout-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.product-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.signal-pill.ok {
  border-color: #a9d8be;
  background: #eef9f2;
  color: var(--success);
}

.signal-pill.warn {
  border-color: #e6c36d;
  background: #fff8e2;
  color: var(--warning);
}
