:root {
  --bg: #f1f5fb;
  --surface: #ffffff;
  --text: #0b1533;
  --muted: #51607a;
  --border: #e1e8f5;
  --accent: #1f3b8f;
  --accent-strong: #182e70;
  --accent-soft: #dbe9ff;
  --accent-cyan: #2fb7ff;
  --accent-yellow: #f4d000;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --error: #dc2626;
  --error-soft: #fee2e2;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);
  --shadow-md: 0 10px 26px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Avenir", "Futura", "Gill Sans", "Trebuchet MS", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
  min-height: 100vh;
  font-size: 18px;
}

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

a:hover {
  color: var(--accent);
}

.site-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 16px 4vw;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.brand-link:hover {
  transform: scale(1.03);
}

.brand-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.brand-text {
  height: 35px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 20px;
  color: var(--muted);
  justify-content: flex-start;
  margin-left: 12px;
}

.nav-links a {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: border 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover {
  border-color: rgba(31, 59, 143, 0.2);
  background: #fff;
  color: var(--text);
}

.nav-links a.active {
  color: var(--text);
  font-weight: 600;
}

.auth-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-size: 0.9rem;
}

.auth-form,
.auth-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-form input {
  min-width: 200px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.auth-user {
  font-size: 0.92rem;
  color: var(--muted);
}

.auth-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 10px;
  text-align: right;
}

.auth-identity {
  color: var(--text);
  font-weight: 600;
}

.auth-meta,
.auth-credits {
  font-size: 0.82rem;
  color: var(--muted);
}

.auth-alert {
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-area .button {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.auth-area .button.ghost:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(31, 59, 143, 0.2);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6px 6vw 40px;
  min-height: calc(100vh - 70px);
  display: grid;
  gap: 36px;
  align-items: start;
}

.home-guides {
  margin-top: clamp(40px, 8vh, 90px);
}

.home-guides-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.home-guides-header h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.5vw, 2rem);
}

.home-guides-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.home-guides-header .button {
  white-space: nowrap;
}

.pricing-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 3vw 70px;
}

.pricing-hero {
  text-align: center;
  margin: 20px auto 28px;
  display: grid;
  gap: 12px;
}

.pricing-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
}

.pricing-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: #eef3ff;
  justify-self: center;
  box-shadow: var(--shadow-md);
}

