/* ============================================================
   Messenger UI — «پیام‌رسان» Design System v2
   RTL-first · mobile-light · light/dark · no frameworks
   Breakpoints: <960 single pane · 960–1279 two pane · ≥1280 three pane
   ============================================================ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------------- tokens ---------------- */

:root {
  --font: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --sidebar-w: 360px;
  --info-w: 330px;
  --topbar-h: 60px;
  --tabbar-h: 58px;

  /* surfaces */
  --bg: #eef1f4;
  --bg-2: #ffffff;
  --bg-3: #e7ebee;
  --panel: #ffffff;
  --panel-2: #f3f5f7;
  --panel-3: #e9edf0;
  --border: #e2e7eb;
  --border-strong: #d3dade;

  /* text */
  --text: #101a21;
  --text-2: #62747e;
  --text-3: #93a3ac;

  /* brand */
  --primary: #0aa37f;
  --primary-h: #088e6e;
  --primary-soft: #ddf3ec;
  --primary-text: #07795f;
  --accent-grad: linear-gradient(135deg, #00c39a, #0090c9);

  /* status */
  --danger: #e5544b;
  --danger-h: #d2463d;
  --danger-soft: #fdecea;
  --warn: #d98a06;
  --warn-soft: #fdf3dd;
  --ok: #1fa855;

  /* bubbles */
  --bubble-mine: #d3f3e2;
  --bubble-theirs: #ffffff;

  /* chat wallpaper */
  --wallpaper: #e9edef;
  --wallpaper-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='none' stroke='%23101a21' stroke-opacity='.045' stroke-width='1.6'%3E%3Cpath d='M22 30h20a7 7 0 0 1 7 7v8a7 7 0 0 1-7 7H32l-7 6v-21a7 7 0 0 1 7-7z'/%3E%3Ccircle cx='112' cy='36' r='7'/%3E%3Cpath d='M108 104h24a6 6 0 0 1 6 6v7a6 6 0 0 1-6 6h-10l-7 5v-18a6 6 0 0 1 6-6z'/%3E%3Cpath d='m30 118 3.2 6.5 7.3 1-5.3 5 1.3 7-6.5-3.4-6.5 3.4 1.3-7-5.3-5 7.3-1z'/%3E%3Ccircle cx='128' cy='76' r='2.4'/%3E%3Ccircle cx='64' cy='84' r='2.4'/%3E%3Cpath d='m84 12 1.8 3.6 4 .6-2.9 2.7.7 4-3.6-1.9-3.6 1.9.7-4-2.9-2.7 4-.6z'/%3E%3C/g%3E%3C/svg%3E");

  /* elevation */
  --shadow: 0 10px 34px rgba(10, 25, 32, .13);
  --shadow-sm: 0 1px 2px rgba(10, 25, 32, .07), 0 2px 10px rgba(10, 25, 32, .06);
  --shadow-float: 0 6px 20px rgba(10, 25, 32, .22);

  /* header tint */
  --head-tint: var(--panel);
}

[data-theme="dark"] {
  --bg: #0b141a;
  --bg-2: #1a252d;
  --bg-3: #0f1a20;
  --panel: #111b21;
  --panel-2: #1e2b33;
  --panel-3: #24333c;
  --border: #22323b;
  --border-strong: #2e414c;

  --text: #e9edef;
  --text-2: #8b9ca4;
  --text-3: #5d7079;

  --primary: #14c392;
  --primary-h: #22d3a4;
  --primary-soft: rgba(20, 195, 146, .13);
  --primary-text: #4adfb4;
  --accent-grad: linear-gradient(135deg, #00c39a, #0f8ec4);

  --danger: #f2635a;
  --danger-h: #f4796f;
  --danger-soft: rgba(242, 99, 90, .14);
  --warn: #e5a93d;
  --warn-soft: rgba(229, 169, 61, .15);
  --ok: #35c46f;

  --bubble-mine: #005c4b;
  --bubble-theirs: #1e2b33;

  --wallpaper: #0c161c;
  --wallpaper-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='none' stroke='%23e9edef' stroke-opacity='.035' stroke-width='1.6'%3E%3Cpath d='M22 30h20a7 7 0 0 1 7 7v8a7 7 0 0 1-7 7H32l-7 6v-21a7 7 0 0 1 7-7z'/%3E%3Ccircle cx='112' cy='36' r='7'/%3E%3Cpath d='M108 104h24a6 6 0 0 1 6 6v7a6 6 0 0 1-6 6h-10l-7 5v-18a6 6 0 0 1 6-6z'/%3E%3Cpath d='m30 118 3.2 6.5 7.3 1-5.3 5 1.3 7-6.5-3.4-6.5 3.4 1.3-7-5.3-5 7.3-1z'/%3E%3Ccircle cx='128' cy='76' r='2.4'/%3E%3Ccircle cx='64' cy='84' r='2.4'/%3E%3Cpath d='m84 12 1.8 3.6 4 .6-2.9 2.7.7 4-3.6-1.9-3.6 1.9.7-4-2.9-2.7 4-.6z'/%3E%3C/g%3E%3C/svg%3E");

  --shadow: 0 10px 34px rgba(0, 0, 0, .5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-float: 0 6px 22px rgba(0, 0, 0, .55);

  --head-tint: rgba(17, 27, 33, .92);
}

/* ---------------- base ---------------- */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* The hidden attribute must always win over component display rules. */
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}
#app { height: 100dvh; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--text); }
a { color: var(--primary); }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.ok-text { color: var(--ok); font-weight: 600; }

.icon { display: inline-flex; vertical-align: middle; flex: none; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.field :focus-visible { outline: none; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(128, 140, 150, .4) transparent; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: rgba(128, 140, 150, .35); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 11px 20px; font-size: 14.5px; font-weight: 700; line-height: 1.2;
  transition: filter .15s, background .15s, transform .08s, box-shadow .15s;
  user-select: none;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(10, 163, 127, .30); }
.btn-primary:hover { background: var(--primary-h); }
[data-theme="dark"] .btn-primary { background: var(--primary); color: #06251d; }
[data-theme="dark"] .btn-primary:hover { background: var(--primary-h); }
.btn-ghost { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--panel-3); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 4px 14px rgba(229, 84, 75, .28); }
.btn-danger:hover { background: var(--danger-h); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: var(--radius-xs); }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: transparent; color: var(--text-2);
  transition: background .15s, color .15s, transform .1s;
  flex: none;
}
.btn-icon:hover { background: var(--panel-2); color: var(--text); }
.btn-icon:active { transform: scale(.9); }
.btn-icon.danger:hover { background: var(--danger-soft); color: var(--danger); }

.linklike {
  background: none; border: none; color: var(--primary-text);
  font-size: 13.5px; font-weight: 600; padding: 6px;
}
[dir="rtl"] .linklike { color: var(--primary-text); }
[data-theme="dark"] .linklike { color: var(--primary-text); }
.linklike:hover { text-decoration: underline; }

/* ---------------- fields ---------------- */

.field { display: block; margin-bottom: 15px; }
.field-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.field-wrap { position: relative; display: flex; align-items: center; }
.field-ic {
  position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none; display: inline-flex;
}
.field input, .field textarea, .field select,
.modal-body input[type="text"], .modal-body input[type="password"],
.modal-body input[type="email"], .modal-body input[type="search"], .modal-body textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-2); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.field .has-ic { padding-inline-start: 42px; }
.field .has-tail { padding-inline-end: 44px; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3.5px var(--primary-soft);
}
.field input.invalid { border-color: var(--danger); }
.field-error { display: block; color: var(--danger); font-size: 12.5px; min-height: 17px; margin-top: 5px; font-weight: 500; }

.pw-toggle {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: none; color: var(--text-3); display: inline-flex;
  align-items: center; justify-content: center;
}
.pw-toggle:hover { background: var(--panel-2); color: var(--text); }

.spinner {
  display: inline-block; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- toasts ---------------- */

.toasts {
  position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); right: 50%; transform: translateX(50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 3000;
  width: min(430px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-float); padding: 12px 16px; font-size: 13.5px; font-weight: 500;
  opacity: 0; transform: translateY(10px); transition: all .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-inline-start: 4px solid var(--ok); }
.toast-error { border-inline-start: 4px solid var(--danger); }
.toast-info { border-inline-start: 4px solid var(--primary); }

/* ---------------- modal / bottom-sheet ---------------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6, 12, 16, .58);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 16px;
  animation: fadeIn .18s ease;
}
.modal-dialog {
  background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); width: min(460px, 100%);
  max-height: min(86dvh, 720px); display: flex; flex-direction: column;
  animation: popIn .22s cubic-bezier(.2, .9, .3, 1.2);
  overflow: hidden;
}
.modal-wide { width: min(680px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 15px 18px; border-bottom: 1px solid var(--border); flex: none;
}
.modal-head h3 { font-size: 16px; font-weight: 800; }
.modal-body { padding: 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.modal-foot {
  display: flex; gap: 8px; justify-content: flex-start;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px) - 12px);
  border-top: 1px solid var(--border); flex: none;
}
@keyframes popIn { from { opacity: 0; transform: scale(.95) translateY(10px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(60%); opacity: .4; } }

.menu-list { display: flex; flex-direction: column; gap: 2px; }
.menu-item {
  display: flex; align-items: center; gap: 11px;
  background: none; border: none; color: var(--text);
  padding: 12px 12px; border-radius: var(--radius-xs);
  font-size: 14px; font-weight: 600; text-align: right; width: 100%;
  transition: background .12s;
}
.menu-item:hover { background: var(--panel-2); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }

.pick-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.pick-row {
  display: flex; align-items: center; gap: 10px; text-align: right;
  background: none; border: 1px solid transparent; border-radius: var(--radius-xs);
  padding: 9px 10px; color: var(--text); width: 100%;
  transition: background .12s, border-color .12s;
}
.pick-row:hover { background: var(--panel-2); border-color: var(--border); }
.pick-name { font-weight: 700; flex: 1; font-size: 14px; }
.pick-sub { color: var(--text-2); font-size: 12.5px; }
.picked-box { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary-soft); color: var(--primary-text);
  border-radius: 20px; padding: 4px 11px; font-size: 12.5px; font-weight: 700;
}
[data-theme="dark"] .chip { color: var(--primary-text); }
.chip-x { background: none; border: none; color: inherit; display: inline-flex; padding: 2px; }
.chip-current { background: var(--primary-soft); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.emoji-cell { background: none; border: none; font-size: 23px; padding: 6px; border-radius: 10px; transition: transform .1s, background .12s; }
.emoji-cell:hover { background: var(--panel-2); }
.emoji-cell:active { transform: scale(1.25); }

.switch-list { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 4px; font-size: 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.switch-row:last-child { border-bottom: none; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: var(--border-strong);
  border-radius: 26px; transition: background .2s;
}
.slider::before {
  content: ''; position: absolute; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; top: 3px; right: 3px;
  transition: transform .2s cubic-bezier(.3, .8, .4, 1.2); box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(-20px); }

/* ---------------- lightbox ---------------- */

.lightbox {
  position: fixed; inset: 0; background: rgba(5, 9, 13, .92);
  display: flex; align-items: center; justify-content: center; z-index: 2500;
  padding: 20px; animation: fadeIn .15s ease;
}
.lightbox img { max-width: 100%; max-height: 92dvh; border-radius: var(--radius-sm); animation: popIn .2s ease; }
.lightbox-x { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; color: #fff; width: 44px; height: 44px; background: rgba(255, 255, 255, .1); }

/* ============================================================
   AUTH
   ============================================================ */

.auth-wrap {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 30px; padding: 24px 20px;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  position: relative;
  background: var(--bg);
}
/* animated aurora blobs (transform/opacity only — cheap on mobile GPUs) */
.auth-blob { position: fixed; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; z-index: 0; }
.auth-blob.b1 { width: 420px; height: 420px; background: rgba(0, 195, 154, .33); top: -140px; inset-inline-end: -120px; animation: drift1 14s ease-in-out infinite alternate; }
.auth-blob.b2 { width: 380px; height: 380px; background: rgba(0, 144, 201, .28); bottom: -130px; inset-inline-start: -110px; animation: drift2 17s ease-in-out infinite alternate; }
[data-theme="dark"] .auth-blob { opacity: .33; }
@keyframes drift1 { to { transform: translate(-60px, 50px) scale(1.12); } }
@keyframes drift2 { to { transform: translate(55px, -45px) scale(1.08); } }

.auth-brand { text-align: center; position: relative; z-index: 1; }
.auth-logo {
  display: inline-flex; width: 74px; height: 74px; border-radius: 24px;
  background: var(--accent-grad); color: #fff;
  align-items: center; justify-content: center;
  box-shadow: 0 14px 34px rgba(0, 165, 145, .42);
  margin-bottom: 14px; animation: logoFloat 5s ease-in-out infinite alternate;
}
@keyframes logoFloat { to { transform: translateY(-7px); } }
.auth-brand h1 { font-size: 27px; font-weight: 900; letter-spacing: -.3px; }
.auth-brand p { color: var(--text-2); font-size: 14px; margin-top: 5px; font-weight: 500; }

.auth-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 22px; box-shadow: var(--shadow);
  padding: 28px 24px; width: min(420px, 100%);
  position: relative; z-index: 1;
}
.auth-card h2 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.auth-card .auth-sub { color: var(--text-2); font-size: 13px; margin-bottom: 18px; }
.auth-form { display: flex; flex-direction: column; }
.auth-form .btn { margin-top: 8px; padding: 13px 20px; font-size: 15px; }
.auth-links { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; text-align: center; }
.otp-input {
  text-align: center; font-size: 22px; font-weight: 800; letter-spacing: 10px;
  direction: ltr; padding: 14px !important;
}
.otp-input:focus { letter-spacing: 12px; }

/* pill tabs on the auth card */
.auth-tabs {
  display: flex; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; border: none; background: none; padding: 9px 10px; border-radius: 10px;
  font-size: 13.5px; font-weight: 700; color: var(--text-2);
  transition: background .18s, color .18s, box-shadow .18s;
}
.auth-tab.active { background: var(--panel); color: var(--primary-text); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .auth-tab.active { background: var(--panel-3); }

@media (min-width: 960px) {
  .auth-wrap { flex-direction: row; gap: 72px; padding: 40px; }
  .auth-brand { text-align: start; align-self: center; }
  .auth-brand h1 { font-size: 34px; }
  .auth-card { padding: 32px 30px; }
}

/* ============================================================
   SHELL
   ============================================================ */

.shell { display: flex; height: 100dvh; height: 100dvh; }

/* ---------------- sidebar ---------------- */

.sidebar {
  width: var(--sidebar-w); flex: none; display: flex; flex-direction: column;
  background: var(--panel); border-inline-end: 1px solid var(--border);
  min-width: 0; position: relative;
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; min-height: var(--topbar-h); flex: none;
}
.me-btn {
  display: flex; align-items: center; gap: 10px; background: none; border: none;
  color: var(--text); border-radius: var(--radius-sm); padding: 4px 10px 4px 4px; min-width: 0;
  transition: background .13s;
}
.me-btn:hover { background: var(--panel-2); }
.me-name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-actions { display: flex; gap: 2px; }

.sidebar-search {
  display: flex; align-items: center; gap: 9px;
  margin: 4px 12px 10px; padding: 0 13px; flex: none;
  background: var(--panel-2); border: 1.5px solid transparent;
  border-radius: 14px; color: var(--text-2);
  transition: border-color .15s, background .15s;
}
.sidebar-search:focus-within { border-color: var(--primary); background: var(--bg-2); }
.sidebar-search input {
  flex: 1; border: none; background: none; outline: none;
  padding: 11px 0; font-size: 14px; min-width: 0; color: var(--text);
}
.sidebar-search input::placeholder { color: var(--text-3); }

.conv-list { flex: 1; overflow-y: auto; padding: 2px 8px calc(14px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.conv-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 10px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .13s; position: relative;
}
.conv-row:hover { background: var(--panel-2); }
.conv-row.active { background: var(--primary-soft); }
.conv-row.active::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 22%; bottom: 22%;
  width: 3.5px; border-radius: 4px; background: var(--primary);
}
.conv-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.conv-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--text-2); flex: none; }
.has-unread .conv-time { color: var(--primary-text); font-weight: 700; }
.conv-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-preview {
  font-size: 13px; color: var(--text-2); min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.has-unread .conv-preview { color: var(--text); font-weight: 600; }
.conv-me { color: var(--primary-text); font-weight: 700; }
.unread-badge {
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 800;
  border-radius: 20px; padding: 2.5px 8px; flex: none; min-width: 22px; text-align: center;
  box-shadow: 0 2px 8px rgba(10, 163, 127, .4);
}
.muted-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-2); opacity: .5; flex: none; }
.conv-empty {
  text-align: center; color: var(--text-2); padding: 46px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 13px;
}
.conv-empty .icon { color: var(--text-3); }
.search-results { padding: 4px 0; }
.search-head { font-size: 11.5px; color: var(--text-2); padding: 12px 10px 4px; font-weight: 800; letter-spacing: .3px; }
.search-row {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: var(--radius-xs); cursor: pointer; width: 100%;
  background: none; border: none; text-align: right; color: var(--text);
  transition: background .12s;
}
.search-row:hover { background: var(--panel-2); }
.search-conv { font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.search-body { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* floating action button (mobile) */
.fab {
  position: absolute; bottom: calc(20px + env(safe-area-inset-bottom)); inset-inline-end: 18px;
  width: 58px; height: 58px; border-radius: 20px; border: none;
  background: var(--accent-grad); color: #fff;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 165, 145, .45);
  transition: transform .15s, filter .15s; z-index: 20;
}
.fab:active { transform: scale(.92); }
.fab:hover { filter: brightness(1.06); }

/* ---------------- avatar ---------------- */

.avatar {
  --av-size: 44px;
  width: var(--av-size); height: var(--av-size); border-radius: 50%;
  flex: none; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
  background: var(--panel-2);
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-init { font-size: calc(var(--av-size) * .36); line-height: 1; }
.avatar-ring { position: relative; flex: none; display: inline-flex; }
.online-dot {
  position: absolute; bottom: 0; inset-inline-end: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ok); border: 2.5px solid var(--panel);
}

/* ---------------- chat pane ---------------- */

.chat-pane {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background-color: var(--wallpaper);
  background-image: var(--wallpaper-img);
  position: relative;
}
.chat-loading { flex: 1; display: flex; align-items: center; justify-content: center; }
.chat-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 13px; color: var(--text-2); text-align: center; padding: 22px;
}
.chat-empty.small { padding: 30px 10px; }
.chat-empty h3 { color: var(--text); font-size: 19px; font-weight: 800; }
.chat-empty .icon { color: var(--primary); opacity: .8; }

.chat-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; min-height: var(--topbar-h);
  background: var(--head-tint);
  border-bottom: 1px solid var(--border);
  flex: none; z-index: 5;
}
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .chat-head { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
.chat-head-main {
  display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0;
  background: none; border: none; color: var(--text); text-align: right;
  border-radius: var(--radius-sm); padding: 4px 8px; transition: background .13s;
}
.chat-head-main:hover { background: var(--panel-2); }
.chat-head-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.chat-head-text strong { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chat-head-sub { font-size: 12px; color: var(--text-2); }
.chat-head-sub.online { color: var(--ok); font-weight: 700; }
.chat-head-actions { display: flex; gap: 2px; }
.mobile-only { display: none; }

.pins-bar {
  display: flex; align-items: center; gap: 8px; flex: none;
  background: var(--head-tint); border-bottom: 1px dashed var(--border);
  color: var(--text-2); font-size: 12.5px; padding: 8px 16px; z-index: 4;
}
.pins-bar .icon { color: var(--warn); }
.pin-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-count { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 1px 9px; font-size: 11px; font-weight: 700; }

.msg-list {
  flex: 1; overflow-y: auto; padding: 14px 6px 8px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  scroll-behavior: smooth;
}
.msg-stream { display: flex; flex-direction: column; gap: 2.5px; max-width: 860px; margin: 0 auto; padding: 0 10px; }
.older-sentinel { display: flex; justify-content: center; padding: 6px; }

.day-divider { display: flex; justify-content: center; margin: 16px 0 10px; }
.day-divider span {
  background: var(--head-tint); color: var(--text-2); font-size: 11.5px; font-weight: 700;
  border-radius: 20px; padding: 5px 15px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .day-divider span, .pins-bar, .chat-head { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}

.msg-row { display: flex; margin-bottom: 2px; animation: bubbleIn .18s ease; }
.msg-row.mine { justify-content: flex-start; flex-direction: row-reverse; }
.msg-row.theirs { justify-content: flex-end; flex-direction: row-reverse; }

.bubble {
  position: relative; max-width: min(74%, 560px);
  padding: 8px 12px 7px; border-radius: var(--radius);
  font-size: 14px; line-height: 1.75; word-break: break-word;
  box-shadow: var(--shadow-sm);
}
/* iMessage-style grouping: middle bubbles get squared inner corners */
/* tail on the outer-bottom corner + iMessage-style grouping */
.bubble.mine { background: var(--bubble-mine); color: var(--text); border-bottom-left-radius: 6px; }
[data-theme="dark"] .bubble.mine { color: #eafff7; }
.bubble.theirs { background: var(--bubble-theirs); border: 1px solid var(--border); border-bottom-right-radius: 6px; }
.bubble.mine.grp-first { border-bottom-left-radius: var(--radius); }
.bubble.mine.grp-mid { border-bottom-left-radius: var(--radius); border-top-left-radius: 6px; }
.bubble.mine.grp-last { border-top-left-radius: 6px; }
.bubble.theirs.grp-first { border-bottom-right-radius: var(--radius); }
.bubble.theirs.grp-mid { border-bottom-right-radius: var(--radius); border-top-right-radius: 6px; }
.bubble.theirs.grp-last { border-top-right-radius: 6px; }
.bubble.mine .msg-meta { color: var(--text); }
.bubble.mine a { color: var(--primary-text); font-weight: 600; }
[data-theme="dark"] .bubble.mine a { color: #7dedc9; }
.bubble.deleted {
  background: var(--panel); color: var(--text-2); font-style: italic;
  border: 1px dashed var(--border-strong); display: flex; align-items: center; gap: 6px;
}
.flash { animation: flashBg 1.5s ease; }
@keyframes flashBg { 0%, 55% { box-shadow: 0 0 0 3px var(--primary); } 100% { box-shadow: var(--shadow-sm); } }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(5px); } }

.msg-sender { font-size: 12.5px; font-weight: 800; margin-bottom: 2px; }
.msg-forwarded { display: flex; align-items: center; gap: 4px; font-size: 11.5px; opacity: .75; margin-bottom: 2px; font-style: italic; }
.msg-body { white-space: pre-wrap; }
.msg-caption { margin-top: 6px; white-space: pre-wrap; }

.msg-reply {
  border-inline-start: 3px solid var(--primary);
  background: rgba(10, 163, 127, .09);
  border-radius: 8px; padding: 5px 10px; margin-bottom: 6px;
  cursor: pointer; display: flex; flex-direction: column; gap: 1px;
  transition: background .13s;
}
.msg-reply:hover { background: rgba(10, 163, 127, .16); }
.bubble.mine .msg-reply { background: rgba(255, 255, 255, .45); border-inline-start-color: var(--primary); }
[data-theme="dark"] .bubble.mine .msg-reply { background: rgba(255, 255, 255, .09); border-inline-start-color: #35d0a5; }
.reply-name { font-size: 11.5px; font-weight: 800; color: var(--primary-text); }
[data-theme="dark"] .bubble.mine .reply-name { color: #5ce0b8; }
.reply-body { font-size: 12.5px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }

.msg-meta {
  display: flex; align-items: center; gap: 4px; justify-content: flex-end;
  font-size: 10.5px; opacity: .62; margin-top: 3px; user-select: none;
}
.msg-meta .icon { opacity: .9; }
.msg-more {
  position: absolute; top: 4px; left: 4px; width: 26px; height: 26px;
  opacity: 0; transition: opacity .15s; color: inherit;
}
.bubble:hover .msg-more { opacity: .75; }
@media (hover: none) { .msg-more { opacity: .45; } }

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.reaction-chip {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; font-size: 12px; padding: 2.5px 9px;
  box-shadow: var(--shadow-sm); transition: transform .12s;
}
.reaction-chip:active { transform: scale(1.12); }
.reaction-chip.mine-react { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); font-weight: 800; }

.msg-media img.msg-image {
  border-radius: 12px; max-width: min(340px, 100%); max-height: 340px;
  cursor: zoom-in; display: block; background: var(--bg-3);
}
.msg-video { border-radius: 12px; max-width: min(360px, 100%); display: block; background: var(--bg-3); }
.msg-audio, .msg-media audio { width: min(300px, 100%); display: block; }
.msg-file {
  display: flex; align-items: center; gap: 11px; text-decoration: none;
  color: inherit; min-width: 200px; padding: 5px 2px;
}
.file-ic {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 163, 127, .14); color: var(--primary-text);
}
[data-theme="dark"] .bubble.mine .file-ic { background: rgba(255, 255, 255, .12); color: #7dedc9; }
.file-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-info strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info span { font-size: 11.5px; opacity: .75; }

/* scroll-to-bottom */
.jump-btn {
  position: absolute; bottom: 88px; inset-inline-end: 18px;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-2); z-index: 10;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-float); transition: transform .15s, opacity .2s;
  animation: popIn .2s ease;
}
.jump-btn:hover { color: var(--primary); transform: translateY(-2px); }

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

.composer {
  background: var(--head-tint); border-top: 1px solid var(--border);
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  flex: none; z-index: 5;
}
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .composer { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
.composer .msg-stream { max-width: none; }
.composer-row {
  display: flex; align-items: flex-end; gap: 5px;
  max-width: 860px; margin: 0 auto;
}
.composer-input {
  flex: 1; resize: none; border: 1.5px solid var(--border);
  background: var(--bg-2); color: var(--text);
  border-radius: 22px; padding: 11px 16px;
  outline: none; line-height: 1.6; max-height: 140px;
  transition: border-color .15s, box-shadow .15s;
  font-size: 15px;
}
.composer-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3.5px var(--primary-soft); }
.btn-send {
  border-radius: 50%; width: 46px; height: 46px; padding: 0; flex: none;
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 5px 16px rgba(0, 165, 145, .4);
  transition: transform .12s, filter .15s;
}
.btn-send:hover { filter: brightness(1.07); }
.btn-send:active { transform: scale(.88); }
.composer-context {
  display: flex; align-items: center; gap: 9px;
  max-width: 860px; margin: 0 auto 8px;
  color: var(--text-2); font-size: 12.5px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  animation: popIn .18s ease;
}
.composer-context .icon { color: var(--primary); }
.ctx-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* upload progress strip (file share) */
.upload-progress-body {
  display: flex; align-items: center; gap: 9px;
  max-width: 860px; margin: 0 auto 8px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  animation: popIn .18s ease;
  color: var(--text-2); font-size: 12.5px;
}
.up-icon { display: inline-flex; color: var(--primary); flex: none; }
.up-name { flex: none; max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.up-bar {
  flex: 1; height: 7px; min-width: 60px;
  border-radius: 6px; background: var(--panel-3);
  overflow: hidden;
}
.up-fill {
  display: block; height: 100%; width: 0;
  border-radius: 6px; background: var(--accent-grad);
  transition: width .2s ease;
}
.up-pct { flex: none; min-width: 42px; text-align: center; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.up-cancel { flex: none; width: 26px; height: 26px; color: var(--text-3); }
.up-cancel:hover { color: var(--danger); }

/* ---------------- info pane ---------------- */

.info-pane {
  width: var(--info-w); flex: none; background: var(--panel);
  border-inline-start: 1px solid var(--border);
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: none;
}
.info-pane.open { display: block; animation: fadeIn .2s ease; }
.info-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 10px; min-height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--panel); z-index: 2;
}
.info-head h3 { font-size: 15.5px; font-weight: 800; }
.info-profile {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 26px 16px 14px; text-align: center;
}
.info-profile h3 { font-size: 17.5px; font-weight: 800; }
.info-actions { display: flex; flex-direction: column; gap: 7px; padding: 10px 14px 18px; }
.info-actions .btn { justify-content: flex-start; }
.members-box { border-top: 1px solid var(--border); padding: 13px 14px calc(20px + env(safe-area-inset-bottom)); }
.members-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.members-head h4 { font-size: 13.5px; font-weight: 800; }
.member-list { display: flex; flex-direction: column; gap: 2px; }
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px; border-radius: var(--radius-xs); font-size: 13.5px;
  transition: background .12s;
}
.member-row:hover { background: var(--panel-2); }
.member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.member-actions { display: flex; gap: 2px; }
.role-chip {
  font-size: 10.5px; font-weight: 800; border-radius: 10px; padding: 2.5px 9px;
  background: var(--primary-soft); color: var(--primary-text);
}
.role-owner { background: var(--warn-soft); color: var(--warn); }

/* ---------------- settings ---------------- */

.settings-wrap { display: flex; gap: 0; min-height: 400px; }
.settings-nav {
  display: flex; flex-direction: column; gap: 3px;
  border-inline-end: 1px solid var(--border); padding: 8px; min-width: 158px; flex: none;
}
.settings-tab {
  display: flex; align-items: center; gap: 9px;
  background: none; border: none; color: var(--text-2);
  padding: 11px 13px; border-radius: var(--radius-xs);
  font-size: 13.5px; font-weight: 700; text-align: right; width: 100%;
  transition: background .13s, color .13s;
}
.settings-tab:hover { background: var(--panel-2); color: var(--text); }
.settings-tab.active { background: var(--primary-soft); color: var(--primary-text); }
.settings-tab.logout { color: var(--danger); margin-top: auto; }
.settings-tab.logout:hover { background: var(--danger-soft); color: var(--danger); }
.settings-content { flex: 1; padding: 18px 20px; overflow-y: auto; max-height: 62dvh; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.settings-title { font-size: 12px; color: var(--text-2); margin: 20px 0 10px; font-weight: 800; letter-spacing: .4px; }
.settings-title:first-child { margin-top: 0; }

.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.avatar-edit { border-radius: 50%; }
.profile-meta { display: flex; flex-direction: column; gap: 4px; }
.profile-meta strong { font-size: 15px; }

.segmented { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; gap: 3px; }
.seg { border: none; background: none; padding: 8px 18px; border-radius: 9px; font-size: 13px; color: var(--text-2); font-weight: 700; transition: background .15s, color .15s; }
.seg.active { background: var(--panel); color: var(--primary-text); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .seg.active { background: var(--panel-3); }

.secret-code {
  display: block; background: var(--panel-2); border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm); padding: 11px; margin: 10px 0;
  font-size: 16px; letter-spacing: 3px; text-align: center; direction: ltr;
  user-select: all; font-weight: 700;
}
.session-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.session-row:last-child { border-bottom: none; }
.session-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.session-info strong { font-size: 13.5px; }
.contact-add { display: flex; gap: 8px; margin-bottom: 14px; }
.contact-add input { flex: 1; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); outline: none; }
.contact-add input:focus { border-color: var(--primary); }
.contacts-box h5 { margin: 13px 0 7px; font-size: 12px; color: var(--text-2); font-weight: 800; letter-spacing: .4px; }

/* ---------------- admin panel ---------------- */

.admin-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chip {
  border: 1.5px solid var(--border); background: var(--panel-2); color: var(--text-2);
  border-radius: 20px; padding: 6px 14px; font-size: 12.5px; font-weight: 700;
  transition: all .15s;
}
.filter-chip:hover { border-color: var(--border-strong); color: var(--text); }
.filter-chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
.filter-chip .fc-count { opacity: .75; font-weight: 600; margin-inline-start: 3px; }

.admin-list { display: flex; flex-direction: column; gap: 6px; }
.admin-row {
  display: flex; align-items: center; gap: 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; background: var(--bg-2);
  transition: border-color .15s, box-shadow .15s;
}
.admin-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.admin-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.admin-name { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.admin-name .icon { color: var(--warn); }
.admin-user { color: var(--text-2); font-size: 12px; direction: ltr; text-align: right; }
.admin-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

.status-chip {
  font-size: 10.5px; font-weight: 800; border-radius: 10px; padding: 2.5px 9px; flex: none;
}
.status-chip.active { background: var(--primary-soft); color: var(--primary-text); }
.status-chip.pending { background: var(--warn-soft); color: var(--warn); }
.status-chip.banned { background: var(--danger-soft); color: var(--danger); }

.act-btn {
  border: 1.5px solid var(--border); background: var(--panel); color: var(--text-2);
  border-radius: var(--radius-xs); padding: 5.5px 12px; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all .14s;
}
.act-btn:hover { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }
.act-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet & below: info pane overlays chat */
@media (max-width: 1279px) {
  .info-pane.open {
    position: absolute; inset-block: 0; inset-inline-end: 0;
    z-index: 60; box-shadow: var(--shadow); width: min(345px, 90vw);
    animation: slideIn .22s ease;
  }
  @keyframes slideIn { from { transform: translateX(-28px); opacity: 0; } }
}

/* Mobile: single pane + bottom sheets */
@media (max-width: 959px) {
  .sidebar { width: 100%; border-inline-end: none; }
  .chat-pane { display: none; }
  .shell[data-pane="chat"] .sidebar { display: none; }
  .shell[data-pane="chat"] .chat-pane { display: flex; }
  .shell[data-pane="chat"] .chat-pane .chat-head { animation: paneIn .22s ease; }
  @keyframes paneIn { from { opacity: .4; } }
  .mobile-only { display: inline-flex; }
  .fab { display: inline-flex; }
  .conv-row.active { background: var(--panel-2); }
  .conv-row.active::before { background: transparent; }
  .bubble { max-width: 86%; }
  .msg-stream { padding: 0 5px; }
  .msg-list { padding-bottom: 4px; }

  /* modals become bottom sheets */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-dialog {
    width: 100%; max-height: 88dvh;
    border-radius: 22px 22px 0 0;
    animation: sheetUp .28s cubic-bezier(.2, .9, .3, 1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-dialog::before {
    content: ''; display: block; width: 40px; height: 4.5px; border-radius: 4px;
    background: var(--border-strong); margin: 9px auto -5px; flex: none;
  }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

  .settings-wrap { flex-direction: column; min-height: 0; }
  .settings-nav {
    flex-direction: row; overflow-x: auto; border-inline-end: none;
    border-bottom: 1px solid var(--border); padding: 6px 8px; flex: none;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-tab { white-space: nowrap; padding: 9px 13px; }
  .settings-tab.logout { margin-top: 0; margin-inline-start: auto; }
  .settings-content { max-height: none; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); }

  .sidebar-head { padding: 8px 10px; }
  .me-name { max-width: 140px; }
  .toasts { bottom: calc(86px + env(safe-area-inset-bottom)); }
}

/* Small phones */
@media (max-width: 380px) {
  :root { --sidebar-w: 100vw; }
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
  .bubble { max-width: 90%; }
}

/* Desktop hover affordances */
@media (hover: hover) {
  .conv-row:active { background: var(--primary-soft); }
}

/* reduced motion — kill all non-essential animation */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Short screens: tighten auth */
@media (max-height: 560px) {
  .auth-brand { display: none; }
  .auth-wrap { justify-content: flex-start; padding-top: 26px; }
  .auth-blob { display: none; }
}
