:root{color-scheme:light;--bg:#f2f5f6;--panel:#fff;--text:#182c36;--muted:#61757e;--line:#dae3e7;--sent:#d7f5e7;--accent:#087d61}*{box-sizing:border-box}body{margin:0;font:16px/1.45 system-ui,sans-serif;color:var(--text);background:var(--bg)}header{height:64px;display:flex;align-items:center;gap:24px;padding:0 24px;background:var(--panel);border-bottom:1px solid var(--line)}header span{margin-left:auto;color:var(--muted);font-size:13px}a{color:var(--accent)}button,input,textarea{font:inherit}button{cursor:pointer;border:1px solid var(--line);border-radius:10px;padding:9px 14px;background:var(--panel);color:var(--text)}button:disabled{opacity:.5;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid var(--accent);outline-offset:2px}main{display:grid;grid-template-columns:320px 1fr;max-width:1400px;height:calc(100dvh - 110px);margin:auto;background:var(--panel);border:1px solid var(--line)}aside{overflow:auto;border-right:1px solid var(--line);padding:18px}.sidebar-heading,.thread-heading{display:flex;align-items:center;gap:12px;justify-content:space-between}h1,h2{font-size:20px}#conversationList button,#contactsList button{display:block;width:100%;margin:8px 0;text-align:left;padding:14px}#conversationList button.selected{border-color:var(--accent);background:var(--sent)}.preview,.hint,small{display:block;color:var(--muted);font-size:13px;overflow-wrap:anywhere}.unread{float:right;background:var(--accent);color:white;border-radius:20px;padding:2px 8px}input,textarea{width:100%;border:1px solid var(--line);border-radius:10px;padding:10px;background:var(--panel);color:var(--text)}#thread{min-width:0;min-height:0}#empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:28px;text-align:center;color:var(--muted)}#active{height:100%;display:flex;flex-direction:column}.thread-heading{padding:15px 20px;border-bottom:1px solid var(--line);justify-content:flex-start}#older{align-self:center;margin:8px}#messages{flex:1;overflow:auto;padding:20px;background:var(--bg);display:flex;flex-direction:column;gap:10px;min-height:0}.bubble{max-width:76%;align-self:flex-start;background:var(--panel);padding:10px 14px;border-radius:14px;border:1px solid var(--line);white-space:pre-wrap;overflow-wrap:anywhere}.bubble.mine{align-self:flex-end;background:var(--sent);border-color:transparent}.bubble small{text-align:right;margin-top:4px}.bubble .seen{color:var(--accent)}#compose{display:flex;align-items:center;padding:14px;gap:10px;border-top:1px solid var(--line)}#compose button{background:var(--accent);color:white}textarea{resize:none;max-height:140px}#notice{margin:8px 24px;color:var(--muted);font-size:14px}#loginNeeded{max-width:420px;margin:60px auto;padding:25px;background:var(--panel);border-radius:16px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}[hidden]{display:none!important}:root[data-theme=dark]{color-scheme:dark;--bg:#10191e;--panel:#19272e;--text:#e8f2f4;--muted:#9dafb6;--line:#31444d;--sent:#154a3c;--accent:#49d7ac}@media(max-width:700px){header{padding:0 14px;gap:16px}main{grid-template-columns:1fr;height:calc(100dvh - 105px)}aside{border:0}#thread{display:none}body.thread-open aside{display:none}body.thread-open #thread{display:block}.bubble{max-width:88%}#messages{padding:12px}#compose{padding:10px}.thread-heading{padding:12px}#notice{margin:6px 12px}}
/* Conversation layout */
:root{--bg:#e8e4dc;--sent:#d9fdd3;--accent:#008069}body{background:linear-gradient(#008069 0 150px,#dce3df 150px)}header{height:56px;max-width:1440px;margin:auto;background:transparent;color:white;border:0}header a,header span{color:white}main{grid-template-columns:350px 1fr;height:calc(100dvh - 80px);box-shadow:0 5px 28px #0002;border:0}aside{padding:0;background:var(--panel)}.sidebar-heading{padding:18px 22px;height:88px}.sidebar-heading h1{font-size:28px;margin:0;letter-spacing:-1px}.sidebar-heading button{background:var(--sent);color:var(--accent);font-size:12px;font-weight:650}#conversationList button,#contactsList button{display:flex;align-items:center;gap:13px;padding:16px 20px;margin:0;border:0;border-radius:0;min-height:80px}#conversationList button.selected{background:var(--bg)}.contact-copy{flex:1;min-width:0}.contact-copy strong{font-weight:600}.preview{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:5px}.avatar{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:46px;height:46px;border-radius:50%;background:#dce9e6;color:#39726a;font-weight:600;letter-spacing:1px}.thread-heading{height:72px;background:var(--bg)}.thread-heading strong{font-weight:600}.thread-heading .avatar{width:42px;height:42px}.thread-heading small{font-size:12px}#messages{background-color:var(--bg);background-image:radial-gradient(circle at 10px 10px,#83958a15 1.5px,transparent 2px),radial-gradient(circle at 30px 30px,#83958a15 1px,transparent 2px);background-size:40px 40px;padding:30px 7%;gap:8px}.bubble{position:relative;border:0;border-radius:0 8px 8px;padding:8px 10px 6px;box-shadow:0 1px 1px #0002;min-width:100px}.bubble:before{content:'';position:absolute;left:-7px;top:0;border-top:9px solid var(--panel);border-left:8px solid transparent}.bubble.mine{border-radius:8px 0 8px 8px}.bubble.mine:before{left:auto;right:-7px;border-left:0;border-right:8px solid transparent;border-top-color:var(--sent)}.bubble small{font-size:10px;margin-top:4px}.bubble .seen{color:#34a9d6}#compose{background:var(--bg);padding:12px 16px;border:0}#draft{border:0;border-radius:24px;padding:14px 18px;min-height:48px}#send{border:0;border-radius:24px;padding:13px 20px}#contactsPanel{padding:14px 18px;border-top:1px solid var(--line)}#contactsPanel h2{margin:4px 0 16px}.import-file{display:block;padding:12px 0;font-size:13px}.import-file input{padding:10px 0;font-size:12px}#contactConsent{width:auto;display:inline;vertical-align:middle}#contactsPanel label{font-size:12px}#contactsPanel .hint{font-size:12px}#clearContacts{font-size:12px;margin:14px 0;color:var(--muted)}#empty{border-bottom:5px solid #25d366;background:var(--bg)}#empty h2{font-size:29px;font-weight:400;color:var(--text)}#empty p{max-width:320px;font-size:14px}#notice{background:var(--panel);max-width:1400px;margin:5px auto;padding:0 10px}#notice:empty{display:none}:root[data-theme=dark]{--bg:#0b141a;--panel:#111b21;--sent:#005c4b;--accent:#00a884}:root[data-theme=dark] body{background:#0a1014}:root[data-theme=dark] .thread-heading,:root[data-theme=dark] #compose{background:#202c33}:root[data-theme=dark] .avatar{background:#31454b;color:#d5e3e0}@media(max-width:700px){body{background:var(--panel)}header{height:38px;font-size:13px;background:#008069;padding:0 14px}header strong{font-size:15px}header span{font-size:10px}main{height:calc(100dvh - 38px);grid-template-columns:1fr}.sidebar-heading{height:82px}.thread-heading{height:64px;padding:10px 12px}#messages{padding:22px 18px}#compose{padding:9px;gap:8px}#draft{padding:13px 14px}#send{padding:13px}#notice{margin:0}#contactsPanel{padding:14px}#contactsList button{padding:12px 0}}
#notice:not(:empty){position:fixed;bottom:12px;left:50%;transform:translateX(-50%);width:calc(100% - 32px);max-width:620px;z-index:10;padding:12px 16px;border-radius:12px;box-shadow:0 2px 14px #0003;border:1px solid var(--line)}

.lookup-row{display:flex;gap:8px;margin:8px 0 12px}.lookup-row input{min-width:0}.lookup-row button{background:var(--accent);color:var(--panel);flex-shrink:0}.found-contact{width:100%;display:flex;justify-content:space-between;gap:10px;align-items:center;background:var(--sent);margin:8px 0}.found-contact span{font-size:12px}.agenda-options{padding:12px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin:14px 0}.agenda-options summary{cursor:pointer;font-size:13px;color:var(--muted)}#findResult{font-size:13px;overflow-wrap:anywhere}

.avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover}

#sidebar>#findContact{padding:0 18px}#sidebar>#findResult{padding:0 18px}

.search-heading{font-size:11px;text-transform:uppercase;letter-spacing:.8px;color:var(--muted);margin:14px 0 8px}.found-contact .contact-copy{border:0;padding:0;margin:0}.found-contact .contact-copy strong{font-size:13px}#findResult .hint{padding:6px 0}

.chat-tools{display:flex;gap:8px;padding:10px 18px}.chat-tools button{flex:1;font-size:12px}.avatar-actions button{width:auto;flex:1}

.profile-photo-row{display:flex;align-items:center;gap:18px}.profile-avatar{width:84px;height:84px;border-radius:50%;object-fit:cover}#avatarForm{padding:16px 0;border-bottom:1px solid var(--line)}#avatarForm small{display:block;margin:8px 0}

#avatarEditor{max-width:390px;padding:14px 0}#avatarPreview{display:block;width:min(100%,300px);height:auto;border-radius:50%;background:#e8ecea;cursor:grab;touch-action:none;border:3px solid #008069;margin:16px auto}#avatarPreview:active{cursor:grabbing}#avatarZoom{padding:0;width:100%;margin:10px 0 20px}.avatar-actions{display:flex;gap:8px;flex-wrap:wrap}

.avatar-open{padding:0;border:0;border-radius:50%;background:transparent;cursor:pointer}.avatar-open .profile-avatar{display:block}#avatarDialog{width:min(92vw,440px);max-height:90dvh;overflow:auto;border:1px solid var(--line);border-radius:20px;background:var(--panel,#fff);color:inherit;padding:22px}#avatarDialog::backdrop{background:#0009}.avatar-dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.avatar-dialog-heading h3{margin:0 0 12px}#avatarLarge{display:block;width:100%;max-height:400px;object-fit:contain;border-radius:12px;margin:12px 0 20px}#avatarDialog #avatarForm{border:0}#avatarDialogEditor:empty{display:none}

.avatar-actions button{width:auto;flex:1}

.chat-own-profile{padding:12px 18px;border-bottom:1px solid var(--line)}.chat-own-profile .profile-avatar{width:44px;height:44px}.chat-own-profile #avatarForm{font-size:12px}.chat-own-profile #avatarForm input{font-size:12px}.chat-own-profile #avatarForm small{display:none}.thread-tools{display:flex;gap:5px;flex-wrap:wrap;padding:8px 12px;border-bottom:1px solid var(--line)}.thread-tools button{font-size:12px;padding:6px 9px}.chat-filter{display:flex;align-items:center;gap:8px;padding:8px 18px}.chat-filter select{flex:1}.message-actions{display:flex;gap:5px;flex-wrap:wrap;margin-top:6px}.message-actions button{font-size:11px;padding:3px 7px}#peerPhoto{border:0;padding:0;border-radius:50%}dialog{width:min(94vw,520px);max-height:90dvh;overflow:auto;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--text);padding:20px}dialog::backdrop{background:#0009}dialog label{display:block;margin:10px 0}dialog label input[type=checkbox]{width:auto}dialog select{width:100%;padding:9px}dialog video{width:100%;max-height:230px;background:#111}#peerFullPhoto{max-width:100%;max-height:55dvh;object-fit:contain}#showJobs{margin:6px 18px}#firstContact{font-size:12px;padding:8px 12px}#avatarDialog img{max-width:100%}@media(max-width:700px){.thread-heading{gap:8px}.thread-heading strong{font-size:14px}.thread-heading #archiveChat{font-size:11px;padding:5px}.thread-tools{gap:4px}.thread-tools button{font-size:11px}}
.hidden{display:none!important}

#avatarUnsaved{position:sticky;bottom:0;background:var(--panel);padding:12px 0;border-top:1px solid var(--line)}#myChat{margin-top:10px}#peerDialogInfo{white-space:pre-line}

#notice:not(:empty){bottom:90px;pointer-events:none}

.notifications-list{display:grid;gap:8px;max-height:60vh;overflow:auto}.notification-item{display:grid;gap:5px;text-align:left;padding:12px}.unread-notification{border-left:4px solid #00a884}.admin-search{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}.chat-attachment{display:grid;gap:8px;margin:10px 0}.chat-attachment img{max-width:260px;max-height:280px;object-fit:contain;cursor:pointer}.chat-photo-dialog img{max-width:90vw;max-height:75vh;object-fit:contain}.chat-photo-dialog a{display:block}header{flex-wrap:wrap}#notificationsPanelButton{font-size:13px;padding:8px}

.notification-toast{position:fixed;bottom:90px;right:16px;background:#075e54;color:white;padding:14px 20px;border-radius:12px;z-index:30;pointer-events:none}dialog{max-width:min(90vw,700px)}

.notification-panel,.account-review-dialog{width:min(92vw,560px);padding:24px;border:1px solid var(--line);border-radius:18px;background:var(--panel);color:var(--text);box-shadow:0 16px 60px #0004}.notification-panel::backdrop,.account-review-dialog::backdrop{background:#10203070}.notification-panel>button,.account-review-dialog>button,#notificationsPanelButton,.admin-account>button,.admin-search>button{font:inherit;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--text);padding:10px 14px;cursor:pointer}.notification-panel>button{margin:12px 8px 16px 0}.notification-item{font:inherit;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--text);cursor:pointer}.notification-item span,.notification-item small{color:var(--muted)}.notification-item strong{font-size:15px}.unread-notification{border-left:4px solid #00a884}.account-review-dialog button{margin:8px}.account-review-dialog input[type=checkbox]{width:auto;display:inline;margin-right:8px}.admin-search input,.admin-search select{width:100%;font:inherit;padding:10px;border-radius:8px;border:1px solid var(--line);background:var(--panel);color:var(--text)}
@media(max-width:700px){header{height:auto;min-height:64px;gap:8px;padding:7px 14px}main{height:calc(100dvh - 64px)}#notificationsPanelButton{font-size:11px;padding:5px 8px}}

.notification-badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.4rem;height:1.4rem;padding:0 .35rem;margin-left:.4rem;background:#dc2626;color:#fff;border-radius:999px;font-weight:700}.has-unread{border-color:#dc2626!important}.unread-notification{border-left:3px solid #dc2626!important}.chat-actions{padding:.5rem 1rem;position:relative}.chat-actions summary{cursor:pointer;font-weight:600}.chat-actions .thread-tools{display:flex;flex-wrap:wrap;gap:.5rem;padding:.6rem 0}#paymentTasksList article{padding:1rem 0;border-bottom:1px solid #8885}#paymentTasksList button{margin:.5rem .5rem 0 0}

/* Keep conversations and search prominent; secondary controls stay grouped. */
.chat-list-options{margin:4px 14px 12px;border:1px solid var(--line);border-radius:12px}.chat-list-options>summary{padding:11px 14px;cursor:pointer;font-size:14px;font-weight:600}.chat-list-options-body{padding:0 12px 12px}.chat-list-options .chat-own-profile{padding:10px 0}.chat-list-options .chat-tools{padding:10px 0;display:grid;grid-template-columns:1fr;gap:8px}.chat-list-options .chat-filter{padding:8px 0}.chat-list-options #showJobs,.chat-list-options #myChat{width:100%;font-size:13px}.chat-list-options .profile-photo-row{margin:0}.chat-list-options-body button{font-size:13px}#chatListState{padding:0 20px;margin:6px 0}#findContact{padding:0 14px 10px}#findContact>label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.lookup-row{gap:8px}#findButton{padding:10px 12px;font-size:13px}.sidebar-heading{height:72px;padding:14px 18px}#contactQuery{min-width:0;font-size:14px}

/* Compact notices; complete content is shown on opening the detail. */
.notification-item{grid-template-columns:1fr auto;gap:4px 12px;padding:12px 14px;min-width:0;background:var(--notice-bg,var(--bg));border-color:var(--notice-line,var(--line))}.notification-item .notification-type{grid-column:2;grid-row:1;font-size:10px;font-weight:700;border-radius:99px;padding:3px 8px;background:var(--notice-line,var(--line));color:var(--text)}.notification-item strong{grid-column:1;grid-row:1;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.notification-preview{grid-column:1/-1;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;font-size:13px}.notification-item small{grid-column:1/-1;font-size:11px}.notification-panel[data-kind]{background:var(--panel);border-top:5px solid var(--notice-line,var(--line))}.notification-panel .notification-type{display:inline-block;border-radius:99px;background:var(--notice-bg,var(--bg));color:var(--text);padding:5px 10px;font-size:12px}.notification-panel dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 16px;font-size:13px;margin:20px 0}.notification-panel dt{color:var(--muted)}.notification-panel dd{margin:0;overflow-wrap:anywhere}.notification-panel p{overflow-wrap:anywhere;white-space:pre-wrap}.notification-item[data-kind=message],.notification-item[data-kind=file],.notification-panel[data-kind=message],.notification-panel[data-kind=file]{--notice-bg:#edf4fd;--notice-line:#ccdff5}.notification-item[data-kind=income],.notification-item[data-kind=payment],.notification-panel[data-kind=income],.notification-panel[data-kind=payment]{--notice-bg:#edf8f1;--notice-line:#cde8d6}.notification-item[data-kind=request],.notification-panel[data-kind=request]{--notice-bg:#fff7e9;--notice-line:#f1dfb7}.notification-item[data-kind=debt],.notification-panel[data-kind=debt]{--notice-bg:#f5effb;--notice-line:#e1d2f2}.notification-item[data-kind=expense],.notification-panel[data-kind=expense]{--notice-bg:#fff0ed;--notice-line:#f3d5cd}:root[data-theme=dark] [data-kind=message],:root[data-theme=dark] [data-kind=file]{--notice-bg:#1b2b3d;--notice-line:#304b68}:root[data-theme=dark] [data-kind=income],:root[data-theme=dark] [data-kind=payment]{--notice-bg:#19342b;--notice-line:#315443}:root[data-theme=dark] [data-kind=request]{--notice-bg:#362e20;--notice-line:#665434}:root[data-theme=dark] [data-kind=debt]{--notice-bg:#2e243b;--notice-line:#514064}:root[data-theme=dark] [data-kind=expense]{--notice-bg:#382623;--notice-line:#67463e}

@media(prefers-color-scheme:dark){:root:not([data-theme="light"]) [data-kind=message],:root:not([data-theme="light"]) [data-kind=file]{--notice-bg:#1b2b3d;--notice-line:#304b68}:root:not([data-theme="light"]) [data-kind=income],:root:not([data-theme="light"]) [data-kind=payment]{--notice-bg:#19342b;--notice-line:#315443}:root:not([data-theme="light"]) [data-kind=request]{--notice-bg:#362e20;--notice-line:#665434}:root:not([data-theme="light"]) [data-kind=debt]{--notice-bg:#2e243b;--notice-line:#514064}:root:not([data-theme="light"]) [data-kind=expense]{--notice-bg:#382623;--notice-line:#67463e}}

/* Muted category colors, for manual and automatic appearance. */
.notification-item[data-kind=message],.notification-panel[data-kind=message]{--notice-bg:#f0f2f4;--notice-line:#dce0e4}
:root[data-theme=dark] [data-kind=message]{--notice-bg:#242a30;--notice-line:#3c434a}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) [data-kind=message]{--notice-bg:#242a30;--notice-line:#3c434a}}
.notification-item[data-kind=file],.notification-panel[data-kind=file]{--notice-bg:#f0f2f4;--notice-line:#dce0e4}
:root[data-theme=dark] [data-kind=file]{--notice-bg:#242a30;--notice-line:#3c434a}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) [data-kind=file]{--notice-bg:#242a30;--notice-line:#3c434a}}
.notification-item[data-kind=income],.notification-panel[data-kind=income]{--notice-bg:#f0f3f1;--notice-line:#dbe2dd}
:root[data-theme=dark] [data-kind=income]{--notice-bg:#252d29;--notice-line:#404a44}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) [data-kind=income]{--notice-bg:#252d29;--notice-line:#404a44}}
.notification-item[data-kind=payment],.notification-panel[data-kind=payment]{--notice-bg:#f0f3f1;--notice-line:#dbe2dd}
:root[data-theme=dark] [data-kind=payment]{--notice-bg:#252d29;--notice-line:#404a44}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) [data-kind=payment]{--notice-bg:#252d29;--notice-line:#404a44}}
.notification-item[data-kind=request],.notification-panel[data-kind=request]{--notice-bg:#f4f2ee;--notice-line:#e3dfd5}
:root[data-theme=dark] [data-kind=request]{--notice-bg:#2e2b25;--notice-line:#4b473c}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) [data-kind=request]{--notice-bg:#2e2b25;--notice-line:#4b473c}}
.notification-item[data-kind=debt],.notification-panel[data-kind=debt]{--notice-bg:#f2f0f4;--notice-line:#e0dce4}
:root[data-theme=dark] [data-kind=debt]{--notice-bg:#2b2830;--notice-line:#47424d}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) [data-kind=debt]{--notice-bg:#2b2830;--notice-line:#47424d}}
.notification-item[data-kind=expense],.notification-panel[data-kind=expense]{--notice-bg:#f4f0ef;--notice-line:#e5ddda}
:root[data-theme=dark] [data-kind=expense]{--notice-bg:#2e2927;--notice-line:#4c4340}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) [data-kind=expense]{--notice-bg:#2e2927;--notice-line:#4c4340}}

/* Single-line account notices: neutral surface, restrained category marker. */
.notifications-list{gap:5px}
.notification-panel .notification-item{display:flex;align-items:center;flex-wrap:nowrap;gap:10px;padding:11px 12px;min-height:44px;border-radius:8px;background:var(--panel);border-color:var(--line);box-shadow:none;overflow:hidden}
.notification-panel .notification-item .notification-type{flex:0 0 6px;width:6px;height:6px;padding:0;border-radius:50%;font-size:0;background:var(--notice-dot,#83909a)}
.notification-panel .notification-item strong{flex:1 1 0;min-width:0;font-size:13px;font-weight:500;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.notification-panel .notification-item .notification-preview{display:block;flex:0 1 48%;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px;font-size:12px;color:var(--muted)}
.notification-panel .notification-item[data-kind=income],.notification-panel .notification-item[data-kind=payment]{--notice-dot:#7f998b}
.notification-panel .notification-item[data-kind=expense]{--notice-dot:#aa8882}
.notification-panel .notification-item[data-kind=request]{--notice-dot:#a69b80}
.notification-panel .notification-item[data-kind=debt]{--notice-dot:#95899e}
.notification-panel .notification-item[data-kind=message],.notification-panel .notification-item[data-kind=file]{--notice-dot:#8295a3}
.notification-panel .notification-item:hover{border-color:var(--muted)}
.notification-panel .notification-item:focus-visible{outline:2px solid var(--muted);outline-offset:2px}
.notification-panel[data-kind]{border-top:1px solid var(--line)}
.notification-panel[data-kind] .notification-type{background:var(--bg);border:1px solid var(--line);color:var(--muted)}

/* Quiet back controls; more legible category dots without colored surfaces. */
.quiet-back,.notification-panel>button.quiet-back{display:inline-flex;align-items:center;justify-content:center;width:34px;min-width:34px;height:34px;padding:0;margin:4px 0 12px;font:inherit;font-size:23px;line-height:1;border:1px solid transparent;border-radius:50%;background:transparent;color:var(--muted);cursor:pointer}
.quiet-back:hover,.notification-panel>button.quiet-back:hover{background:var(--bg);border-color:var(--line);color:var(--text)}
.quiet-back:focus-visible{outline:2px solid var(--muted);outline-offset:2px}
.notification-panel .notification-item .notification-type{flex-basis:9px;width:9px;height:9px;box-shadow:0 0 0 2px var(--bg)}
.notification-panel .notification-item[data-kind=income],.notification-panel .notification-item[data-kind=payment]{--notice-dot:#68a78b}
.notification-panel .notification-item[data-kind=expense]{--notice-dot:#c17f75}
.notification-panel .notification-item[data-kind=request]{--notice-dot:#bea362}
.notification-panel .notification-item[data-kind=debt]{--notice-dot:#ad8ac3}
.notification-panel .notification-item[data-kind=message],.notification-panel .notification-item[data-kind=file]{--notice-dot:#779fc5}

.quiet-symbol,.notification-panel>button.quiet-symbol{display:inline-flex;align-items:center;justify-content:center;width:34px;min-width:34px;height:34px;padding:0;font:inherit;font-size:22px;line-height:1;border:1px solid transparent;border-radius:50%;background:transparent;color:var(--muted);text-decoration:none;cursor:pointer;vertical-align:middle}
.quiet-symbol:hover,.notification-panel>button.quiet-symbol:hover{border-color:var(--line);background:var(--bg);color:var(--text)}.quiet-symbol:focus-visible{outline:2px solid var(--muted);outline-offset:2px}
.notification-panel{max-height:88dvh;overflow-y:auto;overscroll-behavior:contain}.notification-panel dl{align-items:start}.notification-panel dt,.notification-panel dd{padding:0;line-height:1.5}
.notification-panel dt,.notification-panel dd{margin:0;align-self:start}.notification-panel dl{border-top:0}
.chat-attachment img{display:block;width:auto;height:auto;max-width:min(260px,100%);max-height:280px;object-fit:contain}
.chat-attachment img[hidden],.chat-image-state[hidden],.chat-attachment button[hidden]{display:none}
.chat-image-state{font-size:12px;color:var(--muted);margin:4px 0;line-height:1.5}
.chat-photo-dialog{background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:12px;max-width:calc(100% - 24px);max-height:90dvh;overflow:auto}
.chat-photo-dialog img{display:block;width:auto;height:auto;max-width:100%;max-height:70dvh;margin:auto;object-fit:contain}
.chat-photo-dialog img[hidden],.chat-photo-dialog button[hidden]{display:none}
:root[data-embedded=true]{--bg:#f4f6fa;--panel:#fff;--text:#182638;--muted:#66758a;--line:#e2e8f0;--accent:#12765e;--sent:#e5efe9}
:root[data-embedded=true][data-theme=dark]{--bg:#101820;--panel:#18232f;--text:#edf3fa;--muted:#a1afbf;--line:#304051;--accent:#79d4b4;--sent:#243b35}
:root[data-embedded=true],:root[data-embedded=true] body{height:100%;background:var(--panel)}
:root[data-embedded=true] body>header{display:none}
:root[data-embedded=true] main{height:100%;max-width:none;margin:0;border:0;box-shadow:none}
:root[data-embedded=true] #sidebar,:root[data-embedded=true] #empty,:root[data-embedded=true] .thread-heading,:root[data-embedded=true] #compose{background:var(--panel)}
:root[data-embedded=true] #empty{border-bottom:0}
:root[data-embedded=true] #messages{background:var(--bg);background-image:none}
:root[data-embedded=true] .sidebar-heading{height:64px;padding:14px 18px}
:root[data-embedded=true] .sidebar-heading h1{font-size:20px;letter-spacing:-.5px}
:root[data-embedded=true] button{border-radius:8px;font-size:13px}
:root[data-embedded=true] .bubble{border:1px solid var(--line);box-shadow:none}
:root[data-embedded=true] .bubble.mine{background:var(--sent)}
:root[data-embedded=true] #newChat,:root[data-embedded=true] #send,:root[data-embedded=true] #findButton{background:var(--panel);color:var(--accent);border:1px solid var(--line)}
@media(max-width:700px){:root[data-embedded=true] input,:root[data-embedded=true] textarea{font-size:16px}:root[data-embedded=true] .thread-heading{height:60px}:root[data-embedded=true] #messages{padding:16px 12px}}
/* A compact conversation list, with secondary tools in the heading menu. */
#sidebar{position:relative;border-right:1px solid var(--line)}
.chat-title h1{margin:0;font-size:22px;letter-spacing:-.5px}.chat-title>span{display:block;font-size:12px;color:var(--muted);margin-top:2px}
#sidebar .sidebar-heading{height:auto;min-height:78px;padding:16px 20px;align-items:center}
#chatListOptions{margin:0;border:0;position:static}
#chatListOptions>summary{list-style:none;padding:0;width:38px;height:38px;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:50%;font-size:26px;line-height:1;color:var(--text);background:var(--panel)}
#chatListOptions>summary::-webkit-details-marker{display:none}
#chatListOptions[open]>summary{background:var(--bg)}
#chatListOptions>.chat-list-options-body{position:absolute;top:68px;right:12px;left:12px;z-index:12;padding:14px 16px;max-height:65dvh;overflow-y:auto;border:1px solid var(--line);border-radius:14px;background:var(--panel);box-shadow:0 8px 28px #0002}
#savedContacts{border-top:1px solid var(--line);margin-top:12px;padding-top:12px}#savedContacts>summary{font-size:13px;cursor:pointer}#contactsPanel{padding:10px 0;border:0}
#sidebar #findContact{padding:0 16px}#sidebar .lookup-row{margin:0;position:relative;gap:0}
#sidebar #contactQuery{padding:12px 48px 12px 14px;border-radius:12px;background:var(--bg);border-color:transparent}
#sidebar #findButton{position:absolute;right:4px;top:4px;bottom:4px;width:38px;padding:0;border:0;background:transparent;color:var(--muted);font-size:26px;border-radius:9px}
.conversation-filters{display:flex;gap:7px;align-items:center;padding:13px 16px 15px;border-bottom:1px solid var(--line);overflow-x:auto}
.conversation-filters button{flex-shrink:0;padding:6px 12px;border:1px solid var(--line);border-radius:20px;color:var(--muted);background:transparent;font-size:12px}
.conversation-filters button[aria-pressed=true]{background:var(--sent);border-color:var(--sent);color:var(--text);font-weight:600}
#conversationList button{padding:16px;gap:12px;min-height:78px;border-bottom:1px solid var(--line)}
#conversationList button:hover,#findResult .found-contact:hover{background:var(--bg)}
#conversationList .contact-copy strong{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:14px}
.conversation-meta{display:flex;flex-direction:column;align-items:flex-end;align-self:stretch;justify-content:center;gap:7px;min-width:45px}.conversation-meta time{font-size:10px;color:var(--muted);white-space:nowrap}.conversation-meta .unread{float:none;font-size:11px;padding:1px 6px}
#findResult .found-contact{background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0;padding:12px 0;margin:0;text-align:left}
#empty h2{font-size:24px;font-weight:600}#empty p{line-height:1.65}

#chatStartup{padding:18px;text-align:center;color:var(--muted);font-size:14px}#chatStartup[hidden]{display:none}#chatStartup button{margin:8px auto;padding:9px 16px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text)}
