/* Lumo component layer: explicit styles for interactive UI and generated components. */
.new-group-btn{min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 13px;border:1px solid rgba(86,139,255,.24);border-radius:14px;background:linear-gradient(180deg,rgba(27,91,188,.38),rgba(29,52,113,.28));color:#dce9ff;box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 8px 20px rgba(4,30,90,.16);transition:transform .16s ease,border-color .16s ease,background .16s ease,box-shadow .16s ease;font-size:13px;font-weight:700;white-space:nowrap}
.new-group-btn svg{flex:none}.new-group-btn:hover{background:linear-gradient(180deg,rgba(37,112,231,.5),rgba(49,71,142,.36));border-color:rgba(95,151,255,.48);box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 10px 24px rgba(20,75,190,.22)}.new-group-btn:active{transform:translateY(1px) scale(.98)}.new-group-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
html[data-theme="light"] .new-group-btn{background:linear-gradient(180deg,rgba(63,125,232,.12),rgba(67,92,169,.07));color:var(--link);border-color:var(--line-strong);box-shadow:none}
.group-create-sheet{max-height:min(760px,88dvh);overflow:auto;scrollbar-gutter:stable}.group-create-sub{padding:0 10px 12px;color:var(--muted);font-size:12.5px;line-height:1.45}.group-create-field{display:block;margin:0 4px 14px}.group-create-field span,.group-create-section-title{display:block;margin-bottom:7px;padding:0 2px;color:var(--muted);font-size:12px;font-weight:700;letter-spacing:.02em}
#groupTitle{width:100%;min-height:46px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;outline:none;background:var(--panel-2);color:var(--text);font:inherit;transition:border-color .15s ease,box-shadow .15s ease,background .15s ease}#groupTitle::placeholder{color:var(--muted)}#groupTitle:focus{border-color:var(--line-strong);box-shadow:0 0 0 4px rgba(39,134,255,.10)}
.group-create-section{margin:0 4px 14px;padding:12px;border:1px solid var(--line);border-radius:16px;background:color-mix(in srgb,var(--panel-2) 78%,transparent)}.group-members{display:flex;flex-direction:column;gap:6px;max-height:36dvh;overflow-y:auto;padding-right:2px}.group-members .row-line{min-height:48px;padding:8px 10px;border:1px solid transparent;border-radius:13px;background:transparent;cursor:pointer}.group-members .row-line:hover{background:var(--hover);border-color:var(--line)}.group-members .row-line span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-members .row-line input{display:block;width:20px;height:20px;flex:none;accent-color:var(--accent)}
.group-create-actions{position:sticky;bottom:0;margin-top:2px;padding-top:12px;background:linear-gradient(180deg,transparent,var(--sheet-bg,rgba(5,12,27,.98)) 35%)}.cbtn.primary{background:linear-gradient(135deg,#1985ff,#6548ff);border-color:transparent;color:#fff;box-shadow:0 10px 24px rgba(44,98,235,.24)}.cbtn.primary:hover{filter:brightness(1.07)}html[data-theme="light"] .group-create-actions{--sheet-bg:rgba(242,246,255,.98)}html[data-theme="light"] .group-create-section{background:rgba(238,244,255,.7)}
.gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:4px 2px}.gallery-image{display:block;width:100%;aspect-ratio:1;object-fit:cover;border:0;border-radius:12px;cursor:pointer;background:var(--panel-2);transition:transform .15s ease,filter .15s ease}.gallery-image:hover{transform:translateY(-1px);filter:brightness(1.04)}
.slash-icon{display:inline-flex;align-items:center;justify-content:center;width:26px;flex:0 0 26px;font-size:20px}.slash-hint{color:var(--muted)}.settings-loading{padding:10px 16px}.row-line-static{cursor:default}.hint-notifications{padding:0 14px 10px;font-size:12.5px;color:var(--muted);line-height:1.4}
@media(max-width:699px){.new-group-btn{width:40px;min-width:40px;padding:0;border-radius:13px}.new-group-btn span{display:none}}

/* ============================================================
   Games panel (кнопка → панель)
   ============================================================ */
#gamePanel.game-panel,
.game-panel {
  border-radius: 18px 18px 0 0;
  padding: 12px 12px 14px !important;
  background: linear-gradient(180deg, rgba(10,22,48,.98), rgba(5,12,27,.98)) !important;
  border: 1px solid rgba(80,132,238,.18) !important;
  border-bottom: none !important;
  box-shadow: 0 -18px 50px rgba(0,0,0,.4) !important;
  max-height: 280px !important;
}
html[data-theme="light"] .game-panel {
  background: linear-gradient(180deg, #ffffff, #f0f5ff) !important;
  border-color: var(--line) !important;
}
.game-title {
  font-weight: 800 !important;
  font-size: 13.5px !important;
  letter-spacing: .02em;
  color: var(--muted) !important;
  padding: 2px 6px 12px !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
}
.game-grid button {
  width: auto !important;
  height: auto !important;
  min-height: 78px;
  padding: 12px 8px !important;
  background: rgba(17,32,66,.85) !important;
  color: var(--text) !important;
  border: 1px solid rgba(82,126,218,.16) !important;
  border-radius: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  cursor: pointer;
  transition: transform .14s ease, background .15s, border-color .15s, box-shadow .15s;
}
html[data-theme="light"] .game-grid button {
  background: var(--panel-2) !important;
  border-color: var(--line) !important;
}
.game-grid button:hover {
  background: rgba(30,55,110,.95) !important;
  border-color: rgba(95,150,255,.35) !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20,70,180,.22);
}
.game-grid button:active {
  transform: scale(.96);
}
.game-grid button span {
  font-size: 26px !important;
  line-height: 1.1;
}
.game-grid button b {
  font-size: 12.5px !important;
  font-weight: 700;
  letter-spacing: -.01em;
}
.game-grid button small {
  color: var(--muted) !important;
  font-size: 10.5px !important;
  font-weight: 500;
}

/* ============================================================
   Game result cards in chat
   ============================================================ */
.game-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 180px;
  max-width: 260px;
  padding: 14px 16px 12px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(28,58,130,.55), rgba(18,32,80,.7));
  border: 1px solid rgba(90,140,255,.22);
  box-shadow: 0 8px 24px rgba(10,40,120,.18), inset 0 1px 0 rgba(255,255,255,.06);
  position: relative;
  overflow: hidden;
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 80px at 10% 0%, rgba(80,150,255,.18), transparent 70%);
  pointer-events: none;
}
.mrow.own .game-card {
  background: linear-gradient(145deg, rgba(40,90,200,.45), rgba(30,50,140,.55));
  border-color: rgba(140,180,255,.25);
}
html[data-theme="light"] .game-card {
  background: linear-gradient(145deg, #e8f1ff, #f4f7ff);
  border-color: rgba(60,120,220,.18);
  box-shadow: 0 6px 18px rgba(40,90,180,.08);
}
.gc-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 2px;
}
.game-card > span:not(.gc-icon) {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.gc-result {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -.02em;
  margin-top: 2px;
}
.gc-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* ============================================================
   Video notes (кружки) — recording overlay + message bubbles
   ============================================================ */
#vnoteOverlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 16, .88);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  animation: vnoteIn .22s ease;
}
#vnoteOverlay[hidden] { display: none !important; }
@keyframes vnoteIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.vnote-stage {
  position: relative;
  width: min(320px, 78vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.vnote-stage video,
#vnotePreview {
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  border-radius: 50%;
  object-fit: cover;
  background: #0a1224;
  box-shadow: 0 0 0 3px rgba(255,80,100,.85),
              0 0 0 8px rgba(255,80,100,.15),
              0 20px 60px rgba(0,0,0,.5);
  transform: scaleX(-1); /* mirror selfie */
}
.vnote-ring {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  margin-left: calc(min(280px, 70vw) / -2);
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #ff5c6a;
  border-right-color: #ff5c6a;
  animation: vnoteSpin 1.1s linear infinite;
  pointer-events: none;
  box-sizing: border-box;
}
@keyframes vnoteSpin {
  to { transform: rotate(360deg); }
}
.vnote-time {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.vnote-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}
.vnote-actions button {
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: transform .12s, opacity .15s;
}
.vnote-actions button:active { transform: scale(.94); }
#vnoteCancel {
  min-width: 100px;
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(255,255,255,.1);
  color: #e8eefc;
  font-size: 15px;
  border: 1px solid rgba(255,255,255,.12);
}
#vnoteCancel:hover { background: rgba(255,255,255,.16); }
#vnoteStop {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff5c6a, #e02440);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(224,36,64,.45);
}
#vnoteStop:hover { filter: brightness(1.08); }
.vnote-hint {
  font-size: 13px;
  color: rgba(200,210,230,.7);
  font-weight: 600;
}







