/* Intersect Messenger: liquid glass UI */
:root {
  --accent: #7b8cff;
  --accent-rgb: 123, 140, 255;
  --bg-base: #0b0d14;
  --bg-custom: #0b0d14;
  --text: #f4f6ff;
  --text-dim: rgba(244, 246, 255, .62);
  --glass: rgba(255, 255, 255, .075);
  --glass-strong: rgba(255, 255, 255, .13);
  --glass-border: rgba(255, 255, 255, .18);
  --glass-hi: rgba(255, 255, 255, .35);
  --bubble-in: rgba(255, 255, 255, .11);
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
  --orb-a: rgba(var(--accent-rgb), .55);
  --orb-b: rgba(190, 90, 255, .42);
  --orb-c: rgba(40, 200, 220, .35);
  --pat: rgba(255, 255, 255, .09);
  --danger: #ff5d6c;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg-base: #eaeefa; --text: #141726; --text-dim: rgba(20, 23, 38, .6);
    --glass: rgba(255, 255, 255, .5); --glass-strong: rgba(255, 255, 255, .72); --glass-border: rgba(255, 255, 255, .85); --glass-hi: rgba(255, 255, 255, 1);
    --bubble-in: rgba(255, 255, 255, .62); --shadow: 0 10px 34px rgba(60, 70, 120, .18);
    --orb-a: rgba(var(--accent-rgb), .45); --orb-b: rgba(255, 150, 200, .5); --orb-c: rgba(80, 210, 230, .45); --pat: rgba(20, 30, 80, .1);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg-base: #eaeefa; --text: #141726; --text-dim: rgba(20, 23, 38, .6);
  --glass: rgba(255, 255, 255, .5); --glass-strong: rgba(255, 255, 255, .72); --glass-border: rgba(255, 255, 255, .85); --glass-hi: rgba(255, 255, 255, 1);
  --bubble-in: rgba(255, 255, 255, .62); --shadow: 0 10px 34px rgba(60, 70, 120, .18);
  --orb-a: rgba(var(--accent-rgb), .45); --orb-b: rgba(255, 150, 200, .5); --orb-c: rgba(80, 210, 230, .45); --pat: rgba(20, 30, 80, .1);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg-base); color: var(--text); overflow: hidden;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- background ---------- */
