:root {
  color-scheme: light;
  --ink: #252b27;
  --muted: #828780;
  --paper: #f5f4ee;
  --line: #e3e2d9;
  --moss: #193c32;
  --lime: #d9f179;
  --coral: #d58067;
  --serif: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; height: 100vh; overflow: hidden; color: var(--ink); background: var(--paper); font-family: var(--sans); }
button, input, textarea { font: inherit; }
button { color: inherit; }
.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  background: radial-gradient(ellipse at 72% 8%, rgba(218, 226, 199, .25), transparent 36%), var(--paper);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 27px 17px 16px;
  color: #f5f2e9;
  background: radial-gradient(ellipse at 5% 22%, rgba(137, 173, 123, .2), transparent 34%), linear-gradient(155deg, #203e34, #18342d 58%, #172f2a);
  box-shadow: 8px 0 24px rgba(25, 43, 35, .07);
  position: relative;
  z-index: 2;
}
.brand-row { padding: 0 10px; }
.brand { display: flex; align-items: center; gap: 10px; width: fit-content; color: #fffdf4; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(229, 238, 205, .5);
  border-radius: 12px 12px 12px 4px;
  font: 700 22px/1 var(--serif);
  letter-spacing: -3px;
  padding-right: 3px;
  transform: rotate(-4deg);
}
.brand-mark span { color: var(--lime); }
.brand-word { font: 700 25px/1 var(--serif); letter-spacing: -.9px; }
.edition { display: block; margin: 12px 0 0 2px; color: #aebdb0; font-size: 8px; font-weight: 700; letter-spacing: 1.5px; }
.space-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 31px 0 27px;
  padding: 11px 10px;
  border: 1px solid rgba(239, 237, 217, .11);
  border-radius: 10px;
  background: rgba(255, 255, 255, .055);
}
.space-avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 9px; color: var(--moss); background: #e8ca90; font: 700 17px var(--serif); }
.space-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.space-copy strong { font: 600 14px var(--serif); }
.eyebrow { font-size: 8px; font-weight: 750; letter-spacing: 1.35px; }
.space-copy .eyebrow { color: #aab9aa; }
.space-chevron { align-self: flex-start; color: #acb8ad; font-size: 18px; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 9px; color: #b4c0b4; font-size: 10px; font-weight: 700; letter-spacing: 1.35px; text-transform: uppercase; }
.icon-button { display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; }
.add-room { width: 23px; height: 23px; border: 1px solid rgba(223, 237, 219, .2); border-radius: 7px; color: #e7eddd; background: transparent; font-size: 17px; transition: background .16s, color .16s, transform .16s; }
.add-room:hover { color: var(--moss); background: var(--lime); transform: rotate(90deg); }
.room-list { display: grid; gap: 4px; }
.room-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; border-radius: 8px; color: #c2cdc2; background: transparent; cursor: pointer; text-align: left; transition: color .16s, background .16s, transform .16s; }
.room-link:hover { color: white; background: rgba(255, 255, 255, .08); transform: translateX(2px); }
.room-link.active { color: #f8f7ec; background: rgba(255, 255, 255, .105); }
.room-link.active .room-link-icon { color: var(--lime); }
.room-link-icon { width: 20px; color: #9bac9d; text-align: center; font-size: 15px; }
.room-link-name { flex: 1; font-size: 12px; font-weight: 550; }
.sidebar-note { position: relative; margin: auto 7px 17px; padding: 16px 14px 14px; overflow: hidden; border: 1px solid rgba(220, 230, 200, .12); border-radius: 10px; background: radial-gradient(circle at 100% 0%, rgba(218, 241, 121, .13), transparent 47%), rgba(255, 255, 255, .035); }
.note-spark { color: var(--lime); font-size: 15px; }
.sidebar-note p { margin: 9px 0 13px; color: #e1e5d9; font: 14px/1.4 var(--serif); }
.note-caption { color: #9daf9e; font-size: 8px; font-weight: 700; letter-spacing: 1.2px; }
.profile-card { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 8px 2px; border: 0; border-top: 1px solid rgba(224, 235, 219, .12); color: #eff0e7; background: transparent; cursor: pointer; text-align: left; }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 12px 12px 12px 4px; color: #26372d; background: #e8c89a; font: 700 13px var(--serif); }
.avatar-profile { width: 33px; height: 33px; color: #274236; background: var(--lime); }
.profile-copy { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.profile-copy strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { display: flex; align-items: center; gap: 5px; color: #a8b8aa; font-size: 9px; }
.online-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #9bc989; box-shadow: 0 0 0 3px rgba(155, 201, 137, .1); }
.profile-edit { color: #9aab9d; font-size: 19px; letter-spacing: 1px; }

.conversation { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 61px; padding: 0 32px; border-bottom: 1px solid rgba(215, 215, 203, .75); }
.breadcrumb { display: flex; align-items: center; gap: 11px; font-size: 11px; }
.breadcrumb-space { color: #92958d; }
.breadcrumb-slash { color: #c7c6bc; }
.breadcrumb-room { font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.connection-indicator { display: flex; align-items: center; gap: 7px; color: #898e84; font-size: 10px; }
.connection-indicator .online-dot { width: 6px; height: 6px; background: #80a66b; }
.connection-indicator.offline .online-dot { background: var(--coral); box-shadow: none; }
.info-button { width: 24px; height: 24px; border: 1px solid #d4d5cb; border-radius: 50%; color: #73796e; background: transparent; font: italic 13px var(--serif); transition: background .15s, color .15s; }
.info-button:hover { color: var(--paper); background: var(--moss); }
.menu-toggle { display: none; background: transparent; }

.room-intro { display: flex; align-items: center; gap: 17px; min-height: 147px; padding: 24px 40px 22px; border-bottom: 1px solid var(--line); background: radial-gradient(ellipse at 14% 0%, rgba(222, 231, 210, .55), transparent 42%), linear-gradient(100deg, rgba(255, 255, 255, .25), transparent 70%); }
.room-symbol { display: grid; flex: 0 0 auto; place-items: center; width: 51px; height: 51px; border: 1px solid #d3d8c8; border-radius: 16px 16px 16px 5px; color: #496751; background: rgba(249, 250, 240, .68); font-size: 22px; box-shadow: 0 5px 15px rgba(43, 58, 42, .05); }
.room-heading { min-width: 0; }
.room-overline { margin-bottom: 3px; color: #788773; font-size: 8px; font-weight: 750; letter-spacing: 1.45px; }
.tiny-spark { margin-right: 4px; color: #c1795e; font-size: 10px; }
.room-heading h1 { margin: 0; color: #28362e; font: 500 29px/1.08 var(--serif); letter-spacing: -.8px; }
.room-heading p { margin: 6px 0 0; color: #7d8178; font-size: 11px; }
.room-stats { margin-left: auto; min-width: 91px; text-align: right; }
.stat-number { color: #3b563e; font: 500 25px/1 var(--serif); }
.stat-label { margin-top: 4px; color: #898d81; font-size: 8px; font-weight: 700; letter-spacing: 1px; }
.avatar-stack { display: flex; justify-content: flex-end; margin-top: 8px; padding-left: 10px; }
.stack-avatar { display: grid; place-items: center; width: 22px; height: 22px; margin-left: -6px; border: 2px solid var(--paper); border-radius: 50%; color: #394a3a; background: #e5c2a3; font-size: 8px; font-weight: 700; }
.stack-avatar:nth-child(3n) { background: #c7d5b4; }
.stack-avatar:nth-child(3n + 2) { background: #e4bfb0; }
.conversation-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.message-column { display: flex; flex: 1; flex-direction: column; min-width: 0; overflow: hidden; }
.history-label { display: flex; align-items: center; gap: 11px; margin: 18px 35px 7px; color: #a3a399; font-size: 8px; font-weight: 750; letter-spacing: 1.25px; }
.history-label::after { height: 1px; flex: 1; background: #e6e4da; content: ""; }
.messages { flex: 1; min-height: 0; padding: 8px 35px 14px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #c6cbbb transparent; scrollbar-width: thin; }
.message { display: flex; gap: 12px; margin: 0; padding: 12px 0; animation: message-in .25s ease both; }
.message + .message { border-top: 1px solid rgba(225, 224, 214, .67); }
.message.is-own .avatar { color: #f7f5ea; background: #51745a; }
.message-content { min-width: 0; flex: 1; }
.message-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 1px 0 5px; }
.message-author { color: #2f3d32; font: 600 13px var(--serif); }
.message-time { color: #a4a49a; font-size: 9px; }
.message-text { overflow-wrap: anywhere; color: #555b53; font-size: 12px; line-height: 1.62; white-space: pre-wrap; }
.typing-hint { padding: 0 35px 9px 81px; color: #969b90; font: italic 11px var(--serif); }
.typing-hint::before { content: "✳ "; color: #9eac7b; font-style: normal; }
.empty-state { padding: 54px 20px; color: #8b8f84; text-align: center; }
.empty-mark { display: block; margin-bottom: 10px; color: #a0ad80; font-size: 24px; }
.empty-state strong { display: block; color: #485548; font: 18px var(--serif); }
.empty-state p { margin: 6px 0; font-size: 11px; }

.members-panel { display: flex; flex: 0 0 221px; flex-direction: column; padding: 22px 18px 16px; border-left: 1px solid var(--line); background: rgba(238, 238, 229, .42); }
.members-header { display: flex; align-items: flex-start; justify-content: space-between; }
.members-header .eyebrow { color: #96998e; }
.members-header h2 { margin: 5px 0 0; color: #344137; font: 500 16px var(--serif); letter-spacing: -.3px; }
.members-header h2 span { color: #92978c; font: 10px var(--sans); }
.members-flower { color: #a2ad87; font-size: 15px; }
.member-list { display: grid; align-content: start; gap: 9px; margin-top: 21px; overflow-y: auto; }
.member-entry { display: flex; align-items: center; gap: 9px; min-width: 0; }
.member-entry .avatar { width: 29px; height: 29px; border-radius: 10px 10px 10px 4px; font-size: 11px; }
.member-entry:nth-child(3n + 1) .avatar { background: #d8c49c; }
.member-entry:nth-child(3n + 2) .avatar { background: #bed0b0; }
.member-entry:nth-child(3n) .avatar { background: #e5b9a8; }
.member-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.member-name { overflow: hidden; color: #485248; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.member-status { display: flex; align-items: center; gap: 5px; color: #989b90; font-size: 8px; }
.member-status .online-dot { width: 5px; height: 5px; box-shadow: none; }
.members-foot { margin-top: auto; padding-top: 13px; border-top: 1px solid #e4e3d9; color: #9b9d91; font: italic 10px var(--serif); }
.composer-wrap { padding: 10px 33px 15px; }
.composer { padding: 10px 13px 9px; border: 1px solid #dcded2; border-radius: 11px; background: rgba(255, 255, 251, .76); box-shadow: 0 7px 20px rgba(37, 50, 37, .035); transition: border-color .16s, box-shadow .16s; }
.composer:focus-within { border-color: #9daa8b; box-shadow: 0 0 0 3px rgba(128, 150, 113, .1); }
.composer textarea { display: block; width: 100%; min-height: 27px; max-height: 100px; padding: 2px 2px 7px; resize: none; border: 0; outline: none; color: #354238; background: transparent; font-size: 12px; line-height: 1.5; }
.composer textarea::placeholder { color: #a4a69c; }
.composer-tools { display: flex; align-items: center; gap: 13px; }
.composer-tip { flex: 1; color: #a0a197; font-size: 9px; }
kbd { padding: 2px 4px; border: 1px solid #e0e0d7; border-radius: 4px; color: #777c72; background: #f5f4ee; font: 8px var(--sans); }
.tip-divider { padding: 0 4px; color: #c3c3b9; }
.composer-count { color: #a4a69a; font-size: 9px; }
.send-button { display: flex; align-items: center; gap: 9px; min-height: 31px; padding: 0 10px 0 13px; border: 0; border-radius: 7px; color: #f8f6ed; background: #244b3d; cursor: pointer; font-size: 10px; font-weight: 700; transition: transform .15s, background .15s; }
.send-button:hover { transform: translateY(-1px); background: #173b30; }
.send-button:disabled { opacity: .5; cursor: wait; }
.send-arrow { color: var(--lime); font-size: 13px; }
.footer-caption { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: #a5a69b; font-size: 7px; font-weight: 700; letter-spacing: 1.15px; }
.footer-caption > span:first-child { color: #9cad7e; font-size: 10px; }
.footer-line { width: 23px; height: 1px; background: #d8d8ce; }

.voice-dock {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  padding: 9px 32px;
  border-top: 1px solid #dfe2d6;
  background: linear-gradient(100deg, rgba(230, 237, 217, .62), rgba(248, 248, 240, .9) 62%, rgba(241, 231, 214, .55));
}
.voice-summary { display: flex; align-items: center; gap: 10px; min-width: 142px; }
.voice-icon { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid #cbd5be; border-radius: 10px 10px 10px 4px; color: #486b4e; background: #f8faef; font-size: 15px; }
.voice-copy { display: flex; flex-direction: column; gap: 3px; }
.voice-copy strong { color: #344638; font: 600 12px var(--serif); }
.voice-copy span { color: #888e81; font-size: 9px; }
.voice-participants { display: flex; flex: 1; align-items: center; gap: 7px; min-width: 0; overflow: hidden; }
.voice-person { display: inline-flex; align-items: center; gap: 6px; max-width: 120px; padding: 5px 8px; border: 1px solid #e1e4d8; border-radius: 20px; color: #596354; background: rgba(255, 255, 250, .62); font-size: 9px; white-space: nowrap; }
.voice-person::before { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #82a56c; content: ""; }
.voice-person span { overflow: hidden; text-overflow: ellipsis; }
.voice-controls { display: flex; align-items: center; gap: 7px; }
.voice-controls button { min-height: 32px; padding: 0 12px; border: 1px solid #c9d2c0; border-radius: 7px; color: #35523b; background: rgba(255, 255, 250, .78); cursor: pointer; font-size: 9px; font-weight: 700; transition: background .15s, transform .15s; }
.voice-controls button:hover:not(:disabled) { transform: translateY(-1px); background: white; }
.voice-controls button:disabled { opacity: .5; cursor: not-allowed; }
.voice-controls .voice-join { border-color: #315c43; color: #f7f7eb; background: #315c43; }
.voice-controls .voice-join:hover:not(:disabled) { background: #244a35; }
.voice-controls .voice-mute[aria-pressed="true"] { border-color: #cf8a73; color: #8e4e3d; background: #fff1e9; }
.voice-controls .voice-leave { border-color: #e1c7bb; color: #9c5142; }

.mobile-scrim { display: none; }
.toast { position: fixed; right: 22px; bottom: 24px; z-index: 8; max-width: min(360px, calc(100vw - 40px)); padding: 12px 16px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 9px; color: white; background: #24463a; box-shadow: 0 10px 30px rgba(22, 42, 33, .18); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(9px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.modal { width: min(430px, calc(100vw - 32px)); padding: 30px; border: 1px solid #d8ddd0; border-radius: 14px; color: var(--ink); background: radial-gradient(circle at 100% 0%, rgba(221, 232, 206, .45), transparent 40%), #f8f8f1; box-shadow: 0 24px 80px rgba(24, 46, 35, .2); }
.modal::backdrop { background: rgba(22, 39, 31, .48); backdrop-filter: blur(3px); }
.modal-close-form { position: absolute; top: 13px; right: 13px; }
.modal-close { width: 27px; height: 27px; border: 0; border-radius: 50%; color: #72796e; background: #eeefe6; cursor: pointer; font-size: 18px; }
.modal-kicker { color: #829172; font-size: 8px; font-weight: 750; letter-spacing: 1.5px; }
.modal h2 { margin: 9px 0 8px; color: #304237; font: 500 29px/1.1 var(--serif); letter-spacing: -.7px; }
.modal p { margin: 0; color: #82867b; font-size: 12px; line-height: 1.6; }
.modal-form { display: grid; gap: 8px; margin-top: 23px; }
.modal-form label { color: #687466; font-size: 10px; font-weight: 700; }
.modal-form input { width: 100%; padding: 12px 13px; border: 1px solid #d9ddd1; border-radius: 8px; outline: none; color: #304237; background: #fffefa; font-size: 12px; }
.invite-field { display: grid; gap: 8px; }
.invite-field[hidden] { display: none; }
.modal-form input:focus { border-color: #8ea17d; box-shadow: 0 0 0 3px rgba(142, 161, 125, .12); }
.modal-submit { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; padding: 12px 14px; border: 0; border-radius: 8px; color: #faf9f1; background: #244b3d; cursor: pointer; font-size: 11px; font-weight: 700; }
.modal-submit span { color: var(--lime); font-size: 15px; }
.modal-submit:disabled { opacity: .6; cursor: wait; }
.auth-error { min-height: 0; color: #a34e3e; font-size: 10px; line-height: 1.4; }
.auth-error:not(:empty) { min-height: 14px; }
.auth-toggle { display: block; margin: 15px auto 0; padding: 5px; border: 0; color: #82867b; background: transparent; cursor: pointer; font-size: 10px; }
.auth-toggle strong { color: #365743; text-decoration: underline; text-underline-offset: 2px; }
.privacy-note { display: flex; align-items: center; gap: 7px; margin-top: 17px; color: #9a9c91; font-size: 9px; }
.privacy-note span { color: #a1aa87; font-size: 15px; }
.about-rule { height: 1px; margin: 18px 0; background: #e4e5db; }
.modal .about-small { font-size: 10px; }
.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; }

@keyframes message-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1050px) {
  .members-panel { flex-basis: 190px; padding-right: 13px; padding-left: 13px; }
  .room-intro { padding-right: 27px; padding-left: 27px; }
  .messages { padding-right: 27px; padding-left: 27px; }
  .history-label { margin-right: 27px; margin-left: 27px; }
  .composer-wrap { padding-right: 25px; padding-left: 25px; }
}
@media (max-width: 820px) {
  body { overflow: hidden; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, calc(100vw - 52px)); transform: translateX(-102%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-scrim { position: fixed; inset: 0; z-index: 1; display: block; background: rgba(20, 37, 30, .35); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .mobile-scrim.visible { opacity: 1; pointer-events: auto; }
  .topbar { height: 54px; padding: 0 17px; }
  .menu-toggle { display: grid; width: 29px; height: 29px; margin-right: 9px; color: #677263; font-size: 15px; }
  .breadcrumb { flex: 1; gap: 7px; }
  .connection-indicator span:last-child { display: none; }
  .topbar-actions { gap: 11px; }
  .room-intro { min-height: 128px; padding: 19px; }
  .room-symbol { width: 43px; height: 43px; border-radius: 13px 13px 13px 4px; font-size: 19px; }
  .room-heading h1 { font-size: 25px; }
  .room-heading p { max-width: 55vw; font-size: 10px; }
  .room-stats { min-width: 67px; }
  .stat-number { font-size: 21px; }
  .members-panel { display: none; }
  .history-label { margin: 15px 19px 5px; }
  .messages { padding: 7px 19px 14px; }
  .voice-dock { flex-wrap: wrap; gap: 8px; padding: 9px 17px; }
  .voice-summary { min-width: 0; flex: 1; }
  .voice-participants { order: 3; flex-basis: 100%; }
  .voice-controls { margin-left: auto; }
  .composer-wrap { padding: 10px 17px 14px; }
}
@media (max-width: 480px) {
  .room-intro { gap: 11px; min-height: 116px; padding: 16px 14px; }
  .room-symbol { width: 38px; height: 38px; font-size: 17px; }
  .room-overline { font-size: 7px; letter-spacing: 1px; }
  .room-heading h1 { font-size: 23px; }
  .room-heading p { max-width: 57vw; margin-top: 4px; font-size: 9px; line-height: 1.35; }
  .room-stats { min-width: 44px; }
  .stat-label { font-size: 6px; letter-spacing: .7px; }
  .avatar-stack { margin-top: 5px; }
  .stack-avatar { width: 18px; height: 18px; font-size: 7px; }
  .history-label { margin-right: 14px; margin-left: 14px; }
  .messages { padding-right: 14px; padding-left: 14px; }
  .message { gap: 9px; padding: 10px 0; }
  .message .avatar { width: 30px; height: 30px; }
  .message-text { font-size: 11px; }
  .typing-hint { padding-left: 54px; font-size: 10px; }
  .voice-dock { gap: 6px; padding: 8px 11px; }
  .voice-icon { width: 28px; height: 28px; }
  .voice-copy strong { font-size: 11px; }
  .voice-copy span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .voice-controls { gap: 4px; }
  .voice-controls button { min-height: 29px; padding: 0 8px; font-size: 8px; }
  .voice-person { padding: 4px 7px; }
  .composer-wrap { padding-right: 11px; padding-left: 11px; }
  .composer { padding: 9px 9px 8px; }
  .composer-tip { font-size: 8px; }
  .composer-count { display: none; }
  .send-button { gap: 6px; padding-right: 8px; padding-left: 10px; }
  .footer-caption { justify-content: center; gap: 5px; font-size: 6px; letter-spacing: .8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
