[hidden] { display: none !important; }
html, body { margin: 0; }
/* Layout: floating rounded sidebar card over a doodle wallpaper; centered chat column with floating header, pinned bar and input pill. Dark only, by design. */
:root {
  --page: #0b0b0b; --surface: #212121; --surface-2: #2c2c2c; --field: #181818; --hover: #2c2c2c;
  --text: #ffffff; --muted: #aaaaaa; --dim: #707579;
  --accent: #7b5cf0; --accent-hover: #8a6ef5; --out: #6D4CDB; --in: #212121;
  --wp: none;
  --f: "Roboto", -apple-system, "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
html, body { height: 100%; }
body { background: var(--page); color: var(--text); font-family: var(--f); font-size: 16px; overflow: hidden; -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { display: block; }
.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.app { display: flex; height: 100%; background-color: var(--page);
  background-image: var(--wp), radial-gradient(ellipse at 75% 25%, rgba(110, 70, 190, .22), transparent 60%), radial-gradient(ellipse at 25% 95%, rgba(170, 60, 120, .16), transparent 55%);
  background-size: 460px 460px, auto, auto; }

/* ---------- avatars ---------- */
.av { width: var(--s); height: var(--s); flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 500; font-size: calc(var(--s) * .4); position: relative; user-select: none; }
.av svg { width: 55%; height: 55%; }
.av-emoji { font-size: calc(var(--s) * .55); line-height: 1; }
.av.ring { outline: 2px dashed #5ba7f0; outline-offset: 3px; }
.av-gap { width: 40px; flex: none; }

/* ---------- sidebar ---------- */
.side { width: 420px; flex: none; margin: 16px 0 16px 16px; background: var(--surface); border-radius: 24px; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.side-top { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; }
.round { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.round:hover { background: var(--hover); }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 7px 0 16px; border-radius: 27px; background: var(--field); color: var(--muted); }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: inherit; font-size: 17px; outline: none; }
.search input::placeholder { color: var(--muted); }
.banner { margin: 4px 12px 8px; padding: 12px 44px 12px 20px; border-radius: 20px; background: var(--surface-2); position: relative; }
.banner b { display: block; font-weight: 500; font-size: 17px; }
.banner span { color: var(--muted); font-size: 15px; }
.banner .x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; }
.tabs { display: flex; gap: 4px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid #2a2a2a; }
.tab { padding: 14px 14px 12px; font-size: 16px; font-weight: 500; color: var(--muted); white-space: nowrap; position: relative; display: flex; align-items: center; gap: 6px; border-radius: 10px 10px 0 0; }
.tab:hover { background: var(--hover); }
.tab[aria-selected="true"] { color: var(--accent); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.tab .badge { height: 20px; min-width: 20px; font-size: 12px; }

.list { flex: 1; overflow-y: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: #3a3a3a transparent; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 12px; text-align: left; }
.row:hover { background: var(--hover); }
.row.sel { background: var(--accent); }
.r-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.r-top, .r-bot { display: flex; align-items: center; gap: 4px; min-width: 0; }
.r-name { font-weight: 500; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-time { margin-left: auto; padding-left: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.r-prev { flex: 1; min-width: 0; color: var(--muted); font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-prev .who { color: var(--text); }
.mute { width: 15px; height: 15px; color: var(--dim); flex: none; }
.pin { width: 22px; height: 22px; color: var(--dim); flex: none; }
.badge { flex: none; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; display: grid; place-items: center; font-size: 13.5px; font-weight: 500; background: var(--accent); color: #fff; }
.badge.m { background: var(--dim); }
.row.sel .r-prev, .row.sel .r-time, .row.sel .r-prev .who, .row.sel .mute, .row.sel .pin, .row.sel .tk { color: #fff; }
.row.sel .badge { background: #fff; color: var(--accent); }
.tk { width: 16px; height: 16px; color: var(--accent); flex: none; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

.fab { position: absolute; right: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.4); transition: transform .15s; }
.fab:hover { transform: scale(1.05); background: var(--accent-hover); }

.dropdown { position: absolute; top: 62px; left: 12px; z-index: 20; width: 300px; padding: 6px; border-radius: 14px; background: rgba(33,33,33,.96); backdrop-filter: blur(12px); box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.dd-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 9px 12px; border-radius: 8px; font-size: 15px; text-align: left; }
.dd-item:hover { background: rgba(255,255,255,.07); }
.dd-item small { display: block; color: var(--muted); font-size: 13px; }
.dd-sep { height: 1px; background: #333; margin: 6px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* forum mode: avatar strip + topics */
.side.forum { flex-direction: row; }
.strip { width: 80px; flex: none; overflow-y: auto; scrollbar-width: none; padding: 76px 0 12px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid #2a2a2a; }
.strip button { position: relative; display: grid; place-items: center; padding: 8px 0; margin: 0 6px; border-radius: 14px; }
.strip button:hover, .strip button.sel { background: var(--hover); }
.strip .badge { position: absolute; right: 2px; bottom: 4px; border: 2px solid var(--surface); }
.topics { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.t-head { display: flex; align-items: center; gap: 10px; padding: 12px 8px 8px 12px; }
.t-head .t-title { flex: 1; min-width: 0; }
.t-head b { display: block; font-weight: 500; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-head span { color: var(--muted); font-size: 14px; }
.t-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; font-size: 24px; color: #5ba7f0; font-weight: 700; }

/* ---------- chat ---------- */
.main { flex: 1; min-width: 0; display: flex; justify-content: center; position: relative; }
.col { width: min(940px, 100%); height: 100%; position: relative; padding: 0 16px; }
.placeholder { height: 100%; display: grid; place-items: center; }
.placeholder span { background: rgba(0,0,0,.45); padding: 6px 14px; border-radius: 999px; font-size: 15px; }
.top { position: absolute; top: 16px; left: 16px; right: 16px; z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.head { height: 64px; border-radius: 32px; background: var(--surface); display: flex; align-items: center; gap: 12px; padding: 0 10px 0 12px; }
.head-info { flex: 1; min-width: 0; }
.head-info b { display: block; font-weight: 500; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-info span { display: block; color: var(--muted); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-info .typing { color: var(--accent); }
.back { display: grid; }
.pinbar { height: 56px; border-radius: 28px; background: var(--surface); display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px; cursor: pointer; }
.pinbar .pin-ico { color: var(--text); }
.pinbar .pin-txt { flex: 1; min-width: 0; border-left: 3px solid var(--accent); padding-left: 10px; }
.pinbar b { display: block; color: var(--accent); font-weight: 500; font-size: 15px; }
.pinbar span { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msgs { position: absolute; inset: 0; overflow-y: auto; padding: 96px 16px 96px; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: #3a3a3a transparent; }
.col.has-pin .msgs { padding-top: 160px; }
.stack { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; }
.day { align-self: center; margin: 8px 0; font-size: 14px; font-weight: 500; padding: 4px 12px; border-radius: 14px; background: rgba(0,0,0,.4); }
.msg { display: flex; align-items: flex-end; gap: 8px; }
.msg.out { justify-content: flex-end; }
.msg.last { margin-bottom: 6px; }
.bubble { position: relative; max-width: min(620px, 78%); padding: 6px 10px 7px 12px; border-radius: 16px; background: var(--in); font-size: 16px; line-height: 1.38; white-space: pre-wrap; overflow-wrap: anywhere; animation: pop .16s ease-out; }
.out .bubble { background: var(--out); }
.in.last .bubble { border-bottom-left-radius: 4px; }
.out.last .bubble { border-bottom-right-radius: 4px; }
.in.last .bubble::after, .out.last .bubble::after { content: ""; position: absolute; bottom: 0; width: 9px; height: 17px; background: inherit; }
.in.last .bubble::after { left: -8px; clip-path: path("M9 0V17H0C4 15 8 11 9 0Z"); }
.out.last .bubble::after { right: -8px; clip-path: path("M0 0V17H9C5 15 1 11 0 0Z"); }
.m-name { font-weight: 500; font-size: 15px; margin-bottom: 2px; white-space: nowrap; }
.quote { --c: #fff; display: block; margin: 3px 0 5px; padding: 4px 10px 5px; border-left: 3px solid var(--c); border-radius: 5px; background: color-mix(in srgb, var(--c) 14%, transparent); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.quote b { display: block; color: var(--c); font-weight: 500; }
.meta { position: absolute; right: 10px; bottom: 5px; display: flex; align-items: center; gap: 3px; font-size: 12.5px; color: rgba(255,255,255,.5); white-space: nowrap; }
.out .meta { color: rgba(255,255,255,.75); }
.out .meta .tk { color: #fff; }
.meta .rep { display: flex; align-items: center; gap: 2px; margin-right: 6px; }
.meta .rep svg { width: 14px; height: 14px; }
.spacer { display: inline-block; height: 1px; }
.reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; white-space: normal; }
.rc { height: 32px; padding: 0 8px 0 6px; border-radius: 16px; display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,.08); color: var(--accent); font-weight: 500; font-size: 15px; }
.out .rc { background: rgba(255,255,255,.18); color: #fff; }
.rc .e { font-size: 21px; line-height: 1; }
.rc.mine { background: var(--accent); color: #fff; }
.out .rc.mine { background: #fff; color: var(--accent); }
.rc .avs { display: flex; }
.rc .avs .av { border: 2px solid var(--in); margin-left: -6px; }
.rc .avs .av:first-child { margin-left: 0; }
.msg.stk .bubble { background: none; padding: 0; }
.msg.stk .bubble::after { display: none; }
.msg.stk svg.sticker { width: 170px; height: 170px; animation: wobble 1.6s ease-in-out 2; }
.msg.stk .meta, .bubble.media .meta { background: rgba(0,0,0,.45); padding: 2px 7px; border-radius: 10px; color: #fff; bottom: 6px; right: 6px; }
.bubble.media { padding: 0; overflow: hidden; width: min(440px, 100%); }
.lp-img { height: 230px; display: flex; align-items: flex-end; justify-content: center; padding: 18px; font-weight: 700; font-size: 26px; letter-spacing: .08em; color: rgba(255,255,255,.55); text-transform: uppercase; }
.lp-txt { padding: 10px 14px 12px; background: rgba(0,0,0,.35); }
.lp-txt b { display: block; font-size: 22px; font-weight: 700; }
.lp-txt span { color: rgba(255,255,255,.75); font-size: 15px; }

.composer { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 3; display: flex; align-items: flex-end; gap: 8px; }
.inp { flex: 1; min-width: 0; background: var(--surface); border-radius: 28px; display: flex; flex-direction: column; }
.replybar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 0 16px; color: var(--accent); }
.replybar .rb-txt { flex: 1; min-width: 0; border-left: 3px solid var(--accent); padding-left: 10px; font-size: 14.5px; }
.replybar .rb-txt span { display: block; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inp-row { display: flex; align-items: flex-end; gap: 4px; padding: 6px 6px 6px 8px; min-height: 56px; }
.inp-row .av { margin: 2px 6px 2px 0; }
.inp textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: none; color: var(--text); font: inherit; font-size: 17px; line-height: 1.35; padding: 10px 4px; max-height: 180px; }
.inp textarea::placeholder { color: var(--muted); }
.mic { width: 56px; height: 56px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.mic:hover { background: var(--accent-hover); }
.mic .ico { width: 26px; height: 26px; }

.panel { position: absolute; right: 64px; bottom: 68px; width: 360px; max-width: calc(100% - 64px); height: 360px; z-index: 5; background: var(--surface); border-radius: 18px; box-shadow: 0 8px 30px rgba(0,0,0,.5); display: flex; flex-direction: column; overflow: hidden; }
.p-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid #2a2a2a; }
.p-tab { padding: 6px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 14px; }
.p-tab[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.p-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); align-content: start; gap: 2px; padding: 8px; }
.p-grid.st { grid-template-columns: repeat(4, 1fr); }
.p-grid button { aspect-ratio: 1; border-radius: 10px; font-size: 26px; display: grid; place-items: center; }
.p-grid button:hover { background: var(--hover); }
.p-grid button svg { width: 100%; height: 100%; }

.ctx { position: fixed; z-index: 50; min-width: 220px; padding: 6px; border-radius: 14px; background: rgba(33,33,33,.96); backdrop-filter: blur(12px); box-shadow: 0 8px 30px rgba(0,0,0,.55); }
.ctx-re { display: flex; gap: 2px; padding: 2px 2px 6px; border-bottom: 1px solid #333; margin-bottom: 4px; }
.ctx-re button { width: 36px; height: 36px; border-radius: 50%; font-size: 22px; display: grid; place-items: center; transition: transform .1s; }
.ctx-re button:hover { transform: scale(1.2); background: rgba(255,255,255,.07); }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 60; background: rgba(0,0,0,.8); padding: 10px 16px; border-radius: 12px; font-size: 14.5px; max-width: calc(100% - 32px); }

/* voice, photo, file */
.voice, .file, .lp-txt { white-space: normal; }
.voice { display: flex; align-items: center; gap: 10px; padding: 3px 0 2px; min-width: 230px; }
.vplay { width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.out .vplay { background: #fff; color: var(--accent); }
.vplay svg { width: 22px; height: 22px; }
.vbody { display: flex; flex-direction: column; gap: 3px; }
.bars { position: relative; height: 24px; --p: 0%; }
.wv { display: flex; align-items: flex-end; gap: 2px; height: 24px; width: max-content; }
.wv i { width: 3px; border-radius: 2px; flex: none; background: rgba(255,255,255,.4); }
.in .wv i { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.bars .fg { position: absolute; inset: 0 auto 0 0; width: var(--p); overflow: hidden; }
.bars .fg i { background: #fff; }
.in .bars .fg i { background: var(--accent); }
.vtime { font-size: 13px; color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.vdot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.photo { display: block; width: 100%; height: auto; min-height: 120px; max-height: 440px; object-fit: cover; cursor: zoom-in; background: #000; }
.ph-grad { aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 64px; }
.cap { padding: 6px 10px 7px 12px; }
.bubble.media.capd .meta { background: none; padding: 0; bottom: 5px; right: 10px; color: rgba(255,255,255,.6); }
.file { display: flex; align-items: center; gap: 12px; padding: 4px 0 2px; min-width: 240px; }
.fico { width: 48px; height: 48px; flex: none; border-radius: 12px; background: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.out .fico { background: #fff; color: var(--accent); }
.file b { display: block; font-weight: 500; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file span span { font-size: 13.5px; color: rgba(255,255,255,.6); }
.dropdown.up { top: auto; bottom: 68px; left: 0; width: 240px; }
.recbar { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 8px 0 18px; }
.recdot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: #e53935; animation: blink 1s infinite; }
.rectime { min-width: 58px; font-variant-numeric: tabular-nums; }
.recwave { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 2px; height: 30px; overflow: hidden; }
.recwave i { width: 3px; flex: none; border-radius: 2px; background: var(--accent); }
.recnote { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rec-cancel { color: var(--accent); font-weight: 500; padding: 8px 10px; border-radius: 8px; }
.rec-cancel:hover { background: var(--hover); }
@keyframes blink { 50% { opacity: .2 } }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.overlay.lightbox { background: rgba(0,0,0,.92); cursor: zoom-out; }
.lightbox img, .lightbox .ph-grad { max-width: min(90vw, 900px); max-height: 90vh; width: auto; border-radius: 6px; }
.lightbox .ph-grad { width: min(90vw, 800px); font-size: 120px; }
.modal { width: min(420px, 100%); background: var(--surface); border-radius: 16px; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.modal img { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 10px; background: #000; }
.modal-h { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 500; }
.field { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid #3a3a3a; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.field:focus { border-color: var(--accent); outline: none; }
.btn { height: 52px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 500; font-size: 16px; }
.btn:hover { background: var(--accent-hover); }

/* sign-in */
.auth { position: fixed; inset: 0; z-index: 45; overflow-y: auto; display: flex; padding: 32px 16px;
  background-color: var(--page); background-image: var(--wp), radial-gradient(ellipse at 50% 20%, rgba(110,70,190,.25), transparent 60%); background-size: 460px 460px, auto; }
.auth-card { width: min(400px, 100%); margin: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.auth-logo { width: 132px; height: 132px; border-radius: 30px; background: #6D4CDB; display: grid; place-items: center; box-shadow: 0 10px 40px rgba(109,76,219,.35); }
.auth h1 { font-size: 30px; font-weight: 500; margin: 6px 0 0; text-wrap: balance; }
.auth p { color: var(--muted); margin: 0; line-height: 1.45; }
.auth-back { align-self: flex-start; }
.prov { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.prov button { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: var(--surface); text-align: left; }
.prov button:hover { background: var(--surface-2); }
.prov small { display: block; color: var(--muted); font-size: 13.5px; }
.plogo { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; }
.auth form { width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.flabel { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 96px; gap: 8px; }
.err { color: #ff6b6b; font-size: 14px; min-height: 1.2em; }
.hint { width: 100%; background: var(--surface); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--muted); line-height: 1.45; text-align: left; }
.hint b { color: var(--text); font-weight: 500; }
.steps { width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: left; background: var(--surface); border-radius: 14px; padding: 16px; }
.step { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.step.done { color: var(--text); }
.s-ic { width: 20px; display: grid; place-items: center; color: var(--accent); font-weight: 700; flex: none; }
.spin { width: 16px; height: 16px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg) } }

@keyframes pop { from { transform: scale(.97); opacity: .5 } to { transform: none; opacity: 1 } }
@keyframes wobble { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-6deg) scale(1.04) } 60% { transform: rotate(5deg) } }
@media (prefers-reduced-motion: reduce) { .bubble, .msg.stk svg.sticker { animation: none } .fab, .ctx-re button { transition: none } }

/* ---------- phone ---------- */
@media (max-width: 900px) {
  .side { width: 100%; margin: 0; border-radius: 0; }
  .main { display: none; }
  .app.in-chat .side { display: none; }
  .app.in-chat .main { display: flex; }
  .back { display: grid; }
  .col { padding: 0; }
  .top { top: 8px; left: 8px; right: 8px; }
  .composer { left: 8px; right: 8px; bottom: 8px; }
  .msgs { padding: 84px 8px 84px; }
  .col.has-pin .msgs { padding-top: 148px; }
  .bubble { max-width: 86%; }
  .panel { right: 0; max-width: 100%; }
  .head-acts .search-btn { display: none; }
}

/* ---------- live app additions ---------- */
.av { overflow: hidden; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chip { flex: none; font-size: 11.5px; font-weight: 500; padding: 2px 7px; border-radius: 8px; background: rgba(109,76,219,.22); color: var(--accent); }
.row.sel .chip { background: rgba(255,255,255,.25); color: #fff; }
.sec { padding: 14px 12px 6px; font-size: 13px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.row .go { margin-left: auto; flex: none; color: var(--accent); font-size: 14px; font-weight: 500; }
.sys { align-self: center; max-width: 80%; text-align: center; font-size: 14px; padding: 4px 12px; border-radius: 14px; background: rgba(0,0,0,.45); margin: 4px 0; }
.failed { color: #ff6b6b; font-weight: 700; }
.reqbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 20px; background: var(--surface); }
.reqbar span { flex: 1 1 200px; color: var(--muted); font-size: 14.5px; }
.reqbar button { padding: 8px 14px; border-radius: 10px; font-weight: 500; background: var(--surface-2); }
.reqbar .ok { background: var(--accent); color: #fff; }
.composer { flex-direction: column; align-items: stretch; }
.composer .crow { display: flex; align-items: flex-end; gap: 8px; }
.msg.stk img.sticker { width: 170px; height: 170px; object-fit: contain; display: block; }
.file a { color: inherit; text-decoration: none; }
.me-card { display: flex; align-items: center; gap: 12px; padding: 8px 12px 10px; }
.me-card b { display: block; font-weight: 500; }
.me-card small { color: var(--muted); }
.qr { background: #fff; border-radius: 16px; padding: 10px; align-self: center; }
.qr svg, .qr img { width: 220px; height: 220px; display: block; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; }
.install { width: 100%; text-align: left; background: rgba(109,76,219,.15); border: 1px solid rgba(109,76,219,.4); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; line-height: 1.45; }
.install b { color: var(--text); }
.linkbtn { color: var(--accent); font-size: 14px; padding: 6px; }
.hint a { color: var(--accent); }
.avatar-edit { position: relative; align-self: center; cursor: pointer; }
.avatar-edit span.cam { position: absolute; right: 0; bottom: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; border: 3px solid var(--surface); }
.modal p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.offline { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 60; background: #5c2b2b; padding: 6px 14px; border-radius: 12px; font-size: 13.5px; }
@media (max-width: 900px) {
  .side-top { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .top { top: calc(8px + env(safe-area-inset-top, 0px)); }
  .composer { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .msgs { padding-top: calc(84px + env(safe-area-inset-top, 0px)); padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .list { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .fab { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .auth { padding-top: calc(24px + env(safe-area-inset-top, 0px)); }
}

/* menu like the reference: wide items, submenu, version line */
.dropdown.tg { width: 280px; padding: 6px 0; }
.dropdown.tg .dd-item { padding: 10px 18px; border-radius: 0; gap: 18px; font-size: 15.5px; }
.dropdown.tg .dd-item .ico { color: var(--text); }
.dropdown.tg .dd-item .av { margin: -4px 0; }
.dropdown.sub { position: absolute; left: calc(100% - 8px); bottom: 0; top: auto; width: 270px; }
.dd-n { margin-left: auto; color: var(--muted); font-size: 14px; }
.dd-ver { padding: 10px 18px 6px; font-size: 12.5px; color: var(--muted); text-align: center; }
@media (max-width: 900px) { .dropdown.sub { left: 24px; bottom: -8px; } }

/* settings */
.settings { padding: 0 12px 24px; }
.set-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0 18px; text-align: center; }
.set-hero b { font-size: 22px; font-weight: 500; margin-top: 10px; }
.set-hero small { color: var(--muted); font-size: 15px; }
.set-card { background: var(--surface-2); border-radius: 18px; padding: 6px 0; margin-bottom: 14px; }
.set-row { display: flex; align-items: center; gap: 18px; width: 100%; padding: 10px 16px; text-align: left; }
.set-row:hover { background: rgba(255,255,255,.04); }
.set-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.set-t span { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-t small { color: var(--muted); font-size: 13.5px; }
.set-n { color: var(--muted); font-size: 15px; }
.tile { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; }
.tile svg { width: 20px; height: 20px; }
.dev { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid #333; }
.dev small { color: var(--muted); }
.side > .t-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }

.modal.scan video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #000; }
.auth .linkbtn { margin-top: 4px; font-size: 15px; }

/* new chat: suggestions + own QR */
.sugg-wrap { position: relative; }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 3; background: var(--surface-2); border-radius: 12px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.45); max-height: 300px; overflow-y: auto; }
.sugg-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 9px; text-align: left; }
.sugg-item:hover, .sugg-item.on { background: rgba(255,255,255,.07); }
.sugg-item span:not(.av):not(.chip) { flex: 1; min-width: 0; }
.sugg-item b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg-item small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; border-top: 1px solid #333; padding-top: 14px; margin-top: 4px; text-align: center; }
.nc-qr .qr svg { width: 168px; height: 168px; }
.nc-qr .qr { min-width: 188px; min-height: 188px; display: grid; place-items: center; }
.modal { max-height: calc(100dvh - 32px); overflow-y: auto; }

/* past letters from the mailbox */
.hist-btn { align-self: center; display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; padding: 9px 16px; border-radius: 18px; background: rgba(0,0,0,.5); color: var(--text); font-size: 14.5px; font-weight: 500; }
button.hist-btn:hover { background: rgba(0,0,0,.7); }
.hist-btn .ico { width: 18px; height: 18px; }
.msg.hist .bubble { opacity: .9; }
.hist-subj { font-weight: 500; margin-bottom: 2px; }
.hist-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; white-space: normal; }

.histwrap { display: contents; }

/* failed message: dimmed bubble with a red outline and a clear «retry» line under it */
.msg.fail { flex-wrap: wrap; justify-content: flex-end; }
.msg.fail .bubble { background: #6b2433 !important; box-shadow: 0 0 0 2px #ff4d4f; }
.msg.fail .photo { opacity: .5; filter: grayscale(.7); }
.fail-note { flex-basis: 100%; display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin: 4px 2px 6px; padding: 0; border: 0; background: none; color: #ff6b6b; font: 600 15px/1.2 inherit; cursor: pointer; }
.fail-note .failed { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #ff4d4f; color: #fff; font-size: 12px; }
.auth-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; border-top: 1px solid #333; padding-top: 14px; margin-top: 4px; text-align: center; font-size: 14px; }
.auth-qr .qr svg { width: 168px; height: 168px; }
.auth-qr .qr { min-width: 188px; min-height: 188px; display: grid; place-items: center; }

/* phones: the app fills the whole screen (no black strips), tab bar floats at the bottom like Telegram for iOS */
.tabbar { display: none; }
@media (max-width: 900px) {
  .app { position: fixed; inset: 0; height: auto; }
  html, body { background: var(--surface); }
  .tabbar { display: flex; position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 15;
    gap: 4px; padding: 5px; border-radius: 34px; background: rgba(44,44,44,.88); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 6px 24px rgba(0,0,0,.45); }
  .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 104px; padding: 7px 16px 6px; border-radius: 28px; font-size: 11.5px; color: var(--muted); }
  .tabbar button .ico { width: 26px; height: 26px; }
  .tabbar button[aria-current="page"] { background: rgba(255,255,255,.1); color: var(--accent); }
  .fab { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .list, .settings { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  .side > .t-head [data-act="closesettings"] { visibility: hidden; }
  .row { padding-top: 9px; padding-bottom: 9px; }
}

/* ---------- motion: show that work is happening, never just a frozen screen ---------- */
:root { --ease-out: cubic-bezier(.23, 1, .32, 1); }
#busy { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; pointer-events: none; opacity: 0; transition: opacity .2s ease;
  background: linear-gradient(90deg, transparent, var(--accent), #c36cf0, transparent) 0 0 / 40% 100% no-repeat; }
#busy.on { opacity: 1; animation: busy 1.1s linear infinite; }
@keyframes busy { from { background-position: -40% 0 } to { background-position: 140% 0 } }
.tk.sending .hand { transform-origin: 8px 8px; animation: rot 1.2s linear infinite; }
.msg.out .bubble:has(.tk.sending) { opacity: .82; }
/* skeletons and shimmer */
.sk, .bubble.loading, .photo { background-image: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.08) 50%, transparent 70%); background-size: 250% 100%; animation: shimmer 1.3s linear infinite; }
.bubble.loading { color: var(--muted); }
.photo { background-color: #1c1c1c; }
.bubble.sk { height: 38px; min-width: 90px; background-color: var(--in); }
.msg.out .bubble.sk { background-color: rgba(109,76,219,.45); }
.skel .msg { margin: 6px 0; }
.sk-row { pointer-events: none; }
.sk-av { width: 54px; height: 54px; border-radius: 50%; background-color: var(--surface-2); flex: none; }
.sk-l, .sk-s { display: block; height: 13px; border-radius: 7px; background-color: var(--surface-2); }
.sk-l { width: 45%; margin-bottom: 9px; } .sk-s { width: 75%; }
@keyframes shimmer { from { background-position: 150% 0 } to { background-position: -100% 0 } }
/* any disabled button is busy: show a spinner on it */
.btn[disabled] { position: relative; color: transparent !important; }
.btn[disabled]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border: 2.5px solid #fff; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; }
/* press feedback */
.btn, .round, .fab, .row, .dd-item, .set-row, .tabbar button, .sugg-item { transition: transform .16s var(--ease-out), background-color .15s ease; }
.btn:active, .round:active, .fab:active, .row:active, .dd-item:active, .set-row:active, .tabbar button:active, .sugg-item:active { transform: scale(.97); }
/* entrances */
.overlay { animation: fade .2s ease-out; }
.overlay > .modal { animation: rise .26s var(--ease-out); }
.dropdown { transform-origin: top left; animation: drop .18s var(--ease-out); }
.toast { animation: toastIn .24s var(--ease-out); }
.app.in-chat .main { animation: slideIn .26s var(--ease-out); }
@keyframes fade { from { opacity: 0 } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.97) } }
@keyframes drop { from { opacity: 0; transform: scale(.95) } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px) } }
@keyframes slideIn { from { opacity: .4; transform: translateX(24px) } }
@media (min-width: 901px) { .app.in-chat .main { animation: none; } }
@media (prefers-reduced-motion: reduce) {
  .overlay > .modal, .dropdown, .toast, .app.in-chat .main { animation: fade .2s ease-out; }
  .btn:active, .round:active, .fab:active, .row:active, .dd-item:active, .set-row:active, .tabbar button:active { transform: none; }
}
.photo.ok { animation: none; background-image: none; }
@media (max-width: 900px) { .side > .t-head [data-act="closesettings"] { display: none; } .side > .t-head .t-title { text-align: center; padding-left: 44px; } }

/* phones, like Telegram for iOS: menu · «Чаты» · compose on top, full-width search under it, tab bar low on the home-indicator line */
.m-head { display: none; }
@media (max-width: 900px) {
  .m-head { display: flex; align-items: center; justify-content: space-between; padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 0; }
  .m-head b { font-size: 17px; font-weight: 600; }
  .m-head .round .ico { color: var(--accent); }
  .side-top { padding-top: 6px; }
  .side-top > .round, .side-top .search > span[data-act="settings"] { display: none; }
  .fab { display: none; }
  .tabbar { bottom: max(8px, calc(env(safe-area-inset-bottom, 0px) - 14px)); }
  .list, .settings { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 900px) { .side > .dropdown.tg { top: calc(54px + env(safe-area-inset-top, 0px)); left: 10px; } }
/* tab bar flush with the bottom edge (Telegram for iOS): its background runs to the screen edge, buttons sit above the home indicator */
@media (max-width: 900px) {
  .tabbar { left: 0; right: 0; bottom: 0; transform: none; border-radius: 0; justify-content: space-around; gap: 0;
    padding: 6px 12px calc(4px + env(safe-area-inset-bottom, 0px)); background: rgba(28,28,28,.94); border-top: 1px solid rgba(255,255,255,.07); box-shadow: none; }
  .tabbar button { flex: 1; max-width: 180px; padding: 4px 0 2px; border-radius: 12px; background: none !important; }
  .tabbar button .ico { width: 28px; height: 28px; }
  .tabbar button span { font-size: 11px; }
  .list, .settings { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
/* iOS 26 home-screen apps get a viewport shorter than the screen by the status-bar height (WebKit 301108),
   leaving an empty band at the bottom. Full-screen layers grow to the real edge; capped by the top inset (WebKit 316008). */
@media (display-mode: standalone) {
  .auth, .overlay, .app { bottom: auto; height: min(100lvh, calc(100% + env(safe-area-inset-top, 0px))); }
  html { height: min(100lvh, calc(100% + env(safe-area-inset-top, 0px))); }
  body { height: 100%; }
}
/* phones: messages slide under a dark scrim behind the status bar instead of under the clock */
@media (max-width: 900px) {
  .main::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(env(safe-area-inset-top, 0px) + 6px); z-index: 4; pointer-events: none;
    background: linear-gradient(rgba(11,11,11,.96) 70%, rgba(11,11,11,0)); }
}

/* ---------- phones, like Telegram for iOS 26 ---------- */
.tb-n { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e53935; color: #fff; font: 600 11px/18px var(--f); font-style: normal; }
@media (max-width: 900px) {
  /* floating glass tab bar */
  .tabbar { left: 14px; right: 14px; bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) - 18px)); max-width: 460px; margin: 0 auto;
    padding: 5px; border-radius: 32px; border: 1px solid rgba(255,255,255,.08); background: rgba(38,38,40,.78);
    -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6); box-shadow: 0 8px 28px rgba(0,0,0,.45); }
  .tabbar button { position: relative; flex: 1; max-width: none; padding: 7px 0 5px; border-radius: 26px; color: #d0d0d0; }
  .tabbar button[aria-current="page"] { background: rgba(255,255,255,.12) !important; color: var(--accent); }
  .tabbar button .ico { width: 27px; height: 27px; }
  .tabbar button span { font-size: 10.5px; font-weight: 500; }
  .list, .settings { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
  /* chat list rows with inset separators */
  .row { position: relative; border-radius: 0; padding-left: 14px; padding-right: 14px; }
  .row + .row::before { content: ""; position: absolute; top: 0; left: 82px; right: 0; height: 1px; background: rgba(255,255,255,.07); }
  .row.sel { background: none; } .row.sel .r-prev, .row.sel .r-time { color: var(--muted); }
  /* chat header: round back button, name in a glass pill, avatar on the right */
  .head { background: none; padding: 0; gap: 8px; height: 48px; }
  .head .back, .head-info, .head-av .av { -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); }
  .head .back { width: 46px; height: 46px; background: rgba(38,38,40,.8); color: var(--text); }
  .head-info { order: 2; height: 46px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 0 16px;
    border-radius: 23px; background: rgba(38,38,40,.8); cursor: pointer; max-width: calc(100% - 120px); margin: 0 auto; flex: 0 1 auto; }
  .head-info b { font-size: 16px; font-weight: 600; } .head-info span { font-size: 12.5px; }
  .head-av { order: 3; margin-left: auto; cursor: pointer; }
  .head-av .av { width: 46px; height: 46px; }
  .head > .round[data-act="chatmenu"] { display: none; }
  .head .back { order: 1; }
}
@media (max-width: 900px) {
  .head { justify-content: space-between; }
  .head-info { margin: 0; }
  .head-av { margin-left: 0; }
}
/* a small picture stays small instead of being blown up to the full bubble width */
.photo { width: auto; max-width: 100%; min-width: 160px; }
@media (max-width: 900px) { .head .back, .head-info { background: rgba(30,30,32,.9); } }
/* «Настройки» tab shows your own avatar, like Telegram; ringed when selected */
.tb-av { display: grid; place-items: center; width: 27px; height: 27px; }
.tb-av .av { width: 27px !important; height: 27px !important; font-size: 11px; }
.tabbar button[aria-current="page"] .tb-av .av { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- video, round video messages, recording, gestures ---------- */
.vid { display: block; width: 100%; max-height: 420px; border-radius: 12px; background: #000; margin: 2px 0 4px; }
.msg.rvmsg { align-items: flex-end; }
.rv { position: relative; width: 240px; height: 240px; border-radius: 50%; overflow: hidden; background: #000; cursor: pointer; flex: none; }
.rv video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv .meta { position: absolute; right: 16px; bottom: 10px; background: rgba(0,0,0,.45); padding: 1px 7px; border-radius: 10px; }
.rv.on { box-shadow: 0 0 0 3px var(--accent); }
.round-rec { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: rgba(0,0,0,.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fade .2s ease-out; pointer-events: none; }
.rr-circle { position: relative; width: min(78vw, 340px); aspect-ratio: 1; }
.rr-circle video { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; transform: scaleX(-1); background: #111; }
.rr-circle svg { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); }
.rr-circle circle { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-dasharray: 302; stroke-dashoffset: 302; transition: stroke-dashoffset .2s linear; }
.rr-time { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.round-rec p { color: #ccc; margin: 0; font-size: 14px; }
.prog { height: 6px; border-radius: 3px; background: #333; overflow: hidden; } .prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s linear; }
#sendBtn { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.msg.reply-ready .bubble { box-shadow: 0 0 0 2px var(--accent); }
@media (pointer: coarse) { .bubble, .rv { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }
/* keyboard open on a phone: the app occupies just the visible area (see visualViewport code in app.js) */
html.kb .app { top: var(--vvt, 0px) !important; height: var(--vvh, 100%) !important; bottom: auto !important; }
html.kb .composer { bottom: 8px !important; }
html.kb .msgs { padding-bottom: 84px !important; }

/* Lazy sticker catalog: still previews, bounded pages, native WebP on explicit play. */
.pg-sticker-host,.pg-stickers,.pg-sticker-own{display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden}
.pg-sticker-packs{margin:6px 8px;padding:7px 10px;min-height:36px;border:1px solid var(--muted);border-radius:8px;background:var(--surface);color:var(--text);font:inherit;max-width:calc(100% - 16px)}
.pg-sticker-status{font-size:13px;color:var(--muted);padding:4px 10px;line-height:1.4}.pg-sticker-status:empty{display:none}.pg-sticker-status button{color:var(--accent);padding:8px}
.pg-stickers .p-grid.st img{width:100%;height:100%;max-width:96px;max-height:96px;object-fit:contain}.pg-sticker-pages{display:flex;align-items:center;justify-content:space-between;padding:4px 8px;font-size:12px}.pg-sticker-pages button{padding:8px;min-height:36px;color:var(--accent)}.pg-sticker-pages button:disabled{opacity:.4}
.pg-stickers :focus-visible,.stk-trigger:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.stk-trigger{position:relative;display:block;border-radius:10px}.stk-play-mark{position:absolute;right:6px;bottom:6px;background:#0009;color:#fff;border-radius:50%;width:24px;height:24px;display:grid;place-items:center;font-size:11px}.stk-trigger[aria-pressed="true"] .stk-play-mark{display:none}
/* Sticker browser: bounded thumbnail pages, one explicit animation. */
.pg-sticker-nav,.pg-sticker-actions{display:flex;flex-wrap:wrap;gap:4px;padding:4px 8px;flex:none}
.pg-sticker-nav button,.pg-sticker-actions button,.pg-sticker-tools>button,.pg-sticker-link button{min-height:36px;padding:6px 10px;border-radius:8px;font-size:13px;color:var(--accent)}
.pg-sticker-nav button[aria-pressed="true"]{background:var(--surface-2);color:var(--text)}
.pg-sticker-tools{display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:0 8px;flex:none}.pg-sticker-tools>b{font-size:14px;flex:1}.pg-sticker-tools>.field{margin:4px 0;padding:8px;min-height:36px;width:100%}
.pg-sticker-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}.pg-sticker-body .pg-sticker-own{overflow:visible}.pg-sticker-body .p-grid{overflow:visible}
.pg-pack-row{display:block;width:100%;text-align:left;padding:12px;font-size:14px;border-bottom:1px solid var(--hover)}.pg-pack-row:hover,.pg-pack-grid button:hover{background:var(--hover)}
.pg-pack-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:8px}.pg-pack-grid button{min-width:0;padding:5px;border-radius:8px}.pg-pack-grid img{display:block;width:100%;height:64px;object-fit:contain}.pg-pack-grid span{display:block;font-size:12px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pg-sticker-link{display:flex;gap:4px;min-width:0;width:100%;margin:6px 0}.pg-sticker-link input{flex:1;min-width:0;padding:8px}
.pg-sticker-preview{display:flex;flex-direction:column;align-items:center;padding:8px}.pg-sticker-stage{width:150px;height:150px;display:grid;place-items:center}.pg-sticker-stage img,.pg-sticker-stage video,.pg-sticker-stage canvas{width:100%!important;height:100%!important;object-fit:contain}.pg-sticker-stage img{max-height:none;background:transparent}
.pg-chat-sticker-stage{display:block;width:170px;height:170px}.pg-chat-sticker-stage>img,.pg-chat-sticker-stage>video,.pg-chat-sticker-stage>canvas{width:100%!important;height:100%!important;object-fit:contain}
.pg-modal-sticker-host{display:flex;min-height:0;flex:1}.pg-sticker-modal{height:min(680px,85dvh);padding:10px;gap:6px}.pg-sticker-modal img{background:transparent}
.pg-pack-link{display:block;padding:8px 0;color:var(--accent);text-align:left;font-size:13px}.pg-stickers [hidden]{display:none!important}.pg-stickers button:disabled{opacity:.45}
@media(max-width:500px){.panel{right:0;max-width:100%;width:360px;height:min(420px,65dvh)}}

.pg-stickers{--accent:#baa9ff}

/* ---------- stickers, like Telegram ---------- */
.p-tabs { justify-content: center; border: 0; padding: 8px 8px 4px; }
.p-tabs .p-tab { padding: 6px 16px; border-radius: 16px; font-size: 14px; font-weight: 500; color: var(--muted); }
.p-tabs .p-tab[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.stx { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stx-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 6px 8px; scrollbar-width: none; }
.stx-scroll::-webkit-scrollbar { display: none; }
.stx h4 { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 10px 6px 6px;
  background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.stx-x { width: 28px; height: 22px; border-radius: 11px; color: var(--muted); font-size: 16px; line-height: 1; }
.stx-x:active { background: var(--hover); }
.stx-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.stx-grid > .p-grid { display: contents; }
.stx-grid > button, .stx-grid > .p-grid > button { aspect-ratio: 1; border-radius: 12px; padding: 6px; display: grid; place-items: center; transition: transform .14s var(--ease-out), background-color .15s; }
.stx-grid > button:active, .stx-grid > .p-grid > button:active { transform: scale(.88); }
@media (hover: hover) { .stx-grid > button:hover, .stx-grid > .p-grid > button:hover { background: var(--hover); } }
.stx-grid img { width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
.stx-bar { flex: none; display: flex; gap: 4px; padding: 6px 8px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid rgba(255,255,255,.06); }
.stx-bar::-webkit-scrollbar { display: none; }
.stx-bar button { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); font-size: 20px; }
.stx-bar button img { width: 30px; height: 30px; object-fit: contain; }
.stx-bar button:active { background: var(--hover); }
.stx-bar .stx-add { margin-left: auto; background: var(--accent); color: #fff; border-radius: 50%; width: 36px; height: 36px; align-self: center; }
.stx-empty { margin: 14px 6px 4px; padding: 18px 16px; border-radius: 16px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.stx-empty b { font-size: 16px; } .stx-empty span { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.stx-cta { margin-top: 6px; padding: 10px 22px; border-radius: 20px; background: var(--accent); color: #fff; font-weight: 600; }

/* sheets: shop and a single pack */
.stx-sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease-out; }
.stx-sheet.out { opacity: 0; transition: opacity .18s ease; }
.stx-card { width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 22px 22px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheetUp .28s var(--ease-out); display: flex; flex-direction: column; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4 } }
@media (min-width: 700px) { .stx-sheet { align-items: center; } .stx-card { border-radius: 22px; max-height: 80dvh; } }
.stx-card > header { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 8px 8px 4px; background: var(--surface); }
.stx-card > header b { text-align: center; font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stx-card > header::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: rgba(255,255,255,.18); }
@media (min-width: 700px) { .stx-card > header::before { display: none; } }
.stx-search { position: sticky; top: 56px; z-index: 2; display: flex; align-items: center; gap: 8px; margin: 0 12px 6px; padding: 0 12px; height: 40px; border-radius: 12px; background: var(--field); color: var(--muted); }
.stx-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; outline: none; }
.stx-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 14px; }
.stx-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; padding: 4px 0; border-radius: 12px; }
.stx-open img { flex: none; width: 52px; height: 52px; object-fit: contain; }
.stx-open span { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.06); flex: 1; }
.stx-open b { font-weight: 500; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stx-open small { color: var(--muted); font-size: 13px; }
.stx-pill { flex: none; padding: 6px 14px; border-radius: 16px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; min-width: 92px; display: grid; place-items: center; transition: transform .14s var(--ease-out); }
.stx-pill:active { transform: scale(.94); } .stx-pill .spin { border-color: #fff; border-right-color: transparent; width: 14px; height: 14px; }
.stx-done { flex: none; min-width: 92px; text-align: center; color: var(--muted); font-size: 14px; }
.stx-more { display: grid; place-items: center; min-height: 48px; color: var(--muted); font-size: 14px; padding: 8px 16px; text-align: center; }
.stx-pack-body { padding: 4px 10px 12px; }
.stx-pack .stx-grid { grid-template-columns: repeat(5, 1fr); gap: 4px; }
.stx-loading i { aspect-ratio: 1; border-radius: 14px; background: var(--surface-2); }
.stx-pack footer { position: sticky; bottom: 0; padding: 10px 14px 12px; background: linear-gradient(transparent, var(--surface) 30%); }
.stx-big { width: 100%; height: 50px; border-radius: 14px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; transition: transform .14s var(--ease-out); }
.stx-big:active { transform: scale(.98); } .stx-big.danger { background: var(--surface-2); color: #ff6b6b; }
.stx-note, .stx-err { text-align: center; color: var(--muted); font-size: 14px; margin: 8px 0; }
.stk-open { display: block; border-radius: 12px; }
.stk-open:active img { transform: scale(.95); }
.stk-open img { transition: transform .14s var(--ease-out); }

/* the panel itself: popup on desktop, a full-width card above the input on phones (Telegram) */
@media (max-width: 900px) {
  #panel.panel { left: 8px; right: 8px; width: auto; max-width: none; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); height: min(380px, 48dvh); border-radius: 20px; }
  html.kb #panel.panel { bottom: 76px; height: min(300px, 40dvh); }
}
@media (prefers-reduced-motion: reduce) { .stx-card { animation: fade .2s ease-out; } }
@media (max-width: 900px) {
  html.pnl #panel.panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 20; height: calc(min(330px, 44dvh) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.35); animation: sheetUp .24s var(--ease-out); }
  html.pnl .composer { bottom: calc(min(330px, 44dvh) + env(safe-area-inset-bottom, 0px) + 8px) !important; }
  html.pnl .msgs { padding-bottom: calc(min(330px, 44dvh) + 100px) !important; }
}

/* ================= Liquid Glass (iOS 26 / Telegram 12 look) =================
   One recipe for every floating control: see-through tint + strong blur and saturation, a bright rim of light
   along the top edge, a soft specular sheen, a deep but soft shadow. Content scrolls underneath and shows through. */
:root {
  --glass-bg: rgba(40, 40, 46, .42);
  --glass-strong: rgba(30, 30, 36, .62);
  --glass-rim: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(255,255,255,.04), inset 0 0 0 1px rgba(255,255,255,.07);
  --glass-shadow: 0 10px 30px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.25);
  --glass-blur: blur(26px) saturate(190%) brightness(1.08);
  --glass-sheen: linear-gradient(160deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.04) 38%, rgba(255,255,255,0) 60%);
}
.tabbar, .head .back, .head-info, .m-head .round, .inp, .stx-sheet .stx-card > header .round,
.dropdown, .ctx, .toast, .offline, #panel.panel, .stx-card, .overlay > .modal, .search {
  background-color: var(--glass-bg) !important;
  background-image: var(--glass-sheen) !important;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-rim), var(--glass-shadow) !important;
  border: 0 !important;
}
/* big surfaces need more body so text stays readable over busy content */
#panel.panel, .stx-card, .overlay > .modal, .dropdown, .ctx { background-color: var(--glass-strong) !important; }
.stx h4, .stx-card > header, .stx-search, .stx-pack footer { background: transparent !important; }
.stx-pack footer { background: linear-gradient(transparent, rgba(30,30,36,.85) 40%) !important; }
.stx-search { background: rgba(255,255,255,.07) !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
/* accent glass: send button, primary pills */
.mic, .stx-pill, .stx-big:not(.danger), .stx-cta, .tabbar button[aria-current="page"] {
  background-image: linear-gradient(160deg, rgba(255,255,255,.28), rgba(255,255,255,0) 55%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 18px rgba(109,76,219,.45);
}
.tabbar button[aria-current="page"] { background-color: rgba(255,255,255,.14) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.tabbar { border-radius: 34px; }
.head-av .av { box-shadow: var(--glass-rim), var(--glass-shadow); }
/* interactive glass: squish and brighten under the finger */
.tabbar button, .head .back, .head-info, .m-head .round, .mic, .stx-bar button, .stx-pill, .stx-big, .round {
  transition: transform .18s cubic-bezier(.23,1,.32,1), filter .18s ease;
}
.tabbar button:active, .head .back:active, .head-info:active, .m-head .round:active, .mic:active, .stx-bar button:active, .stx-pill:active, .round:active {
  transform: scale(.92); filter: brightness(1.25);
}
/* the chat list scrolls under the floating bars */
.list { padding-top: 4px; }
@media (max-width: 900px) {
  .side { background: var(--page); }
  .side::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background: radial-gradient(ellipse at 80% 0%, rgba(110,70,190,.20), transparent 55%), radial-gradient(ellipse at 10% 100%, rgba(170,60,120,.12), transparent 50%); }
  .side > * { position: relative; z-index: 1; }
  .side > .tabbar { position: absolute; z-index: 15; }
  .m-head .round { width: 40px; height: 40px; }
  .search { height: 44px; border-radius: 22px; background-color: rgba(255,255,255,.07) !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06) !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .row + .row::before { background: rgba(255,255,255,.06); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar, .inp, #panel.panel, .stx-card, .overlay > .modal, .dropdown, .ctx { background-color: rgba(34,34,40,.97) !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .tabbar, .inp, #panel.panel, .stx-card, .overlay > .modal, .dropdown, .ctx, .head-info, .head .back { background-color: rgba(34,34,40,.98) !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.stx-grid, .stx-pack .stx-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stx-grid > button, .stx-grid > .p-grid > button { min-width: 0; overflow: hidden; }
.stx-grid img { display: block; max-width: 100%; max-height: 100%; }
.stx-shop .stx-card { height: 88dvh; }
.stx-bar .stx-add { background: var(--accent) !important; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 12px rgba(109,76,219,.45) !important; }
/* phones: compact input like Telegram for iOS — 44 pt controls, tight margins, so the keyboard leaves room for the chat */
@media (max-width: 900px) {
  .composer { left: 6px; right: 6px; bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
  .composer .crow { gap: 6px; align-items: flex-end; }
  .inp { border-radius: 22px; }
  .inp-row { min-height: 44px; padding: 2px 4px 2px 2px; gap: 0; align-items: flex-end; }
  .inp-row .round { width: 40px; height: 40px; }
  .inp-row .round .ico { width: 23px; height: 23px; }
  .inp textarea { font-size: 16.5px; line-height: 1.3; padding: 10px 4px 9px; max-height: 120px; }
  .mic { width: 44px; height: 44px; } .mic .ico { width: 22px; height: 22px; }
  .msgs { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  html.kb .composer { bottom: 4px !important; }
  html.kb .msgs { padding-bottom: 58px !important; }
  /* with the keyboard up, the floating header shrinks to a slim row */
  html.kb .top { top: calc(4px + env(safe-area-inset-top, 0px)); }
  html.kb .head { height: 40px; }
  html.kb .head .back, html.kb .head-av .av { width: 38px !important; height: 38px !important; }
  html.kb .head-info { height: 38px; } html.kb .head-info span { display: none; }
  html.pnl .composer { bottom: calc(min(330px, 44dvh) + env(safe-area-inset-bottom, 0px) + 6px) !important; }
}
/* ---------- text formatting (Telegram-style) ---------- */
.bubble b { font-weight: 650; } .bubble u { text-underline-offset: 2px; }
.bubble code { font: 14.5px/1.3 ui-monospace, "SF Mono", Menlo, monospace; background: rgba(255,255,255,.12); padding: 1px 5px; border-radius: 5px; }
.spoiler { border-radius: 5px; cursor: pointer; color: transparent; text-shadow: none;
  background: rgba(255,255,255,.22) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cg fill='white' opacity='.8'%3E%3Ccircle cx='2' cy='3' r='.7'/%3E%3Ccircle cx='8' cy='2' r='.6'/%3E%3Ccircle cx='5' cy='7' r='.7'/%3E%3Ccircle cx='10' cy='9' r='.6'/%3E%3Ccircle cx='3' cy='10' r='.5'/%3E%3C/g%3E%3C/svg%3E");
  animation: spoil 1.2s linear infinite; transition: color .3s ease, background-color .3s ease; }
.spoiler.shown { color: inherit; background: rgba(255,255,255,.08); animation: none; cursor: text; }
@keyframes spoil { to { background-position: 12px 12px; } }
@media (prefers-reduced-motion: reduce) { .spoiler { animation: none; } }
.fmtbar { display: flex; gap: 2px; padding: 5px 6px 0; overflow-x: auto; scrollbar-width: none; }
.fmtbar button { flex: none; min-width: 40px; height: 34px; padding: 0 10px; border-radius: 17px; font-size: 15px; color: var(--text); background: rgba(255,255,255,.07); }
.fmtbar button:active { background: rgba(255,255,255,.18); transform: scale(.94); }
.fmtbar code { font: 13px ui-monospace, Menlo, monospace; } .spoiler-ico { letter-spacing: -1px; opacity: .8; }
/* drag a file onto the chat */
.main.drop::after { content: "Отпустите, чтобы отправить"; position: absolute; inset: 12px; z-index: 30; display: grid; place-items: center; border-radius: 24px;
  border: 2px dashed var(--accent); background: rgba(109,76,219,.18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; font-size: 20px; font-weight: 600; pointer-events: none; }
/* shop: big cards for Конвертик and the favourites */
.stx-h { margin: 14px 16px 4px; font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.stx-feat { margin: 6px 12px; padding: 12px 12px 10px; border-radius: 18px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 10px;
  background: rgba(255,255,255,.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.stx-feat .stx-open { padding: 0; } .stx-feat .stx-open span { border: 0; padding: 0; }
.stx-strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stx-strip i, .stx-strip img { aspect-ratio: 1; width: 100%; height: auto; object-fit: contain; }
.stx-strip i { border-radius: 12px; background: rgba(255,255,255,.06); }
.empty.mascot, .empty-chat { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 40px 28px; color: var(--muted); }
.empty.mascot img, .empty-chat img { width: 140px; height: 140px; object-fit: contain; margin-bottom: 6px; animation: rise .5s var(--ease-out); }
.empty.mascot b, .empty-chat b { color: var(--text); font-size: 17px; }
.empty-chat { margin: auto; padding: 18px 22px; border-radius: 22px; background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-rim); max-width: 300px; }
.pair-warn { color: #ffb4a8 !important; background: rgba(255,80,60,.12); padding: 10px 12px; border-radius: 12px; font-size: 13.5px !important; }
.contact-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.alias-form { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.muted-s { font-size: 13px !important; }
/* animated stickers: the moving layer sits exactly over the still thumbnail */
[data-live-url] { position: relative; display: grid; place-items: center; }
.live-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; display: block; }
.live-layer canvas { width: 100% !important; height: 100% !important; }
.stx-grid > button[data-live-url] .live-layer { inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
.stx-strip > span { display: grid; aspect-ratio: 1; }
.offline.authfail { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: calc(100% - 24px); text-align: center; padding: 12px 16px; border-radius: 16px; background: #5c2b2b; }
.offline.authfail .btn { width: auto; padding: 8px 18px; min-height: 0; }
.diag-list { display: flex; flex-direction: column; gap: 6px; max-height: 50dvh; overflow-y: auto; }
.diag-row { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.05); font-size: 14px; }
.diag-row span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .diag-row small { font-size: 13px; }
/* the side menu floats above the chat list (the phone background rule above made every child a positioned block) */
@media (max-width: 900px) {
  .side > .dropdown { position: absolute; z-index: 40; top: calc(56px + env(safe-area-inset-top, 0px)); left: 10px; }
}
/* menus and context menus must be readable over any content: solid glass */
.dropdown, .ctx { background-color: rgba(30,30,36,.97) !important; }
/* overlays (QR scanner, photo, menus-in-modals) must sit above the sign-in screen, which is z-index 45 */
.overlay { z-index: 60; }
.toast { z-index: 70; }
/* ---------- loading screens ---------- */
.splash { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--page); color: var(--muted); }
.splash img { width: 160px; height: 160px; object-fit: contain; animation: bob 1.6s ease-in-out infinite; }
.splash b { color: var(--text); font-size: 22px; } .splash i { width: 120px; height: 4px; border-radius: 2px; margin-top: 8px; background: linear-gradient(90deg, transparent, var(--accent), transparent) 0 0 / 50% 100% no-repeat, rgba(255,255,255,.08); animation: busy 1.1s linear infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
.first-load { position: fixed; inset: 0; z-index: 58; display: grid; place-items: center; padding: 20px; background: rgba(8,8,12,.92); animation: fade .25s ease-out; }
.first-load.out { opacity: 0; transition: opacity .3s ease; }
.fl-card { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.fl-img { width: 190px; height: 190px; object-fit: contain; animation: bob 1.8s ease-in-out infinite; }
.fl-card b { font-size: 20px; } .fl-note { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.fl-bar { width: 100%; height: 10px; border-radius: 5px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 8px; }
.fl-bar i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, #8a6ef5, #c36cf0); transition: width .4s var(--ease-out); }
.fl-st { width: 100%; display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; } .fl-pct { color: var(--text); font-weight: 600; }
.fl-tip { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.06); display: flex; flex-direction: column; gap: 4px; font-size: 14.5px; line-height: 1.4; }
.fl-tip small { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px; }
@media (prefers-reduced-motion: reduce) { .splash img, .fl-img { animation: none; } }
.fl-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; } .first-load { z-index: 58; } .first-load .btn { width: 100%; }
