/* Teca. Visual language after Element X (Compound): Inter, quiet cool neutrals, green accent,
   near-black pill buttons, pastel avatars and soft green-to-blue glows behind headers. */
@font-face {
  font-family: "Inter"; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;
  --brand: #0dbd8b;
  --brand-2: #0467dd;
  --ink: #1b1d22;
  --bg: #f0f2f5;                   /* quiet fills: fields, hovers, incoming bubbles */
  --surface: #ffffff;
  --chat-bg: #ffffff;
  --text: #1b1d22;
  --muted: #656d77;
  --line: #e1e6ec;
  --edge: #cdd3da;                 /* borders of fields and chips */
  --tile: #e1e6ec;
  --accent: #007a61;               /* fills: send, badges, selection */
  --accent-ink: #ffffff;
  --accent-text: #007a61;          /* the accent as text: links, names, active tabs */
  --accent-soft: #e3f7ed;
  --primary: #1b1d22;              /* main buttons and active chips are near-black pills */
  --primary-ink: #ffffff;
  --mine: #e1e6ec;
  --mine-meta: #656d77;
  --read: #0467dd;                 /* the blue of "read": the end of the brand gradient */
  --read-on-dark: #6cb6ff;         /* the same blue on photos and dark chips */
  --theirs: #f0f2f5;
  --danger: #d51928;
  --name-l: 36%;
  --av-bg: 92%; --av-fg: 32%; --av-s: 78%;
  --shadow: none;
  --bar-h: 58px;
  /* the soft blooms Element X puts behind headers and empty screens */
  --glow: radial-gradient(90% 100% at 0% 0%, rgb(13 189 139 / .26), transparent 62%),
          radial-gradient(80% 100% at 100% 0%, rgb(4 103 221 / .2), transparent 60%);
  --grad: linear-gradient(135deg, #0dbd8b, #0467dd);
  /* chart series: fixed order, validated for colour-blind separation on both surfaces */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --good: #0ca30c;
  /* notch and system bars, for phones and installed PWAs */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-in: cubic-bezier(.5, 0, .9, .4);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1f24;
    --surface: #101317;
    --chat-bg: #101317;
    --text: #ebeef2;
    --muted: #808994;
    --line: #26282d;
    --edge: #3c4045;
    --tile: #26282d;
    --accent: #0dbd8b;
    --accent-ink: #06291f;
    --accent-text: #1fc090;
    --accent-soft: #0b3a2d;
    --primary: #ebeef2;
    --primary-ink: #101317;
    --mine: #323539;
    --mine-meta: #9aa2ad;
    --read: #5fb4ff;
    --theirs: #1d1f24;
    --danger: #ff6b66;
    --name-l: 74%;
    --av-bg: 22%; --av-fg: 80%; --av-s: 42%;
    --glow: radial-gradient(90% 100% at 0% 0%, rgb(13 189 139 / .2), transparent 62%),
            radial-gradient(80% 100% at 100% 0%, rgb(4 103 221 / .22), transparent 60%);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 var(--font);
  letter-spacing: -.011em;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: var(--accent-text); }
h1, h2, p { margin: 0; }
h2 { font-weight: 700; letter-spacing: -.02em; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.muted { color: var(--muted); }

@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes sink { to { transform: translateY(100%); } }
@keyframes grow { from { opacity: 0; transform: scale(.94) translateY(8px); } }
@keyframes shrink { to { opacity: 0; transform: scale(.96); } }
@keyframes slideIn { from { transform: translateX(100%); } }
@keyframes slideOut { to { transform: translateX(100%); } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.94); } }
@keyframes paneIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes flash { 0%, 55% { background: color-mix(in srgb, var(--accent) 34%, transparent); } }
@keyframes fromRight { from { opacity: 0; transform: translateX(28%); } }
@keyframes fromLeft { from { opacity: 0; transform: translateX(-28%); } }

