:root {
  color-scheme: dark;
  --bg: #0a0b10;
  --bg-2: #0f1220;
  --panel: rgba(17, 20, 32, 0.9);
  --panel-strong: rgba(24, 28, 44, 0.96);
  --text: #f3f4f7;
  --muted: #a6adbb;
  --accent: #ff7a1a;
  --accent-2: #55d6ff;
  --success: #32d583;
  --warning: #fdb022;
  --danger: #f97066;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --mono: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --font: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(255, 122, 26, 0.18), transparent 55%),
    radial-gradient(circle at 70% 10%, rgba(85, 214, 255, 0.2), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: -0.01em;
}

body.signed-out .workspace,
body.signed-out #btn-run-wizard,
body.signed-out #btn-run-wizard-inline {
  display: none;
}

body.plan-locked .sidebar,
body.plan-locked .content {
  pointer-events: none;
  user-select: none;
  filter: blur(6px);
  opacity: 0.35;
}

body.signed-out .hero-panel {
  grid-template-columns: 1fr;
}

body.signed-out #btn-logout {
  display: none;
}

body.signed-out #btn-checkout,
body.signed-out #btn-portal,
body.signed-out #plan-select {
  pointer-events: none;
  opacity: 0.55;
}

.bg-glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 122, 26, 0.22), transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(85, 214, 255, 0.18), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.bg-noise {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 6vw;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(10, 11, 16, 0.9), rgba(10, 11, 16, 0.4));
  border-bottom: 1px solid var(--border);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.9), rgba(85, 214, 255, 0.6));
  font-weight: 700;
}

.brand-title {
  font-size: 18px;
  font-weight: 600;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.top-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ghost-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.shell {
  position: relative;
  z-index: 1;
  padding: 32px 6vw 80px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.hero {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: stretch;
}

.hero-copy h1 {
  font-size: clamp(30px, 4vw, 48px);
  margin: 0 0 12px;
}

.hero-copy p {
  color: var(--muted);
  margin: 0;
  max-width: 520px;
}

.status-chips {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--muted);
}

.chip.active {
  background: rgba(85, 214, 255, 0.18);
  color: var(--text);
}

.hero-panel {
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel.wide {
  padding: 28px;
}

.tab-header {
  margin: 6px 4px 18px;
}

.tab-header h2 {
  margin: 0 0 6px;
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
}

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

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.form-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 8px;
}

.form-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.log-box {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-height: 120px;
  white-space: pre-wrap;
}

.launch-results {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.launch-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.launch-result {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.launch-result img {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
}

.launch-preview {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 8px;
  align-content: start;
}

.launch-preview img {
  width: 100%;
  max-width: 180px;
  border-radius: 10px;
  object-fit: cover;
}

.launch-suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow: auto;
  margin: 6px 0;
  padding-right: 4px;
}

.launch-suggestion {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.launch-suggestion.active {
  background: rgba(85, 214, 255, 0.18);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #ffb347);
  color: #0a0b10;
  font-weight: 600;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.inline-note {
  font-size: 12px;
  color: var(--muted);
}

.account-summary {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.plan-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

select,
input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-family: var(--font);
}

textarea {
  resize: vertical;
}

label {
  font-size: 13px;
  color: var(--muted);
}

.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #0b0d14;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid var(--border);
  cursor: help;
  position: relative;
  transform: translateY(-1px);
}

.help-tip::before {
  content: "?";
}

.help-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(6px);
  background: var(--panel-strong);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  width: max-content;
  max-width: 240px;
  white-space: normal;
  font-size: 12px;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow);
  z-index: 20;
}

.help-tip:hover::after,
.help-tip:focus::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 24px;
  position: relative;
}

.gate {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(9, 10, 16, 0.92), rgba(15, 17, 28, 0.96));
  border-radius: 22px;
  z-index: 2;
}

body.plan-locked .gate {
  display: flex;
}

.gate-card {
  max-width: 520px;
  width: min(90vw, 520px);
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
  text-align: left;
}

.gate-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 10px;
}

.gate-meta {
  display: grid;
  gap: 6px;
  margin: 18px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.gate-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tab {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
}

.tab.active {
  color: var(--text);
  border-color: rgba(255, 122, 26, 0.4);
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.12), rgba(85, 214, 255, 0.08));
}

.tab.tab-coming-soon {
  opacity: 0.72;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

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

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

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

.stat {
  padding: 16px;
  border-radius: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  margin-top: 6px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.info-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.placeholder-card {
  padding: 24px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.component-card {
  padding: 16px;
  border-radius: 16px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
}

.loyalty-coming-soon {
  position: relative;
}

.coming-soon-chip {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(249, 112, 102, 0.16);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.loyalty-disabled {
  margin: 0;
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  opacity: 0.45;
  filter: saturate(0.3);
}

.code-block {
  width: 100%;
  font-family: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: rgba(10, 14, 24, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 12px;
  box-sizing: border-box;
}

pre.code-block {
  min-height: 140px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.loyalty-media-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.loyalty-media-row {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-strong);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.loyalty-media-meta {
  font-size: 13px;
  color: var(--muted);
}

.loyalty-reward-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.loyalty-reward-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-strong);
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.loyalty-reward-item.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

.loyalty-reward-item .meta {
  color: var(--muted);
  font-size: 13px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  justify-content: flex-start;
  justify-self: start;
}

.toggle input {
  margin: 0;
}

.toggle.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.toggle.is-disabled input {
  pointer-events: none;
}

.toggle.is-disabled .help-tip {
  opacity: 0.7;
}

.toggle-grid {
  display: grid;
  column-gap: 28px;
  row-gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: center;
}

.toggle-input-row {
  display: grid;
  column-gap: 24px;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 320px);
  align-items: center;
  max-width: 880px;
}

.toggle-input-row .toggle {
  display: grid;
  grid-template-columns: 16px 1fr;
  column-gap: 10px;
  align-items: start;
}

.toggle-input-row .toggle input {
  margin: 2px 0 0;
}

.toggle-input-row .toggle span {
  display: block;
}

.radio-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  column-gap: 12px;
  margin: 0;
  font-size: 14px;
}

.radio-row input {
  margin: 2px 0 0;
}

.radio-row span {
  display: block;
}

.wizard-body .radio-row {
  justify-content: flex-start;
  width: fit-content;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.support {
  margin-top: 40px;
}

.wizard {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 12, 0.7);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  z-index: 20;
}

.wizard.hidden {
  display: none;
}

.wizard-shell {
  width: min(920px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wizard-body {
  margin: 20px 0;
  min-height: 280px;
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hidden {
  display: none !important;
}

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

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .launch-results {
    grid-template-columns: 1fr;
  }
  .grid-3-fixed {
    grid-template-columns: 1fr;
  }
}
