:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #14b8a6;
  --accent-strong: #0d9488;
  --accent-dark: #0f766e;
  --danger: #ef4444;
  --success: #10b981;
  --shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 44px rgba(15, 23, 42, 0.08);
  --radius: 12px;
  --focus-ring: rgba(20, 184, 166, 0.5);
  --topbar-bg: rgba(249, 250, 251, 0.9);
  --hero-overlay: linear-gradient(90deg, rgba(15, 23, 42, 0.94) 0%, rgba(15, 23, 42, 0.72) 42%, rgba(15, 23, 42, 0.12) 82%);
  --user-bubble: #f0fdfa;
  --user-bubble-border: #99f6e4;
  color-scheme: light;
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

html.dark {
  --bg: #020617;
  --surface: #0f172a;
  --surface-2: #1e293b;
  --ink: #f3f4f6;
  --muted: #94a3b8;
  --line: #334155;
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-dark: #0f766e;
  --danger: #f87171;
  --success: #34d399;
  --shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 20px 44px rgba(0, 0, 0, 0.3);
  --focus-ring: rgba(45, 212, 191, 0.45);
  --topbar-bg: rgba(2, 6, 23, 0.9);
  --hero-overlay: linear-gradient(90deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.2) 82%);
  --user-bubble: rgba(20, 184, 166, 0.12);
  --user-bubble-border: rgba(45, 212, 191, 0.36);
  color-scheme: dark;
}