.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 18px; height: 18px; }
.ic.xs { width: 13px; height: 13px; stroke-width: 2.6; }
.icon-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; color: inherit; transition: background .15s, transform .12s, opacity .2s; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.icon-btn:active { transform: scale(.9); }
.logo { display: block; flex: none; }
.wordmark { font-weight: 700; letter-spacing: -.04em; }
.spinner { width: 28px; height: 28px; margin: 32px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.sm { width: 14px; height: 14px; margin: 0; border-width: 2px; }

/* --- layout: on a phone the chat slides over the list --- */
#app { position: relative; height: 100dvh; overflow: hidden; }
#left, #main { position: absolute; inset: 0; display: flex; flex-direction: column; min-width: 0; }
#left { background: var(--glow) top / 100% 230px no-repeat, var(--surface); transition: transform .32s var(--ease), opacity .32s var(--ease), visibility 0s; }
#main { z-index: 1; background: var(--chat-bg); transform: translateX(100%); visibility: hidden; will-change: transform; box-shadow: -1px 0 0 var(--line); transition: transform .32s var(--ease), visibility 0s .32s; }
.show-main #main { transform: none; visibility: visible; transition: transform .32s var(--ease), visibility 0s; }
.show-main #left { transform: translateX(-24%); opacity: .5; visibility: hidden; transition: transform .32s var(--ease), opacity .32s var(--ease), visibility 0s .32s; }
#app.boot #left, #app.boot #main { transition: none; }
.placeholder { margin: auto; display: grid; justify-items: center; gap: 14px; color: var(--muted); }
.pane-in { animation: paneIn .24s var(--ease); }
@media (min-width: 860px) {
  #app { display: flex; }
  #left, #main, .show-main #left, .show-main #main { position: relative; transform: none; opacity: 1; visibility: visible; box-shadow: none; transition: none; }
  #left { width: 384px; flex: none; border-right: 1px solid var(--line); }
  #main { flex: 1; }
  .only-narrow { display: none; }
}

.bar {
  height: var(--bar-h); flex: none; display: flex; align-items: center; gap: 4px;
  padding: 0 6px; padding-top: var(--sat); box-sizing: content-box;
  background: var(--surface); border-bottom: 1px solid var(--line); transition: background .2s;
}
#left > .bar { background: none; border-bottom-color: transparent; }
.bar-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title.wordmark, .bar-title.big { font-size: 26px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.bar-title.big { padding-left: 10px; }
.bar-logo { width: 30px; height: 30px; margin: 0 8px 0 10px; }
.bar-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-chat { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 100%; padding-left: 6px; }
.bar-chat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.22; }
.bar.selecting { background: var(--accent-soft); }
.bar.selecting .bar-title { padding-left: 8px; }
.bar-input { flex: 1; min-width: 0; height: 42px; border: 0; border-radius: 21px; padding: 0 16px; background: var(--bg); outline-offset: 0; }

.avatar {
  --hue: 250; width: 50px; height: 50px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: hsl(var(--hue) var(--av-s) var(--av-bg)); color: hsl(var(--hue) 72% var(--av-fg)); font-weight: 600; font-size: 17px; letter-spacing: .02em;
}
.avatar .i3 { font-size: .82em; letter-spacing: -.02em; }
.avatar.sm { width: 38px; height: 38px; font-size: 14px; }
.avatar.sm .ic { width: 19px; height: 19px; }
.avatar.lg { width: 92px; height: 92px; font-size: 34px; }
.avatar.lg .ic { width: 40px; height: 40px; }
.avatar.self { background: var(--grad); color: #fff; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; animation: pop .25s var(--ease); }

.conn { position: fixed; top: calc(8px + var(--sat)); left: 50%; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 18px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: 0 4px 16px rgb(0 0 0 / .3); transform: translate(-50%, -160%); opacity: 0; transition: transform .3s var(--ease), opacity .3s; }
.offline .conn { transform: translate(-50%, 0); opacity: 1; }
.conn .spinner { border-color: rgb(255 255 255 / .25); border-top-color: #fff; }

/* --- chat list --- */
.chatlist { flex: 1; overflow-y: auto; padding: 6px 0 96px; }
.chat-row:has(.badge) .chat-row-time { color: var(--accent-text); font-weight: 600; }
.chat-row { display: flex; gap: 13px; align-items: center; margin: 0 8px; padding: 9px 8px; border-radius: 16px; color: inherit; text-decoration: none; transition: background .15s; }
.chat-row:hover, .chat-row:active { background: color-mix(in srgb, var(--text) 6%, transparent); }
.chat-row.active { background: var(--accent-soft); }
.chat-row-body { flex: 1; min-width: 0; }
.chat-row-top, .chat-row-bottom { display: flex; align-items: center; gap: 8px; }
.chat-row-title { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row-time { font-size: 12px; color: var(--muted); flex: none; }
.chat-row-prev { flex: 1; color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fab {
  position: absolute; right: 18px; bottom: calc(78px + var(--sab)); width: 58px; height: 58px;
  border-radius: 20px; display: grid; place-items: center; background: var(--grad); color: #fff;
  box-shadow: 0 8px 22px rgb(4 103 221 / .32); transition: transform .15s var(--ease), box-shadow .15s; animation: pop .35s var(--ease) .1s backwards;
}
.fab:hover { transform: translateY(-2px); }
.fab:active { transform: scale(.93); }

/* --- chat --- */
.pinbar { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--accent-text); font-size: 14px; animation: paneIn .2s var(--ease); }
.pinbar span { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-body { flex: 1; min-height: 0; position: relative; }
.scroller { position: relative; height: 100%; contain: strict; overflow: hidden auto; overflow-anchor: none; overscroll-behavior: contain; }
.msgs { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 8px 0 10px; max-width: 900px; margin: 0 auto; }
.empty, .hint { margin: auto; padding: 36px 30px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 8px; animation: paneIn .3s var(--ease); }
.empty h2 { color: var(--text); font-size: 21px; }
.empty p { max-width: 30ch; }
.empty-logo { width: 68px; height: 68px; margin-bottom: 8px; filter: drop-shadow(0 10px 22px rgb(4 103 221 / .22)); }
.empty-ic { width: 44px; height: 44px; margin-bottom: 6px; color: var(--accent-text); }
.list:has(.empty) { margin: auto 0; }
.day, .svc { display: flex; justify-content: center; padding: 8px 12px 4px; }
.day span, .svc span, .float-day { font-size: 13px; padding: 3px 11px; border-radius: 12px; background: color-mix(in srgb, var(--text) 9%, transparent); color: var(--muted); text-align: center; }
.day span { font-weight: 600; }
.float-day { position: absolute; top: 8px; left: 50%; z-index: 2; font-weight: 600; background: var(--ink); color: #fff; box-shadow: 0 2px 10px rgb(0 0 0 / .25); opacity: 0; transform: translate(-50%, -8px); transition: opacity .2s, transform .2s var(--ease); pointer-events: none; }
.float-day.on { opacity: .92; transform: translate(-50%, 0); }
.skeleton { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding: 10px 12px; }
.skeleton span { height: 38px; border-radius: 18px; background: linear-gradient(90deg, var(--mine) 25%, color-mix(in srgb, var(--mine) 60%, var(--surface)) 50%, var(--mine) 75%) 0 0 / 200% 100%; animation: shimmer 1.3s linear infinite; opacity: .7; }
.skeleton .theirs { align-self: flex-start; background-image: linear-gradient(90deg, var(--theirs) 25%, var(--line) 50%, var(--theirs) 75%); }

.msg { display: flex; padding: 1.5px 10px; position: relative; touch-action: pan-y; transition: transform .22s var(--ease), background .2s; }
.msg.first { margin-top: 7px; }
.msg.mine { justify-content: flex-end; }
.msg.enter { animation: pop .28s var(--ease); transform-origin: 100% 100%; }
.msg.theirs.enter { transform-origin: 0 100%; }
.msg.flash { animation: flash 1.8s ease-out; }
.msg.focus .bubble { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.msg.sel { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.msg.pending .bubble { opacity: .96; }
.msg.failed .meta { color: var(--danger); }
.tick { display: none; }
.selecting .msg { padding-left: 46px; cursor: pointer; }
.selecting .tick { display: grid; place-items: center; position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); color: transparent; transition: background .15s, border-color .15s, scale .15s var(--ease); }
.selecting .msg.sel .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); scale: 1.1; }
.swipe-hint { position: absolute; right: -44px; top: 50%; translate: 0 -50%; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--muted); scale: .7; transition: scale .15s var(--ease), background .15s, color .15s; }
.swipe-hint.armed { scale: 1; background: var(--accent); color: var(--accent-ink); }
@media (pointer: coarse) { .msg { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; } }

.bubble { position: relative; max-width: min(82%, 520px); min-width: 0; padding: 7px 12px 8px; border-radius: 14px; background: var(--theirs); box-shadow: var(--shadow); transition: box-shadow .15s; }
.mine .bubble { background: var(--mine); }
.bubble.bare { padding: 3px; }
.sticker { display: block; width: 160px; height: 160px; object-fit: contain; }
.bubble.stk { background: none; box-shadow: none; border: 0; padding: 0; }
.bubble.stk .meta { display: inline-block; margin-top: 2px; padding: 2px 7px; border-radius: 10px; background: rgb(0 0 0 / .45); color: #fff; }
.bubble.bare .sender, .bubble.bare .fwd { padding: 4px 9px 3px; margin: 0; }
.sender { font-size: 14px; font-weight: 600; color: hsl(var(--hue) 60% var(--name-l)); margin-bottom: 1px; }
.fwd { font-size: 13px; color: var(--accent-text); margin-bottom: 2px; }
.reply { display: flex; flex-direction: column; width: 100%; margin: 2px 0 5px; padding: 3px 9px; border-left: 3px solid var(--accent); border-radius: 6px; background: color-mix(in srgb, var(--accent) 16%, transparent); font-size: 14px; line-height: 1.3; }
.reply b { color: var(--accent-text); font-weight: 600; }
.reply span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mine .reply span { color: var(--mine-meta); }
.text { display: flow-root; white-space: pre-wrap; overflow-wrap: anywhere; }
.tag { text-decoration: none; font-weight: 500; }
.meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 3px; font-size: 11px; line-height: 1; color: var(--muted); white-space: nowrap; user-select: none; }
.mine .meta { color: var(--mine-meta); }
.text .meta { float: right; display: inline-flex; margin: 9px 0 -2px 12px; }
.bubble.bare .meta { position: absolute; right: 9px; bottom: 9px; margin: 0; padding: 3px 7px; border-radius: 10px; background: rgb(0 0 0 / .55); color: #fff; }

/* a bubble with photos is exactly as wide as its media, whatever else it holds */
.bubble.has-media { width: calc(min(330px, 68vw) + 6px); }
.media { display: flex; flex-direction: column; gap: 2px; margin: -3px -8px 5px; border-radius: 15px; overflow: hidden; }
.mrow { display: flex; gap: 2px; }
.bubble.bare .media { margin: 0; }
.tile { position: relative; display: block; flex: calc(var(--r, 1) * 100) 1 0; min-width: 0; aspect-ratio: var(--r, 1); background: var(--tile); overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s, transform .3s var(--ease); }
.tile img.in { opacity: 1; }
.tile:active img { transform: scale(.97); }
.play { position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .55); color: #fff; }
.play .ic { width: 22px; height: 22px; translate: 1px 0; }
.dur, .ctile-size { position: absolute; left: 7px; top: 7px; padding: 1px 6px; border-radius: 9px; background: rgb(0 0 0 / .55); color: #fff; font-size: 12px; }

/* upload progress: a ring over the tile (or in place of the file icon) */
.ring { position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .55); color: #fff; }
.ring svg { width: 100%; height: 100%; rotate: -90deg; }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: rgb(255 255 255 / .25); }
.ring .bar { stroke: currentColor; stroke-linecap: round; stroke-dasharray: 100px; stroke-dashoffset: calc((100 - var(--p, 0)) * 1px); transition: stroke-dashoffset .3s linear; }
.ring.spin svg { animation: spin 1s linear infinite; }
.ring.spin .bar { stroke-dashoffset: 72px; transition: none; }
.file-ic .ring { position: static; width: 100%; height: 100%; margin: 0; background: none; color: inherit; }
.file-ic .ring .track { stroke: color-mix(in srgb, currentColor 25%, transparent); }

.file { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 0; color: inherit; text-decoration: none; }
.file-ic { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--accent-text); border: 1px solid var(--edge); }
.file-ic .ic { width: 20px; height: 20px; }
.file-ic.thumb { border-radius: 12px; overflow: hidden; background: var(--tile); }
.file-ic.thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.file-name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.file-size { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mine .file-size { color: var(--mine-meta); }
.audio { padding: 3px 0; }
.audio audio { display: block; width: min(300px, 64vw); height: 40px; }

.down { position: absolute; right: 14px; bottom: 14px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--muted); box-shadow: 0 3px 12px rgb(0 0 0 / .25); opacity: 0; scale: .6; pointer-events: none; transition: opacity .2s, scale .2s var(--ease); }
.down.on { opacity: 1; scale: 1; pointer-events: auto; }
.down .badge { position: absolute; top: -8px; right: -4px; }
.drop-hint { position: absolute; inset: 10px; z-index: 3; display: none; place-items: center; align-content: center; gap: 10px; border: 2px dashed var(--accent); border-radius: 22px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--accent-text); font-size: 19px; font-weight: 650; pointer-events: none; }
.dropping .drop-hint { display: grid; animation: fade .15s; }

.composer { flex: none; background: var(--surface); padding-bottom: var(--sab); }
.composer-row { display: flex; align-items: flex-end; gap: 4px; padding: 6px 8px; max-width: 900px; margin: 0 auto; }
.composer-row textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 150px; resize: none; overflow-y: hidden; border: 1px solid var(--edge); outline: 0; border-radius: 22px; background: var(--surface); padding: 10px 16px; line-height: 22px; transition: border-color .15s; }
.composer-row textarea:focus { border-color: var(--muted); }
.icon-btn.send { background: var(--accent); color: var(--accent-ink); transition: scale .2s var(--ease), background .2s, color .2s, opacity .2s; }
.icon-btn.send .ic { width: 22px; height: 22px; stroke-width: 2.4; }
.icon-btn.send.idle { background: var(--bg); color: var(--muted); scale: .86; }
.icon-btn.send.busy { opacity: .5; pointer-events: none; }
.composer .icon-btn:not(.send) { color: var(--muted); }
.banner { display: flex; align-items: center; gap: 10px; padding: 8px 8px 2px 16px; color: var(--accent-text); max-width: 900px; margin: 0 auto; animation: paneIn .2s var(--ease); }
.banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; line-height: 1.3; padding-left: 9px; border-left: 3px solid var(--accent); }
.banner-text span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- overlays --- */
.ov { position: fixed; inset: 0; z-index: 10; display: flex; background: rgb(8 8 16 / .55); animation: fade .2s; }
.ov.closing { animation: fadeOut .2s forwards; }
.sheet-wrap { align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; padding: 6px 0 calc(10px + var(--sab)); border-radius: 24px 24px 0 0; background: var(--surface); animation: rise .28s var(--ease); transition: transform .22s var(--ease); }
.closing .sheet { animation: sink .2s var(--ease-in) forwards; }
.grip { display: block; width: 38px; height: 4px; margin: 4px auto 6px; border-radius: 2px; background: var(--line); }
.sheet-item { display: flex; align-items: center; gap: 18px; width: 100%; min-height: 52px; padding: 0 24px; transition: background .12s; }
.sheet-item:hover, .sheet-item:active, .pick-row:not(.static):hover { background: var(--bg); }
.sheet-item .ic { color: var(--muted); width: 22px; height: 22px; }
.sheet-item.danger, .sheet-item.danger .ic { color: var(--danger); }
.ov.center { align-items: center; justify-content: center; padding: 20px; }
.dialog { width: 100%; max-width: 400px; max-height: 100%; display: flex; flex-direction: column; padding: 20px; border-radius: 24px; background: var(--surface); box-shadow: 0 20px 60px rgb(0 0 0 / .3); animation: grow .24s var(--ease); }
.closing .dialog { animation: shrink .18s forwards; }
.dialog.tall { height: min(560px, 100%); }
.dialog form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dialog-head { display: flex; align-items: center; margin: -8px -10px 8px 0; }
.dialog-head h2 { flex: 1; font-size: 20px; }
.dialog-text { margin-bottom: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dialog input:not([type=checkbox]), .login input { width: 100%; height: 48px; padding: 0 16px; border: 1px solid var(--edge); border-radius: 12px; background: var(--surface); transition: border-color .15s; }
.dialog input:focus, .login input:focus { outline: 0; border-color: var(--text); }
.btn { min-height: 46px; padding: 0 20px; border-radius: 23px; font-weight: 600; color: var(--accent-text); transition: background .15s, transform .12s; }
.btn:hover { background: var(--bg); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 86%, var(--surface)); }
.btn.primary.danger { background: var(--danger); color: var(--surface); }
.btn:disabled { opacity: .6; }
.pick-list { flex: 1; min-height: 0; overflow-y: auto; margin: 8px -20px 0; }
.pick-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 0 20px; transition: background .12s; }
.pick-row input { width: 20px; height: 20px; accent-color: var(--accent); }

