/* ============================================================
   ARPI — Material 3
   ============================================================ */
:root {
  --primary: #4CAF50;
  --on-primary: #FFFFFF;
  --primary-container: #81C784;
  --on-primary-container: #1B5E20;
  --secondary-container: #A5D6A7;
  --on-secondary-container: #1B5E20;
  --tertiary: #66BB6A;
  --tertiary-container: #C8E6C9;
  --on-tertiary-container: #1B5E20;

  --surface: #0F1B0F;
  --on-surface: #E8F5E9;
  --surface-dim: #0D150D;
  --surface-container-lowest: #0B140B;
  --surface-container-low: #142114;
  --surface-container: #1A2C1A;
  --surface-container-high: #223822;
  --surface-container-highest: #2A442A;
  --on-surface-variant: #81C784;
  --outline: #388E3C;
  --outline-variant: #4CAF50;

  --error: #EF5350;
  --on-error: #FFFFFF;
  --error-container: #E57373;
  --on-error-container: #B71C1C;

  --inverse-surface: #E8F5E9;
  --inverse-on-surface: #1B5E20;

  --shadow-1: 0 1px 2px rgba(0,0,0,.30), 0 1px 3px 1px rgba(0,0,0,.15);
  --shadow-2: 0 1px 2px rgba(0,0,0,.30), 0 2px 6px 2px rgba(0,0,0,.15);
  --shadow-3: 0 4px 8px 3px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.30);

  --ease: cubic-bezier(.2, 0, 0, 1);
  --font-scale: 1;
  --font-app: "Roboto", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --radius-s: 12px;
  --radius-m: 16px;
  --radius-l: 24px;
  --radius-xl: 28px;
}

:root[data-theme="dark"] {
    --primary: #66BB6A;
    --on-primary: #1B5E20;
    --primary-container: #4CAF50;
    --on-primary-container: #E8F5E9;
    --secondary-container: #388E3C;
    --on-secondary-container: #E8F5E9;
    --tertiary: #81C784;
    --tertiary-container: #2E7D32;
    --on-tertiary-container: #E8F5E9;

    --surface: #0B140B;
    --on-surface: #C8E6C9;
    --surface-dim: #091009;
    --surface-container-lowest: #070D07;
    --surface-container-low: #0F190F;
    --surface-container: #142114;
    --surface-container-high: #1A2C1A;
    --surface-container-highest: #223822;
    --on-surface-variant: #66BB6A;
    --outline: #4CAF50;
    --outline-variant: #388E3C;

    --error: #EF5350;
    --on-error: #B71C1C;
    --error-container: #E57373;
    --on-error-container: #1B5E20;

    --inverse-surface: #C8E6C9;
    --inverse-on-surface: #0B140B;

    --shadow-1: 0 1px 3px rgba(0,0,0,.6);
    --shadow-2: 0 2px 6px rgba(0,0,0,.6);
    --shadow-3: 0 6px 14px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-app);
  font-size: calc(15px * var(--font-scale, 1));
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
button, input, textarea { font-family: inherit; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--on-surface-variant); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--outline-variant); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------- вход ---------------------------- */
.auth {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(120% 120% at 0% 0%, var(--primary-container) 0%, transparent 55%),
    radial-gradient(120% 120% at 100% 100%, var(--tertiary-container) 0%, transparent 55%),
    var(--surface);
}
.auth-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.auth-orb-1 { width: 320px; height: 320px; background: var(--primary); top: -80px; right: -60px; animation: float 14s var(--ease) infinite alternate; }
.auth-orb-2 { width: 260px; height: 260px; background: var(--tertiary); bottom: -70px; left: -60px; animation: float 18s var(--ease) infinite alternate-reverse; }
@keyframes float { to { transform: translate3d(30px, 40px, 0) scale(1.12); } }

.auth-card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px;
  border-radius: var(--radius-xl);
  background: var(--surface-container-low);
  box-shadow: var(--shadow-3);
  animation: rise .5s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } }

.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.brand-mark, .rail-logo, .chat-empty-mark {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #7C4DFF 0%, #6750A4 55%, #B388FF 100%);
  box-shadow: var(--shadow-2);
}
.brand-mark { width: 56px; height: 56px; border-radius: 18px; font-size: calc(28px * var(--font-scale, 1)); }
.brand h1 { font-size: calc(26px * var(--font-scale, 1)); letter-spacing: .5px; line-height: 1.1; }
.brand p { color: var(--on-surface-variant); font-size: calc(13px * var(--font-scale, 1)); letter-spacing: 2px; text-transform: uppercase; }

.segmented {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  margin-bottom: 22px;
  border-radius: 24px;
  background: var(--surface-container-high);
}
.seg-indicator {
  position: absolute;
  top: 4px; left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 20px;
  background: var(--secondary-container);
  transition: transform .28s var(--ease);
}
.segmented[data-mode="register"] .seg-indicator { transform: translateX(100%); }
.seg-btn {
  position: relative; z-index: 1;
  height: 40px;
  border: 0; border-radius: 20px;
  background: none;
  color: var(--on-surface-variant);
  font-size: calc(14px * var(--font-scale, 1)); font-weight: 600;
  cursor: pointer;
  transition: color .2s var(--ease);
}
.seg-btn.is-active { color: var(--on-secondary-container); }

.field {
  position: relative;
  display: block;
  margin-bottom: 14px;
  --field-bg: var(--surface-container-low);
}

/* Регистрация по фото — круглый выбор аватарки в стиле Material You */
.photo-pick {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 16px;
  padding: 12px 14px;
  border-radius: 24px;
  background: var(--surface-container-low);
  border: 1px solid color-mix(in srgb, var(--primary) 26%, transparent);
  animation: rise .35s var(--ease) both;
}
.photo-pick[hidden] { display: none; }
.photo-pick-btn {
  position: relative;
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.photo-pick-avatar {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--primary-container);
  color: var(--on-primary-container);
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 40%, transparent);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.photo-pick-avatar .ico { width: 28px; height: 28px; }
.photo-pick-avatar.has-photo .ico { display: none; }
.photo-pick-btn:active .photo-pick-avatar { transform: scale(.94); }
.photo-pick-add {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .28);
}
.photo-pick-add .ico { width: 14px; height: 14px; }
.photo-pick-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: calc(13px * var(--font-scale, 1));
  color: var(--on-surface-variant);
}
.photo-pick-text strong {
  font-size: calc(15px * var(--font-scale, 1));
  color: var(--on-surface);
  font-weight: 600;
}
.photo-pick-clear {
  margin-left: auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  cursor: pointer;
}
.photo-pick-clear[hidden] { display: none; }
.photo-pick-clear .ico { width: 16px; height: 16px; }
.field input {
  width: 100%;
  height: 56px;
  padding: 20px 16px 6px;
  border: 1px solid var(--outline);
  border-radius: 4px;
  background: transparent;
  color: var(--on-surface);
  font-size: calc(16px * var(--font-scale, 1));
  outline: none;
  transition: border-color .15s var(--ease), border-width .15s var(--ease);
}
.field input:focus { border: 2px solid var(--primary); padding: 19px 15px 5px; }
.field > span {
  position: absolute;
  left: 12px; top: 17px;
  padding: 0 4px;
  background: var(--field-bg);
  color: var(--on-surface-variant);
  font-size: calc(16px * var(--font-scale, 1));
  pointer-events: none;
  transition: all .15s var(--ease);
}
.field input:focus + span,
.field input:not(:placeholder-shown) + span { top: 7px; font-size: calc(12px * var(--font-scale, 1)); color: var(--primary); }
.field input:focus + span { color: var(--primary); }
.field-trailing {
  position: absolute;
  right: 6px; top: 8px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
}
.field-trailing .ico { width: 22px; height: 22px; }
.dialog .field { --field-bg: var(--surface-container-high); }

/* ---------------------------- кнопки ---------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 24px;
  border: 0;
  border-radius: 20px;
  font-size: calc(14px * var(--font-scale, 1));
  font-weight: 600;
  letter-spacing: .1px;
  cursor: pointer;
  transition: box-shadow .2s var(--ease), background-color .2s var(--ease), transform .1s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-filled { background: var(--primary); color: var(--on-primary); }
.btn-filled:hover { box-shadow: var(--shadow-1); }
.btn-tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn-text { background: transparent; color: var(--primary); padding: 0 16px; }
.btn-danger { color: var(--error); }
.btn-block { width: 100%; height: 50px; border-radius: 25px; margin-top: 6px; }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.btn .ico { width: 20px; height: 20px; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: background-color .2s var(--ease);
}
.icon-btn:hover { background: var(--surface-container-high); }
.icon-btn .ico { width: 22px; height: 22px; }

.auth-note { margin-top: 16px; font-size: calc(13px * var(--font-scale, 1)); color: var(--on-surface-variant); text-align: center; }

/* ---------------------------- каркас ---------------------------- */
.app {
  display: grid;
  grid-template-columns: 88px 360px 1fr;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  max-width: 100vw;
  overflow: hidden;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 0;
  background: var(--surface-container-low);
  border-right: 1px solid var(--outline-variant);
}
.rail-logo { width: 44px; height: 44px; border-radius: 14px; font-size: calc(22px * var(--font-scale, 1)); margin-bottom: 14px; }
.rail-spacer { flex: 1; }
.rail-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  font-size: calc(11px * var(--font-scale, 1));
  cursor: pointer;
}
.rail-item .ico { width: 26px; height: 26px; padding: 6px; border-radius: 16px; box-sizing: content-box; transition: background-color .22s var(--ease), color .22s var(--ease); }
.rail-item:hover .ico { background: var(--surface-container-high); }
.rail-item.is-active { color: var(--on-secondary-container); }
.rail-item.is-active .ico { background: var(--secondary-container); }
.rail-item.is-active span { font-weight: 700; }

/* ---------------------------- список ---------------------------- */
.list-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--surface-container-low);
  border-right: 1px solid var(--outline-variant);
}
.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 10px;
}
.pane-head h2 { font-size: calc(24px * var(--font-scale, 1)); }
.pane-head p { font-size: calc(13px * var(--font-scale, 1)); color: var(--on-surface-variant); }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  margin: 8px 16px 10px;
  padding: 0 14px;
  border-radius: 24px;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
}
.search .ico { width: 20px; height: 20px; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--on-surface);
  font-size: calc(15px * var(--font-scale, 1));
  outline: none;
}
.search input::placeholder { color: var(--on-surface-variant); }

