:root{--green:var(--brand-color,#137c66);--ink:#183c32;--muted:#61736b;--line:#dce7e0;--paper:#f4f7f3;font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:var(--ink);background:var(--paper)}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button,.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:10px;padding:11px 16px;background:var(--green);color:white;font-weight:650;cursor:pointer;text-decoration:none;min-height:44px}button:disabled{opacity:.5;cursor:wait}.quiet{background:transparent;border-color:var(--line);color:var(--ink)}.text-button{background:none;color:var(--green);padding:10px 0;text-align:left;justify-content:start}a{color:var(--green)}button:hover,.button:hover{filter:brightness(.95)}:focus-visible{outline:3px solid #e8ae43;outline-offset:3px}input,textarea,select{width:100%;border:1px solid #bdcec3;border-radius:9px;background:white;color:var(--ink);padding:12px;min-width:0}input[type=checkbox]{width:19px;height:19px;accent-color:var(--green)}textarea{resize:vertical}label{display:block;font-size:14px;font-weight:650;margin:17px 0 6px}.top{display:flex;align-items:center;gap:16px;padding:18px 4vw;background:#fff;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:23px;text-decoration:none;color:var(--ink)}.brand img{width:37px;height:37px}.edition{font-size:12px;color:var(--muted)}.top-actions{margin-left:auto;display:flex;gap:10px;align-items:center;flex-wrap:wrap}#identity{font-weight:700}.dev-note{background:#e8f0e9;padding:8px 4vw;font-size:12px;color:#52685a}.auth{max-width:1160px;display:grid;grid-template-columns:1.2fr 1fr;gap:8vw;margin:65px auto;padding:0 24px;align-items:center}.welcome h1{font-size:clamp(36px,5vw,62px);line-height:1.1;letter-spacing:-2px;margin:22px 0}.welcome p{max-width:500px;line-height:1.8}.eyebrow{font-size:11px;letter-spacing:1.7px;font-weight:750;color:var(--green)}.intro-pills{display:flex;gap:8px;flex-wrap:wrap;margin:25px 0}.intro-pills span{background:#e1ebe1;padding:8px 13px;border-radius:30px;font-size:13px}.card{background:white;border:1px solid var(--line);border-radius:18px;padding:26px;box-shadow:0 6px 26px #233c2b04}.auth .card{padding:30px}.switch{display:flex;border-bottom:1px solid var(--line);gap:8px}.switch button{background:none;color:var(--muted);border-radius:0}.switch button.selected{color:var(--green);border-bottom:3px solid var(--green)}h2{font-size:21px;letter-spacing:-.5px}h1{font-size:30px;letter-spacing:-.8px}.wide{width:100%;margin-top:24px}.password{display:flex;border:1px solid #bdcec3;border-radius:9px;background:white}.password input{border:0;background:transparent}.eye{background:none;color:var(--ink);min-width:48px;padding:10px}.eye svg{width:22px;height:22px}.muted{color:var(--muted);font-size:13px;line-height:1.6}.small{font-size:11px}.auth .text-button{display:block}.notice{margin:16px auto;padding:14px 20px;max-width:1180px;border-radius:10px;background:#e1efe5;white-space:pre-wrap}.notice.error{background:#ffede7;color:#8e3426}.workspace{max-width:1320px;margin:20px auto 50px;padding:0 24px}.tabs{display:flex;gap:8px;margin-bottom:24px;flex-wrap:wrap}.tabs button{background:transparent;color:var(--muted)}.tabs .selected{color:var(--green);background:#dfece2}.inline{display:flex;gap:10px;align-items:center}.inline>input{flex:1}.section-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:24px}.section-head h1{margin:8px 0}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:22px}.chat-layout{display:grid;grid-template-columns:340px 1fr;gap:20px}.conversation{display:flex;flex-direction:column;min-height:570px}.messages{height:380px;overflow:auto;padding:14px 4px;display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth}.bubble{max-width:82%;padding:11px 16px;border-radius:14px;background:#f0f3ee;align-self:flex-start;white-space:pre-wrap;overflow-wrap:anywhere}.bubble.mine{background:#dfefe4;align-self:flex-end}.bubble small{display:block;font-size:10px;color:var(--muted);margin-top:5px}.composer{display:flex;gap:10px;margin-top:auto;align-items:end}.composer button{min-height:50px}.row{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:15px 0;border-bottom:1px solid var(--line)}.row>div{min-width:0;overflow-wrap:anywhere}.row strong{display:block}.row small{color:var(--muted)}.row .actions{display:flex;gap:8px;flex-wrap:wrap}.threads{margin-top:20px}.thread{display:block;background:none;color:var(--ink);width:100%;text-align:left;border-radius:10px;justify-content:start;margin:5px 0}.thread.selected{background:#e5efe6}.activity-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:18px;margin-top:20px}.activity-card{display:flex;flex-direction:column;align-items:start;gap:5px}.activity-card h2{margin:8px 0}.activity-card p{margin:5px 0;white-space:pre-wrap;overflow-wrap:anywhere}.activity-card button{margin-top:auto}.badge{font-size:12px;background:#e7efe9;color:var(--green);border-radius:20px;padding:4px 10px}.check{display:flex;align-items:center;gap:10px;font-weight:500;margin:10px 0}.choices{max-height:220px;overflow:auto;background:#f6f8f4;border-radius:10px;padding:10px 14px}.actions{display:flex;gap:10px;margin-top:16px;flex-wrap:wrap}.danger{color:#a13d2d;background:#fff0eb}.empty{padding:24px 0;color:var(--muted);font-size:14px}dialog{width:calc(100% - 32px);max-width:660px;max-height:90vh;overflow:auto;border:1px solid var(--line);border-radius:18px;padding:26px;color:var(--ink)}dialog::backdrop{background:#152e2690}.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px}.dialog-head h2{margin:0}.dialog-head button{min-width:44px}.detail-copy{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}.date-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.dialog-error{color:#9a3020;background:#ffede7;padding:12px;border-radius:8px}footer{display:flex;justify-content:space-between;max-width:1320px;margin:35px auto;padding:0 24px;font-size:12px;color:var(--muted)}[hidden]{display:none!important}@media(max-width:850px){.auth{gap:30px;margin:30px auto;grid-template-columns:1fr}.welcome h1{font-size:42px}.welcome p{max-width:100%}.welcome .muted{margin-bottom:0}.chat-layout,.two-col{grid-template-columns:1fr}.chat-layout>aside{padding:18px}.threads{display:flex;overflow:auto;gap:8px}.thread{width:auto;white-space:nowrap}.top{padding:12px 18px;flex-wrap:wrap}.top-actions{gap:6px}.edition{display:none}.top-actions .button{font-size:12px;padding:8px}.top-actions button{font-size:12px}.workspace{padding:0 14px}.section-head{align-items:start}.section-head h1{font-size:24px}.section-head button{font-size:13px}.messages{height:330px}.conversation{min-height:480px}.date-grid{grid-template-columns:1fr}.bubble{max-width:90%}}

.eye-slash{display:none}.eye[aria-pressed=true] .eye-slash{display:block}

.eye{min-width:54px;min-height:54px}.eye svg{width:30px;height:30px}.avatar{flex:0 0 42px;display:inline-flex;width:42px;height:42px;align-items:center;justify-content:center;border-radius:50%;overflow:hidden;background:var(--tint,#dfeee5);color:var(--green);font-weight:700}.avatar img{width:100%;height:100%;object-fit:cover}.contact-identity{display:flex;gap:12px;align-items:center}#peer-title{display:flex;gap:12px;align-items:center}.bubble.mine{background:var(--bubble,#dfefe4)}.tabs .selected{background:var(--tint,#dfeee5)}#language{width:auto;max-width:105px;padding:8px}.top-actions{gap:7px}dialog .avatar{width:76px;height:76px;font-size:28px}.messages{background:var(--chat,transparent);border-radius:10px;padding:12px}

body{background:var(--paper);min-height:100vh}

/* Every themed surface derives from the same selected profile. */
:root{--ink:#25333d;--muted:#66727b;--line:#d9dfe4}
.dev-note,.intro-pills span,.notice,.badge,.choices,.thread.selected,.tabs .selected{background:var(--tint,#DFEEE5)}
.switch button.selected{color:var(--green);border-bottom-color:var(--green)}
.bubble:not(.mine){background:#fff}.bubble.mine{background:var(--bubble)}
.receipt-read{color:#1672b8!important}.profile-large{display:block;max-width:100%;max-height:65vh;object-fit:contain;margin:16px auto;border-radius:12px}
.message-photo{display:block;max-width:100%;max-height:300px;object-fit:contain;border-radius:8px;cursor:zoom-in}
.avatar[role=button]{cursor:pointer}.composer-tools{display:flex;gap:2px;align-items:center}.composer-icon{background:transparent;color:var(--green);padding:6px;min-width:40px;min-height:48px;font-size:23px}.bubble audio{max-width:100%;width:260px}.composer textarea{flex:1}
@media(max-width:600px){.composer{flex-wrap:wrap;gap:5px}.composer textarea{flex-basis:100%}.composer-tools{margin-left:auto}.composer #send{min-width:60px}}

.composer-icon svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.composer{padding:6px;border:1px solid var(--line);border-radius:16px;background:#fff}.composer textarea{border:0}.bubble small{white-space:normal}

/* Compact recorder and voice cards use measured amplitude envelopes. */
.composer{flex-wrap:nowrap;align-items:end;border:0;background:transparent;padding:0;gap:8px}.composer-pill{display:flex;flex:1;align-items:center;background:#fff;border-radius:28px;border:1px solid var(--line);padding:2px 7px}.composer textarea{flex:1;flex-basis:auto;resize:none;border:0;background:transparent;min-height:48px;max-height:120px;padding:13px 8px}.composer-tools{margin-left:0;gap:0}.composer-icon{min-width:37px;padding:6px;color:var(--muted)}.composer-icon svg,.voice-send svg,.record-discard svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.voice-send{flex:0 0 52px;width:52px;height:52px;min-width:52px;border-radius:50%;padding:13px}.composer #send{min-width:52px}.conversation{position:relative}.chat-menu{position:absolute;right:20px;top:18px;background:none;color:var(--ink);font-size:30px;padding:4px 12px}.conversation h2{padding-right:45px}.bubble audio{display:none}.audio-row{display:flex;align-items:center;gap:8px;min-width:275px;max-width:100%}.audio-play{background:transparent;color:var(--muted);font-size:25px;padding:5px;min-width:35px}.audio-track{flex:1;min-width:0}.wave-track{position:relative;height:36px;display:flex;align-items:center}.waveform{width:100%;height:38px;overflow:visible}.waveform line{stroke:#c8cdd1;stroke-width:2.7;stroke-linecap:round}.waveform line.played{stroke:#1689d5}.wave-track input{position:absolute;inset:0;opacity:0;cursor:pointer;min-height:0;padding:0}.audio-track small{margin:0!important}.audio-row .avatar{width:38px;height:38px;flex-basis:38px}.transcribe-link{background:none;color:var(--green);padding:3px 0;min-height:30px;font-size:14px;font-weight:500}.transcript-copy{white-space:pre-wrap;margin:6px 0}.record-panel{padding:14px 8px 4px;background:#fff;border-radius:16px}.record-visual{display:flex;gap:20px;align-items:center;margin-bottom:12px}.record-visual strong{font-size:20px;min-width:52px}.record-wave{flex:1}.record-actions{display:flex;gap:12px;align-items:center}.record-discard{border-radius:50%;background:#ffe9ef;color:#c33751;width:50px;height:50px;padding:12px;font-size:23px}.record-pause{flex:1;border-radius:28px;background:#f3f4f4;color:var(--ink)}.record-send{border-radius:50%;width:52px;height:52px;font-size:25px;padding:8px}.bubble{white-space:normal}.bubble:not(:has(.audio-row)){white-space:pre-wrap}@media(max-width:600px){.composer textarea{flex-basis:auto}.composer-tools{margin-left:0}.audio-row{min-width:245px}.bubble{max-width:100%}.conversation{padding:16px}.composer-icon{min-width:33px}.composer-tools svg{width:22px}.chat-menu{right:10px;top:10px}}

.record-send svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.message-video{display:block;max-width:100%;max-height:320px}.file-download{display:block;padding:12px;border-radius:12px;background:var(--tint);color:var(--green)}.rich-card{display:grid;gap:8px;min-width:220px}.rich-card p{margin:2px 0}.rich-card small{display:block}.poll-option{display:flex;gap:12px;align-items:center;justify-content:space-between}.poll-option button{padding:5px 9px;font-size:12px}.poll-option span{white-space:pre-wrap;overflow-wrap:anywhere}

/* Native-looking media cards: image surface with controls/time over the image. */
.bubble.media-photo,.bubble.media-video{padding:0;border:0;background:transparent!important;position:relative;width:260px;max-width:100%;border-radius:10px;overflow:hidden}
.bubble.media-photo .message-photo{display:block;width:100%;height:auto;max-height:340px;margin:0;border-radius:10px;object-fit:cover}
.bubble.media-photo .message-meta,.bubble.media-video .message-meta{position:absolute;bottom:6px;right:6px;background:#0008;border-radius:9px;color:#fff;padding:3px 7px;margin:0;font-size:11px;z-index:2}
.video-preview{position:relative;background:#17231c;min-height:150px;border-radius:10px;overflow:hidden}.video-preview .message-video{width:100%;height:180px;object-fit:cover;display:block;max-height:none}.video-play-overlay{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:54px;height:54px;min-width:54px;padding:0 0 0 4px;line-height:54px;border-radius:50%;background:#0008;color:#fff;font-size:28px;border:0}.video-play-overlay[hidden]{display:none}.video-preview:has(video[controls]) .message-video{height:auto;min-height:180px;object-fit:contain}
.bubble.media-location,.bubble.media-live_location{position:relative;padding:3px 3px 25px;border-radius:10px;width:266px;max-width:100%}.media-location .rich-card,.media-live_location .rich-card{display:block;min-width:0}.map-preview{position:relative;display:block;width:260px;height:165px;max-width:100%;overflow:hidden;border-radius:8px;background:#e4ede6;cursor:pointer}.map-preview .map-tile{position:absolute;width:256px!important;height:256px!important;max-width:none;max-height:none;object-fit:fill;border-radius:0;margin:0}.map-preview .map-marker{position:absolute;width:52px;height:52px;left:50%;top:50%;transform:translate(-50%,-50%);border:3px solid white;box-shadow:0 2px 5px #0003;z-index:1;border-radius:50%;margin:0}.map-attribution{position:absolute;bottom:0;left:0;font-size:10px;color:#244038;background:#fffd;padding:1px 4px;z-index:2}.location-state{padding:8px 7px 1px;font-size:14px}.location-updated{padding:4px 7px}.media-location .message-meta,.media-live_location .message-meta{position:absolute;bottom:6px;right:8px;margin:0;font-size:11px}.media-location .location-state,.media-live_location .location-state{padding-right:78px}

/* Media cards keep their content height inside the scrolling flex column. */
.messages>.bubble{flex:0 0 auto}

.bubble.media-location,.bubble.media-live_location{padding-bottom:3px}.location-state{min-height:29px;padding-top:6px}.bubble.media-live_location:has(.rich-card>button){padding-bottom:22px}
