:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6efe3;
  color: #1c2a2b;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; background: radial-gradient(circle at 18% 0%, #fffaf0 0 20%, transparent 48%), #f6efe3; }

button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.app-shell { width: min(720px, 100%); min-height: 100dvh; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; gap: 12px; margin: 2px 4px 25px; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid #d7c5a8; border-radius: 15px; background: #ffcf57; font-size: 25px; box-shadow: 0 6px 0 #e7ae29; }
h1, h2, p { margin: 0; }
h1 { font-size: 25px; letter-spacing: -.035em; }
h2 { font-size: 21px; line-height: 1.25; letter-spacing: -.03em; }
.eyebrow, .kicker { color: #697574; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow { margin-bottom: 3px; }
.kicker { margin-bottom: 7px; }

.status-badge, .two-person-pill, .route-indicator { margin-left: auto; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-badge { padding: 7px 10px; background: #e7e1d7; color: #5a655f; }
.status-badge[data-state="connecting"] { background: #e2f1ec; color: #096c58; }
.status-badge[data-state="connected"] { background: #d7f1dc; color: #176b31; }
.status-badge[data-state="error"] { background: #f7dedc; color: #a63127; }

.card { margin: 13px 0; padding: 21px; border: 1px solid #ddcfb9; border-radius: 20px; background: rgba(255, 252, 245, .9); box-shadow: 0 10px 28px rgba(91, 67, 28, .07); }
.intro-card { background: #203c3c; border-color: #203c3c; color: #fbf6ed; }
.intro-card .kicker { color: #b9d5c7; }
.intro-card h2 { max-width: 470px; margin-bottom: 9px; font-size: 25px; }
.intro-card p:last-child { max-width: 600px; color: #d5e1da; line-height: 1.55; font-size: 14px; }
.flow-card p.muted { margin: 10px 0 17px; }
.section-heading { display: flex; align-items: flex-start; gap: 12px; }
.muted { color: #667171; font-size: 14px; line-height: 1.5; }
.relay-toggle { display: flex; align-items: center; gap: 7px; margin-left: auto; color: #4b5c5a; font-size: 12px; font-weight: 700; white-space: nowrap; }
.relay-toggle input { width: 16px; height: 16px; accent-color: #0d7662; }

.primary-button, .secondary-button, .send-button { border: 0; border-radius: 12px; font-weight: 800; }
.primary-button { width: 100%; min-height: 48px; padding: 12px 16px; background: #0d7662; color: #fff; box-shadow: 0 4px 0 #085444; }
.primary-button:active { transform: translateY(2px); box-shadow: 0 2px 0 #085444; }
.secondary-button { min-height: 42px; padding: 9px 14px; background: #e9eee9; color: #26433c; }
.text-button { border: 0; padding: 7px 0; background: transparent; color: #a34136; font-weight: 800; }

.invite-card textarea { display: block; width: 100%; min-height: 94px; margin: 17px 0 12px; padding: 11px; resize: none; border: 1px solid #cdd7d1; border-radius: 12px; background: #f7faf8; color: #29413b; font-size: 12px; line-height: 1.45; }
.button-row { display: flex; gap: 9px; }
.button-row > * { flex: 1; }
.hint { margin-top: 13px; color: #74807b; font-size: 12px; line-height: 1.45; }
code { padding: 1px 4px; border-radius: 4px; background: #e5ece5; color: #245449; }

.connection-card { display: flex; align-items: center; gap: 14px; border-left: 5px solid #e3ae37; }
.connection-copy { flex: 1; }
.connection-copy h2 { font-size: 18px; }
.connection-copy .muted { margin-top: 4px; }

.chat-card { padding-bottom: 14px; }
.chat-heading { align-items: center; }
.route-indicator { padding: 6px 9px; background: #edf0eb; color: #52635d; }
.route-indicator[data-route="relay"] { background: #e0f1ec; color: #096c58; }
.messages { display: flex; flex-direction: column; gap: 9px; min-height: 230px; max-height: 47dvh; margin: 18px 0 13px; overflow-y: auto; padding: 4px 1px; }
.empty-chat { margin: auto 0; color: #7a8680; text-align: center; font-size: 13px; }
.message { max-width: 83%; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-break: break-word; }
.message.me { align-self: flex-end; border-bottom-right-radius: 4px; background: #0d7662; color: white; }
.message.peer { align-self: flex-start; border-bottom-left-radius: 4px; background: #e8eee8; color: #20312e; }
.message-meta { display: block; margin-top: 5px; opacity: .66; font-size: 10px; }
.message-form { display: flex; align-items: flex-end; gap: 9px; }
.message-form textarea { flex: 1; min-height: 46px; max-height: 130px; padding: 12px; resize: none; border: 1px solid #ccd7d0; border-radius: 13px; background: #fff; color: #1d2d2a; outline: none; }
.message-form textarea:focus { border-color: #0d7662; box-shadow: 0 0 0 3px #d9ede6; }
.send-button { min-height: 46px; padding: 0 15px; background: #f0bd3e; color: #24322e; }
.notice { min-height: 20px; margin: 12px 4px; color: #a13930; font-size: 13px; text-align: center; }
footer { margin: 25px 7px 0; color: #818883; font-size: 11px; line-height: 1.5; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 460px) {
  .app-shell { padding-inline: 12px; }
  .card { padding: 18px; border-radius: 18px; }
  .topbar { margin-inline: 2px; }
  .status-badge { padding: 6px 8px; font-size: 11px; }
  .section-heading { flex-wrap: wrap; }
  .relay-toggle { width: 100%; margin-left: 0; }
  .messages { max-height: 42dvh; }
}
