/* Emberlo · Liquid-glass layer (Telegram iOS 2025-inspired, ember palette).
 * Floating capsule tab bar, circular glass header buttons + title pill, pinned bar, glass sheets & pill toasts.
 * Loaded last; overrides app.css without touching feature markup. */
:root {
  --bg: #F3EFEA; --bg2: #EAE4DC; --surface: #FFFFFF; --surface2: #F8F4EF; --line: #ECE4DA;
  --glass: rgba(255, 253, 250, .78); --glass-strong: rgba(255, 252, 248, .86); --glass-b: rgba(255, 255, 255, .85);
  --glass-sh: 0 0 0 .5px rgba(70, 40, 15, .10), 0 8px 24px rgba(70, 40, 15, .12), 0 1px 3px rgba(70, 40, 15, .08), inset 0 1px 0 rgba(255, 255, 255, .95);
  --ind: rgba(255, 255, 255, .95); --ind-sh: 0 2px 10px rgba(70, 40, 15, .10);
  --spring: cubic-bezier(.34, 1.45, .64, 1); --spring-soft: cubic-bezier(.22, 1.1, .36, 1);
  --ic-ember: #E8702F; --ic-amber: #EFA02F; --ic-sage: #56A15B; --ic-sky: #3F93CF; --ic-plum: #A55BC4; --ic-rose: #E2626A; --ic-peach: #F0874F; --ic-gray: #8F8A86;
}
[data-theme="dark"] {
  --bg: #090706; --bg2: #1B1613; --surface: #17120F; --surface2: #201A16; --line: #2A221D; --line2: #3A302A;
  --glass: rgba(40, 33, 29, .58); --glass-strong: rgba(34, 28, 24, .88); --glass-b: rgba(255, 240, 225, .10);
  --glass-sh: 0 0 0 .5px rgba(255, 240, 225, .08), 0 8px 26px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 240, 225, .10);
  --ind: rgba(255, 240, 225, .13); --ind-sh: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.glass { background: var(--glass) !important; -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8); border: .5px solid var(--glass-b); box-shadow: var(--glass-sh); }

/* ---------- Header ---------- */
.gnav { position: absolute; top: 0; left: 0; right: 0; z-index: 20; padding: 50px 12px 10px; pointer-events: none;
  background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 50%, color-mix(in srgb, var(--bg) 0%, transparent) 100%); }
