:root { --out: cubic-bezier(.22, 1, .36, 1); --pop: cubic-bezier(.34, 1.56, .64, 1); --red: #e5484d; --line: #242426; --dim: #6b6b6f; --mid: #a3a3a6; }

#bio { position: fixed; inset: 0; visibility: hidden; display: grid; place-items: center; overflow: hidden; background: #0c0c0d; color: #ededed; font: 400 14px Arial, Helvetica, sans-serif; user-select: text; -webkit-user-select: text; }

.who { display: flex; flex-direction: column; align-items: center; padding: 16px; transition: transform .55s var(--out); will-change: transform; }
.who img { width: 46px; height: auto; display: block; }
.who h1 { margin-top: 10px; font: 400 22px/1.2 Arial, Helvetica, sans-serif; letter-spacing: -.01em; }
.who p { margin-top: 8px; color: #7d7d80; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
#age { display: inline-block; min-width: 5ch; text-align: right; }
@media (min-width: 900px) { #bio.talking .who { transform: translateX(-190px); } }

/* icons */
.icons { display: flex; gap: 4px; margin-top: 20px; }
.btn { position: relative; display: flex; align-items: center; gap: 7px; height: 36px; min-width: 36px; justify-content: center; padding: 0 9px; background: none; border: 0; border-radius: 10px; color: var(--mid); font: 400 13px Arial, Helvetica, sans-serif; font-variant-numeric: tabular-nums; cursor: pointer; transition: background .18s, color .18s, transform .18s var(--pop); }
.btn:hover, .btn:focus-visible { background: #1a1a1c; color: #fff; outline: 0; }
.btn:active { transform: scale(.9); }
.btn svg { width: 17px; height: 17px; display: block; flex: none; overflow: visible; }
.line { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: fill .2s, stroke .2s; }
.liked { color: #fff; }
.liked svg .line { fill: var(--red); stroke: var(--red); }
#talk.on { background: #1a1a1c; color: #fff; }

.wave { transform-origin: 12px 12px; transition: opacity .25s, transform .35s var(--out); }
#sound.off { color: var(--dim); }
#sound.off .wave { opacity: 0; transform: scale(.55); }
#sound.off .wave2 { transition-delay: .05s; }

#tip { position: absolute; left: 50%; bottom: calc(100% + 6px); padding: 4px 8px; border-radius: 7px; background: #ededed; color: #0c0c0d; font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-50%, 6px) scale(.94); transition: opacity .18s, transform .3s var(--pop); }
#tip.on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* numbers roll instead of changing */
.num { position: relative; display: inline-block; height: 1.2em; line-height: 1.2em; overflow: hidden; vertical-align: top; min-width: 0; }
.num span { display: block; }
.num span.ghost { position: absolute; left: 0; top: 0; }

.burst { position: absolute; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -1px; top: -1px; width: 2px; height: 2px; border-radius: 1px; background: var(--red); }
.burst u { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--red); }

#views { position: fixed; left: 16px; bottom: 14px; display: flex; align-items: center; gap: 6px; color: #5c5c5f; font-size: 12px; font-variant-numeric: tabular-nums; }
#views svg { width: 15px; height: 15px; }

/* comments panel */
#veil { position: fixed; inset: 0; background: #0000; pointer-events: none; transition: background .35s; }
#panel {
  position: fixed; top: 12px; right: 12px; bottom: 12px; width: 372px; display: flex; flex-direction: column; overflow: hidden;
  background: #121213; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 60px #0009;
  visibility: hidden; opacity: 0; transform: translateX(28px) scale(.985); transform-origin: 100% 50%;
  transition: transform .5s var(--out), opacity .25s, visibility 0s .5s;
}
#bio.talking #panel { visibility: visible; opacity: 1; transform: none; transition: transform .5s var(--out), opacity .25s, visibility 0s; }

.grip { display: none; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 8px 18px; }
.top h2 { font: 400 15px Arial, Helvetica, sans-serif; display: flex; gap: 7px; }
.top h2 .num { color: var(--dim); }

/* composer */
#form { position: relative; margin: 2px 12px 8px; padding: 10px 12px 9px; background: #19191b; border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s, background .2s; }
#form:focus-within { border-color: #48484b; background: #1c1c1e; }
#text { display: block; width: 100%; height: 40px; max-height: 140px; padding: 0; background: none; border: 0; outline: 0; resize: none; color: #ededed; font: 400 14px/20px Arial, Helvetica, sans-serif; overflow-y: auto; scrollbar-width: none; }
.row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
#who { flex: 1; min-width: 0; padding: 0; background: none; border: 0; outline: 0; color: var(--mid); font: 400 12px/28px Arial, Helvetica, sans-serif; }
#text::placeholder, #who::placeholder { color: var(--dim); }
#left { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .2s; }
#left.on { opacity: 1; }
#left.max { color: var(--red); }
#send { position: relative; flex: none; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; background: #ededed; color: #0c0c0d; border: 0; border-radius: 50%; cursor: pointer; transition: transform .25s var(--pop), background .2s, color .2s; }
#send svg { width: 15px; height: 15px; transition: transform .25s var(--out); }
#send:not([disabled]):hover { transform: scale(1.08); background: #fff; }
#send:not([disabled]):hover svg { transform: translateY(-1px); }
#send:not([disabled]):active { transform: scale(.88); }
#send[disabled] { background: #2a2a2c; color: #68686c; cursor: default; }
#send .ring { position: absolute; inset: -1px; width: 30px; height: 30px; transform: rotate(-90deg); opacity: 0; }
#send .ring circle { fill: none; stroke: #ededed; stroke-width: 1.6; stroke-dasharray: 84.8; stroke-dashoffset: 84.8; }
#send.wait .ring { opacity: 1; }
#send.busy svg:first-child { animation: bioPulse .7s ease-in-out infinite alternate; }
@keyframes bioPulse { to { opacity: .35; } }

/* list */
#list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 14px; scrollbar-width: none; -webkit-mask: linear-gradient(#0000, #000 10px, #000 calc(100% - 22px), #0000); mask: linear-gradient(#0000, #000 10px, #000 calc(100% - 22px), #0000); }
#list::-webkit-scrollbar, #text::-webkit-scrollbar { display: none; }
.c { overflow: hidden; }
.c > div { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 9px 8px; border-radius: 12px; transition: background .18s; }
.c > div:hover { background: #18181a; }
.c.fresh > div { animation: bioFresh 1.6s ease-out; }
@keyframes bioFresh { from { background: #26262a; } }
.ava { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: #ededed; user-select: none; }
.meta { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.meta b { font-weight: 400; font-size: 13px; color: #ededed; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta time { flex: none; color: var(--dim); font-size: 12px; }
.c p { margin-top: 2px; color: #bdbdc0; font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.acts { display: flex; align-items: center; gap: 2px; margin: 3px 0 -3px -7px; }
.acts .btn { height: 26px; min-width: 26px; padding: 0 6px; gap: 5px; border-radius: 8px; font-size: 12px; color: var(--dim); }
.acts .btn svg { width: 14px; height: 14px; }
.acts .btn:hover { background: #242426; color: #ededed; }
.acts .liked { color: var(--mid); }
.del { opacity: 0; transition: opacity .15s, background .18s, color .18s, transform .18s var(--pop); }
.c:hover .del, .del:focus-visible { opacity: 1; }
@media (hover: none) { .del { opacity: 1; } }

/* phones: the panel is a bottom sheet */
@media (max-width: 640px) {
  #bio.talking #veil { background: #0009; }
  #panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 86dvh; border-width: 1px 0 0; border-radius: 20px 20px 0 0; opacity: 1; transform: translateY(102%); transition: transform .5s var(--out), visibility 0s .5s; }
  #bio.talking #panel { transition: transform .5s var(--out), visibility 0s; }
  #panel.dragging { transition: none !important; }
  .grip { display: block; flex: none; height: 22px; touch-action: none; position: relative; cursor: grab; }
  .grip::after { content: ""; position: absolute; left: 50%; top: 9px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: #3a3a3d; }
  .top { padding-top: 0; }
  #text { font-size: 16px; }
  #who { font-size: 16px; }
}
