/* AS Studio — mobile-first, RTL, iPhone-friendly. Brand: ink #1d1d1b, red #e3141b. */

:root {
  --bar: #121212;
  --bar-2: #1f1f22;
  --bar-text: #ffffff;
  --bar-sub: rgba(255, 255, 255, 0.6);
  --accent: #e3141b;
  --accent-press: #c20f15;
  --accent-soft: rgba(227, 20, 27, 0.1);
  --bg: #ffffff;
  --bg-2: #f2f2f6;
  --bg-3: #e5e5ea;
  --card: #ffffff;
  --chat-bg: #ebebef;
  --text: #121214;
  --text-2: #6b6b73;
  --text-3: #a0a0a8;
  --sep: rgba(60, 60, 67, 0.15);
  --in: #ffffff;
  --in-text: #121214;
  --in-meta: #8e8e96;
  --out: #1d1d1b;
  --out-text: #ffffff;
  --out-meta: rgba(255, 255, 255, 0.6);
  --link: #c8101a;
  --ok: #1fa35c;
  --danger: #e3141b;
  --overlay: rgba(0, 0, 0, 0.42);
  --press: rgba(120, 120, 128, 0.16);
  --shadow-sm: 0 1px 1.5px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 18px rgba(0, 0, 0, 0.16);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.22);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --kb-sab: var(--sab);
  --font: -apple-system, BlinkMacSystemFont, "SF Arabic", "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  /* motion: the same curves everywhere (see js/motion.js) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-pop: cubic-bezier(0.34, 1.4, 0.64, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bar: #0b0b0c;
  --bar-2: #1c1c1f;
  --bg: #111113;
  --bg-2: #1a1a1d;
  --bg-3: #29292d;
  --card: #1c1c1f;
  --chat-bg: #08080a;
  --text: #f2f2f5;
  --text-2: #a1a1aa;
  --text-3: #6c6c75;
  --sep: rgba(255, 255, 255, 0.09);
  --in: #222226;
  --in-text: #f2f2f5;
  --in-meta: #8d8d96;
  --out: #8e1219;
  --out-text: #ffffff;
  --out-meta: rgba(255, 255, 255, 0.66);
  --link: #ff7a80;
  --accent-soft: rgba(227, 20, 27, 0.2);
  --overlay: rgba(0, 0, 0, 0.62);
  --press: rgba(140, 140, 150, 0.2);
  color-scheme: dark;
}

:root.kb { --kb-sab: 0px; }

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bar);
  overscroll-behavior: none;
}
body {
  font: 16px/1.4 var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
a, button, label, .row, .cell { -webkit-touch-callout: none; }
a.row, a.cell, a.btn, img { -webkit-user-drag: none; }
.ic { flex: none; display: block; }
.hidden { display: none !important; }
[dir="ltr"] { text-align: left; }

/* On phones the app chrome behaves like an app: no text selection, no callouts. */
@media (pointer: coarse) {
  body { -webkit-user-select: none; user-select: none; }
  input, textarea, [contenteditable], .addr, .link { -webkit-user-select: text; user-select: text; }
}
@media (hover: hover) and (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: rgba(128, 128, 136, 0.45) transparent; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
}

/* ------------------------------------------------------------------ layout: panes and screens */

#app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--vh, 100%);
  display: flex;
  overflow: hidden;
  overflow: clip; /* never scrollable: the pane parked off-screen must not be reachable (js/stage.js guards old browsers) */
  background: var(--bg);
  touch-action: pan-y; /* sideways drags belong to the app (swipe back, swipe to reply) */
}
.pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  overflow: clip;
  background: var(--bg);
}
/* one "screen" per pane; two while a transition is running (js/stage.js) */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}
#main > .screen { background: var(--chat-bg); }
.dim {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 899px) {
  .pane { position: absolute; inset: 0; }
  #main { z-index: 2; transform: translate3d(-100%, 0, 0); visibility: hidden; }
  #app.in-main #main { transform: none; visibility: visible; }
  #app.in-main #side { visibility: hidden; }
  #app.moving #side, #app.moving #main { visibility: visible; will-change: transform; }
  .lift { box-shadow: 0 0 36px rgba(0, 0, 0, 0.32); will-change: transform; }
}
@media (min-width: 900px) {
  #side { width: 370px; flex: none; border-inline-end: 1px solid var(--sep); }
  #main { flex: 1; }
  .only-mobile { display: none !important; }
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bar);
  color: #fff;
  transition: opacity 0.38s ease, visibility 0.38s;
}
.splash img { width: 72px; height: 72px; opacity: 0.95; animation: pulse 1.6s ease-in-out infinite; transition: transform 0.38s var(--ease-out); }
.splash.out { opacity: 0; visibility: hidden; pointer-events: none; }
.splash.out img { transform: scale(1.12); animation: none; }
.splash-msg { display: none; margin: 0; font-size: 15px; opacity: 0.75; }
.splash.waiting .splash-msg { display: block; }
@keyframes pulse { 50% { opacity: 0.55; transform: scale(0.96); } }

/* The opening: the mark lands with a glow, a red line draws under it, the name settles in
   (once per launch, see theme.js; sound.js plays the sound that goes with it). */
.intro-mark { position: relative; display: grid; place-items: center; }
.intro-mark::before {
  content: "";
  position: absolute;
  inset: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 20, 27, 0.6), rgba(227, 20, 27, 0) 62%);
  opacity: 0;
  animation: intro-glow 1.5s ease-out 0.2s both;
}
.splash .intro-mark img { position: relative; animation: intro-mark 0.95s var(--ease-pop) both; }
.intro-line { width: 132px; height: 3px; border-radius: 2px; background: var(--accent); transform: scaleX(0); animation: intro-line 0.6s var(--ease-out) 0.6s both; }
.intro-name { margin-top: -6px; font-size: 14px; font-weight: 600; letter-spacing: 3px; opacity: 0; animation: intro-name 0.7s ease-out 0.85s both; }
.splash.waiting .intro-mark img { animation: pulse 1.6s ease-in-out infinite; }
.no-intro .intro-line, .no-intro .intro-name, .no-intro .intro-mark::before { display: none; }
.no-intro .splash .intro-mark img { animation: pulse 1.6s ease-in-out infinite; }
@keyframes intro-mark { from { opacity: 0; transform: scale(0.5); } to { opacity: 0.98; transform: scale(1); } }
@keyframes intro-glow { 0% { opacity: 0; transform: scale(0.35); } 35% { opacity: 1; } 100% { opacity: 0; transform: scale(1.45); } }
@keyframes intro-line { to { transform: scaleX(1); } }
@keyframes intro-name { from { opacity: 0; transform: translateY(6px); letter-spacing: 9px; } to { opacity: 0.85; transform: none; letter-spacing: 3px; } }

