/* Brand palette — matches the Hush website (gold accent on warm charcoal). NOTE: the --teal/
   --teal-bright variable NAMES are kept (they're referenced ~33×) but now carry the brand GOLD,
   so the retheme is a low-risk value swap rather than a churny rename. Semantic colours
   (success green, warning amber, danger red) are intentionally left as-is. */
:root {
  --bg: #0a0a0f;
  --panel: #12121a;
  --panel-2: #1a1a24;
  --teal: #c8aa6e;
  --teal-bright: #d6bd84;
  --text: #e8e6e3;
  --muted: #908a80;
  --me: #5c4d22;
  --ink: #1a160d;          /* dark ink for text/icons ON the gold accent (white-on-gold fails contrast) */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.screen { padding: 22px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.hidden { display: none !important; }

.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 44px; height: 44px; border-radius: 12px; background: var(--teal);
  display: grid; place-items: center; font-weight: 800; font-size: 24px; color: var(--ink);
}
h1 { font-size: 28px; margin: 0; }
.tagline { color: var(--muted); margin: 0 0 8px; }
/* Language picker: a discreet right-aligned dropdown under the tagline, visible before sign-up. */
.langrow { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 0 0 10px; }
.langglobe { font-size: 14px; opacity: .8; }
#langPick {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 6px 10px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
#langPick:focus { border-color: var(--teal-bright); outline: none; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 12px 14px; border-radius: 10px; font-size: 16px; outline: none;
}
input:focus { border-color: var(--teal-bright); }
button {
  background: var(--teal); color: var(--ink); border: 0; padding: 12px 16px;
  border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer;
}
button:hover { background: var(--teal-bright); }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
button.ghost:hover { background: var(--panel); color: var(--text); }
.status { color: var(--muted); font-size: 14px; }
.status.ok { color: var(--teal-bright); }
.status.err { color: #ff8095; }
.fineprint { color: var(--muted); font-size: 12px; margin-top: auto; opacity: .8; }

/* Alternate-auth row + the private-signup / restore panels */
.altauth { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
button.linkbtn {
  background: transparent; border: 0; color: var(--teal-bright); font-weight: 500;
  font-size: 14px; padding: 8px 2px; text-decoration: underline; cursor: pointer;
}
button.linkbtn:hover { background: transparent; color: var(--text); }
.panelh { font-size: 18px; margin: 0; }
.notice {
  background: var(--panel); border: 1px solid #5a3a12; border-left: 3px solid #e0a34a;
  color: var(--text); font-size: 13px; line-height: 1.5; padding: 12px 14px; border-radius: 10px; margin: 0;
}
.reccode {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; letter-spacing: 1px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--teal-bright);
  padding: 12px 14px; border-radius: 10px; word-break: break-all; user-select: all;
}
.ackrow { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); font-size: 13px; line-height: 1.4; }
.ackrow input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }

/* Modal overlay (one-time recovery-code reveal) */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(8, 8, 12, .82); }
.modalcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 14px; }

/* Delivery ticks + click-to-delete affordance on your own messages */
.tick { color: var(--muted); font-size: 11px; }
li.deletable { cursor: pointer; }
li.deletable:hover { opacity: .82; }

.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--panel); border-radius: 12px;
}
.muted { color: var(--muted); }
.safety { font: 12px/1 ui-monospace, Menlo, monospace; color: var(--muted); max-width: 180px; text-align: right; }
.peerpick { display: flex; gap: 8px; }
.peerpick input { flex: 1; }

