:root {
--bg: #f0f2f5; --card: #ffffff; --text: #1c1e21; --muted: #65676b; --line: #e4e6eb; --primary: #1877f2; --primary-text: #ffffff;
--soft: #e7f3ff; --mine: #1877f2; --mine-text: #ffffff; --theirs: #ffffff; --warn: #fff4e5; --warn-text: #7a4b00; --danger: #c62828;
--radius: 14px; --gap: 12px;
color-scheme: light;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #18191a; --card: #242526; --text: #e4e6eb; --muted: #b0b3b8; --line: #3a3b3c; --primary: #2d88ff; --soft: #263951;
--mine: #2d88ff; --theirs: #3a3b3c; --warn: #3d2c0e; --warn-text: #ffd28a; --danger: #ff6b6b;
color-scheme: dark;
}
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
main { max-width: 760px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding: 0 16px env(safe-area-inset-bottom); }
.center { text-align: center; margin: 15vh auto 0; max-width: 34em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0; }
button { font: inherit; border: 0; border-radius: 10px; padding: 10px 16px; background: var(--line); color: var(--text); cursor: pointer; }
button.primary { background: var(--primary); color: var(--primary-text); }
button.quiet { background: transparent; color: var(--primary); padding: 8px 10px; }
button.danger { background: transparent; color: var(--danger); }
button.icon { background: transparent; color: var(--muted); padding: 8px; display: grid; place-items: center; }
button.icon:hover { background: var(--line); }
button:disabled { opacity: .5; cursor: default; }
button:focus { outline: none; }
button:focus-visible { background: var(--soft); }
button.primary:focus-visible { filter: brightness(1.1); background: var(--primary); }
textarea, input[type=text], input[type=email], select { font: inherit; width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); color: var(--text); resize: none; }
textarea:focus, input[type=text]:focus, input[type=email]:focus, select:focus { outline: none; }
.card p:not(.label) { margin: 4px 0; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 0 0 var(--gap); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pair { margin: 8vh auto 0; max-width: 30em; width: 100%; }
.choices { display: grid; gap: 10px; margin: 16px 0; }
.choice { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: var(--card); border: 1px solid var(--line); padding: 14px; }
.choice[aria-pressed=true] { background: var(--soft); border-color: var(--soft); }
.choice strong { display: block; }
.number { font-size: 34px; letter-spacing: .12em; font-weight: 700; text-align: center; margin: 16px 0; font-variant-numeric: tabular-nums; }
.bar { position: sticky; top: 0; z-index: 2; background: var(--bg); display: flex; align-items: center; gap: 8px; padding: 12px 0 8px; }
.bar .title { flex: 1; min-width: 0; }
.bar .title strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #31a24c; margin-right: 6px; vertical-align: middle; }
.dot.off { background: var(--muted); }
.tabs { display: flex; gap: 6px; margin: 0 0 12px; }
.tabs button { flex: 1; background: transparent; color: var(--muted); }
.tabs button[aria-selected=true] { background: var(--card); color: var(--text); font-weight: 600; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; line-height: 20px; margin-left: 6px; }
.banner { background: var(--warn); color: var(--warn-text); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; }
.list { display: grid; gap: 2px; }
.row { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--card); border-radius: 12px; padding: 12px; }
.row .grow { flex: 1; min-width: 0; }
.row .grow strong, .row .grow span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; }
.company { margin: 12px 0 6px; color: var(--muted); font-size: 14px; }
.messages { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 4px 0 12px; }
.bubble { max-width: 85%; padding: 8px 12px; border-radius: 16px; background: var(--theirs); white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.bubble.mine { align-self: flex-end; background: var(--mine); color: var(--mine-text); }
.bubble.notice { align-self: center; background: transparent; color: var(--muted); font-size: 14px; box-shadow: none; text-align: center; }
.bubble .meta { display: block; font-size: 12px; opacity: .75; margin-top: 2px; }
.bubble a { color: inherit; }
.composer { position: sticky; bottom: 0; background: var(--bg); display: flex; gap: 8px; align-items: flex-end; padding: 8px 0 12px; }
.composer textarea { flex: 1; max-height: 40vh; }
.error { color: var(--danger); font-size: 14px; margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 12px; }
.option { display: block; width: 100%; text-align: left; margin: 6px 0; background: var(--bg); }
.option[aria-pressed=true] { background: var(--soft); }
.option small { display: block; color: var(--muted); }
.label { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow: auto; }
pre.preview { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border-radius: 10px; padding: 10px; font-size: 13px; max-height: 40vh; overflow: auto; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }
.search { margin: 0 0 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.chip { background: transparent; color: var(--muted); padding: 6px 12px; }
.chip[aria-pressed=true] { background: var(--card); color: var(--text); font-weight: 600; }
.when { flex: none; text-align: right; white-space: nowrap; }
.list + .empty, .list + .error, .list + .actions { margin-top: 10px; }
.center-actions { justify-content: center; }
.form { display: grid; gap: 4px; }
.field { display: grid; gap: 4px; margin: 6px 0; }
.field .label { margin: 0; }
textarea.first { min-height: 8em; resize: vertical; }
@media (max-width: 480px) { .bubble { max-width: 92%; } .number { font-size: 28px; } }
.group + .group { margin-top: 14px; }
