:root{font-family:Arial,Helvetica,sans-serif;color:#172722;background:#d6dfda;font-size:16px;--teal:#075e54;--green:#128c7e;--muted:#687873;--app-height:100dvh;--app-top:0px;--motion:220ms}
*{box-sizing:border-box}body{margin:0;min-height:100dvh;overscroll-behavior:none}button,input,textarea{font:inherit}button,a,input,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #e9ad4d;outline-offset:3px}input:focus-visible,textarea:focus-visible{outline:2px solid var(--green);outline-offset:2px}[hidden]{display:none!important}svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}button{border:0}input,textarea{min-width:0}a{color:inherit;text-decoration:none}.app{position:fixed;top:var(--app-top);left:0;width:100%;height:var(--app-height);display:flex;flex-direction:column;overflow:hidden;background:#fff}.topbar{display:flex;align-items:center;background:var(--teal);color:#fff;min-height:76px;padding:14px 12px 13px 20px;padding-top:max(14px,env(safe-area-inset-top));flex-shrink:0;z-index:5}.heading{min-width:0;flex:1}.heading h1{font-size:1.25rem;letter-spacing:-.02em;font-weight:600;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.heading p{font-size:.8125rem;margin:5px 0 0;color:#d6e8e4;min-height:15px}.icon-button{width:44px;height:44px;padding:10px;display:inline-flex;align-items:center;justify-content:center;background:transparent;color:inherit;border-radius:50%;flex-shrink:0}.icon-button:hover{background:#ffffff15}.back{margin-left:-10px;margin-right:7px}.menu-wrap{position:relative}.menu{position:absolute;top:48px;right:0;background:#fff;color:#22372f;box-shadow:0 6px 24px #001f2430;border-radius:10px;padding:6px;min-width:195px;z-index:12;transform-origin:top right;animation:menu-in 140ms ease-out}.menu button{display:block;width:100%;padding:14px 12px;background:none;text-align:left;border-radius:6px;font-size:.9375rem}.menu button:hover{background:#eff5f2}.home{flex:1;overflow:auto;background:#fff;display:flex;flex-direction:column}.open-room{padding:30px 24px 26px;background:#f3f8f5}.open-room h2{font-size:1.5rem;font-weight:600;letter-spacing:-.025em;margin:0 0 9px}.open-room>p{font-size:.9375rem;line-height:1.5;color:#566b61;margin:0 0 22px}.room-field{display:flex;align-items:center;border:1px solid #c7d8cf;background:white;padding:6px 6px 6px 14px;border-radius:12px;gap:7px}.room-field>span{font-size:1.25rem;color:#72877a}.room-field input{border:0;background:transparent;width:100%;padding:8px 2px;font-size:1rem;outline:none}.primary{background:var(--green);color:white;font-weight:600;padding:12px 20px;border-radius:8px;min-height:44px}.primary:hover{background:var(--teal)}.field-note{font-size:.75rem;line-height:1.6;color:#6b7d73;margin:10px 0 0;min-height:20px}.field-note.error{color:#a12626}.recent-heading{display:flex;align-items:baseline;justify-content:space-between;margin:26px 24px 8px}.recent-heading h2{font-size:1rem;margin:0}.recent-heading span{font-size:.75rem;color:#788b80}.room-item{display:flex;align-items:center;gap:15px;padding:17px 24px;border-bottom:1px solid #edf1ee}.room-item:hover{background:#f5f8f6}.room-avatar{width:46px;height:46px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#e1eee6;color:#497664;font-size:1.25rem;font-weight:600;flex-shrink:0}.room-detail{min-width:0;flex:1}.room-title{display:block;font-weight:600;margin-bottom:6px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.room-path{font-size:.8125rem;color:#73877a;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.room-date{font-size:.75rem;color:#718078;align-self:flex-start;margin-top:3px}.empty-home{color:#79877f;text-align:center;padding:44px 28px}.empty-home svg{width:48px;height:48px;color:#9bb4a5;stroke-width:1.3;margin-bottom:10px}.empty-home p{font-size:.875rem}.home-note{font-size:.8125rem;line-height:1.6;color:#6d7e73;padding:25px 28px 26px;margin:auto 0 0;text-align:center}.chat{display:flex;flex:1;min-height:0;flex-direction:column;background:#ece5dd;position:relative}.chat-notice{font-size:.75rem;text-align:center;padding:9px 12px;background:#f8f4ec;color:#75776b;flex-shrink:0;border-bottom:1px solid #ded8cb}.connection-banner{padding:9px 14px;background:#fff2d3;color:#735a27;font-size:.8125rem;text-align:center;flex-shrink:0}.messages{flex:1;overflow:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#b8c6bc transparent;overflow-anchor:none;background-image:radial-gradient(#82998b0b 1px,transparent 1px);background-size:20px 20px}.conversation-start{text-align:center;padding:20px 20px 12px}.conversation-start>span{display:block;width:fit-content;margin:0 auto;background:#dae8e1;font-size:.75rem;border-radius:7px;padding:6px 12px;color:#4a6759;display:block;box-shadow:0 1px 1px #112b1b08}.conversation-start p{display:inline-block;background:#fffae9;color:#786f53;border-radius:8px;font-size:.8125rem;line-height:1.6;padding:12px 18px;margin:22px 14px 4px}.thread{padding:2px 13px 14px}.row{position:relative;overflow:hidden;transition:height 240ms cubic-bezier(.2,.7,.3,1),opacity 200ms ease-out}.snapshot,.snapshot .bubble{transition:none!important}.row-content{display:flex;padding:4px 0 4px;align-items:flex-start}.row.own .row-content{justify-content:flex-end}.bubble{background:#fff;border-radius:0 9px 9px 9px;padding:0;border:1px solid transparent;max-width:85%;min-width:82px;overflow:hidden;box-shadow:0 1px 1px #102a2015;overflow-wrap:anywhere;transition:height 240ms cubic-bezier(.2,.7,.3,1),background var(--motion),border-color var(--motion),box-shadow var(--motion),opacity var(--motion)}.own .bubble{background:#dcf8c6;border-radius:9px 0 9px 9px}.bubble-body{padding:8px 10px 7px}.author{display:block;color:#087e6c;font-size:.8125rem;font-weight:600;margin-bottom:4px}.own .author{display:none}.message-text{white-space:pre-wrap;font-size:1rem;line-height:1.42}.bubble-footer{display:flex;justify-content:flex-end;align-items:center;gap:6px;margin-top:4px;font-size:.75rem;color:#78906f;line-height:1.25;min-height:14px}.draft .bubble{background:#f6f7f3;border:1px dashed #a4b9ab;box-shadow:none;opacity:.9}.draft.own .bubble{background:#e6f0dc;border-color:#a0b78b;box-shadow:none}.draft .message-text{font-style:italic;color:#546b5c}.system .row-content{justify-content:center;padding:8px 10px}.system-note{color:#5d7567;background:#e2eae2c7;font-size:.75rem;line-height:1.5;padding:5px 10px;border-radius:6px;text-align:center;max-width:100%;overflow-wrap:anywhere}.new-text{animation:text-in 320ms ease-out}.composer-area{flex-shrink:0;background:#f0f2ed;padding-bottom:env(safe-area-inset-bottom);z-index:3;position:relative}.composer{display:flex;align-items:flex-end;gap:8px;padding:9px 9px 10px}.compose-field{display:flex;align-items:flex-end;border-radius:24px;background:#fff;min-width:0;flex:1;box-shadow:0 1px 2px #0000000b}.emoji-toggle{color:#77837b;margin:1px 0 1px 1px;width:43px;flex-shrink:0}.emoji-toggle:hover{background:#e9f2ed}.compose-field textarea{resize:none;background:transparent;border:0;outline:none;padding:13px 13px 11px 1px;color:#1b2b21;line-height:1.35;max-height:132px;width:100%;min-height:46px;font-size:1rem;scrollbar-width:thin}.send-button{width:47px;height:47px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:50%;background:var(--green);color:#fff;transition:opacity 160ms,transform 160ms}.send-button:disabled{opacity:.46}.send-button:active:not(:disabled){transform:scale(.94)}.send-button svg{width:25px;height:25px;stroke-width:1.6}.emoji-panel{border-top:1px solid #dbe3dc;background:#f5f8f4;padding:4px 12px 12px;height:240px;max-height:min(240px,max(100px,calc(var(--app-height) - 220px)));display:flex;flex-direction:column;animation:menu-in 140ms ease-out}.emoji-header{display:flex;align-items:center;justify-content:space-between;color:#456653;font-size:.875rem;font-weight:600;height:44px;flex-shrink:0}.emoji-actions{display:flex;align-items:center;gap:4px}.emoji-header .icon-button{width:44px;height:44px}.emoji-header button:disabled{opacity:.3}.emoji-header button:hover:not(:disabled){background:#dbe9dd}.emoji-panel input{width:100%;border:1px solid #d3dfd4;border-radius:8px;padding:8px 12px;background:#fff;font-size:.875rem;margin-bottom:8px;flex-shrink:0}.emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);overflow:auto;min-height:0;gap:2px}.emoji-grid button{background:transparent;min-height:39px;border-radius:8px;font-size:1.5rem;padding:4px;line-height:1.2}.emoji-grid button:hover{background:#dbe9dd}.emoji-no-results{grid-column:1/-1;font-size:.875rem;text-align:center;color:#6b7d70;padding:15px}.jump-button{position:absolute;right:17px;bottom:88px;background:white;color:#537262;z-index:2;box-shadow:0 2px 8px #12322122;border-radius:50%;width:39px;height:39px;display:grid;place-items:center}.toast{position:absolute;bottom:90px;left:50%;transform:translateX(-50%);padding:10px 16px;background:#214735;color:#fff;border-radius:9px;font-size:.875rem;z-index:20;max-width:90%;box-shadow:0 3px 14px #0002;text-align:center}dialog{border:0;padding:28px;border-radius:18px;color:#233c2f;max-width:calc(100vw - 40px);width:370px;box-shadow:0 12px 50px #0003}dialog::backdrop{background:#042b2280}dialog h2{font-size:1.375rem;margin:0 0 12px}dialog p{font-size:.9375rem;line-height:1.5;color:#617769;margin:0 0 23px}dialog label{display:block;font-size:.875rem;font-weight:600;margin-bottom:8px}dialog input{width:100%;border:1px solid #b7cbbd;border-radius:8px;padding:12px;font-size:1rem}.dialog-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:8px}.text-button{color:#526d5c;background:none;padding:12px;border-radius:8px;min-height:44px}.name-error{color:#a12626!important;font-size:.8125rem!important;margin:7px 0 10px!important;min-height:18px}.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 menu-in{from{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:none}}@keyframes text-in{from{opacity:0}to{opacity:1}}@media(min-width:700px){body{background:linear-gradient(180deg,#0b7464 0,#0b7464 145px,#d6dfda 145px,#d6dfda 100%)}.app{left:50%;transform:translateX(-50%);top:50%;margin-top:calc(var(--app-height) / -2);width:460px;height:min(840px,calc(100dvh - 48px));--app-height:min(840px,calc(100dvh - 48px));border-radius:16px;box-shadow:0 20px 70px #18392b35;border:1px solid #ffffff40}}@media(max-height:450px){.topbar{min-height:58px;padding-top:9px;padding-bottom:9px}.chat-notice{padding:5px 10px}.emoji-panel{max-height:120px}.conversation-start{padding-top:10px}.conversation-start p{margin-top:10px}}@media(prefers-reduced-motion:reduce){:root{--motion:0ms}*,*::before,*::after{animation-duration:0ms!important;transition-duration:0ms!important;scroll-behavior:auto!important}}

.viewport-probe{position:absolute;top:0;left:0;width:0;height:100dvh;visibility:hidden;pointer-events:none}

/* Compact message metadata, connected replies and reaction controls. */
.own .author{display:block}
.bubble-body{position:relative}
.message-text::after{content:"";display:inline-block;width:var(--time-space,46px);height:12px;vertical-align:baseline}
.bubble-footer{position:absolute;right:10px;bottom:8px;display:block;margin:0;min-height:0;line-height:1.1;white-space:nowrap;font-size:.75rem;color:#677d6d}
.draft .message-text::after{display:none}
.date-row .system-note{background:#dae8e1;color:#4a6759;padding:5px 12px}
.date-row .row-content{padding:13px 10px 8px}
.reply-block{position:relative;margin:0 -4px 6px}
.reply-snippet{display:block;background:#eef1ed;border-left:3px solid var(--name-color,#128c7e);border-radius:5px;padding:7px 9px;text-align:left;width:100%;min-width:0;color:#617267}
.reply-snippet:hover{background:#e1e9e2}
.own .reply-snippet{background:#cfe9bd}
.reply-name{display:block;font-size:.8125rem;font-weight:600;line-height:1.35;margin-bottom:2px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.reply-text{display:block;font-size:.875rem;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#576b5e}
.reply-dismiss{position:absolute;top:0;right:0;width:30px;height:30px;line-height:1;background:transparent;color:#64796b;border-radius:50%;font-size:1.35rem}
.reply-block:has(.reply-dismiss:not([hidden])) .reply-snippet{padding-right:32px}
.compose-reply{display:flex;align-items:center;gap:5px;padding:9px 12px 0;background:#f0f2ed}
.compose-reply>.reply-snippet{flex:1}
.compose-reply>.icon-button{color:#718175}
.thought-toggle{color:#77837b;margin:1px 1px 1px 0;width:43px}
.thought-toggle .thought-slash,.thought-toggle .thought-gap{display:none}
.thought-toggle.off .thought-slash,.thought-toggle.off .thought-gap{display:block}
.thought-toggle.off{color:#89928c}
.compose-field textarea{padding-right:2px}
.reaction-pill{position:absolute;bottom:3px;left:10px;display:flex;align-items:center;gap:3px;padding:3px 6px;border:1px solid #e1e7df;border-radius:20px;background:#fff;color:#627168;box-shadow:0 1px 2px #12351d24;line-height:1;min-height:26px;max-width:calc(100% - 25px)}
.own .reaction-pill{left:auto;right:10px}
.reaction-pill>span{font-size:1rem}
.reaction-pill>span.reaction-count{font-size:.75rem;padding:0 2px}
.reaction-pill.reacted{border-color:#a7c7aa;background:#f5faf2}
.reactions-heading{display:flex;align-items:center;justify-content:space-between;margin:-7px -10px 10px 0}
.reactions-heading h2{margin:0}
#reactions-dialog{padding:22px;max-height:70dvh}
#reactions-list{overflow:auto;max-height:50dvh}
.reaction-person{display:flex;align-items:center;justify-content:space-between;width:100%;gap:14px;padding:13px 4px;background:transparent;border-bottom:1px solid #e6ede6;text-align:left}
button.reaction-person:hover{background:#f2f6f1}
.reaction-person-name{font-size:.9375rem;font-weight:600;min-width:0;overflow-wrap:anywhere}
.reaction-person-name small{display:block;font-size:.75rem;font-weight:400;color:#7a897f;margin-top:5px}
.reaction-person-emoji{font-size:1.5rem;flex-shrink:0}
.message-actions{position:absolute;z-index:15;max-width:calc(100% - 16px);animation:menu-in 120ms ease-out}
.quick-reactions{display:flex;padding:5px;border-radius:28px;gap:1px;background:#fff;box-shadow:0 3px 16px #17342633}
.quick-reactions button{display:grid;place-items:center;width:36px;height:38px;padding:3px;background:transparent;border-radius:50%;font-size:1.45rem}
.quick-reactions button:hover,.quick-reactions button.selected{background:#dcebdc}
.quick-reactions .more-reactions{color:#6b7c6e;background:#eff3ed}
.reply-action{margin-top:6px;display:flex;align-items:center;gap:10px;background:#fff;color:#354f3c;border-radius:10px;padding:12px 17px;box-shadow:0 3px 16px #17342628;font-size:.9375rem;min-height:44px}
.reply-action svg{width:21px;height:21px}
.actions-open .bubble{box-shadow:0 0 0 2px #5c9c7480,0 1px 1px #102a2015}
.bubble{touch-action:pan-y}
.swiping .bubble{user-select:none}
.swiping::before{content:"↩";position:absolute;top:50%;left:8px;transform:translateY(-50%);font-size:1.4rem;color:#6e8e75}
.highlight .bubble{animation:message-highlight 1.5s ease-out}
@keyframes message-highlight{0%,35%{box-shadow:0 0 0 3px #dfb761;background:#fff2b5}100%{box-shadow:0 1px 1px #102a2015}}
.swiping{overflow:visible}


/* A connected conversation is a single shell, with individually actionable messages. */
.message-cluster{display:flex;justify-content:flex-start;padding:4px 0;position:relative}
.message-cluster.own{justify-content:flex-end}
.cluster-shell{width:max-content;max-width:85%;min-width:82px;background:#fff;border-radius:0 10px 10px 10px;box-shadow:0 1px 2px #102a201c}
.own>.cluster-shell{background:#dcf8c6;border-radius:10px 0 10px 10px}
.cluster-shell .row-content{display:block;padding:0;margin:0}
.cluster-shell .bubble{width:100%;max-width:none;min-width:0;background:transparent;border:0;border-radius:0;box-shadow:none}
.cluster-shell .row:first-child .bubble{border-radius:inherit}
.cluster-shell .row:last-child .bubble{border-bottom-left-radius:10px;border-bottom-right-radius:10px}
.message-part{position:relative;min-width:0}
.message-part>.bubble-footer{right:0;bottom:1px}
.cluster-shell .row:not(:first-child) .bubble-body::after{content:"";position:absolute;left:10px;right:10px;top:0;height:1px;background:#1933230c;pointer-events:none}
.reply-branch .message-part{margin-left:16px}
.reply-branch::before{content:"";position:absolute;left:11px;top:var(--branch-top,0px);bottom:0;width:2px;background:#adc0b180;pointer-events:none;z-index:1}
.reply-branch.branch-end::before{bottom:8px;border-radius:0 0 2px 2px}
.reply-branch .reaction-pill{left:26px}
.reply-branch.own .reaction-pill{left:auto;right:10px}
.message-cluster.has-reactions{margin-bottom:17px}
.cluster-shell .cluster-end:has(.reaction-pill:not([hidden])){overflow:visible}
.cluster-shell .cluster-end>.reaction-pill{bottom:-14px;z-index:2}
.cluster-shell .actions-open .bubble{box-shadow:inset 0 0 0 2px #5c9c7460}