/* ------------------------------------------------------------------ header bar */

.bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: calc(54px + var(--sat));
  padding: calc(var(--sat) + 5px) calc(8px + var(--sar)) 5px calc(8px + var(--sal));
  background: var(--bar);
  color: var(--bar-text);
  position: relative;
  z-index: 3;
}
.bar-titles { flex: 1; min-width: 0; padding-inline: 4px; cursor: default; }
.bar-title {
  font-size: 17px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-sub {
  font-size: 13px;
  color: var(--bar-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 17px;
  transition: color 0.2s;
}
.bar-sub.typing { color: #ff7a80; }
.brand-mark { width: 30px; height: 30px; margin-inline: 6px 2px; object-fit: contain; }
.icon-btn {
  flex: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
  position: relative;
  transition: background-color 0.25s, transform 0.25s var(--ease-out);
}
.icon-btn:active { background: rgba(127, 127, 127, 0.24); transform: scale(0.9); transition-duration: 0s, 0.08s; }
@media (hover: hover) { .icon-btn:hover { background: rgba(127, 127, 127, 0.16); } }
.bar .ava { width: 38px; height: 38px; font-size: 15px; }
.dot-badge {
  position: absolute;
  top: 6px;
  inset-inline-end: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ------------------------------------------------------------------ lists */

.search {
  flex: none;
  margin: 8px 12px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--text-3);
  transition: box-shadow 0.2s;
}
.search:focus-within { box-shadow: 0 0 0 2px var(--accent-soft); }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: var(--text);
}
.search input::-webkit-search-cancel-button { display: none; }

.list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding-bottom: calc(10px + var(--sab));
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px calc(14px + var(--sar)) 9px calc(14px + var(--sal));
  text-decoration: none;
  color: inherit;
  position: relative;
  cursor: pointer;
  background: var(--bg);
  transition: background-color 0.3s;
}
.row::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 78px;
  inset-inline-end: 0;
  border-bottom: 0.5px solid var(--sep);
}
/* pressed: on after a beat (so starting a scroll does not flash the row), fades off after the finger lifts */
.row:active { background: var(--bg-2); transition: background-color 0s 0.06s; }
@media (hover: hover) { .row:hover { background: var(--bg-2); } }
.row.active { background: var(--accent-soft); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.row-main { flex: 1; min-width: 0; }
.row-top, .row-bottom { display: flex; align-items: center; gap: 8px; }
.row-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}
.row-title .ic { color: var(--text-3); }
/* which section a group is in, where groups of every section are listed together (search) */
.row-tag { flex: none; font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--bg-3); border-radius: 6px; padding: 1px 7px; }
.row-time { flex: none; font-size: 13px; color: var(--text-3); }
.row-sub {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.row-sub b { color: var(--text); font-weight: 500; }
.row-sub.typing { color: var(--accent); }
.badge {
  flex: none;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.badge.pop { animation: pop 0.4s var(--ease-pop); }
@keyframes pop { from { transform: scale(0.4); opacity: 0.4; } }
.chip {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-3);
  color: var(--text-2);
  flex: none;
}
.chip.red { background: var(--accent-soft); color: var(--accent); }
.chip.green { background: rgba(31, 163, 92, 0.14); color: var(--ok); }

.ava {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 650;
  font-size: 19px;
  background: var(--accent);
  overflow: hidden;
  user-select: none;
}
.ava.sm { width: 40px; height: 40px; font-size: 15px; }
/* a picture instead of the initials */
.ava.img { overflow: hidden; background: var(--bg-3); }
.ava.img img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.ava.topic { border-radius: 16px; font-size: 25px; }
.ava.brand { background: #fff; }
.ava.brand img { width: 62%; height: 62%; object-fit: contain; }
.online-dot {
  position: absolute;
  bottom: 9px;
  inset-inline-start: 52px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ok);
  border: 2px solid var(--bg);
}

.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px;
  text-align: center;
  color: var(--text-2);
  animation: rise 0.45s var(--ease-out) both;
}
.empty img { width: 84px; opacity: 0.85; }
:root[data-theme="dark"] .empty-mark { content: url("/icons/mark-white.png"); }
.empty h3 { margin: 0; color: var(--text); font-size: 18px; }
.empty p { margin: 0; max-width: 320px; font-size: 15px; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 10px, 0); } }
@keyframes fade { from { opacity: 0; } }

.banner {
  flex: none;
  margin: 10px 12px 2px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-2);
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  line-height: 1.45;
  animation: rise 0.35s var(--ease-out) both;
}
.banner .ic { color: var(--accent); }
.banner-text { flex: 1; min-width: 0; }
.banner-text b { display: block; font-size: 15px; margin-bottom: 1px; }
.banner .btn { height: 34px; padding: 0 12px; font-size: 14px; }
.banner .x { width: 30px; height: 30px; color: var(--text-3); }

/* placeholders while something loads: calmer than a "loading…" line popping in and out */
.skel {
  border-radius: 8px;
  background: linear-gradient(100deg, var(--bg-3) 30%, var(--bg-2) 50%, var(--bg-3) 70%) 0 0 / 220% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }
.skel-list { padding: 4px 0; animation: fade 0.3s 0.12s both; }
.skel-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.skel-row .skel:first-child { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.skel-row .skel:last-child { height: 14px; flex: 1; max-width: 62%; }
.skel-row:nth-child(2n) .skel:last-child { max-width: 44%; }

/* ------------------------------------------------------------------ conversation */

.conv-body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.scroller {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column-reverse;
  overscroll-behavior-y: contain;
}
.msgs {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 8px calc(8px + var(--sar)) 8px calc(8px + var(--sal));
}
.loader-top { height: 36px; flex: none; margin-bottom: auto; display: grid; place-items: center; color: var(--text-3); font-size: 13px; }
.conv-empty { margin: auto; padding: 24px 20px; max-width: 330px; text-align: center; color: var(--text-2); font-size: 15px; line-height: 1.6; animation: rise 0.45s var(--ease-out) both; }
.conv-empty img { width: 64px; opacity: 0.85; }
.conv-empty h3 { margin: 12px 0 4px; color: var(--text); font-size: 19px; }
.conv-empty p { margin: 0; }

.conv-skel { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 2px; animation: fade 0.3s 0.15s both; }
.conv-skel .skel { height: 38px; border-radius: 18px; opacity: 0.7; }
.conv-skel .skel.in { align-self: flex-end; }
.conv-skel .skel.out { align-self: flex-start; }

.msg { display: flex; margin-top: 2px; position: relative; }
.msg.first { margin-top: 8px; }
.msg.out { justify-content: flex-start; } /* right side in RTL */
.msg.in { justify-content: flex-end; } /* left side in RTL */
.msg.flash .bubble { animation: flash 1.2s ease; }
@keyframes flash { 30% { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-sm); filter: brightness(1.08); } }