.list { flex: 1; overflow-y: auto; padding: 4px 10px 100px; }

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color .18s var(--ease);
}
.item:hover { background: var(--surface-container); }
.item.is-active { background: var(--secondary-container); }
.item-body { flex: 1; min-width: 0; }
.item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.item-name { font-weight: 600; font-size: calc(15px * var(--font-scale, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-time { font-size: calc(11px * var(--font-scale, 1)); color: var(--on-surface-variant); flex: none; }
.item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.item-preview { font-size: calc(13px * var(--font-scale, 1)); color: var(--on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.is-unread .item-name { font-weight: 700; }
.item.is-unread .item-preview { color: var(--on-surface); font-weight: 600; }

.badge {
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--primary);
  color: var(--on-primary);
  font-size: calc(11px * var(--font-scale, 1)); font-weight: 700;
  flex: none;
}

.avatar {
  width: 48px; height: 48px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: calc(18px * var(--font-scale, 1));
  background: var(--primary);
  user-select: none;
}
.avatar-sm { width: 30px; height: 30px; font-size: calc(13px * var(--font-scale, 1)); }
.avatar-lg { width: 72px; height: 72px; font-size: calc(28px * var(--font-scale, 1)); }
.avatar-channel { border-radius: 16px; }

.fab {
  position: absolute;
  right: 22px; bottom: 22px;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border: 0; border-radius: 16px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  box-shadow: var(--shadow-3);
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.fab:hover { transform: translateY(-2px); box-shadow: var(--shadow-3), var(--shadow-1); }
.fab:active { transform: scale(.95); }
.fab .ico { width: 26px; height: 26px; stroke-width: 2; }

.empty-list { padding: 32px 18px; text-align: center; color: var(--on-surface-variant); font-size: calc(14px * var(--font-scale, 1)); }

/* ---------------------------- чат ---------------------------- */
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
  color: var(--on-surface-variant);
}
.chat-empty-mark { width: 88px; height: 88px; border-radius: 28px; font-size: calc(44px * var(--font-scale, 1)); margin-bottom: 8px; opacity: .9; }
.chat-empty h2 { font-size: calc(20px * var(--font-scale, 1)); color: var(--on-surface); }
.chat-empty p { font-size: calc(14px * var(--font-scale, 1)); max-width: 340px; }

.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 72px;
  padding: 0 16px;
  border-bottom: 1px solid var(--outline-variant);
  background: var(--surface-container-low);
}
.chat-title { flex: 1; min-width: 0; }
.chat-title h3 { font-size: calc(16px * var(--font-scale, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title p { font-size: calc(12px * var(--font-scale, 1)); color: var(--on-surface-variant); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-actions { display: flex; align-items: center; gap: 4px; }
.chat-actions .btn { height: 36px; padding: 0 16px; font-size: calc(13px * var(--font-scale, 1)); }

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.day-divider { align-self: center; margin: 14px 0 6px; padding: 4px 12px; border-radius: 12px; background: var(--surface-container-high); color: var(--on-surface-variant); font-size: calc(11px * var(--font-scale, 1)); font-weight: 600; }
.msg-row { display: flex; gap: 10px; margin-top: 8px; animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.msg-row.own { justify-content: flex-end; }
.bubble {
  max-width: 100%;
  padding: 9px 14px 7px;
  border-radius: 18px;
  background: var(--surface-container-high);
  color: var(--on-surface);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.msg-row.own .bubble { background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 6px; }
.msg-row:not(.own) .bubble { border-bottom-left-radius: 6px; }
.msg-author { font-size: calc(12px * var(--font-scale, 1)); font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.msg-text { font-size: calc(15px * var(--font-scale, 1)); }
.msg-time { font-size: calc(10.5px * var(--font-scale, 1)); opacity: .68; text-align: right; margin-top: 3px; }
.msg-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: min(620px, 78%);
  align-items: flex-start;
}
.msg-row.own .msg-stack { align-items: flex-end; }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 16px 16px;
  border-top: 1px solid var(--outline-variant);
  background: var(--surface-container-low);
}
.composer-field {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 6px 8px 6px 18px;
  border-radius: 26px;
  background: var(--surface-container-high);
}
.composer-field textarea {
  flex: 1;
  min-height: 36px;
  max-height: 132px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--on-surface);
  font-size: calc(15px * var(--font-scale, 1));
  line-height: 1.4;
  resize: none;
  outline: none;
}
.send-btn {
  width: 50px; height: 50px;
  flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  cursor: pointer;
  transition: transform .15s var(--ease), background-color .2s var(--ease);
}
.send-btn:hover { box-shadow: var(--shadow-2); }
.send-btn:active { transform: scale(.92); }
.send-btn:disabled { background: var(--surface-container-highest); color: var(--on-surface-variant); cursor: default; box-shadow: none; }
.send-btn .ico { width: 22px; height: 22px; }

.composer-locked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--outline-variant);
  background: var(--surface-container-low);
  color: var(--on-surface-variant);
  font-size: calc(14px * var(--font-scale, 1));
}

/* ---------------------------- диалоги ---------------------------- */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }

.dialog-wrap {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.dialog {
  width: min(460px, 100%);
  padding: 26px;
  border-radius: var(--radius-xl);
  background: var(--surface-container-high);
  box-shadow: var(--shadow-3);
  animation: rise .25s var(--ease);
}
.dialog h2 { font-size: calc(22px * var(--font-scale, 1)); }
.dialog-sub { margin: 6px 0 18px; font-size: calc(13px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.row-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  cursor: pointer;
}
.row-switch small { color: var(--on-surface-variant); }
.row-switch input {
  appearance: none;
  width: 52px; height: 32px;
  flex: none;
  border: 2px solid var(--outline);
  border-radius: 16px;
  background: var(--surface-container-highest);
  position: relative;
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.row-switch input::after {
  content: "";
  position: absolute;
  top: 6px; left: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--outline);
  transition: transform .2s var(--ease), background-color .2s var(--ease), width .2s var(--ease), height .2s var(--ease), top .2s var(--ease), left .2s var(--ease);
}
.row-switch input:checked { background: var(--primary); border-color: var(--primary); }
.row-switch input:checked::after { transform: translateX(20px); width: 24px; height: 24px; top: 2px; left: 2px; background: var(--on-primary); }

.user-list { max-height: 320px; overflow-y: auto; margin: 4px -8px 0; }
.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--on-surface);
  text-align: left;
  cursor: pointer;
}
.user-row:hover { background: var(--surface-container-highest); }
.user-row .avatar { width: 40px; height: 40px; font-size: calc(15px * var(--font-scale, 1)); }
.user-row b { display: block; font-size: calc(14px * var(--font-scale, 1)); }
.user-row small { color: var(--on-surface-variant); font-size: calc(12px * var(--font-scale, 1)); }

.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.profile-head h2 { font-size: calc(20px * var(--font-scale, 1)); word-break: break-word; }
.profile-status { font-size: calc(13px * var(--font-scale, 1)); color: var(--on-surface-variant); margin-bottom: 18px; }
.profile-status.ok { color: #2E7D32; }
.profile-actions { display: flex; flex-direction: column; gap: 8px; }
.profile-actions .btn { justify-content: flex-start; }

/* ---------------------------- снекбар ---------------------------- */
.snackbar {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 400;
  max-width: min(480px, calc(100vw - 40px));
  padding: 14px 18px;
  border-radius: 8px;
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  font-size: calc(14px * var(--font-scale, 1));
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.snackbar.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------- адаптив ---------------------------- */
.only-mobile { display: none; }

@media (max-width: 1040px) {
  .app { grid-template-columns: 80px 320px 1fr; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .list-pane { width: 100%; max-width: 100vw; overflow-x: hidden; }
  .rail {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    height: calc(72px + env(safe-area-inset-bottom));
    padding: 6px 6px env(safe-area-inset-bottom);
    border-right: 0;
    border-top: 1px solid var(--outline-variant);
    background: var(--surface-container);
  }
  .rail-logo, .rail-spacer { display: none; }
  .rail-item { width: auto; flex: 1; gap: 2px; padding: 4px 0; }
  .rail-item span { font-size: calc(11px * var(--font-scale, 1)); }
  .rail-item .ico { width: 24px; height: 24px; padding: 4px; }

  .list-pane { grid-column: 1; border-right: 0; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .fab { bottom: calc(88px + env(safe-area-inset-bottom)); }

  .chat-pane {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: var(--surface);
    transform: translateX(100%);
    transition: transform .28s var(--ease);
    visibility: hidden;
  }
  .app.chat-open .chat-pane { transform: none; visibility: visible; }
  .only-mobile { display: grid; }
  .chat-head { padding-left: 6px; }
  .messages { padding: 10px 12px 8px; }
  /* Ограничиваем ширину «стека», а не пузыря: max-width в процентах внутри
     flex-колонки, ширина которой зависит от содержимого, схлопывал пузырь
     до одной буквы в строке (текст «уходил вниз» столбиком). */
  .msg-stack { max-width: 86%; }
  .composer { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .chat-empty { display: none; }
  .send-btn { width: 46px; height: 46px; }
  .dialog { padding: 22px; border-radius: 24px; }
}

@media (max-width: 420px) {
  .pane-head { padding: 18px 16px 8px; }
  .pane-head h2 { font-size: calc(22px * var(--font-scale, 1)); }
  .chat-actions .btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------------------- ripple ---------------------------- */
.ripple-host { position: relative; overflow: hidden; }
/* ФИКС сжатия строк после клика: ripple добавляет .ripple-host (overflow: hidden),
   из-за чего флекс-строка теряет автоматический min-height и схлопывалась
   до 26px (аватар сплющивался в эллипс). Строки списка и диалога
   больше не сжимаются — они переполняются и скроллятся. */
.item, .user-row { flex-shrink: 0; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: .18;
  transform: scale(0);
  pointer-events: none;
  animation: ripple-expand .62s var(--ease) forwards;
}
@keyframes ripple-expand {
  to { transform: scale(1); opacity: 0; }
}

/* ============================================================
   Аватарки, реакции, настройки, стекло
   ============================================================ */
.avatar { overflow: hidden; }
.avatar .avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.msg-row { align-items: flex-end; }
.msg-avatar { width: 32px; height: 32px; font-size: calc(12px * var(--font-scale, 1)); flex: none; }
.msg-stack { min-width: 0; }
.msg-tools { display: flex; align-items: center; gap: 4px; margin-top: 3px; min-height: 22px; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; }
.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 13px;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  font-size: calc(12px * var(--font-scale, 1));
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s var(--ease), background-color .15s var(--ease);
}
.reaction-chip:hover { transform: translateY(-1px); }
.reaction-chip.is-mine { background: var(--primary-container); color: var(--on-primary-container); }
.reaction-chip .emoji { font-size: calc(14px * var(--font-scale, 1)); line-height: 1; }
.react-add {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s var(--ease), background-color .15s var(--ease);
}
.react-add .ico { width: 15px; height: 15px; }
.msg-row:hover .react-add,
.react-add:focus-visible { opacity: 1; }
@media (hover: none) { .react-add { opacity: .6; } }

.emoji-picker {
  position: fixed;
  z-index: 320;
  display: grid;
  grid-template-columns: repeat(5, 40px);
  gap: 4px;
  padding: 10px;
  border-radius: 22px;
  background: var(--surface-container-high);
  box-shadow: var(--shadow-3);
  animation: rise .16s var(--ease);
}
.emoji-picker button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  font-size: calc(22px * var(--font-scale, 1));
  line-height: 1;
  cursor: pointer;
}
.emoji-picker button:hover { background: var(--surface-container-highest); transform: scale(1.08); }

/* ---------------------------- настройки ---------------------------- */
.dialog-settings { max-height: min(88vh, 780px); overflow-y: auto; }
.settings-section { padding: 16px 0; border-top: 1px solid var(--outline-variant); }
.settings-section:first-of-type { border-top: 0; padding-top: 2px; }
.settings-section h3 { font-size: calc(13px * var(--font-scale, 1)); font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--primary); margin-bottom: 12px; }
.avatar-editor { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avatar-editor .avatar { width: 76px; height: 76px; font-size: calc(28px * var(--font-scale, 1)); }
.avatar-editor-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.avatar-editor-actions .btn { height: 36px; padding: 0 16px; font-size: calc(13px * var(--font-scale, 1)); }
.avatar-editor-actions small { color: var(--on-surface-variant); font-size: calc(11.5px * var(--font-scale, 1)); line-height: 1.35; }
.theme-switch { display: flex; gap: 4px; padding: 4px; border-radius: 20px; background: var(--surface-container-highest); }
.theme-switch button {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--on-surface-variant);
  font-size: calc(12.5px * var(--font-scale, 1));
  font-weight: 600;
  cursor: pointer;
}
.theme-switch button.is-active { background: var(--primary); color: var(--on-primary); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 0; }
.setting-row b { display: block; font-size: calc(14px * var(--font-scale, 1)); }
.setting-row small { color: var(--on-surface-variant); font-size: calc(12px * var(--font-scale, 1)); }
.download-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 18px;
  background: var(--surface-container-highest);
  color: var(--on-surface);
  text-decoration: none;
  transition: background-color .18s var(--ease), transform .12s var(--ease);
}
.download-row:hover { background: var(--surface-container-high); transform: translateY(-1px); }
.download-row:last-child { margin-bottom: 0; }
.download-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--primary-container); color: var(--on-primary-container); flex: none; }
.download-icon .ico { width: 21px; height: 21px; }
.download-row b { display: block; font-size: calc(14px * var(--font-scale, 1)); }
.download-row small { color: var(--on-surface-variant); font-size: calc(12px * var(--font-scale, 1)); }
.download-row .download-arrow { margin-left: auto; color: var(--primary); font-size: calc(20px * var(--font-scale, 1)); }

.auth-downloads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.auth-downloads .btn { height: 46px; padding: 0 12px; font-size: calc(13px * var(--font-scale, 1)); }
.auth-downloads .ico { width: 18px; height: 18px; }
.auth-fineprint { margin-top: 10px; text-align: center; font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); line-height: 1.4; }

@media (max-width: 520px) {
  .auth-downloads { grid-template-columns: 1fr; }
  .setting-row { flex-direction: column; align-items: flex-start; }
  .avatar-editor { align-items: flex-start; }
}

/* ---------------------------- прозрачное стекло ---------------------------- */
body.glass {
  --glass-bg: rgba(255, 255, 255, .42);
  --glass-bg-strong: rgba(255, 255, 255, .66);
  --glass-bg-soft: rgba(255, 255, 255, .26);
  --glass-bubble: rgba(255, 255, 255, .72);
  --glass-border: rgba(255, 255, 255, .55);
  background:
    radial-gradient(52% 58% at 8% 2%, rgba(177, 140, 255, .80) 0%, transparent 62%),
    radial-gradient(48% 56% at 96% 12%, rgba(255, 178, 214, .78) 0%, transparent 60%),
    radial-gradient(64% 64% at 62% 106%, rgba(143, 216, 255, .80) 0%, transparent 64%),
    linear-gradient(135deg, #f4edff 0%, #fdf8ff 48%, #eaf3ff 100%);
  background-attachment: fixed;
}
:root[data-theme="dark"] body.glass {
  --glass-bg: rgba(24, 21, 32, .46);
  --glass-bg-strong: rgba(38, 34, 48, .72);
  --glass-bg-soft: rgba(16, 14, 22, .28);
  --glass-bubble: rgba(48, 45, 58, .76);
  --glass-border: rgba(255, 255, 255, .12);
  background:
    radial-gradient(54% 60% at 4% 0%, rgba(91, 53, 168, .82) 0%, transparent 62%),
    radial-gradient(50% 58% at 100% 8%, rgba(150, 45, 101, .72) 0%, transparent 60%),
    radial-gradient(64% 64% at 56% 108%, rgba(18, 95, 133, .78) 0%, transparent 64%),
    linear-gradient(135deg, #0f0c16 0%, #17121f 50%, #0b1420 100%);
  background-attachment: fixed;
}
body.glass .rail,
body.glass .list-pane,
body.glass .chat-pane,
body.glass .chat-head,
body.glass .composer,
body.glass .composer-locked,
body.glass .auth-card,
body.glass .dialog {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  backdrop-filter: blur(26px) saturate(165%);
  border-color: var(--glass-border);
}
body.glass .chat-head,
body.glass .composer,
body.glass .composer-locked { background: var(--glass-bg-strong); }
body.glass .rail { background: var(--glass-bg-soft); }
body.glass .auth { background: transparent; }
body.glass .auth-orb { opacity: .7; }
body.glass .search,
body.glass .composer-field,
body.glass .reaction-chip,
body.glass .react-add,
body.glass .download-row,
body.glass .theme-switch,
body.glass .row-switch input {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
body.glass .download-row:hover,
body.glass .item:hover,
body.glass .icon-btn:hover { background: rgba(255, 255, 255, .55); }
:root[data-theme="dark"] body.glass .download-row:hover,
:root[data-theme="dark"] body.glass .item:hover,
:root[data-theme="dark"] body.glass .icon-btn:hover { background: rgba(255, 255, 255, .08); }
body.glass .item.is-active { background: var(--glass-bg-strong); }
body.glass .bubble { background: var(--glass-bubble); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
body.glass .msg-row.own .bubble { background: var(--primary); }
body.glass .reaction-chip.is-mine { background: var(--primary-container); }
body.glass .field { --field-bg: var(--glass-bg-strong); }
body.glass .auth-card,
body.glass .dialog {
  box-shadow: 0 24px 70px rgba(31, 16, 61, .28), inset 0 1px 0 rgba(255, 255, 255, .45);
}
body.glass .emoji-picker {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
}
@media (max-width: 860px) {
  body.glass .chat-pane { background: var(--glass-bg-soft); }
}

/* ---------------------------- вид интерфейса ---------------------------- */
.mode-switch { display: flex; gap: 4px; padding: 4px; border-radius: 20px; background: var(--surface-container-highest); }
.mode-btn {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--on-surface-variant);
  font-size: calc(12.5px * var(--font-scale, 1));
  font-weight: 600;
  cursor: pointer;
}
.mode-btn:hover { background: var(--surface-container-high); }
.mode-btn.is-active { background: var(--primary); color: var(--on-primary); }

/* Галочка анимаций — отключает риппл и плавность */
body:not(.animations) .ripple { display: none !important; }
body:not(.animations) * { transition: none !important; animation: none !important; }

/* Вид без выделений */
body[data-display-mode="none"] .item.is-active,
body[data-display-mode="none"] .msg-row.is-active,
body[data-display-mode="none"] .theme-switch button.is-active,
body[data-display-mode="none"] .mode-btn.is-active {
  background: transparent !important;
  color: inherit !important;
}
body[data-display-mode="none"] .badge { display: none !important; }
body[data-display-mode="none"] .item.is-unread { font-weight: 600; }

/* Вид современный */
body[data-display-mode="modern"] .rail-item,
body[data-display-mode="modern"] .item {
  border-radius: 12px;
}
body[data-display-mode="modern"] .item.is-active { background: var(--primary-container); color: var(--on-primary-container); }
body[data-display-mode="modern"] .bubble { border-radius: 12px 12px 12px 2px; }
body[data-display-mode="modern"] .msg-row.own .bubble { border-radius: 12px 12px 2px 12px; }
body[data-display-mode="modern"] .reaction-chip { border-radius: 10px; height: 24px; font-size: calc(11.5px * var(--font-scale, 1)); }
body[data-display-mode="modern"] .chat-head { border-bottom: 1px solid var(--outline-variant); }

/* Вид классический */
body[data-display-mode="classic"] .list-pane { width: 100%; }
body[data-display-mode="classic"] .item { border-radius: 0; border-bottom: 1px solid var(--outline-variant); padding: 14px 0; }
body[data-display-mode="classic"] .item.is-active { background: var(--surface-container); }
body[data-display-mode="classic"] .chat-pane { position: relative; }
body[data-display-mode="classic"] .bubble { border-radius: 16px; margin: 8px 0; }
body[data-display-mode="classic"] .msg-stack { max-width: 70%; }
body[data-display-mode="classic"] .msg-row.own .bubble { margin-left: auto; }
body[data-display-mode="classic"] .msg-row:not(.own) .bubble { margin-right: auto; }
body[data-display-mode="classic"] .composer { border-top: 1px solid var(--outline-variant); }

/* Список пользователей */
.user-list { display: flex; flex-direction: column; gap: 6px; min-height: 200px; }
/* ARPI 2.0: у строк с ripple стоит overflow: hidden, из-за этого во flex-
   колонке они сжимались в тонкие полоски (баг «пользователь уменьшается»).
   Запрещаем сжатие — список просто прокручивается. */
.user-list > * { flex: 0 0 auto; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 0; border-radius: 14px; background: transparent; color: inherit; cursor: pointer; text-align: left; width: 100%; }
.user-row:hover { background: var(--surface-container-high); }
.user-row .avatar { width: 44px; height: 44px; font-size: calc(18px * var(--font-scale, 1)); flex: none; }
.user-row b { display: block; font-size: calc(14px * var(--font-scale, 1)); }
.user-row small { color: var(--on-surface-variant); font-size: calc(12.5px * var(--font-scale, 1)); }

/* ============================================================
   НОВОЕ: снег на логотипе, вложения, медиатека, композер постов,
   скачивание, переходы кнопок
   ============================================================ */

/* ---------------- снегопад на иконке дома ---------------- */
.rail-logo.home-mark {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--primary), var(--primary-container));
}
.rail-logo.home-mark .ico { position: relative; z-index: 2; }
.snow-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.snow-layer i {
  position: absolute;
  top: -6px;
  left: var(--sx, 50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 0 4px rgba(255, 255, 255, .8);
  opacity: 0;
  animation: snowfall var(--du, 2.6s) linear infinite;
  animation-delay: var(--sd, 0s);
}
@keyframes snowfall {
  0%   { transform: translateY(-6px) translateX(0); opacity: 0; }
  10%  { opacity: .95; }
  50%  { transform: translateY(24px) translateX(4px); }
  90%  { opacity: .9; }
  100% { transform: translateY(50px) translateX(-3px); opacity: 0; }
}

/* ---------------- композер постов владельца ---------------- */
.post-creator {
  margin: 10px 14px 0;
  padding: 12px 14px;
  border-radius: var(--radius-lg, 18px);
  background: var(--surface-container-high);
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-1);
}
.post-creator-field textarea {
  width: 100%;
  border: 0;
  background: transparent;
  resize: none;
  color: var(--on-surface);
  font: inherit;
  font-size: calc(14.5px * var(--font-scale, 1));
  outline: none;
  min-height: 44px;
}
.post-creator-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.post-creator-actions .spacer { flex: 1; }
.post-image-name { font-size: calc(12.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }

/* ---------------- посты на главной ---------------- */
.msg-image {
  display: block;
  max-width: min(420px, 100%);
  border-radius: 12px;
  margin: 4px 0;
  cursor: zoom-in;
}
.msg-voice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 210px;
  padding: 6px 0;
}
.msg-voice-name { font-size: calc(12.5px * var(--font-scale, 1)); opacity: .8; }
.msg-voice audio { width: 220px; height: 34px; }
.msg-file {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 190px;
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--surface-container-highest);
  color: var(--on-surface);
  text-decoration: none;
  font-size: calc(13.5px * var(--font-scale, 1));
  margin: 4px 0;
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.msg-file:hover { background: var(--primary-container); color: var(--on-primary-container); transform: translateY(-1px); }
.msg-file .ico { width: 20px; height: 20px; flex: none; }
.msg-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.msg-file-size { font-size: calc(11px * var(--font-scale, 1)); opacity: .65; margin-left: auto; flex: none; }

.attach-chip {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(100% - 6px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-radius: 14px;
  background: var(--surface-container-highest);
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-2);
  font-size: calc(13px * var(--font-scale, 1));
  z-index: 5;
}
.attach-chip span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-remove .ico { width: 16px; height: 16px; }
.composer { position: relative; }

.voice-rec {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(100% - 6px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--error-container, #fde7e9);
  color: var(--on-surface);
  box-shadow: var(--shadow-2);
  font-size: calc(13.5px * var(--font-scale, 1));
  z-index: 5;
}
.voice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d33;
  animation: voice-pulse 1s ease-in-out infinite;
}
@keyframes voice-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .55; } }
#btn-voice.recording {
  background: #d33;
  color: #fff;
  animation: voice-pulse 1s ease-in-out infinite;
}

/* ---------------- медиатека ---------------- */
.media-card {
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  animation: view-in .25s var(--ease) both;
}
.media-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.media-author { font-weight: 600; font-size: calc(14px * var(--font-scale, 1)); }
.media-meta { font-size: calc(12px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.media-body { font-size: calc(14px * var(--font-scale, 1)); }
.media-text { margin-bottom: 6px; }

/* ---------------- скачивание сборок ---------------- */
.download-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0; }
.auth-downloads { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.auth-downloads .btn { font-size: calc(13px * var(--font-scale, 1)); }

/* ---------------- переходы кнопок (крутые анимации) ---------------- */
.btn, .seg-btn, .mode-btn {
  transition: transform .18s cubic-bezier(.2, .8, .2, 1.2),
              box-shadow .2s var(--ease),
              background-color .2s var(--ease),
              color .2s var(--ease),
              border-radius .2s var(--ease);
  will-change: transform;
}
body.animations .btn:not(:disabled):hover { transform: translateY(-1.5px); box-shadow: var(--shadow-2); }
body.animations .btn:not(:disabled):active { transform: scale(.94); box-shadow: none; }
body.animations .icon-btn, body.animations .rail-item, body.animations .fab, body.animations .send-btn,
body.animations .user-row, body.animations .item, body.animations .seg-btn {
  transition: transform .18s cubic-bezier(.2, .8, .2, 1.2), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
body.animations .icon-btn:active, body.animations .rail-item:active, body.animations .fab:active,
body.animations .seg-btn:active { transform: scale(.92); }
/* ARPI 2.0: строку пользователя при нажатии больше не «сжимаем» — аватар
   и текст остаются того же размера, меняется только фон. */
body.animations .user-row { transform: none !important; }
body.animations .rail-item span { transition: letter-spacing .2s var(--ease); }
body.animations .rail-item:hover span { letter-spacing: .4px; }
body.animations .fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: var(--shadow-3); }

@keyframes view-in {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
body.animations .item, body.animations .media-card, body.animations .post {
  animation: view-in .22s var(--ease) both;
}
body.animations #list > *:nth-child(2) { animation-delay: .03s; }
body.animations #list > *:nth-child(3) { animation-delay: .06s; }
body.animations #list > *:nth-child(4) { animation-delay: .09s; }
body.animations #list > *:nth-child(5) { animation-delay: .12s; }
body.animations .msg-row { animation: msg-in .24s var(--ease) both; }

/* кнопка публикации */
#post-send:disabled { opacity: .6; }

/* ---------------- фиксы для телефонов (поиск и клавиатура) ---------------- */
@media (max-width: 720px) {
  /* iOS увеличивает зум при фокусе, если размер шрифта меньше 16px */
  .search input,
  .composer textarea,
  .field input,
  .dialog input,
  .field textarea {
    font-size: calc(16px * var(--font-scale, 1));
  }
  /* поиск не прячется под клавиатурой: панель скроллится целиком */
  .list-pane, .chat-pane { height: auto; min-height: 100%; }
  .attach-chip, .voice-rec { bottom: calc(100% + 4px); }
  .msg-file-name { max-width: 130px; }
}

/* ============================================================
   Обновление вида: аккуратные иконки, текст, сеть
   ============================================================ */

/* --- тексты: сохраняем переносы и не ломаем вёрстку --- */
.msg-text, .post-text, .media-text, .post-bio, .bubble {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.item-preview, .post-username, .chat-sub, .media-author, .post-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-text:empty, .msg-text:empty { display: none; }

/* --- поле нового поста --- */
.post-input {
  width: 100%;
  min-height: 52px;
  max-height: 180px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  font-size: calc(14.5px * var(--font-scale, 1));
  line-height: 1.45;
  resize: none;
  outline: none;
}
.post-input::placeholder { color: var(--on-surface-variant); opacity: .8; }
.post-creator:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

/* --- блок «Доступ из интернета» --- */
.net-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
}
.net-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: calc(13.5px * var(--font-scale, 1)); }
.net-line span { color: var(--on-surface-variant); }
.net-line b { font-weight: 600; overflow-wrap: anywhere; text-align: right; }
.net-box small { font-size: calc(12px * var(--font-scale, 1)); line-height: 1.4; }

/* --- освежение rail и навигации --- */
.rail-item {
  position: relative;
  border-radius: 16px;
  transition: background-color .2s var(--ease), transform .18s var(--ease);
}
.rail-item.is-active { background: color-mix(in srgb, var(--secondary-container) 60%, transparent); }
.rail-item.is-active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  width: 3px;
  height: 22px;
  margin-top: -11px;
  border-radius: 3px;
  background: var(--primary);
  animation: rail-pop .25s var(--ease);
}
@keyframes rail-pop { from { transform: scaleY(.2); opacity: 0; } }

/* --- карточки и сообщения: мягкая глубина --- */
.item { transition: background-color .18s var(--ease), transform .18s var(--ease); }
.item:hover { background: var(--surface-container-high); }
@media (hover: hover) {
  .item:hover { transform: translateX(2px); }
}
.bubble { box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.msg-row { scroll-margin-bottom: 20px; }

/* --- поиск: заметный фокус и никакого «прыжка» на телефоне --- */
.search { transition: box-shadow .2s var(--ease), border-color .2s var(--ease); }
.search:focus-within {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
  border-color: var(--primary);
}
.search input { min-width: 0; }

/* --- экран без чата --- */
.chat-empty-mark {
  background: linear-gradient(145deg, var(--primary), #7c4dff);
  box-shadow: 0 18px 50px color-mix(in srgb, var(--primary) 35%, transparent);
  animation: mark-float 5s ease-in-out infinite;
}
@keyframes mark-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* --- логотип-домик: буква A видна и снег идёт --- */
.rail-logo.home-mark { background: linear-gradient(155deg, #7c4dff, #4e2bd6); color: #fff; }
.rail-logo.home-mark .ico { width: 26px; height: 26px; stroke-width: 2; }

/* --- единый размер иконок в rail --- */
.rail-item .ico { width: 24px; height: 24px; padding: 5px; }
.rail-logo.home-mark .snow-layer i { will-change: transform, opacity; }

/* ============================================================
   Стикеры
   ============================================================ */
.sticker-panel {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(100% - 4px);
  z-index: 12;
  display: flex;
  flex-direction: column;
  max-height: min(360px, 62vh);
  border-radius: 18px;
  background: var(--surface-container-high);
  border: 1px solid var(--outline-variant);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
  overflow: hidden;
  animation: sticker-panel-in .2s var(--ease);
}
.sticker-panel[hidden] { display: none; }
@keyframes sticker-panel-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
}
.sticker-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--outline-variant);
  background: color-mix(in srgb, var(--surface-container-highest) 70%, transparent);
}
.sticker-tabs::-webkit-scrollbar { display: none; }
.sticker-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--on-surface-variant);
  font: inherit;
  font-size: calc(12.5px * var(--font-scale, 1));
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.sticker-tab:hover { background: var(--surface-container-highest); transform: translateY(-1px); }
.sticker-tab.is-active {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-weight: 600;
}
.sticker-tab-icon { font-size: calc(16px * var(--font-scale, 1)); line-height: 1; }
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 2px;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sticker-item {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: calc(30px * var(--font-scale, 1));
  line-height: 1;
  cursor: pointer;
  transition: transform .16s var(--ease), background-color .16s var(--ease);
}
.sticker-item:hover { background: var(--surface-container-highest); transform: scale(1.18) translateY(-2px); }
.sticker-item:active { transform: scale(.94); }
#btn-sticker.is-open { background: var(--secondary-container); color: var(--on-secondary-container); }

/* стикер в сообщении */
.bubble.is-sticker {
  padding: 2px 0 0;
  background: transparent !important;
  box-shadow: none;
  color: var(--on-surface);
}
.msg-sticker {
  font-size: calc(68px * var(--font-scale, 1));
  line-height: 1.05;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .18));
  animation: sticker-pop .42s cubic-bezier(.2, 1.5, .4, 1);
  transform-origin: 50% 80%;
  user-select: none;
}
@keyframes sticker-pop {
  0% { opacity: 0; transform: scale(.4) rotate(-12deg); }
  60% { opacity: 1; transform: scale(1.12) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}
.msg-row.own .bubble.is-sticker .msg-time { color: var(--on-surface-variant); }

/* ============================================================
   Анимация записи голосового
   ============================================================ */
.composer.mic-requesting #btn-voice {
  animation: mic-breathe .9s ease-in-out infinite;
}
@keyframes mic-breathe {
  0%, 100% { transform: scale(1); color: var(--primary); }
  50% { transform: scale(1.12); color: #d33; }
}
.composer.is-recording {
  border-top-color: color-mix(in srgb, #d33 45%, var(--outline-variant));
  background: color-mix(in srgb, #d33 7%, var(--surface-container-low));
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.composer.is-recording .composer-field {
  opacity: .55;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}
#btn-voice.recording {
  background: #d33;
  color: #fff;
  animation: mic-pulse-ring 1.5s ease-out infinite;
}
@keyframes mic-pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(221, 51, 51, .55); transform: scale(1); }
  55% { transform: scale(1.06); }
  100% { box-shadow: 0 0 0 13px rgba(221, 51, 51, 0); transform: scale(1); }
}
.voice-rec {
  animation: voice-rec-in .25s var(--ease);
}
@keyframes voice-rec-in {
  from { opacity: 0; transform: translateY(8px); }
}
.voice-dot {
  box-shadow: 0 0 0 0 rgba(211, 51, 51, .45);
  animation: voice-pulse 1s ease-in-out infinite, voice-dot-ring 1.4s ease-out infinite;
}
@keyframes voice-dot-ring {
  0% { box-shadow: 0 0 0 0 rgba(211, 51, 51, .45); }
  100% { box-shadow: 0 0 0 10px rgba(211, 51, 51, 0); }
}
.voice-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  margin: 0 2px;
}
.voice-wave i {
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: #d33;
  animation: voice-bar .9s ease-in-out infinite;
}
.voice-wave i:nth-child(2) { animation-delay: .1s; }
.voice-wave i:nth-child(3) { animation-delay: .2s; }
.voice-wave i:nth-child(4) { animation-delay: .3s; }
.voice-wave i:nth-child(5) { animation-delay: .4s; }
.voice-wave i:nth-child(6) { animation-delay: .5s; }
.voice-wave i:nth-child(7) { animation-delay: .6s; }
@keyframes voice-bar {
  0%, 100% { height: 5px; opacity: .5; }
  50% { height: 18px; opacity: 1; }
}