.vnote {
  position: relative;
  width: min(240px, 62vw);
  height: min(240px, 62vw);
  border-radius: 50%;
  overflow: hidden;
  background: #121a2a;
  box-shadow:
    0 0 0 3.5px #fff,
    0 12px 36px rgba(0, 0, 0, .4);
  flex: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html[data-theme="light"] .vnote {
  box-shadow:
    0 0 0 3.5px #fff,
    0 10px 28px rgba(20, 40, 90, .22);
}
.vnote video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  background: #0a101c;
  pointer-events: none;
}
.vnote-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, opacity .2s;
}
.vnote-play::before {
  content: "";
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(15, 20, 35, .55);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  transition: transform .15s, background .15s;
}
.vnote-play::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}
.vnote-play:active::before { transform: scale(.92); }
.vnote.playing .vnote-play {
  background: transparent;
  opacity: 0;
  pointer-events: none;
}
.vnote:not(.playing):hover .vnote-play {
  background: rgba(0, 0, 0, .18);
}
.vnote-time-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.vnote-unsupported {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  background: rgba(20, 35, 70, .75);
}
.vnote-fallback {
  font-size: 28px;
  line-height: 1.35;
  color: var(--muted);
}
.vnote-fallback small {
  display: block;
  font-size: 12px;
  margin-top: 6px;
  max-width: 150px;
  margin-left: auto;
  margin-right: auto;
}