/* a message that just arrived / was just sent grows out of its own corner */
.msg.enter .bubble { animation: msg-in 0.32s var(--ease-out) both; }
.msg.out.enter .bubble { transform-origin: 100% 100%; }
.msg.in.enter .bubble { transform-origin: 0 100%; }
@keyframes msg-in { from { opacity: 0; transform: scale(0.86); } }
.day.enter, .sys.enter, .unread-sep.enter { animation: fade 0.3s both; }

.bubble {
  position: relative;
  max-width: min(82%, 560px);
  min-width: 72px;
  padding: 6px 11px 7px;
  border-radius: 18px;
  background: var(--in);
  color: var(--in-text);
  box-shadow: var(--shadow-sm);
  font-size: 16px;
  line-height: 1.38;
  overflow-wrap: anywhere;
  -webkit-touch-callout: none;
  transition: transform 0.25s var(--ease-out), border-radius 0.2s;
}
.out .bubble { background: var(--out); color: var(--out-text); }
.msg.out:not(.first) .bubble { border-top-right-radius: 6px; }
.msg.out:not(.last) .bubble { border-bottom-right-radius: 6px; }
.msg.in:not(.first) .bubble { border-top-left-radius: 6px; }
.msg.in:not(.last) .bubble { border-bottom-left-radius: 6px; }
@media (pointer: coarse) { .bubble { -webkit-user-select: none; user-select: none; } }
@media (pointer: fine) { .bubble .text { -webkit-user-select: text; user-select: text; } }
.msg.pressing .bubble { transform: scale(0.965); }
.msg.swiping .bubble { transition: none; }

/* swipe a message sideways to reply: the arrow fills in as the bubble moves */
.swipe-ic {
  position: absolute;
  top: 50%;
  left: 4px;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}
:root[data-theme="dark"] .swipe-ic { background: rgba(255, 255, 255, 0.16); }
.swipe-ic.armed { background: var(--accent); }