.gnav > * { pointer-events: auto; }
.gnav-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; height: 48px; }
.gnav-l { display: flex; justify-content: flex-start; } .gnav-r { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.gbtn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); position: relative; flex: none; transition: transform .35s var(--spring); }
.gbtn:active, .dk-o:active, .dk-c:active, .scroll-btm:active { transform: scale(.9); }
.gbtn.wide { width: auto; display: flex; align-items: center; gap: 2px; padding: 0 14px 0 8px; border-radius: 22px; font-weight: 600; font-size: 14px; }
.gbtn.av { padding: 0; } .gbtn.av .avpair, .gbtn.av > span { transform: scale(.92); }
.gbtn.compose { background: linear-gradient(155deg, #F7A851, #E2652A); color: #fff; box-shadow: 0 8px 20px rgba(226, 101, 42, .42), inset 0 1px 0 rgba(255, 255, 255, .35); }
.gbtn.compose .ic { stroke-width: 2.4; }
.gnav-r .ibtn { width: 44px; height: 44px; background: var(--glass) !important; -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8); border: .5px solid var(--glass-b); box-shadow: var(--glass-sh); color: var(--ink); }
.g-badge, .tb-badge { position: absolute; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--ember); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); line-height: 1; font-style: normal; }
.g-badge { top: -4px; right: -4px; }
.gpill { height: 44px; border-radius: 22px; padding: 0 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 0; max-width: 232px; animation: pillIn .5s var(--spring); }
.gpill b { font-size: 16px; font-weight: 650; letter-spacing: -.01em; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.gpill small { font-size: 11.5px; color: var(--muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
@keyframes pillIn { from { transform: scale(.92); opacity: .4; } }
.pinbar { width: 100%; margin-top: 8px; height: 54px; border-radius: 22px; display: flex; align-items: center; gap: 10px; padding: 0 14px 0 12px; text-align: left; color: var(--ink); }
.pin-line { width: 3px; height: 32px; border-radius: 2px; background: var(--ember); flex: none; }
.pin-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--ember-soft); color: var(--ember-ink); display: grid; place-items: center; flex: none; }
.pin-b { flex: 1; min-width: 0; } .pin-b b { display: block; font-size: 13.5px; color: var(--ember-ink); font-weight: 650; }
.pin-b small { display: block; font-size: 13px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinbar > .ic:last-child { color: var(--muted); }

/* ---------- Content under translucent bars ---------- */
.app:not(.nohead) .scr { padding-top: 110px; }
.app.has-pin .scr { padding-top: 172px; }
.app.has-tabs .scr-pad, .app.has-dock .scr-pad { height: 118px; }
.big-t { font-size: 32px; font-weight: 750; letter-spacing: -.03em; line-height: 1.15; margin: 4px 2px 2px; }
.date-line { margin: 2px 2px 14px !important; }
.scr.anim-push { animation: push .48s var(--spring-soft); } .scr.anim-pop { animation: pop .42s var(--spring-soft); }

/* ---------- Floating capsule tab bar ---------- */
.tabbar { position: absolute; left: 14px; right: 14px; bottom: 24px; top: auto; height: 64px; padding: 4px; border-radius: 32px; display: grid; grid-template-columns: repeat(var(--n), 1fr); align-items: stretch; z-index: 30; border-top: 0; }
.tab-ind { position: absolute; top: 4px; bottom: 4px; left: calc(4px + var(--i) * ((100% - 8px) / var(--n))); width: calc((100% - 8px) / var(--n)); border-radius: 28px; background: var(--ind); box-shadow: var(--ind-sh); transition: left .6s var(--spring); }
.tab { position: relative; z-index: 1; width: auto; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--ink2); }
.tab.on { color: var(--ember); } .tab.on .ic { stroke-width: 2.3; }
.tb-ic { position: relative; display: grid; place-items: center; transition: transform .4s var(--spring); } .tab:active .tb-ic { transform: scale(.82); } .tab.on .tb-ic { animation: tabPop .55s var(--spring); }
@keyframes tabPop { 40% { transform: scale(1.14); } }
.tb-badge { top: -6px; left: 14px; } .tb-badge.mute { background: var(--ic-gray); }
.home-ind { bottom: 7px; }
[data-theme="dark"] .home-ind { background: #fff; }

/* ---------- Detail dock: circle · pill CTA · circle ---------- */
.dock { position: absolute; left: 14px; right: 14px; bottom: 26px; display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 30; }
.dk-o { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); flex: none; transition: transform .35s var(--spring); }
.dk-c { flex: 0 1 230px; height: 52px; border-radius: 26px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; font-size: 16px; color: var(--ember-ink); padding: 0 18px; transition: transform .35s var(--spring); white-space: nowrap; }
.dk-c .ic { color: var(--ember); } .dk-sp { width: 52px; flex: none; }
.scroll-btm { position: absolute; right: 18px; bottom: 102px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; z-index: 25; color: var(--ink2); transition: transform .35s var(--spring); }
.scroll-btm b { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--ember); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }

/* ---------- Lists: grouped inset, colored icon squares, chat rows ---------- */
.list:not(.wg) { border-radius: 22px; box-shadow: none; background: var(--surface); border: .5px solid var(--line); }
.row { padding: 10px 16px; min-height: 52px; gap: 13px; }
.list .row + .row::before { left: 61px; border-top-color: var(--line); }
.row-t { font-size: 15.5px; } .row-s { font-size: 13px; }
.row-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--ic-gray); color: #fff; }
.row-ic .ic { stroke-width: 2.1; }
.row-ic.ember { background: var(--ic-ember); color: #fff; } .row-ic.amber { background: var(--ic-amber); color: #fff; } .row-ic.sage { background: var(--ic-sage); color: #fff; }
.row-ic.sky { background: var(--ic-sky); color: #fff; } .row-ic.plum { background: var(--ic-plum); color: #fff; } .row-ic.rose { background: var(--ic-rose); color: #fff; } .row-ic.peach { background: var(--ic-peach); color: #fff; }
.row-r { color: var(--muted); font-size: 15px; }
.warn-b { width: 22px; height: 22px; border-radius: 50%; background: var(--ic-ember); color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; }
.row.chat { align-items: center; padding: 9px 14px 9px 12px; min-height: 74px; gap: 12px; }
.list .row.chat + .row::before { left: 74px; }
.row.chat .row-b { display: flex; flex-direction: column; gap: 3px; }
.cr-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cr-top .row-t { font-weight: 650; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cr-top .row-time { flex: none; font-size: 13px; }
.cr-bot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.cr-prev { font-size: 13.5px; color: var(--muted); line-height: 1.38; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 0; }
.cr-prev .src { vertical-align: 1px; } .cr-prev .pk { color: var(--plum); }
.cr-amt { flex: none; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 12px; background: var(--bg2); color: var(--ink); }
.cr-amt.in { background: var(--sage-soft); color: var(--sage); }
.row.chat .row-av { width: 50px; height: 50px; }
.row.jarrow .jar-ic { width: 46px; height: 46px; border-radius: 50%; }
.row.jarrow .row-r { gap: 4px; } .row.jarrow .money { font-size: 14.5px; }
.cnt { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--bg2); color: var(--ink2); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.row.unread::after { left: 4px; }
.sec-h h3 { font-size: 12.5px; letter-spacing: .04em; margin-left: 6px; }

/* ---------- Cards, jars, banners ---------- */
.card, .jar, .pocket, .sg, .nb-hero { border-radius: 22px !important; box-shadow: none !important; border: .5px solid var(--line); }
.nb-hero { box-shadow: 0 10px 30px rgba(226, 101, 42, .10) !important; }
.card.gift { position: relative; padding-right: 44px; border: .5px solid var(--glass-b); background: var(--glass) !important; -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); box-shadow: var(--glass-sh) !important; }
.gift-x { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: transparent; }
.gift-x:hover { background: var(--bg2); }

/* ---------- Buttons: capsules ---------- */
.btn { height: 52px; border-radius: 26px !important; transition: transform .35s var(--spring), opacity .2s; } .btn:active { transform: scale(.96); }
.btn.sm { height: 36px; border-radius: 18px !important; }
.chip { transition: background .25s, color .25s, transform .35s var(--spring); } .chip:active { transform: scale(.94); }

/* ---------- Glass sheets with grabber ---------- */
.sheet-bg { background: rgba(15, 8, 4, .30); }
.sheet { margin: 0 6px 6px; border-radius: 34px !important; background: var(--glass-strong); -webkit-backdrop-filter: blur(34px) saturate(1.8); backdrop-filter: blur(34px) saturate(1.8); border: .5px solid var(--glass-b); box-shadow: 0 -10px 50px rgba(0, 0, 0, .22); max-height: 86%; }
.sheet-wrap.enter .sheet { animation: sheetIn .55s var(--spring-soft); }
.grab { width: 40px; height: 5px; background: var(--muted); opacity: .45; margin-top: 8px; }
.sheet-h { padding: 10px 14px 4px 22px; }
.sheet-h .ibtn { width: 34px; height: 34px; background: var(--bg2) !important; border-radius: 50%; }
.sheet-wrap.full .sheet { margin: 0; border-radius: 0 !important; background: var(--bg); }
.sheet .list { background: var(--surface); }

/* ---------- Pill toasts ---------- */
.toast { left: 50%; right: auto; top: 104px; width: max-content; max-width: 330px; border-radius: 24px; padding: 10px 16px; background: var(--glass-strong); color: var(--ink); -webkit-backdrop-filter: blur(26px) saturate(1.8); backdrop-filter: blur(26px) saturate(1.8); border: .5px solid var(--glass-b); box-shadow: var(--glass-sh); transform: translate(-50%, -150px) scale(.9); transition: transform .6s var(--spring); line-height: 1.35; }
.toast.in { transform: translate(-50%, 0) scale(1); } .toast .ic { color: var(--ember); flex: none; }

/* ---------- Inputs ---------- */
.inp { border-radius: 14px; }
.search { border-radius: 14px; background: var(--surface); border: .5px solid var(--line); }
[data-theme="dark"] .jar-hero, [data-theme="dark"] .tx-hero { background: transparent; }

/* ---------- Mobile (full-screen app) ---------- */
body.mobile .tabbar { bottom: max(16px, env(safe-area-inset-bottom)); }
body.mobile .dock { bottom: max(18px, env(safe-area-inset-bottom)); }
body.mobile #fab-panel { bottom: auto !important; top: 112px !important; right: 8px !important; width: 40px !important; height: 40px !important; }
.pn-appic { border-radius: 10px; flex: none; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