.toggle-button {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.toggle-button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.toggle-badge {
  background: #fff4bf;
  color: #8b6b00;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pricing-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  max-width: 1400px;
  margin: 0 auto;
}

.pricing-card {
  flex: 1 1 280px;
  max-width: 320px;
  position: relative;
  background: var(--surface);
  border-radius: 24px;
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
  display: grid;
  gap: 12px;
  align-content: start;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  will-change: transform;
}

.pricing-card:hover,
.pricing-card:focus-within {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
  border-color: rgba(47, 183, 255, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .pricing-card {
    transition: none;
  }

  .pricing-card:hover,
  .pricing-card:focus-within {
    transform: none;
  }
}

.plan-header {
  display: grid;
  gap: 6px;
}

.pricing-card.has-badge .plan-header {
  padding-right: 96px;
}

.plan-control {
  display: grid;
  gap: 8px;
  min-height: 92px;
  align-content: start;
}

.plan-muted {
  min-height: 64px;
}

.pricing-card.recommended {
  border-color: rgba(47, 183, 255, 0.45);
  box-shadow: 0 20px 48px rgba(31, 59, 143, 0.2);
}

.pricing-card.recommended:hover,
.pricing-card.recommended:focus-within {
  border-color: rgba(47, 183, 255, 0.65);
  box-shadow: 0 28px 66px rgba(31, 59, 143, 0.28);
}

.pricing-card.team {
  border-color: rgba(244, 208, 0, 0.4);
}


.plan-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.plan-badge.recommended {
  background: rgba(47, 183, 255, 0.18);
  color: #0b3b66;
}

.plan-badge.team {
  background: #fff4bf;
  color: #8b6b00;
}

.plan-title {
  margin: 0;
  font-size: 1.35rem;
}

.plan-title + .plan-description {
  margin-top: 6px;
}

.plan-price {
  margin: 6px 0 0;
  font-size: 1.6rem;
  font-weight: 600;
  color: #2b3b57;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.plan-price + .button {
  margin-top: 12px;
}

.pricing-card .button {
  min-height: 44px;
}

.pricing-card a.button {
  font-size: 1rem;
}

.plan-divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 4px 0 0;
}

.plan-total {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

.faq-section {
  margin: 70px auto 0;
  text-align: center;
  max-width: 900px;
}

.faq-section h2 {
  margin: 0 0 24px;
  font-size: clamp(1.6rem, 2.5vw, 2rem);
}

.faq-list {
  display: grid;
  gap: 14px;
  text-align: left;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 18px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 1.1rem;
}

.faq-list details[open] summary::after {
  content: "▴";
}

.faq-list p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.plan-cycle {
  font-size: 0.9rem;
  color: var(--muted);
}

.plan-description {
  display: block;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.plan-section-title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-features,
.plan-rules {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

.plan-features li,
.plan-rules li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.plan-features li::before,
.plan-rules li::before {
  content: "•";
  color: var(--accent);
  font-weight: 700;
  line-height: 1.2;
}

.plan-tiers {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.plan-tier {
  padding: 6px 10px;
  border-radius: 10px;
  background: #f7f9ff;
  border: 1px dashed rgba(31, 59, 143, 0.2);
}

.credit-packs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.credit-packs span {
  border: 1px dashed rgba(31, 59, 143, 0.3);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.88rem;
  color: var(--muted);
  background: #f7f9ff;
}

.plan-field {
  display: grid;
  gap: 8px;
}

.plan-field-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.plan-select {
  width: 100%;
}

.plan-subtext,
.plan-note {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.toast {
  position: fixed;
  bottom: 26px;
  right: 26px;
  background: #0b1533;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.25);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 30, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 120;
}

.dialog-backdrop[hidden] {
  display: none;
}

.dialog {
  width: min(92vw, 420px);
  background: #fff;
  color: var(--text);
  border-radius: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.dialog h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.dialog-message {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  align-content: center;
  min-height: calc(100vh - 120px);
  width: 100%;
}

.hero-left {
  max-width: 480px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 14px;
  margin-left: 18px;
}

.typewriter {
  display: inline-flex;
  align-items: center;
}

.typewriter::after {
  content: "";
  width: 2px;
  height: 1em;
  margin-left: 4px;
  background: var(--muted);
  animation: caret-blink 1s steps(1) infinite;
}
.hero-left h1 {
  font-size: clamp(2.6rem, 3.7vw, 3.4rem);
  margin: 0 0 14px;
}

.hero-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-logo {
  width: 168px;
  height: 168px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.15));
}

.lead {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.lead strong {
  color: var(--text);
  font-weight: 600;
}

.work-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(31, 59, 143, 0.12);
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 520px;
  justify-self: end;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: #eef3ff;
  gap: 6px;
  width: fit-content;
  justify-self: center;
}

.tab {
  border: none;
  background: transparent;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tab-panels {
  display: grid;
  gap: 18px;
}

.tab-panel {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

label {
  font-weight: 600;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 1.05rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

#single-image {
  transition: opacity 0.25s ease;
}

#single-image.placeholder-fade {
  opacity: 0.35;
}

#stack-input {
  transition: opacity 0.25s ease;
}

#stack-input.placeholder-fade {
  opacity: 0.35;
}

textarea {
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.stack-panel {
  gap: 18px;
}

.stack-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(241, 246, 255, 0.9) 0%, rgba(255, 255, 255, 0.96) 100%);
  border: 1px solid rgba(31, 59, 143, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.stack-card {
  background: #fff;
  border: 1px solid rgba(31, 59, 143, 0.12);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.stack-input-card textarea {
  background: #f8faff;
}

.dropzone {
  border: 1px dashed rgba(31, 59, 143, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  padding: 20px;
  display: grid;
  gap: 10px;
  text-align: center;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: linear-gradient(180deg, #f4fbff 0%, #e8f4ff 100%);
  box-shadow: 0 16px 26px rgba(47, 183, 255, 0.2);
}

.dropzone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dropzone-content {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.dropzone-text {
  margin: 0;
  color: var(--muted);
}

.dropzone-filename {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.dropzone-hint {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.stack-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.stack-choice {
  margin: 0;
  font-size: 0.95rem;
}

.stack-separator {
  position: relative;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
}

.stack-separator::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(148, 163, 184, 0.4);
  transform: translateY(-50%);
}

.stack-separator span {
  position: relative;
  background: #fff;
  border: 1px solid rgba(31, 59, 143, 0.16);
  border-radius: 999px;
  padding: 4px 14px;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.stack-kind {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.85rem;
}

.stack-kind select {
  padding: 6px 8px;
  font-size: 0.85rem;
}

.stack-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 12px;
}

.stack-actions .button {
  width: 100%;
}

.button.stack-upload {
  background: linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%);
  color: #1f2a44;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  padding: 10px 18px;
  font-size: 0.95rem;
}

.button.stack-upload:hover:not(:disabled) {
  background: linear-gradient(180deg, #f8fafc 0%, #e9eef6 100%);
  transform: translateY(-1px);
}

.status-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px;
  display: grid;
  gap: 12px;
  background: #fff;
}

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

.status-meta {
  display: grid;
  gap: 4px;
}

.status-meta p {
  margin: 0;
}

.status-subtext {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-idle {
  background: #f1f4f9;
  color: var(--muted);
}

.status-queued,
.status-running {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-completed {
  background: var(--success-soft);
  color: var(--success);
}

.status-failed,
.status-expired {
  background: var(--error-soft);
  color: var(--error);
}

.alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.alert-error {
  background: var(--error-soft);
  color: var(--error);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-warning {
  background: var(--warning-soft);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.alert-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button.primary {
  background: linear-gradient(135deg, #1f3b8f, #2fb7ff);
  color: #fff;
  box-shadow: 0 10px 20px rgba(31, 59, 143, 0.22);
}

.button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #182e70, #1f8fd1);
  transform: translateY(-1px);
}

.button.danger {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.22);
}

.button.danger:hover:not(:disabled) {
  background: #b91c1c;
  transform: translateY(-1px);
}

.button.secondary {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.button.secondary:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

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

.button.wide {
  width: 100%;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button.is-loading .spinner {
  display: inline-block;
}

.button .spinner {
  display: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.button.secondary .spinner,
.button.ghost .spinner {
  border-color: rgba(15, 23, 42, 0.2);
  border-top-color: var(--text);
}

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

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

.results {
  display: grid;
  gap: 10px;
}

.results-header h3 {
  margin: 0;
}

.code-box {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", "Menlo", monospace;
  font-size: 0.95rem;
  margin: 0;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.code-box code.hljs {
  background: transparent;
  padding: 0;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 840px) {
  .site-nav {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .auth-area {
    align-items: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    align-content: start;
  }

  .work-card {
    justify-self: start;
    max-width: 100%;
  }

  .page {
    min-height: auto;
    padding-bottom: 50px;
  }

  .home-guides-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .pricing-hero {
    text-align: left;
  }

  .billing-toggle {
    justify-self: start;
  }
}

@media (max-width: 839px) {
  .site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
  }

  .brand {
    order: 1;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .auth-area {
    order: 2;
    margin-left: auto;
    align-items: flex-end;
  }

  .auth-form,
  .auth-user {
    width: auto;
    justify-content: flex-end;
  }

  .auth-form {
    gap: 8px;
  }

  .auth-form input {
    flex: 0 0 auto;
    width: 0;
    min-width: 0;
    max-width: 0;
    padding: 0;
    margin: 0;
    border-width: 0;
    opacity: 0;
    pointer-events: none;
    transition: width 0.2s ease, opacity 0.2s ease, padding 0.2s ease, border-width 0.2s ease;
  }

  .auth-form:focus-within input {
    width: min(200px, 60vw);
    min-width: 140px;
    max-width: 60vw;
    padding: 8px 10px;
    border-width: 1px;
    opacity: 1;
    pointer-events: auto;
  }

  .pricing-hero p {
    text-align: center;
  }

  .tabs {
    width: 100%;
    justify-content: space-between;
  }

  .tab {
    flex: 1;
    text-align: center;
  }

  .stack-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .stack-block {
    padding: 12px;
    border-radius: 16px;
  }

  .stack-card {
    padding: 14px;
  }

  .stack-actions {
    grid-template-columns: 1fr;
  }

  .hero-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .plan-badge {
    position: static;
    justify-self: start;
  }

  .toast {
    left: 16px;
    right: 16px;
  }

  .billing-toggle {
    justify-self: center;
    flex-wrap: wrap;
  }
}

.auth-alert {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.auth-alert.alert-success {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.auth-alert.alert-warning {
  background: #fff3cd;
  color: #856404;
  border-color: #ffeeba;
}

.auth-alert.alert-error {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

/* Footer */
.site-footer {
  margin-top: 64px;
  background: #0b1533;
  color: #e7edf7;
  padding: 48px 4vw 32px;
  --footer-max: 960px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-grid {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px 200px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  max-width: var(--footer-max);
  margin: 0 auto;
}

.footer-col {
  text-align: center;
}

.footer-col h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #ffffff;
}

.footer-col a {
  display: block;
  color: #c8d3e6;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #c8d3e6;
  font-size: 0.95rem;
  padding-top: 18px;
  width: 100%;
  max-width: var(--footer-max);
  margin: 0 auto;
  text-align: center;
}

.footer-bottom a {
  color: #c8d3e6;
}

/* Legal & contact pages */
.content-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 4vw 80px;
  min-height: calc(100vh - 140px);
}

.legal-page {
  min-height: calc(100vh - 140px);
  display: block;
}

.card-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

/* API docs */
.api-page {
  display: grid;
  gap: 24px;
}

.api-hero {
  display: grid;
  gap: 12px;
}

.api-hero h1 {
  margin-top: 0;
}

.api-callout {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f2f6ff;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: fit-content;
}

.api-hero .api-callout {
  margin: 0 auto;
}

.api-quickstart-callout {
  margin-top: 12px;
}

.api-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.api-grid {
  display: grid;
  gap: 18px;
  align-items: start;
}

.api-grid > * {
  min-width: 0;
}

.api-grid-auth {
  grid-template-columns: minmax(0, 1fr);
  max-width: 760px;
  margin: 0 auto;
  justify-items: center;
}

.api-grid-endpoints {
  display: block;
  column-count: 1;
  column-gap: 18px;
  column-fill: balance;
}

.api-card {
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.api-key-card {
  width: 100%;
  max-width: none;
  text-align: center;
}

.api-card h3,
.api-card p {
  margin: 0;
}

.api-key-card {
  display: grid;
  gap: 12px;
}

.api-key-status {
  font-size: 0.95rem;
  color: var(--text);
}

.api-key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.api-key-card .api-callout {
  width: 100%;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

.api-key-card .api-callout code {
  word-break: break-all;
}

.api-key-output {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fff;
}

.api-key-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.api-key-row code {
  flex: 1;
  word-break: break-all;
}

.api-key-warning {
  font-size: 0.85rem;
  color: var(--muted);
}

.api-key-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.api-endpoint {
  display: grid;
  gap: 10px;
  break-inside: avoid;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fbfdff;
  min-width: 0;
}

.api-endpoint p,
.api-endpoint ul {
  margin: 0;
}

.api-endpoint ul {
  padding-left: 18px;
}

.api-endpoint-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.api-method {
  background: #e2e8f0;
  color: #1f2a44;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  min-width: 52px;
  text-align: center;
}

.api-path {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", "Menlo", monospace;
  font-size: 0.95rem;
}

.api-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.api-note {
  font-size: 0.95rem;
  color: var(--muted);
}

.api-steps {
  counter-reset: api-step;
}

.api-steps li {
  position: relative;
  padding: 12px 16px;
  background: #f6f8ff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.api-steps li::before {
  content: counter(api-step);
  counter-increment: api-step;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #1f2a44;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.api-steps li > * {
  margin: 0;
}

.api-step-body {
  display: grid;
  gap: 8px;
}

.api-steps .api-callout {
  margin-top: 0;
  flex-wrap: nowrap;
}

.api-quickstart-callout code {
  white-space: nowrap;
}

.api-quickstart-callout {
  flex-wrap: nowrap;
}

@media (max-width: 839px) {
  .api-quickstart-callout {
    flex-wrap: wrap;
  }

  .api-quickstart-callout code {
    white-space: normal;
  }
}

.api-bullets li {
  position: relative;
  padding: 10px 12px 10px 34px;
  background: #f6f8ff;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
}

.api-bullets li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2fb7ff;
}

.api-errors {
  display: grid;
  gap: 10px;
}

.api-error {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #f6f8ff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
}

.api-error-code {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", "Menlo", monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: #1f2a44;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 4px 10px;
  min-width: 52px;
  text-align: center;
}

.api-error-text {
  font-weight: 600;
  color: var(--text);
}

.api-error-detail {
  display: block;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

.api-examples {
  display: grid;
  gap: 18px;
}

.api-example {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fbfdff;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.api-example-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.api-example-header h3 {
  margin: 0;
}

.api-example-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1f2a44;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 4px 10px;
}

.api-example-tips {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}

/* SEO guide pages */
.seo-page {
  display: grid;
  gap: 24px;
}

.seo-hero {
  display: grid;
  gap: 12px;
}

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

.seo-card {
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.seo-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.seo-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.seo-link-card {
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.seo-link-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.seo-link-card h3 {
  margin: 0;
  font-size: 1rem;
}

.seo-link-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (min-width: 900px) {
  .api-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .api-grid-auth {
    grid-template-columns: minmax(0, 1fr);
  }

  .api-grid-endpoints {
    column-count: 2;
  }
}

.legal-page h1 {
  margin: 0 0 12px;
  font-size: 2rem;
}

.legal-page h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  line-height: 1.6;
}

.legal-page ul {
  padding-left: 20px;
}

.contact-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  align-items: start;
  min-height: calc(100vh - 140px);
  justify-items: center;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  width: 100%;
  max-width: 560px;
}

.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #f9fbff;
  font-size: 1rem;
  color: var(--text);
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form .button {
  width: 100%;
  margin-top: 12px;
}

.contact-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.contact-meta strong {
  color: var(--text);
}

.hidden-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

@media (max-width: 700px) {
  .footer-grid {
    flex-wrap: nowrap;
    gap: 16px;
    width: 100%;
  }

  .footer-col {
    flex: 1;
  }
}

/* ========================================
   SEO Content Sections
   ======================================== */

.seo-content, .seo-faq {
  background: #f8f9fa;
  padding: 4rem 2rem;
  margin-top: 4rem;
}

.container-seo {
  max-width: 900px;
  margin: 0 auto;
}

.seo-content h2, .seo-faq h2 {
  font-size: 2rem;
  color: #0066cc;
  margin-bottom: 1.5rem;
  text-align: center;
}

.seo-content h3, .seo-faq h3 {
  font-size: 1.5rem;
  color: #333;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.seo-content p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #555;
  margin-bottom: 1.5rem;
}

.seo-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.seo-list li {
  padding: 0.75rem 0 0.75rem 2rem;
  position: relative;
  line-height: 1.6;
  color: #555;
}

.seo-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #0066cc;
  font-weight: bold;
  font-size: 1.2rem;
}

.seo-list code, .faq-item code {
  background: #e9ecef;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #d63384;
}

/* FAQ Styling */
.faq-item {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: box-shadow 0.3s ease;
}

.faq-item:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.faq-item h3 {
  font-size: 1.2rem;
  color: #0066cc;
  margin-top: 0;
  margin-bottom: 1rem;
}

.faq-item p {
  font-size: 1rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 0.5rem;
}

.faq-item a {
  color: #0066cc;
  text-decoration: none;
}

.faq-item a:hover {
  text-decoration: underline;
}

/* Screen-reader only (SEO but invisible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .seo-content, .seo-faq {
    padding: 2rem 1rem;
  }

  .seo-content h2, .seo-faq h2 {
    font-size: 1.5rem;
  }

  .seo-content h3, .seo-faq h3 {
    font-size: 1.2rem;
  }
}