.gc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.gc-top .gc-icon {
  font-size: 22px;
  margin: 0;
}
.gc-top > span:not(.gc-icon) {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* ============================================================
   Left rail — SVG icons + polish
   ============================================================ */
.app-rail .rail-btn span,
.app-rail .rail-btn svg {
  display: block;
  width: 22px;
  height: 22px;
  line-height: 1;
}
.app-rail .rail-btn svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-rail .rail-btn.active svg {
  stroke: #eaf2ff;
}
.app-rail .rail-brand .rail-lumo {
  font-size: 20px;
}

/* ============================================================
   Lumo Tools panel (Contacts / Calls / Saved / Files)
   Full LAYOUT — was missing, only paint existed
   ============================================================ */
#lumoTools.lumo-tools,
.lumo-tools {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  pointer-events: auto;
}
#lumoTools[hidden] {
  display: none !important;
}
.lumo-tools-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 18, .62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}
.lumo-tools-card {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 24px 24px 0 0;
  border: 1px solid rgba(98, 150, 255, .26);
  background: linear-gradient(180deg, rgba(13, 22, 42, .98), rgba(7, 14, 29, .99));
  box-shadow: 0 -24px 80px rgba(0, 0, 0, .55), 0 0 60px rgba(44, 112, 255, .12);
  padding: 0 0 calc(var(--sab, 0px) + 12px);
  animation: menu-rise .3s cubic-bezier(.32, .72, .25, 1);
  overflow: hidden;
}
html[data-theme="light"] .lumo-tools-card {
  background: linear-gradient(180deg, #ffffff, #f2f6ff);
  border-color: var(--line);
  box-shadow: 0 -16px 48px rgba(20, 40, 90, .12);
}
@media (min-width: 700px) {
  .lumo-tools {
    align-items: center;
    padding: 24px;
  }
  .lumo-tools-card {
    border-radius: 24px;
    max-height: min(78vh, 680px);
  }
}
.lumo-tools-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(100, 140, 220, .12);
  flex: none;
}
.lumo-tools-head > div {
  min-width: 0;
}
.lumo-tools-kicker {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #6ea8ff;
  margin-bottom: 2px;
}
.lumo-tools-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #f4f8ff;
}
html[data-theme="light"] .lumo-tools-head h3 {
  color: var(--text);
}
.lumo-tools-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 8px;
  max-height: none;
}
.tools-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(126, 155, 214, .18);
  background: rgba(255, 255, 255, .055);
  color: #f4f8ff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
html[data-theme="light"] .tools-search {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
}
.tools-search:focus {
  border-color: rgba(62, 142, 255, .62);
  box-shadow: 0 0 0 3px rgba(62, 142, 255, .15);
}
.tools-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tools-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(117, 147, 206, .12);
  background: rgba(255, 255, 255, .035);
  color: #fff;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