.name { font-size: 14px; font-weight: 650; margin-bottom: 1px; display: flex; align-items: center; gap: 5px; }
.staff-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
}
.text { white-space: pre-wrap; word-break: break-word; }
.text a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.out .text a { color: inherit; }
.spacer { display: inline-block; width: var(--mw, 52px); height: 1px; vertical-align: bottom; }
.msg-list { display: flex; flex-direction: column; }
.meta {
  position: absolute;
  bottom: 5px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  line-height: 1;
  color: var(--in-meta);
  white-space: nowrap;
  direction: ltr;
  pointer-events: none;
}
/* the time sits at the end of the text's last line: left for Arabic, right for English */
.bubble[dir="ltr"] .meta { left: auto; right: 10px; }
.out .meta { color: var(--out-meta); }
.meta .edited { margin-right: 3px; }
.tick { display: inline-flex; transition: color 0.3s; }
.tick.read { color: #ff8389; }
:root[data-theme="dark"] .tick.read { color: #fff; }
.tick.fail { color: #ffb3b6; }
.tick.swap { animation: tick-in 0.3s var(--ease-pop); }
@keyframes tick-in { from { transform: scale(0.4); opacity: 0; } }
.bubble.stacked .meta { position: static; justify-content: flex-start; margin-top: 3px; }

.quote {
  display: block;
  margin: 2px 0 5px;
  padding: 4px 9px;
  border-inline-start: 3px solid var(--accent);
  border-radius: 6px;
  background: rgba(127, 127, 127, 0.12);
  cursor: pointer;
  font-size: 14px;
  max-width: 100%;
  transition: background-color 0.2s;
}
.quote:active { background: rgba(127, 127, 127, 0.26); }
.out .quote { border-color: #ff6b72; background: rgba(255, 255, 255, 0.12); }
.out .quote:active { background: rgba(255, 255, 255, 0.24); }
/* "forwarded (from …)" above a forwarded message */
.fwd { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; font-size: 13px; color: var(--accent); }
.fwd span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fwd b { font-weight: 650; }
.out .fwd { color: #ffb3b6; }
.bubble.media .fwd { margin: 3px 8px 5px; }
.quote-name { font-weight: 650; color: var(--accent); font-size: 13px; }
.out .quote-name { color: #ffb3b6; }
.quote-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; }

.bubble.media { padding: 3px; }
.bubble.media .name, .bubble.media .quote { margin: 3px 8px 5px; }
.bubble.media .text { padding: 4px 8px 3px; }
.thumb {
  position: relative;
  display: block;
  border-radius: 15px;
  overflow: hidden;
  background: var(--bg-3);
  cursor: pointer;
  max-width: 100%;
}
.msg:not(.first) .thumb, .bubble.media:not(.only) .thumb { border-radius: 14px; }
/* pictures fade in when they have loaded instead of painting in strips */
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-touch-callout: none; opacity: 0; transition: opacity 0.3s; }
.thumb img.ready { opacity: 1; }
.thumb img.now { transition: none; }
.thumb:active img { opacity: 0.86; transition-duration: 0.1s; }
.bubble.media.only .meta {
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  padding: 4px 7px;
  border-radius: 10px;
  bottom: 9px;
  left: 9px;
  right: auto;
}
.play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
}
.play .ic { margin-inline-start: 3px; }
.pill {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 10px;
  direction: ltr;
}

.file { display: flex; align-items: center; gap: 11px; padding: 3px 1px 2px; min-width: min(240px, 62vw); cursor: pointer; }
.file-ic {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 750;
  font-size: 11.5px;
  letter-spacing: 0.2px;
  transition: transform 0.2s var(--ease-out);
}
.file:active .file-ic { transform: scale(0.92); }
/* a photo or video sent as a file: its small picture in place of the icon */
.file-ic.pic, .out .file-ic.pic { width: 56px; height: 56px; border-radius: 10px; background-color: var(--bg-3); background-size: cover; background-position: center; color: #fff; }
.file-play { width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, 0.5); display: grid; place-items: center; }
.out .file-ic { background: #ffffff; color: var(--out); }
.file-info { flex: 1; min-width: 0; }
.file-name {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}
.file-sub { font-size: 13px; color: var(--in-meta); margin-top: 2px; direction: ltr; text-align: end; }
.out .file-sub { color: var(--out-meta); }
.audio { display: block; width: min(270px, 62vw); height: 40px; margin-top: 6px; }

/* upload progress ring */
.ring { position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; display: grid; place-items: center; }
.thumb .ring { width: 56px; height: 56px; border-radius: 50%; background: rgba(0, 0, 0, 0.5); }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .bg { stroke: rgba(255, 255, 255, 0.25); }
.ring .fg { stroke: #fff; stroke-linecap: round; transition: stroke-dasharray 0.35s linear; }
.out .file-ic .ring .fg { stroke: var(--out); }
.out .file-ic .ring .bg { stroke: rgba(0, 0, 0, 0.15); }
.ring.spin svg { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(270deg); } }
.ring-x { position: relative; border: 0; background: transparent; color: inherit; width: 100%; height: 100%; display: grid; place-items: center; }
.thumb .ring-x { color: #fff; }
.up-status { font-size: 12.5px; padding: 3px 8px 0; opacity: 0.8; direction: ltr; text-align: end; }
.file .up-status { padding: 2px 0 0; }
.up-error { color: #ffb3b6; }
.in .up-error, .bubble:not(.out) .up-error { color: var(--danger); }

.day {
  align-self: center;
  margin: 10px 0 4px;
  padding: 4px 11px;
  border-radius: 12px;
  background: rgba(40, 40, 46, 0.52);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  position: sticky;
  top: 6px;
  z-index: 1;
}
:root[data-theme="dark"] .day { background: rgba(58, 58, 64, 0.86); }
.unread-sep {
  align-self: stretch;
  margin: 10px -12px 4px;
  padding: 5px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(127, 127, 127, 0.14);
}
.sys { align-self: center; margin: 8px 0; padding: 4px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); color: #fff; font-size: 13px; }

.jump {
  position: absolute;
  bottom: 12px;
  left: calc(14px + var(--sal));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--card);
  color: var(--text-2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 10px, 0) scale(0.8);
  transition: opacity 0.2s, transform 0.3s var(--ease-out), visibility 0.2s;
}
.jump.show { opacity: 1; visibility: visible; transform: none; }
.jump.show:active { transform: scale(0.9); transition-duration: 0.08s; }
.jump .badge { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); }

.pinned {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px calc(14px + var(--sar)) 7px calc(10px + var(--sal));
  background: var(--bg);
  border-bottom: 0.5px solid var(--sep);
  cursor: pointer;
  z-index: 2;
  transition: background-color 0.3s;
}
.pinned:active { background: var(--bg-2); transition-duration: 0s; }
.pinned .ic { color: var(--accent); }
.pinned-main { flex: 1; min-width: 0; }
.pinned-title { font-size: 13px; font-weight: 650; color: var(--accent); }
.pinned-text { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }

.drop-hint {
  position: absolute;
  inset: 10px;
  border: 2px dashed var(--accent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 650;
  color: var(--accent);
  z-index: 5;
  pointer-events: none;
  animation: drop-in 0.2s var(--ease-out);
}
@keyframes drop-in { from { opacity: 0; transform: scale(0.97); } }

/* ------------------------------------------------------------------ composer */

.reply-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px calc(10px + var(--sar)) 4px calc(10px + var(--sal));
  background: var(--bg);
  border-top: 0.5px solid var(--sep);
}
.reply-bar .ic { color: var(--accent); }
.reply-main { flex: 1; min-width: 0; border-inline-start: 3px solid var(--accent); padding-inline-start: 8px; }
.reply-title { font-size: 13px; font-weight: 650; color: var(--accent); }
.reply-text { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.reply-bar:not(.hidden) + [data-composer] .composer { border-top: 0; }

.composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 6px calc(6px + var(--sar)) calc(6px + var(--kb-sab)) calc(6px + var(--sal));
  background: var(--bg);
  border-top: 0.5px solid var(--sep);
}
.composer .icon-btn { color: var(--text-2); width: 42px; height: 42px; }
.composer textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 1px solid var(--sep);
  background: var(--bg-2);
  color: var(--text);
  border-radius: 21px;
  padding: 9px 15px;
  font-size: 16px;
  line-height: 22px;
  height: 42px;
  max-height: 150px;
  outline: none;
  overflow-y: auto;
  transition: height 0.16s var(--ease-out), border-color 0.2s;
}
.composer textarea:focus { border-color: color-mix(in srgb, var(--accent) 45%, var(--sep)); }
.send-btn {
  flex: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  transition: transform 0.3s var(--ease-pop), opacity 0.2s, background-color 0.2s;
}
.send-btn:active { transform: scale(0.88); background: var(--accent-press); transition-duration: 0.08s; }
.send-btn[disabled] { opacity: 0.35; transform: scale(0.86); }
.closed-note {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px calc(16px + var(--sar)) calc(14px + var(--sab)) calc(16px + var(--sal));
  text-align: center;
  color: var(--text-2);
  background: var(--bg);
  border-top: 0.5px solid var(--sep);
  font-size: 14px;
}

/* ------------------------------------------------------------------ sheets, dialogs, toasts */

.backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  opacity: 0;
  transition: opacity 0.32s ease;
  z-index: 90; /* above the media viewer: its menus are sheets too */
}
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 91;
  background: var(--bg-2);
  color: var(--text);
  border-radius: 20px 20px 0 0;
  padding: 0 calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal));
  transform: translate3d(0, 100%, 0);
  transition: transform 0.42s var(--ease-ios);
  max-height: calc(var(--vh, 100vh) - var(--sat) - 20px);
  overflow-y: auto;
  overscroll-behavior: none; /* no rubber band of its own: pulling down drags the sheet instead */
  box-shadow: var(--shadow-lg);
  will-change: transform;
  touch-action: pan-y;
}
.sheet.show { transform: none; }
.sheet.dragging { transition: none; }
.sheet.closing { transition-duration: 0.3s; }
/* the sheet's colour continues below it, so pulling it up never shows a gap */
.sheet::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 60vh; background: inherit; }
.grab { flex: none; height: 22px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.grab::before { content: ""; width: 38px; height: 5px; border-radius: 3px; background: var(--bg-3); background: color-mix(in srgb, var(--text-3) 55%, transparent); }
.sheet.tall { height: calc(var(--vh, 100vh) - var(--sat) - 12px); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 900px) {
  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: 420px;
    max-height: 86vh;
    border-radius: 18px;
    padding: 10px;
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
    transition: transform 0.3s var(--ease-out), opacity 0.2s;
  }
  .sheet.show { opacity: 1; transform: translate(-50%, -50%); }
  .sheet.closing { transition-duration: 0.18s; }
  .sheet.tall { width: 520px; height: min(760px, 88vh); padding: 0; }
  .sheet::after, .grab { display: none; }
}
.sheet-title { text-align: center; font-size: 13px; color: var(--text-2); padding: 2px 12px 10px; }
@media (min-width: 900px) { .sheet-title { padding-top: 8px; } }
.menu { background: var(--card); border-radius: 14px; overflow: hidden; }
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  font-size: 17px;
  text-align: start;
  border-bottom: 0.5px solid var(--sep);
  transition: background-color 0.3s;
}
.menu-item:last-child { border-bottom: 0; }
.menu-item:active { background: var(--bg-3); transition-duration: 0s; }
@media (hover: hover) { .menu-item:hover { background: var(--bg-2); } }
.menu-item .ic { color: var(--text-2); }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger); }
.menu-item.cancel { margin-top: 8px; background: var(--card); border-radius: 14px; justify-content: center; font-weight: 650; border: 0; }
.menu-item.cancel:active { background: var(--bg-3); }

