:root {
  color-scheme: light dark;
  --ink: #20231f; --muted: #62675e; --line: #dddfd6; --paper: #fff; --ground: #f8f8f4;
  --wash: #eef1e8; --accent: #cbf5aa; --accent-ink: #21391e; --bubble: #e1f2d3; --dark: #202b23; --inverse: #fff;
  --error: #a13d2d; --radius: 16px;
  font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--ground);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.sprite { width: 0; height: 0; position: absolute; overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #699b57; outline-offset: 3px; }
h1, h2, p { margin: 0; }
.welcome { min-height: 100svh; max-width: 1680px; margin: auto; display: flex; flex-direction: column; padding: 0 clamp(22px,5vw,80px) clamp(22px,4vw,64px); }
.mast { height: clamp(80px,10vh,110px); display: flex; justify-content: space-between; align-items: center; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 730; letter-spacing: -.055em; font-size: 25px; }
.brand-mark { height: 34px; width: 34px; border-radius: 11px 11px 11px 3px; background: var(--dark); color: var(--accent); display: grid; place-items: center; }
.brand-mark svg { width: 25px; height: 25px; stroke-width: 1.8; }
.quiet, .primary, .circle, .action-row { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: .6em; font-weight: 610; }
.quiet { background: var(--paper); color: var(--ink); padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; }
.quiet:hover, .circle:not(.dark):hover, .action-row:hover { background: var(--wash); }
.quiet svg { width: 17px; height: 17px; }
.primary, .dark { background: var(--dark); color: var(--inverse); }
.primary { padding: 12px 19px; border-radius: 999px; }
.primary:hover, .dark:hover { filter: brightness(1.15); }
.circle { width: 40px; height: 40px; border-radius: 50%; background: transparent; color: var(--ink); padding: 0; flex: 0 0 auto; }
.circle.dark { background: var(--dark); color: var(--inverse); }
.signin { flex: 1; display: grid; grid-template-columns: 1.02fr 1fr; border: 1px solid var(--line); border-radius: 26px; overflow: hidden; min-height: min(680px,77svh); background: var(--paper); }
.intro { align-self: center; padding: clamp(32px,6vw,104px); }
.intro h1 { font-size: clamp(42px,4.8vw,78px); line-height: .98; font-weight: 590; letter-spacing: -.077em; overflow-wrap: anywhere; }
.intro h1 em { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.065em; font-weight: 400; }
.intro > p:not(.signin-note, .feedback) { margin-top: 24px; max-width: 350px; font-size: clamp(16px,1.3vw,20px); line-height: 1.5; color: var(--muted); }
.signin-button { margin-top: 36px; padding: 15px 20px; }
.signin-button svg:first-child { color: var(--accent); }
.signin-button svg:last-child { margin-left: 12px; width: 18px; }
.signin-note { margin-top: 10px; font-size: 13px; color: var(--muted); }
.switch-account { margin-top: 12px; }
.feedback { color: var(--error); font-size: 14px; overflow-wrap: anywhere; }
.feedback:not(:empty) { margin-top: 12px; }
.illustration { position: relative; isolation: isolate; overflow: hidden; min-height: 100%; background: #b6d6ab; color: #20372c; container-type: inline-size; }
.art-grid { position: absolute; inset: 0; background: radial-gradient(circle at 1px 1px,#375b3d4a 1px,transparent 1.5px) 0 0 / 15px 15px; }
.art-orbit { width: 80%; aspect-ratio: 1; border: 1px solid #385d414a; border-radius: 50%; position:absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.art-orbit::before, .art-orbit::after { content: ""; position: absolute; border: inherit; border-radius: inherit; inset: 11%; }
.art-orbit::after { inset: -12%; }
.art-message { width: 51%; height: 23cqw; position: absolute; border: 2px solid #253629; border-radius: 4.3cqw 4.3cqw 4.3cqw .5cqw; display: grid; grid-template-columns: 24% 1fr; grid-template-rows: 1fr 1fr; gap: 9% 10%; padding: 5.2% 4%; box-shadow: .8cqw 1cqw 0 #253629; }
.art-back { left: 17.5%; top: calc(50% - 15.4cqw); transform: rotate(-12deg); background: #e9f1dd; }
.art-front { left: 33%; top: calc(50% - 3.6cqw); transform: rotate(8deg); background: #273d30; border-radius: 4.3cqw 4.3cqw .5cqw 4.3cqw; }
.art-avatar { background: #a3be9a; border: 1.5px solid #233a2a; width: 100%; aspect-ratio: 1; align-self: center; border-radius: 50%; grid-row: span 2; display: grid; place-items: center; }
.art-avatar.light { background: #caf4a9; }
.art-avatar svg { width: 90%; height: 90%; }
.art-line { width: 94%; height: 1.15cqw; background: #516c54; border-radius: 9px; align-self: end; }
.art-front .art-line { background: #d9ead0; }
.art-line.short { align-self: start; width: 62%; }
.art-seal { position: absolute; right: -4.4cqw; bottom: -4cqw; width: 10cqw; aspect-ratio: 1; border-radius: 50%; background: #cdf6a9; border: 1.6px solid #293a2e; display: grid; place-items: center; }
.art-seal svg { width: 49%; height: 49%; }
#workspace { max-width: 1680px; margin: auto; height: 100dvh; min-height: 350px; display: grid; grid-template-columns: minmax(255px,30%) minmax(0,1fr); border-inline: 1px solid var(--line); }
.rail { display: flex; flex-direction: column; overflow: hidden; padding: 24px 16px 0; border-right: 1px solid var(--line); background: var(--paper); }
.rail-head, .profile, .room-head, .dialog-head { display: flex; align-items: center; gap: 12px; }
.rail-head { justify-content: space-between; padding: 0 6px; }
.rail > h2 { margin: 34px 9px 12px; font-size: 26px; font-weight: 650; letter-spacing: -.055em; }
.search { display: flex; align-items: center; gap: 8px; border-radius: 12px; background: var(--ground); padding: 9px 12px; border: 1px solid var(--line); margin: 0 3px 14px; }
.search svg { width: 17px; height: 17px; color: var(--muted); }
.search input { outline: none; min-width: 0; width: 100%; border: 0; background: transparent; }
.search:focus-within { border-color: #699b57; }
#chats { flex: 1; min-height: 0; overflow: auto; }
.chat-row, .action-row { width: 100%; text-align: left; }
.chat-row { padding: 10px 9px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 12px; background: transparent; }
.chat-row:hover, .chat-row[aria-current="true"] { background: var(--wash); }
.avatar { flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid color-mix(in srgb,var(--ink) 10%,transparent); background: #e0ebd8; color: #344634; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 680; }
.avatar.large, .chat-row .avatar { width: 43px; height: 43px; font-size: 18px; }
.chat-row:nth-child(3n+2) .avatar { background: #eee3cd; color: #56452a; }
.chat-row:nth-child(3n+3) .avatar { background: #e1e4f4; color: #3e4163; }
.profile { margin: 12px -16px 0; border-top: 1px solid var(--line); padding: 14px 20px max(14px,env(safe-area-inset-bottom)); }
.profile-text, .room-titles, .row-text { min-width: 0; flex: 1; }
.profile-text strong, .row-text strong, .room-titles h2 { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail small, .room-head small { display: block; font-size: 12px; color: var(--muted); }
.unread { border-radius: 100px; background: var(--dark); color: var(--inverse); padding: 2px 7px; font-size: 11px; }
.room { display: grid; min-width: 0; min-height: 0; }
.room-empty, .conversation-empty { text-align: center; display: grid; place-items: center; align-content: center; gap: 12px; padding: 25px; }
.room-empty h2,.conversation-empty strong { font-size: 24px; font-weight: 620; letter-spacing: -.05em; }
.room-empty p,.conversation-empty p { max-width: 330px; color: var(--muted); }
.empty-icon { width: 75px; height: 75px; border-radius: 25px 25px 25px 6px; color: var(--accent-ink); background: var(--accent); display: grid; place-items: center; margin-bottom: 7px; transform: rotate(-4deg); }
.empty-icon svg { width: 37px; height: 37px; }
#conversation { display: grid; grid-template-rows: auto minmax(0,1fr) auto; min-height: 0; }
.room-head { padding: 17px clamp(14px,3vw,48px); background: var(--paper); border-bottom: 1px solid var(--line); }
.room-head h2 { font-size: 19px; letter-spacing: -.04em; }
.room-head .back { display: none; }
.history { min-height: 0; display: flex; flex-direction: column; }
.message-search { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 14px; background: var(--paper); border-bottom: 1px solid var(--line); }
.message-search .search { min-width: 105px; flex: 1; margin: 0; }
.message-search small { color: var(--muted); }
.timeline { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px clamp(14px,5vw,74px); }
.older { display: flex; margin: 0 auto 14px; }
#messages { min-height: 100%; display: flex; flex-direction: column; justify-content: end; gap: 8px; }
.conversation-empty { flex: 1; min-height: 200px; }
.bubble { max-width: min(84%,620px); background: var(--paper); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; align-self: flex-start; padding: 8px 12px; }
.bubble.mine { align-self: flex-end; border-color: transparent; border-radius: 16px 16px 4px 16px; background: var(--bubble); }
.bubble p { white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; font-size: 16px; }
.bubble .from { font-weight: 650; font-size: 12px; display: block; color: var(--muted); }
.bubble time { display: block; text-align: right; font-size: 10px; color: var(--muted); }
.bubble-foot { display: flex; align-items: center; justify-content: end; gap: 7px; margin-top: 2px; }
.bubble-more { border: 0; color: var(--muted); background: transparent; border-radius: 6px; padding: 1px 5px; font-size: 13px; font-weight: 700; letter-spacing: 1px; line-height: 20px; }
.bubble-more:hover { background: color-mix(in srgb,var(--ink) 8%,transparent); }
.bubble .reply-preview { display: block; padding: 4px 8px; border-left: 2px solid var(--muted); border-radius: 4px; background: color-mix(in srgb,var(--ink) 5%,transparent); font-size: 13px; margin: 0 0 5px; overflow-wrap: anywhere; }
.removed p { font-style: italic; color: var(--muted); }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.reaction { display: inline-flex; align-items: center; gap: 3px; border-radius: 999px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); padding: 2px 7px; }
.reaction[aria-pressed="true"] { border-color: #77a565; background: var(--bubble); }
.compose-mode { display: flex; align-items: center; justify-content: space-between; border-left: 3px solid #79a468; padding: 4px 8px; margin: 0 4px 5px; background: var(--paper); border-radius: 5px; }
.compose-mode span { min-width: 0; }
.compose-mode strong,.compose-mode small { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.compose-mode small { color: var(--muted); }
.compose-wrap { padding: 4px clamp(12px,4vw,62px) max(14px,env(safe-area-inset-bottom)); }
.compose-wrap .feedback:not(:empty) { margin: 0 7px 7px; }
#composer { display: flex; align-items: end; gap: 5px; border: 1px solid var(--line); border-radius: 24px; padding: 5px; background: var(--paper); }
#draft { display: block; flex: 1; min-width: 0; resize: none; background: transparent; padding: 8px 2px; border: 0; line-height: 24px; max-height: 120px; outline: none; }
#composer:focus-within { border-color: #86a17d; }
.emoji-tray { display: flex; flex-wrap: wrap; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; padding: 7px; margin-bottom: 7px; width: fit-content; }
.emoji-tray button { width: 35px; height: 35px; border: 0; border-radius: 8px; background: transparent; font-size: 21px; }
.emoji-tray button:hover { background: var(--wash); }
dialog { width: min(94vw,450px); max-height: min(82dvh,700px); overflow: auto; border: 1px solid var(--line); border-radius: 21px; background: var(--paper); color: var(--ink); padding: 22px; box-shadow: 0 24px 100px #15231732; }
dialog::backdrop { background: #19221b75; }
.dialog-head { justify-content: space-between; margin-bottom: 13px; }
.dialog-head h2 { font-size: 23px; letter-spacing: -.05em; line-height: 1.1; }
#dialog-body { display: grid; gap: 13px; }
#dialog-body p, .list-note { color: var(--muted); font-size: 14px; }
.list-note { padding: 15px 10px; }
.field { display: grid; gap: 5px; font-size: 13px; font-weight: 630; }
.field input { min-width: 0; width: 100%; border: 1px solid var(--line); background: var(--ground); border-radius: 11px; padding: 10px 12px; font-weight: 450; }
.action-row { background: var(--ground); justify-content: flex-start; padding: 10px 13px; border-radius: 12px; }
.selected-list { display: flex; flex-wrap: wrap; gap: 6px; }
.selected-list:empty { display: none; }
.selected-list button { background: var(--wash); border: 1px solid var(--line); border-radius: 14px; padding: 3px 9px; }
.peer-card { border: 1px solid var(--line); border-radius: 13px; padding: 12px; display: grid; gap: 9px; }
.peer-card code { overflow-wrap: anywhere; color: var(--ink); font-size: 14px; font-weight: 650; user-select: all; }
.peer-card .primary { justify-self: start; }
.room-gate { padding: 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; text-align: center; margin: auto; max-width: 360px; }
.room-gate p { margin: 5px 0 12px; color: var(--muted); }
@media (max-width: 760px) {
  .intro { padding: 28px; }
  .welcome { padding: 0 16px 16px; }
  .mast { height: 70px; }
  .signin { grid-template-columns: 1fr; grid-template-rows: minmax(165px,.85fr) auto; }
  .illustration { grid-row: 1; min-height: 0; }
  .art-orbit { width: 53%; }
  .art-message { scale: .74; }
  .intro { padding: 28px clamp(24px,7vw,62px) 32px; }
  .intro h1 { font-size: clamp(40px,10vw,60px); }
  .intro h1 br { display: none; }
  .intro h1 em::before { content: " "; }
  .intro > p:not(.signin-note, .feedback) { margin-top: 12px; }
  .signin-button { margin-top: 20px; }
  #workspace { grid-template-columns: 1fr; border-inline: 0; }
  #workspace .room, #workspace.room-open .rail { display: none; }
  #workspace.room-open .room { display: grid; }
  .rail { border: 0; }
  .room-head .back { display: flex; }
  .room-head { gap: 7px; padding: 10px 12px; }
  .room-head .quiet { padding: 8px 10px; }
  .timeline { padding: 14px; }
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #eceee6; --muted: #aeb5aa; --line: #383d35; --paper: #20251f; --ground: #171b16; --wash: #323a2d; --accent: #cbf5aa; --accent-ink: #21391e; --bubble: #394f32; --dark: #d5ebc6; --inverse: #142013; --error: #ffad9e; }
  .brand-mark, .signin-button svg:first-child { color: var(--inverse); }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .15s ease,color .15s ease; }
}