html[data-theme="light"] .tools-row {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
}
.tools-row:hover {
  border-color: rgba(78, 145, 255, .38);
  background: rgba(74, 127, 255, .08);
}
.tools-row:active {
  transform: scale(.985);
}
.tools-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}
.tools-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: linear-gradient(135deg, rgba(69, 136, 255, .2), rgba(169, 94, 255, .18));
  color: #8ab8ff;
}
.tools-row-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tools-row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tools-row-text b {
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tools-row-text small {
  font-size: 12.5px;
  color: #8697b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tools-empty {
  text-align: center;
  padding: 36px 16px;
  color: #8190aa;
  font-size: 14px;
  line-height: 1.45;
}
.tools-empty.hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.tools-empty.hero strong {
  font-size: 16px;
  font-weight: 700;
  color: #ecf4ff;
}
.tools-empty.hero span {
  font-size: 13px;
  color: #8394b0;
  max-width: 260px;
}
.tools-call-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 16px 20px;
  text-align: center;
}
.tools-call-orb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #b9d5ff;
  background: radial-gradient(circle at 35% 30%, #4eafff, #2444c9 55%, #111d4a);
  box-shadow: 0 0 35px rgba(48, 117, 255, .5), inset 0 0 0 2px rgba(255, 255, 255, .18);
}


/* Vnote recording overlay — Telegram-like */
#vnoteOverlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 8, 16, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#vnoteOverlay[hidden] { display: none !important; }
.vnote-stage {
  position: relative;
  width: min(320px, 78vw);
  height: min(320px, 78vw);
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 4px rgba(255,255,255,.95),
    0 0 0 8px rgba(255,80,90,.35),
    0 24px 60px rgba(0,0,0,.5);
}
#vnoteOverlay.locked .vnote-stage {
  box-shadow:
    0 0 0 4px rgba(255,255,255,.95),
    0 0 0 8px rgba(60,160,255,.45),
    0 24px 60px rgba(0,0,0,.5);
}
.vnote-stage video,
#vnotePreview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  background: #0a101c;
  transform: scaleX(-1); /* mirror selfie */
}
.vnote-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid rgba(255, 80, 90, .85);
  pointer-events: none;
  animation: vnoteSpin 1.2s linear infinite;
}
#vnoteOverlay.locked .vnote-ring {
  border-color: rgba(80, 170, 255, .9);
  animation: none;
}
@keyframes vnoteSpin {
  to { transform: rotate(360deg); }
}
.vnote-time {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  z-index: 3;
}
.vnote-lock-hint {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(20, 30, 50, .9);
  color: #c8d6f0;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0;
  transition: opacity .15s, transform .15s;
  pointer-events: none;
  z-index: 4;
}
.vnote-lock-hint.on {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}
.vnote-actions {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 18px;
  z-index: 3;
}
.vnote-actions button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
}
#vnoteCancel {
  background: rgba(255,255,255,.14);
  color: #fff;
}
#vnoteStop {
  background: linear-gradient(145deg, #4aa8ff, #2b6dff);
  color: #fff;
  box-shadow: 0 8px 20px rgba(43,109,255,.4);
}
.vnote-hint {
  position: absolute;
  bottom: -48px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 90vw;
  text-align: center;
  color: rgba(255,255,255,.75);
  font-size: 12.5px;
  font-weight: 500;
}

/* Telegram-ish message layout (palette unchanged) */
.mrow {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 2px 10px;
  padding: 0 4px;
}
.mrow.own { justify-content: flex-end; }
.mrow.their { justify-content: flex-start; }
.mrow.grouped { margin-top: 1px; }
.mrow .av {
  width: 32px !important;
  height: 32px !important;
  font-size: 13px !important;
  flex: none;
  margin-bottom: 2px;
}
.mrow .aspace {
  width: 32px;
  flex: none;
}
.bwrap {
  max-width: min(78%, 420px);
  min-width: 0;
}








#vnoteBtn {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}


/* Recording overlay polish */
#vnoteOverlay {
  background: radial-gradient(ellipse at center, rgba(12,20,40,.55), rgba(2,6,14,.88)) !important;
}
.vnote-stage {
  width: min(340px, 82vw) !important;
  height: min(340px, 82vw) !important;
}
.vnote-actions button {
  width: 54px !important;
  height: 54px !important;
}
#vnoteStop {
  background: linear-gradient(145deg, #4aa8ff, #2b6dff) !important;
}
.vnote-hint {
  bottom: -52px !important;
  font-size: 13px !important;
  color: rgba(255,255,255,.82) !important;
}




