:root {
  color-scheme: dark;
  --ink: #f4f2eb;
  --muted: #9da3ad;
  --quiet: #737b88;
  --base: #0b0d12;
  --base-soft: #10131a;
  --panel: #151820;
  --panel-high: #1a1e27;
  --line: #2a2f3b;
  --line-soft: #202530;
  --lime: #b8f45d;
  --lime-ink: #172006;
  --mint: #78e5bb;
  --violet: #a99df5;
  --gold: #f0c96d;
  --danger: #ff9c9c;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--base);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 4%, rgba(111, 81, 184, .19), transparent 28rem),
    radial-gradient(circle at 3% 34%, rgba(53, 136, 103, .13), transparent 28rem),
    linear-gradient(180deg, #0b0d12 0%, #0d1016 72%, #0b0d12 100%);
  font: 400 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(184, 244, 93, .45);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: rgba(11, 13, 18, .84);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: cover;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.brand-copy strong {
  overflow: hidden;
  font-size: .88rem;
  letter-spacing: .06em;
  text-overflow: ellipsis;
}

.brand-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: .7rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.once-pill {
  display: none;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 700;
}

.button,
.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
}

.button:hover,
.send-button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.send-button:disabled {
  cursor: wait;
  opacity: .55;
  transform: none;
}

.button-small {
  min-height: 40px;
  padding: 10px 13px;
  font-size: .82rem;
}

.button-accent {
  background: var(--lime);
  color: var(--lime-ink);
}

.button-primary,
.send-button {
  background: var(--ink);
  color: var(--base);
}

.button-secondary {
  border-color: var(--line);
  background: var(--panel-high);
  color: var(--ink);
}

.privacy-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  min-height: 36px;
  padding: 7px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  background: rgba(16, 19, 26, .8);
  font-size: .7rem;
  font-weight: 650;
  white-space: nowrap;
  scrollbar-width: none;
}

.privacy-ribbon::-webkit-scrollbar {
  display: none;
}

.privacy-ribbon span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--mint);
  vertical-align: 1px;
}

.page {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.hero {
  display: grid;
  gap: 28px;
  padding: 18px 2px 36px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--mint);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.15rem, 8.5vw, 5.2rem);
  font-weight: 790;
  letter-spacing: -.064em;
  line-height: .98;
}

.hero-copy {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.22rem);
}

.hero-note {
  align-self: end;
  display: grid;
  gap: 5px;
  max-width: 480px;
  padding: 18px;
  border: 1px solid rgba(240, 201, 109, .2);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(240, 201, 109, .1), rgba(169, 157, 245, .06));
}

.hero-note strong {
  color: var(--gold);
  font-size: .88rem;
}

.hero-note span {
  color: #c7c2b5;
  font-size: .84rem;
}

.mode-switcher {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(21, 24, 32, .78);
  box-shadow: var(--shadow);
}

.mode-button {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.mode-button > span {
  color: var(--ink);
  font-weight: 800;
}

.mode-button b {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--gold);
  background: rgba(240, 201, 109, .1);
  font-size: .62rem;
  letter-spacing: .03em;
  vertical-align: 2px;
}

.mode-button small {
  overflow: hidden;
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-button.is-active {
  border-color: #3b4351;
  background: var(--panel-high);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.mode-button.is-active::before {
  content: "";
  width: 22px;
  height: 3px;
  margin-bottom: 5px;
  border-radius: 999px;
  background: var(--lime);
}

.mode-summary {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 4px 18px;
}

.mode-summary h2,
.provider-card h2,
.desk-offer h2 {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 2rem);
  letter-spacing: -.04em;
  line-height: 1.08;
}

.mode-summary p:not(.eyebrow):not(.meter) {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .92rem;
}

.meter {
  flex: 0 0 auto;
  margin: 0;
  color: var(--gold);
  font-size: .76rem;
  font-weight: 750;
}

.desk-gate,
.provider-card,
.desk-settings {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 24, 32, .92);
  box-shadow: var(--shadow);
}

.desk-gate {
  display: grid;
  overflow: hidden;
}

.desk-offer,
.unlock-card {
  padding: clamp(22px, 6vw, 36px);
}

.desk-offer {
  background:
    radial-gradient(circle at 100% 0%, rgba(184, 244, 93, .16), transparent 15rem),
    linear-gradient(145deg, #1a1e24, #13161d);
}

.desk-offer > p:not(.eyebrow) {
  max-width: 590px;
  margin: 13px 0 0;
  color: var(--muted);
}

.feature-list {
  display: grid;
  gap: 9px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 24px;
  color: #d5d8d2;
  font-size: .9rem;
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--lime);
  font-weight: 900;
}

