@font-face {
  font-family: Manrope;
  src: url('./manrope.ttf') format('truetype');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --background: #f0ebe4;
  --surface: #faf8f4;
  --paper: #fffdf9;
  --border: #e7e0d6;
  --text: #403a33;
  --muted: #8b8073;
  --accent: #806b55;
  --app-height: 100dvh;
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font-size: 14px; line-height: 1.5; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
::selection { background: #e5d7c5; color: #3c332a; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { width: min(100%, 1040px); height: var(--app-height); min-height: 380px; margin: auto; padding: 32px; }
.chat-panel { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; background: var(--surface); border: 1px solid #e4ddd2; border-radius: 28px; box-shadow: 0 12px 50px #66533b08, 0 2px 6px #66533b03; }
.chat-header { display: flex; align-items: center; flex-shrink: 0; gap: 13px; padding: 23px 30px; border-bottom: 1px solid var(--border); }
.room-icon { display: grid; place-items: center; width: 44px; height: 44px; background: #ede5d9; border-radius: 16px; color: #8a745b; }
.room-icon .icon { width: 23px; height: 23px; }
.room-heading { min-width: 0; }
.room-heading h1 { margin: 0; font-size: 19px; line-height: 1.3; font-weight: 650; letter-spacing: -.6px; }
.room-heading a { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.room-heading a:hover { color: var(--text); }
.presence { margin-left: auto; display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 4px; border-radius: 10px; color: #7d806e; font-size: 11px; white-space: nowrap; }
.presence:not(:disabled):hover { background: #ede8de; }
.presence:not(:disabled) #online-count { text-decoration: underline; text-decoration-color: #c8c6b7; text-underline-offset: 4px; }
.live-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: #92a180; }
.presence.offline { color: var(--muted); }
.presence.offline .live-dot { background: #baad9c; }
.share-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; margin-left: 12px; padding: 8px 13px; border: 1px solid #e4dccf; border-radius: 12px; font-size: 11px; font-weight: 550; background: #f3eee6; color: #7b6b58; transition: background .15s; }
.share-button .icon { width: 17px; height: 17px; }
.share-button:hover { background: #ebe2d6; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--muted); }
.icon-button:hover { background: #ece5db; color: var(--text); }
.connection-banner { flex-shrink: 0; padding: 9px 18px; text-align: center; font-size: 12px; color: #856842; background: #f2e7d4; }

.feed { flex: 1; min-height: 0; padding: 20px 30px 12px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d6cbbb transparent; }
.day-divider { display: flex; justify-content: center; margin: 2px 0 28px; color: #988b7b; font-size: 10px; }
.day-divider span { padding: 4px 12px; border-radius: 20px; background: #f0ebe3; }
.empty-state { height: calc(100% - 70px); min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 32px; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 23px; background: #f0e9df; color: #ae9a82; }
.empty-icon .icon { width: 29px; height: 29px; stroke-width: 1.3; }
.empty-state p { margin: 18px 0 0; color: #9c8e7d; font-size: 13px; }
.load-older { display: block; margin: 0 auto 26px; padding: 8px 14px; border-radius: 20px; color: #8b7459; font-size: 11px; background: #efe8de; }
.load-older:hover { background: #e7ddcf; }

.message { display: flex; align-items: flex-start; gap: 10px; width: fit-content; max-width: 86%; margin: 0 0 24px; overflow-wrap: anywhere; animation: appear .16s ease-out; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; font-size: 10px; font-weight: 650; margin-top: 2px; }
.color-0 { background: #e3e7d9; color: #7a8464; }
.color-1 { background: #e5e0ed; color: #8b7d9b; }
.color-2 { background: #f0e0d6; color: #a67f66; }
.color-3 { background: #dde7e2; color: #6f8c7d; }
.color-4 { background: #ece3cb; color: #a08b58; }
.color-5 { background: #eedfe2; color: #a37b82; }
.message-content { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; max-width: 100%; min-height: 18px; margin: 0 2px 6px; }
.author-name { max-width: 200px; overflow-wrap: anywhere; color: #766956; font-size: 11px; font-weight: 600; }
.message-time { color: #a49685; font-size: 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.you-tag { color: #a4937c; font-size: 9px; }
.message-body { max-width: 100%; padding: 12px 16px; border: 1px solid #eee7dd; border-radius: 5px 18px 18px; background: var(--paper); color: #484037; font-size: 14px; line-height: 1.75; white-space: pre-wrap; box-shadow: 0 2px 3px #715b3703; }
.message-body a { color: #8e6944; text-decoration: underline; text-underline-offset: 3px; word-break: break-word; }
.message.mine { margin-left: auto; flex-direction: row-reverse; }
.message.mine .message-content { align-items: flex-end; }
.message.mine .message-meta { flex-direction: row-reverse; }
.message.mine .message-body { background: #eee3d3; border-color: #e9decd; border-radius: 18px 5px 18px 18px; }
.reactions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.reaction, .add-reaction { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 29px; padding: 3px 8px; background: #f2ece3; border: 1px solid #e7ded1; border-radius: 10px; font-size: 13px; transition: background .15s, border-color .15s; }
.reaction-count { min-width: 7px; color: #92806b; font-size: 10px; font-weight: 600; }
.reaction:hover, .add-reaction:hover { background: #e9dfd1; border-color: #cbb99f; }
.reaction.active { background: #e8dcc9; border-color: #c4ad8a; }
.reaction.active .reaction-count { color: #796041; }
.add-reaction { padding: 4px 7px; color: #b1a18b; border-color: transparent; background: transparent; }
.add-reaction .icon { width: 17px; height: 17px; }
.reply-button { display: flex; align-items: center; gap: 5px; min-height: 30px; padding: 4px 7px; color: #a18c74; font-size: 10px; border-radius: 9px; }
.reply-button .icon { width: 15px; height: 15px; }
.reply-button:hover { background: #ede4d7; color: #786047; }
.reply-quote { display: block; max-width: 100%; margin: 0 0 9px; padding: 5px 9px; border-left: 3px solid #bda887; border-radius: 3px 8px 8px 3px; background: #a98c6420; text-align: left; white-space: normal; }
.reply-quote strong { display: block; color: #806649; font-size: 10px; font-weight: 650; }
.reply-quote > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: #a08d74; font-size: 11px; }
.mention-text { padding: 1px 3px; border-radius: 4px; background: #eae1cf; color: #80603e; }
.mention-text.mine { background: #e8d3ad; color: #694717; }
.message.addressed .message-body { border-color: #cdb389; box-shadow: inset 3px 0 #ccb187; }
.message-focused .message-body { outline: 2px solid #bda078; outline-offset: 3px; }
.message-images { display: grid; gap: 7px; width: min(420px, 65vw); max-width: 100%; margin-top: 7px; }
.message-images:first-child { margin-top: 0; }
.message-images.multiple { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.message-image { display: block; min-width: 0; padding: 0; border-radius: 10px; overflow: hidden; background: #ede6db; }
.message-image img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: contain; }
.reaction-picker { position: fixed; z-index: 30; display: flex; gap: 3px; padding: 7px; border: 1px solid #e6dbca; border-radius: 17px; background: #fffaf1; box-shadow: 0 10px 35px #63482b20, 0 2px 5px #63482b05; }
.reaction-picker button { display: grid; place-items: center; width: 37px; height: 38px; border-radius: 11px; font-family: system-ui; font-size: 23px; transition: background .12s, transform .12s; }
.reaction-picker button:hover { background: #efe3d0; transform: translateY(-2px); }

.composer-wrap { flex-shrink: 0; position: relative; padding: 13px 28px 24px; border-top: 1px solid var(--border); background: var(--surface); }
.composer-identity { display: flex; align-items: center; justify-content: space-between; min-width: 0; margin: 0 2px 9px; font-size: 10px; color: var(--muted); }
.composer-identity button { display: flex; align-items: center; gap: 7px; min-height: 28px; max-width: 90%; padding: 2px 4px 2px 0; border-radius: 7px; color: #8b7b66; font-size: 11px; }
.composer-identity button:hover { color: #574637; }
.composer-identity button > .icon { width: 12px; height: 12px; margin-left: 1px; color: #ad9a82; }
#my-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-avatar { display: grid; place-items: center; width: 23px; height: 23px; flex-shrink: 0; border-radius: 50%; font-size: 8px; font-weight: 650; }
.composer { display: flex; align-items: flex-end; gap: 12px; padding: 8px 8px 8px 18px; border: 1px solid #e0d6c7; border-radius: 20px; background: #fffcf7; box-shadow: 0 2px 8px #66543a04; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: #bcaa90; box-shadow: 0 0 0 3px #d7c5ad20; }
.composer textarea { display: block; width: 100%; min-width: 0; min-height: 42px; max-height: 130px; padding: 9px 0; border: 0; outline: none; resize: none; background: transparent; color: var(--text); font-size: 14px; line-height: 24px; scrollbar-width: thin; scrollbar-color: #d0beaa transparent; }
.composer textarea::placeholder { color: #b1a18d; }
.attach-image { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 42px; padding: 0; color: #a08b72; }
.attach-image .icon { width: 20px; height: 20px; }
.attach-image:hover { color: #705638; }
.attach-image:disabled { opacity: .4; }
.reply-preview { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px 8px 6px 12px; margin-bottom: 8px; border-radius: 11px; background: #eee6d9; color: #91795b; }
.reply-preview > .icon { width: 18px; height: 18px; }
.reply-preview > div { flex: 1; min-width: 0; }
.reply-preview strong, .reply-preview span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.reply-preview strong { font-weight: 650; }
.reply-preview span { margin-top: 2px; color: #a08c73; }
.attachment-previews { display: flex; gap: 8px; padding: 2px 0 9px; overflow-x: auto; }
.attachment-preview { position: relative; flex-shrink: 0; width: 64px; height: 64px; border: 1px solid #ded0bd; border-radius: 10px; overflow: hidden; background: #eee6d9; }
.attachment-preview > img { width: 100%; height: 100%; object-fit: cover; }
.attachment-remove { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 23px; height: 23px; padding: 0; border-radius: 50%; background: #fffaf0e8; color: #786147; }
.attachment-remove .icon { width: 14px; height: 14px; }
.mention-picker { position: absolute; z-index: 40; bottom: calc(100% + 5px); left: 16px; right: 16px; max-height: min(280px, 35vh); overflow-y: auto; padding: 5px; border: 1px solid #ded0bd; border-radius: 16px; background: #fcf8f0; box-shadow: 0 10px 35px #63482b20; }
.mention-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 11px; text-align: left; font-size: 12px; overflow-wrap: anywhere; }
.mention-option[aria-selected="true"], .mention-option:hover { background: #eee4d5; }
.mention-option .participant-avatar { width: 28px; height: 28px; border-radius: 9px; }
.send-button { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; padding: 0; border-radius: 14px; background: #897055; color: #fff9ef; transition: background .15s; }
.send-button:disabled { background: #ede5d8; color: #b7a68e; }
.send-button:not(:disabled):hover { background: #745b41; }
.send-button .icon { width: 21px; height: 21px; stroke-width: 1.8; }
.new-messages { position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; padding: 9px 15px; border: 1px solid #deceba; border-radius: 30px; background: #f4e8d6; color: #806447; font-size: 11px; font-weight: 600; white-space: nowrap; box-shadow: 0 5px 16px #60431e12; }
.new-messages .icon { width: 14px; height: 14px; }

.dialog { position: fixed; width: 390px; max-width: calc(100% - 32px); padding: 32px; border: 1px solid #e6ddcf; border-radius: 25px; background: #fcf8f0; color: var(--text); box-shadow: 0 24px 90px #4b39252b; }
.dialog::backdrop { background: #50453745; backdrop-filter: blur(6px); }
.dialog-close { position: absolute; top: 13px; right: 13px; }
.dialog-close .icon { width: 18px; height: 18px; }
.dialog h2 { margin: 0 0 26px; font-size: 21px; font-weight: 600; letter-spacing: -.6px; }
.dialog input { width: 100%; padding: 13px 14px; border: 1px solid #dcd0be; border-radius: 13px; background: #fffdfa; color: var(--text); font-size: 16px; }
.dialog input::placeholder { color: #b2a28d; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 45px; margin-top: 18px; padding: 12px 18px; border-radius: 13px; background: #8b7256; color: #fff9ef; font-size: 12px; font-weight: 600; transition: background .15s; }
.primary-button:hover { background: #765c40; }
.primary-button:disabled { opacity: .6; }
.primary-button .icon { width: 17px; height: 17px; }
.form-error { margin: 10px 0 0; color: #b26049; font-size: 11px; }
.share-dialog { text-align: center; width: 366px; }
.qr-frame { width: 250px; max-width: 100%; margin: 0 auto; padding: 8px; background: #fff; border: 1px solid #ece4d9; border-radius: 19px; }
.qr-frame img { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.share-url { margin-top: 20px; color: #8a755b; font-size: 13px; }
.share-dialog .primary-button { margin-top: 22px; }
.participants-dialog { width: 420px; max-height: min(650px, calc(var(--app-height) - 32px)); overflow: hidden; }
.participants-dialog[open] { display: flex; flex-direction: column; }
.participants-dialog h2 { margin: 0 24px 5px 0; }
.participants-status { margin: 0 0 18px; color: var(--muted); font-size: 11px; }
.participants-list { min-height: 0; margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d6cbbb transparent; }
.participant { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #ece3d6; }
.participant:last-child { border-bottom: 0; }
.participant-avatar { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 13px; font-size: 11px; font-weight: 650; }
.participant-name { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.participant-self { margin-left: auto; padding-right: 3px; color: #a08e77; font-size: 10px; }
.image-dialog { width: 960px; max-height: calc(var(--app-height) - 24px); padding: 44px 18px 18px; }
.image-dialog[open] { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#image-full { display: block; min-height: 0; max-width: 100%; max-height: calc(var(--app-height) - 140px); object-fit: contain; border-radius: 8px; }
#image-original { flex-shrink: 0; color: #8e775d; text-decoration: underline; text-underline-offset: 3px; font-size: 11px; }
.message-source-dialog { width: 640px; max-height: calc(var(--app-height) - 24px); overflow-y: auto; }
.message-source-dialog .message { max-width: 100%; margin-bottom: 0; }
.toast { position: fixed; z-index: 100; left: 50%; top: 28px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 11px 19px; border: 1px solid #dfd1be; border-radius: 14px; background: #faf1e2; color: #806749; box-shadow: 0 5px 25px #634a2c18; font-size: 12px; text-align: center; }
.noscript { position: fixed; inset: auto 0 0; padding: 20px; background: #f6e6ca; color: #765c37; text-align: center; }

@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  .app-shell { padding: 0; min-height: 0; }
  .chat-panel { border: 0; border-radius: 0; box-shadow: none; }
  .chat-header { gap: 10px; padding: 16px 18px; padding-top: max(16px, env(safe-area-inset-top)); }
  .room-icon { width: 40px; height: 40px; border-radius: 14px; }
  .room-icon .icon { width: 22px; height: 22px; }
  .room-heading h1 { font-size: 18px; }
  .room-heading a { font-size: 10px; margin-top: 2px; }
  .presence { font-size: 10px; gap: 6px; }
  .share-button { width: 36px; height: 36px; min-height: 36px; margin-left: 4px; padding: 0; border-radius: 12px; }
  .share-button .icon { width: 18px; height: 18px; }
  .share-button span { display: none; }
  .feed { padding: 20px 17px 10px; }
  .day-divider { margin-bottom: 25px; font-size: 9px; }
  .message { gap: 8px; max-width: 94%; margin-bottom: 22px; }
  .avatar { width: 27px; height: 27px; font-size: 8px; }
  .message-meta { gap: 6px; margin-bottom: 5px; }
  .author-name { max-width: 150px; font-size: 11px; }
  .message-time, .you-tag { font-size: 9px; }
  .message-body { padding: 10px 13px; font-size: 14px; line-height: 1.65; border-radius: 4px 17px 17px; }
  .message.mine .message-body { border-radius: 17px 4px 17px 17px; }
  .reactions { margin-top: 6px; }
  .reaction, .add-reaction { min-width: 33px; min-height: 32px; }
  .composer-wrap { padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); }
  .composer-identity { margin-bottom: 8px; }
  .composer { gap: 8px; padding: 7px 7px 7px 15px; border-radius: 19px; }
  .composer textarea { padding: 8px 0; min-height: 40px; max-height: 100px; font-size: 16px; line-height: 24px; }
  .composer textarea::placeholder { font-size: 14px; }
  .send-button { width: 40px; height: 40px; border-radius: 13px; }
  .dialog { padding: 30px 25px; border-radius: 24px; }
  .dialog h2 { font-size: 20px; }
  .toast { top: calc(16px + env(safe-area-inset-top)); }
}

@media (max-width: 360px) {
  .reaction-picker { display: grid; grid-template-columns: repeat(4, 37px); }
  .chat-header { padding-left: 13px; padding-right: 13px; gap: 8px; }
  .room-icon { width: 35px; height: 35px; border-radius: 12px; }
  .room-icon .icon { width: 20px; height: 20px; }
  .room-heading h1 { font-size: 16px; }
  .presence { font-size: 9px; }
  .share-button { width: 33px; height: 33px; min-height: 33px; margin-left: 1px; }
  .feed { padding-left: 12px; padding-right: 12px; }
  .composer-wrap { padding-left: 12px; padding-right: 12px; }
}

/* Introduction and participant portraits share the room's warm palette. */
body.needs-introduction .app-shell { visibility: hidden; }
.picture-avatar { overflow: hidden; }
.picture-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.field-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; color: #786a58; }
.avatar-label-row { display: flex; justify-content: space-between; align-items: center; margin: 23px 0 12px; gap: 12px; }
.avatar-label-row .field-label { margin: 0; }
.avatar-label-row > :last-child { color: #a08e78; font-size: 11px; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; padding: 4px; }
.avatar-option { position: relative; display: grid; place-items: center; aspect-ratio: 1; width: 100%; min-width: 0; padding: 3px; border: 2px solid transparent; border-radius: 50%; transition: border-color .15s, transform .15s; }
.avatar-option:hover { transform: translateY(-2px); }
.avatar-option[aria-pressed="true"] { border-color: #92744f; background: #e9dcc8; }
.avatar-option[aria-pressed="true"]::after { content: '✓'; position: absolute; right: -1px; bottom: -1px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fcf8f0; background: #92744f; color: white; font: 10px/1 system-ui; }
.avatar-choice-picture { display: grid; place-items: center; width: 100%; height: 100%; overflow: hidden; border-radius: 50%; font-size: 12px; font-weight: 650; }
.profile-dialog { width: 540px; max-height: calc(var(--app-height) - 32px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d6cbbb transparent; }
.profile-dialog .avatar-grid { margin-top: 20px; }
.text-button { min-height: 42px; padding: 10px 12px; border-radius: 11px; color: #8c785e; font-size: 12px; font-weight: 550; }
.text-button:hover { background: #eee5d9; color: #6c543a; }
.text-button:disabled { opacity: .45; }
.profile-survey-link { display: block; margin: 10px auto -10px; }
.intro-dialog { width: 560px; max-height: min(830px, calc(100dvh - 40px), calc(var(--app-height) - 40px)); padding: 0; overflow: hidden; }
.intro-dialog[open] { display: flex; flex-direction: column; }
.intro-dialog::backdrop { background: #e8dfd2b8; backdrop-filter: blur(9px); }
.intro-header { flex-shrink: 0; padding: 27px 32px 0; }
.intro-progress { display: flex; gap: 6px; margin-bottom: 24px; }
.intro-progress span { flex: 1; height: 3px; border-radius: 3px; background: #e9e0d3; transition: background .2s; }
.intro-progress .complete { background: #b7a287; }
.intro-progress .current { background: #80664a; }
.intro-step-label { display: flex; justify-content: space-between; margin-bottom: 12px; color: #a08e78; font-size: 10px; font-weight: 550; letter-spacing: .15px; }
.intro-dialog h2 { margin-bottom: 0; font-size: 26px; line-height: 1.35; letter-spacing: -.8px; font-weight: 600; outline: none; }
#intro-title:focus-visible, #vote-title:focus-visible { outline: none; }
.intro-description { margin: 8px 0 0; color: #9a8872; font-size: 12px; line-height: 1.6; }
#intro-form, .voting-form { display: flex; flex-direction: column; min-height: 0; }
.intro-body { padding: 24px 32px 16px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d6cbbb transparent; }
.intro-footer { flex-shrink: 0; padding: 16px 32px 27px; }
.intro-actions { display: flex; align-items: center; gap: 6px; }
.intro-actions .primary-button { margin: 0 0 0 auto; width: auto; min-width: 150px; min-height: 46px; font-size: 12px; }
.intro-actions .primary-button:disabled { background: #e7ddcf; color: #aa9780; opacity: 1; }
.intro-footer .form-error { margin: 0 0 12px; }
.choice-grid { display: grid; gap: 9px; }
.role-choices { grid-template-columns: 1fr 1fr; }
.role-choices .choice:last-child { grid-column: 1 / -1; }
.choice { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 13px 15px; border: 1px solid #e7ddcf; border-radius: 14px; background: #fffdf9; cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: #ccbaa2; }
.choice:has(input:checked) { background: #eee4d5; border-color: #baa081; }
.choice:has(input:focus-visible) { outline: 2px solid #937d60; outline-offset: 2px; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; margin: 0; pointer-events: none; }
.choice-copy { flex: 1; min-width: 0; }
.choice strong { display: block; font-size: 12px; line-height: 1.5; font-weight: 550; }
.choice small { display: block; margin-top: 4px; color: #a08e77; font-size: 10px; line-height: 1.6; }
.choice-indicator { display: grid; place-items: center; flex-shrink: 0; width: 17px; height: 17px; border: 1px solid #dacdbb; border-radius: 50%; background: #fffdf9; }
.choice:has(input:checked) .choice-indicator { border: 5px solid #9a8060; }
.stance-step { padding: 14px 0 5px; }
.stance-readout { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 24px 10px 31px; }
.stance-readout strong { font-size: 27px; font-weight: 550; letter-spacing: -.8px; }
.stance-readout > span { color: #a08c73; font-size: 11px; font-variant-numeric: tabular-nums; }
.stance-endpoints { display: flex; justify-content: space-between; align-items: center; margin: 7px 0 3px; padding: 0 2px; }
.stance-endpoints > span { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600; color: #85866a; }
.stance-endpoints > span:last-child { color: #9b859b; }
.stance-endpoints .icon { width: 20px; height: 20px; }
.stance-track { position: relative; padding-bottom: 18px; }
.stance-track::before { content: ''; position: absolute; inset: 21px 0 auto; height: 12px; border-radius: 20px; background: linear-gradient(to right, #b5bb9b, #c8bdad 50%, #c2aecb); pointer-events: none; }
.stance-track input[type="range"] { position: relative; display: block; appearance: none; -webkit-appearance: none; width: 100%; height: 54px; padding: 0; margin: 0; border: 0; border-radius: 0; cursor: ew-resize; background: transparent; }
.stance-track input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 34px; height: 34px; border: 5px solid #fffaf1; border-radius: 50%; background: #9e8970; box-shadow: 0 0 0 1px #b5a088, 0 3px 10px #6e54332b; }
.stance-track input::-moz-range-thumb { width: 24px; height: 24px; border: 5px solid #fffaf1; border-radius: 50%; background: #9e8970; box-shadow: 0 0 0 1px #b5a088, 0 3px 10px #6e54332b; }
.stance-ticks { position: absolute; bottom: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; pointer-events: none; }
.stance-ticks i { width: 1px; height: 5px; background: #d2c4b1; }
.stance-ticks i:nth-child(3) { height: 8px; }
.neutral-button { display: block; min-height: 34px; padding: 6px 15px; margin: 4px auto 0; border: 1px solid #e4d8c7; border-radius: 20px; font-size: 11px; }
.neutral-button.selected { background: #e9dfd0; border-color: #bfa789; }
.stance-note { margin: 31px 0 0; text-align: center; color: #a18f79; font-size: 10px; }
.vote-dialog { width: 510px; }
.mood-panel { flex-shrink: 0; padding: 10px 30px 10px; border-bottom: 1px solid var(--border); background: #f7f3ec; }
.personal-vote { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #e6ded2; }
.personal-vote-copy { min-width: 0; }
.personal-vote-summary { display: flex; flex-wrap: wrap; gap: 2px 5px; color: #85745f; font-size: 10px; font-variant-numeric: tabular-nums; }
.personal-vote-summary > span { white-space: nowrap; }
#my-vote-title { color: #6d5943; font-weight: 650; }
#my-vote-comparison { margin-top: 3px; font-size: 9px; color: #9b8a76; }
.personal-vote button { flex-shrink: 0; min-height: 34px; padding: 6px 10px; border: 1px solid #d7c7b2; border-radius: 10px; background: #eee5d8; color: #806b55; font-size: 10px; font-weight: 600; }
.personal-vote button:not(:disabled):hover { background: #e5d8c5; }
.personal-vote button:disabled { border-color: #e1d7c8; background: #eee7dc; color: #9b8a76; }
#vote-comparison { font-size: 10px; text-align: center; }
.mood-heading, .mood-endpoints, .mood-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mood-heading { margin-bottom: 9px; font-size: 10px; color: #85745f; }
#mood-count { font-size: 9px; color: #a29380; }
.mood-endpoints { margin-bottom: 9px; font-size: 11px; color: #85866a; }
.mood-endpoints > span:last-child { color: #9b859b; }
.mood-endpoints strong { margin: 0 4px; font-weight: 650; font-variant-numeric: tabular-nums; }
.mood-track { position: relative; height: 7px; border-radius: 10px; background: linear-gradient(to right, #b5bb9b, #c8bdad 50%, #c2aecb); }
.mood-track > span { position: absolute; top: -3px; left: clamp(6px, var(--mood, 50%), calc(100% - 6px)); width: 13px; height: 13px; transform: translateX(-50%); border: 3px solid #fffaf1; border-radius: 50%; background: #8e7558; box-shadow: 0 0 0 1px #b5a088; transition: left .35s ease; }
.mood-footer { margin-top: 8px; font-size: 9px; color: #aa9983; }
.vote-banner { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 30px; border-bottom: 1px solid #ded3c1; background: #eee4d4; color: #8d7150; font-size: 10px; }
.vote-banner button { min-height: 30px; padding: 4px 0 4px 12px; font-size: 10px; font-weight: 650; }

@media (max-width: 760px) {
  .mood-panel { padding: 9px 18px 10px; }
  .mood-heading { margin-bottom: 7px; }
  .vote-banner { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 520px) {
  .intro-dialog { max-width: calc(100% - 24px); max-height: min(calc(100dvh - 24px), calc(var(--app-height) - 24px)); border-radius: 23px; }
  .intro-header { padding: 22px 22px 0; }
  .intro-progress { margin-bottom: 20px; }
  .intro-dialog h2 { font-size: 24px; }
  .intro-body { padding: 21px 20px 12px; }
  .intro-footer { padding: 15px 22px 22px; }
  .avatar-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; padding: 3px; }
  .avatar-label-row { margin-top: 19px; }
  .role-choices { gap: 8px; }
  .role-choices .choice { padding: 11px; gap: 7px; }
  .role-choices .choice strong { font-size: 11px; }
  .role-choices .choice-indicator { width: 14px; height: 14px; }
  .role-choices .choice:has(input:checked) .choice-indicator { border-width: 4px; }
  .choice { padding: 13px; }
  .intro-actions .primary-button { min-width: 130px; }
  .stance-readout strong { font-size: 25px; }
}

@media (max-height: 540px) {
  .has-message-extras .mood-panel { display: none; }
  .attachment-preview { width: 48px; height: 48px; }
  .mood-panel { padding-top: 5px; padding-bottom: 7px; }
  .personal-vote { margin-bottom: 7px; padding-bottom: 7px; }
  .mood-heading { margin-bottom: 5px; }
  .mood-footer { display: none; }
  .intro-header { padding-top: 17px; }
  .intro-progress { margin-bottom: 12px; }
  .intro-step-label { margin-bottom: 7px; }
  .intro-dialog h2 { font-size: 21px; }
  .intro-body { padding-top: 15px; }
  .intro-footer { padding-top: 10px; padding-bottom: 16px; }
  .vote-dialog .stance-step { padding-top: 0; }
  .vote-dialog .stance-readout { padding: 5px 0 12px; gap: 3px; }
  .vote-dialog .stance-readout strong { font-size: 22px; }
  .vote-dialog .stance-note { margin-top: 15px; }
}

@media (max-width: 360px) {
  .intro-actions { gap: 3px; }
  .intro-actions .text-button { padding: 10px 7px; font-size: 11px; }
  .intro-actions .primary-button { min-width: 110px; padding: 12px; font-size: 11px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