#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--bg-base); }
body[data-bg="solid"] #bg { background: var(--bg-custom); }
body[data-bg="image"] #bg { background: var(--bg-base) var(--bg-image) center / cover no-repeat; }
.orbs i { position: absolute; border-radius: 50%; filter: blur(70px); animation: float 26s ease-in-out infinite alternate; }
.orbs i:nth-child(1) { width: 60vmax; height: 60vmax; left: -15vmax; top: -15vmax; background: var(--orb-a); }
.orbs i:nth-child(2) { width: 55vmax; height: 55vmax; right: -20vmax; bottom: -15vmax; background: var(--orb-b); animation-duration: 32s; }
.orbs i:nth-child(3) { width: 38vmax; height: 38vmax; left: 35%; top: 30%; background: var(--orb-c); animation-duration: 38s; }
body[data-bg="solid"] .orbs, body[data-bg="image"] .orbs { opacity: .35; }
@keyframes float { to { transform: translate3d(8vmax, 6vmax, 0) scale(1.15); } }
.pat { position: absolute; inset: 0; pointer-events: none; }
.pat[data-p="dots"] { background-image: radial-gradient(var(--pat) 1.6px, transparent 1.7px); background-size: 22px 22px; }
.pat[data-p="grid"] { background-image: linear-gradient(var(--pat) 1px, transparent 1px), linear-gradient(90deg, var(--pat) 1px, transparent 1px); background-size: 34px 34px; }
.pat[data-p="stripes"] { background-image: repeating-linear-gradient(45deg, var(--pat) 0 2px, transparent 2px 16px); }
.pat[data-p="diamonds"] { background-image: conic-gradient(from 45deg at 50% 50%, var(--pat) 0 25%, transparent 0 50%, var(--pat) 0 75%, transparent 0); background-size: 36px 36px; opacity: .6; }
.pat[data-p="waves"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cpath d='M0 20 Q30 0 60 20 T120 20' fill='none' stroke='white' stroke-opacity='.18' stroke-width='1.6'/%3E%3C/svg%3E"); background-size: 120px 40px; }
:root[data-theme="light"] .pat[data-p="waves"] { filter: invert(1); opacity: .5; }
.pat[data-p="aurora"], .pat[data-p="solid"], .pat[data-p="image"] { display: none; }
.pat.thumb { position: relative; width: 100%; height: 100%; display: block !important; border-radius: inherit; background-color: rgba(120, 130, 200, .25); }

/* ---------- glass primitives ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(180%); backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 rgba(255, 255, 255, .04);
}
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; transition: background .2s, transform .15s; }
.icon-btn:hover { background: var(--glass-strong); }
.icon-btn:active { transform: scale(.92); }
.btn { padding: 12px 20px; border-radius: 16px; font-weight: 600; background: rgba(var(--accent-rgb), .85); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 6px 20px rgba(var(--accent-rgb), .35); transition: transform .15s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn.ghost { background: var(--glass-strong); box-shadow: inset 0 1px 0 var(--glass-hi); color: var(--text); }
.btn.danger { background: rgba(255, 93, 108, .85); box-shadow: none; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }
.input { width: 100%; padding: 13px 16px; border-radius: 16px; border: 1px solid var(--glass-border); background: var(--glass); outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: rgba(var(--accent-rgb), .8); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .22); }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }
.muted { color: var(--text-dim); font-size: 13px; }
.row-flex { display: flex; gap: 10px; align-items: center; }

/* ---------- avatar ---------- */
.avatar { border-radius: 50%; background: linear-gradient(135deg, rgba(var(--accent-rgb), .9), rgba(190, 90, 255, .8)); display: grid; place-items: center; color: #fff; font-weight: 700; overflow: hidden; flex: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 4px 14px rgba(0, 0, 0, .25); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- screens ---------- */
#root { position: relative; z-index: 1; height: var(--vvh, 100dvh); }
.center-screen { height: 100%; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); overflow: auto; }
.card { width: min(420px, 100%); padding: 30px 26px; border-radius: 32px; animation: pop .55s cubic-bezier(.2, .9, .25, 1.1) both; }
.card h1 { margin: 14px 0 4px; font-size: 28px; letter-spacing: -.02em; }
.card .sub { margin: 0 0 22px; color: var(--text-dim); }
.logo { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(var(--accent-rgb), .9), rgba(190, 90, 255, .85)); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 10px 30px rgba(var(--accent-rgb), .45); }
.logo svg { width: 30px; height: 30px; }
.steps { padding-left: 20px; line-height: 1.7; color: var(--text); }
.link { color: var(--text-dim); font-size: 14px; text-decoration: underline; margin-top: 14px; display: inline-block; }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.94); filter: blur(8px); } }

