:root {
  --bg: #ffffff; --panel: #f6f6f8; --ink: #0b0b0f; --muted: #6b6b76; --line: #e7e7ec;
  --accent: #4f46e5; --accent-ink: #fff; --bubble: #0b0b0f; --bubble-ink: #fff;
  --radius: 16px;
}
[data-suite="sway"] { --accent: #e5322d; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0b0f; --panel: #16161c; --ink: #f4f4f6; --muted: #9a9aa6; --line: #26262e; --bubble: #f4f4f6; --bubble-ink: #0b0b0f; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, -apple-system, Segoe UI, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }

.page { min-height: 100%; display: flex; min-width: 0; width: 100%; flex-direction: column; max-width: 760px; margin: 0 auto; padding: 0 20px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); font-size: 17px; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 15px; font-weight: 800; position: relative; }
.mark::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); right: -2px; top: -2px; box-shadow: 0 0 0 2px var(--bg); }
.close { border: 0; background: transparent; font-size: 18px; color: var(--muted); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.close:hover { background: var(--panel); }

.main { flex: 1; display: flex; flex-direction: column; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.intro { padding: 36px 0 12px; }
h1 { font-size: clamp(30px, 6vw, 44px); letter-spacing: -0.035em; line-height: 1.05; margin: 0 0 12px; font-weight: 800; }
.sub { color: var(--muted); font-size: 16px; line-height: 1.5; margin: 0 0 26px; max-width: 560px; }
.picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 620px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field select { width: 100%; appearance: none; border: 1px solid var(--line); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6b76' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat right 14px center; border-radius: 12px; padding: 12px 36px 12px 14px; font-size: 16px; cursor: pointer; }
.field select:disabled { opacity: .5; cursor: default; }
.field select:focus { outline: 0; border-color: var(--accent); }
.pick-hint { color: var(--muted); font-size: 13px; text-align: center; padding: 6px 0 0; }
@media (max-width: 560px) { .picker { grid-template-columns: 1fr; } }
.label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--muted); }
.chip[aria-checked="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.chat { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 20px 0; }
.msg { max-width: 88%; line-height: 1.55; font-size: 15px; }
.msg.user { align-self: flex-end; background: var(--bubble); color: var(--bubble-ink); padding: 10px 14px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--panel); padding: 12px 16px; border-radius: 18px 18px 18px 4px; }
.msg.bot p { margin: 0 0 8px; } .msg.bot p:last-child { margin-bottom: 0; }
.msg.bot ol, .msg.bot ul { margin: 4px 0 8px; padding-left: 22px; } .msg.bot li { margin: 3px 0; }
.msg.bot a { color: var(--accent); }
.msg.bot code { background: var(--line); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }
.helped { align-self: flex-start; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: -4px; }
.helped button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-weight: 500; }
.helped button:hover { border-color: var(--muted); }
.helped button.need { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.ask { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 8px 8px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.06); }
.ask:focus-within { border-color: var(--muted); }
.ask textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; padding: 8px 0; font-size: 16px; line-height: 1.4; max-height: 160px; }
.ask button { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--ink); color: var(--bg); cursor: pointer; display: grid; place-items: center; }
.ask button:disabled { opacity: .35; cursor: default; }
.foot { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 12px 0 4px; font-size: 13px; color: var(--muted); }
.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }
.link:hover { color: var(--ink); }

.sheet { position: fixed; inset: 0; background: rgba(10,10,15,.45); display: grid; place-items: center; padding: 16px; z-index: 10; overflow-y: auto; }
.sheet[hidden] { display: none; }
.card { background: var(--bg); width: 100%; max-width: 460px; border-radius: 20px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.card[hidden] { display: none; }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.note { color: var(--muted); font-size: 14px; margin: 6px 0 16px; line-height: 1.45; } .note.small { font-size: 13px; margin: 0 0 12px; }
.card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.card input, .card select, .card textarea { display: block; width: 100%; margin-top: 6px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 16px; font-weight: 400; outline: 0; }
.card input:focus, .card select:focus, .card textarea:focus { border-color: var(--accent); }
.card textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; }
.err { color: #dc2626; font-size: 14px; margin: 0 0 12px; }
.primary { width: 100%; border: 0; border-radius: 12px; padding: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 16px; cursor: pointer; }
.primary:disabled { opacity: .6; }
.done { text-align: center; } .done p { color: var(--muted); line-height: 1.5; margin: 10px 0 20px; }
.check { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 24px; margin: 4px auto 14px; }

/* Inside the widget on another site: tighter. */
.embed .page { padding: 0 16px; }
.embed .intro { padding: 12px 0 6px; }
.embed h1 { font-size: 26px; }
.embed .sub { font-size: 14px; margin-bottom: 18px; }
.embed .ask { box-shadow: none; }
.has-chat .intro h1, .has-chat .intro .sub { display: none; }
.has-chat .intro { padding-top: 4px; }
.has-chat .picker { opacity: .85; }