.unlock-card {
  display: grid;
  align-content: center;
  gap: 22px;
  border-top: 1px solid var(--line);
}

.unlock-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.subtle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .86rem;
}

label {
  display: grid;
  gap: 7px;
  color: #cfd3d9;
  font-size: .75rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #343a46;
  border-radius: 12px;
  color: var(--ink);
  background: #10131a;
}

input,
select {
  min-height: 45px;
  padding: 10px 12px;
}

textarea {
  padding: 12px 13px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #696f7a;
}

.inline-form {
  display: grid;
  gap: 8px;
}

.form-status {
  min-height: 1.3em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .78rem;
}

.form-status.is-error {
  color: var(--danger);
}

.form-status.is-success {
  color: var(--mint);
}

.recover {
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.recover summary {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}

.recover form {
  margin-top: 14px;
}

.provider-card {
  display: grid;
  gap: 20px;
  padding: clamp(20px, 5vw, 30px);
}

.provider-grid {
  display: grid;
  gap: 12px;
}

.privacy-copy {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.55;
}

.privacy-copy strong {
  color: #d9ddd7;
}

.desk-settings {
  overflow: hidden;
}

.desk-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  list-style: none;
  cursor: pointer;
}

.desk-settings summary::-webkit-details-marker {
  display: none;
}

.desk-settings summary > span:first-child {
  display: grid;
  gap: 3px;
}

.desk-settings summary strong {
  font-size: .9rem;
}

.desk-settings summary small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 400;
}

.summary-action {
  color: var(--lime);
  font-size: .74rem;
  font-weight: 800;
}

.settings-body {
  display: grid;
  gap: 18px;
  padding: 4px 20px 22px;
}

.settings-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.settings-footer .privacy-copy {
  max-width: 760px;
}

.text-button,
.icon-button,
.starter-prompts button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.text-button {
  padding: 7px 6px;
  font-size: .75rem;
  font-weight: 750;
}

.text-button:hover {
  color: var(--ink);
}

.danger-text:hover {
  color: var(--danger);
}

.workspace {
  display: grid;
  gap: 12px;
  min-height: 610px;
}

.conversation-rail,
.chat-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 24, 32, .94);
  box-shadow: var(--shadow);
}

.conversation-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 280px;
  max-height: 65vh;
}

.rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.rail-header h2 {
  margin: 0;
  font-size: 1rem;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--panel-high);
  font-size: 1.15rem;
}

.conversation-list {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
  overflow-y: auto;
}

.conversation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 12px;
}

.conversation-row.is-active {
  border-color: #414957;
  background: var(--panel-high);
}

.conversation-open {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.conversation-open strong,
.conversation-open small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-open strong {
  font-size: .8rem;
}

.conversation-open small {
  color: var(--quiet);
  font-size: .65rem;
}

.conversation-delete {
  align-self: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  color: var(--quiet);
  background: transparent;
  cursor: pointer;
}

.conversation-delete:hover {
  color: var(--danger);
  background: rgba(255, 156, 156, .08);
}

.rail-note {
  margin: 0;
  padding: 13px 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--quiet);
  font-size: .65rem;
}