@media (max-width: 640px) {
  .sticker-panel { left: 8px; right: 8px; max-height: 48vh; border-radius: 16px; }
  .sticker-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
  .sticker-item { font-size: calc(27px * var(--font-scale, 1)); }
  .msg-sticker { font-size: calc(58px * var(--font-scale, 1)); }
  .sticker-tab-name { display: none; }
  .sticker-tab { padding: 6px 10px; }
  .sticker-tab-icon { font-size: calc(18px * var(--font-scale, 1)); }
}

/* --- статус публичной ссылки --- */
.net-line-main {
  padding: 8px 10px;
  margin: -2px -4px 2px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.net-line-main b {
  color: var(--primary);
  font-weight: 700;
  word-break: break-all;
}
.net-box[data-state="online"] .net-line-main {
  background: color-mix(in srgb, #1a9e4b 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #1a9e4b 35%, transparent);
}
.net-box[data-state="online"] .net-line-main b { color: #16803c; }
.net-box[data-state="online"] .net-line-main span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: #1a9e4b;
  box-shadow: 0 0 0 3px rgba(26, 158, 75, .18);
  animation: net-dot 2s ease-in-out infinite;
}
@keyframes net-dot { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.net-box[data-state="starting"] .net-line-main b,
.net-box[data-state="retrying"] .net-line-main b { opacity: .75; }

@media (max-width: 640px) {
  .composer { gap: 6px; }
  .composer-ico { width: 38px; height: 38px; }
  .composer-ico .ico { width: 21px; height: 21px; }
  .send-btn { width: 44px; height: 44px; }
  .voice-rec { left: 8px; right: 8px; padding: 9px 12px; }
}
.bubble.is-sticker { padding: 4px 0 0; }
.bubble.is-sticker .msg-time { margin-top: 4px; margin-right: 4px; }

/* ============================================================
   Печеньковые аватарки, галочки, закрытые группы (Material 3)
   ============================================================ */
.avatar { position: relative; background: transparent; overflow: visible; }
.avatar-shape {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: inherit;
  background: var(--primary);
  user-select: none;
}
.avatar-cookie { background: transparent; border-radius: 0; overflow: visible; }
.avatar-cookie .avatar-shape {
  border-radius: 50%;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .22));
}
.avatar-channel { border-radius: 16px; }
.avatar-channel .avatar-shape { border-radius: 16px; background: var(--primary-container); color: var(--on-primary-container); }
.avatar-shape .avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* круглые аватарки с рамками (Discord Decorations) */
.frame-neon .avatar-shape, .frame-neon .frame-dot-shape {
  box-shadow: 0 0 0 2.5px #7af6ff, 0 0 16px 3px rgba(90, 220, 255, .85), inset 0 0 10px rgba(160, 120, 255, .55);
}
.frame-gold .avatar-shape, .frame-gold .frame-dot-shape {
  box-shadow: 0 0 0 3px #ffd76a, 0 0 16px 3px rgba(255, 205, 80, .75), inset 0 0 10px rgba(255, 235, 170, .5);
}
.frame-fire .avatar-shape, .frame-fire .frame-dot-shape {
  box-shadow: 0 0 0 3px #ff8a3d, 0 0 20px 5px rgba(255, 90, 30, .78), inset 0 0 12px rgba(255, 160, 60, .6);
}
.frame-orbit .avatar-shape, .frame-orbit .frame-dot-shape {
  box-shadow: 0 0 0 3px #b48cff, 0 0 18px 4px rgba(150, 90, 255, .75), inset 0 0 10px rgba(210, 180, 255, .5);
}
.frame-mint .avatar-shape, .frame-mint .frame-dot-shape {
  box-shadow: 0 0 0 3px #6ff0c0, 0 0 16px 4px rgba(80, 230, 180, .7), inset 0 0 10px rgba(190, 255, 230, .55);
}
.frame-violet .avatar-shape, .frame-violet .frame-dot-shape {
  box-shadow: 0 0 0 3px #c08cff, 0 0 18px 4px rgba(170, 100, 255, .78), inset 0 0 10px rgba(230, 200, 255, .5);
}
.frame-ice .avatar-shape, .frame-ice .frame-dot-shape {
  box-shadow: 0 0 0 3px #9fd8ff, 0 0 16px 4px rgba(140, 210, 255, .78), inset 0 0 10px rgba(225, 245, 255, .6);
}
.frame-rainbow .avatar-shape, .frame-rainbow .frame-dot-shape {
  box-shadow: 0 0 0 2px #ff7ad9, 0 0 0 5px #8b7aff, 0 0 18px 6px rgba(255, 120, 210, .55);
}
.frame-rose .avatar-shape, .frame-rose .frame-dot-shape {
  box-shadow: 0 0 0 3px #ff9ec4, 0 0 18px 4px rgba(255, 150, 195, .8), inset 0 0 10px rgba(255, 215, 230, .6);
}

/* галочка подтверждения / владельца */
.name-wrap { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.name-wrap .name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verified-badge {
  width: 17px;
  height: 17px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 16%, transparent);
}
.verified-badge .ico { width: 14px; height: 14px; stroke-width: 1.7; }
.verified-badge.is-owner {
  color: #B8860B;
  background: color-mix(in srgb, #F2C94C 24%, transparent);
}
:root[data-theme="dark"] .verified-badge.is-owner { color: #F2C94C; }
.post-name .name-wrap, .item-name .name-wrap, .msg-author .name-wrap { max-width: 100%; }
.chat-title h3 .name-wrap { max-width: 100%; }

/* кнопки в шапке списка */
.pane-head-actions { display: flex; align-items: center; gap: 2px; }
.pane-head-actions .icon-btn { width: 42px; height: 42px; }

/* выбор людей в диалогах групп */
.pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 2px;
  font-size: calc(13px * var(--font-scale, 1));
}
.pick-head b { font-size: calc(13px * var(--font-scale, 1)); font-weight: 700; }
.pick-count { color: var(--on-surface-variant); font-size: calc(12px * var(--font-scale, 1)); }
.user-list { max-height: min(46vh, 340px); }
.user-row-body { flex: 1; min-width: 0; }
.user-row-name { font-size: calc(14px * var(--font-scale, 1)); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row-body small { display: block; color: var(--on-surface-variant); font-size: calc(12px * var(--font-scale, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row-check {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  font-size: calc(16px * var(--font-scale, 1));
  font-weight: 700;
}
.user-row.is-selected { background: var(--secondary-container); }
.user-row.is-selected .user-row-check { background: var(--primary); color: var(--on-primary); }

/* участники группы */
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 150px; overflow-y: auto; margin-top: 4px; }
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 14px;
  background: var(--surface-container-high);
  font-size: calc(13px * var(--font-scale, 1));
  font-weight: 600;
}
.member-owner {
  padding: 1px 7px;
  border-radius: 8px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-size: calc(10px * var(--font-scale, 1));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.member-remove {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--on-surface-variant);
  font-size: calc(16px * var(--font-scale, 1));
  line-height: 1;
  cursor: pointer;
}
.member-remove:hover { background: var(--error-container); color: var(--on-error-container); }

/* карточки списка как на референсе */
.list .item {
  margin: 3px 2px;
  padding: 10px 12px;
  border-radius: 22px;
}
.list .item:hover { background: var(--surface-container); }
.list .item.is-active { background: var(--secondary-container); }
.list .item .avatar { width: 52px; height: 52px; }
.item-group .item-name { letter-spacing: .01em; }

@media (max-width: 860px) {
  .list .item { border-radius: 24px; padding: 9px 10px; }
  .list .item .avatar { width: 54px; height: 54px; }
  .member-chips { max-height: 120px; }
  .user-list { max-height: 38vh; }
}

/* ============================================================
   Вид как на референсе: крупные карточки, печеньки, нижняя навигация
   ============================================================ */
:root[data-theme="dark"] {
  --surface: #0B140B;
  --surface-container-lowest: #070D07;
  --surface-container-low: #0F190F;
  --surface-container: #142114;
  --surface-container-high: #1A2C1A;
  --surface-container-highest: #223822;
  --outline-variant: #388E3C;
  --on-surface: #C8E6C9;
  --on-surface-variant: #81C784;
}

.list-pane {
  background: var(--surface-container-lowest);
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.pane-head h2 { font-size: calc(26px * var(--font-scale, 1)); letter-spacing: -.02em; }
.pane-head p { font-size: calc(13.5px * var(--font-scale, 1)); }

.list { display: flex; flex-direction: column; gap: 8px; padding: 2px 12px 110px; }
.list .item {
  margin: 0;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--surface-container);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
  transition: background-color .18s var(--ease), transform .18s var(--ease);
}
.list .item:hover { background: var(--surface-container-high); transform: translateY(-1px); }
.list .item.is-active { background: #3b3253; }
.list .item .avatar { width: 56px; height: 56px; font-size: calc(20px * var(--font-scale, 1)); }
.item-name { font-size: calc(17px * var(--font-scale, 1)); font-weight: 700; }
.item-preview { font-size: calc(13.5px * var(--font-scale, 1)); color: #a5a4ad; }
.item-time { font-size: calc(11.5px * var(--font-scale, 1)); color: #8e8d96; }

.item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  flex: none;
  min-width: 40px;
}
.item-action {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
  color: #f4f3f7;
  cursor: pointer;
  transition: background-color .16s var(--ease), transform .16s var(--ease);
}
.item-action:hover { background: rgba(255, 255, 255, .13); }
.item-action:active { transform: scale(.92); }
.item-action .ico { width: 22px; height: 22px; stroke-width: 1.7; }
.item-count {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, .08);
  color: #d6d5dd;
  font-size: calc(12px * var(--font-scale, 1));
  font-weight: 700;
}
.list .badge {
  min-width: 26px;
  height: 26px;
  border-radius: 13px;
  background: #7c4dff;
  color: #fff;
  font-size: calc(13px * var(--font-scale, 1));
}

.avatar.has-presence::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #7c4dff;
  box-shadow: 0 0 0 2px #29292d;
}
.list .item .avatar.has-presence::after { box-shadow: 0 0 0 3px #29292d; }

.inbox-pill {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 65;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 10px 0 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 21px;
  background: rgba(35, 31, 48, .92);
  color: #f2f1f5;
  font-size: calc(13px * var(--font-scale, 1));
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  backdrop-filter: blur(14px);
  cursor: pointer;
}
.inbox-pill .ico { width: 18px; height: 18px; }
.inbox-pill b {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #7c4dff;
  font-size: calc(12px * var(--font-scale, 1));
}

@media (max-width: 860px) {
  .list { padding: 2px 10px calc(104px + env(safe-area-inset-bottom)); }
  .list .item { padding: 12px 14px; border-radius: 22px; }
  .list .item .avatar { width: 62px; height: 62px; font-size: calc(22px * var(--font-scale, 1)); }
  .item-name { font-size: calc(19px * var(--font-scale, 1)); }
  .item-preview { font-size: calc(14.5px * var(--font-scale, 1)); }
  .inbox-pill:not([hidden]) { display: flex; }
  .rail {
    border-radius: 26px 26px 0 0;
    background: rgba(30, 30, 34, .94);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 -14px 34px rgba(0, 0, 0, .35);
  }
  .rail::before {
    content: "";
    position: absolute;
    left: 4%;
    right: 4%;
    top: -1px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #8b5cf6 25%, #6d3bd8 70%, transparent);
    opacity: .7;
  }
  .rail-item { border-radius: 16px; transition: background-color .2s var(--ease); }
  .rail-item.is-active { background: rgba(124, 77, 255, .18); }
  .rail-item.is-active .ico { background: transparent; }
  .rail-item span { font-size: calc(10px * var(--font-scale, 1)); letter-spacing: -.01em; }
  #rail-settings { display: none; }
}

/* ---------------------------- посты на «Главной» ---------------------------- */
.post {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-areas: "avatar body" "avatar actions";
  column-gap: 12px;
  row-gap: 6px;
  padding: 14px;
  border-radius: 20px;
  background: var(--surface-container);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}
.list .post { margin: 0; }
.post-avatar { grid-area: avatar; width: 56px; height: 56px; font-size: calc(20px * var(--font-scale, 1)); }
.post-body { grid-area: body; min-width: 0; }
.post-header { display: flex; align-items: center; gap: 8px; min-width: 0; }
.post-name { display: flex; align-items: center; font-size: calc(16px * var(--font-scale, 1)); font-weight: 700; }
.post-username { font-size: calc(13px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.post-time { margin-left: auto; flex: none; font-size: calc(11.5px * var(--font-scale, 1)); color: #8e8d96; }
.post-text {
  margin-top: 4px;
  font-size: calc(15px * var(--font-scale, 1));
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.post-image {
  display: block;
  width: 100%;
  max-height: 440px;
  margin-top: 10px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--surface-container-high);
}
.post-actions { grid-area: actions; display: flex; justify-content: flex-end; }
.post-actions:empty { display: none; }
.post-delete { height: 32px; padding: 0 10px; font-size: calc(12.5px * var(--font-scale, 1)); border-radius: 10px; }

/* ============================================================
   Material You: тональные поверхности, крупные радиусы,
   пилюли навигации, bottom-sheet на телефоне
   ============================================================ */
:root {
  --md-shape-xs: 8px;
  --md-shape-s: 12px;
  --md-shape-m: 16px;
  --md-shape-l: 24px;
  --md-shape-xl: 28px;
  --md-shape-full: 999px;
  --md-state: rgba(208, 188, 255, .10);
  --md-state-strong: rgba(208, 188, 255, .18);
  --md-tint: rgba(124, 77, 255, .16);
}

:root[data-theme="light"] {
  --md-state: rgba(103, 80, 164, .08);
  --md-state-strong: rgba(103, 80, 164, .14);
  --md-tint: rgba(103, 80, 164, .10);
}

body {
  background-image:
    radial-gradient(90% 60% at 100% 0%, var(--md-tint) 0%, transparent 60%),
    radial-gradient(70% 50% at 0% 100%, var(--md-tint) 0%, transparent 55%);
  background-attachment: fixed;
}

/* Тональные карточки и мягкие state layer'ы */
.list .item,
.post,
.media-card,
.channel-card {
  border-radius: var(--md-shape-l);
}
.list .item {
  background: color-mix(in srgb, var(--surface-container) 88%, var(--primary) 12%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .045);
}
.list .item:hover {
  background: color-mix(in srgb, var(--surface-container-high) 86%, var(--primary) 14%);
}
.list .item.is-active {
  background: color-mix(in srgb, var(--primary-container) 72%, var(--surface-container) 28%);
  color: var(--on-surface);
}
.list .item:focus-visible,
.btn:focus-visible,
.icon-btn:focus-visible,
.rail-item:focus-visible,
.fab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Кнопки-пилюли и поля в стиле M3 */
.btn { border-radius: var(--md-shape-full); }
.btn-filled {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.btn-filled:hover { background: color-mix(in srgb, var(--primary) 88%, #fff 12%); }
.btn-tonal {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.icon-btn { border-radius: var(--md-shape-full); }
.search,
.composer-field,
.dialog .field input,
.dialog .field textarea {
  border-radius: var(--md-shape-l);
}

/* FAB — акцентная тональная кнопка, всегда внутри экрана */
.fab {
  right: max(20px, env(safe-area-inset-right));
  border-radius: 20px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4), 0 1px 2px rgba(0, 0, 0, .3);
}
.fab:hover { background: color-mix(in srgb, var(--primary-container) 82%, #fff 18%); }

/* Нижняя навигация: активный пункт — тональная пилюля */
@media (max-width: 860px) {
  .rail {
    border-radius: 28px 28px 0 0;
    background: color-mix(in srgb, var(--surface-container) 92%, var(--primary) 8%);
    border-top: 1px solid color-mix(in srgb, var(--outline-variant) 70%, transparent);
  }
  .rail::before { opacity: .35; }
  .rail-item { border-radius: var(--md-shape-l); }
  .rail-item.is-active {
    background: color-mix(in srgb, var(--secondary-container) 76%, transparent);
    color: var(--on-secondary-container);
  }
  .rail-item.is-active .ico {
    background: var(--primary-container);
    color: var(--on-primary-container);
    border-radius: var(--md-shape-full);
  }
  .rail-item.is-active::before { display: none; }
  .rail-item .ico { border-radius: var(--md-shape-full); }
  .inbox-pill { border-radius: var(--md-shape-full); }
}

/* Диалоги: на телефоне — bottom sheet с «ручкой» */
.dialog {
  border-radius: var(--md-shape-xl);
  border: 1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);
  background: color-mix(in srgb, var(--surface-container-high) 94%, var(--primary) 6%);
}
@media (max-width: 560px) {
  .dialog-wrap {
    place-items: end center;
    padding: 0;
    overflow: hidden;
  }
  .dialog {
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
    border-radius: var(--md-shape-xl) var(--md-shape-xl) 0 0;
    border-bottom: 0;
    animation: sheet-up .28s var(--ease);
  }
  .dialog::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    margin: -8px auto 16px;
    border-radius: var(--md-shape-full);
    background: var(--outline-variant);
  }
  .dialog-settings { max-height: 92dvh; }
  .dialog-actions { position: sticky; bottom: 0; padding-top: 8px; }
}
@keyframes sheet-up {
  from { transform: translateY(18px); opacity: .4; }
  to { transform: none; opacity: 1; }
}

/* Тональные чипы и переключатели */
.reaction-chip,
.theme-switch,
.mode-switch {
  border-radius: var(--md-shape-full);
}
.reaction-chip:hover { background: var(--md-state-strong); }
.row-switch input:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.row-switch input::after {
  transition: transform .22s var(--ease), background-color .22s var(--ease);
}
.row-switch input:checked::after { background: var(--on-primary); }

/* Скроллбар тоньше и в цвет темы */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--outline) 60%, transparent); }

/* Мягкое появление экранов */
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.post-own { border: 1px solid rgba(124, 77, 255, .25); }

@media (max-width: 860px) {
  .post { padding: 12px; border-radius: 22px; grid-template-columns: 52px minmax(0, 1fr); }
  .post-avatar { width: 52px; height: 52px; font-size: calc(19px * var(--font-scale, 1)); }
  .post-name { font-size: calc(17px * var(--font-scale, 1)); }
  .post-text { font-size: calc(15.5px * var(--font-scale, 1)); }
}

/* ================= поддержка (ИИ + почта) ================= */
.auth-support { margin-top: 10px; color: var(--primary); }
.settings-danger { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--outline-variant); }
.btn-danger-filled { background: var(--error); color: var(--on-error, #fff); }
.dialog-support {
  width: min(540px, 100%);
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 760px);
  overflow: hidden;
}
.support-head { display: flex; align-items: center; gap: 12px; }
.support-bot {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--on-primary-container);
  background: linear-gradient(145deg, var(--primary-container), var(--secondary-container));
}
.support-bot .ico { width: 24px; height: 24px; }
.support-title { flex: 1; min-width: 0; }
.support-title h2 { font-size: calc(20px * var(--font-scale, 1)); }
.support-title p { margin-top: 2px; font-size: calc(12.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.support-log {
  flex: 1;
  min-height: 220px;
  max-height: 44vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 2px 8px;
  overscroll-behavior: contain;
}
.support-msg { display: flex; animation: pop .2s var(--ease); }
.support-msg.user { justify-content: flex-end; }
.support-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--surface-container-highest);
  color: var(--on-surface);
  font-size: calc(14px * var(--font-scale, 1));
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.support-msg.bot .support-bubble { border-bottom-left-radius: 5px; }
.support-msg.user .support-bubble {
  background: var(--primary);
  color: var(--on-primary);
  border-bottom-right-radius: 5px;
}
.support-bubble a { color: inherit; text-decoration: underline; }
.support-msg.bot .support-bubble a { color: var(--primary); font-weight: 600; }
.support-typing { display: flex; align-items: center; gap: 5px; padding: 4px 2px; }
.support-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--on-surface-variant);
  animation: support-dot 1s infinite ease-in-out;
}
.support-typing i:nth-child(2) { animation-delay: .15s; }
.support-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes support-dot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.support-form { display: flex; align-items: flex-end; gap: 8px; margin-top: 6px; }
.support-form textarea {
  flex: 1;
  min-height: 44px;
  max-height: 110px;
  padding: 11px 15px;
  border: 1px solid var(--outline-variant);
  border-radius: 22px;
  background: var(--surface-container-low);
  color: var(--on-surface);
  font: inherit;
  font-size: calc(14px * var(--font-scale, 1));
  line-height: 20px;
  resize: none;
  outline: none;
}
.support-form textarea:focus { border-color: var(--primary); }
.support-send {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
}
.support-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
  font-size: calc(12.5px * var(--font-scale, 1));
  color: var(--on-surface-variant);
}
.support-mail { color: var(--primary); font-weight: 700; text-decoration: none; }
.support-mail:hover { text-decoration: underline; }

/* ================= звонки ================= */
.call-screen {
  position: fixed;
  inset: 0;
  z-index: 340;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 10, 20, .78);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.call-screen[hidden] { display: none; }
.call-card {
  width: min(370px, 100%);
  padding: 34px 26px 26px;
  border-radius: 34px;
  text-align: center;
  color: #f6f3fc;
  background: radial-gradient(120% 120% at 50% 0%, #4c3579 0%, #221a35 55%, #15111f 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .09);
}
.call-avatar {
  width: 106px;
  height: 106px;
  margin: 0 auto 18px;
  font-size: calc(38px * var(--font-scale, 1));
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .06), 0 18px 40px rgba(0, 0, 0, .35);
}
.call-card h2 { font-size: calc(24px * var(--font-scale, 1)); line-height: 1.2; overflow-wrap: anywhere; }
.call-status { min-height: 20px; margin: 8px 0 28px; font-size: calc(14px * var(--font-scale, 1)); opacity: .72; }
.call-actions { display: flex; justify-content: center; gap: 22px; }
.call-btn {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  transition: transform .15s var(--ease);
}
.call-btn:active { transform: scale(.92); }
.call-btn .ico { width: 27px; height: 27px; }
.call-accept { background: #2f9e5f; box-shadow: 0 10px 26px rgba(47, 158, 95, .35); }
.call-hangup { background: #d93a4f; box-shadow: 0 10px 26px rgba(217, 58, 79, .35); }
.call-hint { display: block; margin-top: 20px; font-size: calc(11.5px * var(--font-scale, 1)); opacity: .45; }

/* ================= свои стикеры ================= */
.msg-sticker-img {
  display: block;
  width: 132px;
  height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .18));
  animation: sticker-pop .42s cubic-bezier(.2, 1.5, .4, 1);
}
.sticker-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  pointer-events: none;
}
.sticker-item.is-custom { position: relative; padding: 3px; }
.sticker-item.sticker-add {
  border: 1.5px dashed var(--outline);
  border-radius: 12px;
  color: var(--on-surface-variant);
  font-size: calc(26px * var(--font-scale, 1));
  line-height: 1;
}
.sticker-item.sticker-add:hover { color: var(--primary); border-color: var(--primary); }
.sticker-del {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  display: none;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--error);
  color: #fff;
  font-size: calc(12px * var(--font-scale, 1));
  line-height: 1;
  cursor: pointer;
}
.sticker-item.is-custom:hover .sticker-del { display: grid; }

/* ================= ЭКРАН ПРОФИЛЯ (Material You) ================= */
.profile-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  opacity: 0;
  transform: translateY(14px) scale(.99);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.profile-screen[hidden] { display: none; }
.profile-screen.is-open { opacity: 1; transform: none; }

.pf-hero {
  position: relative;
  flex: 0 0 auto;
  padding: 0 18px 26px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 255, 255, .34), transparent 58%),
    radial-gradient(90% 80% at 92% 18%, rgba(255, 255, 255, .2), transparent 52%),
    linear-gradient(158deg, #8f6ff0 0%, #6a5ae0 42%, #f0729a 100%);
  border-radius: 0 0 34px 34px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(106, 90, 224, .26);
}
.pf-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    radial-gradient(circle at 18% 26%, rgba(255,255,255,.55) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 16%, rgba(255,255,255,.45) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 88% 56%, rgba(255,255,255,.4) 0 2px, transparent 3px),
    radial-gradient(circle at 8% 68%, rgba(255,255,255,.35) 0 3px, transparent 4px),
    radial-gradient(circle at 46% 88%, rgba(255,255,255,.3) 0 2px, transparent 3px),
    radial-gradient(circle at 64% 40%, rgba(255,255,255,.28) 0 1.6px, transparent 2.6px);
}
.pf-hero-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 0 0;
}
.pf-icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, .18);
  transition: background .16s var(--ease);
}
.pf-icon-btn:hover { background: rgba(255, 255, 255, .3); }
.pf-icon-btn .ico { width: 22px; height: 22px; }