/* ---------- app layout ---------- */
.app { height: 100%; display: flex; position: relative; overflow: hidden; }
.sidebar { width: 360px; flex: none; display: flex; flex-direction: column; margin: 12px 0 12px 12px; border-radius: 30px; overflow: hidden; padding-top: env(safe-area-inset-top); }
.side-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 8px; }
.side-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; flex: 1; }
.side-search { padding: 4px 14px 10px; }
.list { flex: 1; overflow-y: auto; padding: 4px 8px 14px; }
.item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px; border-radius: 20px; text-align: left; transition: background .2s; }
.item:hover, .item.active { background: var(--glass-strong); }
.item .meta { flex: 1; min-width: 0; }
.item .name { font-weight: 650; display: flex; justify-content: space-between; gap: 8px; }
.item .time { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.item .prev { font-size: 14px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; justify-content: space-between; gap: 8px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: rgb(var(--accent-rgb)); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }
.empty { text-align: center; color: var(--text-dim); padding: 40px 20px; }

.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.chat-head { display: flex; align-items: center; gap: 10px; margin: max(10px, env(safe-area-inset-top)) 12px 0; padding: 8px 10px 8px 8px; border-radius: 26px; z-index: 5; }
.chat-head .who { flex: 1; min-width: 0; }
.chat-head .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .status { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 5px; }
.chat-head .back { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 3px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.msgs .spacer { flex: 1; }
.day { align-self: center; font-size: 12px; font-weight: 600; color: var(--text-dim); padding: 5px 12px; border-radius: 12px; margin: 12px 0 6px; background: var(--glass); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.hello { align-self: center; text-align: center; color: var(--text-dim); font-size: 13px; padding: 10px 18px; max-width: 320px; margin: auto; }

.row { display: flex; flex-direction: column; max-width: 100%; }
.row.mine { align-items: flex-end; }
.row.theirs { align-items: flex-start; }
.row.gap-top { margin-top: 8px; }
.bubble {
  position: relative; max-width: min(78%, 520px); padding: 9px 13px 7px; border-radius: 22px; line-height: 1.38; font-size: 16px; word-wrap: break-word; overflow-wrap: anywhere;
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  border: 1px solid var(--glass-border); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-y;
  transition: transform .15s;
}
.bubble:active { transform: scale(.985); }
.theirs .bubble { background: var(--bubble-in); border-bottom-left-radius: 7px; box-shadow: inset 0 1px 0 var(--glass-hi), 0 4px 18px rgba(0, 0, 0, .12); }
.mine .bubble { background: linear-gradient(135deg, rgba(var(--accent-rgb), .78), rgba(var(--accent-rgb), .5)); color: #fff; border-color: rgba(255, 255, 255, .28); border-bottom-right-radius: 7px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 22px rgba(var(--accent-rgb), .28); }
.bubble.media { padding: 4px; }
.bubble.sticker { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; }
.bubble.big-emoji { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; font-size: 46px; line-height: 1.15; padding: 0 2px; }
.bubble .txt { white-space: pre-wrap; }
.bubble .foot { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; opacity: .72; margin-top: 2px; float: right; margin-left: 12px; position: relative; top: 3px; }
.bubble.media .foot, .bubble.sticker .foot { position: absolute; right: 10px; bottom: 8px; margin: 0; top: auto; padding: 2px 7px; border-radius: 10px; background: rgba(0, 0, 0, .38); color: #fff; opacity: 1; }
.bubble.sticker .foot { display: none; }
.bubble .foot svg { width: 14px; height: 14px; }
.bubble .foot .fail { color: #ffd0d4; cursor: pointer; }
.bubble.media img, .bubble.media video { display: block; max-width: 100%; border-radius: 18px; background: rgba(0, 0, 0, .2); }
.bubble.media img { cursor: zoom-in; max-height: 380px; width: auto; }
.bubble.media video { max-height: 420px; width: 100%; }
.bubble.sticker img { width: 150px; height: auto; display: block; }
.bubble .gifimg { border-radius: 18px; max-width: 260px; width: 100%; height: auto; }
.ph { display: grid; place-items: center; min-width: 160px; min-height: 120px; color: var(--text-dim); font-size: 13px; border-radius: 18px; background: rgba(0, 0, 0, .15); }
.prog { position: absolute; left: 8px; right: 8px; bottom: 6px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: #fff; transition: width .15s; }
.chips { display: flex; gap: 4px; margin: -8px 10px 0; position: relative; z-index: 1; }
.chip { padding: 1px 7px; border-radius: 12px; font-size: 14px; background: var(--glass-strong); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: pop .35s both; }
.row.has-chips { margin-bottom: 8px; }

.file { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 4px; min-width: 200px; text-decoration: none; }
.file .ficon { width: 42px; height: 42px; border-radius: 14px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; }
.file .fname { font-weight: 600; font-size: 15px; word-break: break-all; }
.file .fsize { font-size: 12px; opacity: .75; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 2px 6px 2px 2px; }
.voice .pbtn { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .25); display: grid; place-items: center; flex: none; }
.voice .bars { flex: 1; height: 26px; display: flex; align-items: center; gap: 2px; }
.voice .bars i { flex: 1; border-radius: 2px; background: currentColor; opacity: .35; transition: opacity .1s; min-height: 4px; }
.voice .bars i.on { opacity: 1; }
.voice .dur { font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; width: 34px; text-align: right; }

/* ---------- composer ---------- */
.composer-wrap { padding: 6px 12px max(12px, env(safe-area-inset-bottom)); position: relative; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 6px; border-radius: 30px; }
.composer .inputwrap { flex: 1; display: flex; align-items: flex-end; border-radius: 24px; background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-border); padding-right: 4px; min-width: 0; }
.composer textarea { flex: 1; border: 0; outline: 0; background: none; resize: none; padding: 11px 6px 11px 16px; max-height: 140px; line-height: 1.35; font-size: 16px; min-width: 0; }
.composer textarea::placeholder { color: var(--text-dim); }
.send { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--accent-rgb), .9); color: #fff; flex: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 4px 16px rgba(var(--accent-rgb), .4); transition: transform .2s cubic-bezier(.3, 1.5, .5, 1); }
.send:active { transform: scale(.88); }
.send.mic { background: var(--glass-strong); color: var(--text); box-shadow: inset 0 1px 0 var(--glass-hi); }
.rec { display: none; flex: 1; align-items: center; gap: 10px; padding: 0 10px; min-height: 42px; }
.rec .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
.rec .t { font-variant-numeric: tabular-nums; font-weight: 600; }
.rec .hint { flex: 1; color: var(--text-dim); font-size: 14px; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.composer.recording .inputwrap, .composer.recording #attachBtn { display: none; }
.composer.recording .rec { display: flex; }

.drawer { position: absolute; left: 12px; right: 12px; bottom: calc(100% - 4px); border-radius: 28px; height: min(340px, 46dvh); display: none; flex-direction: column; overflow: hidden; z-index: 6; }
.drawer.open { display: flex; animation: rise .3s cubic-bezier(.2, .9, .25, 1.1); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.tabs { display: flex; gap: 4px; padding: 8px 10px 4px; overflow-x: auto; }
.tabs button { padding: 6px 12px; border-radius: 14px; font-size: 18px; opacity: .6; flex: none; }
.tabs button.on { background: var(--glass-strong); opacity: 1; }
.egrid { flex: 1; overflow-y: auto; padding: 6px 10px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 2px; align-content: start; }
.egrid button { font-size: 27px; padding: 4px; border-radius: 12px; }
.egrid button:active { background: var(--glass-strong); transform: scale(1.2); }
.gsearch { padding: 10px 12px 4px; }
.ggrid { flex: 1; overflow-y: auto; padding: 6px 10px 12px; columns: 3; column-gap: 6px; }
.ggrid .g { break-inside: avoid; margin-bottom: 6px; border-radius: 14px; overflow: hidden; display: block; width: 100%; background: rgba(255, 255, 255, .08); }
.ggrid .g img { width: 100%; display: block; }
.ggrid.stk .g { background: rgba(255, 255, 255, .04); }
.ggrid .note { column-span: all; text-align: center; padding: 18px; color: var(--text-dim); font-size: 14px; }

/* ---------- popovers / sheets ---------- */
.menu { position: absolute; bottom: calc(100% - 4px); left: 12px; border-radius: 22px; padding: 6px; display: none; z-index: 7; min-width: 190px; }
.menu.open { display: block; animation: rise .25s cubic-bezier(.2, .9, .25, 1.1); }
.menu button, .ctx .acts button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-radius: 16px; text-align: left; font-weight: 550; }
.menu button:hover, .ctx .acts button:hover { background: var(--glass-strong); }
.menu button svg { color: rgb(var(--accent-rgb)); }
.ctx-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.ctx-wrap.in { opacity: 1; }
.ctx { position: absolute; display: flex; flex-direction: column; gap: 8px; width: 240px; animation: pop .3s cubic-bezier(.2, .9, .25, 1.15) both; }
.ctx .rx { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 26px; }
.ctx .rx button { font-size: 26px; width: 38px; height: 38px; border-radius: 50%; transition: transform .15s; }
.ctx .rx button:hover { transform: scale(1.25) translateY(-3px); }
.ctx .rx button.sel { background: rgba(var(--accent-rgb), .45); }
.ctx .acts { border-radius: 22px; padding: 5px; }
.ctx .acts .del { color: var(--danger); }

.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0); transition: background .25s; }
.sheet-wrap.in { background: rgba(0, 0, 0, .4); }
.sheet-wrap.center { align-items: center; }
.sheet { width: min(520px, 100%); max-height: 88dvh; border-radius: 32px 32px 0 0; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .38s cubic-bezier(.2, .9, .25, 1.05); background: var(--glass-strong); padding-bottom: env(safe-area-inset-bottom); }
.sheet-wrap.in .sheet { transform: none; }
.sheet-wrap.center .sheet { border-radius: 32px; width: min(440px, calc(100% - 28px)); transform: translateY(30px) scale(.94); opacity: 0; transition: transform .35s cubic-bezier(.2, .9, .25, 1.1), opacity .25s; }
.sheet-wrap.center.in .sheet { transform: none; opacity: 1; }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 32px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px 24px; }
.sheet-head h3 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.sheet-body { padding: 8px 22px 24px; overflow-y: auto; }
.sec { margin: 20px 0 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.seg { display: flex; padding: 4px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-border); gap: 4px; }
.seg button { flex: 1; padding: 9px 6px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.seg button.on { background: rgba(var(--accent-rgb), .85); color: #fff; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); box-shadow: 0 3px 10px rgba(0, 0, 0, .25); }
.sw.on { outline: 3px solid var(--text); outline-offset: 2px; }
.sw-color { width: 34px; height: 34px; border: 0; padding: 0; border-radius: 50%; background: none; overflow: hidden; }
.bgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bgs button { aspect-ratio: 1; border-radius: 16px; overflow: hidden; position: relative; border: 2px solid var(--glass-border); background: var(--bg-base); font-size: 11px; font-weight: 700; display: grid; place-items: end center; padding-bottom: 5px; color: var(--text); }
.bgs button.on { border-color: rgb(var(--accent-rgb)); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .35); }
.bgs .thumb { position: absolute; inset: 0; }
.bgs span { position: relative; z-index: 1; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); color: #fff; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--glass-border); }
.list-row:last-child { border: 0; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 9px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-border); font-weight: 600; font-size: 14px; }
.pill.on { background: rgba(var(--accent-rgb), .85); color: #fff; }
.creds { padding: 14px; border-radius: 18px; background: rgba(0, 0, 0, .18); font-family: ui-monospace, Menlo, monospace; font-size: 14px; line-height: 1.7; word-break: break-all; user-select: text; -webkit-user-select: text; }
.countdown { height: 6px; border-radius: 6px; background: var(--glass); overflow: hidden; margin: 6px 0 16px; }
.countdown i { display: block; height: 100%; background: var(--danger); width: 100%; transition: width 1s linear; }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .86); display: grid; place-items: center; animation: fade .2s; }
.lightbox img { max-width: 96vw; max-height: 90dvh; border-radius: 12px; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; top: max(14px, env(safe-area-inset-top)); left: 0; right: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 11px 18px; border-radius: 20px; font-weight: 550; font-size: 14px; opacity: 0; transform: translateY(-14px) scale(.95); transition: all .3s cubic-bezier(.2, .9, .25, 1.2); max-width: 88vw; background: var(--glass-strong); }
.toast.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .sidebar { position: absolute; inset: 0; width: auto; margin: 0; border-radius: 0; border: 0; transition: transform .4s cubic-bezier(.2, .9, .25, 1); background: transparent; box-shadow: none; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
  .app.admin .chat { position: absolute; inset: 0; transform: translateX(100%); transition: transform .4s cubic-bezier(.2, .9, .25, 1); }
  .app.admin.in-chat .chat { transform: none; }
  .app.admin.in-chat .sidebar { transform: translateX(-30%); }
  .app.admin .chat-head .back { display: grid; }
  .bubble { max-width: 84%; }
}
.nochat { flex: 1; display: grid; place-items: center; color: var(--text-dim); }
@media (max-width: 820px) { .nochat { display: none; } }
::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-thumb { background: var(--glass-strong); border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