/* Selected Gateway Console direction */
.gateway-site {
  --bg: #04111f;
  --surface: #0a1b2d;
  --surface-2: #0e2237;
  --ink: #f7fbff;
  --muted: #9fb0c3;
  --line: #243b52;
  --topbar-bg: rgba(4, 17, 31, 0.88);
  background: radial-gradient(circle at 50% -20%, #10314a 0, #04111f 42%);
}

.gateway-site .site-topbar { max-width: 1440px; margin: 0 auto; }
.gateway-site .nav a.active { color: var(--ink); }
.gateway-site .btn.outline { border-color: #3b8490; background: transparent; color: var(--ink); }
.gateway-site .eyebrow { color: #58d3c1; }

.gateway-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
  gap: clamp(44px, 7vw, 100px);
  align-items: center;
  width: min(1320px, calc(100% - 64px));
  min-height: 670px;
  margin: 0 auto;
  padding: 90px 0 70px;
}
.gateway-hero h1 { max-width: 680px; font-size: clamp(52px, 5vw, 72px); line-height: 1; letter-spacing: -.045em; }
.hero-lede { max-width: 620px; color: var(--muted); font-size: 18px; }
.gateway-proofs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 48px; }
.gateway-proofs div { display: grid; gap: 5px; }
.gateway-proofs strong { font-size: 14px; }
.gateway-proofs span { color: var(--muted); font-size: 12px; }
.gateway-code { overflow: hidden; border: 1px solid #355068; border-radius: 16px; background: rgba(8, 25, 42, .88); box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.code-copy { border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; background: transparent; color: var(--muted); cursor: pointer; }
.gateway-code pre { margin: 0; padding: 22px; overflow: auto; color: #c7d6e5; font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.gateway-code code { white-space: pre; }
.code-tags { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.code-tags span, .pricing-facts span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.gateway-section { width: min(1240px, calc(100% - 64px)); margin: 0 auto; padding: 80px 0; border-top: 1px solid var(--line); }
.gateway-steps { display: grid; grid-template-columns: repeat(3, 1fr); }
.gateway-steps article { padding: 28px; border-left: 1px solid var(--line); }
.gateway-steps article:first-child { border-left: 0; }
.gateway-steps article > span { color: #58d3c1; font: 12px ui-monospace, monospace; }
.gateway-steps p, .gateway-pricing-summary p, .account-summary p { color: var(--muted); }
.gateway-pricing-summary, .account-summary { display: flex; justify-content: space-between; align-items: center; gap: 32px; }

.pricing-page { padding-bottom: 40px; }
.pricing-hero { max-width: 860px; margin: 0 auto; padding: 74px 24px 42px; text-align: center; }
.pricing-hero h1 { font-size: clamp(40px, 5vw, 66px); letter-spacing: -.045em; }
.pricing-hero > p:not(.eyebrow) { color: var(--muted); font-size: 17px; }
.pricing-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.pricing-section { width: min(1180px, calc(100% - 48px)); margin: 0 auto 26px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pricing-card { position: relative; display: flex; flex-direction: column; min-height: 430px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: rgba(10,27,45,.8); }
.pricing-card.recommended { border-color: #41bbaa; box-shadow: 0 22px 70px rgba(34,197,179,.12); }
.popular { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); padding: 5px 14px; border-radius: 999px; background: #55cbb9; color: #04111f; font-size: 12px; font-weight: 800; }
.pricing-card h2 { font-size: 28px; }
.pricing-card p, .pricing-card li { color: var(--muted); }
.pricing-price { display: flex; align-items: baseline; gap: 8px; margin: 24px 0; }
.pricing-price strong { font-size: 39px; }
.pricing-price span { color: var(--muted); }
.pricing-card ul { display: grid; gap: 11px; padding: 0; list-style: none; }
.pricing-card li::before { content: "✓"; margin-right: 9px; color: #58d3c1; }
.pricing-coming-soon { width: 100%; margin-top: auto; background: #26384c; color: #9fb0c3; }
.usage-panel, .enterprise-panel { display: grid; grid-template-columns: .9fr 1.3fr; gap: 36px; padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: rgba(10,27,45,.7); }
.usage-panel p, .enterprise-panel p { color: var(--muted); }
.usage-facts, .enterprise-tiers { display: grid; grid-template-columns: repeat(3, 1fr); }
.usage-facts div, .enterprise-tiers div { display: grid; gap: 8px; padding: 16px 22px; border-left: 1px solid var(--line); }
.usage-facts span, .enterprise-tiers span, .enterprise-tiers small { color: var(--muted); }
.enterprise-tiers strong { font-size: 21px; }
.pricing-faq { padding: 50px 0; }
.pricing-faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.pricing-faq summary { cursor: pointer; font-weight: 700; }
.pricing-faq p, .pricing-disclaimer { color: var(--muted); }
.pricing-disclaimer { width: min(900px, calc(100% - 48px)); margin: 30px auto; text-align: center; font-size: 12px; }

.mobile-chat-nav { display: none; }
body:has(.app-shell) { background: #04111f; }
body:has(.app-shell) .topbar,
body:has(.app-shell) .sidebar,
body:has(.app-shell) .chat-toolbar,
body:has(.app-shell) .composer { background: #071828; border-color: #22394f; }
body:has(.app-shell) .app-shell { color: #f7fbff; }
body:has(.app-shell) .sidebar { background: #061522; }
body:has(.app-shell) .chat-stream { background: radial-gradient(circle at center, #0b2236 0, #04111f 70%); }
body:has(.app-shell) .empty-panel { text-align: center; background: rgba(8,25,42,.84); border-color: #29445b; box-shadow: 0 30px 80px rgba(0,0,0,.24); }
body:has(.app-shell) .prompt-chip,
body:has(.app-shell) .balance-card,
body:has(.app-shell) .composer-inner,
body:has(.app-shell) select { background: #0b2033; color: #f7fbff; border-color: #29445b; }
body:has(.app-shell) .message .bubble { background: #0b2033; border-color: #29445b; }

@media (max-width: 960px) {
  .gateway-hero { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card { min-height: 0; }
  .usage-panel, .enterprise-panel { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .site-topbar .nav { display: none; }
  .site-topbar .nav-actions .ghost { display: none; }
  .site-topbar { padding: 0 16px; }
  .brand-logo { width: 118px; }
  .gateway-hero, .gateway-section { width: min(100% - 32px, 640px); }
  .gateway-hero { padding-top: 58px; min-height: auto; }
  .gateway-hero h1 { font-size: 48px; }
  .gateway-proofs, .gateway-steps, .usage-facts, .enterprise-tiers { grid-template-columns: 1fr; }
  .gateway-steps article, .usage-facts div, .enterprise-tiers div { border-left: 0; border-top: 1px solid var(--line); }
  .gateway-pricing-summary, .account-summary { align-items: flex-start; flex-direction: column; }
  .pricing-section { width: calc(100% - 32px); }
  .pricing-hero { padding-top: 52px; }
  .pricing-card, .usage-panel, .enterprise-panel { padding: 22px; }
  body:has(.app-shell) .topbar { min-height: 54px; }
  body:has(.app-shell) .topbar .nav, body:has(.app-shell) .topbar .nav-actions { display: none; }
  body:has(.app-shell) .app-shell { grid-template-columns: 1fr; min-height: calc(100dvh - 108px); }
  body:has(.app-shell) .sidebar { display: none; }
  body:has(.app-shell) .chat-main { min-height: calc(100dvh - 108px); }
  body:has(.app-shell) .chat-toolbar { align-items: flex-start; padding: 12px; }
  body:has(.app-shell) .chat-toolbar > div:first-child { display: none; }
  body:has(.app-shell) .chat-controls { width: 100%; justify-content: space-between; }
  body:has(.app-shell) .chat-stream { padding: 12px; }
  body:has(.app-shell) .empty-panel { padding: 22px 16px; }
  body:has(.app-shell) .prompt-grid { grid-template-columns: 1fr; }
  body:has(.app-shell) .composer { padding: 10px 12px; }
  .mobile-chat-nav { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr 1fr; min-height: 54px; background: #071828; border-top: 1px solid #22394f; }
  .mobile-chat-nav a { display: grid; place-items: center; color: #9fb0c3; font-size: 12px; }
  .mobile-chat-nav a.active { color: #58d3c1; }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-size: 15px;
  line-height: 1.5;
}

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

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

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 720;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.brand-logo {
  display: block;
  width: 156px;
  height: 42px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover {
  color: var(--ink);
}

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

.account-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: 220px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--line);
  background: var(--surface-2);
}

.btn:focus-visible,
.language-select:focus-visible,
.field input:focus,
.field select:focus,
.field textarea:focus,
.composer textarea:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.btn.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.22);
}

.btn.primary:hover {
  background: linear-gradient(90deg, var(--accent-strong), var(--accent-dark));
  border-color: transparent;
}

.btn.accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  color: #ffffff;
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.btn.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.language-select {
  min-height: 36px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.hero {
  position: relative;
  min-height: min(740px, calc(100vh - 64px));
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--surface-2);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    var(--hero-overlay),
    url("./hero-dashboard.png");
  background-size: cover;
  background-position: center;
}

.hero-inner {
  position: relative;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 44px;
}

.hero-copy {
  width: min(650px, 100%);
  color: #ffffff;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-weight: 720;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy p {
  width: min(560px, 100%);
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
}

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

.hero-strip {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.22);
}

.strip-item {
  min-height: 90px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
}

.strip-label {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.strip-value {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 760;
}

.section {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.section-head p {
  max-width: 620px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.feature {
  padding: 22px;
}

.feature h3,
.plan h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.feature p,
.plan p {
  color: var(--muted);
}

.plan {
  padding: 24px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0;
}

.plan-price strong {
  font-size: 34px;
}

.plan ul {
  min-height: 118px;
  padding-left: 18px;
  color: var(--muted);
}

.account-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}

.auth-box {
  padding: 24px;
}

.auth-box h2 {
  margin-bottom: 8px;
}

.account-entry p {
  color: var(--muted);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}

.field textarea {
  resize: vertical;
}

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

.form-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-status[data-type="error"] {
  color: var(--danger);
}

.form-status[data-type="success"] {
  color: var(--success);
}

.tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.tab {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: 650;
}

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

.notice {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

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

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.footer {
  padding: 30px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
  min-height: calc(100vh - 64px);
}

.sidebar-head {
  display: grid;
  margin-bottom: 16px;
}

.balance-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.compact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.compact-card a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.balance-card span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.balance-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.compact-card strong {
  font-size: 20px;
}

.sidebar-section {
  margin-top: 18px;
  min-height: 0;
}

.sidebar-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.session-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 360px);
  overflow: auto;
}

.session-item {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.session-item span,
.session-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-item span {
  color: inherit;
  font-weight: 650;
}

.session-item small {
  color: var(--muted);
  font-size: 12px;
}

.session-item.active,
.session-item:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.sidebar-footer {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.sidebar-footer .btn {
  flex: 1;
}

.api-key-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.chat-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: calc(100vh - 64px);
}

.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
}

.chat-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-stream {
  overflow: auto;
  padding: 28px;
  background: var(--bg);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 100%;
}

.empty-panel {
  width: min(720px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.empty-panel h2 {
  margin-bottom: 10px;
  font-size: 30px;
  line-height: 1.1;
}

.empty-panel p {
  color: var(--muted);
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.prompt-chip {
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-weight: 650;
}

.prompt-chip:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.message {
  display: grid;
  grid-template-columns: 42px minmax(0, 720px);
  gap: 12px;
  margin: 0 auto 18px;
  width: min(920px, 100%);
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 750;
  font-size: 12px;
}

.message.user .avatar {
  background: var(--accent);
}

.bubble {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow);
}

.bubble strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.message.user .bubble {
  background: var(--user-bubble);
  border-color: var(--user-bubble-border);
}

.image-result {
  display: grid;
  gap: 10px;
}

.image-frame {
  display: grid;
  place-items: end start;
  aspect-ratio: 16 / 10;
  width: min(520px, 100%);
  border-radius: 7px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.88), rgba(15, 23, 42, 0.9)),
    url("./hero-dashboard.png");
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

img.image-frame {
  display: block;
  object-fit: cover;
  background: var(--surface-2);
}

.image-frame span {
  margin: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--muted);
  animation: typing-pulse 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes typing-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.composer {
  padding: 16px 22px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.composer-status {
  width: min(920px, 100%);
  min-height: 18px;
  margin: 0 auto 6px;
  color: var(--muted);
  font-size: 13px;
}

.composer-status[data-type="error"] {
  color: var(--danger);
}

.composer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  width: min(920px, 100%);
  margin: 0 auto;
}

.composer textarea {
  min-height: 54px;
  max-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  resize: none;
  line-height: 1.45;
}

.composer textarea:focus {
  border-color: var(--accent);
}

.cost-line {
  width: min(920px, 100%);
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 12px;
}

.hidden {
  display: none !important;
}

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

/* Pricing: quiet comparison surfaces with a single teal recommendation rail. */
.pricing-page {
  padding-bottom: 80px;
}

.pricing-hero,
.pricing-section,
.pricing-disclaimer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.pricing-hero {
  max-width: 880px;
  padding: 96px 24px 58px;
  text-align: center;
}

.pricing-hero h1 {
  max-width: 780px;
  margin: 12px auto 18px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.pricing-hero > p:not(.eyebrow) {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
}

.pricing-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 26px;
  margin-top: 32px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pricing-facts span::before {
  content: "/";
  margin-right: 8px;
  color: var(--accent-strong);
  font-weight: 900;
}

.pricing-section {
  padding: 64px 0;
  border-top: 1px solid var(--line);
}

.pricing-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  align-items: end;
  gap: 32px;
  margin-bottom: 28px;
}

.pricing-section h2 {
  max-width: 720px;
  margin: 6px 0 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.pricing-section-head > p,
.pricing-split > div > p,
.pricing-enterprise-copy > p,
.pricing-image-note > p {
  color: var(--muted);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.pricing-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 620px;
  flex-direction: column;
  padding: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.pricing-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--line);
  content: "";
}

.pricing-card.recommended {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  box-shadow: 0 22px 60px color-mix(in srgb, var(--accent) 14%, transparent);
}

.pricing-card.recommended::before {
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
}

.pricing-badge {
  align-self: flex-start;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.recommended .pricing-badge {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent-dark);
}

html.dark .recommended .pricing-badge {
  color: var(--accent);
}

.pricing-card h3 {
  margin: 28px 0 6px;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.pricing-audience {
  min-height: 66px;
  margin: 0;
  color: var(--muted);
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 28px 0;
}

.pricing-price strong {
  font-size: clamp(40px, 4vw, 54px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.pricing-price span {
  color: var(--muted);
  font-weight: 650;
}

.pricing-features {
  display: grid;
  gap: 13px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.pricing-features li {
  position: relative;
  padding-left: 22px;
}

.pricing-features li::before {
  position: absolute;
  left: 0;
  color: var(--accent-strong);
  content: "✓";
  font-weight: 900;
}

.pricing-features.compact {
  gap: 9px;
  margin: 24px 0 30px;
}

.pricing-card .pricing-coming-soon {
  width: 100%;
  margin-top: auto;
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.pricing-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.pricing-table th,
.pricing-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.pricing-table thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pricing-table tbody th {
  color: var(--ink);
  font-weight: 750;
}

.pricing-table tr:last-child th,
.pricing-table tr:last-child td {
  border-bottom: 0;
}

.pricing-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pricing-split,
.pricing-enterprise,
.pricing-image-note {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(36px, 7vw, 92px);
  align-items: start;
}

.pricing-credit-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  overflow: hidden;
}

.pricing-credit-card p {
  display: grid;
  gap: 4px;
  min-height: 112px;
  margin: 0;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pricing-credit-card p:nth-child(2n) {
  border-right: 0;
}

.pricing-credit-card p:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.pricing-credit-card strong {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.pricing-credit-card span {
  color: var(--muted);
  font-size: 13px;
}

.token-table td:not(:first-child) {
  font-variant-numeric: tabular-nums;
}

.pricing-image-note {
  padding-block: 50px;
}

.pricing-enterprise {
  align-items: center;
  border-top: 0;
  border-radius: 28px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 52%);
  padding: clamp(28px, 5vw, 58px);
}

.pricing-enterprise-copy .btn {
  min-height: 46px;
}

.enterprise-table {
  min-width: 620px;
}

.pricing-faq {
  max-width: 900px;
}

.pricing-faq details {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.pricing-faq summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
}

.pricing-faq summary:focus-visible {
  border-radius: 5px;
  outline: 3px solid var(--focus-ring);
  outline-offset: 5px;
}

.pricing-faq details p {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
}

.pricing-disclaimer {
  margin-top: 52px;
  padding: 22px 24px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: 0 16px;
  }

  .nav {
    display: none;
  }

  .hero-inner,
  .hero-strip,
  .section {
    width: min(100% - 32px, 1180px);
  }

  .hero-strip,
  .grid.three,
  .grid.two,
  .account-panel,
  .stat-grid,
  .prompt-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: block;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .session-list {
    max-height: 220px;
  }

  .chat-toolbar,
  .chat-controls,
  .nav-actions,
  .footer-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .account-pill {
    max-width: none;
  }

  .chat-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .message {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .composer-inner {
    grid-template-columns: 1fr;
  }

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

  .pricing-hero,
  .pricing-section,
  .pricing-disclaimer {
    width: min(100% - 32px, 720px);
  }

  .pricing-grid,
  .pricing-section-head,
  .pricing-split,
  .pricing-enterprise,
  .pricing-image-note {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    min-height: auto;
  }

  .pricing-card .pricing-coming-soon {
    margin-top: 10px;
  }
}

@media (max-width: 640px) {
  .pricing-hero {
    padding: 62px 0 42px;
  }

  .pricing-hero h1 {
    font-size: clamp(40px, 13vw, 58px);
  }

  .pricing-section {
    padding: 48px 0;
  }

  .pricing-card,
  .pricing-enterprise {
    padding: 22px;
    border-radius: 18px;
  }

  .pricing-credit-card {
    grid-template-columns: 1fr;
  }

  .pricing-credit-card p,
  .pricing-credit-card p:nth-child(2n),
  .pricing-credit-card p:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pricing-credit-card p:last-child {
    border-bottom: 0;
  }
}

@media print {
  .topbar,
  .footer,
  .pricing-coming-soon {
    display: none;
  }

  .pricing-card,
  .pricing-table-wrap,
  .pricing-enterprise {
    box-shadow: none;
  }
}

/* Keep the selected direction authoritative over legacy responsive rules. */
.gateway-site .site-topbar { flex-direction: row; align-items: center; }
.gateway-site .site-topbar .nav-actions { flex-direction: row; align-items: center; }
.gateway-site .pricing-hero { text-align: center; }
body:has(.app-shell) .topbar,
body:has(.app-shell) .sidebar,
body:has(.app-shell) .chat-toolbar,
body:has(.app-shell) .composer { background: #071828; border-color: #22394f; }
body:has(.app-shell) .chat-stream { background: radial-gradient(circle at center, #0b2236 0, #04111f 70%); }
body:has(.app-shell) .empty-panel { text-align: center; background: rgba(8,25,42,.84); border-color: #29445b; }
body:has(.app-shell) .user-card { padding: 12px; }
body:has(.app-shell) .user-card strong { margin-top: 4px; font-size: 14px; font-weight: 650; }

@media (max-width: 720px) {
  .gateway-site .site-topbar { min-height: 64px; padding: 0 16px; }
  .gateway-site .site-topbar .nav-actions { display: flex; gap: 8px; }
  .gateway-site .site-topbar .language-select { width: 94px; min-width: 0; }
  .gateway-site .site-topbar .btn.primary { min-height: 36px; padding: 0 11px; font-size: 12px; }
  .gateway-site .pricing-hero h1 { font-size: 40px; line-height: 1.03; }
  .gateway-site .pricing-hero > p:not(.eyebrow) { font-size: 16px; }
  .gateway-site .pricing-facts { align-items: center; }
  body:has(.app-shell) .app-shell { grid-template-columns: 1fr; min-height: calc(100dvh - 108px); }
  body:has(.app-shell) .sidebar { display: none; }
  body:has(.app-shell) .chat-main { min-height: calc(100dvh - 108px); }
  body:has(.app-shell) .chat-toolbar { flex-direction: row; padding: 12px; }
  body:has(.app-shell) .chat-toolbar > div:first-child { display: none; }
  body:has(.app-shell) .chat-controls { display: flex; flex-direction: row; width: 100%; }
  body:has(.app-shell) .composer-inner { grid-template-columns: minmax(0, 1fr) auto; }
  body:has(.app-shell) .prompt-grid { grid-template-columns: 1fr; }
  .mobile-chat-nav { display: grid; }
}

/* Legal, support, and merchant disclosure pages */
.legal-page {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

.legal-hero {
  max-width: 780px;
  padding-bottom: 48px;
}

.legal-hero h1 {
  max-width: 720px;
  margin: 10px 0 18px;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.legal-hero > p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.legal-effective {
  display: inline-flex;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.legal-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 720px);
  gap: clamp(44px, 8vw, 100px);
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 44px;
}

.legal-toc {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
}

.legal-toc strong {
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.legal-toc a {
  border-radius: 7px;
  padding: 7px 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.legal-toc a:hover,
.legal-toc a:focus-visible,
.footer-links a:hover,
.footer-links a:focus-visible,
.footer-merchant a:hover,
.footer-merchant a:focus-visible {
  color: var(--accent-strong);
}

.legal-toc a:focus-visible,
.footer-links a:focus-visible,
.footer-merchant a:focus-visible,
.legal-contact-link:focus-visible,
.contact-email:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.legal-document {
  min-width: 0;
}

.legal-document section {
  scroll-margin-top: 96px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 36px;
}

.legal-document section + section {
  padding-top: 36px;
}

.legal-document section:last-child {
  border-bottom: 0;
}

.legal-document h2 {
  margin: 0 0 13px;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.legal-document p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.legal-contact-link,
.contact-email {
  display: inline-flex;
  margin-top: 16px;
  border-radius: 7px;
  color: var(--accent-strong);
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact-card {
  border: 1px solid var(--line) !important;
  border-radius: 20px;
  padding: clamp(24px, 5vw, 38px) !important;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.contact-card .eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.contact-card .contact-email {
  margin: 4px 0 14px;
  font-size: clamp(22px, 4vw, 34px);
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.site-footer .footer-inner {
  align-items: flex-end;
}

.footer-merchant {
  display: grid;
  gap: 5px;
}

.footer-merchant strong {
  color: var(--ink);
}

.footer-merchant span,
.footer-merchant a {
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 22px;
}

.footer-links a {
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
}

.footer-links a[aria-current="page"] {
  color: var(--ink);
  font-weight: 750;
}

@media (max-width: 900px) {
  .legal-page {
    width: min(100% - 32px, 720px);
    padding: 52px 0 72px;
  }

  .legal-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .legal-toc {
    position: static;
  }

  .site-footer .footer-inner {
    align-items: flex-start;
  }

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

@media (max-width: 640px) {
  .legal-hero h1 {
    font-size: 40px;
  }

  .legal-hero > p:not(.eyebrow) {
    font-size: 16px;
  }

  .legal-document p {
    font-size: 15px;
  }
}