.pf-avatar-wrap {
  position: relative;
  width: max-content;
  margin: 8px auto 12px;
}
.avatar-xl { width: 104px; height: 104px; font-size: calc(36px * var(--font-scale, 1)); }
.pf-avatar-wrap .avatar { overflow: visible; }
.pf-avatar-wrap .avatar-shape { filter: drop-shadow(0 12px 26px rgba(40, 20, 70, .45)); }
.pf-avatar-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  color: #5b3fc4;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
}
.pf-avatar-btn .ico { width: 18px; height: 18px; }

.pf-name {
  position: relative;
  font-size: calc(24px * var(--font-scale, 1));
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .18);
}
.pf-name .badge-ico { vertical-align: middle; }
.pf-sub {
  position: relative;
  margin-top: 4px;
  font-size: calc(13.5px * var(--font-scale, 1));
  opacity: .88;
  overflow-wrap: anywhere;
}
.pf-edit {
  position: relative;
  margin-top: 14px;
  height: 38px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: calc(13.5px * var(--font-scale, 1));
  font-weight: 600;
  color: #4a2f9e;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 20px rgba(40, 20, 70, .2);
}
.pf-edit:active { transform: scale(.97); }

.pf-body { flex: 0 0 auto; padding: 18px 16px calc(28px + env(safe-area-inset-bottom)); max-width: 620px; width: 100%; margin: 0 auto; }
.pf-group {
  margin-bottom: 14px;
  padding: 6px;
  border-radius: 26px;
  background: var(--surface-container-low);
}
.pf-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--on-surface);
  background: transparent;
  transition: background .16s var(--ease);
}
.pf-row:hover { background: var(--surface-container-high); }
.pf-row:active { background: var(--surface-container-highest); }
.pf-ico {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--pf, var(--primary));
  box-shadow: 0 6px 14px color-mix(in srgb, var(--pf, var(--primary)) 34%, transparent);
}
.pf-ico .ico { width: 21px; height: 21px; }
.pf-label { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; font-size: calc(15px * var(--font-scale, 1)); font-weight: 500; }
.pf-label small { font-size: calc(11.5px * var(--font-scale, 1)); font-weight: 400; color: var(--on-surface-variant); }
.pf-chevron { flex: 0 0 auto; width: 18px; height: 18px; color: var(--on-surface-variant); opacity: .7; }
.pf-danger {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 14px;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  font: inherit;
  font-size: calc(14.5px * var(--font-scale, 1));
  font-weight: 600;
  color: var(--error, #d93025);
  background: transparent;
}
.pf-danger:hover { background: color-mix(in srgb, var(--error, #d93025) 10%, transparent); }
.pf-version { margin-top: 16px; text-align: center; font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); opacity: .65; }

/* ================= информационные диалоги ================= */
.info-body { display: flex; flex-direction: column; gap: 10px; max-height: 56dvh; overflow-y: auto; }
.info-text { font-size: calc(14px * var(--font-scale, 1)); line-height: 1.5; color: var(--on-surface-variant); }
.info-list { display: flex; flex-direction: column; gap: 4px; }

.call-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--on-surface);
  background: transparent;
}
.call-row:hover { background: var(--surface-container-high); }
.call-row-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.call-row-body b { font-size: calc(14.5px * var(--font-scale, 1)); overflow-wrap: anywhere; }
.call-row-body small { font-size: calc(12px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.call-row-icon { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent); }
.call-row-icon .ico { width: 18px; height: 18px; }

.device-row { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: 18px; }
.device-row.is-current { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.device-ico { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--primary); background: var(--surface-container-high); }
.device-ico .ico { width: 20px; height: 20px; }
.device-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.device-body b { font-size: calc(14.5px * var(--font-scale, 1)); }
.device-body small { font-size: calc(12px * var(--font-scale, 1)); color: var(--on-surface-variant); }

.wallet-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(150deg, #6a5ae0, #a35ae0 60%, #f0729a);
  box-shadow: 0 14px 34px rgba(106, 90, 224, .32);
}
.wallet-label { font-size: calc(12.5px * var(--font-scale, 1)); opacity: .82; text-transform: uppercase; letter-spacing: 1px; }
.wallet-sum { font-size: calc(30px * var(--font-scale, 1)); line-height: 1.15; }
.wallet-card small { font-size: calc(11.5px * var(--font-scale, 1)); opacity: .82; }

.story-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 18px; background: var(--surface-container-low); }
.story-thumb { width: 56px; height: 56px; flex: 0 0 auto; object-fit: cover; border-radius: 14px; }
.story-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.story-body p { font-size: calc(14px * var(--font-scale, 1)); overflow-wrap: anywhere; }
.story-body small { font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }

.saved-compose { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.saved-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--outline);
  background: var(--surface-container-low);
  color: var(--on-surface);
  font: inherit;
  font-size: calc(14px * var(--font-scale, 1));
  resize: vertical;
}
.saved-compose .btn { align-self: flex-end; }
.saved-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px; border-radius: 16px; background: var(--surface-container-low); }
.saved-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.saved-body p { font-size: calc(14px * var(--font-scale, 1)); overflow-wrap: anywhere; }
.saved-body small { font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }

.folder-list { display: flex; flex-direction: column; gap: 4px; }
.folder-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 10px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--on-surface);
  background: transparent;
}
.folder-row:hover { background: var(--surface-container-high); }
.folder-row.is-active { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.folder-check { flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center; color: var(--primary); }
.folder-check .ico { width: 20px; height: 20px; }
.folder-label { display: flex; flex-direction: column; gap: 2px; }
.folder-label b { font-size: calc(14.5px * var(--font-scale, 1)); }
.folder-label small { font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }

/* ================= видеозвонок ================= */
.call-screen.is-video { place-items: stretch; padding: 0; }
.call-screen.is-video .call-card {
  width: 100%;
  max-width: none;
  border-radius: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: calc(30px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(10, 8, 16, .92), rgba(10, 8, 16, .25) 55%, rgba(10, 8, 16, .1));
}
.call-screen.is-video .call-avatar { display: none; }
.call-remote {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0c0a14;
}
.call-remote[hidden] { display: none; }
.call-local {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  width: 110px;
  height: 150px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  background: #17131f;
  z-index: 2;
  transform: scaleX(-1);
}
.call-local[hidden] { display: none; }
.call-screen.is-video .call-card h2,
.call-screen.is-video .call-status,
.call-screen.is-video .call-hint { position: relative; z-index: 1; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.call-screen.is-video .call-actions { position: relative; z-index: 1; margin-top: 4px; }
.call-ctrl { background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.call-ctrl.is-off { background: rgba(255, 255, 255, .92); color: #1b1b1f; }
.call-screen:not(.is-video) #call-cam { display: none; }

@media (max-width: 560px) {
  .dialog-support { max-height: 94dvh; overflow: hidden; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .support-log { max-height: 40dvh; min-height: 150px; }
  .support-form textarea { font-size: calc(16px * var(--font-scale, 1)); }
  .support-foot { margin-bottom: 2px; }
  .pf-ico { width: 38px; height: 38px; }
  .pf-row { padding: 10px; }
  .call-local { width: 92px; height: 126px; }
  .info-body { max-height: 50dvh; }
}

/* ================================================================
   1.6 · новый вид: пастельный градиент, слоистое стекло, пилюли
   ================================================================ */
body {
  background:
    radial-gradient(90% 70% at 0% 0%, rgba(205, 184, 255, .42) 0%, transparent 60%),
    radial-gradient(80% 70% at 100% 4%, rgba(255, 205, 226, .38) 0%, transparent 62%),
    radial-gradient(90% 80% at 50% 100%, rgba(188, 218, 255, .34) 0%, transparent 60%),
    var(--surface);
  background-attachment: fixed;
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(90% 70% at 0% 0%, rgba(96, 70, 176, .30) 0%, transparent 62%),
    radial-gradient(80% 70% at 100% 4%, rgba(150, 62, 110, .24) 0%, transparent 64%),
    radial-gradient(90% 80% at 50% 100%, rgba(34, 66, 140, .26) 0%, transparent 62%),
    var(--surface);
  background-attachment: fixed;
}

body.glass .rail,
body.glass .list-pane,
body.glass .chat-pane,
body.glass .chat-head,
body.glass .composer,
body.glass .composer-locked {
  background: transparent;
  border-color: rgba(255, 255, 255, .28);
}
:root[data-theme="dark"] body.glass .rail,
:root[data-theme="dark"] body.glass .list-pane,
:root[data-theme="dark"] body.glass .chat-pane,
:root[data-theme="dark"] body.glass .chat-head,
:root[data-theme="dark"] body.glass .composer,
:root[data-theme="dark"] body.glass .composer-locked {
  border-color: rgba(255, 255, 255, .08);
}
body.glass .chat-head,
body.glass .composer,
body.glass .composer-locked,
body.glass .rail {
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  background: rgba(255, 255, 255, .34);
}
:root[data-theme="dark"] body.glass .chat-head,
:root[data-theme="dark"] body.glass .composer,
:root[data-theme="dark"] body.glass .composer-locked,
:root[data-theme="dark"] body.glass .rail {
  background: rgba(24, 21, 32, .44);
}

/* Слоистые стеклянные карточки списка */
.list .item {
  background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .42));
  border: 1px solid rgba(255, 255, 255, .62);
  box-shadow: 0 10px 26px rgba(83, 60, 140, .12), inset 0 1px 0 rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
  backdrop-filter: blur(18px) saturate(155%);
}
.list .item:hover {
  background: linear-gradient(145deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .58));
  transform: translateY(-1px);
}
.list .item.is-active {
  background: linear-gradient(145deg, rgba(216, 198, 255, .92), rgba(244, 204, 232, .80));
  border-color: rgba(255, 255, 255, .85);
  box-shadow: 0 14px 32px rgba(103, 80, 164, .24), inset 0 1px 0 rgba(255, 255, 255, .9);
}
:root[data-theme="dark"] .list .item {
  background: linear-gradient(145deg, rgba(52, 47, 68, .74), rgba(31, 28, 42, .58));
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .07);
}
:root[data-theme="dark"] .list .item:hover {
  background: linear-gradient(145deg, rgba(64, 58, 82, .84), rgba(38, 34, 50, .68));
}
:root[data-theme="dark"] .list .item.is-active {
  background: linear-gradient(145deg, rgba(86, 68, 138, .90), rgba(70, 46, 92, .82));
  border-color: rgba(255, 255, 255, .16);
}
.list .item .avatar.has-presence::after { box-shadow: 0 0 0 3px rgba(255, 255, 255, .55); }
:root[data-theme="dark"] .list .item .avatar.has-presence::after { box-shadow: 0 0 0 3px rgba(30, 27, 40, .9); }

/* Стеклянные группы профиля */
.pf-group {
  background: linear-gradient(160deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .48));
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 14px 34px rgba(83, 60, 140, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}
:root[data-theme="dark"] .pf-group {
  background: linear-gradient(160deg, rgba(48, 43, 64, .78), rgba(27, 24, 38, .58));
  border-color: rgba(255, 255, 255, .09);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.pf-row {
  border-radius: 999px;
}
.pf-row:hover {
  background: rgba(255, 255, 255, .58);
}
:root[data-theme="dark"] .pf-row:hover { background: rgba(255, 255, 255, .07); }
.pf-row:active { transform: scale(.995); }
.pf-ico {
  box-shadow: 0 8px 18px color-mix(in srgb, var(--pf, var(--primary)) 38%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, .38);
}

/* Пилюли */
.search, .mode-switch, .seg, .seg-btn, .btn, .inbox-pill, .amount-chip {
  border-radius: 999px;
}
.btn { border-radius: 999px; }
.dialog { border-radius: 32px; }

/* Иконки-аватарки */
.avatar-shape { position: relative; }
.avatar-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58%;
  height: 58%;
  transform: translate(-50%, -50%);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.icon-choice {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  color: var(--on-surface-variant);
  background: var(--surface-container-high);
  transition: transform .14s var(--ease), background-color .14s var(--ease), border-color .14s var(--ease);
}
.icon-choice:hover { transform: translateY(-1px); background: var(--surface-container-highest); }
.icon-choice.is-active {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, var(--surface-container-high));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 22%, transparent);
}
.icon-choice-svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-choice-text { font-size: calc(12px * var(--font-scale, 1)); font-weight: 700; letter-spacing: .4px; }

