/* The Chat page: group rooms and private messages that are end-to-end encrypted over TapeRelay. */
body.on-chat .cx-fab, body.on-chat .cx { display: none; }
body.on-chat .foot { display: none; }
.ch { display: grid; grid-template-columns: 320px minmax(0, 1fr) 300px; gap: 14px; height: calc(100dvh - 128px); min-height: 520px; }
.ch > .card { padding: 0; margin: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.ch-side-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 16px 10px; }
.ch-side-h h2 { font: 700 22px var(--fh); }
.tr-pill { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 8px; border-radius: 99px; font-size: 11.5px; border: 1px solid var(--line); background: var(--card2); color: var(--muted); white-space: nowrap; }
.tr-pill svg { width: 13px; height: 13px; }
.tr-pill b { color: var(--ink2); font-weight: 700; }
.tr-pill i { font-style: normal; }
.tr-pill.on { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); background: var(--good-soft); color: var(--good); }
.tr-pill.on b { color: var(--good); }
.tr-pill.wait svg { animation: lkPulse 1.2s ease-in-out infinite; }
@keyframes lkPulse { 50% { opacity: .35; } }
.ch-search { display: flex; align-items: center; gap: 8px; margin: 0 14px 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); color: var(--muted); }
.ch-search svg { width: 16px; height: 16px; flex: none; }
.ch-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 14px; color: var(--ink); }
.ch-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px 16px; overscroll-behavior: contain; }
.ch-sec { display: flex; align-items: center; gap: 8px; padding: 14px 8px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ch-e2e { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; letter-spacing: 0; text-transform: none; font-weight: 600; font-size: 10.5px; color: var(--good); }
.ch-e2e svg { width: 11px; height: 11px; }
.ch-row { position: relative; width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 14px; text-align: left; transition: background .15s; }
.ch-row:hover { background: var(--card2); }
.ch-row.on { background: var(--accent-soft); }
.ch-row.on::before { content: ''; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); }
.ch-ico { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #eeeeee; background: linear-gradient(140deg, #525252, #282828); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
.ch-ico.match { background: linear-gradient(140deg, #6e6e6e, #424242); }
.ch-ico svg { width: 20px; height: 20px; }
.ch-ico.lg { width: 44px; height: 44px; }
.ch-av { position: relative; flex: none; }
.ch-av img.av.sm { width: 42px; height: 42px; box-shadow: none; }
.ch-av.lg img.av.sm { width: 44px; height: 44px; }
.ch-av i { position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 2px var(--card); opacity: .6; }
.ch-av i.on { background: #3fbf6a; opacity: 1; }
.ch-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ch-tt b { display: flex; align-items: center; gap: 4px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-tt b em { font-style: normal; font-weight: 600; font-size: 11px; color: var(--muted); }
.ch-tt b .flag { width: 16px; height: 11px; }
.ch-tt small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-lk { display: inline-flex; vertical-align: -1px; margin-right: 4px; color: var(--good); }
.ch-lk svg { width: 11px; height: 11px; }
.ch-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; font-size: 11px; color: var(--muted); }
.ch-on { font-size: 10.5px; font-weight: 700; color: var(--good); }
.ch-none { padding: 6px 10px 10px; font-size: 12.5px; color: var(--muted); }

/* conversation */
.ch-main { position: relative; }
.ch-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ch-back { display: none; width: 36px; height: 36px; border-radius: 50%; place-items: center; color: var(--ink2); flex: none; }
.ch-back svg { width: 18px; height: 18px; }
.ch-ht { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-ht b { display: flex; align-items: center; gap: 4px; font-size: 15.5px; white-space: nowrap; overflow: hidden; }
.ch-ht b .flag { width: 18px; height: 13px; }
.ch-ht small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.g { color: var(--good); font-weight: 600; }
.ch-stack { display: flex; align-items: center; padding-left: 8px; }
.ch-stack img.av.sm { width: 28px; height: 28px; margin-left: -8px; box-shadow: 0 0 0 2px var(--card); }
.ch-stack span { margin-left: 6px; font-size: 11.5px; font-weight: 700; color: var(--ink2); }
.ch-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ch-badge svg { width: 13px; height: 13px; }
.ch-badge.on { color: var(--good); background: var(--good-soft); border: 1px solid color-mix(in srgb, var(--good) 40%, transparent); }
.ch-badge.wait { color: var(--warn); background: var(--warn-soft); }
.ch-badge.wait svg { animation: lkPulse 1.2s ease-in-out infinite; }
.ch-badge.off { color: var(--muted); background: var(--card2); border: 1px solid var(--line); }
.ch-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(120% 60% at 50% 0%, var(--glow), transparent 70%); }
.ch-body .cx-list { padding: 8px 18px 16px; }
.ch-body .cm-b { max-width: min(78%, 560px); }
.ch-e2e-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 18px 0; padding: 10px 12px; border-radius: 12px; font-size: 12px; line-height: 1.45; color: var(--ink2); background: color-mix(in srgb, var(--good-soft) 70%, transparent); border: 1px dashed color-mix(in srgb, var(--good) 40%, transparent); }
.ch-e2e-note svg { flex: none; width: 15px; height: 15px; margin-top: 1px; color: var(--good); }
.ch-form { padding: 12px 14px; }
.ch-blank { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 40px; color: var(--muted); }
.ch-blank > b { font-size: 18px; color: var(--ink); }
.ch-blank small { max-width: 380px; font-size: 13.5px; line-height: 1.55; }
.ch-orb { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: var(--good); background: var(--good-soft); box-shadow: 0 0 0 12px color-mix(in srgb, var(--good-soft) 50%, transparent); margin-bottom: 14px; animation: orb 3s ease-in-out infinite; }
.ch-orb svg { width: 36px; height: 36px; }
@keyframes orb { 50% { box-shadow: 0 0 0 22px color-mix(in srgb, var(--good-soft) 15%, transparent); } }

/* message extras */
.cm-lk { display: inline-flex; vertical-align: -1px; margin-right: 3px; color: var(--good); }
.cm.me .cm-lk { color: #9fe0b0; }
.cm-lk svg { width: 10px; height: 10px; }
.cm.sending .cm-b { opacity: .7; }
.cm-sys { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px auto 4px; width: max-content; max-width: 90%; padding: 5px 12px; border-radius: 99px; font-size: 12px; color: var(--muted); background: var(--card2); border: 1px solid var(--line); }
.cm-sys.ok { color: var(--good); background: var(--good-soft); border-color: transparent; }
.cm-sys svg { width: 12px; height: 12px; }
.cm-sys i { display: inline-flex; }
.cm-sys time { font-size: 10px; opacity: .6; }
.cm-sys.new { animation: cmIn .35s both; }

/* match proposal card */
.cm.offer .cm-b, .cm.me.offer .cm-b { width: 300px; max-width: 92%; padding: 0 0 6px; overflow: hidden; }
.cm.offer .cm-b time { padding-right: 12px; }
.of { display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 4px; }
.of-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.of-h svg { width: 15px; height: 15px; color: var(--gold); }
.of-tag { margin-left: auto; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--card2); color: var(--muted); }
.of.agreed .of-tag { background: var(--good-soft); color: var(--good); }
.of.declined { opacity: .65; }
.of-main { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 18%, var(--card2)), var(--card2)); border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); }
.of-amt { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.of-amt .tk { width: 22px; height: 22px; margin: 0 0 2px; }
.of-amt b { font: 700 22px/1 var(--fh); }
.of-amt small { font-size: 10px; color: var(--muted); }
.of-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink2); }
.of-meta span { display: flex; align-items: center; gap: 6px; }
.of-meta svg { width: 13px; height: 13px; color: var(--muted); }
.of-cd { text-align: center; font: 700 12.5px ui-monospace, Consolas, monospace; color: var(--accent); padding: 6px; border-radius: 10px; background: var(--accent-soft); }
.of-cd.due { color: #fff; background: var(--good); animation: lkPulse 1.4s ease-in-out infinite; }
.of-st { display: block; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 7px; border-radius: 10px; background: var(--card2); }
.of-btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.of-btns svg { width: 14px; height: 14px; }
.of-sheet { position: absolute; left: 12px; right: 12px; bottom: 8px; z-index: 5; display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .45); animation: cmIn .3s cubic-bezier(.2, 1.1, .3, 1); }
.of-sheet[hidden] { display: none; }
.of-sh-h { display: flex; align-items: center; justify-content: space-between; }
.of-sh-h b { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.of-sh-h svg { width: 16px; height: 16px; color: var(--gold); }
.of-sheet > small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.of-row { display: flex; flex-wrap: wrap; gap: 6px; }
.of-chip { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border-radius: 99px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--card2); color: var(--ink2); cursor: pointer; }
.of-chip .tk, .of-chip svg { width: 15px; height: 15px; margin: 0; }
.of-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.of-time input { border: 0; background: none; font: inherit; color: inherit; width: 84px; outline: none; }
.of-sheet .btn { margin-top: 8px; }
.of-sheet .btn svg { width: 15px; height: 15px; }