/* Conversation switcher (one chip per chat, with an unread badge) */
.convbar { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0; }
.convchip {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font-weight: 500;
  font-size: 13px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; display: flex;
  align-items: center; gap: 6px;
}
.convchip:hover { background: var(--panel); }
.convchip.active { background: var(--teal); border-color: var(--teal-bright); color: #fff; }
.convchip .badge {
  background: #ff5470; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 999px; display: inline-grid; place-items: center; padding: 0 5px;
}

/* Group roster + protection state */
.beta { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--teal-bright); border: 1px solid var(--teal); border-radius: 999px; padding: 2px 8px; }
.groupbar { background: var(--panel); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.groupbar-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.groupbar-head .muted { font-size: 13px; }
.pqbadge { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; margin-left: auto; }
.pqbadge.on { color: var(--teal-bright); border-color: var(--teal); }
.roster { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; background: var(--panel-2); color: var(--text); border-radius: 999px; padding: 3px 10px; }

.messages { list-style: none; margin: 0; padding: 4px 0; flex: 1; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.messages li { max-width: 78%; padding: 9px 13px; border-radius: 14px; background: var(--panel-2); }
.messages li.me { align-self: flex-end; background: var(--me); }
.messages li.sys { align-self: center; background: transparent; color: var(--muted); font-size: 13px; max-width: 100%; text-align: center; }
.messages li a { color: var(--teal-bright); }
img.att { max-width: 220px; border-radius: 10px; display: block; margin-top: 4px; }

.composer { display: flex; gap: 8px; padding-top: 8px; }
.composer input { flex: 1; }

.callbtns { display: flex; gap: 6px; }
button.icon { background: var(--panel-2); color: var(--text); padding: 8px 10px; font-size: 18px; line-height: 1; }
button.icon:hover { background: var(--teal); }
button.danger { background: #b3263b; color: #fff; }
button.danger:hover { background: #d6314a; }

.callOverlay { position: fixed; inset: 0; background: #000; display: flex; align-items: center; justify-content: center; z-index: 50; }
.callOverlay .remote { width: 100%; height: 100%; object-fit: contain; background: #000; }
.callOverlay .local { position: absolute; right: 14px; bottom: 86px; width: 28%; max-width: 160px; border-radius: 10px; border: 1px solid var(--line); background: #111; }
/* Group (mesh) call: a tile per remote participant */
.callOverlay .remoteGrid { width: 100%; height: 100%; display: grid; gap: 6px; padding: 6px; box-sizing: border-box;
  grid-template-columns: repeat(auto-fit, minmax(45%, 1fr)); align-content: center; background: #000; }
.callOverlay .remoteGrid .tile { width: 100%; height: 100%; min-height: 0; object-fit: cover; background: #111; border-radius: 8px; }
.callHud { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; }

.incoming { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.incoming-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* --- parity features: reactions, reply, voice, search, message actions --- */
.messages li { position: relative; }
.msgmenu { background: none; border: none; cursor: pointer; opacity: 0; color: var(--muted); padding: 0 4px; font-size: 1rem; }
.messages li:hover .msgmenu, .messages li:focus-within .msgmenu { opacity: 1; }
.quote { border-left: 3px solid var(--teal); padding: 2px 8px; margin: 2px 0 3px; font-size: .85em; opacity: .85; cursor: pointer; background: rgba(255,255,255,.05); border-radius: 4px; }
.reactions { display: flex; gap: 4px; margin-top: 3px; }
.react { background: var(--panel-2); border-radius: 12px; padding: 1px 7px; font-size: .85em; cursor: pointer; }
.starmark { font-size: .8em; }
.msgactions { position: absolute; right: 8px; top: 100%; z-index: 20; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 6px 24px rgba(0,0,0,.45); }
.msgactions button { background: none; border: none; text-align: left; color: var(--text); padding: 6px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; font-size: .9em; }
.msgactions button:hover { background: rgba(255,255,255,.08); }
.reactpick { display: flex; gap: 2px; border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 4px; margin-bottom: 4px; }
.reactpick button { font-size: 1.15rem; padding: 4px; }
.composebar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: .85em; background: rgba(200,170,110,.12); border-radius: 8px; margin-top: 6px; }
.composebar button { padding: 2px 8px; }
.searchbox { margin: 6px 0; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
button.icon.recording { color: #ff5b5b; animation: recpulse 1s infinite; }
@keyframes recpulse { 50% { opacity: .4; } }
.messages li.flash { background: rgba(200,170,110,.22); border-radius: 6px; transition: background .3s; }
.messages audio { vertical-align: middle; max-width: 220px; height: 34px; }
.safety.verified { color: #4ad08a; }
.safety.unverified { color: #d8b24a; }

/* Install-first gate (index.html #installGate): leads with an install step before the sign-up form. */
#installGate { display: flex; flex-direction: column; gap: 12px; }
#installGate .hint { color: var(--muted); font-size: 13px; margin: 0; }
#installGate #installBtn { font-weight: 600; }

/* ============================================================================
   Polish pass (consumer-grade). Appended so it overrides the base rules above
   without removing any selector. Depth, balance, full-width CTAs, real chat.
   ============================================================================ */
:root {
  --bg: #0a0a0f;
  --panel: #12121a;
  --panel-2: #1a1a24;
  --line: #2b2b33;
  --teal: #c8aa6e;
  --teal-bright: #d6bd84;
  --me: #5c4d22;
  --shadow: 0 12px 34px rgba(0,0,0,.5);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.4);
}
body {
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(200,170,110,.07), transparent 62%),
    var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

/* Auth: vertically balanced, generous, designed. */
#connect.screen { justify-content: center; gap: 18px; padding: 30px 22px; }
.brand { gap: 14px; }
.logo {
  background: linear-gradient(150deg, var(--teal-bright), var(--teal));
  box-shadow: 0 10px 24px rgba(200,170,110,.28); border-radius: 14px;
}
h1 { letter-spacing: -.02em; }
.tagline { font-size: 15px; max-width: 36ch; line-height: 1.5; }
#connectMain, #privatePanel, #restorePanel, #emailSignup { display: flex; flex-direction: column; gap: 14px; }
#connectMain > .hint, #emailSignup .or { color: var(--muted); font-size: 13px; margin: 0; }
#emailSignup .or { text-align: center; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; opacity: .7; }

/* Inputs + buttons: deeper, tactile, animated. */
input, .reccode, .searchbox {
  background: var(--panel); border-color: var(--line); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
input { padding: 14px 15px; }
input:focus { border-color: var(--teal-bright); box-shadow: 0 0 0 3px rgba(200,170,110,.22); }
button {
  border-radius: 12px; padding: 14px 18px;
  box-shadow: var(--shadow-sm); transition: transform .08s ease, filter .15s, background .15s;
}
button:not(.ghost):not(.linkbtn):not(.icon):not(.danger) {
  background: linear-gradient(150deg, var(--teal-bright), var(--teal));
}
button:not(.ghost):not(.linkbtn):not(.icon):not(.danger):hover { filter: brightness(1.06); }
button:not(.linkbtn):not(.icon):active { transform: translateY(1px); }
button:disabled { box-shadow: none; filter: none; }
button.ghost { border-radius: 12px; box-shadow: none; }
/* Full-width primary CTAs in the auth columns; row buttons stay inline. */
#createAccountBtn, #emailSignup #connectBtn, #doRestore, #createPrivate, #recRevealContinue { width: 100%; }
.altauth { justify-content: space-between; gap: 10px; }
#coreStatus.status { text-align: center; font-size: 13px; }
.notice { border-radius: 12px; }

/* ---- Chat: a real messenger ---- */
.bar { box-shadow: var(--shadow-sm); border: 1px solid var(--line); gap: 12px; }
#meLabel { font-weight: 500; color: var(--muted); font-size: 13px; }
#peerLabel:not(:empty) { color: var(--text); font-weight: 700; font-size: 16px; }
#presence { font-size: 12px; }
.messages li {
  box-shadow: var(--shadow-sm); line-height: 1.35; border-radius: 16px;
  padding: 9px 14px; font-size: 15px;
}
.messages li.me { background: var(--me); border-bottom-right-radius: 5px; }
.messages li:not(.me):not(.sys) { border-bottom-left-radius: 5px; }
.messages li.sys {
  background: rgba(255,255,255,.05); color: var(--muted); font-size: 12px;
  padding: 5px 12px; border-radius: 999px; box-shadow: none; max-width: 86%;
}
.tick { color: rgba(255,255,255,.6); }
/* Tap-to-retry shown on a message whose send failed (socket down). */
.messages li .retry {
  background: rgba(179, 38, 59, 0.22); color: #ff8095; border: 0; box-shadow: none;
  border-radius: 999px; padding: 2px 9px; font-size: 11px; margin-left: 6px; cursor: pointer;
}
.messages li .retry:hover { background: rgba(179, 38, 59, 0.34); }
/* Composer: clean pill + circular send, fitted to the viewport (fixes Send overflow). */
/* Bottom padding clears the iOS home indicator when installed standalone (viewport-fit=cover): on a
   notched iPhone env(safe-area-inset-bottom) is ~34px, elsewhere it is 0 so this stays the original
   12px — identical on desktop/Android and in the headless E2E. */
.composer { padding: 10px 2px max(12px, env(safe-area-inset-bottom)); gap: 8px; align-items: center; }
.composer input { min-width: 0; border-radius: 999px; padding: 12px 16px; background: var(--panel-2); }
/* Multi-line composer: a textarea that grows with content (Enter sends, Shift+Enter is a newline). */
.composer { align-items: flex-end; }
.composer textarea {
  min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 20px; padding: 11px 16px;
  background: var(--panel-2); color: var(--text); font: inherit; line-height: 1.35;
  resize: none; overflow-y: auto; max-height: 140px;
}
.composer textarea:focus {
  border-color: var(--teal-bright); box-shadow: 0 0 0 3px rgba(200,170,110,.22); outline: none;
}
.composer button[type="submit"] { border-radius: 999px; padding: 12px 20px; flex: 0 0 auto; }
button.icon { border-radius: 12px; box-shadow: none; flex: 0 0 auto; }

/* Chat header: a contact avatar + peer-focused title, like a real messenger. */
.peerhead { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 17px; box-shadow: var(--shadow-sm);
  background: linear-gradient(150deg, var(--teal-bright), var(--teal));
}
.bar #meLabel { display: none; }            /* the header focuses on who you are talking TO */
.bar #peerLabel { font-size: 16px; }
/* Inline message timestamp. */
.time { color: rgba(255,255,255,.45); font-size: 11px; margin-left: 6px; }
.messages li.me .time { color: rgba(255,255,255,.6); }

/* A clean chat action bar + a single "⋮ More" menu instead of a wall of buttons. */
.peerpick { position: relative; align-items: center; gap: 8px; }
.peerpick #peer { flex: 1; min-width: 0; border-radius: 999px; padding: 11px 16px; }
.peerpick #openChat { border-radius: 999px; flex: 0 0 auto; }
.peerpick #moreBtn { flex: 0 0 auto; width: 44px; padding: 11px 0; font-size: 20px; line-height: 1; }
.moremenu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 230px; max-height: 70vh;
  overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.moremenu button {
  width: 100%; text-align: left; background: transparent; border: 0; box-shadow: none;
  padding: 11px 13px; border-radius: 9px; color: var(--text); font-weight: 500;
}
.moremenu button:hover { background: var(--panel-2); filter: none; }
.moremenu button.danger { background: transparent; color: #ff8095; }
.moremenu button.danger:hover { background: rgba(179,38,59,.18); }
/* In-menu language switch for signed-in users (mirrors the connect-screen picker). */
.moremenu .menulang { display: flex; align-items: center; gap: 8px; padding: 8px 13px; }
.moremenu .menulang select {
  flex: 1; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 7px 9px; border-radius: 8px; font-size: 14px; cursor: pointer;
}
.moremenu .menulang select:focus { border-color: var(--teal-bright); outline: none; }

/* ============================================================================
   Accessibility pass: screen-reader utility, visible keyboard focus, and a
   prefers-reduced-motion safety net. Appended so it overrides without removing.
   ============================================================================ */

/* "↓ New messages" pill: floats above the composer when a message arrives while you're scrolled up,
   so a new line never yanks you down (see renderLine's smart auto-scroll). */
#chat.screen { position: relative; }
.newmsgpill {
  position: absolute; right: 16px; bottom: 84px; z-index: 30;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 15px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow); cursor: pointer;
}
.newmsgpill:hover { filter: brightness(1.08); }

/* Day separators ("Today" / "Yesterday" / a date) — a quiet centered label, not a chat bubble. */
.messages li.daysep {
  background: transparent; box-shadow: none; color: var(--muted);
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; align-self: center;
}
/* The reassuring end-to-end-encryption banner at the top of each chat. */
.messages li.ebanner {
  background: var(--tint); color: var(--muted); font-size: 11.5px; line-height: 1.4;
  text-align: center; border-radius: 10px; max-width: 92%; align-self: center; box-shadow: none; padding: 7px 12px;
}

/* First-run / no-conversation welcome (shown in place of the empty message list). */
.emptystate { flex: 1; }
.emptystate:not(.hidden) { display: flex; align-items: center; justify-content: center; padding: 24px; }
.emptystate-card { text-align: center; max-width: 34ch; color: var(--muted); }
.emptystate-logo {
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(150deg, var(--teal-bright), var(--teal)); color: #fff; font-weight: 700;
  font-size: 26px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.emptystate-card h2 { margin: 0 0 8px; color: var(--text); font-size: 20px; }
.emptystate-card p { margin: 6px 0; line-height: 1.5; }
.emptystate-hint { font-size: 13px; opacity: .85; }

/* Visually hidden but available to assistive tech (the #srLive announcer). */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* A clear focus ring for keyboard users (not shown on mouse click). Reaction chips and reply quotes
   are now keyboard-operable (role=button + tabindex), so they need a visible focus state too. */
:focus-visible {
  outline: 2px solid var(--teal-bright); outline-offset: 2px; border-radius: 6px;
}
.react:focus-visible, .quote:focus-visible, .msgmenu:focus-visible { outline-offset: 1px; }

/* Respect users who ask for less motion: neutralize every animation/transition + the press transform
   and the flash highlight, without having to enumerate each keyframe. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  button:active { transform: none !important; }
  .messages li.flash { animation: none !important; }
}

/* ====================================================================================
   Tint overlays + LIGHT THEME. Dark is the default and is left untouched; light only
   activates when the user's OS prefers light, so the existing dark experience is unchanged.
   The few hardcoded white tints are routed through --tint vars so they adapt to light.
   ==================================================================================== */
:root { --tint: rgba(255,255,255,.05); --tint-2: rgba(255,255,255,.08); --tint-line: rgba(255,255,255,.1); }
.messages li.me { color: #fff; }          /* white text on the teal sent bubble (correct in both themes) */
.time { color: var(--muted); }            /* received-bubble time adapts; .me .time stays white (below) */
.quote { background: var(--tint); }
.messages li.sys { background: var(--tint); }
.msgactions button:hover { background: var(--tint-2); }
.reactpick { border-bottom-color: var(--tint-line); }

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f3ef; --panel: #ffffff; --panel-2: #f0ede7; --line: #e2ddd2;
    --teal: #9a7c3c; --teal-bright: #b0923d; --text: #1a1a18; --muted: #6b6760;
    --me: #7d6432;                        /* deep gold sent bubble so white text still reads in light mode */
    --shadow: 0 12px 34px rgba(60,50,30,.12); --shadow-sm: 0 2px 10px rgba(60,50,30,.08);
    --tint: rgba(0,0,0,.045); --tint-2: rgba(0,0,0,.06); --tint-line: rgba(0,0,0,.08);
  }
}

/* Right-to-left (Arabic/Hebrew/Urdu/Farsi). `dir="rtl"` on <html> (set by i18n.js) already mirrors
   text flow + the flexbox layout (message bubbles use align-self: flex-end, which auto-flips). These
   overrides flip the few rules pinned with PHYSICAL left/right that wouldn't otherwise mirror, so menus,
   the quoted-reply bar, badges and the floating button land on the correct side. */
[dir="rtl"] .safety { text-align: left; }
[dir="rtl"] .pqbadge { margin-left: 0; margin-right: auto; }
[dir="rtl"] .msgactions { right: auto; left: 8px; }
[dir="rtl"] .msgactions button { text-align: right; }
[dir="rtl"] .moremenu { right: auto; left: 0; }
[dir="rtl"] .moremenu button { text-align: right; }
[dir="rtl"] .quote { border-left: 0; border-right: 3px solid var(--teal); }
[dir="rtl"] .time { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .newmsgpill { right: auto; left: 16px; }
[dir="rtl"] .callOverlay .local { right: auto; left: 14px; }