/* ================================================================
   ARPI Pay
   ================================================================ */
.dialog-wallet { width: min(480px, 100%); }
.wallet-hero {
  position: relative;
  margin: 16px 0 14px;
  padding: 18px 20px 20px;
  border-radius: 26px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(110% 120% at 88% 10%, rgba(255, 255, 255, .34), transparent 58%),
    linear-gradient(140deg, #7a5cf0 0%, #9a6bf0 46%, #ef7fab 100%);
  box-shadow: 0 18px 38px rgba(103, 80, 164, .34), inset 0 1px 0 rgba(255, 255, 255, .38);
}
.wallet-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  pointer-events: none;
}
.wallet-top { position: relative; display: flex; align-items: center; justify-content: space-between; }
.wallet-brand { font-size: calc(13px * var(--font-scale, 1)); font-weight: 700; letter-spacing: 2px; opacity: .92; }
.wallet-brand b { font-weight: 800; opacity: .7; }
.mir-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: calc(11px * var(--font-scale, 1));
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  background: rgba(255, 255, 255, .22);
  border: 1px solid rgba(255, 255, 255, .4);
}
.wallet-sum {
  position: relative;
  display: block;
  margin-top: 14px;
  font-size: calc(34px * var(--font-scale, 1));
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.5px;
}
.wallet-hero small { position: relative; display: block; margin-top: 6px; font-size: calc(12.5px * var(--font-scale, 1)); opacity: .85; }
.wallet-open { width: 100%; justify-content: center; border-radius: 999px; }
.wallet-form { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.amount-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.amount-chip {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--outline-variant);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: calc(13px * var(--font-scale, 1));
  font-weight: 600;
  color: var(--on-surface);
  background: var(--surface-container-high);
  transition: background-color .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.amount-chip:hover { background: var(--surface-container-highest); }
.amount-chip.is-active {
  color: var(--on-primary);
  background: var(--primary);
  border-color: var(--primary);
}
.field-row { display: flex; gap: 8px; }
.field-row .field { flex: 1; }
.wallet-note {
  font-size: calc(12px * var(--font-scale, 1));
  line-height: 1.45;
  color: var(--on-surface-variant);
  padding: 10px 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}
.wallet-history { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.wallet-hist-title { font-size: calc(12px * var(--font-scale, 1)); letter-spacing: .6px; text-transform: uppercase; color: var(--on-surface-variant); margin-bottom: 2px; }
.wallet-empty { font-size: calc(13px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.wallet-op {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: var(--surface-container-low);
}
.wallet-op-ico {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 16%, transparent);
}
.wallet-op-ico .ico { width: 19px; height: 19px; }
.wallet-op-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wallet-op-body b { font-size: calc(14px * var(--font-scale, 1)); font-weight: 600; overflow-wrap: anywhere; }
.wallet-op-body small { font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.wallet-op-sum { flex: none; font-size: calc(14px * var(--font-scale, 1)); font-weight: 700; color: #1fa463; }
.notify-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 560px) {
  .field-row { flex-wrap: wrap; }
  .field-row .field { min-width: 96px; }
  .wallet-sum { font-size: calc(30px * var(--font-scale, 1)); }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .pf-row { border-radius: 18px; }
}

.icon-choice .avatar-icon {
  position: static;
  transform: none;
  width: 26px;
  height: 26px;
  stroke-width: 3;
}

/* Посты и создание поста — те же слоистые стеклянные карточки */
.post,
.post-creator {
  background: linear-gradient(145deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .44));
  border: 1px solid rgba(255, 255, 255, .64);
  box-shadow: 0 12px 28px rgba(83, 60, 140, .12), inset 0 1px 0 rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
  backdrop-filter: blur(18px) saturate(155%);
}
:root[data-theme="dark"] .post,
:root[data-theme="dark"] .post-creator {
  background: linear-gradient(145deg, rgba(50, 45, 64, .72), rgba(30, 27, 41, .56));
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.post { border-radius: 26px; }
.post-creator { border-radius: 26px; }
.search {
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
:root[data-theme="dark"] .search {
  background: rgba(40, 36, 52, .72);
  border-color: rgba(255, 255, 255, .08);
}

/* Диалоги должны быть читаемыми поверх стекла */
.dialog-wrap {
  background: rgba(24, 18, 40, .38);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.dialog { max-height: min(90dvh, 920px); overflow-y: auto; }
body.glass .dialog,
body.glass .dialog-support {
  background: linear-gradient(165deg, rgba(255, 255, 255, .97), rgba(248, 244, 255, .94));
  border: 1px solid rgba(255, 255, 255, .8);
}
:root[data-theme="dark"] body.glass .dialog,
:root[data-theme="dark"] body.glass .dialog-support {
  background: linear-gradient(165deg, rgba(40, 36, 52, .98), rgba(27, 24, 37, .97));
  border: 1px solid rgba(255, 255, 255, .1);
}
.dialog-wallet { width: min(480px, 100%); }

/* ================================================================
   Подарки
   ================================================================ */
.dialog-gifts { width: min(560px, 100%); }
.gift-balance {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
  padding: 12px 16px;
  border-radius: 22px;
  background: linear-gradient(140deg, rgba(122, 92, 240, .16), rgba(239, 127, 171, .18));
  border: 1px solid rgba(255, 255, 255, .6);
}
.gift-balance span { font-size: calc(12.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.gift-balance b { margin-left: auto; font-size: calc(20px * var(--font-scale, 1)); font-weight: 800; }
.btn-sm { height: 34px; padding: 0 14px; font-size: calc(13px * var(--font-scale, 1)); border-radius: 999px; }
.gift-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.gift-tabs::-webkit-scrollbar { display: none; }
.gift-tab {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  font-size: calc(13px * var(--font-scale, 1));
  font-weight: 600;
  cursor: pointer;
}
.gift-tab.is-on {
  background: color-mix(in srgb, var(--primary) 18%, var(--surface-container-high));
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 36%, transparent);
}
.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.gift-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px 14px;
  border-radius: 22px;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(150deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .5));
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 10px 22px rgba(83, 60, 140, .10), inset 0 1px 0 rgba(255, 255, 255, .8);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.gift-card:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(83, 60, 140, .16), inset 0 1px 0 rgba(255, 255, 255, .85); }
.gift-emoji { font-size: calc(34px * var(--font-scale, 1)); line-height: 1.1; }
.gift-title { font-size: calc(13.5px * var(--font-scale, 1)); font-weight: 700; overflow-wrap: anywhere; }
.gift-sub { font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.gift-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  background: var(--surface-container);
}
.gift-photo-btn {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .16);
  font-size: calc(14px * var(--font-scale, 1));
  line-height: 1;
  cursor: pointer;
}
.gift-hist-photo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 12px;
  float: right;
  margin-left: 8px;
}
.gift-order-photo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 12px;
  flex: none;
}
.gift-photo-pick {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 22px;
  border: 1px dashed color-mix(in srgb, var(--primary) 38%, transparent);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  cursor: pointer;
}
.gift-photo-preview {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: calc(26px * var(--font-scale, 1));
  background: var(--surface-container-high);
}
.gift-photo-preview.has-photo { background: transparent; }
.gift-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gift-photo-hint { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gift-photo-hint b { font-size: calc(13.5px * var(--font-scale, 1)); }
.gift-photo-hint small { font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.gift-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(217, 48, 37, .12);
  color: #d93025;
  font-size: calc(16px * var(--font-scale, 1));
  line-height: 1;
  cursor: pointer;
}
.gift-empty {
  grid-column: 1 / -1;
  padding: 18px 8px;
  text-align: center;
  font-size: calc(13px * var(--font-scale, 1));
  color: var(--on-surface-variant);
}
.gift-history { display: flex; flex-direction: column; gap: 8px; }
.gift-hist {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: var(--surface-container-high);
}
.gift-hist-avatar { width: 38px; height: 38px; flex: none; }
.gift-hist-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; min-width: 0; text-align: left; }
.gift-hist-body b { font-size: calc(13.5px * var(--font-scale, 1)); }
.gift-hist-body small { font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.gift-hist-msg { font-style: italic; }
.gift-hist-price { flex: none; font-size: calc(13px * var(--font-scale, 1)); font-weight: 700; color: var(--primary); }
.gift-form { display: flex; flex-direction: column; gap: 12px; }
.field-emoji { flex: 0 0 76px; }
.gift-send-gift {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 12px 16px;
  border-radius: 22px;
  background: var(--surface-container-high);
}
.gift-send-info { display: flex; flex-direction: column; gap: 2px; }
.gift-send-info b { font-size: calc(15px * var(--font-scale, 1)); }
.gift-send-info small { font-size: calc(12px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.gift-users { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; margin: 10px 0; }
.gift-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.gift-user:hover { background: var(--surface-container-high); }
.gift-user.is-on {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border-color: color-mix(in srgb, var(--primary) 34%, transparent);
}
.gift-user-avatar { width: 36px; height: 36px; flex: none; }
.gift-user-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gift-user-body b { font-size: calc(13.5px * var(--font-scale, 1)); }
.gift-user-body small { font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); overflow-wrap: anywhere; }
:root[data-theme="dark"] .gift-card {
  background: linear-gradient(150deg, rgba(56, 50, 72, .72), rgba(34, 30, 46, .58));
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .06);
}
:root[data-theme="dark"] .gift-balance { border-color: rgba(255, 255, 255, .08); }
@media (max-width: 560px) {
  .gift-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .gift-emoji { font-size: calc(30px * var(--font-scale, 1)); }
}

/* Оплата подарка переводом */
.gift-pay-banner { background: linear-gradient(140deg, rgba(122, 92, 240, .18), rgba(60, 200, 180, .18)); }
.gift-pay-banner b { font-size: calc(12px * var(--font-scale, 1)); letter-spacing: .4px; }
.dialog-gift-pay { width: min(520px, 100%); }
.gift-pay-requisites {
  margin-top: 14px;
  padding: 14px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .44));
  border: 1px solid rgba(255, 255, 255, .72);
}
:root[data-theme="dark"] .gift-pay-requisites {
  background: rgba(48, 43, 60, .72);
  border-color: rgba(255, 255, 255, .08);
}
.gift-req-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gift-req-head b { font-size: calc(14px * var(--font-scale, 1)); }
.gift-req-head span { font-size: calc(20px * var(--font-scale, 1)); font-weight: 800; color: var(--primary); }
.gift-req {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.gift-req:active { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.gift-req-label {
  font-size: calc(11.5px * var(--font-scale, 1));
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--on-surface-variant);
}
.gift-req b { font-size: calc(17px * var(--font-scale, 1)); letter-spacing: .6px; }
.gift-req small { font-size: calc(11px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.gift-method { display: flex; gap: 8px; margin: 12px 0; }
.gift-method-chip {
  flex: 1;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--outline-variant);
  background: transparent;
  color: var(--on-surface-variant);
  font: inherit;
  font-weight: 600;
  font-size: calc(13px * var(--font-scale, 1));
  cursor: pointer;
}
.gift-method-chip.is-on {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  border-color: transparent;
}
.gift-order {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--surface-container-high);
}
.gift-order-head { display: flex; align-items: center; gap: 10px; }
.gift-order-emoji { font-size: calc(26px * var(--font-scale, 1)); flex: none; }
.gift-order-title { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.gift-order-title b { font-size: calc(13.5px * var(--font-scale, 1)); }
.gift-order-title small { font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.gift-status {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: calc(10.5px * var(--font-scale, 1));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.st-pending { background: color-mix(in srgb, #f2b01e 22%, transparent); color: #9a6a00; }
.st-approved { background: color-mix(in srgb, #2bb673 20%, transparent); color: #137a4a; }
.st-rejected { background: color-mix(in srgb, #d93025 18%, transparent); color: #a5231b; }
.st-canceled { background: var(--surface-container); color: var(--on-surface-variant); }
.gift-order-meta, .gift-order-msg {
  font-size: calc(11.5px * var(--font-scale, 1));
  color: var(--on-surface-variant);
  overflow-wrap: anywhere;
}
.gift-order-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.gift-order-check {
  font-size: calc(11.5px * var(--font-scale, 1));
  color: var(--primary);
  font-weight: 600;
}
.gift-order-receipt {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 14px;
  margin-top: 6px;
  background: var(--surface-container);
}
.gift-code-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 9%, transparent);
  font-size: calc(12px * var(--font-scale, 1));
}
.gift-code-line b { letter-spacing: 1.2px; font-size: calc(14px * var(--font-scale, 1)); }
.gift-code-line .btn { margin-left: auto; }
.gift-receipt-pick { margin-top: 4px; }
.gift-code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 14px 0;
  padding: 18px 14px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 16%, transparent), color-mix(in srgb, var(--tertiary) 14%, transparent));
  border: 1px dashed color-mix(in srgb, var(--primary) 40%, transparent);
}
.gift-code-box span {
  font-size: calc(11px * var(--font-scale, 1));
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}
.gift-code-box b {
  font-size: calc(28px * var(--font-scale, 1));
  letter-spacing: 3px;
  font-weight: 800;
  color: var(--primary);
}
.gift-code-box small { font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.gift-code-sum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--surface-container-high);
  flex-wrap: wrap;
}
.gift-code-sum b { font-size: calc(14px * var(--font-scale, 1)); }
.gift-code-sum span { font-size: calc(20px * var(--font-scale, 1)); font-weight: 800; color: var(--primary); }
.gift-code-sum small { font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.auto-pay-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  background: var(--surface-container-high);
}
.auto-pay-head { display: flex; align-items: flex-start; gap: 12px; }
.auto-pay-head > div { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; }
.auto-pay-head b { font-size: calc(14px * var(--font-scale, 1)); }
.auto-pay-head small { font-size: calc(11.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }
.auto-toggle {
  flex: none;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  padding: 3px;
  background: var(--surface-container-highest);
  cursor: pointer;
  transition: background-color .18s var(--ease);
}
.auto-toggle span {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--on-surface-variant);
  transition: transform .18s var(--ease), background-color .18s var(--ease);
}
.auto-toggle.is-on { background: var(--primary); }
.auto-toggle.is-on span { transform: translateX(20px); background: var(--on-primary); }
.auto-note, .auto-sub {
  font-size: calc(11.5px * var(--font-scale, 1));
  color: var(--on-surface-variant);
}
.auto-sub {
  margin: 14px 0 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.auto-row { display: flex; gap: 8px; flex-wrap: wrap; }
.auto-sms { display: flex; flex-direction: column; gap: 8px; }
.auto-sms .field { margin-bottom: 0; }
.auto-sms textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 22px 16px 10px;
  border: 1px solid var(--outline);
  border-radius: 16px;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  font-size: calc(14px * var(--font-scale, 1));
  line-height: 1.4;
  outline: none;
}
.auto-sms textarea:focus { border: 2px solid var(--primary); padding: 21px 15px 9px; }
.auto-sms textarea:focus + span,
.auto-sms textarea:not(:placeholder-shown) + span {
  top: 7px;
  font-size: calc(12px * var(--font-scale, 1));
  color: var(--primary);
}
.auto-order {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--surface-container-high);
}
.auto-order-head { display: flex; align-items: center; gap: 10px; }
.auto-order-code {
  flex: none;
  font-size: calc(12.5px * var(--font-scale, 1));
  letter-spacing: 1px;
  color: var(--primary);
}
.auto-event {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--surface-container-high);
}
.auto-event-amount {
  flex: none;
  min-width: 72px;
  font-weight: 800;
  font-size: calc(14px * var(--font-scale, 1));
  color: var(--primary);
}
.auto-event-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.auto-event-body small {
  font-size: calc(11.5px * var(--font-scale, 1));
  color: var(--on-surface-variant);
  overflow-wrap: anywhere;
}

/* ================================================================
   Круглые аватарки, рамки, шрифт — Material You
   ================================================================ */.frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}
.frame-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  font: inherit;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.frame-choice:hover { background: var(--surface-container-high); transform: translateY(-1px); }
.frame-choice.is-active {
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}
.frame-choice small { font-size: calc(10.5px * var(--font-scale, 1)); }
.frame-dot {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #c8b6ff, #ffc2e2);
}
.frame-dot-shape {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(46, 24, 92, .8);
  font-weight: 800;
  font-size: calc(13px * var(--font-scale, 1));
}
.font-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.font-chip {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--outline-variant);
  background: transparent;
  color: var(--on-surface-variant);
  font-size: calc(13px * var(--font-scale, 1));
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.font-chip.is-on {
  border-color: transparent;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.font-range {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 20px;
  background: var(--surface-container-high);
}
.font-range span { font-size: calc(13px * var(--font-scale, 1)); }
.font-range b { font-size: calc(13px * var(--font-scale, 1)); min-width: 44px; text-align: right; }
.font-range input[type="range"] {
  flex: 1 1 auto;
  accent-color: var(--primary);
  height: 24px;
}

/* Material You ripple */
.ripple-host { position: relative; overflow: hidden; }
.ripple-dot {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: .22;
  pointer-events: none;
  transform: scale(0);
  animation: ripple-out .5s var(--ease) forwards;
}
@keyframes ripple-out { to { transform: scale(1); opacity: 0; } }

/* Auth / профиль — больше Material You */
.auth-card, .dialog, .profile-card, .pf-group {
  border-radius: 28px;
}
.btn { letter-spacing: .1px; }
.btn-filled { box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 30%, transparent); }
.fab { box-shadow: 0 10px 26px color-mix(in srgb, var(--primary) 36%, transparent); }
.pf-row { transition: background-color .16s var(--ease), transform .16s var(--ease); }
.pf-row:active { transform: scale(.985); }

/* ============================ ARPI 1.8 ============================ */
/* -------- �������� ������ -------- */
.ico { transition: transform .22s var(--ease), color .22s var(--ease); }
.icon-btn:hover .ico, .btn:hover .ico, .pf-row:hover .pf-ico .ico {
  transform: scale(1.12) rotate(-4deg);
}
.icon-btn:active .ico, .btn:active .ico, .rail-item:active .ico {
  transform: scale(.9);
}
.animations .rail-item .ico { transform-origin: 50% 50%; }
.animations .rail-item:hover .ico { animation: arpi-icon-wiggle .55s var(--ease); }
.animations .rail-item.is-active .ico { animation: arpi-icon-pop .42s var(--ease); }
.animations .home-mark .ico { animation: arpi-logo-breathe 4.4s var(--ease) infinite; }
.animations .gift-emoji, .animations .gift-order-emoji {
  display: inline-block;
  animation: arpi-gift-float 3.6s var(--ease) infinite;
}
.animations .send-btn:active, .animations .shorts-send:active { transform: scale(.86); }
.animations .pf-row:hover .pf-chevron { transform: translateX(3px); }
.animations .item:hover .avatar { transform: scale(1.04); }
.avatar { transition: transform .25s var(--ease); }
@keyframes arpi-icon-pop {
  0% { transform: scale(.72); }
  55% { transform: scale(1.22) rotate(-5deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes arpi-icon-wiggle {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-9deg) scale(1.08); }
  65% { transform: rotate(7deg) scale(1.06); }
}
@keyframes arpi-logo-breathe {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
  50% { transform: scale(1.07); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--primary) 55%, transparent)); }
}
@keyframes arpi-gift-float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}
@keyframes shorts-slide-in {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .animations .rail-item .ico, .animations .rail-item.is-active .ico,
  .animations .home-mark .ico, .animations .gift-emoji, .animations .gift-order-emoji {
    animation: none !important;
  }
}