.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 12px;
  border-bottom: 0.5px solid var(--sep);
  background: var(--bg-2);
}
@media (min-width: 900px) { .sheet-head { padding-top: 12px; border-radius: 18px 18px 0 0; } }
.sheet-head h3 { flex: 1; margin: 0; text-align: center; font-size: 17px; }
.link-btn { border: 0; background: transparent; color: var(--accent); font-size: 16px; padding: 6px 4px; min-width: 56px; transition: opacity 0.2s; }
.link-btn:active { opacity: 0.45; transition-duration: 0s; }
.link-btn.strong { font-weight: 700; }
.link-btn:disabled { opacity: 0.4; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: none; padding: 16px calc(14px + var(--sar)) calc(20px + var(--sab)) calc(14px + var(--sal)); }

.dialog { padding: 4px 8px 4px; }
@media (min-width: 900px) { .dialog { padding-top: 10px; } }
.dialog h3 { margin: 4px 0 8px; font-size: 18px; text-align: center; }
.dialog p { margin: 0 0 16px; color: var(--text-2); text-align: center; font-size: 15px; line-height: 1.5; }
.dialog-btns { display: flex; gap: 10px; }
.dialog-btns .btn { flex: 1; }

.toasts {
  position: fixed;
  top: calc(var(--sat) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: min(92vw, 440px);
  pointer-events: none;
}
.toast {
  max-width: 100%;
  background: rgba(30, 30, 33, 0.96);
  color: #fff;
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 15px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.42s var(--ease-pop);
  transition: opacity 0.25s, transform 0.3s var(--ease-out);
  touch-action: none;
}
.toast.error { background: rgba(190, 18, 26, 0.97); }
.toast.msg { display: flex; gap: 10px; align-items: center; cursor: pointer; width: 100%; }
.toast.msg b { display: block; font-size: 14px; }
.toast.msg span { display: block; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.out { opacity: 0; transform: translate3d(0, -14px, 0) scale(0.96); }
@keyframes toast-in { from { opacity: 0; transform: translate3d(0, -22px, 0) scale(0.92); } }

/* ------------------------------------------------------------------ forms */

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--text-2); padding-inline-start: 4px; }
.field small { color: var(--text-3); font-size: 12.5px; padding-inline-start: 4px; }
.input {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--sep);
  background: var(--card);
  color: var(--text);
  padding: 0 14px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { height: auto; min-height: 84px; padding: 11px 14px; resize: vertical; line-height: 1.45; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.input.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 1px; direction: ltr; text-align: center; }
.input.mono::placeholder { font-family: var(--font); letter-spacing: 0; }
/* empty dir="auto" fields: keep the Arabic placeholder on the right */
input[dir]:placeholder-shown:not(.mono), textarea[dir]:placeholder-shown { direction: rtl; }
.btn {
  height: 48px;
  border-radius: 12px;
  border: 0;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 650;
  background: var(--bg-3);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), background-color 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); opacity: 0.85; transition-duration: 0.08s; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-press); opacity: 1; }
.btn.danger { background: transparent; color: var(--danger); }
.btn.danger-fill { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.block { width: 100%; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

/* segmented control: the white thumb slides to the chosen option (--i of --n) */
.seg { position: relative; isolation: isolate; display: flex; background: var(--bg-3); border-radius: 12px; padding: 3px; gap: 3px; --n: 2; --i: 0; }
.seg::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 3px;
  bottom: 3px;
  inset-inline-start: 3px;
  width: calc((100% - 6px - 3px * (var(--n) - 1)) / var(--n));
  border-radius: 9px;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
  transform: translateX(calc(var(--i) * (-100% - 3px)));
  transition: transform 0.36s var(--ease-ios);
}
:root[data-theme="dark"] .seg::before { background: #3a3a40; }
.seg button {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
  transition: color 0.25s;
}
.seg button.on { color: var(--text); }
/* a tab with a label and a count of what is waiting in it */
.seg button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px; white-space: nowrap; }
.seg button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.seg-badge {
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  font-style: normal;
  line-height: 18px;
  text-align: center;
}

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 50px; }
.switch-row .lbl { flex: 1; min-width: 0; }
.switch-row .lbl small { display: block; color: var(--text-3); font-size: 13px; margin-top: 2px; }
.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 16px;
  background: var(--bg-3);
  position: relative;
  transition: background-color 0.25s;
  cursor: pointer;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  transition: transform 0.3s var(--ease-ios), width 0.2s;
}
.switch:active::after { width: 32px; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(-20px); }
.switch:checked:active::after { transform: translateX(-15px); }

.checks { border-radius: 12px; background: var(--card); overflow: hidden; max-height: 340px; overflow-y: auto; border: 1px solid var(--sep); }
.check { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 14px; border-bottom: 0.5px solid var(--sep); cursor: pointer; transition: background-color 0.3s; }
.check:active { background: var(--bg-2); transition-duration: 0s; }
.check:last-child { border-bottom: 0; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin: 0; }
.check .who { flex: 1; min-width: 0; }
.check .who small { display: block; color: var(--text-3); font-size: 13px; direction: ltr; text-align: start; }
.check .who small.sub { direction: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* forward sheet: what is being forwarded */
.fwd-what { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px; background: var(--card); color: var(--text-2); font-size: 14.5px; }
.fwd-what .ic { color: var(--accent); }
.fwd-what span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* chat list: "all / private" filter for the studio */
.list-filter { flex: none; padding: 6px 12px 2px; }
.list-filter .seg button { height: 32px; font-size: 14px; }
.checks-empty { padding: 16px; color: var(--text-3); text-align: center; font-size: 14px; }

.emojis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.emojis button { height: 42px; padding: 0; border-radius: 10px; border: 0; background: var(--card); font-size: 22px; display: grid; place-items: center; transition: transform 0.25s var(--ease-pop), box-shadow 0.2s, background-color 0.2s; }
.emojis button:active { transform: scale(0.86); transition-duration: 0.08s; }
.emojis button.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 0; transition: transform 0.25s var(--ease-pop), box-shadow 0.2s; }
.swatches button:active { transform: scale(0.86); transition-duration: 0.08s; }
.swatches button.on { box-shadow: 0 0 0 3px var(--bg-2), 0 0 0 5px var(--text); }

