:root {
  --bg: #f6f5f3;
  --ink: #111111;
  --muted: #6f6c66;
  --soft: #e7e5e1;
  --line: rgba(17, 17, 17, 0.08);
  --user: #111111;
  --danger: #8d2b2b;
  --font: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}

body {
  min-height: 100dvh;
}

a { color: inherit; }

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

button {
  cursor: pointer;
  border: 0;
  background: none;
}

.wrap {
  width: min(100%, 440px);
  margin: 0 auto;
  padding: 20px 20px 40px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.wordmark {
  font-weight: 600;
  letter-spacing: -0.04em;
  text-decoration: none;
  font-size: 18px;
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
}

.hero {
  padding: 28px 0 8px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(40px, 11vw, 56px);
  line-height: 0.96;
  letter-spacing: -0.055em;
  font-weight: 500;
}

.lede {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  max-width: 28rem;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 22px 0 14px;
}

.price {
  font-size: 28px;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.price span, .quiet {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  text-decoration: none;
  font-size: 16px;
}

.btn.block { width: 100%; }

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

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

.text-btn {
  color: var(--muted);
  min-height: 44px;
  padding: 0 8px;
}

.preview {
  margin-top: 28px;
  background: #f3f2ef;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px 16px 18px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.landing {
  width: min(100%, 440px);
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
}

.landing h1 {
  margin: 4px 0 0;
  text-align: center;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.045em;
  font-weight: 600;
}

.landing .lede {
  margin: 8px auto 0;
  text-align: center;
  max-width: 22rem;
  font-size: 16px;
}

.landing .preview {
  margin-top: 20px;
  aspect-ratio: 1;
  min-height: 0;
  height: auto;
  overflow: auto;
  border-radius: 28px;
  text-align: left;
  -webkit-overflow-scrolling: touch;
}

.signup-label {
  margin: 22px 0 0;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.landing .field {
  margin: 12px 0 8px;
  text-align: left;
}

.landing .error {
  text-align: left;
}

.landing .foot {
  text-align: center;
}

.landing .text-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.preview-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bubble {
  max-width: 88%;
  padding: 12px 16px;
  font-size: 15.5px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.bubble.user {
  align-self: flex-end;
  background: var(--user);
  color: white;
  border-radius: 22px;
}

.bubble.assistant {
  align-self: flex-start;
  background: var(--soft);
  color: #171717;
  border-radius: 18px;
  max-width: 94%;
}

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

.notes {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.notes li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.notes strong {
  display: block;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 2px;
}

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

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

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen.center {
  justify-content: center;
}

.hidden { display: none !important; }

.auth-card, .pay-card {
  width: min(100%, 440px);
  margin: 0 auto;
  padding: 24px 20px 32px;
}

.auth-card h1, .pay-card h1 {
  margin: 18px 0 8px;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 500;
}

.field {
  display: block;
  margin: 22px 0 12px;
}

.field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.field input, .composer textarea {
  width: 100%;
  border: 1px solid rgba(17, 17, 17, 0.16);
  background: white;
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
  font-size: 16px;
}

.field input:focus, .composer textarea:focus {
  border-color: #111;
}

.error {
  min-height: 1.3em;
  color: var(--danger);
  font-size: 14px;
  margin: 8px 0 12px;
}

.chat-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(246, 245, 243, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.left-count {
  color: var(--muted);
  font-size: 13px;
}

.log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px 12px;
  width: min(100%, 680px);
  margin: 0 auto;
}

.suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 15px;
}

.composer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 75%, rgba(246, 245, 243, 0));
}

.composer textarea {
  resize: none;
  min-height: 52px;
  max-height: 140px;
  border-radius: 22px;
}

.composer .btn {
  min-width: 72px;
  height: 52px;
}

.sheet {
  position: fixed;
  inset: auto 16px calc(16px + env(safe-area-inset-bottom));
  background: white;
  border-radius: 20px;
  padding: 8px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
}

.sheet button, .sheet a {
  text-align: left;
  text-decoration: none;
  padding: 14px 12px;
  border-radius: 12px;
  font-size: 16px;
}

.legal {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.legal h1 {
  font-size: 40px;
  letter-spacing: -0.05em;
  font-weight: 500;
  line-height: 1;
}

.legal h2 {
  font-size: 18px;
  letter-spacing: -0.03em;
  margin: 28px 0 8px;
}

.legal p { color: #2a2a2a; }

@media (min-width: 800px) {
  .wrap { width: min(100%, 920px); padding-top: 28px; }
  .landing { width: min(100%, 420px); padding-top: 36px; }
}