.ov.page { background: transparent; }
.page-panel { width: 100%; height: 100%; display: flex; flex-direction: column; background: var(--surface); will-change: transform; box-shadow: -1px 0 0 var(--line); animation: slideIn .3s var(--ease); }
.page.closing .page-panel { animation: slideOut .22s var(--ease-in) forwards; }
.page-scroll { flex: 1; overflow-y: auto; }
@media (min-width: 860px) {
  .ov.page { align-items: center; justify-content: center; background: rgb(8 8 16 / .55); }
  .page-panel { max-width: 580px; height: min(840px, 92%); border-radius: 24px; overflow: hidden; animation: grow .24s var(--ease); }
  .page.closing .page-panel { animation: shrink .18s forwards; }
}
.hero { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px 14px; text-align: center; }
.hero h2 { font-size: 24px; }
.people { border-top: 1px solid var(--line); padding: 6px 0; }
.tabs { position: sticky; top: 0; z-index: 1; display: flex; background: var(--surface); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.tab { flex: 1; height: 48px; text-align: center; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; transition: color .15s, border-color .15s; }
.tab[aria-selected=true] { color: var(--accent-text); border-bottom-color: var(--accent); }
.info-body { animation: paneIn .22s var(--ease); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.info-row { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; }
.info-row .file { flex: 1; }
.info-row .icon-btn { color: var(--muted); }

/* videos that play by themselves in a chat */
.tile .pv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; pointer-events: none; }
.tile.playing .pv { opacity: 1; }
.tile.playing .play { opacity: 0; }
.tile .play { transition: opacity .2s; }
/* tags */
.st-tags { display: flex; align-items: center; gap: 6px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; color: var(--muted); }
.st-tag-in { flex: none; width: 120px; height: 34px; padding: 0 12px; border: 1px dashed var(--edge); border-radius: 17px; background: none; color: #fff; font-size: 14px; outline: 0; }
.st-tag-in:focus { border-style: solid; border-color: #fff; }
.st-tags .chip-f { height: 34px; padding: 0 12px; }
.viewer-tags { position: absolute; left: 0; right: 0; top: calc(var(--bar-h) + var(--sat) + 2px); z-index: 2; display: flex; gap: 6px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; transition: opacity .2s; }
.vtag { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 15px; background: rgb(60 60 66 / .85); color: #fff; font-size: 13px; }
.vtag.add { background: none; border: 1px dashed rgb(255 255 255 / .45); color: rgb(255 255 255 / .85); }
.vtag.sug { padding: 0; gap: 0; background: rgb(60 60 66 / .55); border: 1px dashed #5fe0b5; }
.vtag.sug button { display: inline-flex; align-items: center; gap: 5px; height: 100%; padding: 0 4px 0 10px; color: #fff; font-size: 13px; }
.vtag.sug button.no { padding: 0 9px 0 5px; color: rgb(255 255 255 / .6); }
.chip-f.sug { border-style: dashed; border-color: var(--accent); color: var(--accent-text); }
.lib-maybe-hint { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; color: var(--muted, #888); font-size: 14px; }
.lib-maybe-card { flex: none; display: flex; flex-direction: column; gap: 6px; transition: opacity .2s, transform .2s; }
.lib-maybe-card.gone { opacity: 0; transform: scale(.9); }
.lib-maybe-btns { display: flex; gap: 6px; }
.lib-maybe-btns button { flex: 1; display: inline-flex; align-items: center; justify-content: center; height: 34px; border-radius: 17px; border: 1px solid var(--edge); }
.lib-maybe-btns .yes { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.viewer.bare .viewer-tags { opacity: 0; pointer-events: none; }

/* the media studio: always dark, pictures against black */
@keyframes studioIn { from { opacity: 0; transform: translateY(4%) scale(.98); } }
@keyframes studioOut { to { opacity: 0; transform: translateY(4%); } }
.studio { flex-direction: column; background: #000; color: #fff; color-scheme: dark; animation: studioIn .26s var(--ease);
  --text: #f2f2f6; --muted: #a2a3b0; --line: #34343f; --bg: #1c1c24; --surface: #131318; --accent-text: #b3a6ff; --accent-soft: #272148; }
.studio.closing { animation: studioOut .2s var(--ease-in) forwards; }
.studio .bar { background: none; border: 0; color: #fff; }
.st-tools { display: flex; }
.st-tools .off { opacity: .3; pointer-events: none; }
.st-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: pan-y; }
.st-stage > img, .st-stage > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; animation: fade .18s; user-select: none; }
.st-doc { position: absolute; inset: 0; margin: auto; width: min(280px, 80%); height: max-content; display: grid; justify-items: center; gap: 8px; padding: 28px 20px; border-radius: 24px; background: #17171d; text-align: center; overflow-wrap: anywhere; }
.st-doc span:last-child { color: var(--muted); font-size: 14px; }
.working .st-stage::after { content: ""; position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgb(255 255 255 / .25); border-top-color: #fff; animation: spin .8s linear infinite; }
.working .st-stage > img { opacity: .5; }
.st-crop { position: absolute; border: 1.5px solid #fff; box-shadow: 0 0 0 9999px rgb(0 0 0 / .66); touch-action: none; cursor: move;
  background: linear-gradient(rgb(255 255 255 / .35), rgb(255 255 255 / .35)) 33.33% 0 / 1px 100% no-repeat, linear-gradient(rgb(255 255 255 / .35), rgb(255 255 255 / .35)) 66.66% 0 / 1px 100% no-repeat,
    linear-gradient(rgb(255 255 255 / .35), rgb(255 255 255 / .35)) 0 33.33% / 100% 1px no-repeat, linear-gradient(rgb(255 255 255 / .35), rgb(255 255 255 / .35)) 0 66.66% / 100% 1px no-repeat; }
.st-crop .h { position: absolute; width: 34px; height: 34px; border: 0 solid #fff; }
.st-crop .nw { left: -4px; top: -4px; border-width: 4px 0 0 4px; cursor: nwse-resize; }
.st-crop .ne { right: -4px; top: -4px; border-width: 4px 4px 0 0; cursor: nesw-resize; }
.st-crop .sw { left: -4px; bottom: -4px; border-width: 0 0 4px 4px; cursor: nesw-resize; }
.st-crop .se { right: -4px; bottom: -4px; border-width: 0 4px 4px 0; cursor: nwse-resize; }
.st-pad { position: absolute; touch-action: none; cursor: crosshair; }
.st-edit { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px calc(12px + var(--sab)); animation: paneIn .2s var(--ease); }
.st-controls { flex: 1; min-width: 0; display: flex; gap: 10px; overflow-x: auto; align-items: center; padding: 4px; scrollbar-width: none; }
.st-swatch { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 2px solid rgb(255 255 255 / .4); transition: scale .15s var(--ease); }
.st-swatch[aria-pressed=true] { scale: 1.2; border-color: #fff; box-shadow: 0 0 0 2px #000, 0 0 0 4px #fff; }
.btn.ghost { color: #fff; }
.editing .st-foot, .editing .st-tools { display: none; }
.st-foot { flex: none; padding-bottom: var(--sab); }
.st-strip { display: flex; gap: 7px; overflow-x: auto; padding: 10px 12px 8px; scrollbar-width: none; }
.st-thumb { position: relative; width: 58px; height: 58px; flex: none; border-radius: 13px; overflow: hidden; background: #22222b; display: grid; place-items: center; color: #b8b8c4; opacity: .55; transition: opacity .15s, scale .15s var(--ease), box-shadow .15s; }
.st-thumb.on { opacity: 1; scale: 1.06; box-shadow: 0 0 0 2.5px #0dbd8b; }
.st-thumb img { width: 100%; height: 100%; object-fit: cover; }
.st-num { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #0dbd8b; color: #06291f; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.st-dur { position: absolute; left: 3px; bottom: 3px; padding: 0 4px; border-radius: 6px; background: rgb(0 0 0 / .65); font-size: 10px; }
.st-thumb.add { opacity: 1; background: none; border: 1.5px dashed #5a5a68; }
.st-opts { display: flex; align-items: center; gap: 8px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.st-note { font-size: 13px; color: var(--muted); white-space: nowrap; }
.studio .composer-row textarea { background: #1c1c24; color: #fff; }
.studio .send { position: relative; }
.st-count { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #fff; color: #111; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

.viewer { background: rgb(0 0 0 / var(--dim, 1)); color: #fff; outline: 0; }
.viewer.closing { animation: fadeOut .2s forwards; }
.viewer .bar { position: absolute; inset: 0 0 auto; z-index: 2; border: 0; color: #fff; background: linear-gradient(rgb(0 0 0 / .65), transparent); transition: opacity .2s; }
.viewer .bar-title { font-family: inherit; font-size: 16px; }
.viewer .bar-sub { color: rgb(255 255 255 / .75); }
.stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.stage img, .stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.stage .fade-in { animation: fade .2s; }
.stage .from-right { animation: fromRight .24s var(--ease); }
.stage .from-left { animation: fromLeft .24s var(--ease); }
.viewer-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; max-height: 30%; overflow-y: auto; padding: 28px 16px calc(16px + var(--sab)); background: linear-gradient(transparent, rgb(0 0 0 / .7) 40%); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; transition: opacity .2s; }
.viewer.is-video .viewer-cap { bottom: 76px; background: none; text-shadow: 0 1px 4px #000; }
.viewer.bare .bar, .viewer.bare .viewer-cap, .viewer.bare .nav { opacity: 0; pointer-events: none; }
.icon-btn.nav { position: absolute; top: 50%; z-index: 2; translate: 0 -50%; background: rgb(0 0 0 / .45); }
.icon-btn.nav.prev { left: 10px; }
.icon-btn.nav.next { right: 10px; }
@media (pointer: coarse) { .icon-btn.nav { display: none; } }

/* --- bottom tabs, gallery --- */
.tabbar { flex: none; display: flex; justify-content: space-around; padding: 6px 8px calc(6px + var(--sab)); background: var(--surface); border-top: 1px solid var(--line); }
.tab-b { flex: 1; max-width: 140px; display: grid; justify-items: center; gap: 2px; padding: 4px 0; border-radius: 14px; color: var(--muted); font-size: 11.5px; font-weight: 500; text-decoration: none; transition: color .15s; }
.tab-b .ic { width: 23px; height: 23px; transition: scale .2s var(--ease); }
.tab-b.on { color: var(--text); font-weight: 600; }
.tab-b.on .ic { color: var(--accent-text); scale: 1.08; }
.lib, .adm { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lib .filters { border-bottom: 0; }
.lib-scroll { flex: 1; overflow-y: auto; padding-bottom: 24px; contain: strict; }
.lib { position: relative; }
.lib-tile, .tile { contain: layout paint; }
.lib-month { position: sticky; top: 0; z-index: 1; margin: 0; padding: 12px 14px 8px; font-size: 15px; font-weight: 600; background: var(--surface); }
.lib-month::first-letter { text-transform: uppercase; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 2px; }
@media (min-width: 860px) { .lib-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 3px; padding: 0 12px; } }
.lib-tile { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--tile); }
.lib-tile img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s, scale .3s var(--ease); }
.lib-tile img.in { opacity: 1; }
.lib-tile:hover img { scale: 1.04; }
.lib-tile .dur { top: auto; bottom: 6px; left: 6px; display: inline-flex; align-items: center; gap: 3px; }
.lib-heart { display: none; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; place-items: center; background: rgb(0 0 0 / .45); color: #fff; }
.lib-heart .ic { fill: currentColor; }
.lib-tile.fav .lib-heart { display: grid; }
.lib-memories { padding-bottom: 6px; }
.lib-strip { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 6px; scrollbar-width: none; }
.lib-tile.big { flex: none; width: 132px; aspect-ratio: 3 / 4; border-radius: 16px; }
.lib-ago { position: absolute; inset: auto 0 0; padding: 22px 10px 8px; background: linear-gradient(transparent, rgb(0 0 0 / .65)); color: #fff; font-size: 12px; font-weight: 600; text-align: left; }
select.chip-f { appearance: none; background: var(--surface); color: inherit; padding-right: 30px; max-width: 190px; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 15px, calc(100% - 12px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.viewer .heart.on .ic { fill: #ff5b7d; stroke: #ff5b7d; }
.viewer.playing .slideshow { color: #0dbd8b; }

/* --- administration --- */
.adm-body { flex: 1; overflow-y: auto; padding: 4px 14px 28px; display: grid; gap: 14px; align-content: start; max-width: 1040px; width: 100%; margin: 0 auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi, .card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.kpi { display: grid; gap: 2px; padding: 14px 16px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 13px; color: var(--muted); }
.meter { display: block; height: 6px; margin-top: 8px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--s1); }
.card { padding: 16px; min-width: 0; }
.card h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.card-sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.card > h2 + :not(.card-sub) { margin-top: 12px; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border: 1px solid var(--edge); }
.card .btn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border: 1px solid var(--edge); color: var(--text); font-size: 14px; }
.chart-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 18px; border-bottom: 1px solid var(--edge); }
.chart-max { position: absolute; top: 0; left: 0; font-size: 11px; color: var(--muted); }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; border-radius: 4px 4px 0 0; }
.bar-col i { display: block; width: 100%; min-height: 1px; border-radius: 4px 4px 0 0; background: var(--s1); transition: height .4s var(--ease), opacity .15s; }
.chart-plot:hover .bar-col i { opacity: .45; }
.chart-plot .bar-col:hover i, .bar-col:focus-visible i { opacity: 1; }
.chart-tip { position: absolute; bottom: calc(100% - 14px); translate: -50% 0; display: grid; gap: 1px; padding: 7px 10px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 2; box-shadow: 0 4px 14px rgb(0 0 0 / .25); }
.chart-x { display: flex; justify-content: space-between; padding-top: 5px; font-size: 11px; color: var(--muted); }
.chart-table { margin-top: 10px; font-size: 13px; color: var(--muted); }
.chart-table summary { cursor: pointer; width: max-content; }
.chart-table table, .tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart-table td, .chart-table th { padding: 4px 8px 4px 0; text-align: left; }
.stack { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; }
.stack i { display: block; min-width: 4px; }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto; column-gap: 8px; align-items: center; font-size: 14px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }
.legend-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-sub { grid-column: 2 / -1; font-size: 12px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.tbl th { padding: 8px 14px 8px 0; text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 14px 10px 0; font-size: 14px; white-space: nowrap; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-sub { display: block; font-size: 12px; color: var(--muted); }
.online { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.online i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.rank { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.rank-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.rank-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-bar { display: block; height: 6px; margin: 5px 0 3px; border-radius: 3px; background: var(--bg); }
.rank-bar i { display: block; height: 100%; min-width: 2px; border-radius: 3px; background: var(--s1); }
.rank-sub { font-size: 12px; color: var(--muted); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.adm-foot { font-size: 12px; color: var(--muted); text-align: center; }
.adm-form { gap: 10px; }
.adm-check { padding: 0; min-height: 40px; }

/* --- studio: one size down, closer to Telegram's proportions --- */
.studio .icon-btn { width: 40px; height: 40px; }
.studio .ic { width: 20px; height: 20px; }
.studio .ic.sm { width: 15px; height: 15px; }
.studio .ic.xs { width: 12px; height: 12px; }
.studio .composer-row { padding: 5px 8px; }
.studio .composer-row textarea { min-height: 40px; padding: 8px 14px; font-size: 15px; line-height: 22px; }
.studio .st-count { min-width: 18px; height: 18px; font-size: 10px; }
.studio .bar { height: 48px; }
.studio .bar-title { font-size: 15px; }
.st-tools { justify-content: center; gap: 2px; padding-top: 2px; color: rgb(255 255 255 / .92); }
.st-strip { padding: 6px 12px; gap: 6px; }
.st-thumb { width: 46px; height: 46px; border-radius: 10px; }
.st-num { top: 2px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; }
.st-dur { font-size: 9px; }
.st-tags { padding-bottom: 6px; }
.studio .chip-f, .st-tags .chip-f { height: 30px; padding: 0 11px; font-size: 13px; }
.st-tag-in { width: 106px; height: 30px; font-size: 13px; }
.st-note { font-size: 12px; }
.st-edit { padding-top: 8px; }
.st-edit .btn { min-height: 38px; padding: 0 14px; font-size: 14px; }
.st-swatch { width: 26px; height: 26px; }
.st-doc { font-size: 14px; }

/* --- a message of only emoji: large, no bubble --- */
.bubble.jumbo { padding: 0 2px; background: none; box-shadow: none; }
.bubble.jumbo .text { font-size: var(--jumbo, 48px); line-height: 1.18; letter-spacing: 0; font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", var(--font); }
.bubble.jumbo .meta { font-family: var(--font); }
.bubble.jumbo .text .meta { float: none; display: flex; width: max-content; margin: 2px 0 0 auto; padding: 3px 7px; border-radius: 10px; background: color-mix(in srgb, var(--text) 8%, transparent); font-size: 11px; }
.theirs .bubble.jumbo .text .meta { margin-left: 0; }

/* --- the chat itself: who wrote what must be obvious, and it should feel like the chat list --- */
:root { --mine: #d7f5e6; --mine-meta: #3f7a63; --theirs: #f0f2f5; }
@media (prefers-color-scheme: dark) { :root { --mine: #0e4a3a; --mine-meta: #8fd3bb; --theirs: #1f2227; } }
#main { background: var(--glow) top / 100% 240px no-repeat, var(--chat-bg); }
#main > .bar { background: none; border-bottom-color: transparent; }
.pinbar { background: color-mix(in srgb, var(--surface) 70%, transparent); border: 0; margin: 0 10px 2px; padding: 7px 12px; border-radius: 12px; }
.msgs { padding: 10px 0 12px; }
.msg { padding: 1px 12px; }
.msg.first { margin-top: 12px; }
.bubble { max-width: min(78%, 520px); padding: 8px 12px 8px; border-radius: 18px; }
.bubble.bare, .bubble.jumbo { border-radius: 16px; }
.mine .bubble a { color: #00664f; }
@media (prefers-color-scheme: dark) { .mine .bubble a { color: #7fe3c4; } }
/* Groups, Element's way: no tails; the sender's picture sits on the bubble's top left corner, ringed in the
   page's colour, and the name beside it above the bubble (the Android app does the same in Bubble.java). */
.avatar.xs { width: 30px; height: 30px; font-size: 11px; margin: 0 -10px 0 0; align-self: flex-start; position: relative; z-index: 1; box-shadow: 0 0 0 2px var(--chat-bg); }
.av-gap { width: 20px; flex: none; }
.sender { font-size: 13px; margin-bottom: 2px; }
.avatar.xs + .bubble { margin-top: 22px; }
.avatar.xs + .bubble > .sender, .avatar.xs + .bubble.bare > .sender { position: absolute; left: 16px; bottom: 100%; margin: 0 0 4px; padding: 0; max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day { padding: 14px 12px 4px; }
.day span, .svc span { font-size: 12px; font-weight: 600; letter-spacing: .01em; padding: 4px 12px; border-radius: 14px; background: var(--bg); color: var(--muted); }
.svc span { font-weight: 500; }
.meta { font-size: 10.5px; letter-spacing: 0; }
.reply { border-radius: 8px; padding: 4px 9px; background: color-mix(in srgb, var(--text) 6%, transparent); border-left-color: var(--accent-text); }
.mine .reply { background: color-mix(in srgb, var(--accent-text) 12%, transparent); }
/* A link's preview under the text (docs/link-preview.md): a tinted block with an accent bar on its left; the site,
   a title of at most four lines, a description of at most six; a small square picture beside the text, or a large
   one below it. The whole block is the link. */
.lp { display: block; clear: both; position: relative; min-width: min(250px, 100%); margin: 4px 0 3px; padding: 5px 9px 7px 10px; border-left: 3px solid var(--accent-text); border-radius: 6px; background: color-mix(in srgb, var(--accent-text) 10%, transparent); font-size: 14px; line-height: 1.36; text-decoration: none; overflow: hidden; transition: background .15s, scale .12s var(--ease); }
.bubble a.lp { color: inherit; }
.lp:hover { background: color-mix(in srgb, var(--accent-text) 16%, transparent); }
.lp:active { scale: .99; }
.lp > span { display: block; overflow-wrap: anywhere; }
.lp-site { font-weight: 600; color: var(--accent-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-title, .lp-desc { display: -webkit-box !important; -webkit-box-orient: vertical; overflow: hidden; margin-top: 1px; }
.lp-title { font-weight: 600; -webkit-line-clamp: 4; line-clamp: 4; }
.lp-desc { -webkit-line-clamp: 6; line-clamp: 6; }
.lp-thumb { float: right; width: 48px; height: 48px; margin: 3px 0 2px 10px; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, var(--text) 8%, transparent); }
.lp-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lp-img { margin-top: 6px; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, var(--text) 8%, transparent); }
.lp-img img { display: block; width: 100%; height: auto; min-height: 60px; max-height: min(33vh, 340px); object-fit: cover; }
.lp ~ .meta { margin-top: 2px; }
.link-bar { min-height: 48px; }
.link-bar .banner-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg.sel { background: color-mix(in srgb, var(--brand) 16%, transparent); }
.composer { background: none; }
#main .composer-row { padding: 6px 10px 8px; }

/* reactions */
.reacts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; clear: both; }
.react { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 9px; border-radius: 14px; font-size: 15px; background: color-mix(in srgb, var(--text) 8%, transparent); border: 1px solid transparent; transition: scale .15s var(--ease), background .15s; }
.react span { font-size: 12px; font-weight: 600; color: var(--muted); }
.react.on { background: var(--accent-soft); border-color: var(--accent-text); }
.react.on span { color: var(--accent-text); }
.react:active { scale: .9; }
.bubble.bare .reacts, .bubble.jumbo .reacts { padding: 0 4px 4px; }
.quick-reacts { display: flex; justify-content: space-between; gap: 2px; padding: 2px 14px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.quick { width: 44px; height: 44px; border-radius: 50%; font-size: 26px; line-height: 1; font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", var(--font); transition: scale .15s var(--ease), background .15s; }
.quick:active { scale: 1.25; }
.quick.on { background: var(--accent-soft); }

/* --- calendar --- */
.cal-body { flex: 1; overflow-y: auto; padding: 4px 12px 28px; }
.cal-month h2 { position: sticky; top: 0; z-index: 1; padding: 14px 4px 8px; font-size: 16px; font-weight: 600; background: var(--surface); }
.cal-month h2::first-letter { text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 4px; text-transform: uppercase; }
.cal-day { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font-size: 14px; color: var(--muted); overflow: hidden; }
.cal-day.on { color: var(--text); font-weight: 600; background: var(--bg); transition: scale .15s var(--ease); }
.cal-day.on:active { scale: .92; }
.cal-day img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cal-day.pic b { position: relative; color: #fff; text-shadow: 0 1px 3px rgb(0 0 0 / .7); }
.cal-day.pic::after { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / .22); }
.cal-day b { z-index: 1; font-weight: 600; }
.cal-day i { position: absolute; bottom: 12%; font-size: 9px; font-style: normal; font-weight: 500; color: var(--accent-text); }
.day span { cursor: pointer; }

/* --- emoji panel --- */
.emo { height: min(300px, 42dvh); display: flex; flex-direction: column; border-top: 1px solid var(--line); animation: paneIn .18s var(--ease); }
.emo-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); align-content: start; padding: 6px 8px; contain: strict; }
.emo-k { height: 44px; font-size: 27px; line-height: 1; border-radius: 10px; font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", var(--font); }
.emo-k:active { background: var(--bg); scale: 1.15; }
.emo-tabs { flex: none; order: 2; display: flex; align-items: center; padding: 2px 6px calc(2px + var(--sab)); border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.emo-tab { flex: 1; min-width: 40px; height: 40px; display: grid; place-items: center; font-size: 21px; border-radius: 12px; color: var(--muted); filter: grayscale(.6); opacity: .7; }
.emo-tab[aria-selected=true] { background: var(--bg); filter: none; opacity: 1; color: var(--text); }
.emo-del { color: var(--muted); }
.composer:has(.emo:not([hidden])) { padding-bottom: 0; }
.composer .emo-btn { margin-left: -6px; }

/* --- search --- */
.search-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.filters { flex: none; padding: 10px 0 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; align-items: center; }
.chip-f { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 15px; border-radius: 18px; border: 1px solid var(--edge); font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .12s; }
.chip-f:active { transform: scale(.95); }
.chip-f[aria-pressed=true] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.date { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.date input { height: 36px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 18px; background: transparent; font-size: 14px; }
.results { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.res { flex: none; display: flex; gap: 12px; padding: 11px 14px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); transition: background .12s; animation: paneIn .2s var(--ease); }
.res:hover, .res:active { background: var(--bg); }
.res-thumb { width: 54px; height: 54px; flex: none; border-radius: 12px; object-fit: cover; display: grid; place-items: center; background: var(--bg); color: var(--muted); }
.res-body { flex: 1; min-width: 0; }
.res-top { display: flex; gap: 8px; align-items: baseline; }
.res-chat { flex: 1; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-date { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.res-text { color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
mark { background: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); border-radius: 4px; padding: 0 2px; }

/* --- login and toasts --- */
.login-wrap { min-height: 100dvh; background: var(--glow), radial-gradient(70% 50% at 50% 100%, rgb(13 189 139 / .12), transparent 70%), var(--surface); }
.login { min-height: 100dvh; max-width: 340px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; justify-content: center; gap: 12px; text-align: center; }
.login > * { animation: paneIn .5s var(--ease) backwards; }
.login > :nth-child(2) { animation-delay: .06s; }
.login > :nth-child(3) { animation-delay: .12s; }
.login > :nth-child(n+4) { animation-delay: .18s; }
.login.shake { animation: shake .4s; }
.login-logo { width: 84px; height: 84px; margin: 0 auto 4px; filter: drop-shadow(0 14px 28px rgb(4 103 221 / .28)); }
.login h1 { font-size: 44px; line-height: 1; }
.login .muted { margin-bottom: 16px; font-size: 16px; }
.login .btn { margin-top: 4px; }
.get-app { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.form-error { color: var(--danger); font-size: 14px; min-height: 20px; }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(88px + var(--sab)); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { max-width: 100%; padding: 11px 18px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 6px 20px rgb(0 0 0 / .35); animation: grow .24s var(--ease); transition: opacity .2s, transform .2s; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast.act { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
.toast.act { justify-content: space-between; }
.toast.act button { flex: none; padding: 4px 2px; color: #5fe0b5; font-weight: 600; font-size: 14px; }
.lib-maybe-more { margin-left: 10px; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: underline; }
p + .lib-maybe-more, .lib-maybe > .lib-maybe-more { margin: 0 14px 8px; }
.lib-refused .lib-maybe-btns button { gap: 6px; font-size: 13px; padding: 0 10px; }

/* --- personal pictures: the initials stay underneath until the photo has loaded --- */
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.avatar img.in { opacity: 1; }
.avatar.xl { width: 124px; height: 124px; font-size: 44px; }

/* --- profile --- */
.dialog.prof-dialog { max-width: 420px; }
.prof { display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 0; overflow-y: auto; margin: 0 -20px; padding: 2px 20px 4px; }
.prof-face { position: relative; padding: 10px; border-radius: 50%; background: radial-gradient(closest-side, rgb(13 189 139 / .22), rgb(4 103 221 / .1) 70%, transparent); }
.prof-cam { position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); box-shadow: 0 0 0 3px var(--surface); transition: transform .12s; }
.prof-cam:active { transform: scale(.92); }
.prof-name { display: grid; justify-items: center; line-height: 1.3; }
.prof-name b { font-size: 19px; letter-spacing: -.015em; }
.prof-name span { font-size: 14px; }
.prof-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.prof-actions .btn:not(.primary) { border: 1px solid var(--edge); color: var(--text); }
.btn.danger-text, .prof-actions .btn.danger-text { color: var(--danger); }
.prof .prof-pass { flex: none; align-self: stretch; gap: 10px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.prof-h { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.prof-h .ic { color: var(--muted); }
.prof-pass .form-error { min-height: 0; }

/* --- members of a group --- */
.people-head { padding: 12px 20px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.member { display: flex; align-items: center; padding-right: 10px; }
.member .pick-row { flex: 1; min-width: 0; }
.member .pick-row:disabled { cursor: default; }
.pick-row:disabled:hover { background: none; }
.member-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-x { color: var(--muted); }
.member-x:hover { color: var(--danger); }
.pick-row.leave { color: var(--danger); font-weight: 500; }
.avatar.leave-ic { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }

/* --- voice messages: play, bars that fill as it plays, duration; the transcript underneath --- */
.voice { width: min(260px, 60vw); padding: 2px 0; }
.vrow { display: flex; align-items: center; gap: 11px; }
.vplay { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 10px rgb(0 122 97 / .25); transition: transform .12s, background .15s; }
.vplay:active { transform: scale(.92); }
.vplay .ic { width: 18px; height: 18px; }
.vplay[data-state=false] .ic { translate: 1.5px 0; }
.vmid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vbars { display: flex; align-items: center; gap: 2px; width: 100%; height: 30px; }
.vbars i { flex: 1 1 0; min-width: 2px; max-width: 4px; border-radius: 2px; background: color-mix(in srgb, var(--text) 26%, transparent); transition: background .1s; }
.mine .vbars i { background: color-mix(in srgb, var(--mine-meta) 42%, transparent); }
.vbars i.on, .mine .vbars i.on { background: var(--accent-text); }
.vtime { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mine .vtime { color: var(--mine-meta); }
.vtrans { margin-top: 7px; }
.vtoggle { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12.5px; font-weight: 600; color: var(--accent-text); background: color-mix(in srgb, var(--accent-text) 11%, transparent); transition: background .15s, color .15s; }
.vtoggle[aria-expanded=false] { color: var(--muted); background: color-mix(in srgb, var(--text) 7%, transparent); }
.vtoggle:disabled { opacity: .5; }
.vtext { margin-top: 7px; padding-left: 10px; border-left: 2px solid color-mix(in srgb, var(--accent-text) 45%, transparent); font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; animation: paneIn .2s var(--ease); }
.vtext.pending { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; color: var(--muted); font-size: 13px; }
.vtext.pending .spinner { border-top-color: var(--accent-text); }
.audio .vtrans { max-width: min(300px, 64vw); }

/* --- recording from the composer --- */
@keyframes blink { 50% { opacity: .2; } }
.rec { display: flex; align-items: center; gap: 8px; max-width: 900px; margin: 0 auto; padding: 6px 10px 8px; animation: paneIn .2s var(--ease); }
.composer .icon-btn.rec-cancel { color: var(--danger); }
.rec-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--danger); animation: blink 1.1s ease-in-out infinite; }
.rec-time { min-width: 40px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-bars { flex: 1; min-width: 0; height: 34px; display: flex; align-items: center; justify-content: flex-end; gap: 2px; overflow: hidden; }
.rec-bars i { flex: none; width: 3px; border-radius: 2px; background: var(--accent-text); animation: fade .15s; }

/* --- quick filters, favourites, disappearing messages --- */
.quickf { flex: none; gap: 6px; padding-block: 2px 10px; }
.quickf .chip-f { height: 38px; padding: 0 13px; border-width: 1.5px; font-size: 15px; font-weight: 500; }
.quickf .chip-f[aria-pressed=true] { font-weight: 600; }
.chatlist .empty { margin: 36px auto 0; }
.chatlist .empty .btn { margin-top: 10px; border: 1px solid var(--edge); color: var(--text); }
.chat-row-fav { flex: none; display: grid; place-items: center; color: var(--accent-text); }
.chat-row-fav .ic { fill: currentColor; stroke-width: 2; }
@media (pointer: coarse) { .chat-row { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; } }
.sheet-head { display: flex; flex-direction: column; padding: 4px 24px 10px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head span { font-size: 13px; font-weight: 400; color: var(--muted); }
.ttl-mark { display: inline-flex; align-items: center; gap: 3px; color: var(--accent-text); font-weight: 500; vertical-align: -1px; }
.ttl-mark .ic.xs { width: 12px; height: 12px; }
.exp { display: inline-flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.exp .ic.xs { width: 11px; height: 11px; stroke-width: 2.4; }
.meta .exp { margin-right: 3px; }
.res-top .exp { flex: none; font-size: 12px; color: var(--accent-text); }
.info-opts { border-top: 1px solid var(--line); padding: 6px 0; }
.info-opts .pick-row .ic { color: var(--muted); width: 22px; height: 22px; }
.info-opts .pick-row > span:nth-child(2) { flex: 1; text-align: left; }
.opt-val { font-size: 14px; color: var(--muted); }
.sw { position: relative; flex: none; width: 40px; height: 24px; border-radius: 12px; background: var(--edge); transition: background .18s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: translate .18s var(--ease); }
[aria-checked=true] > .sw { background: var(--accent); }
[aria-checked=true] > .sw::after { translate: 16px 0; }
.dialog-note { margin: -2px 0 6px; font-size: 14px; color: var(--muted); }
.pick-row.opt { gap: 16px; }
.radio { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--edge); transition: border-color .15s, box-shadow .15s; }
.opt[aria-checked=true] .radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 11px var(--accent); }
.pick-list.opts { flex: none; margin-top: 4px; }
.ttl-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ttl-custom .btn { grid-column: 1 / -1; }
.dialog select { width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--edge); border-radius: 12px; background: var(--surface); color: inherit; }
.dialog select:focus { outline: 0; border-color: var(--text); }

/* --- scrollbars ---
   Quiet and theme-aware: thin, no arrows, only a faint thumb that firms up while the pointer is over the area it
   scrolls. Vertical lists reserve their gutter (no layout jump when a bar appears); horizontal strips never show a bar
   (wheel, drag and touch still scroll them) and fade out at their edges instead. Safari before 18.2 gets the
   ::-webkit-scrollbar equivalent. */
:root { --sb: color-mix(in srgb, var(--text) 20%, transparent); --sb-on: color-mix(in srgb, var(--text) 40%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--sb) transparent; }
:is(.chatlist, .scroller, .lib-scroll, .results, .page-scroll, .adm-body, .cal-body, .pick-list, .emo-grid, .prof, .viewer-cap, textarea):hover { --sb: var(--sb-on); }
:is(.chatlist, .scroller, .lib-scroll, .results, .page-scroll, .adm-body, .cal-body, .pick-list, .emo-grid, .prof) { scrollbar-gutter: stable; overscroll-behavior: contain; }
.viewer, .studio { --sb: rgb(255 255 255 / .28); --sb-on: rgb(255 255 255 / .5); }
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 9px; height: 9px; }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 6px; background: var(--sb) padding-box; }
  ::-webkit-scrollbar-thumb:hover { background: var(--sb-on) padding-box; }
  ::-webkit-scrollbar-button { display: none; }
}
.chips, .st-tags, .viewer-tags, .st-controls, .st-strip, .st-opts, .lib-strip, .emo-tabs, .tbl-wrap {
  --fade: 12px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
}
:is(.chips, .st-tags, .viewer-tags, .st-controls, .st-strip, .st-opts, .lib-strip, .emo-tabs, .tbl-wrap)::-webkit-scrollbar { display: none; }
.st-controls { padding-inline: 12px; }
.emo-tabs { --fade: 8px; padding-inline: 8px; }
.tbl-wrap { --fade: 16px; }
@media (hover: hover) { :is(.chips, .st-tags, .viewer-tags, .st-controls, .st-strip, .st-opts, .lib-strip, .emo-tabs, .tbl-wrap).dragging { cursor: grabbing; user-select: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* --- end-to-end encrypted chats: the lock, the states in words, devices and their safety codes --- */
.lock-mark { display: inline-flex; vertical-align: -1px; margin-right: 5px; color: var(--accent-text); }
.lock-mark .ic.xs { width: 13px; height: 13px; stroke-width: 2.4; }
.e2e-mark { display: inline-flex; align-items: center; gap: 3px; color: var(--accent-text); font-weight: 500; vertical-align: -1px; }
.e2e-mark .ic.xs { width: 12px; height: 12px; stroke-width: 2.4; }
.e2e-hero { margin-top: -4px; font-size: 14px; }
.e2e-choice { gap: 14px; min-height: 72px; padding-block: 10px; text-align: left; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.e2e-choice:disabled { cursor: default; opacity: 1; }
.e2e-choice:disabled:hover { background: none; }
.e2e-choice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.e2e-choice-text span { font-size: 13px; color: var(--muted); }
.avatar.e2e-ic { background: var(--accent-soft); color: var(--accent-text); }
.e2e-choice:disabled .avatar.e2e-ic { background: var(--bg); color: var(--muted); }
.e2e-note { display: flex; align-items: flex-start; gap: 12px; max-width: 900px; margin: 6px auto 0; padding: 10px 14px; border-radius: 16px; background: var(--accent-soft); color: var(--text); font-size: 14px; line-height: 1.35; animation: paneIn .2s var(--ease); }
.e2e-note > .ic { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--accent-text); }
.e2e-note.busy { align-items: center; padding-block: 8px; color: var(--muted); background: none; }
.e2e-note.busy .spinner { border-top-color: var(--accent-text); }
.e2e-note-text { display: flex; flex-direction: column; gap: 2px; }
.e2e-note-text span { color: var(--muted); }
#main .e2e-note { margin-inline: max(10px, (100% - 900px) / 2); }
.composer-row.off { opacity: .45; }
.locked-text { color: var(--muted); font-style: italic; font-size: 14.5px; }
.locked-text > .ic { width: 13px; height: 13px; margin-right: 5px; vertical-align: -1px; stroke-width: 2.4; }
.locked-text .meta { font-style: normal; }
.file.locked { color: var(--muted); }
.file.busy .file-ic { animation: blink 1.1s ease-in-out infinite; }
button.file { width: 100%; text-align: left; }
.voice.loading .vplay { animation: blink 1.1s ease-in-out infinite; }
.stage-wait { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.stage-wait .spinner { border-color: rgb(255 255 255 / .2); border-top-color: #fff; }
.stage-wait > span:not(.spinner) { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 18px; background: rgb(0 0 0 / .6); color: #fff; }
.e2e-off { flex: 1; display: grid; align-content: center; justify-items: center; gap: 10px; padding: 32px 28px; text-align: center; background: var(--glow), var(--chat-bg); animation: paneIn .3s var(--ease); }
.e2e-off h2 { font-size: 21px; letter-spacing: -.015em; }
.e2e-off p { max-width: 42ch; color: var(--muted); line-height: 1.45; }
.e2e-off .e2e-off-how { font-size: 14px; }
.e2e-off-ic { width: 72px; height: 72px; margin-bottom: 6px; border-radius: 24px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 10px 26px rgb(4 103 221 / .25); }
.e2e-off-ic .ic { width: 32px; height: 32px; }
.e2e-tab-note { display: flex; align-items: center; gap: 6px; padding: 12px 20px 4px; font-size: 13px; color: var(--muted); }
.e2e-tab-note .ic { flex: none; color: var(--accent-text); }
.bar.finding { gap: 4px; padding-right: 6px; }
.find-count { flex: none; min-width: 2.5em; font-size: 13px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.devices { border-top: 1px solid var(--line); padding: 6px 0 10px; }
.dev-note { padding: 2px 20px 8px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.dev-who { padding: 10px 20px 2px; font-size: 14px; font-weight: 600; }
.dev { display: flex; gap: 14px; padding: 10px 20px; }
.dev-ic { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--muted); }
.dev.me .dev-ic { background: var(--accent-soft); color: var(--accent-text); }
.dev.bad .dev-ic { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.dev-ic .ic { width: 19px; height: 19px; }
.dev-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dev-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-name { min-width: 0; overflow-wrap: anywhere; }
.dev-badge { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 9px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 600; }
.dev-badge.ok .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.dev-sub { font-size: 13px; color: var(--muted); }
.dev-fp { display: flex; flex-direction: column; margin-top: 4px; padding: 8px 12px; width: fit-content; max-width: 100%; border-radius: 12px; background: var(--bg); font: 500 14px/1.55 ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace; letter-spacing: .04em; font-variant-numeric: tabular-nums; user-select: all; }
.dev-warn { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--danger); }
.dev-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.dev-actions .btn.sm { color: var(--text); }
.dev-actions .btn.sm.danger-text { color: var(--danger); }
.dev-none { padding: 4px 20px 6px; font-size: 13px; color: var(--muted); }
.dev-notices { padding-top: 4px; }
.dev-notices .svc { padding-inline: 20px; justify-content: flex-start; }
.dev-notices .svc span { text-align: left; }

/* --- delivery ticks: clock, one tick (sent), two (delivered), two blue (read) --- */
.rcpt { display: inline-flex; align-items: center; flex: none; color: var(--mine-meta); transition: color .25s; }
.rcpt-ic { width: 17px; height: 10.5px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rcpt .c1 { opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .3s var(--ease); }
.rcpt:not([data-s=sent]) .c1 { opacity: 1; transform: none; }
.rcpt[data-s=read] { color: var(--read); }
.rcpt .ic.xs { width: 12px; height: 12px; stroke-width: 2.2; }
.bubble.bare .rcpt { color: rgb(255 255 255 / .85); }
.bubble.bare .rcpt[data-s=read] { color: var(--read-on-dark); }
.msg.pending .rcpt { opacity: .85; }
.chat-row .rcpt { color: var(--muted); margin-right: -2px; }
.chat-row .rcpt[data-s=read] { color: var(--read); }
.chat-row .rcpt-ic { width: 18px; height: 11px; }

/* --- what someone is doing: under the name, in the chat list --- */
.dots { display: inline-flex; align-items: flex-end; align-self: flex-end; flex: none; gap: 2px; margin: 0 0 .32em 3px; }
.dots i { width: 3.5px; height: 3.5px; border-radius: 50%; background: currentColor; animation: dot 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .16s; }
.dots i:nth-child(3) { animation-delay: .32s; }
.act-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-act, .chat-row-prev.act { display: flex; }
@keyframes dot { 0%, 70%, 100% { opacity: .3; transform: none; } 35% { opacity: 1; transform: translateY(-2.5px); } }
.bar-act { color: var(--accent-text); animation: fade .2s; }
.bar-act[hidden] { display: none; }
.bar-chat-text.acting > .bar-sub:not(.bar-act) { display: none; }
.chat-row-prev.act { color: var(--accent-text); font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .7; } }

/* --- message info --- */
.sheet.panel { max-height: min(86%, 640px); overflow-y: auto; overscroll-behavior: contain; }
.minfo-msg { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin: 2px 16px 14px; }
.minfo-msg .bubble { max-width: 100%; background: var(--mine); }
.minfo-msg .text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.minfo-sent { font-size: 12.5px; color: var(--muted); }
.minfo-body { padding-bottom: 6px; }
.minfo-sec { border-top: 1px solid var(--line); padding: 4px 0 6px; animation: paneIn .22s var(--ease); }
.minfo-h { display: flex; align-items: center; gap: 9px; margin: 0; padding: 10px 22px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.minfo-h .rcpt { color: var(--muted); }
.minfo-h .rcpt[data-s=read] { color: var(--read); }
.minfo-h .rcpt-ic { width: 19px; height: 12px; }
.minfo-row { display: flex; align-items: center; gap: 13px; padding: 7px 22px; }
.minfo-name { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minfo-at { flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.minfo .hint { padding: 22px 24px 28px; }

/* --- profile and person pages: fields with their own errors, sections, switches --- */
.prof-hero { gap: 12px; padding-top: 18px; background: radial-gradient(70% 90% at 50% 0%, rgb(13 189 139 / .14), transparent 70%), radial-gradient(60% 80% at 100% 0%, rgb(4 103 221 / .1), transparent 70%); }
.pic-ed { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.prof-name { align-items: center; justify-items: center; }
.set { display: flex; flex-direction: column; gap: 12px; padding: 20px 20px 22px; border-top: 1px solid var(--line); }
.set-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.set-h .ic { color: var(--muted); }
.set-note { margin: -6px 0 0; font-size: 14px; color: var(--muted); }
.set-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.set-actions .btn:disabled { opacity: .4; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.fld-box { display: flex; align-items: center; height: 48px; border: 1px solid var(--edge); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.fld-box:focus-within { border-color: var(--text); }
.fld-box.bad { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }
.fld-box input { flex: 1; min-width: 0; height: 100%; padding: 0 16px; border: 0; border-radius: 12px; background: transparent; outline: 0; }
.fld-box.pre input { padding-left: 2px; }
.fld-pre { padding-left: 16px; color: var(--muted); }
.fld-note { font-size: 13px; color: var(--muted); }
.fld-err { margin: 0; font-size: 13px; font-weight: 500; color: var(--danger); }
.fld-err[hidden] { display: none; }
.set-row { gap: 14px; min-height: 60px; margin: 0 -20px; width: calc(100% + 40px); text-align: left; }
.set-row .ic { color: var(--muted); width: 22px; height: 22px; flex: none; }
.set-row.danger, .set-row.danger .ic { color: var(--danger); }
.set-row:disabled { opacity: .5; cursor: default; }
.set-row:disabled:hover { background: none; }
.set-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.set-text b { font-weight: 600; }
.set-text span { font-size: 13px; color: var(--muted); font-weight: 400; }
.set-row.danger .set-text b { font-weight: 600; }
.set-why { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 4px; font-size: 13px; color: var(--muted); }
.set-why .ic { flex: none; margin-top: 2px; }

/* --- the menu's profile card --- */
.sheet-me { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 66px; padding: 8px 20px; text-align: left; border-bottom: 1px solid var(--line); transition: background .12s; }
.sheet-me:hover, .sheet-me:active { background: var(--bg); }
.sheet-me-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.sheet-me-text b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-me-text span { font-size: 13px; color: var(--muted); }
.sheet-me > .ic { color: var(--muted); }

/* --- disabled accounts --- */
.off-mark { display: inline-flex; align-items: center; margin-left: 8px; padding: 1px 8px; border-radius: 9px; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .01em; vertical-align: 1px; }
.off-mark[hidden] { display: none; }
.prof-name .off-mark { margin: 6px 0 0; }
.member.off, .chat-row.off .avatar, .chat-row.off .chat-row-title { opacity: .55; }
.member.off .avatar, .member.off .member-name { filter: grayscale(1); }
tr.off .tbl-user { opacity: .6; }
tr.off .avatar { filter: grayscale(1); }
.tbl-user { display: flex; align-items: center; gap: 12px; text-align: left; padding: 2px 0; }
.tbl-who { display: grid; line-height: 1.3; }

/* --- group picture --- */
.prof-face.sm { padding: 6px; }
.prof-face.sm .prof-cam { width: 32px; height: 32px; right: 6px; bottom: 6px; box-shadow: 0 0 0 3px var(--surface); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hero-actions .btn { border: 1px solid var(--edge); color: var(--text); }
.hero-note { display: flex; align-items: flex-start; gap: 8px; max-width: 360px; margin: 0; font-size: 13px; color: var(--muted); text-align: left; }
.hero-note .ic { flex: none; margin-top: 2px; }

/* --- second round: reactions with any emoji; one's own view of a chat (muted, pinned, archived, unread) --- */
.quick.more { display: grid; place-items: center; color: var(--muted); background: var(--bg); }
.emo-pick { height: min(340px, 50dvh); border-top: 0; animation: none; }
.react-who .who-e { flex: none; font-size: 22px; line-height: 1; font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", var(--font); }
.chat-row { position: relative; -webkit-touch-callout: none; }
.chat-row-title { flex: 0 1 auto; }
.chat-row-time { margin-left: auto; }
.row-mark { flex: none; display: grid; place-items: center; color: var(--muted); }
.row-mark .ic.xs { width: 14px; height: 14px; }
.badge.muted { background: color-mix(in srgb, var(--muted) 60%, var(--surface)); color: var(--surface); }
.badge:empty { min-width: 14px; width: 14px; height: 14px; padding: 0; }
.chat-row:has(.badge.muted) .chat-row-time { color: var(--muted); font-weight: 400; }
.arch-row { width: calc(100% - 16px); }
.arch-ic { background: color-mix(in srgb, var(--text) 9%, transparent); color: var(--muted); }
.arch-head { display: flex; align-items: center; gap: 10px; width: calc(100% - 16px); margin: 0 8px 4px; padding: 9px 8px; border-radius: 14px; color: var(--muted); font-weight: 600; transition: background .15s; }
.arch-head:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.row-more { display: none; position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; place-items: center; background: var(--surface); color: var(--muted); box-shadow: 0 1px 6px rgb(0 0 0 / .2); }
@media (hover: hover) { .chat-row:hover .row-more, .row-more:focus-visible { display: grid; } }

/* --- topics (docs/topics.md) --- */
.topic-ic { flex: none; width: 24px; height: 24px; border-radius: 34%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; line-height: 1; text-shadow: 0 1px 1px rgb(0 0 0 / .18); }
.topic-ic.general { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--muted); text-shadow: none; }
.topic-ic.emj { background: none; text-shadow: none; font-size: 20px; font-weight: 400; }
.topic-ic.xs { width: 18px; height: 18px; font-size: 10px; }
.topic-ic.xs.emj { font-size: 15px; }
.topic-ic.md { width: 38px; height: 38px; font-size: 18px; }
.topic-ic.md.emj { font-size: 30px; }
.topic-ic.lg { width: 50px; height: 50px; font-size: 22px; }
.topic-ic.lg.emj { font-size: 38px; }
.topics-body { display: flex; flex-direction: column; background: var(--surface); }
.topic-list { padding-bottom: 24px; }
.topic-row { position: relative; }
.topic-row .row-more { display: grid; position: static; flex: none; box-shadow: none; background: none; width: 36px; height: 36px; }
.topic-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin: 1px 0 4px; padding: 2px 6px 2px 3px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); font-size: 13px; font-weight: 600; line-height: 1.3; }
.topic-chip span:not(.topic-ic) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-chip .ic { width: 12px; height: 12px; opacity: .6; flex: none; }
.topic-chip.closed { opacity: .7; }
.bubble.bare .topic-chip { margin: 5px 9px 4px; }
.closed-bar { display: flex; align-items: center; gap: 10px; max-width: 900px; margin: 0 auto; padding: 10px 16px; color: var(--muted); font-size: 14px; }
.closed-bar span { flex: 1; min-width: 0; }
.closed-bar .btn { min-height: 38px; padding: 0 14px; flex: none; }
.composer-row[hidden], .closed-bar[hidden] { display: none; }
.info-topics { padding: 10px 12px 2px; }
.info-topics[hidden] { display: none; }
.dialog.topic-dialog { max-width: 420px; }
.topic-form-top { display: flex; align-items: center; gap: 12px; }
.topic-form-top input { flex: 1; min-width: 0; }
.topic-colors { display: flex; gap: 10px; margin: 16px 2px 4px; }
.topic-color { width: 34px; height: 34px; border-radius: 34%; transition: scale .15s var(--ease), box-shadow .15s; }
.topic-color[aria-checked=true] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); scale: 1.05; }
.topic-emoji-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.topic-emoji-row .btn { min-height: 38px; padding: 0 14px; border: 1px solid var(--edge); color: var(--text); font-weight: 500; }
.topic-chooser { height: 220px; margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; }
.topic-chooser[hidden] { display: none; }
.topic-chooser .emo { flex: 1; min-width: 0; height: 100%; border-top: 0; }
.pick-row > .topic-ic { width: 34px; height: 34px; font-size: 16px; }
.pick-row > .topic-ic.emj { font-size: 26px; }
.dialog .pick-list .pick-row:disabled { opacity: .5; }

/* share links (docs/share-links.md): the dialog that makes one, the list of one's own, the gallery's selection */
.dialog.share-dialog { max-width: 440px; }
.share-form, .share-done { display: flex; flex-direction: column; gap: 10px; }
.share-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.dialog .share-durations { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; overflow: visible; mask: none; -webkit-mask: none; }
.share-warn { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: 13px; }
.share-warn .ic { margin-top: 3px; }
.share-done .share-warn { color: var(--text); font-weight: 500; }
.share-dialog .btn { display: inline-flex; align-items: center; gap: 8px; }
.share-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -8px; }
.share-empty { padding: 32px 8px; text-align: center; color: var(--muted); }
.share-row { display: grid; grid-template-columns: 56px 1fr; gap: 4px 12px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.share-row:last-child { border-bottom: 0; }
.share-cover { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--tile); display: grid; place-items: center; color: var(--muted); }
.share-text { min-width: 0; display: grid; line-height: 1.35; }
.share-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.share-text span { font-size: 13px; color: var(--muted); }
.share-acts { grid-column: 2; display: flex; gap: 8px; }
.share-acts .chip-f { height: 32px; padding: 0 13px; font-size: 13px; }
.chip-f.danger { color: var(--danger); }
.share-row.dead .share-cover { filter: grayscale(1); opacity: .55; }
.share-row.dead .share-text b { color: var(--muted); }
.lib-tile .lib-pick { display: none; position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; place-items: center; border: 2px solid #fff; background: rgb(0 0 0 / .25); color: transparent; }
.lib.picking .lib-tile .lib-pick { display: grid; }
.lib-tile.picked .lib-pick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lib-tile.picked img { scale: .86; border-radius: 10px; }
.lib-picked { position: absolute; left: 50%; bottom: calc(16px + var(--sab)); translate: -50% 0; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 18px; border-radius: 28px; background: var(--primary); color: var(--primary-ink); font-weight: 600; font-size: 14px; white-space: nowrap; box-shadow: 0 8px 28px rgb(0 0 0 / .28); }
.lib-picked[hidden] { display: none; }
.lib-picked .btn { min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px; background: var(--surface); color: var(--text); }
.lib-picked .btn:disabled { opacity: .5; }
.lib-picked .icon-btn { width: 40px; height: 40px; }

/* --- administration: automatic problem reports and the health of the service (docs/reports.md) --- */
.adm-nav { flex: none; display: flex; gap: 8px; padding: 4px 14px 10px; overflow-x: auto; scrollbar-width: none; max-width: 1040px; width: 100%; margin: 0 auto; }
.rp-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-n:empty { display: none; }
.chip-f[aria-pressed=true] .rp-n { background: var(--primary-ink); color: var(--primary); }
.rp-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rp-q { flex: 1 1 200px; min-width: 0; height: 36px; padding: 0 14px; border: 1px solid var(--edge); border-radius: 18px; background: var(--surface); outline: 0; font-size: 14px; }
.rp-q:focus { border-color: var(--muted); }
.rp-list { display: grid; margin: 12px -16px -16px; border-top: 1px solid var(--line); }
.rp-row { display: grid; gap: 3px; padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); transition: background .15s; min-width: 0; }
.rp-row:last-child { border-bottom: 0; border-radius: 0 0 16px 16px; }
.rp-row:hover { background: var(--bg); }
.rp-row.done .rp-title { color: var(--muted); font-weight: 500; }
.rp-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.rp-kind, .rp-state, .rp-plat { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.rp-kind { background: color-mix(in srgb, var(--k, var(--muted)) 16%, transparent); color: color-mix(in srgb, var(--k, var(--muted)) 78%, var(--text)); }
.rp-kind.k-crash, .rp-kind.k-anr, .rp-kind.k-server { --k: var(--danger); }
.rp-kind.k-exit, .rp-kind.k-error, .rp-kind.k-js { --k: var(--s2); }
.rp-kind.k-slow { --k: var(--s4); }
.rp-plat { border: 1px solid var(--edge); color: var(--muted); font-weight: 500; }
.rp-state.open, .rp-state.reopened { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.rp-state.resolved { background: var(--accent-soft); color: var(--accent-text); }
td .rp-state { margin-left: 8px; }
.rp-when { margin-left: auto; color: var(--muted); white-space: nowrap; }
.rp-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.rp-sig, .rp-route, .rp-detail, .rp-diary { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.rp-sig { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.rp-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.rp-empty { display: grid; justify-items: center; gap: 8px; padding: 36px 16px; color: var(--muted); }
.rp-empty .ic { width: 36px; height: 36px; color: var(--good); }
.rp-none { font-size: 14px; color: var(--muted); }
.rp-head { display: grid; gap: 8px; padding: 18px 20px 20px; }
.rp-head h2 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.rp-head .facts { margin-top: 6px; }
.rp-head .facts dd { overflow-wrap: anywhere; }
.rp-note { width: 100%; min-height: 64px; padding: 10px 14px; border: 1px solid var(--edge); border-radius: 14px; background: var(--surface); outline: 0; resize: vertical; line-height: 1.4; }
.rp-note:focus { border-color: var(--muted); }
.rp-panel .set-actions .btn:not(.primary) { border: 1px solid var(--edge); color: var(--text); }
@media (min-width: 720px) { .rp-panel.page-panel { max-width: 760px; } }
.rp-one { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.rp-one summary { display: grid; gap: 2px; padding: 11px 14px; cursor: pointer; font-size: 14px; list-style: none; }
.rp-one summary::-webkit-details-marker { display: none; }
.rp-one summary span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.rp-one[open] summary { border-bottom: 1px solid var(--line); background: var(--bg); }
.rp-one h4 { margin: 12px 14px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rp-one .rp-none, .rp-title2 { margin: 10px 14px; }
.rp-title2 { font-size: 14px; overflow-wrap: anywhere; }
.rp-detail { margin: 12px 14px 0; padding: 10px 12px; max-height: 320px; overflow: auto; border-radius: 10px; background: var(--bg); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.rp-diary { list-style: none; margin: 0 14px 14px; padding: 0; max-height: 380px; overflow-y: auto; font-size: 12px; line-height: 1.45; border-left: 2px solid var(--line); }
.rp-diary li { display: grid; grid-template-columns: 74px 62px 1fr; gap: 8px; padding: 3px 0 3px 10px; }
.rp-diary time { color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-ev { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-what { overflow-wrap: anywhere; min-width: 0; }
.rp-what b { font-weight: 500; }
.rp-diary li.bad { color: var(--danger); margin-left: -2px; border-left: 2px solid var(--danger); }
.rp-diary li.bad time { color: inherit; }
.rp-health, .rp-metrics { display: grid; gap: 14px; min-width: 0; }
.rp-route { font-size: 13px; font-weight: 500; }
.rank.bad .rank-bar i { background: var(--danger); }