.vnote {
  box-shadow: 0 10px 28px rgba(0,0,0,.35) !important;
  border: none !important;
  outline: none !important;
  /* без белого кольца — только лёгкая тень на обоях */
}
html[data-theme="light"] .vnote {
  box-shadow: 0 8px 22px rgba(20,40,80,.18) !important;
}

/* ---- Recording overlay: clean like Telegram ---- */
#vnoteOverlay {
  background: rgba(0,0,0,.45) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
}
.vnote-stage {
  width: min(300px, 78vw) !important;
  height: min(300px, 78vw) !important;
  border-radius: 50% !important;
  overflow: visible !important;
  box-shadow: none !important;
  background: transparent !important;
  position: relative !important;
}
.vnote-stage video,
#vnotePreview {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  background: #1a2030 !important;
  transform: scaleX(-1) !important;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #2b6dff !important;
}
.vnote-ring {
  display: none !important; /* убираем вращающееся кольцо-артефакт */
}
.vnote-time {
  top: 14% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  background: rgba(0,0,0,.55) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  z-index: 5 !important;
  border: none !important;
}
.vnote-lock-hint {
  top: -40px !important;
  z-index: 6 !important;
}
.vnote-actions {
  position: absolute !important;
  bottom: 12% !important;
  left: 0 !important;
  right: 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 16px !important;
  z-index: 6 !important;
  pointer-events: none !important;
}
.vnote-actions button {
  pointer-events: auto !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
}
#vnoteCancel {
  background: rgba(255,255,255,.22) !important;
  color: #fff !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  box-shadow: none !important;
}
#vnoteStop {
  background: #2b8cff !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(43,140,255,.45) !important;
}
#vnoteStop svg {
  width: 20px !important;
  height: 20px !important;
  margin-left: 2px !important;
}
.vnote-hint {
  position: absolute !important;
  bottom: -44px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: max-content !important;
  max-width: 90vw !important;
  text-align: center !important;
  color: rgba(255,255,255,.75) !important;
  font-size: 12.5px !important;
  z-index: 5 !important;
}

#newGroupWrap, .group-create-overlay {
  z-index: 95 !important;
}
.group-create-sheet {
  max-height: min(80vh, 560px);
  overflow-y: auto;
}
.group-members {
  max-height: 40vh;
  overflow-y: auto;
}
.group-members .row-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
}


/* ---- Vnote Telegram-style: small preview → expand + progress ---- */
.vnote {
  width: min(168px, 42vw) !important;
  height: min(168px, 42vw) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.35) !important;
  border: none !important;
  transition: width .22s ease, height .22s ease, box-shadow .22s ease;
}
.vnote.playing {
  width: min(260px, 68vw) !important;
  height: min(260px, 68vw) !important;
  box-shadow: 0 14px 40px rgba(0,0,0,.45) !important;
}
.vnote-progress {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  z-index: 2;
  pointer-events: none;
  transform: rotate(-90deg);
  opacity: 0;
  transition: opacity .15s ease;
}
.vnote.playing .vnote-progress {
  opacity: 1;
}
.vnote-progress-bg {
  fill: none;
  stroke: rgba(255,255,255,.25);
  stroke-width: 3.2;
}
.vnote-progress-fg {
  fill: none;
  stroke: #fff;
  stroke-width: 3.2;
  stroke-linecap: round;
  transition: stroke-dashoffset .08s linear;
}
.vnote:not(.playing) video {
  /* слегка «живой» превью-кадр */
  filter: brightness(.95);
}


/* Превью-кружок: видео видно под кнопкой, таймер аккуратный */
.vnote-play {
  background: transparent !important;
  z-index: 3 !important;
}
.vnote-play::before {
  width: 44px !important;
  height: 44px !important;
  background: rgba(10, 14, 28, .45) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.vnote:not(.playing) .vnote-play {
  /* лёгкое затемнение только в центре — гифка видна */
  background: radial-gradient(circle at center, rgba(0,0,0,.2) 0%, transparent 55%) !important;
}
.vnote.playing .vnote-play {
  opacity: 0 !important;
  pointer-events: none !important;
}
.vnote-time-badge {
  left: 10px !important;
  bottom: 10px !important;
  right: auto !important;
  z-index: 4 !important;
  padding: 2px 7px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  background: rgba(0, 0, 0, .62) !important;
  border-radius: 8px !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  letter-spacing: 0.02em;
}

.vnote video {
  background: #1a2235 !important;
}


/* ============================================================
   FINAL STABILITY / CIRCLES PASS
   ============================================================ */
html, body, #listScreen, #chatScreen, #chatList, #msgs, .list-main {
  overflow-x: hidden !important;
}
body.has-app #listScreen,
body.has-app #listScreen > .app-rail,
body.has-app #listScreen > .list-main,
body.has-app #listScreen .list-main > #chatList {
  overscroll-behavior-x: none !important;
  touch-action: pan-y !important;
}
body.has-app #listScreen .row-item,
body.has-app #listScreen .guser,
body.has-app #listScreen .ri-mid,
body.has-app #listScreen .ri-right {
  min-width: 0 !important;
}
body.has-app #listScreen .row-item {
  max-width: 100% !important;
  transform: none !important;
}
body.has-app #listScreen .row-item:active {
  transform: translateX(0) scale(.995) !important;
}
body.has-app #listScreen .av,
body.has-app #listScreen .me-av {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
}


