:root { color-scheme: light dark; --brand: #33339e; --accent: #ffcc00; --page: #d1d7db; --chat: #efeae2; --dots: rgba(0, 0, 0, 0.05); --bar: #f0f2f5; --field: #ffffff; --text: #111b21; --muted: #667781; --theirs: #ffffff; --mine: #d9fdd3; --link: #33339e; --line: #e9edef; --off: #8696a0; --shadow: rgba(11, 20, 26, 0.13); }
@media (prefers-color-scheme: dark) { :root { --page: #0b141a; --chat: #0b141a; --dots: rgba(255, 255, 255, 0.04); --bar: #202c33; --field: #2a3942; --text: #e9edef; --muted: #8696a0; --theirs: #202c33; --mine: #005c4b; --link: #aab0ff; --line: #313d45; --off: #667781; --shadow: rgba(0, 0, 0, 0.4); } }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--page); color: var(--text); }
main { width: 100%; height: 100vh; height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; background: var(--chat); }
@media (min-width: 600px) { main { width: 420px; box-shadow: 0 0 24px var(--shadow); } }
header { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--brand); color: #ffffff; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.95rem; }
.title { flex: 1; min-width: 0; }
h1 { font-size: 1.05rem; line-height: 1.2; margin: 0; font-weight: 600; }
.subtitle { margin: 0; font-size: 0.78rem; opacity: 0.8; }
#restart { padding: 6px 10px; font-size: 0.78rem; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.45); background: transparent; color: #ffffff; }
#messages { list-style: none; margin: 0; padding: 14px 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; background-color: var(--chat); background-image: radial-gradient(var(--dots) 1.5px, transparent 1.5px); background-size: 22px 22px; }
#messages li { position: relative; max-width: 85%; padding: 6px 10px 5px; box-shadow: 0 1px 0.5px var(--shadow); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; font-size: 0.95rem; color: var(--text); }
#messages li::before { content: ""; position: absolute; top: 0; width: 8px; height: 12px; background: inherit; }
#messages li.out { align-self: flex-start; background: var(--theirs); border-radius: 0 8px 8px 8px; }
#messages li.out::before { left: -7px; clip-path: polygon(100% 0, 100% 100%, 0 0); }
#messages li.in { align-self: flex-end; background: var(--mine); border-radius: 8px 0 8px 8px; }
#messages li.in::before { right: -7px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.time { display: block; margin-top: 2px; text-align: right; font-size: 0.68rem; color: var(--muted); white-space: normal; }
.options { margin: 6px -10px -5px; border-radius: 0 0 8px 8px; overflow: hidden; }
.options button { display: block; width: 100%; padding: 11px 12px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--theirs); color: var(--link); font: inherit; font-size: 0.92rem; text-align: center; cursor: pointer; }
.options button:disabled { color: var(--off); cursor: default; }
#status { margin: 0; padding: 4px 16px 0; min-height: 1.6em; font-size: 0.8rem; color: var(--muted); background: var(--bar); }
form { display: flex; align-items: center; gap: 8px; padding: 8px 10px 10px; background: var(--bar); }
#text { flex: 1; min-width: 0; font: inherit; padding: 10px 16px; border-radius: 22px; border: 0; background: var(--field); color: var(--text); }
#text::placeholder { color: var(--muted); }
.attach, .send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.attach { background: transparent; }
.send { background: var(--brand); }
.send:disabled { background: var(--off); cursor: default; }
.icon { display: block; width: 24px; height: 24px; }
.clip { background: var(--muted); -webkit-mask: var(--clip) center / contain no-repeat; mask: var(--clip) center / contain no-repeat; --clip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16.5 6v11.5a4 4 0 0 1-8 0V5a2.5 2.5 0 0 1 5 0v10.5a1 1 0 0 1-2 0V6H10v9.5a2.5 2.5 0 0 0 5 0V5a4 4 0 0 0-8 0v12.5a5.5 5.5 0 0 0 11 0V6h-1.5z'/%3E%3C/svg%3E"); }
.arrow { width: 22px; height: 22px; background: #ffffff; -webkit-mask: var(--arrow) center / contain no-repeat; mask: var(--arrow) center / contain no-repeat; --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 21l21-9L2 3v7l15 2-15 2z'/%3E%3C/svg%3E"); }
#photo:focus-visible + label, .send:focus-visible, #restart:focus-visible, .options button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#text:focus-visible { outline: 2px solid var(--brand); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