/* -------- Shorts -------- */
.shorts-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #fff;
  overscroll-behavior: contain;
}
body.shorts-open { overflow: hidden; }
.shorts-head {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: linear-gradient(180deg, rgba(0,0,0,.68), transparent);
  pointer-events: none;
}
.shorts-head h2 {
  flex: 1;
  font-size: calc(17px * var(--font-scale, 1));
  font-weight: 800;
  letter-spacing: .3px;
}
.shorts-head > * { pointer-events: auto; }
.shorts-icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.shorts-icon:hover { background: rgba(255,255,255,.26); transform: scale(1.05); }
.shorts-icon .ico { width: 22px; height: 22px; }
.shorts-feed {
  flex: 1;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  background: #000;
}
.shorts-feed::-webkit-scrollbar { display: none; }
.shorts-slide {
  position: relative;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  overflow: hidden;
  animation: shorts-slide-in .34s var(--ease);
}
.shorts-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.shorts-shade {
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(0deg, rgba(0,0,0,.82), rgba(0,0,0,.28) 55%, transparent);
  pointer-events: none;
}
.shorts-meta {
  position: absolute;
  left: 16px;
  right: 86px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-shadow: 0 1px 8px rgba(0,0,0,.7);
}
.shorts-author { display: flex; align-items: center; gap: 9px; }
.shorts-author .avatar { width: 34px; height: 34px; font-size: calc(12px * var(--font-scale, 1)); }
.shorts-author b { font-size: calc(14px * var(--font-scale, 1)); }
.shorts-author small { font-size: calc(11px * var(--font-scale, 1)); opacity: .8; }
.shorts-caption {
  font-size: calc(13.5px * var(--font-scale, 1));
  line-height: 1.35;
  overflow-wrap: anywhere;
  max-height: 4.2em;
  overflow: hidden;
}
.shorts-side {
  position: absolute;
  right: 10px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.shorts-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  font-size: calc(11px * var(--font-scale, 1));
  text-shadow: 0 1px 6px rgba(0,0,0,.8);
  transition: transform .18s var(--ease);
}
.shorts-act .ico { width: 28px; height: 28px; }
.shorts-act:active { transform: scale(.86); }
.shorts-act.is-liked { color: #ff5b8a; animation: arpi-icon-pop .35s var(--ease); }
.shorts-act.is-liked .ico { fill: currentColor; }
.shorts-act-del { opacity: .78; }
.shorts-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s var(--ease);
  pointer-events: none;
}
.shorts-slide.is-paused .shorts-play { opacity: 1; pointer-events: auto; }
.shorts-play span {
  display: grid;
  place-items: center;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
}
.shorts-play .ico { width: 34px; height: 34px; }
.shorts-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px;
  text-align: center;
  color: #fff;
  pointer-events: none;
}
.shorts-empty[hidden] { display: none; }
.shorts-empty-ico { font-size: 54px; animation: arpi-gift-float 3.6s var(--ease) infinite; }
.shorts-empty b { font-size: calc(17px * var(--font-scale, 1)); }
.shorts-empty p { max-width: 300px; font-size: calc(12.5px * var(--font-scale, 1)); opacity: .72; }
.shorts-progress {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 7;
  width: min(78vw, 360px);
  padding: 16px 18px;
  transform: translate(-50%, -50%);
  border-radius: 22px;
  background: rgba(22,22,26,.92);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(14px);
  text-align: center;
  color: #fff;
}
.shorts-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  overflow: hidden;
  margin-bottom: 10px;
}
.shorts-progress-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--tertiary));
  transition: width .2s var(--ease);
}
.shorts-progress span { font-size: calc(12px * var(--font-scale, 1)); opacity: .86; }
.shorts-sheet {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 8;
  max-height: 68%;
  display: flex;
  flex-direction: column;
  background: var(--surface-container, #1d1b20);
  color: var(--on-surface, #e6e0e9);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -18px 50px rgba(0,0,0,.45);
  animation: shorts-sheet-up .28s var(--ease);
}
@keyframes shorts-sheet-up { from { transform: translateY(60px); opacity: .4; } to { transform: none; opacity: 1; } }
.shorts-sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 8px;
}
.shorts-sheet-head b { flex: 1; font-size: calc(15px * var(--font-scale, 1)); }
.shorts-comments {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shorts-comment { display: flex; gap: 10px; }
.shorts-comment .avatar { flex: none; width: 32px; height: 32px; font-size: calc(11px * var(--font-scale, 1)); }
.shorts-comment-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shorts-comment-body b { font-size: calc(12.5px * var(--font-scale, 1)); }
.shorts-comment-body p { font-size: calc(13px * var(--font-scale, 1)); overflow-wrap: anywhere; }
.shorts-comment-body small { font-size: calc(10.5px * var(--font-scale, 1)); color: var(--on-surface-variant); }
/* ============================================================
   Подарки в чате (Material You карточки, как на фото)
   ============================================================ */
.msg-gift {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 35%, transparent), color-mix(in srgb, var(--tertiary) 25%, transparent));
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--outline-variant));
  box-shadow: var(--shadow-2);
  max-width: 320px;
  margin: 8px auto;
  animation: gift-pop .45s cubic-bezier(.2, 1.5, .4, 1) both;
}
@keyframes gift-pop {
  0% { opacity: 0; transform: scale(.6) rotate(-8deg); }
  70% { transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}
.msg-gift-cover {
  width: 140px;
  height: 140px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--on-surface) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--on-surface) 20%, transparent);
  font-size: 56px;
  overflow: hidden;
  position: relative;
}
.msg-gift-cover img {
  width: 100%; height: 100%; object-fit: cover;
}
.msg-gift-badge {
  position: absolute;
  top: 8px; right: 8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--error);
  color: var(--on-error);
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.msg-gift-body { text-align: center; }
.msg-gift-title {
  font-size: calc(16px * var(--font-scale, 1));
  font-weight: 700;
  color: var(--on-surface);
  margin: 0 0 4px;
}
.msg-gift-sub {
  font-size: calc(12px * var(--font-scale, 1));
  color: var(--on-surface-variant);
  margin: 0 0 8px;
  display: block;
}
.msg-gift-from {
  font-size: calc(13px * var(--font-scale, 1));
  color: var(--primary);
  font-weight: 600;
  margin: 0 0 6px;
}
.msg-gift-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: calc(13px * var(--font-scale, 1));
  font-weight: 600;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-1);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.msg-gift-view:active { transform: scale(.94); box-shadow: none; }