.cred { background: var(--card); border-radius: 14px; padding: 6px 16px; }
.cred-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 0.5px solid var(--sep); align-items: center; }
.cred-row:last-child { border-bottom: 0; }
.cred-row span { color: var(--text-2); font-size: 14px; flex: none; }
.cred-row b { direction: ltr; font-size: 17px; word-break: break-all; text-align: left; -webkit-user-select: text; user-select: text; }
.note { font-size: 13.5px; color: var(--text-2); line-height: 1.55; padding: 0 4px; }

/* ------------------------------------------------------------------ pages (settings / admin) */

.page { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg-2); }
.page-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 16px calc(14px + var(--sar)) calc(28px + var(--sab)) calc(14px + var(--sal));
}
.page-inner { max-width: 680px; margin: 0 auto; }
.page-inner.swap { animation: fade 0.22s both; }
.tabs { flex: none; padding: 10px calc(12px + var(--sar)) 8px calc(12px + var(--sal)); background: var(--bg-2); }
.tabs .seg { max-width: 680px; margin: 0 auto; }
@media (max-width: 480px) { .tabs .seg button { font-size: 13px; padding: 0 2px; } } /* four tabs on a phone */
.group-title { font-size: 13px; color: var(--text-2); margin: 0 14px 7px; display: flex; justify-content: space-between; align-items: center; }
.group { background: var(--card); border-radius: 14px; overflow: hidden; margin-bottom: 22px; }
.group.pad { padding: 14px; }
.cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 16px;
  border-bottom: 0.5px solid var(--sep);
  text-decoration: none;
  color: inherit;
  position: relative;
  width: 100%;
  background: transparent;
  border-top: 0;
  border-inline: 0;
  text-align: start;
  font-size: 16px;
  transition: background-color 0.3s;
}
.cell:last-child { border-bottom: 0; }
button.cell:active, a.cell:active { background: var(--bg-3); transition: background-color 0s 0.06s; }
@media (hover: hover) { button.cell:hover, a.cell:hover { background: var(--bg-2); } }
.cell .grow { flex: 1; min-width: 0; }
.cell .grow small { display: block; color: var(--text-3); font-size: 13px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .val { color: var(--text-2); font-size: 15px; direction: ltr; }
.cell > .ic:last-child { color: var(--text-3); }
.cell.danger { color: var(--danger); justify-content: center; font-weight: 600; }
.cell .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: var(--accent); flex: none; }
.cell .ico .ic { width: 18px; height: 18px; }
.profile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.profile .ava { width: 64px; height: 64px; font-size: 24px; }
.profile h2 { margin: 0; font-size: 20px; }
.profile p { margin: 2px 0 0; color: var(--text-2); direction: ltr; text-align: right; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 22px; }
.stat { background: var(--card); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-size: 22px; direction: ltr; text-align: right; }
.stat span { font-size: 13px; color: var(--text-2); }
.meter { height: 8px; border-radius: 4px; background: var(--bg-3); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transform-origin: 100% 50%; animation: meter 0.7s var(--ease-out) both; }
@keyframes meter { from { transform: scaleX(0); } }
.addr { direction: ltr; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; user-select: all; -webkit-user-select: all; }
.footer-note { text-align: center; color: var(--text-3); font-size: 13px; margin-top: 8px; }

/* ------------------------------------------------------------------ login */

.login {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--sat) + 40px) calc(24px + var(--sar)) calc(var(--sab) + 24px) calc(24px + var(--sal));
  background: radial-gradient(120% 70% at 50% 0%, #26262a 0%, var(--bar) 60%);
  color: #fff;
}
.login-logo { width: min(80vw, 330px); height: auto; margin: 6vh 0 34px; }
.login form { width: min(100%, 370px); display: flex; flex-direction: column; gap: 12px; animation: rise 0.45s var(--ease-out) both; }
.login h2 { margin: 0 0 4px; font-size: 20px; text-align: center; }
.login .sub { margin: 0 0 8px; text-align: center; color: rgba(255, 255, 255, 0.6); font-size: 14.5px; line-height: 1.5; }
.login .input {
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 17px;
}
.login .input::placeholder { color: rgba(255, 255, 255, 0.4); }
.login .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(227, 20, 27, 0.3); }
.login .btn.primary { height: 52px; font-size: 17px; margin-top: 4px; }
.login .install {
  width: min(100%, 370px);
  margin-top: 26px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  animation: rise 0.45s 0.08s var(--ease-out) both;
}
.login .install b { color: #fff; }
.login .err { color: #ff9ca0; font-size: 14px; text-align: center; min-height: 20px; }
.login .err.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.login .code-input {
  height: 64px;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: 6px;
  text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.login .code-input::placeholder { color: rgba(255, 255, 255, 0.22); letter-spacing: 6px; }
.login .btn.ghost { color: rgba(255, 255, 255, 0.7); font-weight: 500; font-size: 15px; height: 42px; }
.login .staff-link { margin-top: 18px; font-size: 14px; color: rgba(255, 255, 255, 0.45); }

.code-card { text-align: center; padding: 18px 14px; background: var(--card); border-radius: 16px; }
.code-card .code { font: 700 34px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 4px; direction: ltr; margin: 6px 0 4px; user-select: all; -webkit-user-select: all; }
.code-card .link { direction: ltr; font-size: 13px; color: var(--text-2); word-break: break-all; user-select: all; -webkit-user-select: all; }
.code-card small { display: block; color: var(--text-2); font-size: 13px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-left: 52px; }
.pw-wrap .icon-btn { position: absolute; top: 5px; inset-inline-end: 4px; color: rgba(255, 255, 255, 0.55); }
.steps { margin: 6px 0 0; padding-inline-start: 20px; }
.steps li { margin: 3px 0; }
.share-ic { display: inline-block; vertical-align: -4px; }

/* ------------------------------------------------------------------ attach preview */

.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 4px; }
.attach-item { aspect-ratio: 1; border-radius: 12px; background: var(--card) center/cover no-repeat; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; text-align: center; animation: pop-in 0.34s var(--ease-out) both; }
.attach-item:nth-child(2) { animation-delay: 0.03s; }
.attach-item:nth-child(3) { animation-delay: 0.06s; }
.attach-item:nth-child(n + 4) { animation-delay: 0.09s; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.88); } }
.attach-item .ext { font-weight: 750; color: var(--accent); font-size: 14px; }
.attach-item .nm { font-size: 11px; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all; }
.attach-item .sz { position: absolute; bottom: 4px; inset-inline-end: 4px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11px; border-radius: 6px; padding: 1px 5px; direction: ltr; }