.vnote {
  width: clamp(150px, 20vw, 188px) !important;
  height: clamp(150px, 20vw, 188px) !important;
  aspect-ratio: 1 !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  isolation: isolate !important;
  background: #111827 !important;
  box-shadow: 0 8px 26px rgba(0,0,0,.34), 0 0 0 1px rgba(255,255,255,.08) !important;
  transform: translateZ(0) !important;
}
.vnote.playing {
  width: clamp(180px, 24vw, 224px) !important;
  height: clamp(180px, 24vw, 224px) !important;
  box-shadow: 0 16px 42px rgba(0,0,0,.42), 0 0 0 1px rgba(255,255,255,.10) !important;
}
.vnote video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  display: block !important;
  background: #111827 !important;
}
.vnote::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  border-radius: 50% !important;
  pointer-events: none !important;
  z-index: 1 !important;
  background: linear-gradient(180deg, rgba(0,0,0,.04) 35%, rgba(0,0,0,.28) 100%) !important;
}
.vnote-play {
  width: 54px !important;
  height: 54px !important;
  border-radius: 50% !important;
  z-index: 4 !important;
  background: rgba(10,16,30,.52) !important;
  border: 1px solid rgba(255,255,255,.24) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.22) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}
.vnote-play::before {
  width: 52px !important;
  height: 52px !important;
  background: transparent !important;
  box-shadow: none !important;
}
.vnote-play::after {
  margin-left: 4px !important;
}
.vnote-time-badge {
  left: 10px !important;
  bottom: 10px !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  z-index: 5 !important;
  background: rgba(5,10,20,.62) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  font-size: 11px !important;
}
.vnote-progress {
  inset: 5px !important;
  width: calc(100% - 10px) !important;
  height: calc(100% - 10px) !important;
  z-index: 3 !important;
}
.vnote-progress-bg { stroke: rgba(255,255,255,.22) !important; stroke-width: 2.7 !important; }
.vnote-progress-fg { stroke: #fff !important; stroke-width: 3 !important; }
.vnote:not(.playing):hover { transform: translateZ(0) scale(1.015) !important; }
.vnote.playing .vnote-play { opacity: 0 !important; }

@media (max-width: 699px){
  .vnote { width: min(178px, 54vw) !important; height: min(178px, 54vw) !important; }
  .vnote.playing { width: min(210px, 66vw) !important; height: min(210px, 66vw) !important; }
}


/* ============================================================
   FINAL SMOOTHNESS / VIDEO NOTE POLISH
   ============================================================ */
#msgs,
#chatList {
  scroll-behavior: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
#msgs {
  contain: layout paint style;
}

.mrow {
  animation: none !important;
}



/* Telegram-like circles: one stable size, no layout jump when playing. */
.vnote {
  width: clamp(156px, 19vw, 184px) !important;
  height: clamp(156px, 19vw, 184px) !important;
  aspect-ratio: 1 / 1 !important;
  transform: translateZ(0);
  contain: layout paint style;
  will-change: transform;
}
.vnote.playing {
  width: clamp(156px, 19vw, 184px) !important;
  height: clamp(156px, 19vw, 184px) !important;
  transform: translateZ(0);
  box-shadow: 0 12px 32px rgba(0,0,0,.38), 0 0 0 1px rgba(255,255,255,.10) !important;
}
.vnote video {
  object-position: center center !important;
  image-rendering: auto;
}
.vnote:not(.playing):hover {
  transform: translateZ(0) scale(1.015) !important;
}
.vnote-play {
  transition: transform .16s cubic-bezier(.22,.7,.22,1), background-color .16s ease, opacity .16s ease !important;
}
.vnote:not(.playing):hover .vnote-play {
  transform: scale(1.04);
}
.vnote.playing .vnote-play {
  opacity: 0 !important;
}
.vnote-time-badge {
  font-variant-numeric: tabular-nums;
}

