/* The message overview follows the original tabs and search layout. */
.messages-view{background:var(--page)}.messages-view:before,.messages-view .cabinet-bar{display:none}
.messages-view .cabinet-content{max-width:720px;padding:0;overflow:visible;border:0;border-radius:0;background:none;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
.msg-app{position:relative;--msg-bg:#091321;--msg-surface:#102232;--msg-soft:#182e40;--msg-border:#b6d6f024;--msg-text:#eaf4ff;--msg-muted:#91a9be;--msg-accent:#91ceff;--msg-sent:#16486a;min-width:0;min-height:calc(100svh - 160px);color:var(--msg-text);background:transparent;isolation:isolate}
.msg-app button,.msg-app input,.msg-app textarea{font:inherit;color:inherit}.msg-app button:disabled{opacity:.5;cursor:wait}.msg-app button:focus-visible,.msg-app textarea:focus-visible,.msg-app input:focus-visible{outline:2px solid var(--msg-accent);outline-offset:3px}.msg-app svg{display:block;width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.msg-sidebar{min-width:0;min-height:0}.msg-search-row{display:flex;align-items:center;gap:10px}.msg-search-row .msg-search{flex:1;min-width:0}.msg-notifications{display:grid;place-items:center;width:40px;height:40px;flex:0 0 40px;padding:8px;border:1px solid var(--msg-border);border-radius:50%;background:transparent;color:var(--msg-muted);position:relative}.msg-notifications svg{height:22px;width:22px}.msg-notifications:hover{border-color:var(--msg-accent);color:var(--msg-text)}
.msg-menu-trigger{position:absolute;left:10px;top:10px;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;background:var(--msg-surface);color:var(--msg-text);z-index:5}.msg-menu-trigger:focus-visible{width:auto;height:auto;padding:12px 15px;margin:0;clip-path:none;border:1px solid var(--msg-accent);border-radius:14px}
.msg-tabs{display:flex;gap:4px;align-items:stretch;padding:3px;border-radius:999px;background:#9dc8ed08;margin:0 0 22px;min-width:0}.msg-tabs button{display:flex;align-items:center;justify-content:center;gap:6px;flex:1;min-width:0;min-height:44px;padding:10px 8px;border:1px solid transparent;border-radius:999px;background:transparent;color:var(--msg-muted);font-size:16px;font-weight:600;line-height:1.3}.msg-tabs button[aria-selected=true]{background:linear-gradient(130deg,#28577b4d,#163b5d40);border-color:#82bfed80;box-shadow:inset 0 1px 6px #b7e4ff36,0 0 13px #2584bd21;color:var(--msg-text)}
.msg-total,.msg-unread{display:inline-flex;align-items:center;justify-content:center;background:#8dcaff;color:#052239;border-radius:20px;font-size:10px;font-weight:700;min-width:20px;height:20px;padding:0 6px;flex:none}
.msg-app .msg-search{display:flex;align-items:center;gap:12px;margin:0;border:1px solid #9dbbd03d;border-radius:30px;background:#a4cae407;padding:0 17px;color:var(--msg-muted);box-shadow:inset 0 1px 2px #0000000a}.msg-search svg{width:20px;height:20px}.msg-app .msg-search input{height:45px;width:100%;padding:0;background:none;border:0;box-shadow:none;color:var(--msg-text);font-size:14px;min-width:0}.msg-app .msg-search input::placeholder{color:var(--msg-muted);font-size:14px;opacity:1}.msg-search:focus-within{outline:2px solid var(--msg-accent);outline-offset:2px}.msg-app .msg-search input:focus{outline:none;box-shadow:none}
.msg-list{min-height:0;padding:17px 0 25px}.msg-tab-empty{margin:55px 0 0;padding:0 12px;text-align:center;font-size:13px;line-height:1.6;color:var(--msg-muted);font-weight:400}.msg-note{font-size:12px;color:var(--msg-muted);padding:32px 13px;line-height:1.7;text-align:center;margin:0}.msg-list-label{font-size:10px;color:var(--msg-muted);padding:7px 12px;margin:0;text-transform:uppercase;letter-spacing:1px}.msg-list-error{margin:15px 0 0;border:1px solid #edaaaa33;border-radius:12px;padding:12px;color:#eeb6b6;font-size:12px;line-height:1.6}
.msg-person{display:flex;align-items:center;gap:12px;background:none;border:1px solid transparent;border-radius:17px;width:100%;padding:13px 10px;margin:3px 0;text-align:left;min-height:77px}.msg-person:hover{background:#88bfff0c}.msg-person.msg-person-active{background:#66adf01c;border-color:#83c8ff3d}.msg-avatar{position:relative;display:grid;place-items:center;width:47px;height:47px;flex:0 0 47px;border-radius:50%;background:linear-gradient(135deg,#47718f,#203a50);border:1px solid #c7e6ff35;color:#d1edff;font-size:15px;font-weight:600;overflow:visible}.msg-avatar img{height:100%;width:100%;object-fit:cover;border-radius:inherit}.msg-avatar i{position:absolute;right:0;bottom:1px;height:11px;width:11px;border:2px solid var(--msg-bg);background:#68dfa2;border-radius:50%}.msg-person-copy{min-width:0;flex:1}.msg-person-copy strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600;line-height:1.5}.msg-person-copy small{display:block;color:var(--msg-muted);font-size:12px;line-height:1.6;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.msg-person-meta{display:flex;flex-direction:column;align-items:flex-end;gap:8px;flex:none}.msg-person-meta time{font-size:10px;color:var(--msg-muted)}.msg-start{font-size:20px;color:var(--msg-accent)}
.msg-main{display:flex;flex-direction:column;min-width:0;min-height:560px;height:min(780px,calc(100svh - 145px));border:1px solid var(--msg-border);border-radius:24px;overflow:hidden;background:var(--msg-bg)}
.msg-thread-header{display:flex;align-items:center;gap:8px;min-height:90px;padding:14px 22px;border-bottom:1px solid var(--msg-border);background:#9bc8eb06}.msg-profile{border:0;background:none;display:flex;align-items:center;gap:13px;min-width:0;padding:0;text-align:left;min-height:52px}.msg-profile>span:last-child{min-width:0}.msg-profile strong{display:block;font-weight:600;font-size:15px;overflow-wrap:anywhere;line-height:1.4}.msg-profile small{display:block;color:var(--msg-muted);font-size:10px;line-height:1.5;margin-top:5px}.msg-profile .msg-online{color:#83d8ba}.msg-back{display:none;background:none;border:0;padding:10px 7px;color:var(--msg-text)}.msg-thread-error{color:#eeb6b6;padding:10px 18px;margin:0;font-size:11px;line-height:1.6;border-bottom:1px solid #edaaaa22}
.msg-log{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:20px;display:flex;flex-direction:column;gap:8px;outline:none}.msg-conversation-empty{margin:auto;text-align:center;padding:30px;color:var(--msg-muted);line-height:1.7}.msg-conversation-empty>span{font-size:27px;color:#aad9ff}.msg-conversation-empty p{font-size:14px;color:var(--msg-text)}.msg-conversation-empty small{font-size:11px}.msg-day{align-self:center;flex:none;color:var(--msg-muted);background:#96b8d50b;padding:7px 14px;border:1px solid #accfe512;border-radius:20px;font-size:10px;margin:12px 0;line-height:1.4}
.msg-bubble{align-self:flex-start;max-width:min(85%,430px);padding:10px 13px 7px;border:1px solid var(--msg-border);background:var(--msg-soft);border-radius:18px 18px 18px 5px;box-shadow:0 3px 15px #00000012;flex:none;min-width:63px;overflow:hidden}.msg-bubble.msg-outgoing{align-self:flex-end;background:linear-gradient(140deg,#1e5173,var(--msg-sent));border-color:#89c4f126;border-radius:18px 18px 5px 18px}.msg-body{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.65;margin:0;padding:0 0 3px}.msg-bubble footer{display:flex;align-items:center;justify-content:flex-end;gap:6px;font-size:9px;color:#b2c9da;line-height:1.7}.msg-receipt{font-size:11px;letter-spacing:-3px;padding:0 3px 0 0;color:#a6bacb}.msg-receipt.msg-read{color:#99d7ff}.msg-image{display:block;border:0;background:none;padding:0;max-width:100%;margin:0 0 6px;border-radius:10px;overflow:hidden}.msg-image img{display:block;max-width:100%;max-height:300px;object-fit:contain}.msg-load{align-self:center;flex:none;border:1px solid var(--msg-border);border-radius:20px;background:var(--msg-surface);color:var(--msg-accent);padding:10px 17px;min-height:40px;font-size:11px;margin:0 0 12px}
.msg-pending{opacity:.86}.msg-pending>small{font-size:9px;color:var(--msg-muted)}.msg-pending-photo{display:flex;align-items:center;gap:8px;font-size:11px;line-height:1.5;margin:0 0 5px;overflow-wrap:anywhere}.msg-pending-photo svg{height:18px;width:18px}.msg-send-error{font-size:11px;line-height:1.5;color:#ffc1ba;margin:8px 0}.msg-retry-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.msg-retry-actions button{min-height:36px;border:1px solid #aedcff55;border-radius:10px;background:#041a2c44;padding:7px 9px;font-size:10px}
.msg-composer{padding:14px 17px 11px;border-top:1px solid var(--msg-border);background:var(--msg-bg);flex:none}.msg-compose-row{display:flex;align-items:flex-end;gap:8px;border:1px solid #b6d6f02a;border-radius:19px;padding:6px;background:#a5c9e40a}.msg-compose-row:focus-within{border-color:#87c5f37a}.msg-compose-row button{display:grid;place-items:center;flex:0 0 39px;width:39px;height:40px;border:0;border-radius:13px;background:none;color:var(--msg-muted)}.msg-app .msg-compose-row .msg-send{background:linear-gradient(140deg,#b5e0ff,#7db8e3);color:#12354e;box-shadow:0 2px 15px #4eabf133}.msg-compose-row .msg-send svg{height:21px;width:21px}.msg-app .msg-compose-row textarea{resize:none;display:block;width:100%;max-height:128px;min-height:40px;height:67px;line-height:1.5;padding:11px 0 7px;box-shadow:none;border:0;outline:0;background:none;color:var(--msg-text);font-size:13px;scrollbar-width:thin}.msg-compose-row textarea::placeholder{color:var(--msg-muted);opacity:1}.msg-compose-hint{margin:8px 3px 0;color:var(--msg-muted);font-size:9px;line-height:1.5}.msg-file-note{margin-bottom:10px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;line-height:1.5;color:var(--msg-accent)}.msg-file-note>span{display:flex;align-items:center;gap:8px;min-width:0;overflow-wrap:anywhere}.msg-file-note svg{height:17px;width:17px}.msg-file-note small{color:var(--msg-muted);white-space:nowrap}.msg-file-note button{border:1px solid var(--msg-border);border-radius:50%;background:none;color:var(--msg-muted);display:grid;place-items:center;flex:none;width:32px;height:32px;padding:6px}.msg-compose-error{margin:9px 3px 0;font-size:11px;line-height:1.5;color:#eeb6b6}.msg-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.msg-viewer{border:1px solid #b6d6f047;border-radius:20px;max-width:95vw;max-height:90svh;background:#081521;color:#eaf4ff;padding:50px 12px 12px;box-shadow:0 25px 100px #0009}.msg-viewer::backdrop{background:#030b13de;backdrop-filter:blur(12px)}.msg-viewer img{display:block;max-height:calc(90svh - 70px);max-width:calc(95vw - 26px);object-fit:contain}.msg-viewer button{display:grid;place-items:center;position:absolute;top:7px;right:9px;width:38px;height:38px;border:1px solid #b6d6f047;border-radius:50%;background:#102438;color:inherit}.msg-viewer svg{height:21px;width:21px;fill:none;stroke:currentColor;stroke-width:1.7}
[data-theme=light] .msg-app{position:relative;--msg-bg:#f6faff;--msg-surface:#eaf3fc;--msg-soft:#e4edf7;--msg-border:#718caa36;--msg-text:#19374f;--msg-muted:#617e96;--msg-accent:#226a9f;--msg-sent:#c6e4fc}[data-theme=light] .msg-avatar{background:linear-gradient(135deg,#bcd7ed,#8cb2d0);color:#1e4461}[data-theme=light] .msg-bubble.msg-outgoing{background:linear-gradient(140deg,#d6ecff,var(--msg-sent));border-color:#a8c6e9}[data-theme=light] .msg-bubble footer{color:#6484a0}[data-theme=light] .msg-receipt{color:#7b96ac}[data-theme=light] .msg-receipt.msg-read{color:#146fbb}[data-theme=light] .msg-profile .msg-online{color:#218363}[data-theme=light] .msg-search{background:#fff}[data-theme=light] .msg-app .msg-search input{background:none;color:var(--msg-text)}[data-theme=light] .msg-list-error,[data-theme=light] .msg-thread-error,[data-theme=light] .msg-compose-error,[data-theme=light] .msg-send-error{color:#a52d35}[data-theme=light] .msg-retry-actions button{background:#ffffff66;border-color:#7ea6c6}[data-theme=light] .msg-welcome>svg{color:#4f88af}

.msg-thread-header .msg-notifications{margin-left:auto}.msg-thread-header .msg-profile{flex:1}.msg-thread-header .msg-back{display:grid;place-items:center;flex:none}
[data-theme=light] .messages-view{background:#e9f3fd}
[data-theme=light] .msg-app{position:relative;--msg-bg:#e9f3fd;--msg-surface:#eef6fd;--msg-soft:#dfeaf5;--msg-border:#87a7bf40;--msg-text:#24415c;--msg-muted:#7a8f9f;--msg-accent:#589dcf;--msg-sent:#c6e4fc}
[data-theme=light] .msg-tabs{background:#dfedf940}[data-theme=light] .msg-tabs button{color:#58738c}[data-theme=light] .msg-tabs button[aria-selected=true]{color:#2c4358;background:linear-gradient(125deg,#ffffffd9,#d6edffb0);border-color:#88bddc8c;box-shadow:inset 0 1px 5px #fff,0 0 13px #86bce936}
[data-theme=light] .msg-app .msg-search{border-color:#a7bdcc66;background:#ffffff8c;box-shadow:inset 0 1px 1px #ffffffba}[data-theme=light] .msg-app .msg-search input{background:transparent}
[data-theme=light] .msg-tab-empty{color:#7b8e9c}
@media(max-width:760px){.msg-app{min-height:calc(100svh - 40px)}.msg-tabs{margin-bottom:22px}.msg-tabs button{font-size:15px;min-height:44px}.msg-main{min-height:500px;height:calc(100svh - 40px);border-radius:22px}.msg-thread-header{padding:12px 10px 12px 6px;gap:7px;min-height:79px}.msg-thread-header .msg-avatar{width:42px;height:42px;flex-basis:42px}.msg-profile{gap:10px}.msg-profile strong{font-size:14px}.msg-profile small{font-size:10px}.msg-back{min-height:44px;padding:5px}.msg-log{padding:13px 12px}.msg-bubble{max-width:89%;padding:9px 12px 6px}.msg-body{font-size:14px}.msg-composer{padding:10px 10px max(10px,env(safe-area-inset-bottom))}.msg-app .msg-compose-row textarea{font-size:16px;height:65px;padding:10px 0 7px}.msg-compose-hint{display:none}.msg-compose-row{gap:4px;border-radius:17px}.msg-compose-row button{height:40px;width:37px;flex-basis:37px}.msg-image img{max-height:260px}.msg-compose-error{font-size:11px}.msg-person{min-height:79px;padding:13px 8px}.msg-search input{font-size:14px!important;height:44px!important}.msg-avatar{width:47px;height:47px;flex-basis:47px}}
@media(max-width:350px){.msg-tabs button{font-size:14px;padding-left:4px;padding-right:4px}.msg-tabs{gap:1px}.msg-notifications{height:37px;width:37px;flex-basis:37px}.msg-thread-header .msg-profile{gap:7px}.msg-thread-header .msg-avatar{width:34px;height:34px;flex-basis:34px}.msg-profile strong{font-size:12px}}
@media(prefers-reduced-motion:reduce){.msg-app *{scroll-behavior:auto}}

/* Chat music is handed to the one TiDi player; no competing audio element. */
.msg-audio{display:grid;grid-template-columns:42px minmax(0,1fr);align-items:center;gap:10px 12px;min-width:0;width:280px;max-width:100%;padding:6px 0 7px}
.msg-audio-cover{display:grid;place-items:center;width:42px;height:48px;border:1px solid var(--msg-border);border-radius:12px;background:#a8d9ff0c;color:var(--msg-accent)}
.msg-audio-cover svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.msg-audio-copy{min-width:0}
.msg-audio-copy strong{display:block;color:var(--msg-text);font-size:13px;line-height:1.5;font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.msg-audio-copy small{display:block;margin-top:4px;color:var(--msg-muted);font-size:10px;line-height:1.6}
.msg-audio-actions{grid-column:1/-1;display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px}
.msg-audio-actions button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:8px 10px;border:1px solid var(--msg-border);border-radius:12px;background:#a4d8ff0a;color:var(--msg-accent);font:inherit;font-size:11px;line-height:1.5;cursor:pointer}
.msg-audio-actions button svg{width:16px;height:16px;fill:currentColor;stroke:none}
.msg-audio-actions button:disabled{opacity:.45;cursor:default}
.msg-audio-actions button:focus-visible{outline:2px solid var(--msg-accent);outline-offset:2px}
.msg-audio-status{grid-column:1/-1;margin:0;color:var(--msg-muted);font-size:10px;line-height:1.7;overflow-wrap:anywhere}
.msg-audio-status[data-state=error]{color:#ffc1ba}
.msg-audio-status[data-state=saved]{color:#9ddfbe}
[data-theme=light] .msg-audio-status[data-state=error]{color:#a52d35}
[data-theme=light] .msg-audio-status[data-state=saved]{color:#287856}