/* ------------------------------------------------------------------ media viewer */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  color: #fff;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.viewer-bg { position: absolute; inset: 0; background: #000; }
.viewer-track { position: absolute; inset: 0; will-change: transform; }
.vw-slide { position: absolute; inset: 0; overflow: hidden; }
/* the picture: laid out at its fitted size, moved and zoomed with transforms only */
.vw-media { position: absolute; will-change: transform; overflow: hidden; background: #111; }
.vw-media.clear { background: transparent; }
.vw-media img, .vw-media video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; -webkit-touch-callout: none; }
.vw-media img { object-fit: cover; -webkit-user-drag: none; }
.vw-media img.full { opacity: 0; transition: opacity 0.25s; }
.vw-media img.full.ready { opacity: 1; }
.vw-media video { object-fit: contain; background: #000; }
.vw-media.loose img { object-fit: contain; }
.viewer-top, .viewer-bottom {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-inline: calc(8px + var(--sar)) calc(8px + var(--sal));
  transition: opacity 0.25s, transform 0.35s var(--ease-out);
}
.viewer-top { top: 0; padding-top: calc(var(--sat) + 6px); padding-bottom: 18px; background: linear-gradient(rgba(0, 0, 0, 0.65), transparent); }
.viewer-bottom { bottom: 0; padding-top: 26px; padding-bottom: calc(var(--sab) + 12px); background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); flex-direction: column; align-items: stretch; pointer-events: none; }
.viewer-bottom > * { pointer-events: auto; }
/* the way out stays on screen whatever else is hidden */
.viewer-close {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  padding: 0 14px 0 10px;
  border-radius: 19px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  flex: none;
}
.viewer-close:active { transform: scale(0.94); }
.viewer-top > * { transition: opacity 0.25s; }
.viewer.chrome-off .viewer-top { background: none; pointer-events: none; }
.viewer.chrome-off .viewer-top > :not(.viewer-close) { opacity: 0; pointer-events: none; }
.viewer.chrome-off .viewer-top > .viewer-close { pointer-events: auto; }
.viewer.chrome-off .viewer-bottom { opacity: 0; pointer-events: none; transform: translate3d(0, 12px, 0); }
.viewer.chrome-off .viewer-bottom > * { pointer-events: none; }
.viewer.chrome-off .viewer-nav { opacity: 0; pointer-events: none; }
.viewer.has-video .viewer-bottom { display: none; }
/* while the picture is being pulled away / closing, the bars get out of the way */
.viewer.leaving .viewer-top, .viewer.leaving .viewer-bottom, .viewer.leaving .viewer-nav { opacity: 0; pointer-events: none; }
.viewer-title { flex: 1; min-width: 0; }
.viewer-title b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-title span { font-size: 12.5px; opacity: 0.7; }
.viewer-caption { font-size: 15px; line-height: 1.45; max-height: 30vh; overflow-y: auto; white-space: pre-wrap; padding-inline: 8px; touch-action: pan-y; }
.viewer-count { text-align: center; font-size: 13px; opacity: 0.7; padding-top: 6px; }
.viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  margin-top: -23px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: grid;
  place-items: center;
  transition: opacity 0.25s, background-color 0.2s, transform 0.25s var(--ease-out);
}
.viewer-nav:hover { background: rgba(255, 255, 255, 0.24); }
.viewer-nav:active { transform: scale(0.9); }
.viewer-nav.prev { right: 14px; }
.viewer-nav.next { left: 14px; }
@media (pointer: coarse) { .viewer-nav { display: none; } }
.viewer .spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin2 0.9s linear infinite, fade 0.3s 0.25s both;
  pointer-events: none;
}
@keyframes spin2 { to { transform: rotate(360deg); } }

.progress-line { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; margin: 14px 0 8px; }
.progress-line i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s linear; }

.typing-dots { display: inline-flex; gap: 3px; margin-inline-end: 5px; vertical-align: middle; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: dots 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dots { 30% { transform: translateY(-3px); opacity: 1; } 0%, 60%, 100% { opacity: 0.4; } }

/* light <-> dark: a short cross-fade where the browser supports it */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.3s; }

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