/* Avoid expensive infinite effects while the app is in a hidden tab. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
   CIRCLE PLAY BUTTON — exact center + stable Telegram-style preview
   ============================================================ */
.vnote {
  position: relative !important;
  display: block !important;
  flex: 0 0 auto !important;
  transform: translateZ(0) !important;
  contain: paint layout !important;
}
.vnote-play {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  place-items: center !important;
  text-align: center !important;
}
.vnote-play::before {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
}
.vnote-play::after {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) translateX(2px) !important;
  margin: 0 !important;
}
.vnote:not(.playing) .vnote-play {
  background: radial-gradient(circle at center, rgba(0,0,0,.15), transparent 48%) !important;
}
.vnote video {
  object-fit: cover !important;
  object-position: center center !important;
  will-change: auto !important;
}


/* ---------- Video circles: crisp image, no blur overlays ---------- */
.vnote, .vnote video {
  filter: none !important;
  -webkit-filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.vnote-play, .vnote-time-badge {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.vnote-play {
  background: rgba(8,12,20,.56) !important;
}

/* ---------- WebRTC calls ---------- */
.call-btn { color: var(--text) !important; }
.call-overlay {
  position: fixed; inset: 0; z-index: 3000; display:flex; align-items:center; justify-content:center;
  background: rgba(5,8,15,.78);
  padding: 20px;
}
.call-overlay[hidden] { display:none !important; }
.call-card {
  width:min(720px, 96vw); max-height:92vh; overflow:auto; border-radius:28px;
  background:var(--panel); border:1px solid var(--line); box-shadow:0 28px 90px rgba(0,0,0,.45);
  padding:20px;
}
.call-top { text-align:center; padding:8px 0 14px; }
.call-avatar { width:72px; height:72px; border-radius:50%; margin:0 auto 10px; display:grid; place-items:center; color:#fff; font-weight:800; font-size:26px; }
.call-state { font-size:12px; color:var(--muted); }
.call-top h3 { margin:4px 0 2px; font-size:21px; }
.call-sub { color:var(--muted); font-size:13px; }
.call-videos { position:relative; min-height:260px; aspect-ratio:16/10; border-radius:22px; overflow:hidden; background:#090c12; }
#remoteVideo { width:100%; height:100%; object-fit:cover; background:#090c12; }
#localVideo { position:absolute; right:14px; bottom:14px; width:min(170px,30%); aspect-ratio:3/4; object-fit:cover; border-radius:18px; border:2px solid rgba(255,255,255,.7); background:#111; }
.call-actions, .call-incoming { display:flex; justify-content:center; gap:12px; padding-top:16px; }
.call-action { border:0; border-radius:999px; min-width:54px; min-height:54px; padding:0 20px; cursor:pointer; color:#fff; background:var(--panel-2); border:1px solid var(--line); font-weight:700; }
.call-action.danger { background:#dc3b54; border-color:#dc3b54; }
.call-action.success { background:#2faf6d; border-color:#2faf6d; }
@media (max-width:700px){
  .call-videos { min-height:220px; }
  #localVideo { width:112px; }
  .call-card { padding:14px; border-radius:22px; }
}

/* ---------- Polls ---------- */
.poll-modal{position:fixed;inset:0;z-index:4100;display:flex;align-items:flex-end;justify-content:center}
.poll-modal[hidden]{display:none!important}
.poll-backdrop{position:absolute;inset:0;background:rgba(1,5,14,.68);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.poll-sheet{position:relative;width:min(520px,100vw);max-height:min(88dvh,760px);overflow:auto;padding:18px 18px calc(18px + var(--sab));background:var(--panel);border:1px solid var(--line);border-radius:28px 28px 0 0;box-shadow:0 -24px 80px rgba(0,0,0,.38);animation:pollIn .2s ease}
@keyframes pollIn{from{transform:translateY(18px);opacity:.4}to{transform:none;opacity:1}}
.poll-sheet header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:16px}.poll-kicker{font-size:10px;font-weight:800;letter-spacing:.14em;color:var(--accent)}.poll-sheet h3{margin-top:3px;font-size:20px}.poll-field{display:block;margin-bottom:16px}.poll-field span,.poll-options-head>span{display:block;font-size:12px;font-weight:700;color:var(--muted);margin:0 0 7px}.poll-field input,.poll-option-input input{width:100%;min-height:46px;border:1px solid var(--line);border-radius:14px;padding:11px 13px;background:var(--panel-2);color:var(--text);font:inherit;outline:none}.poll-field input:focus,.poll-option-input input:focus{border-color:var(--line-strong);box-shadow:0 0 0 4px rgba(39,134,255,.08)}
.poll-options-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.poll-options-head button{border:0;background:transparent;color:var(--link);font-weight:700}.poll-option-input{display:grid;grid-template-columns:26px 1fr 36px;align-items:center;gap:8px;margin-bottom:8px}.poll-option-input>span{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:var(--hover);font-size:11px;color:var(--muted);font-weight:800}.poll-option-input button{width:36px;height:36px;border:0;border-radius:10px;background:transparent;color:var(--muted)}.poll-option-input button:not(:disabled):hover{background:var(--hover);color:var(--danger)}.poll-multi{display:flex;align-items:center;gap:9px;margin:14px 0;font-size:13px;color:var(--text)}.poll-multi input{accent-color:var(--accent);width:17px;height:17px}.poll-actions{display:flex;gap:8px;justify-content:flex-end;padding-top:10px}.cbtn.primary{min-height:42px;padding:0 16px;border-radius:13px}
.poll-card{width:min(360px,74vw);padding:13px 14px 11px;border-radius:18px;background:linear-gradient(145deg,rgba(31,60,125,.62),rgba(14,28,66,.78));border:1px solid rgba(95,145,255,.2);box-shadow:0 10px 28px rgba(8,32,100,.16)}.mrow.own .poll-card{background:linear-gradient(145deg,rgba(31,86,196,.52),rgba(35,54,136,.62))}.poll-head{display:flex;align-items:flex-start;gap:10px;margin-bottom:12px}.poll-card-icon{width:30px;height:30px;border-radius:10px;display:grid;place-items:center;background:rgba(255,255,255,.08);flex:none}.poll-card-title{font-size:15px;line-height:1.3;font-weight:800}.poll-choice{width:100%;border:0;background:transparent;color:var(--text);padding:7px 0;cursor:pointer;text-align:left}.poll-choice-top{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;font-weight:700}.poll-choice-top span:last-child{color:var(--muted);font-variant-numeric:tabular-nums}.poll-bar{display:block;height:5px;margin-top:6px;border-radius:999px;background:rgba(255,255,255,.09);overflow:hidden}.poll-bar i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent),var(--accent-2));transition:width .25s ease}.poll-choice.selected .poll-choice-top span:first-child::before{content:"✓ ";color:var(--accent)}.poll-foot{padding-top:8px;color:var(--muted);font-size:11px}

/* ---------- Call screen ---------- */
.call-card{width:min(760px,96vw)}
.call-stats{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;padding:12px 0 0}.call-stats span{padding:5px 9px;border-radius:999px;background:var(--panel-2);border:1px solid var(--line);font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}.call-videos{min-height:min(58vh,520px);aspect-ratio:16/10}.call-videos::after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;box-shadow:inset 0 0 0 1px rgba(255,255,255,.04)}
#remoteVideo{position:absolute;inset:0}.call-videos>audio{display:none}#localVideo{z-index:3;box-shadow:0 12px 30px rgba(0,0,0,.32)}
.call-actions{align-items:center;flex-wrap:wrap}.call-action{transition:transform .15s ease,filter .15s ease,background .15s ease}.call-action:active{transform:scale(.94)}.call-action.secondary{padding:0;width:54px;background:rgba(255,255,255,.06)}
@media(max-width:700px){.call-overlay{padding:0;align-items:stretch}.call-card{width:100%;max-height:none;height:100dvh;border-radius:0;border:none;padding:calc(12px + var(--sat)) 12px calc(14px + var(--sab));display:flex;flex-direction:column;background:var(--bg)}.call-top{padding-top:10px}.call-videos{flex:1;min-height:0;width:100%;aspect-ratio:auto;border-radius:24px}.call-actions{padding-bottom:8px}.call-action{min-width:52px;min-height:52px}.call-stats{padding:10px 0}.call-incoming{padding-bottom:8px}}
