/* Sali 0.8 – own look: logo green #195b4b and gold #cfb976, Plus Jakarta Sans,
   light headers, rounded cards and line icons. Colours as tokens for light and dark;
   --green is the accent for fills and highlights, --out the own message bubble. */
@font-face{font-family:"Plus Jakarta Sans";font-style:normal;font-weight:200 800;font-display:swap;src:url(/wa/jakarta-latin.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Plus Jakarta Sans";font-style:normal;font-weight:200 800;font-display:swap;src:url(/wa/jakarta-latin-ext.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
:root{
 --font:"Plus Jakarta Sans","Segoe UI",system-ui,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
 --green:#195b4b;--green-strong:#134a3d;--green-badge:#195b4b;--on-badge:#fff;--green-text:#195b4b;--green-soft:#dfe8e5;
 --gold:#cfb976;--gold-text:#7a5d14;--gold-soft:#f4ecd6;
 --bg:#fff;--bg-2:#edf0eb;--bg-3:#f3f5f1;--hover:#f3f5f1;--active:#e8ede8;--border:#e4e8e2;--border-2:#d3dad3;
 --text:#11201b;--text-2:#56665f;--text-3:#76857f;--icon:#33433d;--icon-2:#66756f;
 --appbar:#fff;--appbar-text:#11201b;--appbar-icon:#33433d;--tab-off:#56665f;--nav:#fff;
 --chat-bg:#ebefe9;--doodle:rgba(17,32,27,.045);
 --in:#fff;--out:#195b4b;--bubble-shadow:0 1px 2px rgba(17,32,27,.08);
 --meta:#56665f;--meta-out:rgba(255,255,255,.74);--tick:rgba(255,255,255,.74);--tick-read:#9a7a22;
 --system:rgba(255,255,255,.92);--system-text:#56665f;--crypto:#f3edd9;--crypto-text:#5a491b;
 --quote-in:#eff2ee;--quote-out:rgba(0,0,0,.16);--link:#17785f;--danger:#c11b32;--warn:#e5484d;
 --chip:#edf0eb;--chip-border:transparent;--chip-text:#56665f;--chip-on:#195b4b;--chip-on-text:#fff;
 --input:#fff;--search:#edf0eb;--menu:#fff;--overlay:rgba(9,16,13,.45);
 --shadow:0 10px 30px rgba(17,32,27,.14),0 2px 8px rgba(17,32,27,.08);
 --card-shadow:0 1px 2px rgba(17,32,27,.05);
 --unread-strip:rgba(255,255,255,.55);--selected:rgba(25,91,75,.12);
 --avatar-bg:#dfe8e5;--avatar-fg:#195b4b;
 --toast:#1b2a25;
 --radius:12px;--bubble-radius:18px;
 color-scheme:light;
}
:root[data-theme=dark]{
 --green:#2f8a70;--green-strong:#256f5a;--green-badge:#5cc99a;--on-badge:#062016;--green-text:#7fcfae;--green-soft:#17352d;
 --gold-text:#e3cf8e;--gold-soft:#2e2816;
 --bg:#0e1613;--bg-2:#1b2622;--bg-3:#0b110f;--hover:#16201c;--active:#1e2a26;--border:#1f2b27;--border-2:#2c3a35;
 --text:#e7eeea;--text-2:#9aa9a2;--text-3:#82918a;--icon:#bac7c1;--icon-2:#8d9c95;
 --appbar:#0e1613;--appbar-text:#e7eeea;--appbar-icon:#bac7c1;--tab-off:#9aa9a2;--nav:#111a17;
 --chat-bg:#09100d;--doodle:rgba(231,238,234,.035);
 --in:#18231f;--out:#195b4b;--bubble-shadow:0 1px 1px rgba(0,0,0,.25);
 --meta:#9aa9a2;--meta-out:rgba(255,255,255,.7);--tick:rgba(255,255,255,.7);--tick-read:#d8c27f;
 --system:#16201c;--system-text:#9aa9a2;--crypto:#1f1c11;--crypto-text:#e2cf93;
 --quote-in:#111a17;--quote-out:rgba(0,0,0,.2);--link:#8fd3b6;--danger:#ff7a86;--warn:#ff7a86;
 --chip:#1b2622;--chip-border:transparent;--chip-text:#9aa9a2;--chip-on:#2f8a70;--chip-on-text:#fff;
 --input:#18231f;--search:#1b2622;--menu:#16201c;--overlay:rgba(0,0,0,.6);
 --shadow:0 10px 30px rgba(0,0,0,.45),0 2px 8px rgba(0,0,0,.3);
 --card-shadow:none;
 --unread-strip:rgba(14,22,19,.75);--selected:rgba(92,201,154,.14);
 --avatar-bg:#24312c;--avatar-fg:#9aa9a2;--toast:#e7eeea;
 color-scheme:dark;
}
/* Sender names in groups (util.mjs nameColor): darker tones on light, lighter on dark. */
:root{--sc-0:#1f7a52;--sc-1:#b0531f;--sc-2:#7c4dbe;--sc-3:#2f6fb0;--sc-4:#a8336b;--sc-5:#7d6210;--sc-6:#21807f;--sc-7:#c0392b;--sc-8:#4f5fc9;--sc-9:#3f7d22;--sc-10:#9a5a14;--sc-11:#6b4fb0;--sc-12:#1b7894;--sc-13:#94407f}
:root[data-theme=dark]{--sc-0:#6fd19f;--sc-1:#f0a070;--sc-2:#c2a3f2;--sc-3:#86b9ef;--sc-4:#f08cbf;--sc-5:#e3c66a;--sc-6:#6fd3d1;--sc-7:#ff8f84;--sc-8:#a2adf5;--sc-9:#9bd57a;--sc-10:#f0b26a;--sc-11:#b9a4f0;--sc-12:#74c9e3;--sc-13:#e59ad3}
/* Line icons (icons.mjs L): stroke in the icon's colour; rules below that colour
   icons set both fill and color. */
svg.ln{fill:none!important;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;overflow:clip;background:var(--bg);color:var(--text);font:14px/1.4 var(--font);-webkit-font-smoothing:antialiased}
body{position:fixed;inset:0}
[hidden]{display:none!important}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
button:disabled{cursor:default;opacity:.5}
input,textarea,select{font:inherit;color:inherit}
a{color:var(--link)}
svg{display:block;flex:none}
.sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.ico{width:24px;height:24px;fill:currentColor}
.ico-sm{width:18px;height:18px;fill:currentColor}
.ico-xs{width:16px;height:16px;fill:currentColor}
.icon-btn{width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:var(--icon);flex:none;transition:background .15s}
.icon-btn:hover{background:rgba(11,20,26,.06)}
:root[data-theme=dark] .icon-btn:hover{background:rgba(233,237,239,.08)}
.icon-btn.active{background:rgba(11,20,26,.08);color:var(--text)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 24px;border-radius:14px;font-weight:700;font-size:14.5px;background:var(--green);color:#fff;transition:filter .15s,background .15s}
.btn:hover{filter:brightness(1.1)}
.btn.ghost{background:transparent;color:var(--green-text);border:1px solid var(--border-2)}
.btn.ghost:hover{background:var(--hover)}
.btn.text{background:transparent;color:var(--green-text);padding:0 14px}
.btn.danger{background:var(--danger);color:#fff}
.btn.text.danger{background:transparent;color:var(--danger)}
.btn.wide{width:100%}
.field{display:block;margin:0 0 18px}
.field>span{display:block;font-size:13px;font-weight:600;color:var(--green-text);margin-bottom:6px}
.field input,.field textarea,.field select{width:100%;border:1.5px solid transparent;background:var(--bg-2);padding:11px 14px;font-size:16px;outline:0;transition:border-color .15s,background .15s;border-radius:12px}
.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--green);background:var(--bg)}
.field textarea{resize:none}
.field small{display:block;color:var(--text-2);margin-top:4px;font-size:12.5px}
.error-text{color:var(--danger);font-size:13.5px;min-height:18px;margin:6px 0}
.muted{color:var(--text-2)}

/* ---------- Avatars ---------- */
/* Rounded squares like the Sali logo (--av-r), also for photos. */
.avatar{--av-r:35%;position:relative;border-radius:var(--av-r);flex:none;overflow:hidden;background:var(--avatar-bg);color:var(--avatar-fg);display:inline-flex;align-items:center;justify-content:center;font-weight:800;user-select:none}
.avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar svg{width:52%;height:52%;fill:currentColor}
.avatar .ini{font-size:.34em;letter-spacing:.01em;line-height:1}
.av-40{width:40px;height:40px;font-size:40px}
.av-49{width:49px;height:49px;font-size:49px}
.av-52{width:52px;height:52px;font-size:52px}
.av-32{width:32px;height:32px;font-size:32px}
.av-28{width:28px;height:28px;font-size:28px}
.av-24{width:24px;height:24px;font-size:24px}
.av-64{width:64px;height:64px;font-size:64px}
.av-82{width:82px;height:82px;font-size:82px}
.av-120{width:120px;height:120px;font-size:120px}
.av-140{width:140px;height:140px;font-size:140px}
.av-200{width:200px;height:200px;font-size:200px}
/* Initials avatars: palette classes from util.mjs avatar(); no inline colours,
   so a theme switch recolours avatars that are already on screen. */
.avatar.initials{background:var(--av-bg,var(--avatar-bg));color:var(--av-fg,var(--avatar-fg))}
:root[data-theme=dark] .avatar.initials{background:var(--av-dbg,var(--avatar-bg));color:var(--av-dfg,var(--avatar-fg))}
/* Calm tints; each pair has a light and a dark variant. */
.pal-0{--av-bg:#f8e1e4;--av-fg:#9b2c3f;--av-dbg:#40202a;--av-dfg:#f3c4cc}.pal-1{--av-bg:#fbe4d3;--av-fg:#984417;--av-dbg:#41271a;--av-dfg:#f4c8a9}.pal-2{--av-bg:#f4ead0;--av-fg:#74560e;--av-dbg:#3a3018;--av-dfg:#ebd596}.pal-3{--av-bg:#dfeee0;--av-fg:#2e6b3a;--av-dbg:#1d3524;--av-dfg:#bfe3c6}.pal-4{--av-bg:#dce9f8;--av-fg:#1e5a96;--av-dbg:#1e3a57;--av-dfg:#c4dcf6}
.pal-5{--av-bg:#e3e6fa;--av-fg:#3d4aa6;--av-dbg:#252b4a;--av-dfg:#ccd2f7}.pal-6{--av-bg:#ece5fa;--av-fg:#5a3ea6;--av-dbg:#2f2649;--av-dfg:#d8ccf7}.pal-7{--av-bg:#f9e2ef;--av-fg:#9c2a66;--av-dbg:#3f1f31;--av-dfg:#f3c5de}.pal-8{--av-bg:#dfe8e5;--av-fg:#195b4b;--av-dbg:#17352d;--av-dfg:#a3d9c3}.pal-9{--av-bg:#e4e9e6;--av-fg:#475751;--av-dbg:#24302c;--av-dfg:#c3cfca}

/* ---------- Splash ---------- */
.splash{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--bg-3);z-index:50;gap:14px}
.splash img{border-radius:24px;box-shadow:0 12px 28px rgba(25,91,75,.28)}
.splash-name{font-size:26px;color:var(--text);font-weight:800;letter-spacing:-.02em}
.splash-progress{width:200px;max-width:60vw;height:4px;border-radius:2px;background:var(--border);overflow:hidden}
.splash-progress span{display:block;height:100%;width:35%;background:var(--green);border-radius:2px;animation:progress 1.3s ease-in-out infinite}
@keyframes progress{0%{transform:translateX(-100%)}100%{transform:translateX(290%)}}
.splash p{margin:0;color:var(--text-2);font-size:14px;min-height:20px;text-align:center;padding:0 24px}
.splash-foot{position:absolute;bottom:34px;display:flex;align-items:center;gap:6px;color:var(--text-3);font-size:13px}
.splash-foot svg{width:14px;height:14px;fill:currentColor}

/* ---------- Auth & unlock ---------- */
.auth,.unlock{position:fixed;inset:0;overflow:auto;background:var(--bg-3);z-index:20}
.auth::before,.unlock::before{content:'';position:absolute;left:0;right:0;top:0;height:222px;background:var(--green)}
:root[data-theme=dark] .auth::before,:root[data-theme=dark] .unlock::before{background:#122a23}
.auth-top{position:relative;display:flex;align-items:center;gap:12px;max-width:1000px;margin:0 auto;padding:28px 24px 0;color:#fff;font-size:20px;font-weight:800;letter-spacing:-.01em}
.auth-top img{width:40px;height:40px;border-radius:12px}
.auth-card{position:relative;max-width:1000px;margin:28px auto 40px;background:var(--bg);border-radius:24px;box-shadow:var(--shadow);display:flex;min-height:520px;overflow:hidden}
.auth-intro{flex:1.1;padding:56px 48px 40px 60px;display:flex;flex-direction:column}
.auth-intro h1{font-size:30px;font-weight:800;letter-spacing:-.02em;color:var(--text);margin:0 0 26px}
.auth-intro ol{margin:0;padding:0 0 0 22px;color:var(--text);font-size:17px;line-height:1.55}
.auth-intro li{margin-bottom:14px;padding-left:6px}
.auth-intro .note{margin-top:auto;display:flex;gap:8px;align-items:center;color:var(--text-2);font-size:14px}
.auth-intro .note svg{width:15px;height:15px;fill:currentColor}
.auth-form{flex:1;padding:48px 56px;border-left:1px solid var(--border);display:flex;flex-direction:column}
.auth-form h2{margin:0 0 6px;font-size:24px;font-weight:800;letter-spacing:-.01em}
.auth-form p.sub{margin:0 0 24px;color:var(--text-2)}
.auth-switch{margin-top:16px;text-align:center;color:var(--text-2)}
.auth-switch button{color:var(--green-text);font-weight:700}
.auth-hero{width:120px;height:120px;border-radius:36px;background:var(--green-soft);display:flex;align-items:center;justify-content:center;margin:0 0 24px}
.auth-hero img{width:64px;height:64px;border-radius:18px}
.unlock-card{position:relative;max-width:460px;margin:80px auto 40px;background:var(--bg);border-radius:24px;box-shadow:var(--shadow);padding:36px 36px 28px;text-align:center}
.unlock-card .lock-ico{width:88px;height:88px;border-radius:28px;background:var(--green-soft);display:flex;align-items:center;justify-content:center;margin:0 auto 18px;color:var(--green-text)}
.unlock-card .lock-ico svg{width:42px;height:42px;fill:currentColor}
.unlock-card h2{margin:0 0 8px;font-weight:800;font-size:22px;letter-spacing:-.01em}
.unlock-card p{color:var(--text-2);margin:0 0 22px}
.unlock-card .field{text-align:left}
.unlock-card details{margin-top:18px;text-align:left;color:var(--text-2);font-size:13.5px}
.unlock-card summary{cursor:pointer;color:var(--green-text);text-align:center;font-weight:600}
.unlock-card .error-text{color:var(--danger);margin:6px 0 12px;text-align:left}
.unlock-card .unlock-links{margin:14px 0 0}
.unlock-card .unlock-links+.unlock-links{margin-top:2px}
.unlock-card .unlock-links .btn.text{height:auto;min-height:36px;padding:6px 12px;white-space:normal;line-height:1.3}
.unlock-card .lock-ico svg[class]{width:42px;height:42px}
.auth-intro p.note{margin-bottom:0}
.splash-actions{margin-top:6px}
/* Security warnings and the shortcut list (app.mjs dialogs) */
.dialog h3.danger-title{color:var(--danger)}
.dialog .security-list{margin:0 0 14px;padding-left:22px;color:var(--text);font-size:15px;line-height:1.6}
.shortcut-list{display:flex;flex-direction:column;gap:2px;max-height:60vh;overflow-y:auto}
.shortcut{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:7px 0;border-bottom:1px solid var(--border);font-size:14.5px;color:var(--text)}
.shortcut kbd{font:500 12.5px/1 var(--font);background:var(--bg-2);color:var(--text-2);border:1px solid var(--border-2);border-radius:6px;padding:5px 8px;white-space:nowrap}

/* ---------- Main layout ---------- */
/* overflow:clip – focus/scrollIntoView must never scroll the off-screen chat into view */
.main{position:fixed;inset:0;display:flex;background:var(--bg-2);overflow:hidden;overflow:clip}
.rail{width:64px;flex:none;display:flex;flex-direction:column;align-items:center;padding:10px 0;gap:6px;background:var(--bg-2);border-right:1px solid var(--border);z-index:3}
.rail .spacer{flex:1}
.rail .icon-btn{position:relative;width:40px;height:40px}
.rail .icon-btn{border-radius:14px}
.rail .icon-btn.active{background:var(--green-soft);color:var(--green-text)}
.rail .dot{position:absolute;top:-2px;right:-4px;min-width:19px;height:19px;border-radius:10px;background:var(--green-badge);color:var(--on-badge);font-size:10.5px;font-weight:800;display:flex;align-items:center;justify-content:center;padding:0 4px;border:2px solid var(--bg-2)}
.rail hr{width:32px;border:0;border-top:1px solid var(--border-2);margin:4px 0}
.side{position:relative;flex:0 0 30%;min-width:340px;max-width:520px;background:var(--bg);display:flex;flex-direction:column;border-right:1px solid var(--border);z-index:2;overflow:hidden;overflow:clip}
.chat{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;background:var(--chat-bg);z-index:1}
.panel{flex:0 0 30%;min-width:320px;max-width:480px;background:var(--bg);border-left:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden;z-index:2}

/* ---------- Sidebar home ---------- */
.side-home{display:flex;flex-direction:column;height:100%;min-height:0}
.appbar{display:flex;align-items:center;gap:6px;height:68px;padding:0 12px 0 20px;flex:none}
.appbar h1{flex:1;margin:0;font-size:26px;font-weight:800;color:var(--text);letter-spacing:-.025em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.appbar .brand{width:34px;height:34px;border-radius:10px;flex:none;margin-right:6px}
.appbar .new-chat{width:40px;height:40px;border-radius:50%;background:var(--green);color:#fff;display:inline-flex;align-items:center;justify-content:center}
.appbar .new-chat:hover{filter:brightness(1.07)}
.tabs,.bottom-nav{display:none}
.side-body{flex:1;min-height:0;display:flex;flex-direction:column}
.tab-pane{flex:1;min-height:0;display:flex;flex-direction:column}
.search-row{padding:2px 16px 10px;flex:none}
.search{display:flex;align-items:center;gap:10px;height:44px;border-radius:14px;background:var(--search);padding:0 14px;color:var(--icon-2);transition:background .15s}
.search:focus-within{background:var(--bg);box-shadow:inset 0 0 0 2px var(--green)}
.search input{flex:1;min-width:0;border:0;outline:0;background:transparent;font-size:15px;color:var(--text)}
.search input::placeholder{color:var(--text-2)}
.search .clear{color:var(--icon-2)}
/* Only the app's own clear button (list.mjs); the browser's search ✕ is hidden. */
.search input::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none;display:none}
.search .icon-btn.clear{width:32px;height:32px;margin-right:-8px}
/* Filter chips scroll sideways when they do not fit; a fade marks more chips. */
.chips{display:flex;gap:8px;padding:0 16px 12px;overflow-x:auto;scrollbar-width:none;flex:none}
.chips::-webkit-scrollbar{display:none}
.chips.fade-r{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 40px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 40px),transparent)}
.chips.fade-l{-webkit-mask-image:linear-gradient(to right,transparent,#000 40px);mask-image:linear-gradient(to right,transparent,#000 40px)}
.chips.fade-l.fade-r{-webkit-mask-image:linear-gradient(to right,transparent,#000 40px,#000 calc(100% - 40px),transparent);mask-image:linear-gradient(to right,transparent,#000 40px,#000 calc(100% - 40px),transparent)}
.chip{height:34px;padding:0 15px;border-radius:17px;border:1px solid transparent;background:var(--chip);color:var(--chip-text);font-size:14px;font-weight:600;white-space:nowrap;display:inline-flex;align-items:center;gap:6px;transition:background .15s,color .15s;flex:none}
.chip:not(.on):hover{background:var(--active)}
.chip.on{background:var(--chip-on);color:var(--chip-on-text);border-color:transparent;font-weight:700}
.chip .count{font-size:12px;opacity:.9}
.list{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--border-2) transparent}
.list-note{padding:30px 32px;text-align:center;color:var(--text-2);font-size:14px;line-height:1.55}
.list-foot{padding:22px 24px 90px;text-align:center;color:var(--text-2);font-size:12.5px;display:flex;align-items:center;justify-content:center;gap:5px}
.list-foot svg{width:12px;height:12px;fill:currentColor}
.list-foot b{color:var(--green-text);font-weight:600}
.row{display:flex;align-items:center;height:76px;padding:0 16px;cursor:pointer;position:relative;background:var(--bg);transition:background .1s;user-select:none;width:100%;text-align:left}
.row:hover{background:var(--hover)}
.row.current{background:var(--active)}
.row.picked{background:var(--selected)}
.row>.avatar{margin-right:14px}
.row-body{flex:1;min-width:0;height:100%;display:flex;flex-direction:column;justify-content:center;padding-right:2px}
.row-top,.row-bottom{display:flex;align-items:center;min-width:0}
.row-name{flex:1;min-width:0;font-size:16px;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:21px}
.row.unread .row-name{font-weight:800}
.row-time{font-size:12.5px;font-weight:500;color:var(--text-2);margin-left:8px;flex:none}
.row.unread .row-time{color:var(--green-badge);font-weight:700}
.row-bottom{margin-top:4px;min-height:20px}
.row-preview{flex:1;min-width:0;font-size:14.5px;font-weight:500;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;gap:4px;line-height:20px}
.row.unread .row-preview{color:var(--text);font-weight:600}
.row-preview>span.txt{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row-preview .typing,.row-preview .draft{color:var(--green-badge);font-weight:700}
.row-preview svg{width:18px;height:18px;fill:currentColor;flex:none}
.row-preview svg.tick{width:18px;height:18px}
.row-preview .sender{flex:none}
.row-badges{display:flex;align-items:center;gap:5px;margin-left:6px;flex:none;color:var(--icon-2)}
.row-badges svg{width:18px;height:18px;fill:currentColor}
.badge{min-width:22px;height:22px;border-radius:11px;background:var(--green-badge);color:var(--on-badge);font-size:12px;font-weight:800;display:inline-flex;align-items:center;justify-content:center;padding:0 7px;line-height:1}
.badge.dot{min-width:12px;width:12px;height:12px;padding:0}
.badge.muted{background:var(--icon-2);color:#fff}
:root[data-theme=dark] .badge.muted{color:#0e1613}
.row-menu{width:0;overflow:hidden;opacity:0;transition:width .12s,opacity .12s;color:var(--icon-2);display:flex}
.row:hover .row-menu,.row-menu.open{width:22px;opacity:1}
.row-select{display:none}
.row.picked>.avatar::after{content:'';position:absolute;right:-2px;bottom:-2px;width:20px;height:20px;border-radius:50%;background:var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/14px no-repeat;border:2px solid var(--bg)}
.row.picked>.avatar{overflow:visible}
.row.picked>.avatar img{border-radius:var(--av-r)}
.archived-row{display:flex;align-items:center;height:56px;padding:0 16px 0 30px;gap:30px;color:var(--text);font-size:15.5px;font-weight:600;width:100%;text-align:left}
.archived-row:hover{background:var(--hover)}
.archived-row svg{color:var(--green-text)}
.archived-row .grow{flex:1}
.archived-row .n{font-size:12.5px;color:var(--green-text);font-weight:700}
.section-title{padding:18px 20px 8px;color:var(--green-text);font-size:13.5px;font-weight:700}
.fab{display:none}
.people-note{margin:4px 20px 12px;color:var(--text-2);font-size:13px}
/* Keyboard focus inside the scrolling list; no long-press callout on touch. */
.list .row:focus-visible,.list .archived-row:focus-visible,.list .link-row:focus-visible,.more-hits:focus-visible{outline-offset:-2px}
.row[data-room]{-webkit-touch-callout:none}
/* Chat-list search: message hits (search.mjs), "more" and status lines. */
.row.msg-hit{padding-left:20px}
.msg-hit mark{background:transparent;color:var(--green-text);font-weight:600}
.more-hits{display:block;width:100%;padding:14px 20px;text-align:left;color:var(--green-text);font-weight:500;font-size:14.5px}
.more-hits:hover{background:var(--hover)}
.search-status{display:flex;align-items:center;justify-content:center;gap:10px;margin:0;padding:16px 24px;color:var(--text-2);font-size:13.5px;text-align:center;line-height:1.45}
.search-status .spinner{flex:none;width:18px;height:18px;border-width:2px}

/* ---------- Calls tab ---------- */
.call-row .row-preview svg{width:16px;height:16px}
.call-row .dir-out,.call-row .dir-in{color:var(--green-text)}
.call-row .dir-missed{color:var(--danger)}
.call-row.missed .row-name{color:var(--danger)}
.call-row .call-actions{display:flex;gap:2px;color:var(--green-text)}
.call-row .call-actions .icon-btn{color:var(--green-text)}
.row .call-actions{display:flex;gap:2px;flex:none}
.row .call-actions .icon-btn{color:var(--green-text)}
.link-row{display:flex;align-items:center;gap:14px;height:76px;padding:0 16px;width:100%;text-align:left}
.link-row:hover{background:var(--hover)}
.link-row .round{width:52px;height:52px;border-radius:18px;background:var(--green);color:#fff;display:flex;align-items:center;justify-content:center;flex:none}
.link-row b{font-weight:700;font-size:16px;display:block}
.link-row small{color:var(--text-2);font-size:14px}

/* ---------- Chat: empty state ---------- */
.chat-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--bg-3);text-align:center;padding:40px;color:var(--text-2)}
.chat-empty .hero{width:280px;height:188px;position:relative;margin-bottom:28px}
.chat-empty .hero .screen{position:absolute;left:28px;top:12px;width:224px;height:150px;border-radius:16px;background:var(--bg);box-shadow:0 12px 30px rgba(25,91,75,.13);border:1px solid var(--border);overflow:hidden}
.chat-empty .hero .screen::before{content:'';position:absolute;left:0;top:0;bottom:0;width:62px;background:var(--bg-2)}
.chat-empty .hero .b{position:absolute;height:14px;border-radius:7px;background:var(--out)}
.chat-empty .hero .b.in{background:var(--bg-2)}
.chat-empty .hero .phone{position:absolute;right:6px;bottom:0;width:70px;height:124px;border-radius:16px;background:var(--green);box-shadow:0 10px 24px rgba(25,91,75,.3)}
.chat-empty .hero .phone::after{content:'';position:absolute;inset:8px;border-radius:9px;background:var(--bg)}
.chat-empty .hero .logo{position:absolute;right:23px;bottom:44px;width:36px;height:36px;border-radius:9px;z-index:2}
.chat-empty h2{font-size:32px;font-weight:800;letter-spacing:-.02em;color:var(--text);margin:0 0 14px}
.chat-empty p{margin:0;max-width:520px;line-height:1.6;font-size:14px}
.chat-empty .foot{position:absolute;bottom:40px;display:flex;align-items:center;gap:6px;font-size:13.5px}
.chat-empty .foot svg{width:13px;height:13px;fill:currentColor}

/* ---------- Chat header ---------- */
.chat-view{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}
.chat-head{display:flex;align-items:center;gap:4px;height:68px;padding:0 12px 0 16px;background:var(--bg);border-bottom:1px solid var(--border);flex:none;z-index:4;position:relative}
.chat-head .back{display:none}
.chat-head .who{flex:1;min-width:0;display:flex;align-items:center;gap:12px;cursor:pointer;height:100%;text-align:left}
.chat-head .who-text{min-width:0;display:flex;flex-direction:column;gap:1px}
.chat-head .who-name{font-size:16.5px;font-weight:800;letter-spacing:-.01em;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:21px}
.chat-head .who-sub{font-size:12.5px;font-weight:500;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:18px}
.chat-head .who-sub.live{color:var(--green-text);font-weight:600}
.chat-head .who-sub.online{display:flex;align-items:center;gap:6px;color:var(--green-text);font-weight:600}
.chat-head .who-sub.online::before{content:'';width:8px;height:8px;border-radius:4px;background:var(--green-badge);flex:none}
.chat-head .actions{display:flex;align-items:center;gap:6px}
.select-head{display:flex;align-items:center;gap:6px;height:68px;padding:0 12px 0 10px;background:var(--bg);border-bottom:1px solid var(--border);flex:none;z-index:5}
.select-head .count{flex:1;font-size:18px;font-weight:800;color:var(--text);padding-left:8px}
.find-head{display:flex;align-items:center;gap:6px;height:68px;padding:0 12px;background:var(--bg);border-bottom:1px solid var(--border);flex:none;z-index:5}
.find-head .search{flex:1;min-width:0}
.find-head .hits{font-size:13px;color:var(--text-2);min-width:52px;text-align:center}
.block-bar{padding:12px 16px;text-align:center;background:var(--bg-2);color:var(--text-2);font-size:14px;border-top:1px solid var(--border)}
.block-bar button{color:var(--green-text);font-weight:700}

/* ---------- Messages ---------- */
.messages{position:relative;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:10px 0 8px;display:flex;flex-direction:column;scrollbar-width:thin;scrollbar-color:rgba(11,20,26,.2) transparent;overscroll-behavior:contain}
.wall{position:absolute;inset:0;pointer-events:none;background-color:var(--doodle);-webkit-mask-image:url(/wa/doodles.svg);mask-image:url(/wa/doodles.svg);-webkit-mask-size:420px;mask-size:420px;z-index:0}
.messages{z-index:1}
.chat-head{z-index:4}
/* flex:none – the list must never shrink to the viewport (long chats would
   overflow upwards, out of reach). Short chats still sit at the bottom. */
.msg-list{position:relative;display:flex;flex-direction:column;justify-content:flex-end;min-height:100%;flex:none}
.loading-row{align-self:center;padding:28px 0}
.sys.load-error{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:center}
.sys.load-error button{color:var(--green-text);font-weight:700}
/* Floating date while scrolling (the inline date chips do not stick). */
.float-day-wrap{position:sticky;top:0;height:0;z-index:4;display:flex;justify-content:center;pointer-events:none;flex:none}
.float-day{height:max-content;margin-top:8px;padding:5px 12px 6px;border-radius:10px;background:var(--system);color:var(--system-text);font-size:12px;font-weight:700;letter-spacing:.02em;box-shadow:var(--bubble-shadow);white-space:nowrap;opacity:0;transition:opacity .3s}
.float-day.show{opacity:1;transition-duration:.1s}
.load-older{align-self:center;margin:6px 0 10px;font-size:13px;font-weight:600;color:var(--text-2);background:var(--system);padding:6px 14px;border-radius:14px;box-shadow:var(--bubble-shadow)}
.crypto-note{align-self:center;max-width:min(520px,88%);margin:8px 16px 12px;padding:9px 14px;border-radius:16px;background:var(--crypto);color:var(--crypto-text);font-size:12.5px;font-weight:500;text-align:center;line-height:1.45;cursor:pointer}
.crypto-note svg{display:inline-block;width:12px;height:12px;fill:currentColor;vertical-align:-1.5px;margin-right:5px}
.day{position:relative;z-index:3;align-self:center;margin:12px 0 8px;padding:5px 12px 6px;border-radius:10px;background:var(--system);color:var(--system-text);font-size:12px;font-weight:700;letter-spacing:.02em;box-shadow:var(--bubble-shadow);text-transform:none}
.sys{align-self:center;max-width:min(600px,86%);margin:6px 16px;padding:6px 12px;border-radius:var(--radius);background:var(--system);color:var(--system-text);font-size:12.5px;font-weight:500;text-align:center;box-shadow:var(--bubble-shadow);line-height:1.45}
.sys.security{background:var(--crypto);color:var(--crypto-text);cursor:pointer}
.sys svg{display:inline-block;width:12px;height:12px;fill:currentColor;vertical-align:-1.5px;margin-right:4px}
/* Calls in the chat: a small bubble on the caller's side, missed calls in red. */
.call-bubble{display:flex;align-items:center;gap:10px;min-width:210px;padding:8px 10px 10px 8px;text-align:left;font-size:14.2px;line-height:19px;cursor:pointer}
.call-bubble:disabled{opacity:1;cursor:default}
.call-bubble .call-ico{width:38px;height:38px;border-radius:13px;flex:none;display:flex;align-items:center;justify-content:center;background:rgba(17,32,27,.06);color:var(--icon)}
:root[data-theme=dark] .call-bubble .call-ico,.msg.out .call-bubble .call-ico{background:rgba(255,255,255,.12)}
.call-bubble .call-ico svg{width:22px;height:22px;fill:currentColor}
.call-note.missed .call-ico{color:var(--danger)}
.call-bubble .call-body{display:flex;flex-direction:column;min-width:0;padding-right:40px}
.call-bubble .call-title{color:var(--text)}
.call-bubble .call-sub{font-size:12.5px;color:var(--text-2)}
.unread-strip{align-self:stretch;margin:8px 0;padding:5px 0;text-align:center;background:var(--unread-strip)}
.unread-strip span{display:inline-block;padding:4px 12px;border-radius:10px;background:var(--system);color:var(--system-text);font-size:12.5px;font-weight:600;box-shadow:var(--bubble-shadow)}
.msg{display:flex;padding:0 7%;margin-bottom:2px;position:relative;align-items:flex-start;transition:background .2s}
.msg.first{margin-top:10px}
.msg.out{justify-content:flex-end}
.msg.selected{background:var(--selected)}
.msg.flash .bubble{animation:flash 1.4s ease}
@keyframes flash{0%,60%{box-shadow:0 0 0 3px rgba(207,185,118,.85)}100%{box-shadow:var(--bubble-shadow)}}
/* A reacted bubble gets room below it: the pill hangs under the bubble and never
   covers time, ticks or caption (WhatsApp). */
.msg.react{margin-bottom:27px}
.msg.react .bubble.emoji-only{margin-bottom:8px}
.msg-wrap{position:relative;max-width:65%;display:flex;flex-direction:column;min-width:0}
/* Groups: the sender's picture beside the first bubble of each run. */
.msg.in.grp{padding-left:max(8px,calc(7% - 36px))}
.msg-av{flex:none;width:28px;height:28px;margin-right:8px;border-radius:35%;align-self:flex-start;cursor:pointer}
.msg.in.grp:not(.first) .msg-wrap{margin-left:36px}
.msg.out .msg-wrap{align-items:flex-end}
/* Rounded bubbles without tails: the corner at the sender's side stays small,
   and a run of messages from one person joins along that side. */
.bubble{position:relative;padding:7px 10px 8px 12px;border-radius:var(--bubble-radius) var(--bubble-radius) var(--bubble-radius) 6px;box-shadow:var(--bubble-shadow);background:var(--in);font-size:14.2px;line-height:19px;color:var(--text);min-width:90px;max-width:100%;overflow-wrap:anywhere;word-break:normal}
.msg.in:not(.first) .bubble{border-top-left-radius:6px}
.msg.out .bubble{background:var(--out);border-radius:var(--bubble-radius) var(--bubble-radius) 6px var(--bubble-radius)}
.msg.out:not(.first) .bubble{border-top-right-radius:6px}
/* Own messages: white on the logo green. Everything inside the bubble reads these
   tokens, so quotes, files, polls and voice messages follow without own rules. */
.msg.out .bubble,.star-bubble.out,.wall-preview .bubble.out{--text:#fff;--text-2:rgba(255,255,255,.8);--text-3:rgba(255,255,255,.62);--meta:rgba(255,255,255,.74);--icon:rgba(255,255,255,.92);--icon-2:rgba(255,255,255,.74);--link:#d4f1e4;--green:#e3cf8e;--green-text:#fff;--quote-in:rgba(0,0,0,.16);--bg-2:rgba(255,255,255,.12);--danger:#ffc2c9;--tick-read:#e8d59a;--border-2:rgba(255,255,255,.35);color:var(--text)}
.msg.out .bubble.emoji-only{--tick:#76857f;--tick-read:#9a7a22}
:root[data-theme=dark] .msg.out .bubble.emoji-only{--tick:#9aa9a2;--tick-read:#d8c27f}
.msg.out .quote .q-name{color:#fff!important}
.msg.out .quote .bar{background:var(--gold)!important}
.bubble .sender{font-size:12.8px;font-weight:700;line-height:22px;margin-top:-3px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.bubble .fwd{display:flex;align-items:center;gap:3px;font-size:12.8px;font-style:italic;color:var(--text-2);margin:-2px 0 2px}
.bubble .fwd svg{width:14px;height:14px;fill:currentColor}
.bubble .text{white-space:pre-wrap}
.bubble .text a{color:var(--link);font-weight:600;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}
.bubble .text a:hover{text-decoration-thickness:2px}
.bubble .text code{font-family:Consolas,"Courier New",monospace;font-size:13px}
.bubble .spacer{display:inline-block;height:1px;vertical-align:baseline}
.bubble .deleted{color:var(--text-2);font-style:italic;display:inline}
.bubble .deleted svg{display:inline-block;width:15px;height:15px;fill:currentColor;vertical-align:-3px;margin-right:5px}
.bubble .failed{color:var(--danger);font-style:italic;font-size:13px;margin-top:2px}
.meta{position:absolute;right:10px;bottom:4px;display:flex;align-items:center;gap:3px;font-size:11px;font-weight:500;line-height:15px;color:var(--meta);white-space:nowrap;pointer-events:none}
.msg.out .meta{color:var(--meta-out)}
.meta .edited{margin-right:2px}
.meta svg{width:16px;height:16px;fill:var(--tick);color:var(--tick)}
.meta svg.ln{stroke-width:2.2}
.meta svg.read{fill:var(--tick-read);color:var(--tick-read)}
.meta svg.star{width:12px;height:12px;fill:currentColor;color:inherit}
.meta svg.clock{width:13px;height:13px;fill:currentColor;color:inherit}
.meta svg.err{fill:var(--danger);color:var(--danger)}
.bubble.emoji-only{background:transparent!important;box-shadow:none;padding:0 0 18px;min-width:0}
.bubble.emoji-only::before{display:none}
.bubble.emoji-only .text{font-size:44px;line-height:52px}
.bubble.emoji-only.n2 .text{font-size:38px;line-height:46px}
.bubble.emoji-only.n3 .text{font-size:32px;line-height:40px}
.bubble.emoji-only .meta{bottom:0;right:0;background:var(--system);color:var(--system-text);padding:1px 6px;border-radius:9px;box-shadow:var(--bubble-shadow)}
.bubble.emoji-only .sender{display:none}
.quote{display:flex;border-radius:10px;background:var(--quote-in);margin:0 -4px 6px -6px;overflow:hidden;cursor:pointer;min-height:42px;max-width:100%}
.msg.out .quote{background:var(--quote-out)}
.quote .bar{width:4px;flex:none;background:var(--green)}
/* The quote reaches 10 px into the bubble padding (negative margins); its max-width
   must allow that, otherwise short quotes wrap ("Nachricht / 1"). */
.bubble .quote{max-width:calc(100% + 10px)}
.quote .q-body{flex:1 1 auto;min-width:0;padding:5px 10px 6px 8px}
.quote .q-name{font-size:12.8px;font-weight:700;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quote .q-text{font-size:13.2px;color:var(--text-2);line-height:18px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-wrap}
.quote .q-text svg{display:inline-block;width:14px;height:14px;fill:currentColor;vertical-align:-2px;margin-right:2px}
.quote .q-thumb{width:52px;flex:none;background:var(--bg-2) center/cover}
.reactions{position:absolute;bottom:-25px;display:flex;align-items:center;gap:2px;padding:2px 7px;border-radius:12px;background:var(--bg);box-shadow:0 1px 3px rgba(17,32,27,.16);font-size:14px;line-height:20px;cursor:pointer;z-index:2;border:1.5px solid var(--chat-bg)}
:root[data-theme=dark] .reactions{background:#1e2a26}
.msg.in .reactions{left:8px}
.msg.out .reactions{right:8px}
.reactions .n{font-size:12px;color:var(--text-2);margin-left:2px}
.reactions .mine{filter:none}
.hover-actions{position:absolute;top:50%;transform:translateY(-50%);display:flex;gap:2px;opacity:0;transition:opacity .12s;z-index:3}
.msg.in .hover-actions{left:calc(100% + 6px)}
.msg.out .hover-actions{right:calc(100% + 6px)}
.msg:hover .hover-actions,.hover-actions:focus-within{opacity:1}
.hover-actions button{width:30px;height:30px;border-radius:50%;background:rgba(11,20,26,.28);color:#fff;display:flex;align-items:center;justify-content:center}
:root[data-theme=dark] .hover-actions button{background:rgba(233,237,239,.18)}
.hover-actions svg{width:18px;height:18px;fill:currentColor}
.bubble-menu{position:absolute;top:2px;right:3px;width:28px;height:24px;border-radius:0 16px 0 14px;display:flex;align-items:center;justify-content:center;color:var(--icon-2);opacity:0;transition:opacity .12s;z-index:2}
.msg.in .bubble-menu{background:radial-gradient(at top right,var(--in) 60%,transparent 80%)}
.msg.out .bubble-menu{background:radial-gradient(at top right,var(--out) 60%,transparent 80%)}
.msg:hover .bubble-menu{opacity:1}
.bubble-menu svg{width:20px;height:20px;fill:currentColor}
/* Emoji-only and media bubbles have no plain background behind the chevron. */
.bubble.emoji-only .bubble-menu,.bubble.media .bubble-menu{background:rgba(11,20,26,.35)!important;color:#fff;border-radius:50%;width:24px;height:24px;top:4px;right:4px}
.msg .swipe-reply{position:absolute;left:10px;top:50%;margin-top:-16px;width:32px;height:32px;border-radius:50%;background:rgba(11,20,26,.18);color:#fff;display:flex;align-items:center;justify-content:center;opacity:0;transform:scale(.5)}
.msg .swipe-reply svg{width:18px;height:18px;fill:currentColor}
/* media inside bubbles */
.bubble.media{padding:3px}
.bubble.media .sender{padding:4px 6px 0}
.bubble.media .fwd{padding:4px 6px 0}
.bubble.media .quote{margin:0 0 3px;max-width:100%}
/* Width + aspect-ratio come from chat.mjs; the photo shrinks with a narrow bubble. */
.photo{position:relative;display:block;border-radius:15px;overflow:hidden;cursor:pointer;background:rgba(17,32,27,.08) center/cover no-repeat;min-width:0;max-width:min(330px,100%)}
.photo img,.photo video{display:block;width:100%;height:100%;object-fit:cover}
.photo .spin{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
.photo .play{position:absolute;left:50%;top:50%;width:56px;height:56px;margin:-28px 0 0 -28px;border-radius:50%;background:rgba(11,20,26,.55);color:#fff;display:flex;align-items:center;justify-content:center}
.photo .play svg{width:34px;height:34px;fill:currentColor}
.photo .vlen{position:absolute;left:8px;bottom:5px;color:#fff;font-size:11.5px;display:flex;align-items:center;gap:3px;text-shadow:0 1px 2px rgba(0,0,0,.5)}
.photo .vlen svg{width:15px;height:15px;fill:currentColor}
.photo .gif{position:absolute;left:8px;top:8px;background:rgba(11,20,26,.55);color:#fff;font-size:11px;font-weight:700;padding:2px 6px;border-radius:4px}
.bubble.media.no-caption .meta{color:#fff;background:linear-gradient(to top,rgba(9,16,13,.5),rgba(9,16,13,0));right:3px;bottom:3px;left:auto;padding:14px 9px 4px 26px;border-radius:0 0 15px 0}
.msg.out .bubble.media.no-caption .meta{border-bottom-right-radius:5px}
.bubble.media.no-caption .meta svg{fill:#fff;color:#fff}
.bubble.media.no-caption .meta svg.read{fill:#e8d59a;color:#e8d59a}
.bubble.media .caption{padding:6px 6px 8px 6px}
.spinner{width:42px;height:42px;border-radius:50%;border:3px solid rgba(255,255,255,.35);border-top-color:#fff;animation:spin 1s linear infinite;background:rgba(11,20,26,.35)}
.spinner.dark{border-color:rgba(11,20,26,.15);border-top-color:var(--green);background:transparent}
@keyframes spin{to{transform:rotate(360deg)}}
.doc{display:flex;align-items:center;gap:10px;min-width:240px;max-width:330px;padding:10px 12px;border-radius:12px;background:var(--quote-in);margin-bottom:4px;cursor:pointer}
.msg.out .doc{background:var(--quote-out)}
.doc .doc-ico{width:34px;height:40px;border-radius:6px;flex:none;display:flex;align-items:flex-end;justify-content:center;color:#fff;font-size:9px;font-weight:800;padding-bottom:5px;position:relative;background:#76857f}
.doc .doc-ico::before{content:'';position:absolute;right:0;top:0;border-style:solid;border-width:0 10px 10px 0;border-color:transparent rgba(255,255,255,.5) transparent transparent}
.doc .doc-ico.pdf{background:#e2574c}
.doc .doc-ico.txt{background:#5c6bc0}
.doc .doc-ico.zip{background:#ef9a2c}
.doc .doc-ico.audio{background:#f57c00}
.doc .doc-body{flex:1;min-width:0}
.doc .doc-name{display:block;font-size:14.2px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.doc .doc-sub{font-size:12px;color:var(--text-2)}
.doc .dl{width:34px;height:34px;border-radius:50%;border:1.5px solid var(--icon-2);color:var(--icon-2);display:flex;align-items:center;justify-content:center;flex:none}
.doc .dl svg{width:20px;height:20px;fill:currentColor}
/* Document without caption: the time sits right under the card. */
.bubble.doc-only .doc{margin-bottom:14px}
.voice{display:flex;align-items:center;gap:10px;width:300px;max-width:100%;padding:4px 2px 14px 2px}
.voice .v-av{position:relative;flex:none}
.voice .v-av .mic{position:absolute;right:-5px;bottom:-3px;width:20px;height:20px;border-radius:7px;background:var(--in);color:var(--green-text);display:flex;align-items:center;justify-content:center}
.msg.out .voice .v-av .mic{background:var(--out);color:var(--gold)}
.voice .v-av .mic svg{width:15px;height:15px;fill:currentColor}
.voice.played .v-av .mic{color:var(--gold-text)}
.msg.out .voice.played .v-av .mic{color:#fff}
.voice .v-play{width:40px;height:40px;border-radius:20px;flex:none;display:flex;align-items:center;justify-content:center;background:var(--green);color:#fff}
.msg.out .voice .v-play{background:#fff;color:#195b4b}
.voice .v-play svg{width:22px;height:22px;fill:currentColor}
.voice .v-track{flex:1;min-width:0;position:relative;height:34px}
.voice canvas{position:absolute;left:0;right:0;top:4px;width:100%;height:26px}
.voice input[type=range]{position:absolute;left:-6px;right:-6px;top:6px;width:calc(100% + 12px);height:22px;margin:0;opacity:0;cursor:pointer}
.voice .v-dot{position:absolute;top:12px;width:12px;height:12px;border-radius:50%;background:var(--green);margin-left:-6px;pointer-events:none;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.voice .v-time{position:absolute;left:0;bottom:-14px;font-size:11px;color:var(--meta)}
.voice .v-speed{flex:none;height:22px;min-width:34px;padding:0 6px;border-radius:11px;background:rgba(17,32,27,.3);color:#fff;font-size:12px;font-weight:700}
.msg.out .voice .v-speed{background:rgba(255,255,255,.2)}
.audio-file{display:flex;align-items:center;gap:10px}
/* ---------- Scroll to bottom ---------- */
.to-bottom{position:absolute;right:20px;bottom:86px;width:42px;height:42px;border-radius:14px;background:var(--bg);color:var(--icon);box-shadow:0 2px 8px rgba(17,32,27,.18);display:flex;align-items:center;justify-content:center;z-index:6;transition:transform .15s,opacity .15s}
.to-bottom .badge{position:absolute;top:-8px;left:-6px}
.to-bottom.hide{opacity:0;transform:scale(.6);pointer-events:none}
/* Drop zone while files are dragged over the chat (desktop). */
.drop-zone{position:absolute;inset:68px 0 0;z-index:9;display:none;align-items:center;justify-content:center;background:rgba(243,245,241,.94);pointer-events:none}
:root[data-theme=dark] .drop-zone{background:rgba(9,16,13,.92)}
.chat-view.dragging .drop-zone{display:flex}
.drop-zone>div{display:flex;flex-direction:column;align-items:center;gap:14px;padding:44px 64px;border:2px dashed var(--green);border-radius:22px;color:var(--text-2);font-size:17px;font-weight:600}
.drop-zone svg{width:56px;height:56px;fill:var(--green);color:var(--green)}

/* ---------- Composer ---------- */
.composer{position:relative;flex:none;display:flex;flex-direction:column;padding:0 16px 12px;z-index:5}
/* The reply/edit preview and the input form one rounded field. */
.composer .pre{display:flex;align-items:stretch;background:var(--input);border-radius:24px 24px 0 0;margin:0;padding:8px 8px 2px;box-shadow:0 -1px 2px rgba(17,32,27,.05)}
.composer .pre+.c-row{border-top-left-radius:0;border-top-right-radius:0}
.composer .pre .quote{flex:1;margin:0;background:var(--bg-2);cursor:default}
.composer .pre .icon-btn{align-self:center;margin-left:6px}
.composer .pre.edit .quote .bar{background:var(--gold)}
.c-row{display:flex;align-items:flex-end;gap:8px;min-height:52px;background:var(--input);border-radius:26px;padding:6px 8px;box-shadow:0 1px 3px rgba(17,32,27,.1);position:relative;z-index:1}
.c-row .icon-btn{width:40px;height:40px;color:var(--icon-2)}
.c-row .icon-btn.on{color:var(--green-text)}
.c-input{flex:1;min-width:0;align-self:center;max-height:132px;overflow-y:auto;border:0;outline:0;background:transparent;resize:none;font-size:15px;font-weight:500;line-height:20px;padding:10px 4px;color:var(--text);scrollbar-width:thin}
.c-input::placeholder{color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.c-camera,.c-attach-m{display:none}
/* touch-action:none: holding the mic and sliding up/left must not become a scroll. */
.c-send{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--icon-2);flex:none;transition:background .15s,transform .1s;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.c-send.send{background:var(--green);color:#fff}
.c-send:active{transform:scale(.94)}
.c-send svg{width:23px;height:23px;fill:currentColor}
.c-record{display:flex;align-items:center;gap:10px;flex:1;min-width:0;min-height:40px;align-self:center;padding:0 6px;color:var(--text)}
.c-record .rec-dot{width:10px;height:10px;border-radius:50%;background:var(--danger);animation:pulse 1s infinite}
@keyframes pulse{50%{opacity:.25}}
.c-record .rec-time{font-variant-numeric:tabular-nums;min-width:44px;font-size:16px}
.c-record .rec-hint{flex:1;color:var(--text-2);font-size:14.5px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;justify-content:center;gap:4px}
.c-record .rec-hint svg{width:18px;height:18px;fill:currentColor}
.c-record canvas{flex:1 1 0;width:0;height:28px;min-width:40px;color:var(--icon-2)}
.c-record audio{display:none}
.c-record .rec-play{color:var(--icon)}
.rec-lock{position:absolute;right:8px;bottom:62px;width:40px;height:88px;border-radius:20px;background:var(--bg);box-shadow:var(--shadow);display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding-top:10px;color:var(--icon);z-index:3;gap:6px}
.rec-lock svg{width:20px;height:20px;fill:currentColor}
.rec-lock .up{animation:up 1.2s infinite}
@keyframes up{50%{transform:translateY(-6px)}}
.attach-menu{position:absolute;left:10px;bottom:70px;min-width:220px;background:var(--menu);border-radius:16px;box-shadow:var(--shadow);padding:8px;z-index:8;display:flex;flex-direction:column}
.attach-menu button{display:flex;align-items:center;gap:14px;height:44px;padding:0 12px;border-radius:10px;font-size:14.5px;color:var(--text);text-align:left}
.attach-menu button:hover{background:var(--hover)}
.attach-menu .dot{width:30px;height:30px;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#fff}
.attach-menu .dot svg{width:17px;height:17px;fill:currentColor}
/* Attachment colours: calm tones that differ in lightness, not only in hue. */
.dot.d-doc{background:#5a3ea6}.dot.gal{background:#1e5a96}.dot.cam{background:#9b2c3f}.dot.aud{background:#b0601e}.dot.gif{background:#195b4b}.dot.contact{background:#2d7f9a}
.emoji-panel{height:320px;display:flex;flex-direction:column;background:var(--bg);border-radius:20px;box-shadow:var(--shadow);margin-bottom:8px;overflow:hidden}
.ep-tabs{display:flex;align-items:center;gap:2px;padding:6px 8px 0;border-bottom:1px solid var(--border);flex:none}
.ep-tabs button{height:36px;min-width:40px;padding:0 10px;border-bottom:3px solid transparent;color:var(--icon-2);display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600}
.ep-tabs button.on{color:var(--green-text);border-bottom-color:var(--green)}
.ep-tabs .grow{flex:1}
.ep-cats{display:flex;justify-content:space-between;padding:0 10px;border-bottom:1px solid var(--border);flex:none}
.ep-cats button{flex:1;height:38px;display:flex;align-items:center;justify-content:center;color:var(--icon-2);border-bottom:3px solid transparent;font-size:18px;filter:grayscale(1);opacity:.7}
.ep-cats button.on{border-bottom-color:var(--green);filter:none;opacity:1}
.ep-search{padding:8px 10px 4px;flex:none}
.ep-search .search{height:34px}
.ep-grid{flex:1;overflow-y:auto;padding:4px 8px 10px;scrollbar-width:thin}
.ep-grid h4{margin:10px 6px 4px;font-size:13px;color:var(--text-2);font-weight:500}
.ep-grid .cells{display:grid;grid-template-columns:repeat(auto-fill,minmax(40px,1fr))}
.ep-grid .cells button{height:40px;font-size:27px;line-height:40px;border-radius:8px;font-family:"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif}
.ep-grid .cells button:hover{background:var(--hover)}
.ep-grid .gifs{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:6px}
.ep-grid .gifs button{aspect-ratio:1;border-radius:8px;overflow:hidden;background:var(--bg-2)}
.ep-grid .gifs img{width:100%;height:100%;object-fit:cover;display:block}
.ep-grid .sali-faces{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:4px}
.ep-grid .sali-faces button{padding:6px;border-radius:10px}
.ep-grid .sali-faces button:hover{background:var(--hover)}
.sali-emoji{display:inline-block;width:1.35em;height:1.35em;vertical-align:-.3em}
.sali-emoji svg{width:100%;height:100%}

/* ---------- Drawers (sidebar pages) & right panel ---------- */
.drawer{position:absolute;inset:0;background:var(--bg);display:flex;flex-direction:column;z-index:6;animation:slideIn .18s ease-out}
.drawer.back-out{animation:slideOut .16s ease-in forwards}
@keyframes slideIn{from{transform:translateX(-30%);opacity:.3}to{transform:none;opacity:1}}
@keyframes slideOut{to{transform:translateX(-30%);opacity:0}}
.d-head{display:flex;align-items:center;gap:10px;height:68px;padding:0 12px 0 10px;flex:none;background:var(--bg)}
.d-head h2{flex:1;margin:0;font-size:20px;font-weight:800;letter-spacing:-.015em;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.d-head .sub{display:block;font-size:13px;color:var(--text-2);font-weight:500;letter-spacing:0}
.d-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin}
.panel .d-head{border-bottom:1px solid var(--border)}
/* Rows of the pages: the icon sits in a soft tile (svg padding + background). */
.item{display:flex;align-items:center;gap:16px;min-height:64px;padding:10px 18px 10px 20px;width:100%;text-align:left;color:var(--text);position:relative}
button.item:hover,label.item:hover{background:var(--hover);cursor:pointer}
.item>svg:first-child{width:38px;height:38px;padding:9px;border-radius:12px;background:var(--green-soft);fill:var(--green-text);color:var(--green-text);flex:none}
.item>svg:not(:first-child){fill:var(--icon-2);color:var(--icon-2);flex:none}
.item .i-body{flex:1;min-width:0}
.item .i-title{font-size:15.5px;font-weight:600;display:block;line-height:21px}
.item .i-sub{font-size:13px;font-weight:500;color:var(--text-2);display:block;line-height:18px;margin-top:2px;overflow-wrap:anywhere}
.item.danger{color:var(--danger)}
.item.danger>svg:first-child{color:var(--danger);fill:var(--danger);background:color-mix(in srgb,var(--danger) 13%,transparent)}
.item .i-end{color:var(--text-2);font-size:14px;flex:none}
.item.compact{min-height:56px}
.item .ico-space{width:38px;flex:none}
a.item{text-decoration:none}
.item .i-sub.key{font-family:Consolas,"Courier New",monospace;font-size:12px}
.item.me-item{min-height:96px}
.item.me-item .i-title{font-size:18px;font-weight:800;letter-spacing:-.01em}
.settings-foot{padding-bottom:30px}
.sep{height:12px;background:var(--bg-3)}
.group-title{padding:18px 20px 6px;color:var(--text-2);font-size:13px;font-weight:700}
.group-title.green{color:var(--green-text)}
.switch{position:relative;width:46px;height:28px;flex:none}
.switch input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer;z-index:1}
.switch span{position:absolute;inset:0;border-radius:14px;background:var(--border-2);transition:background .15s}
.switch span::after{content:'';position:absolute;left:3px;top:3px;width:22px;height:22px;border-radius:11px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .15s}
.switch input:checked+span{background:var(--green)}
.switch input:checked+span::after{transform:translateX(18px)}
.switch input:focus-visible+span{outline:2px solid var(--green);outline-offset:3px}
/* Settings start page: profile card and grouped cards on a soft ground. */
.drawer.settings-page,.drawer.settings-page .d-head{background:var(--bg-3)}
.settings-page .card-group{margin:0 16px 14px;border-radius:20px;background:var(--bg);overflow:hidden;box-shadow:var(--card-shadow)}
.settings-page .card-group .item{min-height:60px;padding:9px 16px 9px 14px;gap:14px}
.settings-page .card-group .item+.item::before{content:'';position:absolute;top:0;left:66px;right:0;border-top:1px solid var(--border)}
.settings-page .card-group .item>svg:first-child{width:36px;height:36px;padding:8px;border-radius:11px}
.settings-page .card-group .item .i-sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.settings-page .card-group button.item:not(.danger)::after{content:'';width:18px;height:18px;flex:none;background:var(--text-3);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 6 6 6-6 6' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 6 6 6-6 6' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat}
.settings-page .card-group .item.me-item{min-height:92px;padding:14px}
.settings-page .card-group .item.me-item .avatar{width:62px;height:62px;font-size:62px}
.settings-page .card-group .item.gold>svg:first-child{background:var(--gold-soft);color:var(--gold-text);fill:var(--gold-text)}
.settings-page .settings-foot{padding:8px 24px 30px}
.radio-list label{display:flex;align-items:center;gap:18px;padding:14px 24px;cursor:pointer;font-size:16px;font-weight:500}
.radio-list label:hover{background:var(--hover)}
.radio-list input{width:20px;height:20px;accent-color:var(--green);margin:0}
.profile-hero{display:flex;flex-direction:column;align-items:center;padding:28px 20px 20px;background:var(--bg)}
.profile-hero .avatar{cursor:pointer}
.profile-hero .cam{position:relative}
.profile-hero .cam .overlay{position:absolute;inset:0;border-radius:35%;background:rgba(9,16,13,.55);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;opacity:0;transition:opacity .15s;font-size:12.5px;text-transform:uppercase;text-align:center;gap:6px;cursor:pointer;padding:30px}
.profile-hero .cam:hover .overlay,.profile-hero .cam .overlay:focus-visible{opacity:1}
/* The overlay text is not drawn over large initials. */
.profile-hero .cam:hover .avatar .ini,.profile-hero .cam:focus-within .avatar .ini{visibility:hidden}
.profile-hero .cam .overlay svg{width:24px;height:24px;fill:currentColor}
.profile-hero h3 .title-edit{display:inline-flex;vertical-align:middle;margin-left:4px}
.profile-hero .help-logo{border-radius:26px}
.lock-hero{width:96px;height:96px;border-radius:30px;background:var(--green-soft);display:flex;align-items:center;justify-content:center;color:var(--green-text)}
.lock-hero svg{width:48px;height:48px;fill:currentColor}
.profile-hero .cam .fab-cam{position:absolute;right:-4px;bottom:-4px;width:46px;height:46px;border-radius:16px;background:var(--green);color:#fff;display:none;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(25,91,75,.3);border:3px solid var(--bg)}
.profile-hero h3{margin:16px 0 2px;font-size:22px;font-weight:800;letter-spacing:-.01em;text-align:center;overflow-wrap:anywhere}
.profile-hero .p-sub{color:var(--text-2);font-size:15px;font-weight:500;text-align:center}
.hero-actions{display:flex;justify-content:center;gap:12px;padding:6px 16px 18px}
.hero-actions button{width:96px;height:70px;border:0;background:var(--bg-2);border-radius:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:var(--green-text);font-size:13px;font-weight:700}
.hero-actions button:hover{background:var(--hover)}
.hero-actions svg{width:24px;height:24px;fill:currentColor}
.edit-line{display:flex;align-items:flex-end;gap:8px;padding:6px 24px 18px}
.edit-line .field{flex:1;margin:0}
.media-strip{display:flex;gap:6px;padding:0 24px 16px;overflow:hidden}
.media-strip .thumb{width:84px;height:84px;border-radius:14px;background:var(--bg-2) center/cover;flex:none;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--icon-2)}
.media-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:3px;padding:3px}
.media-grid .thumb{aspect-ratio:1;background:var(--bg-2) center/cover;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;color:var(--icon-2)}
.media-grid .thumb .vl{position:absolute;left:6px;bottom:4px;color:#fff;font-size:11.5px;display:flex;gap:3px;align-items:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}
.media-grid .thumb .vl svg{width:14px;height:14px;fill:currentColor}
.tabs-inline{display:flex;border-bottom:1px solid var(--border);flex:none}
.tabs-inline button{flex:1;height:48px;color:var(--text-2);font-weight:600;border-bottom:3px solid transparent;font-size:14.5px}
.tabs-inline button.on{color:var(--green-text);border-bottom-color:var(--green)}
.search-hit{display:block;width:100%;text-align:left;padding:12px 22px;border-bottom:1px solid var(--border);color:var(--text);text-decoration:none;overflow-wrap:anywhere}
.search-hit:hover{background:var(--hover)}
.search-hit small{display:block;color:var(--text-2);font-size:12.5px;margin-bottom:3px}
.search-hit mark{background:transparent;color:var(--green-text);font-weight:600}
.link-hit .host{display:block;font-size:14.5px;line-height:20px}
.link-hit .url{display:block;color:var(--link);font-size:13.5px;line-height:18px;margin-top:1px}
/* Starred messages: header line + the message as a bubble (pages.mjs). */
.star-list{min-height:100%;background:var(--chat-bg);padding:4px 0 24px}
.star-item{display:block;width:100%;text-align:left;padding:10px 16px 12px}
.star-item:hover{background:rgba(17,32,27,.04)}
:root[data-theme=dark] .star-item:hover{background:rgba(231,238,234,.04)}
.star-item:focus-visible{outline-offset:-2px}
.star-head{display:flex;align-items:center;gap:10px;min-width:0;margin-bottom:6px;color:var(--text)}
.star-who{flex:1;min-width:0;font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.star-date{flex:none;font-size:12px;color:var(--text-2)}
.star-head>svg{fill:var(--icon-2);color:var(--icon-2)}
.star-bubble{display:inline-flex;flex-direction:column;max-width:calc(100% - 38px);min-width:90px;margin-left:38px;padding:7px 10px 5px 12px;border-radius:var(--bubble-radius) var(--bubble-radius) var(--bubble-radius) 6px;background:var(--in);box-shadow:var(--bubble-shadow);font-size:14.2px;line-height:19px;color:var(--text)}
.star-bubble.out{background:var(--out);border-radius:var(--bubble-radius) var(--bubble-radius) 6px var(--bubble-radius)}
.star-text{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere}
.star-text svg{display:inline-block;width:16px;height:16px;fill:var(--icon-2);color:var(--icon-2);vertical-align:-3px;margin-right:3px}
.star-text .link{color:var(--link)}
.star-text code{font-family:Consolas,"Courier New",monospace;font-size:13px}
.star-bubble .meta{position:static;align-self:flex-end;margin-top:2px}
.star-bubble.out .meta{color:var(--meta-out)}
.star-foot{text-align:center}
.member-tag{font-size:11.5px;font-weight:700;color:var(--green-text);background:var(--green-soft);border-radius:6px;padding:1px 6px;margin-left:6px;flex:none}
.picked-strip{display:flex;flex-wrap:wrap;gap:8px;padding:8px 16px 4px;flex:none;max-height:120px;overflow-y:auto}
.picked-chip{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 4px 0 2px;border-radius:12px;background:var(--bg-2);font-size:14px;font-weight:600}
.picked-chip button{width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--icon-2)}
.picked-chip button svg{width:16px;height:16px;fill:currentColor}
.next-fab{position:absolute;right:24px;bottom:28px;width:58px;height:58px;border-radius:20px;background:var(--green);color:#fff;box-shadow:0 10px 22px rgba(25,91,75,.32);display:flex;align-items:center;justify-content:center;z-index:3}
.next-fab svg{width:26px;height:26px;fill:currentColor}
.code-box{margin:10px 24px;padding:14px;border-radius:14px;background:var(--bg-2);font-family:Consolas,"Courier New",monospace;font-size:15px;letter-spacing:.08em;line-height:1.8;text-align:center;word-spacing:.5em;user-select:all}
.textarea-box{display:block;width:calc(100% - 48px);margin:6px 24px 10px;min-height:96px;border:1px solid var(--border-2);border-radius:12px;background:var(--bg);padding:10px;font-family:Consolas,"Courier New",monospace;font-size:12px;resize:vertical;color:var(--text)}
.pad{padding:8px 24px 16px}
.pad p{margin:0 0 10px;color:var(--text-2);line-height:1.55}
.row-actions{display:flex;flex-wrap:wrap;gap:10px;padding:4px 24px 18px}
.admin-row{display:flex;align-items:center;gap:12px;padding:10px 24px;border-bottom:1px solid var(--border)}
.admin-row .i-body{flex:1;min-width:0}
.admin-row .btn{height:32px;padding:0 12px;font-size:13px}

/* ---------- Overlay layer: menus, dialogs, sheets, toasts ---------- */
.layer{position:fixed;inset:0;pointer-events:none;z-index:40}
.layer>*{pointer-events:auto}
.scrim{position:fixed;inset:0;background:transparent}
.scrim.dim{background:var(--overlay);animation:fade .15s}
@keyframes fade{from{opacity:0}}
.menu{position:fixed;min-width:200px;max-width:300px;background:var(--menu);border-radius:18px;box-shadow:var(--shadow);padding:6px;z-index:2;animation:pop .12s ease-out;transform-origin:top right;max-height:calc(100vh - 20px);overflow-y:auto}
@keyframes pop{from{opacity:0;transform:scale(.92)}}
.menu button{display:flex;align-items:center;gap:14px;width:100%;height:44px;padding:0 14px;border-radius:12px;font-size:14.5px;font-weight:600;color:var(--text);text-align:left;white-space:nowrap}
.menu button:hover{background:var(--hover)}
.menu button svg{width:20px;height:20px;fill:var(--icon-2);color:var(--icon-2)}
.menu button.danger{color:var(--danger)}
.menu button.danger svg{fill:var(--danger);color:var(--danger)}
.menu hr{border:0;border-top:1px solid var(--border);margin:5px 8px}
.react-bar{position:fixed;display:flex;align-items:center;gap:2px;padding:5px 8px;background:var(--menu);border-radius:28px;box-shadow:var(--shadow);z-index:3;animation:pop .14s ease-out}
.react-bar button{width:42px;height:42px;border-radius:50%;font-size:27px;line-height:42px;transition:transform .12s,background .12s;font-family:"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif}
.react-bar button:hover{transform:scale(1.18)}
.react-bar button.mine{background:var(--bg-2)}
.react-bar .more{font-size:0;color:var(--icon-2);display:flex;align-items:center;justify-content:center;background:var(--bg-2)}
.react-bar .more svg{width:24px;height:24px;fill:currentColor}
.dialog{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,calc(100vw - 32px));max-height:calc(100vh - 40px);overflow:auto;background:var(--menu);border-radius:24px;box-shadow:0 20px 50px rgba(9,16,13,.25);padding:24px 24px 16px;z-index:2;animation:popc .16s ease-out}
@keyframes popc{from{opacity:0;transform:translate(-50%,-48%) scale(.96)}}
.dialog h3{margin:0 0 12px;font-size:19px;font-weight:800;letter-spacing:-.01em;color:var(--text)}
.dialog p{margin:0 0 14px;color:var(--text-2);line-height:1.55;font-size:14.5px}
.dialog .choices{display:flex;flex-direction:column;gap:4px;margin:4px 0 8px}
.dialog .choices label{display:flex;align-items:center;gap:14px;padding:10px 4px;cursor:pointer;font-size:15px;font-weight:500}
.dialog .choices input{width:20px;height:20px;accent-color:var(--green);margin:0}
.dialog .buttons{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:18px}
.dialog .list-pick{max-height:52vh;overflow-y:auto;margin:0 -24px;border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.dialog .list-pick .row{height:64px}
.dialog .list-pick .row .row-body{border:0}
.dialog.wide{width:min(680px,calc(100vw - 32px))}
.dialog pre.license{max-height:46vh;overflow:auto;margin:0 0 12px;padding:12px 14px;border-radius:12px;background:var(--bg-2);color:var(--text);font:12px/1.5 Consolas,"Courier New",monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.dialog h4.license-title{margin:14px 0 8px;font-size:15px;font-weight:700;color:var(--text)}
.check{width:22px;height:22px;border-radius:7px;border:2px solid var(--icon-2);flex:none;display:flex;align-items:center;justify-content:center;margin-left:8px}
.check.on{background:var(--green);border-color:var(--green)}
.check.on::after{content:'';width:12px;height:6px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg) translate(1px,-1px)}
.toasts{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:8px;z-index:60;pointer-events:none;width:max-content;max-width:calc(100vw - 32px)}
.toast{background:var(--toast);color:#fff;padding:12px 18px;border-radius:14px;font-size:14px;font-weight:500;box-shadow:var(--shadow);animation:toastIn .2s ease-out;pointer-events:auto;display:flex;align-items:center;gap:16px;max-width:560px}
:root[data-theme=dark] .toast{color:#0e1613}
.toast button{color:#e3cf8e;font-weight:800;font-size:13.5px}
:root[data-theme=dark] .toast button{color:#195b4b}
@keyframes toastIn{from{opacity:0;transform:translateY(10px)}}
/* Desktop: toasts bottom left over the chat list, never over the input (WhatsApp Web). */
@media (min-width:768px){.toasts{left:80px;transform:none;bottom:24px;align-items:flex-start;max-width:min(420px,calc(100vw - 96px))}}
/* Media viewer: opaque dark stage in both themes. */
.viewer{position:fixed;inset:0;background:#09100d;color:#e9edef;z-index:3;display:flex;flex-direction:column;animation:fade .15s}
.viewer~div>.menu,.viewer~div>.scrim{z-index:4}
.viewer-head{display:flex;align-items:center;gap:8px;height:60px;padding:0 12px 0 16px;flex:none;color:#e9edef}
.viewer-head .icon-btn{color:#aebac1}
.viewer-head .icon-btn:hover{background:rgba(233,237,239,.1)}
.viewer-head .v-who{flex:1;min-width:0;display:flex;align-items:center;gap:12px}
.viewer-head .v-meta{min-width:0;display:flex;flex-direction:column}
.viewer-head .v-who b,.viewer-head .v-who small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.viewer-head .v-who b{font-weight:700;font-size:15.5px;line-height:21px}
.viewer-head .v-who small{color:#8696a0;font-size:13px;line-height:18px}
.viewer-body{position:relative;flex:1;min-height:0;display:flex}
.viewer .v-nav{position:absolute;top:50%;margin-top:-22px;width:44px;height:44px;background:rgba(233,237,239,.1);color:#e9edef;z-index:1}
.viewer .v-nav:hover{background:rgba(233,237,239,.18)}
.viewer .v-nav:disabled{opacity:0;pointer-events:none}
.viewer .v-prev{left:16px}
.viewer .v-prev svg{transform:scaleX(-1)}
.viewer .v-next{right:16px}
.viewer-strip{display:flex;gap:6px;justify-content:safe center;padding:8px 16px 14px;overflow-x:auto;flex:none;border-top:1px solid rgba(233,237,239,.08);scrollbar-width:thin}
.viewer-strip .v-thumb{position:relative;width:56px;height:56px;flex:none;border-radius:12px;background:#1b2622 center/cover no-repeat;opacity:.55;border:2px solid transparent;color:#fff;display:flex;align-items:flex-end;justify-content:flex-start;padding:2px}
.viewer-strip .v-thumb svg{filter:drop-shadow(0 1px 1px rgba(0,0,0,.6))}
.viewer-strip .v-thumb:hover{opacity:.85}
.viewer-strip .v-thumb.on{opacity:1;border-color:var(--gold)}
.viewer-stage{flex:1;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:12px;touch-action:pan-x pan-y pinch-zoom}
.viewer-stage .spinner{flex:none}
.viewer-stage img,.viewer-stage video{max-width:100%;max-height:100%;object-fit:contain;box-shadow:0 10px 40px rgba(0,0,0,.25);transition:transform .15s;cursor:zoom-in}
.viewer-stage.zoomed{align-items:flex-start;justify-content:flex-start}
.viewer-stage.zoomed img{max-width:none;max-height:none;cursor:zoom-out}
.viewer-caption{text-align:center;padding:10px 20px 18px;color:#e9edef;font-size:15px;flex:none;white-space:pre-wrap}
.viewer-caption:empty{padding:0 0 12px}
.sheet{position:fixed;left:0;right:0;bottom:0;background:var(--menu);border-radius:26px 26px 0 0;box-shadow:var(--shadow);padding:10px 0 calc(10px + env(safe-area-inset-bottom));z-index:2;animation:sheetUp .18s ease-out;max-height:85vh;overflow-y:auto}
@keyframes sheetUp{from{transform:translateY(100%)}}
.sheet::before{content:'';display:block;width:40px;height:5px;border-radius:3px;background:var(--border-2);margin:0 auto 8px}
.sheet h3{margin:4px 24px 10px;font-size:17px;font-weight:800}
.sheet .grid-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:18px 8px;padding:10px 16px 16px}
.sheet .grid-actions button{display:flex;flex-direction:column;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--text-2)}
.sheet .grid-actions .dot{width:56px;height:56px;border-radius:19px;display:flex;align-items:center;justify-content:center;color:#fff}
.sheet .grid-actions .dot svg{width:26px;height:26px;fill:currentColor}
.preview{position:fixed;inset:0;z-index:3;background:var(--bg-2);display:flex;flex-direction:column;animation:fade .15s}
.preview-head{display:flex;align-items:center;gap:10px;height:60px;padding:0 12px;flex:none}
.preview-head b{flex:1;font-weight:700;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.preview-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:16px}
.preview-stage img,.preview-stage video{max-width:100%;max-height:100%;border-radius:12px;box-shadow:var(--shadow)}
.preview-stage .doc-big{display:flex;flex-direction:column;align-items:center;gap:12px;color:var(--text-2);text-align:center}
.preview-stage .doc-big .doc-ico{width:90px;height:110px;font-size:18px;border-radius:12px}
.preview-thumbs{display:flex;gap:8px;justify-content:center;padding:4px 16px 8px;flex:none;overflow-x:auto}
.preview-thumbs button{width:52px;height:52px;border-radius:12px;background:var(--bg) center/cover;border:3px solid transparent;flex:none;color:var(--icon-2);display:flex;align-items:center;justify-content:center;font-size:10px}
.preview-thumbs button.on{border-color:var(--green)}
.preview-foot{display:flex;align-items:flex-end;gap:10px;padding:10px 16px calc(14px + env(safe-area-inset-bottom));flex:none;max-width:900px;width:100%;margin:0 auto}
.preview-foot .c-row{flex:1}
.preview-foot .send-big{width:56px;height:56px;border-radius:50%;background:var(--green);color:#fff;display:flex;align-items:center;justify-content:center;flex:none;box-shadow:var(--shadow)}
.preview-foot .send-big svg{width:26px;height:26px;fill:currentColor}

/* ---------- Calls ---------- */
.call{position:fixed;inset:0;z-index:45;background:radial-gradient(ellipse at top,#1d4a3e 0%,#09100d 70%);color:#fff;display:flex;flex-direction:column;align-items:center;overflow:hidden}
.call video.remote{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#000}
.call video.remote.audio{display:none}
.call video.local{position:absolute;right:18px;bottom:130px;width:120px;height:170px;border-radius:12px;object-fit:cover;background:#111;box-shadow:0 6px 20px rgba(0,0,0,.4);z-index:2;transform:scaleX(-1)}
.call .c-top{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;padding:34px 20px 0;text-align:center;width:100%}
.call .c-e2e{display:flex;align-items:center;gap:6px;font-size:13px;color:rgba(255,255,255,.75);margin-bottom:22px}
.call .c-e2e svg{width:13px;height:13px;fill:currentColor}
.call .c-name{font-size:28px;font-weight:800;letter-spacing:-.02em;margin:0 0 6px;text-shadow:0 1px 4px rgba(0,0,0,.4)}
.call .c-status{font-size:16px;font-weight:500;color:rgba(255,255,255,.8);min-height:22px;text-shadow:0 1px 4px rgba(0,0,0,.4)}
.call .c-avatar{position:relative;z-index:1;margin-top:auto;margin-bottom:auto;border:4px solid rgba(255,255,255,.12);border-radius:35%}
.call.video-on .c-avatar{visibility:hidden}
.call .c-bar{position:relative;z-index:2;margin:auto 0 calc(34px + env(safe-area-inset-bottom));display:flex;gap:22px;padding:14px 26px;border-radius:40px;background:rgba(255,255,255,.1);backdrop-filter:blur(8px)}
.call .c-bar button{width:56px;height:56px;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;display:flex;align-items:center;justify-content:center}
.call .c-bar button.on{background:#fff;color:#11201b}
.call .c-bar button svg{width:26px;height:26px;fill:currentColor}
.call .c-bar .hang{background:#d92d3f}
.call .c-bar .accept{background:#2f8a70}
.call .c-bar button:disabled{opacity:.35}
.call .c-min{position:absolute;left:14px;top:14px;z-index:3;color:#fff}
.call .c-min:hover{background:rgba(255,255,255,.12)}
.call .c-note{position:relative;z-index:2;font-size:14px;color:#e3cf8e;padding:0 30px 12px;text-align:center}
.call-banner{position:fixed;left:0;right:0;top:0;height:34px;background:#195b4b;color:#fff;display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;z-index:44;cursor:pointer}
.call-banner svg{width:18px;height:18px;fill:currentColor}
.has-call-banner .main{top:34px}
/* Calls 0.6.1: own camera full screen until the other picture arrives, labelled
   answer buttons, device controls, desktop incoming-call card, ringing banner */
.call video.local.full{inset:0;right:auto;bottom:auto;width:100%;height:100%;border-radius:0;box-shadow:none;z-index:0}
.call video.local.back{transform:none}
.call.preview .c-avatar{visibility:hidden}
.call.preview .c-top,.call.video-on .c-top{background:linear-gradient(rgba(0,0,0,.35),transparent);padding-bottom:18px}
.call .c-bar.labelled{background:none;backdrop-filter:none;gap:64px;padding:14px 10px}
.call .c-act{display:flex;flex-direction:column;align-items:center;gap:8px;font-size:13.5px;color:rgba(255,255,255,.92)}
.call .c-bar.labelled button{width:64px;height:64px}
.call .c-bar.labelled button svg{width:30px;height:30px}
.call .c-menu{position:relative;z-index:3;margin:auto 0 10px;background:rgba(22,32,28,.97);border-radius:18px;padding:6px;min-width:240px;max-width:calc(100vw - 32px);box-shadow:0 6px 20px rgba(0,0,0,.4)}
.call .c-menu+.c-bar{margin-top:0}
.call .c-menu button{display:flex;align-items:center;gap:12px;width:100%;padding:10px 14px;border-radius:12px;color:#fff;font-size:14.5px;font-weight:600;text-align:left}
.call .c-menu button:hover{background:rgba(255,255,255,.08)}
.call .c-menu button.on{color:#e3cf8e}
.call .c-menu svg{width:20px;height:20px;fill:currentColor}
.call.card{inset:auto;top:72px;right:16px;width:400px;max-width:calc(100vw - 32px);height:auto;border-radius:22px;background:var(--menu);color:var(--text);box-shadow:var(--shadow);display:block;overflow:visible;animation:pop .16s ease-out}
.call.card video{display:none}
.call .c-card{display:flex;align-items:center;gap:14px;padding:16px 16px 14px}
.call .c-card-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.call .c-card-text b{font-size:16px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.call .c-card-text span{color:var(--text-2);font-size:13.5px}
.call .c-card-text small{display:flex;align-items:center;gap:4px;color:var(--text-3);font-size:12px;margin-top:3px}
.call .c-card-text small svg{width:11px;height:11px;fill:currentColor}
.call .c-card-actions{display:flex;gap:14px;flex:none}
.call .c-card .c-act{color:var(--text-2);font-size:12px;gap:4px}
.call .c-card .c-act button{width:46px;height:46px;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center}
.call .c-card .c-act svg{width:22px;height:22px;fill:currentColor}
.call .c-card .hang{background:#d92d3f}
.call .c-card .accept{background:#2f8a70}
.call-banner{cursor:default}
.call-banner .cb-main{display:flex;align-items:center;justify-content:center;gap:8px;height:100%;padding:0 12px;color:inherit;font:inherit;min-width:0}
.call-banner .cb-main span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.call-banner .cb-no,.call-banner .cb-yes{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin-left:6px;flex:none}
.call-banner .cb-no{background:#d92d3f;color:#fff}
.call-banner .cb-yes{background:#fff;color:#195b4b}
.call-banner .cb-no svg,.call-banner .cb-yes svg{width:17px;height:17px}
.has-call-banner .unlock,.has-call-banner .auth{top:34px}

/* ---------- Phone layout (Android app and narrow windows) ---------- */
@media (max-width:767px){
 html,body{font-size:15px}
 .rail{display:none}
 .main{display:block}
 .side{position:absolute;inset:0;max-width:none;min-width:0;border:0}
 .chat{position:absolute;inset:0;z-index:7;transform:translateX(100%);transition:transform .22s cubic-bezier(.2,.8,.2,1);visibility:hidden}
 .main.chat-open .chat{transform:none;visibility:visible}
 .main.chat-open .side{visibility:hidden;transition:visibility 0s .22s}
 .panel{position:absolute;inset:0;z-index:9;max-width:none;min-width:0;border:0;animation:slideUp .2s ease-out}
 @keyframes slideUp{from{transform:translateX(100%)}}
 .chat-empty{display:none}
 /* Bottom navigation (list.mjs renderNav): Chats, Anrufe, Einstellungen. It stays
    over the chat list and its pages; those end above it. Hidden while a chat is open. */
 .main{--nav-h:calc(72px + env(safe-area-inset-bottom))}
 .side{padding-bottom:var(--nav-h)}
 .main:not(.chat-open) .side>.drawer{bottom:var(--nav-h)}
 .main.chat-open .side{padding-bottom:0}
 .bottom-nav{display:grid;position:absolute;left:0;right:0;bottom:0;height:var(--nav-h);z-index:9;grid-template-columns:repeat(3,minmax(0,1fr));padding:8px 8px calc(8px + env(safe-area-inset-bottom));background:var(--nav);border-top:1px solid var(--border)}
 .main.chat-open .bottom-nav{display:none}
 .bottom-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;color:var(--text-2);font-size:12.5px;font-weight:600}
 .bottom-nav .pill{position:relative;width:60px;height:32px;border-radius:16px;display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s}
 .bottom-nav .pill svg{width:23px;height:23px}
 .bottom-nav button.on{color:var(--text);font-weight:800}
 .bottom-nav button.on .pill{background:var(--green-soft);color:var(--green-text)}
 .bottom-nav .tab-badge{position:absolute;top:-5px;right:4px;min-width:20px;height:20px;box-sizing:border-box;padding:0 5px;border-radius:10px;background:var(--green-badge);color:var(--on-badge);border:2px solid var(--nav);font-size:10.5px;font-weight:800;display:flex;align-items:center;justify-content:center}
 .appbar{height:72px;padding:0 12px 0 18px;gap:8px}
 .appbar h1{font-size:28px}
 .appbar .icon-btn{width:44px;height:44px;border-radius:14px;background:var(--bg-2);color:var(--icon)}
 .appbar .icon-btn:hover{background:var(--active)}
 .appbar .new-chat{display:none}
 .appbar.select{gap:0;padding-left:4px}
 .appbar.select h1{font-size:22px;padding-left:6px}
 .appbar.select .icon-btn{width:44px;height:48px;border-radius:24px;background:none}
 .search-row{padding:2px 16px 10px}
 .search{height:46px;border-radius:16px}
 .chips{padding:2px 16px 10px}
 .chip{position:relative;height:36px;border-radius:18px;padding:0 16px}
 /* 44 px touch target around each 36 px chip (VM-25), same look. */
 .chip::after{content:'';position:absolute;left:-4px;right:-4px;top:-4px;bottom:-4px}
 .row{height:76px;padding:0 20px}
 .row>.avatar{width:54px;height:54px;font-size:54px;margin-right:14px}
 .row-menu{display:none}
 .archived-row{padding-left:34px}
 .fab{display:flex;position:absolute;right:18px;bottom:calc(var(--nav-h) + 18px);width:58px;height:58px;border-radius:20px;background:var(--green);color:#fff;align-items:center;justify-content:center;box-shadow:0 10px 22px rgba(25,91,75,.32);z-index:4;transition:transform .15s}
 :root[data-theme=dark] .fab{box-shadow:0 10px 24px rgba(0,0,0,.45)}
 .fab:active{transform:scale(.94)}
 .fab svg{width:26px;height:26px;fill:currentColor}
 .list{padding-bottom:96px}
 .drawer{z-index:8;animation:slideUp .2s ease-out}
 .drawer.back-out{animation:slideDown .16s ease-in forwards}
 @keyframes slideDown{to{transform:translateX(100%)}}
 .d-head{height:64px;padding:0 4px;gap:6px}
 /* The settings start page is a tab of the bottom navigation: large title, no back arrow. */
 .settings-page>.d-head{height:76px;padding:0 20px}
 .settings-page>.d-head>.icon-btn:first-child{display:none}
 .settings-page>.d-head h2{font-size:28px;letter-spacing:-.025em}
 .panel .d-head{border:0}
 .chat-head{height:64px;padding:0 4px 0 2px;gap:2px}
 .chat-head .back{display:flex;color:var(--icon)}
 .chat-head .who{gap:10px}
 .chat-head .icon-btn{color:var(--icon)}
 .chat-head .desk-only{display:none}
 .select-head,.find-head{height:64px}
 .find-head{gap:2px;padding:0 4px}
 .find-head .hits{min-width:40px}
 /* Touch targets of at least 44–48 px (VM-25). */
 .d-head .icon-btn,.row .call-actions .icon-btn{width:48px;height:48px}
 .chat-head .icon-btn,.select-head .icon-btn,.find-head .icon-btn{width:44px;height:48px;border-radius:24px}
 .chat-head .back{width:40px;min-width:40px}
 .select-head{gap:0}
 .picked-chip button{width:32px;height:32px;margin:-1px -4px -1px -2px}
 .voice .v-play{position:relative}
 .voice .v-play::after{content:'';position:absolute;inset:-5px}
 .reactions::after{content:'';position:absolute;left:-4px;right:-4px;top:-8px;bottom:-3px}
 .msg{padding:0 12px}
 .msg.in.grp{padding-left:6px}
 .msg-wrap{max-width:84%}
 .bubble{font-size:15.5px;line-height:21px}
 .bubble .sender{font-size:13.5px}
 .meta{font-size:11.5px}
 .hover-actions,.bubble-menu{display:none}
 .photo{max-width:min(300px,72vw,100%)}
 .voice{width:min(290px,72vw)}
 .doc{min-width:0;max-width:72vw}
 .to-bottom{right:14px;bottom:80px;width:42px;height:42px}
 .to-bottom::after{content:'';position:absolute;inset:-3px;border-radius:16px}
 .composer{padding:0 8px calc(10px + env(safe-area-inset-bottom))}
 .composer.panel-open{padding-bottom:0}
 .composer .pre{margin:0 60px 0 0;border-radius:24px 24px 0 0;padding:6px 6px 0;box-shadow:none}
 .composer .pre+.c-row .c-pill{border-top-left-radius:0;border-top-right-radius:0}
 .c-row{background:transparent;box-shadow:none;padding:0;min-height:52px;gap:8px;border-radius:0}
 .c-pill{flex:1;min-width:0;display:flex;align-items:flex-end;background:var(--input);border-radius:26px;min-height:52px;padding:0 4px;box-shadow:0 1px 3px rgba(17,32,27,.1)}
 :root[data-theme=dark] .c-pill{box-shadow:none}
 .c-pill .icon-btn{width:42px;height:52px;border-radius:21px;color:var(--icon-2)}
 .c-attach-d{display:none!important}
 .c-camera,.c-attach-m{display:inline-flex}
 .c-pill.has-text .c-camera{display:none}
 .c-input{padding:16px 4px;font-size:16px;line-height:20px}
 .c-send,.c-send.send{width:52px;height:52px;background:var(--green);color:#fff;box-shadow:0 6px 16px rgba(25,91,75,.3)}
 :root[data-theme=dark] .c-send,:root[data-theme=dark] .c-send.send{box-shadow:none}
 .c-record{background:var(--input);border-radius:26px;min-height:52px;padding:0 14px}
 .rec-lock{right:6px;bottom:64px}
 .attach-menu{display:none}
 .emoji-panel{height:min(300px,42vh);border-radius:0;box-shadow:none;margin:8px -8px 0;border-top:1px solid var(--border)}
 /* 44 px touch targets in the emoji panel tabs (VM-25), same look. */
 .ep-tabs button{position:relative;min-width:44px}
 .ep-tabs button::after{content:'';position:absolute;left:0;right:0;top:-6px;bottom:-2px}
 .ep-grid .cells{grid-template-columns:repeat(8,1fr)}
 .ep-grid .cells button{font-size:29px;height:44px}
 .dialog{border-radius:24px;padding:22px 22px 12px}
 .menu{min-width:210px;border-radius:18px}
 .menu button{height:48px;font-size:15.5px}
 .react-bar button{width:44px;height:44px;font-size:26px;line-height:44px}
 .toasts{bottom:96px}
 .call .c-bar{gap:18px;padding:12px 20px}
 .call .c-bar.labelled{gap:84px;padding:12px 10px}
 .profile-hero .cam .overlay{display:none}
 .profile-hero .cam .fab-cam{display:flex}
 .hero-actions button{width:30vw;max-width:110px}
 .auth::before,.unlock::before{height:0}
 .auth,.unlock{background:var(--bg)}
 .auth-top{color:var(--text);padding:32px 20px 0;justify-content:center;font-size:26px}
 .auth-top img{width:52px;height:52px;border-radius:16px}
 .auth-card{margin:6px 0 0;box-shadow:none;flex-direction:column;min-height:0;border-radius:0}
 .auth-intro{padding:12px 24px 0;align-items:center;text-align:center}
 .auth-intro h1{font-size:22px;font-weight:800;margin:0 0 10px;color:var(--text)}
 .auth-intro ol{display:none}
 /* Lock icon inline in the centred text (not detached on the left). */
 .auth-intro .note{margin-top:4px;display:block;text-align:center;line-height:1.45}
 .auth-intro .note svg{display:inline-block;vertical-align:-2px;margin-right:6px}
 .auth-form{border:0;padding:8px 24px 28px}
 .auth-form p.sub{margin-bottom:16px}
 .auth-form .field{margin-bottom:14px}
 .unlock-card{margin:28px 16px;box-shadow:none;padding:24px 20px}
 /* Viewer and send preview: dark stage on the phone. */
 .viewer{background:#000}
 .viewer-head{padding:0 2px 0 4px;gap:0}
 .viewer-head .v-who{gap:10px;margin-left:4px}
 .viewer-head .v-who small{color:rgba(255,255,255,.7)}
 .viewer-head .icon-btn{color:#fff;width:44px;height:48px;border-radius:24px}
 .preview{background:#09100d;color:#e7eeea}
 .preview-head,.preview-head .icon-btn{color:#e7eeea}
 .preview-foot .c-row{background:#1b2622;border-radius:26px;padding:0 16px;min-height:52px;align-items:center;box-shadow:none}
 .preview-foot .c-input{color:#e7eeea}
 .preview-foot .c-input::placeholder{color:#9aa9a2}
 .preview-thumbs button{background-color:#1b2622;color:#9aa9a2}
 .preview-stage .doc-big{color:#9aa9a2}
 .preview-stage .doc-big b{color:#e7eeea}
}
@media (min-width:768px){
 .sheet{left:50%;right:auto;width:420px;transform:translateX(-50%);bottom:24px;border-radius:24px}
 @keyframes sheetUp{from{opacity:0;transform:translate(-50%,20px)}}
 .c-pill{display:contents}
 .c-attach-d{order:-2}
 .c-emoji{order:-1}
}
@media (min-width:768px) and (max-width:1020px){
 .side{flex-basis:40%}
 .panel{position:absolute;right:0;top:0;bottom:0;width:360px;z-index:8;box-shadow:var(--shadow)}
}
/* Up to here the chat would shrink below ~410 px beside the info panel: it overlays instead. */
@media (min-width:1021px) and (max-width:1180px){
 .panel{position:absolute;right:0;top:0;bottom:0;width:min(400px,40vw);z-index:8;box-shadow:var(--shadow)}
}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* ---------- 0.6 phase B (client-ui): chat look, formatting, group and settings pages ---------- */
/* Chat look: util.mjs applyChatLook() sets data-wall / data-pattern / data-font on <html>.
   Every wallpaper colour has a light and a dark variant. */
:root{--wall-standard:#ebefe9;--wall-sand:#ede1cc;--wall-salbei:#dde7d5;--wall-himmel:#d7e6f0;--wall-lavendel:#e4dff0;--wall-rose:#f2e0df;--wall-nebel:#e2e6e8;--wall-petrol:#cfe3e0}
:root[data-theme=dark]{--wall-standard:#09100d;--wall-sand:#231e15;--wall-salbei:#15231a;--wall-himmel:#0f1f2c;--wall-lavendel:#1c1930;--wall-rose:#28181b;--wall-nebel:#161c20;--wall-petrol:#0c2524}
:root[data-wall=sand]{--chat-bg:var(--wall-sand)}
:root[data-wall=salbei]{--chat-bg:var(--wall-salbei)}
:root[data-wall=himmel]{--chat-bg:var(--wall-himmel)}
:root[data-wall=lavendel]{--chat-bg:var(--wall-lavendel)}
:root[data-wall=rose]{--chat-bg:var(--wall-rose)}
:root[data-wall=nebel]{--chat-bg:var(--wall-nebel)}
:root[data-wall=petrol]{--chat-bg:var(--wall-petrol)}
:root[data-pattern=off] .wall{display:none}
:root[data-font=small] .bubble{font-size:13px;line-height:17.5px}
:root[data-font=large] .bubble{font-size:16.5px;line-height:22px}
@media (max-width:767px){
 :root[data-font=small] .bubble{font-size:14px;line-height:19px}
 :root[data-font=large] .bubble{font-size:18px;line-height:24px}
}
/* Rich text: @mentions, "> " quotes, "- "/"1. " lists, `inline code`. */
.mention{color:var(--link);font-weight:700;cursor:pointer}
.md-quote{display:block;border-left:3px solid var(--text-3);padding:1px 0 1px 9px;margin:2px 0}
.md-list{display:block;margin:1px 0}
.md-li{display:flex;gap:6px}
.md-mark{flex:none;min-width:1.1em;text-align:right;color:var(--text-2)}
.md-body{flex:1;min-width:0}
code.inline{font-family:Consolas,"Courier New",monospace;padding:0 4px;border-radius:5px;background:rgba(17,32,27,.07)}
.bubble .text code.inline{font-size:.9em}
:root[data-theme=dark] code.inline,.msg.out code.inline{background:rgba(255,255,255,.14)}
/* Group pages, invite link, notices */
.avatar-slot{display:inline-flex}
.left-note{display:flex;align-items:flex-start;gap:12px;margin:0 16px 16px;padding:12px 14px;border-radius:14px;background:var(--bg-2);color:var(--text-2);font-size:14px;line-height:1.45}
.left-note svg{width:20px;height:20px;fill:var(--icon-2);color:var(--icon-2);flex:none;margin-top:1px}
.skipped-list{display:flex;flex-direction:column;gap:2px;margin:0 0 14px}
.skipped{display:flex;align-items:center;gap:12px;padding:6px 0}
.skipped .i-body{flex:1;min-width:0}
.skipped .i-title{display:block;font-size:15px;color:var(--text)}
.skipped .i-sub{display:block;font-size:13px;color:var(--text-2)}
.invite-head{display:flex;align-items:center;gap:16px;padding:20px 24px 8px}
.invite-head .i-body{flex:1;min-width:0}
.invite-head .i-title{display:block;font-size:17px;font-weight:700;color:var(--text)}
.invite-url{display:block;color:var(--link);font-size:14px;overflow-wrap:anywhere;user-select:all}
.invite-card{display:flex;flex-direction:column;align-items:center;text-align:center;margin-bottom:12px}
.invite-card h3{margin:12px 0 2px}
.invite-card .p-sub{color:var(--text-2);font-size:14px}
.dialog.photo-view{padding:0;overflow:hidden;width:min(512px,calc(100vw - 32px))}
.dialog.photo-view img{display:block;width:100%;height:auto;cursor:zoom-out}
.dialog p.help{font-size:13px;line-height:1.5;margin:-2px 0 12px}
.dialog .form-error{color:var(--danger);font-size:14px;margin:-6px 0 12px}
.dialog .buttons.stacked{flex-direction:column;align-items:flex-end;gap:2px}
.switch input:disabled{cursor:default}
.switch input:disabled+span{opacity:.5}
.item .i-sub.mail{color:var(--text);font-size:15px}
/* Einstellungen › Chats › Hintergrund */
.wall-preview{position:relative;height:210px;margin:16px 24px 8px;border-radius:20px;overflow:hidden;background:var(--chat-bg);border:1px solid var(--border);display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:12px}
.wall-preview .wall{-webkit-mask-size:300px;mask-size:300px}
.wall-preview .wp-day{position:relative;align-self:center;margin-bottom:auto;padding:4px 10px;border-radius:10px;background:var(--system);color:var(--system-text);font-size:12px;font-weight:700;box-shadow:var(--bubble-shadow)}
.wall-preview .bubble{max-width:80%;padding:7px 12px}
.wall-preview .bubble.out{align-self:flex-end;background:var(--out);border-radius:var(--bubble-radius) var(--bubble-radius) 6px var(--bubble-radius)}
.wall-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;padding:4px 24px 14px}
.wall-swatch{position:relative;aspect-ratio:3/4;border-radius:14px;border:1px solid var(--border-2);display:flex;align-items:center;justify-content:center;color:var(--text-2);font-size:12px;font-weight:600}
.wall-swatch.on{border:2px solid var(--green);color:var(--text)}
.wall-swatch svg{width:26px;height:26px;fill:var(--green);color:var(--green)}
.wall-swatch .ws-name{position:absolute;left:2px;right:2px;bottom:6px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wall-swatch[data-w=standard]{background:var(--wall-standard)}
.wall-swatch[data-w=sand]{background:var(--wall-sand)}
.wall-swatch[data-w=salbei]{background:var(--wall-salbei)}
.wall-swatch[data-w=himmel]{background:var(--wall-himmel)}
.wall-swatch[data-w=lavendel]{background:var(--wall-lavendel)}
.wall-swatch[data-w=rose]{background:var(--wall-rose)}
.wall-swatch[data-w=nebel]{background:var(--wall-nebel)}
.wall-swatch[data-w=petrol]{background:var(--wall-petrol)}
/* Einstellungen › Speicher verwalten */
.storage-head{padding:20px 24px 6px}
.storage-nums{display:flex;align-items:baseline;gap:8px;color:var(--text-2);font-size:14.5px}
.storage-nums b{font-size:28px;font-weight:800;letter-spacing:-.02em;color:var(--text)}
.usage-bar{display:flex;height:10px;border-radius:5px;background:var(--bg-2);overflow:hidden;margin:12px 0 10px}
.usage-bar span{flex:none;height:100%}
.u-files{background:var(--green)}
.u-legacy{background:var(--gold)}
.usage-legend{display:flex;flex-wrap:wrap;gap:6px 18px;font-size:13px;color:var(--text-2)}
.usage-legend .dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:6px}
.usage-legend .dot.u-free{background:var(--bg-2);box-shadow:inset 0 0 0 1px var(--border-2)}
.st-row{display:flex;align-items:center;gap:14px;width:100%;min-height:68px;padding:8px 16px 8px 20px;text-align:left;color:var(--text);border-bottom:1px solid var(--border)}
.st-row:hover{background:var(--hover)}
.st-row.on{background:var(--selected)}
.st-tile{width:48px;height:48px;border-radius:14px;flex:none;background:var(--bg-2) center/cover no-repeat;display:flex;align-items:center;justify-content:center;color:var(--icon-2)}
.st-tile svg{width:24px;height:24px;fill:currentColor}
.st-row .i-body{flex:1;min-width:0}
.st-row .i-title{display:block;font-size:15px;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.st-row .i-sub{display:block;font-size:13px;line-height:18px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.st-size{flex:none;font-size:13px;color:var(--text-2)}
.storage-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:10px 16px calc(10px + env(safe-area-inset-bottom)) 20px;background:var(--bg);border-top:1px solid var(--border);font-size:14.5px;color:var(--text)}
/* "@" in the chat list: an unread message mentions me (green also when muted) */
.badge.at{padding:0;font-size:13px;font-weight:700}
/* Phone: a page opened from inside a chat or its info (e.g. "Markierte Nachrichten",
   "Geräte ansehen") lies over them instead of opening hidden behind; back returns there. */
@media (max-width:767px){.main.chat-open .side:has(>.drawer){visibility:visible;z-index:10;transition:none}}

/* ---------- Chat features (client-chat, phase B) ---------- */
/* Pinned messages: bar under the header, pin in the bubble meta */
.pin-bar{display:flex;align-items:center;min-height:48px;padding-right:6px;background:var(--bg);border-bottom:1px solid var(--border);flex:none;position:relative;z-index:3}
.pin-main{flex:1;min-width:0;display:flex;align-items:center;gap:10px;min-height:48px;padding:0 8px 0 12px;text-align:left;color:var(--text)}
.pin-main:hover{background:var(--hover)}
.pin-segs{display:flex;flex-direction:column;gap:2px;width:3px;height:30px;flex:none}
.pin-segs span{flex:1;border-radius:2px;background:var(--border-2)}
.pin-segs span.on{background:var(--gold)}
.pin-ico{width:18px;height:18px;fill:var(--icon-2);transform:rotate(45deg)}
.pin-text{flex:1;min-width:0;display:flex;align-items:center;gap:4px;font-size:14px;color:var(--text-2)}
.pin-text>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pin-text svg{width:16px;height:16px;fill:currentColor;flex:none}
.pin-thumb{width:36px;height:36px;border-radius:9px;flex:none;background:var(--bg-2) center/cover}
.pin-bar .pin-more{width:36px;height:36px}
.meta svg.pin{width:12px;height:12px;fill:currentColor;color:inherit;transform:rotate(45deg)}
.sys.link{cursor:pointer}
.sys.link:hover{text-decoration:underline}
/* Albums: up to four tiles, "+N" on the last */
.bubble.album{padding:3px}
.album-grid{display:grid;grid-template-columns:1fr 1fr;gap:3px;width:min(330px,72vw);max-width:100%}
.album-grid .photo.tile{width:auto;max-width:none;aspect-ratio:1;border-radius:10px}
.album-grid.n3 .photo.tile:first-child{grid-column:1/-1;aspect-ratio:2/1}
.photo.tile .play{width:44px;height:44px;margin:-22px 0 0 -22px}
.photo.tile .play svg{width:28px;height:28px}
.album-cell{position:relative;min-width:0}
.album-cell .photo.tile{width:100%}
.album-more{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:10px;background:rgba(9,16,13,.5);color:#fff;font-size:30px;pointer-events:none}
.photo .hd{position:absolute;left:8px;top:8px;background:rgba(11,20,26,.55);color:#fff;font-size:11px;font-weight:700;padding:2px 6px;border-radius:4px}
.photo.gone{cursor:default}
.photo .gone-media{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:6px;padding:12px;text-align:center;background:rgba(11,20,26,.55);color:#fff;font-size:13px}
.photo .gone-media svg{fill:currentColor}
.doc.gone{cursor:default}
.doc.gone .doc-sub{font-style:italic}
/* Polls */
.bubble.poll-bubble{width:min(340px,78vw)}
.poll{padding:2px 1px 0}
.poll-q{font-size:15px;font-weight:700;line-height:20px;margin:0 0 4px;white-space:pre-wrap;color:var(--text)}
.poll-hint{display:flex;align-items:center;gap:4px;font-size:12.5px;color:var(--text-2);margin-bottom:6px}
.poll-hint svg{fill:currentColor}
.poll-opt{display:flex;align-items:flex-start;gap:10px;width:100%;padding:7px 0;text-align:left;color:var(--text)}
.poll-opt:disabled{opacity:1}
.poll-check{width:20px;height:20px;border-radius:50%;border:2px solid var(--icon-2);flex:none;display:flex;align-items:center;justify-content:center;margin-top:1px}
.poll-check.multi{border-radius:4px}
.poll-opt.on .poll-check{background:var(--green);border-color:var(--green);color:#fff}
.msg.out .poll-opt.on .poll-check{color:#195b4b}
.poll-check svg{fill:currentColor}
.poll-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.poll-line{display:flex;align-items:baseline;gap:8px}
.poll-text{flex:1;min-width:0;font-size:14.2px;line-height:19px;overflow-wrap:anywhere}
.poll-n{flex:none;font-size:13px;color:var(--text-2)}
.poll-bar{height:6px;border-radius:3px;background:rgba(17,32,27,.1);overflow:hidden}
:root[data-theme=dark] .poll-bar,.msg.out .poll-bar{background:rgba(255,255,255,.18)}
.poll-bar span{display:block;height:100%;border-radius:3px;background:var(--green);transition:width .2s}
.poll-votes{display:block;width:calc(100% + 22px);margin:22px -10px -6px -12px;padding:10px 0 4px;border-top:1px solid rgba(17,32,27,.1);color:var(--green-text);font-weight:700;font-size:14px;text-align:center}
:root[data-theme=dark] .poll-votes,.msg.out .poll-votes{border-top-color:rgba(255,255,255,.16)}
.poll-votes:disabled{color:var(--text-2);opacity:1}
.bubble.poll-bubble .meta{bottom:46px}
.dialog.poll-dialog .poll-sub{font-size:13px;color:var(--green-text);margin:4px 0 2px}
.dialog.poll-dialog .poll-options{max-height:40vh;overflow-y:auto;margin:0 -4px;padding:0 4px}
.dialog.poll-dialog .poll-option{margin:0 0 6px}
.dialog.poll-dialog .poll-multi{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0 4px;font-size:15px;color:var(--text);cursor:pointer}
.dialog .poll-q{color:var(--text);margin:0 0 8px}
.dialog .poll-detail{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin:14px 0 6px}
.dialog .poll-detail b{font-weight:500;color:var(--text)}
/* Contact cards */
.bubble.card-bubble{width:min(300px,76vw)}
.card-list .card+.card{border-top:1px solid rgba(17,32,27,.1)}
.card-top{display:flex;align-items:center;gap:12px;padding:6px 2px 24px}
.card-name{min-width:0;font-size:15px;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card-action{display:block;width:calc(100% + 22px);margin:0 -10px 0 -12px;padding:10px 0 4px;border-top:1px solid rgba(17,32,27,.1);color:var(--green-text);font-weight:700;text-align:center}
:root[data-theme=dark] .card-action,:root[data-theme=dark] .card-list .card+.card,.msg.out .card-action,.msg.out .card-list .card+.card{border-color:rgba(255,255,255,.16)}
.card-bubble:has(.card:last-child .card-action) .meta{bottom:42px}
/* @mentions: member list above the text field */
.mention-pop{position:absolute;left:16px;right:16px;bottom:100%;max-height:260px;overflow-y:auto;background:var(--menu);border-radius:18px;box-shadow:var(--shadow);padding:6px;z-index:9}
.mention-pop button{display:flex;align-items:center;gap:12px;width:100%;padding:7px 12px;border-radius:12px;text-align:left;color:var(--text)}
.mention-pop button.on,.mention-pop button:hover{background:var(--hover)}
.mention-pop .mp-body{display:flex;flex-direction:column;min-width:0}
.mention-pop .mp-name{font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mention-pop .mp-sub{font-size:12.5px;color:var(--text-2)}
.mention-pop .avatar svg{width:20px;height:20px;fill:currentColor}
/* Attachments: poll dot, HD switch, desktop camera */
.dot.poll{background:#8a6a12}
.hd-toggle{height:28px;min-width:40px;padding:0 8px;border-radius:14px;border:1.5px solid var(--icon-2);color:var(--icon);font-size:12.5px;font-weight:700;letter-spacing:.5px;flex:none}
.hd-toggle.on{background:var(--green);border-color:var(--green);color:#fff}
.camera{position:fixed;inset:0;z-index:3;background:#09100d;display:flex;flex-direction:column;animation:fade .15s}
.camera-head{display:flex;align-items:center;gap:10px;height:60px;padding:0 12px;color:#e9edef;flex:none}
.camera-head .icon-btn{color:#e9edef}
.camera-head .icon-btn:hover{background:rgba(233,237,239,.1)}
.camera-head b{font-weight:700;font-size:16px}
.camera-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:0 16px}
.camera-stage video{max-width:100%;max-height:100%;border-radius:16px;background:#000}
.camera-stage video.mirror{transform:scaleX(-1)}
.camera-foot{position:relative;display:flex;justify-content:center;padding:18px 0 calc(22px + env(safe-area-inset-bottom));flex:none}
.cam-shutter{width:68px;height:68px;border-radius:50%;background:var(--green);color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 5px rgba(233,237,239,.2);touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;transition:transform .15s,background .15s}
.camera.recording .cam-shutter{background:#d92d3f;transform:scale(1.18)}
.cam-flip{position:absolute;right:28px;top:50%;transform:translateY(-50%);color:#e9edef;width:48px;height:48px}
.cam-flip:hover{background:rgba(233,237,239,.1)}
.cam-timer{margin-left:auto;padding:3px 10px;border-radius:12px;background:#d92d3f;color:#fff;font-size:14px;font-variant-numeric:tabular-nums}
.cam-hint{flex:none;text-align:center;color:#e9edef;opacity:.8;font-size:13px;padding-top:12px}
.cam-shutter svg{width:30px;height:30px;fill:currentColor}
/* Voice recording: pause, listen, go on */
.c-record .rec-pause,.c-record .rec-resume{color:var(--danger)}
.c-record .rec-prev{flex:1 1 0;min-width:40px;height:4px;border-radius:2px;background:rgba(118,133,127,.35);position:relative;overflow:hidden}
.c-record .rec-prev span{position:absolute;left:0;top:0;bottom:0;width:0;background:var(--green)}
/* Message info in groups: read by / delivered to */
.dialog.msg-info .receipt-group h4{display:flex;align-items:center;gap:6px;margin:12px 0 6px;font-size:14px;font-weight:700;color:var(--text)}
.dialog.msg-info .receipt-group h4 svg{width:18px;height:18px;fill:var(--icon-2);color:var(--icon-2)}
.dialog.msg-info .receipt-group h4 svg.read{fill:var(--tick-read);color:var(--tick-read)}
.dialog.msg-info .receipt-group p{margin:0 0 6px;font-size:13.5px}
.dialog.msg-info .list-pick{max-height:30vh;margin:0 -24px 4px}
@media (max-width:767px){
 .mention-pop{left:6px;right:6px}
 .album-grid{width:min(300px,72vw)}
 .pin-bar .pin-more{width:44px;height:48px}
}
/* QR code and contact link (pages.mjs openQr, 0.8.1): the card stays white in
   both themes, so every scanner reads the code. */
.qr-page{display:flex;flex-direction:column;align-items:center;padding:12px 20px 4px}
.qr-card{display:flex;flex-direction:column;align-items:center;gap:4px;width:min(340px,100%);padding:22px 20px 18px;border-radius:26px;background:#fff;color:#11201b;box-shadow:var(--shadow);text-align:center}
:root[data-theme=dark] .qr-card{box-shadow:none}
.qr-card .avatar{margin-bottom:6px}
.qr-name{font-size:19px;font-weight:800;letter-spacing:-.01em;overflow-wrap:anywhere}
.qr-handle{font-size:13.5px;font-weight:600;color:#56665f}
.qr-box{width:min(250px,64vw);aspect-ratio:1;margin:12px 0 6px}
.qr-box .qr-svg{width:100%;height:100%;display:block}
.qr-hint{margin:6px 0 0;font-size:13px;font-weight:500;line-height:1.45;color:#56665f}
.qr-page+.pad{padding-top:4px}
.qr-page .hero-actions{padding:18px 0 8px}
/* Scanner (scan.mjs): live picture with a frame; "Bild auswählen" for screenshots. */
.scan-view{position:relative;width:min(100%,520px);aspect-ratio:3/4;max-height:100%;border-radius:22px;overflow:hidden;background:#000}
.scan-view video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:0}
.scan-frame{position:absolute;left:50%;top:50%;width:62%;aspect-ratio:1;transform:translate(-50%,-50%);border-radius:26px;box-shadow:0 0 0 2000px rgba(9,16,13,.45);outline:3px solid var(--gold);outline-offset:0}
.scan-image{display:inline-flex;align-items:center;gap:10px;height:48px;padding:0 20px;border-radius:24px;background:rgba(255,255,255,.12);color:#fff;font-weight:700;font-size:15px}
.scan-image svg{width:22px;height:22px;fill:currentColor}
.scan-image:hover{background:rgba(255,255,255,.2)}
/* Connection notice (app.mjs setNetbar): toast look at the top; taps pass through. */
.netbar{position:fixed;left:50%;top:calc(10px + env(safe-area-inset-top));transform:translateX(-50%);z-index:61;display:flex;align-items:center;gap:10px;max-width:calc(100vw - 32px);padding:9px 16px;border-radius:14px;background:var(--toast);color:#fff;font-size:13.5px;font-weight:600;line-height:1.35;box-shadow:var(--shadow);pointer-events:none;animation:toastIn .2s ease-out}
:root[data-theme=dark] .netbar{color:#0e1613}
.netbar .spinner{flex:none;width:14px;height:14px;border-width:2px;background:none}
:root[data-theme=dark] .netbar .spinner{border-color:rgba(14,22,19,.3);border-top-color:#0e1613}
/* iPhone/iPad (0.9): the keyboard only shrinks and shifts the visible area, so the
   full-screen layers follow it (app.mjs sets --vvt/--vvh and .kb while it is open). */
html.ios body,html.ios .main,html.ios .auth,html.ios .unlock,html.ios .splash,html.ios .call,html.ios .layer,html.ios .viewer,html.ios .preview,html.ios .camera{top:var(--vvt,0px);bottom:auto;height:var(--vvh,100%)}
html.ios .dialog{top:calc(var(--vvt,0px) + var(--vvh,100vh)/2);max-height:calc(var(--vvh,100vh) - 40px)}
html.ios.kb .main{--nav-h:0px}
html.ios.kb .bottom-nav{display:none}
html.ios.kb .composer{padding-bottom:10px}
html.ios.kb .toasts{bottom:calc(100% - var(--vvt,0px) - var(--vvh,100%) + 16px)}
/* "Sali auf dem iPhone" above the sign-in (Safari, before "Zum Home-Bildschirm"). */
.install-card{position:relative;max-width:1000px;margin:24px auto 0;padding:20px 24px;border-radius:22px;background:var(--bg);box-shadow:var(--shadow);color:var(--text);border:2px solid var(--gold)}
.install-card h2{display:flex;align-items:center;gap:10px;margin:0 0 10px;font-size:18px;font-weight:800}
.install-card h2 svg{width:22px;height:22px;fill:currentColor;color:var(--green-text)}
.install-card ol{margin:0 0 10px;padding-left:22px;font-size:15.5px;line-height:1.55}
.install-card li{margin-bottom:6px}
.install-card b{font-weight:800;color:var(--green-text)}
.install-card p{margin:0;color:var(--text-2);font-size:14px;line-height:1.5}
@media (max-width:767px){.install-card{margin:20px 16px 0;padding:18px 18px}}