.msg-gift-view .ico { width: 16px; height: 16px; }

/* Статус подарка над сообщением */
.msg-gift-status {
  font-size: calc(11.5px * var(--font-scale, 1));
  color: var(--on-surface-variant);
  text-align: center;
  margin-bottom: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
}

/* Подарок в профиле — сетка */
.profile-gifts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 12px;
  padding: 12px 0;
}
.profile-gift-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--on-surface-variant) 6%, transparent);
  border: 1px solid var(--outline-variant);
  padding: 10px 6px;
  text-align: center;
}
.profile-gift-card .gift-cover {
  width: 64px; height: 64px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-size: 30px;
  overflow: hidden;
  margin-bottom: 4px;
}
.profile-gift-card .gift-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-gift-card .gift-name {
  font-size: calc(11px * var(--font-scale, 1));
  font-weight: 600;
  color: var(--on-surface);
  line-height: 1.2;
}
.profile-gift-card .gift-price {
  font-size: calc(10px * var(--font-scale, 1));
  color: var(--on-surface-variant);
}

/* === Мама Tanya — поздравление с Днём матери === */
.profile-mom-tribute {
  margin: 16px 0;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #ff9a9e 100%);
  color: #5d2e3a;
  box-shadow: 0 10px 30px rgba(255, 154, 158, .35);
  position: relative;
  overflow: hidden;
}
.profile-mom-tribute::before {
  content: "🌹";
  position: absolute;
  top: -16px; right: -16px;
  font-size: 44px;
  opacity: .6;
}
.profile-mom-tribute h3 {
  margin: 0 0 6px;
  font-size: calc(19px * var(--font-scale, 1));
  font-weight: 800;
  color: #4a1e28;
}
.profile-mom-tribute p {
  margin: 0;
  font-size: calc(15px * var(--font-scale, 1));
  line-height: 1.45;
  color: #5d2e3a;
}
.profile-mom-tribute .mom-sign {
  margin-top: 10px;
  display: block;
  font-size: calc(13px * var(--font-scale, 1));
  font-weight: 700;
  color: #8e3a48;
  text-align: right;
}

/* Улучшения Material You для всего приложения */
.app { background: var(--surface); }
.list-pane, .chat-pane { background: var(--surface); }
.dialog { background: var(--glass-bg); border: 1px solid var(--glass-border); }

.shorts-comment-form {
  display: flex;
  gap: 8px;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--outline-variant, rgba(255,255,255,.12));
}
.shorts-comment-form input {
  flex: 1;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--outline, rgba(255,255,255,.2));
  border-radius: 999px;
  background: var(--surface-container-high, #2b292f);
  color: inherit;
  font: inherit;
  font-size: calc(14px * var(--font-scale, 1));
  outline: none;
}
.shorts-comment-form input:focus { border-color: var(--primary); }
.shorts-send {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  cursor: pointer;
}
.shorts-send .ico { width: 21px; height: 21px; }

/* -------- ����� ���� ������ -------- */
.dialog-video { max-width: 640px; }
.whatsnew-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #000;
  margin: 6px 0 12px;
  object-fit: contain;
}
.whatsnew-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: calc(12.5px * var(--font-scale, 1));
  color: var(--on-surface-variant);
  margin-bottom: 6px;
}

/* -------- функции плеера и галерея скриншотов (Material You) -------- */
.video-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.video-speeds {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-container-high, rgba(255, 255, 255, .06));
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--outline-variant, rgba(255, 255, 255, .16));
  border-radius: 999px;
  background: transparent;
  color: var(--on-surface-variant);
  font: inherit;
  font-size: calc(12.5px * var(--font-scale, 1));
  font-weight: 600;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), transform .12s var(--ease);
}
.chip:active { transform: scale(.96); }
.chip.is-active {
  background: var(--secondary-container, rgba(201, 180, 255, .22));
  border-color: transparent;
  color: var(--on-secondary-container, #fff);
}
.video-speeds .chip { height: 28px; padding: 0 12px; border: none; }
.video-speeds .chip.is-active { background: var(--primary); color: var(--on-primary, #fff); }
.chip .ico { width: 16px; height: 16px; }

.shot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 14px;
}
.shot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--outline-variant, rgba(255, 255, 255, .12));
  border-radius: 20px;
  background: var(--surface-container-low, rgba(255, 255, 255, .04));
  color: var(--on-surface-variant);
  font: inherit;
  font-size: calc(11px * var(--font-scale, 1));
  cursor: pointer;
  overflow: hidden;
  transition: transform .16s var(--ease), border-color .16s var(--ease);
}
.shot:hover { border-color: color-mix(in srgb, var(--primary) 55%, transparent); }
.shot:active { transform: scale(.97); }
.shot img {
  width: 100%;
  aspect-ratio: 500 / 980;
  object-fit: cover;
  object-position: top center;
  border-radius: 14px;
  background: var(--surface-container);
  display: block;
}
.shot span {
  display: block;
  text-align: center;
  font-weight: 600;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialog-shot { max-width: 520px; }
.shot-view-head { display: flex; align-items: center; gap: 12px; }
.shot-view-head h2 { flex: 1 1 auto; min-width: 0; }
.shot-view-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 22px;
  background: var(--surface-container-low, #14121a);
  margin-top: 8px;
}

@media (max-width: 420px) {
  .shot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* -------- ���������� ������ ��������� � Shorts -------- */
@media (max-width: 760px) {
  .rail-shorts .ico { color: var(--primary); }
  .shorts-meta { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}

.short-preview {
  width: 100%;
  max-height: 46vh;
  border-radius: 18px;
  background: #000;
  margin: 8px 0 14px;
  object-fit: contain;
}

/* Игра-поздравление ко Дню матери — ссылка в профиле */
a.pf-mom-game {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-container-low, transparent));
}
a.pf-mom-game .pf-label { flex: 1; }
a.pf-mom-game .pf-label small { color: var(--primary-light, #81c784); }

/* ============================================================
   Material You везде + жидкое стекло на переключателях режимов
   ============================================================ */
:root {
  --glass-bg: rgba(18, 38, 22, .62);
  --glass-bg-strong: rgba(24, 50, 29, .82);
  --glass-bg-soft: rgba(14, 30, 18, .46);
  --glass-bubble: rgba(26, 54, 32, .76);
  --glass-border: rgba(140, 220, 150, .22);
  --glass-sheen: rgba(255, 255, 255, .14);
}
:root[data-theme="dark"] {
  --glass-bg: rgba(10, 22, 12, .68);
  --glass-bg-strong: rgba(16, 34, 19, .86);
  --glass-bg-soft: rgba(8, 18, 10, .50);
  --glass-bubble: rgba(20, 42, 24, .80);
  --glass-border: rgba(129, 199, 132, .20);
}

/* --- Жидкое стекло: переключатели режимов на главной --- */
.chat-filters { padding-top: 4px; padding-bottom: 10px; }
.chat-filter {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-soft);
  color: var(--on-surface-variant);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-sheen), 0 4px 14px rgba(0, 0, 0, .18);
  transition: background .25s var(--ease), color .2s var(--ease),
              border-color .25s var(--ease), box-shadow .25s var(--ease), transform .15s var(--ease);
}
.chat-filter::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.22), transparent 38%,
                             transparent 62%, rgba(140,220,150,.14));
  opacity: .85;
}
.chat-filter:hover {
  border-color: color-mix(in srgb, var(--primary) 60%, transparent);
  color: var(--on-surface);
}
.chat-filter:active { transform: scale(.96); }
.chat-filter.is-active {
  border-color: color-mix(in srgb, var(--primary) 75%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 88%, #fff 12%), var(--primary));
  color: var(--on-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35),
              0 6px 20px color-mix(in srgb, var(--primary) 45%, transparent);
}
.chat-filter.is-active::before { opacity: 1; }
body.glass .chat-filter:not(.is-active) { background: var(--glass-bg-soft); }

/* Также стеклянные переключатели режимов оформления */
.mode-btn {
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--glass-sheen);
}

/* --- Единые Material You поверхности во всех окнах --- */
.dialog, .dialog-wrap .dialog, .bottom-sheet, .sheet, .menu, .popup {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-l);
  color: var(--on-surface);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--shadow-3);
}
.dialog h2, .dialog h3, .sheet h2 { color: var(--on-surface); }
.dialog-sub, .dialog-note { color: var(--on-surface-variant); }

.btn-filled, .btn-primary, .send-btn, .fab {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 999px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 28%, transparent);
}
.btn-text, .btn-tonal { color: var(--primary); }
.btn-outline { border-color: var(--primary); color: var(--primary); }

input, textarea, select {
  color: var(--on-surface);
  caret-color: var(--primary);
  accent-color: var(--primary);
}
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--primary); }
::selection { background: color-mix(in srgb, var(--primary) 45%, transparent); color: var(--on-surface); }

a { color: var(--primary); }
.ripple-dot { background: color-mix(in srgb, var(--primary) 42%, transparent); }

.rail-item.is-active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}
.bubble.in { background: var(--surface-container-low); color: var(--on-surface); }
.bubble.out {
  background: color-mix(in srgb, var(--primary) 28%, var(--surface-container));
  color: var(--on-surface);
}

.chip, .gift-tab, .font-chip, .amount-chip, .icon-choice, .t20-palette, .t20-shape {
  border-radius: 999px;
  border-color: var(--glass-border);
  color: var(--on-surface-variant);
}
.chip.is-active, .gift-tab.is-active, .font-chip.is-active,
.amount-chip.is-active, .icon-choice.is-active {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: 999px;
}
*::-webkit-scrollbar-track { background: transparent; }

/* Голосовая запись — та же зелёная палитра Material You */
.composer .voice-rec {
  background: linear-gradient(110deg, #1b5e20 0%, #2e7d32 42%, #4caf50 78%, #1b5e20 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18),
              0 16px 40px rgba(27,94,32,.42), 0 0 30px rgba(76,175,80,.28);
}
.voice-send { background: #fff; color: #1b5e20; }
.voice-label { background: linear-gradient(90deg, #fff 0%, #c8e6c9 45%, #fff 90%); }

/* Добиваем серые/фиолетовые хардкоды старого вида — везде зелёный Material You */
.list .item.is-active { background: color-mix(in srgb, var(--primary) 22%, var(--surface-container)); }
.list .badge { background: var(--primary); color: var(--on-primary); }
.avatar.has-presence::after {
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--surface-container);
}
.item-preview, .item-time { color: var(--on-surface-variant); }
.item-action, .item-count { color: var(--on-surface); }

/* --- Фон приложения: несколько обоев Material You --- */
.app { background: transparent; }
.list-pane, .chat-pane { background: color-mix(in srgb, var(--surface) 94%, transparent); }
body.glass .list-pane, body.glass .chat-pane { background: transparent; }

html[data-theme] body[data-wallpaper="forest"], html[data-theme] body.glass[data-wallpaper="forest"] {
  background:
    radial-gradient(100% 75% at 0% 0%, rgba(76,175,80,.30) 0%, transparent 62%),
    radial-gradient(85% 70% at 100% 5%, rgba(129,199,132,.22) 0%, transparent 60%),
    radial-gradient(90% 80% at 50% 100%, rgba(27,94,32,.30) 0%, transparent 62%),
    var(--surface);
  background-attachment: fixed;
}
html[data-theme] body[data-wallpaper="emerald"], html[data-theme] body.glass[data-wallpaper="emerald"] {
  background:
    radial-gradient(100% 75% at 0% 0%, rgba(0,137,123,.34) 0%, transparent 62%),
    radial-gradient(85% 70% at 100% 5%, rgba(76,175,80,.24) 0%, transparent 60%),
    radial-gradient(90% 80% at 50% 100%, rgba(0,77,64,.34) 0%, transparent 62%),
    var(--surface);
  background-attachment: fixed;
}
html[data-theme] body[data-wallpaper="mint"], html[data-theme] body.glass[data-wallpaper="mint"] {
  background:
    radial-gradient(100% 75% at 0% 0%, rgba(165,214,167,.30) 0%, transparent 62%),
    radial-gradient(85% 70% at 100% 5%, rgba(129,199,132,.26) 0%, transparent 60%),
    radial-gradient(90% 80% at 50% 100%, rgba(46,125,50,.28) 0%, transparent 62%),
    var(--surface);
  background-attachment: fixed;
}
html[data-theme] body[data-wallpaper="ocean"], html[data-theme] body.glass[data-wallpaper="ocean"] {
  background:
    radial-gradient(100% 75% at 0% 0%, rgba(30,136,229,.32) 0%, transparent 62%),
    radial-gradient(85% 70% at 100% 5%, rgba(0,150,136,.24) 0%, transparent 60%),
    radial-gradient(90% 80% at 50% 100%, rgba(21,101,192,.28) 0%, transparent 62%),
    var(--surface);
  background-attachment: fixed;
}
html[data-theme] body[data-wallpaper="lavender"], html[data-theme] body.glass[data-wallpaper="lavender"] {
  background:
    radial-gradient(100% 75% at 0% 0%, rgba(126,87,194,.34) 0%, transparent 62%),
    radial-gradient(85% 70% at 100% 5%, rgba(214,123,178,.22) 0%, transparent 60%),
    radial-gradient(90% 80% at 50% 100%, rgba(81,45,168,.30) 0%, transparent 62%),
    var(--surface);
  background-attachment: fixed;
}
html[data-theme] body[data-wallpaper="sunset"], html[data-theme] body.glass[data-wallpaper="sunset"] {
  background:
    radial-gradient(100% 75% at 0% 0%, rgba(255,112,67,.30) 0%, transparent 62%),
    radial-gradient(85% 70% at 100% 5%, rgba(255,183,77,.24) 0%, transparent 60%),
    radial-gradient(90% 80% at 50% 100%, rgba(230,81,0,.26) 0%, transparent 62%),
    var(--surface);
  background-attachment: fixed;
}
html[data-theme] body[data-wallpaper="graphite"], html[data-theme] body.glass[data-wallpaper="graphite"] {
  background:
    radial-gradient(100% 75% at 0% 0%, rgba(84,110,122,.30) 0%, transparent 62%),
    radial-gradient(85% 70% at 100% 5%, rgba(120,144,156,.20) 0%, transparent 60%),
    radial-gradient(90% 80% at 50% 100%, rgba(38,50,56,.34) 0%, transparent 62%),
    var(--surface);
  background-attachment: fixed;
}

.t20-wallpapers { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.t20-wallpapers::-webkit-scrollbar { display: none; }
.t20-wallpaper {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: transparent;
  color: var(--on-surface-variant);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .12s var(--ease);
}
.t20-wallpaper i { display: block; width: 48px; height: 34px; border-radius: 12px; }
.t20-wallpaper:active { transform: scale(.95); }
.t20-wallpaper.is-active {
  border-color: var(--primary);
  color: var(--on-surface);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}