.chat-card {
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto auto;
  min-height: 610px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 71px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.chat-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-header h2 {
  overflow: hidden;
  max-width: min(56vw, 530px);
  margin: 0;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-tools {
  display: flex;
  align-items: center;
  gap: 1px;
}

.export-menu {
  display: flex;
  align-items: center;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 24px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.message {
  width: fit-content;
  max-width: min(88%, 720px);
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 17px 17px 17px 5px;
  color: #e7e9e6;
  background: var(--panel-high);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.user {
  align-self: flex-end;
  border-color: rgba(120, 229, 187, .25);
  border-radius: 17px 17px 5px 17px;
  color: #e7fff6;
  background: rgba(27, 74, 59, .48);
}

.message.system-note {
  align-self: center;
  max-width: 520px;
  padding: 10px 13px;
  border-style: dashed;
  border-radius: 13px;
  color: var(--muted);
  background: rgba(16, 19, 26, .65);
  font-size: .76rem;
  text-align: center;
}

.message-meta {
  display: block;
  margin-top: 7px;
  color: var(--quiet);
  font-size: .63rem;
}

.empty-chat {
  align-self: center;
  display: grid;
  gap: 7px;
  max-width: 450px;
  margin: auto;
  padding: 28px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-chat strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.empty-chat span {
  font-size: .82rem;
}

.typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: .76rem;
}

.typing::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 12px 0 var(--mint), 24px 0 var(--violet);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: .35; transform: translateY(-2px); }
}

.starter-prompts {
  display: flex;
  gap: 7px;
  padding: 0 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.starter-prompts::-webkit-scrollbar {
  display: none;
}

.starter-prompts button {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #12151c;
  font-size: .69rem;
  font-weight: 700;
  white-space: nowrap;
}

.starter-prompts button:hover {
  border-color: #4c5664;
  color: var(--ink);
}

.composer {
  margin: 0 10px 10px;
  overflow: hidden;
  border: 1px solid #363d49;
  border-radius: 17px;
  background: #10131a;
}

.composer:focus-within {
  border-color: #687363;
  box-shadow: 0 0 0 3px rgba(184, 244, 93, .08);
}

.composer textarea {
  min-height: 62px;
  max-height: 210px;
  padding: 14px 14px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  resize: none;
}

.composer textarea:focus {
  outline: 0;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 7px 7px 14px;
}

.composer-footer p {
  margin: 0;
  color: var(--quiet);
  font-size: .64rem;
}

.send-button {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 11px;
  font-size: .78rem;
}

.promise-grid {
  display: grid;
  gap: 1px;
  margin-top: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.promise-grid article {
  padding: 22px;
  background: #11141a;
}

.promise-grid article > span {
  color: var(--lime);
  font: 700 .68rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.promise-grid h2 {
  margin: 18px 0 7px;
  font-size: 1rem;
  letter-spacing: -.02em;
}

.promise-grid p {
  margin: 0;
  color: var(--muted);
  font-size: .79rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  color: var(--quiet);
  font-size: .72rem;
}

.site-footer nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

.legal-page {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

.legal-page > h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.35rem, 8vw, 4.8rem);
  letter-spacing: -.06em;
  line-height: 1;
}

.legal-lead {
  margin: 24px 0 44px;
  color: #d6d9d4;
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
}

.legal-page section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.legal-page section h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}

.legal-page section p {
  margin: 10px 0 0;
  color: var(--muted);
}

.legal-page section a {
  color: var(--mint);
}

.noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  padding: 14px;
  border-radius: 12px;
  color: #241b00;
  background: var(--gold);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 560px) {
  .once-pill {
    display: inline;
  }

  .mode-switcher {
    grid-template-columns: repeat(3, 1fr);
  }

  .inline-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .inline-form .button {
    min-width: 126px;
  }

  .provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .key-field {
    grid-column: span 2;
  }

  .promise-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .chat-log {
    padding: 28px 24px;
  }

  .starter-prompts {
    padding-right: 24px;
    padding-left: 24px;
  }

  .composer {
    margin: 0 18px 18px;
  }
}

@media (min-width: 820px) {
  .page {
    padding-top: 66px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(280px, .42fr);
    align-items: end;
    padding-bottom: 54px;
  }

  .desk-gate {
    grid-template-columns: 1.06fr .94fr;
  }

  .unlock-card {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .provider-card {
    grid-template-columns: minmax(230px, .62fr) minmax(0, 1fr);
    align-items: center;
  }

  .provider-card .privacy-copy {
    grid-column: 1 / -1;
  }

  .workspace.has-desk {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .workspace.has-desk .conversation-rail {
    max-height: none;
  }

  .conversations-toggle {
    display: none !important;
  }

  .provider-grid {
    grid-template-columns: minmax(130px, .6fr) minmax(170px, .9fr) minmax(170px, 1fr);
  }

  .key-field {
    grid-column: auto;
  }
}

@media (max-width: 819px) {
  .conversation-rail.mobile-collapsed {
    display: none;
  }
}

@media (max-width: 559px) {
  .site-header {
    min-height: 62px;
  }

  .brand-copy span {
    display: none;
  }

  .page {
    width: min(100% - 20px, 1180px);
    padding-top: 24px;
  }

  .hero-note {
    padding: 15px;
  }

  .mode-summary {
    display: block;
  }

  .meter {
    margin-top: 9px;
  }

  .settings-footer {
    display: grid;
  }

  .chat-header {
    padding: 12px 10px;
  }

  .chat-tools .text-button {
    padding-right: 5px;
    padding-left: 5px;
    font-size: .69rem;
  }

  .chat-card {
    min-height: 68vh;
  }

  .workspace {
    min-height: 68vh;
  }

  .composer-footer p {
    max-width: 170px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
