@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --ink: #16231d;
  --muted: #52635a;
  --line: #d5ddd6;
  --green: #153e2e;
  --accent: #d1f064;
  --paper: #f5f7f2;
  --white: #fff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 'DM Sans', Arial, sans-serif; }
h1, h2, h3, .tier-price, .estimate, .meter strong { font-family: 'Space Grotesk', Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #377cc6; outline-offset: 4px; }
[hidden] { display: none !important; }

.simulation-banner { background: var(--green); color: white; text-align: center; padding: 8px 5%; font-size: 13px; }
.simulation-banner strong { color: var(--accent); margin-right: 8px; }
body > header { max-width: 1400px; padding: 25px 5%; margin: auto; display: flex; align-items: center; gap: 36px; border-bottom: 1px solid var(--line); }
.brand { display: block; flex: 0 1 270px; line-height: 0; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: clamp(210px, 20vw, 270px); max-width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: contain; }
nav { display: flex; gap: 30px; margin-left: auto; font-size: 14px; }
.preview { border: 1px solid #b9c8b8; border-radius: 30px; padding: 5px 13px; font-size: 12px; color: var(--muted); }

main { max-width: 1400px; margin: auto; padding: 0 5%; }
.intro { display: flex; justify-content: space-between; align-items: center; padding: 58px 0 34px; gap: 48px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .17em; color: var(--muted); margin: 0 0 14px; }
h1 { font-size: clamp(36px, 4.4vw, 62px); font-weight: 500; letter-spacing: -.05em; line-height: 1.08; margin: 0 0 20px; }
h2 { font-size: 34px; line-height: 1.2; letter-spacing: -.04em; font-weight: 500; margin: 0 0 20px; }
.lead { max-width: 560px; color: var(--muted); margin: 0; }
.intro-note { max-width: 275px; border-left: 2px solid #acbd9b; padding-left: 25px; }
.mini-label { font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.intro-note p { font-size: 20px; line-height: 1.4; margin: 12px 0; }
.intro-note small { color: var(--muted); font-size: 14px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); border: 1px solid var(--line); border-radius: 20px; background: white; overflow: hidden; margin-top: 10px; }
.choose, .session-panel { padding: 28px; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.section-label h2 { font-size: 20px; margin: 0; }
.section-label > span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tier { cursor: pointer; border: 1px solid var(--line); background: white; border-radius: 12px; text-align: left; padding: 17px; display: flex; flex-direction: column; color: var(--ink); transition: background .2s, border-color .2s; }
.tier:hover { background: #f4f8ec; }
.tier.selected { border: 2px solid var(--green); padding: 16px; background: #edf4dc; }
.tier.future { cursor: not-allowed; opacity: .68; }
.tier-symbol { font: 600 20px 'Space Grotesk', sans-serif; height: 35px; }
.tier-name { font-size: 18px; font-weight: 600; }
.tier-description { font-size: 14px; color: var(--muted); margin: 5px 0 16px; }
.tier-price { font-size: 22px; margin-top: auto; }
.tier-price small { font: 400 13px 'DM Sans', sans-serif; color: var(--muted); }
.tier-badge { display: inline-block; vertical-align: 2px; margin-left: 5px; border-radius: 10px; background: #e1e5df; padding: 2px 7px; color: var(--muted); font: 600 10px 'DM Sans', sans-serif; text-transform: uppercase; letter-spacing: .05em; }
.tier-badge.available { background: var(--accent); color: var(--green); }
.session-config { margin-top: 26px; }
.session-config label { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
.session-config output { font-weight: 400; }
.session-config input { width: 100%; accent-color: var(--green); margin: 17px 0 6px; }
.range-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.select-label { margin-top: 24px; }
.select-label span { color: var(--muted); font-size: 12px; font-weight: 400; }
select { width: 100%; padding: 12px; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: 14px; }
.model-details { margin-top: 24px; font-size: 14px; color: var(--muted); }
summary { cursor: pointer; color: var(--ink); }
.model-details p { margin: 10px 0; }

.session-panel { background: #f0f4ea; border-left: 1px solid var(--line); }
.credit-line { display: flex; justify-content: space-between; border-radius: 8px; background: rgba(255,255,255,.7); padding: 9px 11px; color: var(--muted); font-size: 13px; }
.credit-line strong { color: var(--green); }
.selected-name { font-size: 15px; margin: 26px 0 8px; }
.estimate { display: flex; flex-direction: column; }
.estimate > span { font-size: 52px; letter-spacing: -.06em; line-height: 1.1; }
.estimate small { font: 400 13px 'DM Sans', sans-serif; color: var(--muted); margin-top: 10px; }
dl { margin: 28px 0 18px; }
dl > div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin: 12px 0; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 500; text-align: right; }
.billing-note { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.primary { background: var(--green); color: white; border: none; padding: 15px 17px; width: 100%; border-radius: 9px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 15px; margin-top: 23px; }
.primary:hover { background: #20543f; }
.primary:disabled { opacity: .55; cursor: wait; }
.primary.accent { background: var(--accent); color: var(--green); font-weight: 700; }
.primary.accent:hover { background: #c4e352; }
.secondary { border: 1px solid var(--green); border-radius: 9px; background: transparent; width: 100%; padding: 10px; margin-top: 10px; cursor: pointer; color: var(--green); }
.status { font-size: 14px; color: var(--green); margin-top: 17px; min-height: 44px; }
.steps { font-size: 13px; padding-left: 22px; color: var(--muted); }
.steps li { padding: 3px 0; }
.steps .complete { font-weight: 600; color: var(--green); }
.disclosure { font-size: 12px; color: var(--muted); margin-top: 22px; }
.disclosure strong { display: block; margin-bottom: 4px; }

.chat-workspace { margin-top: 28px; border: 1px solid var(--green); border-radius: 20px; overflow: hidden; background: white; }
.chat-header { padding: 25px 28px; background: var(--green); color: white; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.workspace-actions { display: flex; gap: 8px; align-items: center; }
.auth-controls { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.auth-button { border: 1px solid rgba(255,255,255,.45); background: transparent; color: inherit; border-radius: 7px; padding: 7px 9px; cursor: pointer; font: inherit; font-size: .75rem; }
.chat-header h2 { margin: 0; color: white; }
.chat-header .eyebrow { color: var(--accent); }
.chat-model { color: #c9d5cf; font-size: 13px; margin: 7px 0 0; }
.end-button { flex: none; border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 9px; padding: 11px 16px; cursor: pointer; }
.end-button:hover { background: rgba(209,240,100,.12); }
.end-button:disabled { opacity: .5; cursor: default; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.meter > div { padding: 17px 22px; border-right: 1px solid var(--line); }
.meter > div:last-child { border-right: 0; }
.meter span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.meter strong { font-size: 20px; }
.meter-note { margin: 0; padding: 12px 22px; background: #f0f4ea; color: var(--muted); font-size: 12px; }
.messages { min-height: 230px; max-height: 480px; overflow-y: auto; padding: 28px; display: flex; flex-direction: column; gap: 13px; }
.message { max-width: 80%; border-radius: 12px; padding: 12px 15px; }
.message strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.message p { margin: 0px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user { align-self: flex-end; background: var(--green); color: white; }
.message.assistant { align-self: flex-start; background: #edf4dc; }
.message.streaming p::after { content: '▋'; color: #64820b; animation: blink .7s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chat-form { border-top: 1px solid var(--line); padding: 20px 28px 26px; }
.chat-form label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.chat-form > div { display: flex; gap: 10px; align-items: stretch; }
.chat-form textarea { resize: vertical; flex: 1; min-height: 58px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); }
.chat-form .primary { width: auto; margin: 0; justify-content: center; min-width: 90px; }

.pricing-section { padding: 75px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; border-bottom: 1px solid var(--line); }
.pricing-section > div > p:last-child { max-width: 420px; color: var(--muted); }
.pricing-notes article + article { margin-top: 28px; }
.pricing-notes h3 { margin-bottom: 5px; }
.pricing-notes p { margin: 0; color: var(--muted); }
.how { padding: 70px 0; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 35px; }
.how-grid article { border-top: 1px solid var(--line); padding-top: 18px; }
.how-grid article > span { color: var(--muted); font-size: 12px; }
.how-grid h3 { margin: 18px 0 8px; }
.how-grid p { color: var(--muted); margin: 0; }
footer { border-top: 1px solid var(--line); padding: 25px 5%; display: flex; justify-content: space-between; gap: 24px; color: var(--muted); font-size: 13px; }

@media (max-width: 800px) {
  body > header { gap: 16px; }
  nav { display: none; }
  .preview { margin-left: auto; }
  .intro { align-items: flex-start; }
  .intro-note { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .session-panel { border-left: 0; border-top: 1px solid var(--line); }
  .pricing-section { grid-template-columns: 1fr; gap: 35px; }
  .meter { grid-template-columns: repeat(2, 1fr); }
  .meter > div:nth-child(2) { border-right: 0; }
  .meter > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 520px) {
  .simulation-banner { text-align: left; }
  body > header { padding-block: 18px; }
  .brand { flex-basis: auto; min-width: 0; }
  .brand-logo { width: min(66vw, 210px); }
  .preview { display: none; }
  main { padding: 0 4%; }
  .intro { padding-top: 40px; }
  .tier-grid, .how-grid { grid-template-columns: 1fr; }
  .choose, .session-panel { padding: 20px; }
  .estimate > span { font-size: 44px; }
  .chat-header { align-items: flex-start; padding: 20px; }
  .meter { grid-template-columns: 1fr; }
  .meter > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .messages, .chat-form { padding: 20px; }
  .message { max-width: 92%; }
  .chat-form > div { flex-direction: column; }
  footer { flex-direction: column; }
}

.payments-panel { margin: 0 0 36px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: #f5f8ef; }
.payment-signin { display: grid; gap: 12px; max-width: 440px; }
.payment-signin input { width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.payment-signin small, .payment-receipts small { display: block; }
.payment-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 18px; }
.payment-actions button { width: auto; }
.payment-receipts { padding: 0; list-style: none; }
.payment-receipts li { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.payments-test .workspace { grid-template-columns: 1fr; }
.payments-test .preview { display: inline; }
[hidden] { display: none !important; }

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