/* ------------------------------------------------------------------ picking several messages */
.sel-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--bar-bg, var(--card));
  border-top: 1px solid var(--sep);
}
.sel-bar .sel-n { flex: 1; min-width: 0; font-size: 15px; font-weight: 650; }
.sel-bar .btn { flex: none; height: 40px; padding: 0 16px; }
.selecting .msg { cursor: pointer; padding-inline-start: 34px; transition: background-color 0.15s; border-radius: 10px; }
.selecting .msg::before {
  content: '';
  position: absolute;
  inset-inline-start: 6px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  border: 2px solid var(--text-3);
  box-sizing: border-box;
}
.selecting .msg.sel { background: var(--accent-soft); }
.selecting .msg.sel::before {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.selecting .msg .bubble { pointer-events: none; }

/* ------------------------------------------------------------------ who is online, who has read */
.on-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-inline-end: 5px; vertical-align: 1px; }
.bar-sub .sub-status.on { color: #7be0a6; }
.seen-on, .cell small.seen-on { color: var(--ok); }
.cell .tick.read { color: var(--ok); }
.cell .tick.sent { color: var(--text-3); }
.chip.warn { background: rgba(240, 140, 0, 0.16); color: #c97500; gap: 4px; flex: none; }
:root[data-theme="dark"] .chip.warn { color: #ffb650; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; font-size: 14.5px; margin-bottom: 14px; }
.status-line span { display: inline-flex; align-items: center; gap: 5px; }

/* ------------------------------------------------------------------ voice messages */

.send-btn.mic { background: var(--bg-3); color: var(--text); }
.send-btn.mic:active { background: var(--bg-3); }
.rec-bar { align-items: center; }
.rec-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 21px; background: var(--bg-2); font-size: 15px; color: var(--text-2); }
.rec-info b { color: var(--text); font-variant-numeric: tabular-nums; direction: ltr; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: rec-blink 1.1s ease-in-out infinite; }
@keyframes rec-blink { 50% { opacity: 0.25; } }

.voice { display: flex; align-items: center; gap: 10px; min-width: min(220px, 60vw); padding: 3px 1px 2px; cursor: pointer; }
.voice-btn {
  flex: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  transition: transform 0.2s var(--ease-pop);
}
.out .voice-btn { background: rgba(255, 255, 255, 0.92); color: var(--out); }
.voice-btn:active { transform: scale(0.9); }
.voice-main { flex: 1; min-width: 0; }
.voice-bar { direction: ltr; height: 18px; display: flex; align-items: center; position: relative; }
.voice-bar::before { content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: currentColor; opacity: 0.22; }
.voice-bar i { position: relative; display: block; height: 4px; width: 0; border-radius: 2px; background: var(--accent); }
.out .voice-bar i { background: #fff; }
.voice.playing .voice-bar i { transition: width 0.25s linear; }
.voice-time { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--in-meta); direction: ltr; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.out .voice-time { color: var(--out-meta); }

/* ------------------------------------------------------------------ downloads (sheet, chip) and the game layer */

.dl-dialog .note { text-align: center; margin: 0 0 12px; }
.dl-play { margin-bottom: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.dl-cancel { display: block; width: 100%; margin-top: 8px; font-size: 14px; color: var(--text-2); }
.dialog-ic { width: 64px; height: 64px; margin: 4px auto 6px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }

.dl-chip {
  position: fixed;
  top: calc(var(--sat) + 62px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 82;
  max-width: min(92vw, 360px);
  display: flex;
  align-items: center;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bar-2);
  color: #fff;
  box-shadow: var(--shadow-md);
  direction: rtl;
  animation: dl-chip-in 0.3s var(--ease-out);
}
@keyframes dl-chip-in { from { opacity: 0; transform: translate(-50%, -10px); } }
.dl-chip-main { display: flex; align-items: center; gap: 8px; min-width: 0; height: 38px; padding: 0 14px 0 6px; border: 0; background: transparent; color: inherit; font-size: 14px; }
.dl-chip-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.dl-chip-ic { flex: none; display: grid; place-items: center; }
.dl-chip-x { flex: none; width: 34px; height: 38px; border: 0; background: transparent; color: rgba(255, 255, 255, 0.6); display: grid; place-items: center; }
.dl-chip-bar { position: absolute; bottom: 0; left: 0; height: 3px; width: 0; background: var(--accent); transition: width 0.3s linear; }
.dl-chip.done { background: var(--ok); }
.dl-chip.done .dl-chip-bar { display: none; }

.viewer-hd { height: 30px; padding: 0 9px; border-radius: 8px; border: 1.5px solid rgba(255, 255, 255, 0.7); background: transparent; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.5px; }
.viewer-hd.on { background: #fff; color: #000; border-color: #fff; }

.game-layer { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: var(--bg-2); animation: game-layer-in 0.25s var(--ease-out); }
@keyframes game-layer-in { from { opacity: 0; transform: translateY(14px); } }
.game-top { flex: none; display: flex; align-items: center; gap: 12px; padding: calc(var(--sat) + 8px) calc(12px + var(--sar)) 8px calc(12px + var(--sal)); background: var(--bar); color: #fff; }
.game-dl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; justify-content: flex-end; font-size: 14px; }
.game-dl .progress-line { flex: 1; max-width: 160px; margin: 0; background: rgba(255, 255, 255, 0.2); }
.game-dl-text { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.game-dl .btn { height: 36px; padding: 0 12px; font-size: 14px; }
.game-box { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; padding-bottom: var(--sab); }
.game-box > .game-root { position: absolute; inset: 0 0 var(--sab) 0; height: auto; }

/* ------------------------------------------------------------------ the company page */

.home { flex: 1; overflow-y: auto; overscroll-behavior-y: contain; background: var(--bg-2); padding: 0 calc(14px + var(--sar)) calc(24px + var(--sab)) calc(14px + var(--sal)); }
.home > * { max-width: 640px; margin-inline: auto; }
.home-hero { text-align: center; padding: 26px 10px 18px; }
.home-hero img { width: 76px; }
.home-hero h2 { margin: 10px 0 4px; font-size: 21px; }
.home-hero p { margin: 0; color: var(--text-2); font-size: 15px; }
.home-enter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform 0.2s var(--ease-out);
}
.home-enter:active { transform: scale(0.98); }
.home-enter .ava { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }
.home-enter-main { flex: 1; min-width: 0; }
.home-enter-main b { display: block; font-size: 17px; }
.home-enter-main span { display: block; font-size: 13.5px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-enter .badge { background: #fff; color: var(--accent); }
.home-enter-time { font-size: 12.5px; opacity: 0.8; }
.home-quick { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(76px, 1fr); gap: 8px; margin: 14px auto; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.home-quick::-webkit-scrollbar { display: none; }
.home-q { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; background: var(--card); color: var(--text); text-decoration: none; font-size: 12.5px; text-align: center; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease-out); }
.home-q .ic { color: var(--accent); }
.home-q.wa .ic { color: var(--ok); }
.home-q:active { transform: scale(0.95); }
.home-card { background: var(--card); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.home-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 16px; }
.home-card h3 .ic { color: var(--accent); }
.home-card p { margin: 0 0 8px; font-size: 15px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.home-card p:last-child { margin-bottom: 0; }
.home-card a { color: var(--link); }
.home-card .btn { margin-top: 4px; text-decoration: none; color: var(--text); }
.home-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.home-list li { position: relative; padding: 9px 12px; border-radius: 10px; background: var(--bg-2); font-size: 15px; border-inline-start: 3px solid var(--accent); }
.home-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.home-chips span { padding: 6px 12px; border-radius: 16px; background: var(--bg-2); font-size: 14px; }
.home-hours { display: flex; align-items: center; gap: 6px; color: var(--text-2) !important; font-size: 14px !important; }
.home-game { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; margin-bottom: 10px; border: 0; border-radius: 16px; background: var(--card); color: var(--text); text-align: start; font-size: 13.5px; box-shadow: var(--shadow-sm); }
.home-game > .ic:first-child { color: var(--accent); flex: none; }
.home-game span { flex: 1; min-width: 0; color: var(--text-2); }
.home-game b { display: block; font-size: 15.5px; color: var(--text); }
.home-game:active { transform: scale(0.98); }
.home-wait { text-align: center; color: var(--text-2); font-size: 14px; padding: 8px 10px; }
.share-text { max-height: 90px; overflow: hidden; white-space: pre-wrap; background: var(--bg-2); border-radius: 10px; padding: 8px 12px; }