/* right column */
.ch-info { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; min-height: 0; }
.ch-card { padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ch-card h4 { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 10px; }
.ch-card h4 svg { width: 15px; height: 15px; color: var(--gold); }
.ch-p { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.ch-prof { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.ch-prof img.av.lg { width: 76px; height: 76px; margin-bottom: 6px; }
.ch-prof > b { font-size: 17px; }
.ch-prof small { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.ch-prof small .flag { width: 16px; height: 11px; }
.ch-prof .btn svg { width: 15px; height: 15px; }
.ch-enc { background: linear-gradient(160deg, color-mix(in srgb, var(--good-soft) 60%, var(--card)), var(--card)); }
.ch-enc h4 svg { color: var(--good); }
.ch-flow { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin: 6px 0 14px; }
.ch-flow > span { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); }
.ch-flow img.av.sm { width: 34px; height: 34px; box-shadow: none; }
.ch-q { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); font-weight: 700; }
.ch-node { color: var(--good); }
.ch-node .tk { width: 34px; height: 34px; padding: 6px; margin: 0; border-radius: 10px; background: var(--good-soft); }
.ch-wire { position: relative; flex: 1; height: 2px; margin-bottom: 16px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--good) 50%, transparent) 0 5px, transparent 5px 9px); }
.ch-wire em { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 2px; background: var(--good); animation: wire 1.8s linear infinite; }
.ch-wire.r em { animation-delay: .9s; }
@keyframes wire { from { left: 0; } to { left: calc(100% - 8px); } }
.ch-enc dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; font-size: 12px; }
.ch-enc dt { color: var(--muted); }
.ch-enc dd { text-align: right; font-weight: 600; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-addr { display: inline-flex; align-items: center; gap: 4px; font: 600 12px ui-monospace, Consolas, monospace; color: var(--ink2); }
.ch-addr svg { width: 12px; height: 12px; }
.ch-enc p { margin-top: 12px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.ch-mini { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; font-size: 13px; text-align: left; }
.ch-mini:hover { background: var(--card2); }
.ch-mini img.av.sm { width: 28px; height: 28px; box-shadow: none; }
.ch-mini .flag { width: 16px; height: 11px; }
.ch-mini span { margin-left: auto; color: var(--muted); display: inline-flex; }
.ch-mini span svg { width: 15px; height: 15px; }
.ch-ag { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 0; border-top: 1px solid var(--line2); font-size: 12.5px; }
.ch-ag:first-of-type { border-top: 0; }
.ch-ag small { color: var(--muted); }
.ch-ag .of-cd { grid-column: 1 / -1; margin-top: 4px; }

@media (max-width: 1180px) { .ch { grid-template-columns: 300px minmax(0, 1fr); } .ch-info { display: none; } }
@media (max-width: 760px) {
  .ch { grid-template-columns: 1fr; height: calc(var(--vv-h, 100dvh) - 96px); min-height: 0; gap: 0; }
  .ch.sel .ch-side, .ch:not(.sel) .ch-main { display: none; }
  .ch-back { display: grid; }
  .ch-h { padding: 10px 10px 10px 6px; gap: 8px; }
  .ch-badge { padding: 7px; font-size: 0; gap: 0; }
  .ch-badge svg { width: 15px; height: 15px; }
  .ch-badge.off { font-size: 11px; padding: 5px 9px; }
  .ch-stack { display: none; }
  .ch-body .cx-list { padding: 6px 10px 12px; }
  .ch-e2e-note { margin: 10px 10px 0; }
  .ch-form .cx-in { font-size: 16px; }
}

/* ---------- intro: private messages over TapeRelay ---------- */
.dm-stage { display: flex; align-items: center; gap: 0; width: min(900px, 96vw); justify-content: center; }
.dm-ph { position: relative; width: min(290px, 38vw); height: min(400px, 52vh); display: flex; flex-direction: column; border-radius: 30px; padding: 10px 10px 12px; background: linear-gradient(180deg, #1e1e1e, #161616); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .85), inset 0 0 0 5px rgba(0, 0, 0, .35); }
.scdm.on .dm-ph.l { animation: duelL .9s cubic-bezier(.2, 1.1, .3, 1) both; }
.scdm.on .dm-ph.r { animation: duelR .9s cubic-bezier(.2, 1.1, .3, 1) both; }
.dm-ph::before { content: ''; position: absolute; top: 9px; left: 50%; width: 70px; height: 6px; margin-left: -35px; border-radius: 9px; background: rgba(0, 0, 0, .6); }
.dm-ph-h { display: flex; align-items: center; gap: 8px; padding: 14px 6px 10px; border-bottom: 1px solid rgba(255, 255, 255, .08); text-align: left; }
.dm-ph-h img.av.sm { width: 30px; height: 30px; box-shadow: none; }
.dm-ph-h b { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: #e7e7e7; }
.dm-ph-h b .flag { width: 15px; height: 11px; margin: 0; }
.dm-ph-h small { display: flex; align-items: center; gap: 3px; font-size: 10px; color: #7fd39a; }
.dm-ph-h small svg { width: 10px; height: 10px; }
.dm-feed { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 8px 2px; }
.dm-b { align-self: flex-start; max-width: 86%; text-align: left; animation: logIn .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.dm-b.me { align-self: flex-end; }
.dm-b p { font-size: clamp(10.5px, 1.4vw, 12.5px); line-height: 1.35; padding: 7px 10px; border-radius: 14px 14px 14px 4px; background: rgba(255, 255, 255, .1); color: #e7e7e7; font-variant-ligatures: none; overflow-wrap: anywhere; }
.dm-b.me p { background: #4f4f4f; border-radius: 14px 14px 4px 14px; }
.dm-b.dm-card { max-width: 96%; width: 96%; }
.dm-in { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 4px 0 12px; border-radius: 99px; background: rgba(255, 255, 255, .07); font-size: 11px; color: rgba(198, 198, 198, .45); }
.dm-in i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #898989; color: #131313; }
.dm-in svg { width: 12px; height: 12px; }
.dm-who { position: absolute; left: 0; right: 0; bottom: -26px; display: flex; align-items: center; justify-content: center; gap: 5px; font-style: normal; font-size: 11px; color: rgba(198, 198, 198, .55); }
.dm-who .flag { width: 14px; height: 10px; margin: 0; }
.dm-of { padding: 9px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(137, 137, 137, .55); }
.dm-of-h { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #e7e7e7; }
.dm-of-h svg { width: 12px; height: 12px; color: #898989; }
.dm-of-m { display: flex; align-items: center; gap: 5px; margin: 7px 0; padding: 7px 8px; border-radius: 10px; background: rgba(137, 137, 137, .16); }
.dm-of-m .tk { width: 16px; height: 16px; margin: 0; }
.dm-of-m b { font: 700 17px/1 var(--fh); color: #fff; }
.dm-of-m small { font-size: 9.5px; color: rgba(198, 198, 198, .7); }
.dm-of-m span { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: #e7e7e7; }
.dm-of-m span svg { width: 11px; height: 11px; }
.dm-of-f { position: relative; height: 26px; }
.dm-of-f > * { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4px; border-radius: 99px; font-style: normal; font-size: 11px; font-weight: 700; transition: opacity .3s, transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.dm-acc { background: #898989; color: #131313; }
.dm-acc.press { transform: scale(.9); }
.dm-wait { color: rgba(198, 198, 198, .6); background: rgba(255, 255, 255, .06); font-weight: 500 !important; }
.dm-of-f em { background: #3f8f5a; color: #fff; opacity: 0; transform: scale(.6); }
.dm-of-f em svg { width: 12px; height: 12px; }
.dm-of.ok .dm-of-f > i { opacity: 0; }
.dm-of.ok .dm-of-f em { opacity: 1; transform: none; }
.dm-of.ok { border-color: #3f8f5a; box-shadow: 0 0 30px -6px rgba(63, 143, 90, .6); transition: box-shadow .5s, border-color .5s; }
.dm-relay { position: relative; width: min(190px, 18vw); height: 120px; flex: none; display: flex; align-items: center; justify-content: center; }
.dm-wire { position: absolute; left: -6px; right: -6px; top: 50%; height: 2px; background: repeating-linear-gradient(90deg, rgba(127, 211, 154, .55) 0 6px, transparent 6px 11px); background-size: 22px 2px; animation: wireMove .8s linear infinite; }
@keyframes wireMove { to { background-position: 22px 0; } }
.dm-node { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 12px; border-radius: 16px; background: #13231a; border: 1px solid rgba(127, 211, 154, .5); color: #7fd39a; box-shadow: 0 0 40px -8px rgba(127, 211, 154, .45); transition: transform .2s, box-shadow .2s; }
.scdm.on .dm-node { animation: vsSlam .6s .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.dm-node .tk { width: 24px; height: 24px; margin: 0; }
.dm-node b { font-size: 12px; color: #d7f5e0; }
.dm-node small { font-size: 9.5px; color: rgba(127, 211, 154, .75); }
.dm-node.ping { transform: scale(1.12); box-shadow: 0 0 60px 0 rgba(127, 211, 154, .7); }
.dm-pk { position: absolute; top: calc(50% - 30px); left: 0; z-index: 2; padding: 3px 7px; border-radius: 6px; font: 600 10px ui-monospace, Consolas, monospace; color: #0d1a12; background: #7fd39a; box-shadow: 0 0 18px rgba(127, 211, 154, .8); opacity: 0; white-space: nowrap; pointer-events: none; }
.dm-pk.go-l { animation: pkL .98s cubic-bezier(.5, 0, .5, 1) forwards; }
.dm-pk.go-r { animation: pkR .98s cubic-bezier(.5, 0, .5, 1) forwards; }
@keyframes pkL { 0% { left: 0%; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: 62%; opacity: 0; } }
@keyframes pkR { 0% { left: 62%; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: 0%; opacity: 0; } }
.dm-seal { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.dm-seal > span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; font-size: 12px; color: rgba(198, 198, 198, .8); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); }
.dm-seal > span:first-child { color: #7fd39a; border-color: rgba(127, 211, 154, .45); background: rgba(127, 211, 154, .1); }
.dm-seal svg { width: 13px; height: 13px; }
.scdm.on .dm-seal > span { animation: slideUp .6s both; }
.scdm.on .dm-seal > span:nth-child(1) { animation-delay: 1s; }
.scdm.on .dm-seal > span:nth-child(2) { animation-delay: 1.15s; }
.scdm.on .dm-seal > span:nth-child(3) { animation-delay: 1.3s; }
@media (max-width: 640px) {
  .dm-ph { height: min(330px, 46vh); border-radius: 22px; padding: 8px 6px 10px; }
  .dm-ph-h { padding: 12px 2px 8px; gap: 5px; }
  .dm-ph-h img.av.sm { width: 22px; height: 22px; }
  .dm-ph-h b { font-size: 10px; }
  .dm-node { padding: 6px; }
  .dm-node b { font-size: 9px; }
  .dm-node small { display: none; }
  .dm-pk { font-size: 8px; padding: 2px 4px; }
  .dm-of-m b { font-size: 13px; }
  .dm-of-m small, .dm-of-m span { font-size: 8.5px; }
  .dm-of-f > * { font-size: 8.5px; white-space: nowrap; letter-spacing: -.01em; }
  .dm-who { font-size: 9.5px; }
  .dm-seal > span { font-size: 10.5px; padding: 5px 10px; }
}

/* ---------- intro: the group chat ---------- */
.gr-room { width: min(460px, 92vw); text-align: left; padding: 16px; border-radius: 24px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .13); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); }
.scgr.on .gr-room { animation: boardIn .9s cubic-bezier(.2, 1, .3, 1) both; }
.gr-h { display: flex; align-items: center; gap: 10px; }
.gr-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(140deg, #4f4f4f, #282828); color: #e7e7e7; }
.gr-ic svg { width: 20px; height: 20px; }
.gr-h b { display: block; font-size: 16px; color: #e7e7e7; }
.gr-h small { font-size: 11.5px; color: rgba(198, 198, 198, .6); }
.gr-on { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #7fd39a; }
.gr-on i { width: 8px; height: 8px; border-radius: 50%; background: #7fd39a; box-shadow: 0 0 0 4px rgba(127, 211, 154, .2); animation: lkPulse 1.2s ease-in-out infinite; }
.gr-on em { font-style: normal; font-variant-numeric: tabular-nums; }
.gr-ppl { display: flex; padding: 14px 0 10px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.gr-ppl span { position: relative; margin-right: -6px; opacity: 0; }
.scgr.on .gr-ppl span { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(.3s + var(--p) * 90ms); opacity: 1; }
.gr-ppl img.av.sm { width: 34px; height: 34px; box-shadow: 0 0 0 2px #1e1e1e; }
.gr-ppl .flag { position: absolute; right: -1px; bottom: -1px; width: 14px; height: 10px; margin: 0; }
.gr-feed { display: flex; flex-direction: column; gap: 7px; padding-top: 12px; }
.gm { display: flex; align-items: flex-end; gap: 7px; opacity: 0; }
.scgr.on .gm { opacity: 1; animation: logIn .45s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: calc(1s + var(--m) * .52s); }
.gm img.av.sm { width: 26px; height: 26px; box-shadow: none; }
.gm p { font-size: 12.5px; line-height: 1.35; padding: 6px 10px; border-radius: 14px 14px 14px 4px; background: rgba(255, 255, 255, .1); color: #e7e7e7; }
.gm p b { display: flex; align-items: center; gap: 3px; font-size: 10.5px; color: rgba(198, 198, 198, .65); }
.gm p b .flag, .gm .flag { width: 13px; height: 9px; margin: 0; }
.gm.inv { justify-content: space-between; padding: 8px 10px; border-radius: 12px; border: 1px solid rgba(137, 137, 137, .55); background: rgba(137, 137, 137, .1); font-size: 12px; color: #e7e7e7; }
.gm.inv span { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.gm.inv svg, .gm.inv .tk { width: 14px; height: 14px; margin: 0; color: #898989; }
.gm.inv i { font-style: normal; font-weight: 700; font-size: 11px; padding: 4px 12px; border-radius: 99px; background: #898989; color: #131313; }

/* ---------- chat page polish ---------- */
.ch-hint { margin: 4px 10px 2px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; color: var(--muted); background: var(--card2); }
.ch-rec { display: inline-block; margin: -4px 0 12px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--ink2); background: var(--card2); border: 1px solid var(--line); }
.ch-spin { width: 12px; height: 12px; margin-left: 6px; border-width: 2px; }
.ch-h { position: relative; z-index: 2; min-height: 64px; background: color-mix(in srgb, var(--card) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.ch-body { background:
  radial-gradient(120% 60% at 50% 0%, var(--glow), transparent 70%),
  conic-gradient(color-mix(in srgb, var(--ink) 3%, transparent) 25%, transparent 0 50%, color-mix(in srgb, var(--ink) 3%, transparent) 0 75%, transparent 0) 0 0 / 44px 44px,
  var(--bg); }
.ch-body .cm { margin-top: 8px; }
.ch-body .cm.grp { margin-top: 2px; }
.ch-body .cm-b { padding: 8px 13px 6px; border-radius: 18px 18px 18px 6px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.ch-body .cm.me .cm-b { border-radius: 18px 18px 6px 18px; background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.ch-body .cm.me .cm-h b { color: color-mix(in srgb, var(--accent-ink) 75%, transparent); }
.ch-body .cm.me .cm-lk { color: inherit; opacity: .8; }
.ch-body .cm-b p { font-size: 14.5px; line-height: 1.42; }
.ch-body .cm.inv .cm-b, .ch-body .cm.me.inv .cm-b { background: var(--card); color: var(--ink); border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--line)); }
.ch-e2e-note { justify-content: center; text-align: center; margin: 12px auto 4px; max-width: 420px; border-style: solid; font-size: 11.5px; }
.ch-form { gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--card); }
.ch-form .cx-in { height: 46px; padding: 0 16px; border-radius: 23px; background: var(--card2); font-size: 15px; }
.ch-form .cx-send { width: 46px; height: 46px; background: var(--accent); color: var(--accent-ink); }
.ch-form .cx-chal { width: 46px; height: 46px; background: var(--card2); }
.ch-blank { background: var(--bg); }
.ch-e2e-note.off { color: var(--muted); background: var(--card2); border-color: var(--line); }
.ch-e2e-note.off svg { color: var(--muted); }

/* ---------- intro v2: bigger, fuller phones; faster group chat ---------- */
.dm-stage { width: min(1040px, 98vw); }
.dm-ph { width: min(340px, 40vw); height: min(600px, 68vh); border-radius: 42px; padding: 10px 12px 14px; background: linear-gradient(180deg, #1f1f1f, #131313); box-shadow: 0 50px 90px -30px rgba(0, 0, 0, .9), inset 0 0 0 6px #0a0a0a, inset 0 0 0 7px rgba(255, 255, 255, .12); }
.dm-ph::before { top: 16px; width: 92px; height: 24px; margin-left: -46px; border-radius: 14px; background: #0a0a0a; }
.dm-sb { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 6px 18px 0; font: 600 12px 'Inter', sans-serif; color: #e7e7e7; }
.dm-sb span { display: flex; align-items: flex-end; gap: 2px; }
.dm-sb i { width: 3px; border-radius: 1px; background: #e7e7e7; }
.dm-sb i:nth-child(1) { height: 5px; } .dm-sb i:nth-child(2) { height: 7px; } .dm-sb i:nth-child(3) { height: 9px; }
.dm-sb em { width: 20px; height: 10px; margin-left: 5px; border-radius: 3px; border: 1.5px solid #e7e7e7; background: linear-gradient(90deg, #e7e7e7 70%, transparent 0) 1px 1px / calc(100% - 2px) calc(100% - 2px) no-repeat; }
.dm-ph-h { padding: 10px 8px 12px; gap: 10px; }
.dm-ph-h img.av.sm { width: 40px; height: 40px; }
.dm-ph-h b { font-size: 14.5px; }
.dm-ph-h small { font-size: 11px; }
.dm-feed { gap: 8px; padding: 10px 4px; justify-content: flex-end; }
.dm-b p { font-size: clamp(12px, 1.5vw, 14px); padding: 9px 13px; border-radius: 18px 18px 18px 5px; }
.dm-b.me p { border-radius: 18px 18px 5px 18px; }
.dm-b.old { opacity: .55; animation: none; }
.dm-day { align-self: center; margin: 4px 0; padding: 3px 10px; border-radius: 99px; font: 600 10px 'Inter', sans-serif; letter-spacing: .04em; color: rgba(198, 198, 198, .65); background: rgba(255, 255, 255, .06); }
.dm-in { height: 42px; font-size: 13px; padding-left: 16px; }
.dm-in i { width: 32px; height: 32px; }
.dm-of { padding: 12px; }
.dm-of-h { font-size: 13px; }
.dm-of-m b { font-size: 22px; }
.dm-of-m small, .dm-of-m span { font-size: 11.5px; }
.dm-of-f { height: 32px; }
.dm-of-f > * { font-size: 12.5px; }
.dm-who { bottom: -30px; font-size: 12px; }
.dm-relay { width: min(200px, 16vw); }
.gr-room { width: min(560px, 94vw); padding: 20px; }
.gr-h b { font-size: 18px; }
.gm p { font-size: 14px; padding: 8px 12px; }
.gm img.av.sm { width: 32px; height: 32px; }
.gr-ppl img.av.sm { width: 40px; height: 40px; }
.scgr.on .gm { animation-delay: calc(.5s + var(--m) * .33s); }
.scgr.on .gr-ppl span { animation-delay: calc(.2s + var(--p) * 60ms); }
@media (max-width: 640px) {
  .scdm .in-kicker { margin-bottom: 10px; }
  .dm-stage { width: 100vw; padding: 0 6px; }
  .dm-ph { width: 44vw; height: min(540px, 66vh); border-radius: 28px; padding: 6px 6px 10px; }
  .dm-ph::before { top: 10px; width: 52px; height: 14px; margin-left: -26px; }
  .dm-sb { height: 22px; padding: 4px 12px 0; font-size: 9.5px; }
  .dm-sb em { width: 15px; height: 8px; }
  .dm-ph-h { padding: 6px 4px 8px; gap: 5px; }
  .dm-ph-h img.av.sm { width: 26px; height: 26px; }
  .dm-ph-h b { font-size: 10.5px; }
  .dm-ph-h small { font-size: 8.5px; }
  .dm-b p { font-size: 10.5px; padding: 6px 9px; }
  .dm-day { font-size: 8px; }
  .dm-in { height: 30px; font-size: 10px; padding-left: 10px; }
  .dm-in i { width: 22px; height: 22px; }
  .dm-of { padding: 7px; }
  .dm-of-h { font-size: 10px; }
  .dm-of-m { flex-wrap: wrap; gap: 3px; padding: 6px; }
  .dm-of-m b { font-size: 15px; }
  .dm-of-m small { font-size: 8.5px; }
  .dm-of-m span { margin-left: 0; width: 100%; font-size: 9px; }
  .dm-of-f { height: 24px; }
  .dm-of-f > * { font-size: 9px; }
  .dm-relay { width: 8vw; }
  .dm-node { padding: 5px; border-radius: 10px; }
  .dm-node b, .dm-node small { display: none; }
  .dm-pk { display: none; }
  .dm-who { bottom: -22px; font-size: 10px; }
  .dm-seal { margin-top: 30px; }
  .dm-seal > span:not(:first-child) { display: none; }
}
