* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #fff8fb; color: #33253b; font: 16px system-ui, sans-serif; }
.site-header { padding: 20px max(16px, calc((100% - 680px) / 2)); background: linear-gradient(120deg, #672e64, #d35380); }
.site-header a { color: #fff; font: italic 32px Georgia, serif; text-decoration: none; }
main { max-width: 712px; margin: 0 auto; padding: 12px 16px 28px; }
h1 { margin: 12px 0; }
h2 { margin: 0; overflow-wrap: anywhere; }
nav, .thread-header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
nav a, #sign-in { display: inline-flex; align-items: center; min-height: 44px; }
a { color: #920f50; }
button, select, textarea { font: inherit; }
button { min-height: 44px; padding: 9px 13px; border: 1px solid transparent; border-radius: 9px; background: #a31558; color: #fff; font-weight: 650; cursor: pointer; }
button:disabled { opacity: .65; cursor: default; }
button.secondary { color: #920f50; background: #fff; border-color: #e1bfce; }
:focus-visible { outline: 3px solid #712759; outline-offset: 2px; }
#connection-status:empty, #action-status:empty, #report-status:empty { display: none; }
.error { color: #a0133b; }
#inbox, #thread { background: #fff; border: 1px solid #ecd3e1; border-radius: 16px; padding: 12px; }
#conversations, #message-list { list-style: none; margin: 0; padding: 0; }
#conversations li + li { border-top: 1px solid #ecd3e1; }
.conversation { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 12px 4px; text-decoration: none; }
.conversation:hover strong { text-decoration: underline; }
.conversation strong { overflow-wrap: anywhere; }
.preview { grid-column: 1 / -1; color: #564656; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread { align-self: start; border-radius: 12px; background: #f8e4ef; padding: 2px 8px; font-size: .875rem; font-weight: 700; }
.thread-header { justify-content: space-between; padding-bottom: 8px; }
#history { min-height: 110px; max-height: 52vh; max-height: 52dvh; overflow: auto; padding: 6px; border-block: 1px solid #ecd3e1; }
#message-list { display: flex; flex-direction: column; gap: 12px; padding-block: 6px; }
#message-list li { align-self: flex-start; min-width: 0; max-width: min(86%, 36rem); }
#message-list li.outgoing { align-self: flex-end; }
.bubble { margin: 0; border-radius: 12px; padding: 10px 12px; background: #f3edf4; overflow-wrap: anywhere; white-space: pre-wrap; }
.outgoing .bubble { background: #f9e0ec; }
.message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 8px; color: #665665; font-size: .8125rem; }
.outgoing .message-meta { justify-content: flex-end; }
button.report { background: transparent; color: #920f50; padding: 0 8px; }
#composer { display: grid; gap: 7px; padding-top: 10px; }
#composer button { justify-self: end; }
textarea, select { width: 100%; padding: 9px; border: 1px solid #b89aaa; border-radius: 8px; background: #fff; color: inherit; }
textarea { resize: vertical; min-height: 64px; }
dialog { width: min(420px, calc(100% - 32px)); border: 1px solid #ecd3e1; border-radius: 16px; color: inherit; }
dialog::backdrop { background: #33253b88; }
dialog select { margin: 6px 0 12px; }
