/* ============================================================
   MILANA LINK STORE — Premium Dark Glassmorphism Design System
   Version: 2.0
   ============================================================ */

/* ─── 1. DESIGN TOKENS ─── */
:root {
  /* Colors — Surface */
  --bg: #0a0a0a;
  --surface-0: #0a0a0a;
  --surface-1: rgba(28, 28, 28, 0.72);
  --surface-2: rgba(34, 34, 34, 0.78);
  --surface-3: rgba(40, 40, 40, 0.84);
  --surface-hover: rgba(255, 255, 255, 0.04);
  --surface-active: rgba(255, 255, 255, 0.07);

  /* Colors — Accent */
  --accent: #D4AF37;
  --accent-2: #b8932b;
  --accent-glow: rgba(212, 175, 55, 0.25);
  --accent-subtle: rgba(212, 175, 55, 0.08);
  --accent-border: rgba(212, 175, 55, 0.3);

  /* Colors — Text */
  --text: #ffffff;
  --text-secondary: #c0c0c0;
  --text-muted: #808080;
  --text-faint: #555555;

  /* Colors — Semantic */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --error: #ff4b4b;
  --error-bg: rgba(255, 75, 75, 0.10);
  --error-border: rgba(255, 75, 75, 0.25);
  --success: #00c853;
  --success-bg: rgba(0, 200, 83, 0.10);
  --success-border: rgba(0, 200, 83, 0.25);
  --ok: #00c853;
  --warning: #ffa726;

  /* Spacing */
  --sp-xxs: 4px;
  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;

  /* Radius */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px var(--accent-glow);

  /* Glass */
  --blur-sm: blur(8px);
  --blur-md: blur(16px);
  --blur-lg: blur(24px);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.15s var(--ease);
  --t-base: 0.25s var(--ease);
  --t-slow: 0.4s var(--ease);
  --transition: all 0.25s var(--ease);

  /* Z-index */
  --z-bg: -1;
  --z-content: 1;
  --z-sticky: 50;
  --z-topbar: 100;
  --z-bottombar: 100;
  --z-dropdown: 200;
  --z-sheet: 300;
  --z-modal: 500;
  --z-toast: 950;
  --z-critical: 900;

  /* Typography */
  --font: Roboto, 'Space Grotesk', system-ui, sans-serif;
  --fs-display: 32px;
  --fs-h1: 24px;
  --fs-h2: 18px;
  --fs-h3: 15px;
  --fs-body: 14px;
  --fs-body-sm: 13px;
  --fs-caption: 12px;
  --fs-label: 11px;
  --fs-micro: 10px;
  --fw-regular: 400;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh-tight: 1.2;
  --lh-base: 1.4;
  --lh-relaxed: 1.6;

  /* Layout */
  --topbar-h: 56px;
  --bottombar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ─── 2. RESET & BASE ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  color: var(--text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[data-locked] {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* ─── 3. SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }

/* ─── 4. FOCUS ─── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── 5. BACKGROUND ─── */
.bg-fixed {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  background-color: #0B0704;
  background-image:
    linear-gradient(rgba(11,7,4,.80), rgba(11,7,4,.80)),
    url(/icons/bg-pattern.jpg?v=1),
    radial-gradient(1000px 600px at 80% -10%, rgba(212,175,55,.04), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(139,92,246,.03), transparent 60%);
  background-size: cover, cover, 1000px 600px, 800px 500px;
  background-position: center, center, 80% -10%, -10% 110%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  pointer-events: none;
}

/* ─── 6. TYPOGRAPHY HELPERS ─── */
.muted { color: var(--text-muted); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: var(--fs-h1); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }

/* ─── 7. TOPBAR ─── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-md);
  background: rgba(16, 16, 16, 0.85);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-topbar);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

.topbar .brand .logo-svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.topbar .brand span {
  font-weight: var(--fw-bold);
  font-size: var(--fs-body-sm);
  letter-spacing: 0.5px;
}

.topbar .nav {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.topbar .me {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-body-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
  color: var(--text-muted);
}

/* ─── 8. BOTTOMBAR ─── */
.bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottombar-h);
  padding: 0 14px calc(10px + var(--safe-bottom));
  background: transparent;
  border: none;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  z-index: var(--z-bottombar);
  pointer-events: none;
}
.bottombar::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  bottom: calc(10px + var(--safe-bottom));
  background: linear-gradient(rgba(255,255,255,.08), rgba(255,255,255,.04));
  background-color: rgba(12, 12, 14, 0.82);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 26px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.bn {
  background: none;
  border: none;
  color: rgba(255,255,255,.55);
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 6px;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  transition: color var(--t-fast), transform var(--t-fast);
  min-width: 56px;
}

.bn svg {
  width: 22px;
  height: 22px;
  padding: 6px 14px;
  box-sizing: content-box;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: transform var(--t-fast);
}

.bn.active {
  color: #FFF0B0;
  font-weight: 700;
}

.bn.active svg {
  transform: scale(1.06);
  color: #F0AF15;
  background: linear-gradient(rgba(240,175,21,.22), rgba(229,169,34,.16));
  border-color: rgba(240,175,21,.4);
  box-shadow: 0 0 12px rgba(229,169,34,.2);
}

.bn:active {
  transform: scale(0.92);
}

.bcastbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 14px calc(10px + var(--safe-bottom));
  background: transparent;
  border: none;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  z-index: var(--z-bottombar);
  pointer-events: none;
}
.bcastbar::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  bottom: calc(10px + var(--safe-bottom));
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
}
.bb {
  background: none;
  border: none;
  color: rgba(255,255,255,.62);
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.bb svg {
  width: 22px;
  height: 22px;
}
.bb.active {
  color: #F0AF15;
  background: rgba(240,175,21,.18);
}
.bb:active {
  transform: scale(0.92);
}
.bb-start {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg,#FFF3B0,#F9D976,#D4A017,#8A5A00);
  color: #080603;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(212,175,55,.35);
}
.bb-start svg {
  width: 26px;
  height: 26px;
}
.bb-start:active {
  transform: scale(0.92);
}

/* ─── 9. WRAP / LAYOUT ─── */
.wrap {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: var(--bottombar-h);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: var(--z-content);
}

body:not(.admin) .wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--sp-sm);
  padding-bottom: var(--sp-md);
}

body.admin .wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--sp-md);
  padding-bottom: var(--sp-md);
}

/* ─── 10. GLASS LEVELS ─── */
.card,
.card.soft,
.block,
.modalcard {
  background: var(--surface-1);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  margin-bottom: var(--sp-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.item,
.prod {
  background: var(--surface-1);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-sm) var(--sp-md);
  margin-bottom: var(--sp-xs);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.item:hover,
.prod:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.item:active,
.prod:active {
  transform: scale(0.985);
  background: var(--surface-active);
}

.item .muted {
  font-size: var(--fs-caption);
}

/* ─── 11. BUTTONS ─── */
button {
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--t-fast);
}

.primary,
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1300;
  font-weight: var(--fw-bold);
  font-size: var(--fs-body-sm);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-sm);
  border: none;
  box-shadow: 0 4px 16px var(--accent-glow);
  letter-spacing: 0.3px;
  width: 100%;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.primary:active {
  transform: translateY(0) scale(0.98);
}

.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ghost {
  background: rgba(255,255,255,.03);
  color: var(--text);
  border: 1px solid var(--border);
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--r-sm);
  font-size: var(--fs-body-sm);
}

.ghost:hover {
  background: rgba(255,255,255,.06);
  border-color: var(--border-strong);
}

.ghost:active {
  transform: scale(0.97);
}

.sm {
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--r-sm);
  font-size: var(--fs-caption);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-family: var(--font);
  white-space: nowrap;
  transition: all var(--t-fast);
}

.sm:hover {
  background: rgba(255,255,255,.08);
}

.sm:active {
  transform: scale(0.95);
}

.sm.active {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent);
}

.sm.red {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: #ff8a8a;
}

.sm.red:hover {
  background: rgba(255,75,75,.18);
}

.mgmt {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs);
  align-items: center;
}

.mgmt .sm {
  border-color: rgba(56,189,248,.25);
  color: #aee9ff;
}

/* ─── 12. FORMS / INPUTS ─── */
.search,
input[type="text"],
input[type="tel"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-sm) var(--sp-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  overflow: hidden;
  text-overflow: ellipsis;
}

.search:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

label {
  font-size: var(--fs-label);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: block;
}

select.search {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23808080' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

select.search option {
  background: #1a1a1a;
  color: var(--text);
}

textarea.search {
  resize: vertical;
  min-height: 60px;
  line-height: var(--lh-relaxed);
}

.check {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  cursor: pointer;
  font-size: var(--fs-body-sm);
  color: var(--text-muted);
}

.check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── 13. MESSAGES / NOTIFICATIONS ─── */
.msg {
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--r-sm);
  font-size: var(--fs-caption);
  margin-top: var(--sp-xs);
  word-wrap: break-word;
  line-height: var(--lh-relaxed);
}

.msg.ok {
  background: var(--success-bg);
  color: #7dffb0;
  border: 1px solid var(--success-border);
}

.msg.err {
  background: var(--error-bg);
  color: #ff9a9a;
  border: 1px solid var(--error-border);
}

.results {
  margin: var(--sp-xs) 0;
}

/* ─── 14. TABLE ─── */
#tbl {
  width: 100%;
  border-collapse: collapse;
}

#tbl th {
  text-align: left;
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: var(--sp-xs) var(--sp-sm);
  border-bottom: 1px solid var(--border);
}

#tbl td {
  padding: var(--sp-sm);
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: var(--fs-body-sm);
}

#tbl tbody tr {
  cursor: pointer;
  transition: background var(--t-fast);
}

#tbl tbody tr:hover {
  background: var(--surface-hover);
}

.badge {
  font-size: var(--fs-caption);
  padding: 2px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  white-space: nowrap;
  display: inline-block;
  font-weight: var(--fw-semibold);
}

.badge.on {
  color: var(--ok);
  border-color: rgba(0,200,83,.3);
}

.badge.off {
  color: #ff9a9a;
  border-color: rgba(255,75,75,.3);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) 0;
  border-bottom: 1px solid var(--border);
}

/* ─── 15. DETAIL / BOTTOM SHEET ─── */
#detail,
.detail {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-sheet);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s var(--ease-out);
}

#detail > *,
.detail > * {
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
  width: 100%;
  max-width: 600px;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border-top: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--sp-lg) var(--sp-md) calc(var(--sp-xl) + var(--safe-bottom));
  box-shadow: var(--shadow-xl);
  animation: sheetUp 0.3s var(--ease-out);
}

#detail h3,
.detail h3 {
  margin: 0 0 var(--sp-xs);
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
}

/* ─── 16. HERO / PROFILE ─── */
.hero {
  text-align: center;
  padding: var(--sp-sm) 0 var(--sp-xs);
}

.avawrap {
  display: inline-block;
  position: relative;
}

.avatar-xl {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(139,92,246,.15);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
}

.avatar-xl.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: var(--fw-bold);
  color: #fff;
  text-shadow: 0 0 12px rgba(139,92,246,.5);
  background: linear-gradient(135deg, #3b2a7a, #2a4a9a);
  border: none;
}

.hero-name {
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  margin-top: var(--sp-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── PROFILE (как в АПК: шапка, hero, iOS-группы) ─── */
.pf-head{display:flex;align-items:center;justify-content:space-between;padding:18px 20px 6px}
.pf-head>span{font-size:20px;font-weight:900;color:#FFF0B0;letter-spacing:1px}
.pf-gear{width:38px;height:38px;border-radius:12px;background:rgba(255,255,255,.06);border:1px solid rgba(240,175,21,.2);color:#F0AF15;font-size:20px;cursor:pointer;font-family:inherit}
.pf-hero{margin:6px 16px 0;padding:20px;border-radius:20px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.11);text-align:center;box-shadow:0 8px 32px rgba(0,0,0,.4)}
.pf-avawrap{width:88px;height:88px;border-radius:50%;margin:0 auto;padding:3px;background:radial-gradient(circle,rgba(240,175,21,.15),transparent);border:1px solid rgba(240,175,21,.35);box-sizing:border-box}
.pf-avawrap .avatar-xl{width:82px;height:82px}
.pf-hero .hero-name{font-size:20px;color:#FFF0B0}
.pf-hero .hero-sub{color:#E8C87A}
.pf-offbadge{display:inline-block;margin-top:8px;padding:4px 10px;border-radius:8px;background:linear-gradient(135deg,#FFF3B0,#F9D976,#D4A017,#8A5A00);color:#080603;font-size:10px;font-weight:900;letter-spacing:.8px}
.pf-group-h{display:flex;align-items:center;margin:14px 20px 6px;font-size:11px;font-weight:700;color:#F0AF15;letter-spacing:1px;text-transform:uppercase}
.pf-group-h::before{content:"";width:22px;height:1px;background:linear-gradient(90deg,transparent,#E5A922);margin-right:8px}
.pf-group-h::after{content:"";flex:1;height:1px;background:rgba(240,175,21,.1);margin-left:8px}
.pf-group{margin:0 16px;border-radius:14px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.11);overflow:hidden}
.pf-cell{display:flex;align-items:center;width:100%;min-height:44px;padding:11px 16px;background:none;border:none;border-bottom:1px solid rgba(240,175,21,.1);cursor:pointer;font-family:inherit;text-align:left}
.pf-cell:last-child{border-bottom:none}
.pf-ic{width:32px;height:32px;flex:none;border-radius:9px;background:linear-gradient(rgba(240,175,21,.18),rgba(229,169,34,.12));border:1px solid rgba(240,175,21,.2);display:flex;align-items:center;justify-content:center;font-size:18px;margin-right:12px}
.pf-lb{flex:1;font-size:15px;font-weight:500;color:#FFF0B0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pf-ch{color:rgba(232,200,122,.35);font-size:18px;margin-left:8px}
.pf-logout{display:block;width:calc(100% - 32px);margin:20px 16px 8px;padding:16px;border:none;border-radius:14px;background:linear-gradient(#2A1A1A,#1A0A0A);border:1px solid rgba(255,59,48,.3);color:#FF3B30;font-size:16px;font-weight:600;font-family:inherit;cursor:pointer}

.hero-sub {
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  margin-top: var(--sp-xs);
  font-size: var(--fs-caption);
  padding: 3px 12px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  gap: 4px;
}

.hero-status.on {
  color: var(--ok);
  border-color: rgba(0,200,83,.3);
}

.hero-status.on::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
  animation: glowPulse 2s infinite;
}

.pill {
  display: inline-block;
  font-size: var(--fs-caption);
  padding: 3px 12px;
  border-radius: var(--r-full);
  white-space: nowrap;
  font-weight: var(--fw-semibold);
}

.pill.on { color: var(--ok); }
.pill.off { color: #ff9a9a; }

#me-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-xs);
  margin-top: var(--sp-sm);
}

#me-info .frow {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#me-info .frow span {
  font-size: var(--fs-label);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

#me-info .frow b {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  word-break: break-word;
  overflow: hidden;
}

.frow {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-sm);
  padding: var(--sp-xs) 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.frow span {
  color: var(--text-muted);
  white-space: nowrap;
  font-size: var(--fs-body-sm);
}

.frow b {
  text-align: right;
  word-break: break-word;
  font-size: var(--fs-body-sm);
}

/* ─── 17. PROFILE NAV ─── */
.prof-nav {
  display: flex;
  gap: var(--sp-xs);
  margin-top: var(--sp-md);
}

.prof-nav-list {
  flex-direction: column;
  gap: var(--sp-xs);
}

.prof-nav-list .prof-navbtn {
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px 16px;
}

.prof-nav-list .prof-navbtn span {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.prof-navbtn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--sp-sm) var(--sp-xs);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-caption);
  transition: all var(--t-fast);
  overflow: hidden;
  cursor: pointer;
}

.prof-navbtn span {
  font-size: 20px;
  line-height: 1;
}

.prof-navbtn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-border);
}

.prof-navbtn:active {
  transform: scale(0.96);
}

.backbtn {
  background: transparent;
  color: var(--accent);
  border: none;
  padding: 0;
  margin-bottom: var(--sp-sm);
  font-size: var(--fs-body-sm);
  font-family: var(--font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.backbtn:hover {
  opacity: 0.8;
}

/* ─── 18. AVATARS ─── */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(139,92,246,.15);
  border: 1px solid var(--border);
}

.avatar.sm { width: 28px; height: 28px; }
.avatar-lg { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin-bottom: var(--sp-xs); background: rgba(139,92,246,.15); display: block; border: 1px solid var(--border); }

.avt {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  width: 32px;
  height: 32px;
  background: #2a2060;
}

.avt.sm { width: 28px; height: 28px; }
.avt.lg { width: 40px; height: 40px; }

.avt img.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  display: block;
  border: none;
}

.avt .avt-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d4b8ff;
  font-weight: var(--fw-bold);
  font-size: var(--fs-body-sm);
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #4a2d8a, #2d5a9a);
}

.avt.lg .avt-ph { font-size: 16px; }
.avt.official { box-shadow: 0 0 0 2px var(--accent), 0 0 15px var(--accent-glow), 0 0 30px rgba(212,175,55,.12); animation: glowPulse 3s ease-in-out infinite; }
.avatar-xl.official { box-shadow: 0 0 0 3px var(--accent), 0 0 20px var(--accent-glow), 0 0 40px rgba(212,175,55,.15); animation: glowPulse 3s ease-in-out infinite; }
.avatar.official { box-shadow: 0 0 0 2px var(--accent), 0 0 12px var(--accent-glow), 0 0 25px rgba(212,175,55,.1); animation: glowPulse 3s ease-in-out infinite; }

.official-badge {
  display: inline-block;
  margin-top: var(--sp-xxs);
  padding: 2px 10px;
  background: linear-gradient(135deg, rgba(212,175,55,.15), rgba(212,175,55,.08));
  border: 1px solid var(--accent-border);
  border-radius: var(--r-sm);
  color: var(--accent);
  font-weight: var(--fw-bold);
  font-size: var(--fs-caption);
  text-shadow: 0 0 8px var(--accent-glow);
  letter-spacing: .3px;
}

.official-tag {
  font-size: var(--fs-micro);
  color: var(--accent);
  border: 1px solid rgba(212,175,55,.4);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ─── 19. CHAT ─── */
.chat {
  height: calc(100vh - var(--topbar-h) - var(--bottombar-h) - var(--sp-xl));
  height: calc(100dvh - var(--topbar-h) - var(--bottombar-h) - var(--sp-xl));
  display: flex;
  overflow: hidden;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

.chat .list {
  width: 38%;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: var(--sp-xs);
  background: rgba(8,11,24,.2);
  -webkit-overflow-scrolling: touch;
}

.chat .conv {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.convhead {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  background: rgba(10,14,30,.5);
  backdrop-filter: blur(8px);
  min-height: 48px;
}

.convhead .ch-name {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.convhead .ch-status {
  font-size: var(--fs-caption);
  color: var(--ok);
  margin-left: auto;
}

.ch-name.official {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

.ch-name.official::before {
  content: "\1F451 ";
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-md) 40px;
  gap: 6px;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(600px 300px at 80% 0%, rgba(212,175,55,.03), transparent 60%),
    radial-gradient(500px 260px at 0% 100%, rgba(139,92,246,.04), transparent 60%),
    #070b18;
}

.daysep {
  align-self: center;
  font-size: var(--fs-caption);
  color: var(--text-muted);
  background: rgba(11,15,31,.8);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: var(--r-full);
  margin: var(--sp-xs) 0;
  flex-shrink: 0;
}

.msgrow {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  margin: 1px 0;
  max-width: 100%;
}

.msgrow.me {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.msgbody {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  min-width: 0;
  overflow: hidden;
}

.msgrow.me .msgbody {
  align-items: flex-end;
}

.bubble {
  position: relative;
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: var(--fs-body);
  line-height: var(--lh-base);
}

.msgrow.me .bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1300;
  border: none;
  box-shadow: 0 2px 12px var(--accent-glow);
  border-bottom-right-radius: 5px;
}

.msgrow.them .bubble {
  border-bottom-left-radius: 5px;
}

.msgrow.them.official .bubble {
  border: 1px solid var(--accent-border);
  box-shadow: 0 0 10px var(--accent-glow), 0 0 20px rgba(212,175,55,.08);
}

.msgrow.official .bubble {
  background: linear-gradient(135deg, rgba(212,175,55,.18), rgba(212,175,55,.08));
  border: 1px solid var(--accent-border);
  color: #fff7d6;
  box-shadow: 0 0 12px var(--accent-glow), 0 0 25px rgba(212,175,55,.1);
  animation: officialBubblePulse 4s ease-in-out infinite;
}

@keyframes officialBubblePulse {
  0%, 100% { box-shadow: 0 0 12px var(--accent-glow), 0 0 25px rgba(212,175,55,.1); }
  50% { box-shadow: 0 0 18px var(--accent-glow), 0 0 35px rgba(212,175,55,.18); }
}

.msgtime {
  font-size: var(--fs-micro);
  color: var(--text-faint);
  margin-top: 2px;
  white-space: nowrap;
}

.unread {
  background: var(--accent);
  color: #1a1300;
  border-radius: var(--r-full);
  padding: 1px 7px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  box-shadow: 0 0 8px var(--accent-glow);
  white-space: nowrap;
}

.composer {
  display: flex;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  border-top: 1px solid var(--border);
  background: rgba(10,14,30,.5);
  backdrop-filter: blur(8px);
  align-items: center;
}

.composer input {
  flex: 1;
  border: none;
  background: rgba(255,255,255,.05);
  border-radius: var(--r-full);
  padding: var(--sp-sm) var(--sp-md);
  color: var(--text);
  outline: none;
  transition: background var(--t-fast), box-shadow var(--t-fast);
  font-family: var(--font);
  font-size: var(--fs-body-sm);
  min-width: 0;
}

.composer input:focus {
  background: rgba(255,255,255,.08);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

#send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1300;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--accent-glow);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

#send svg { width: 20px; height: 20px; }
#send:disabled { opacity: 0.4; box-shadow: none; }
#send:not(:disabled):hover { transform: scale(1.08); }
#send:not(:disabled):active { transform: scale(0.95); }

/* ─── 20. PRODUCTS ─── */
.prod {
  flex-wrap: wrap;
  align-items: flex-start;
}

.prod-ic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  flex-shrink: 0;
}

.prod-body { flex: 1; min-width: 0; }
.prod-name { font-weight: var(--fw-bold); font-size: var(--fs-body-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-desc { color: var(--text-muted); font-size: var(--fs-caption); margin: 2px 0 var(--sp-xs); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-link { color: var(--accent); font-size: var(--fs-caption); word-break: break-word; }
.prod .mgmt { width: 100%; margin-top: var(--sp-xs); }

/* ─── 21. MODAL ─── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3,5,13,.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--sp-md);
  animation: fadeIn 0.2s var(--ease-out);
}

.modalcard {
  background: linear-gradient(180deg, rgba(22,26,44,.92), rgba(11,15,31,.95));
  border: 1px solid rgba(212,175,55,.2);
  border-radius: var(--r-lg);
  padding: var(--sp-lg) var(--sp-md);
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg), 0 0 24px var(--accent-glow);
}

.modalcard h3 { margin-top: 0; }

.iconbtn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  padding: var(--sp-xxs) var(--sp-xs);
  cursor: pointer;
  transition: color var(--t-fast);
}

.iconbtn:hover { color: var(--accent); }

.ctxmenu {
  position: fixed;
  min-width: 160px;
  background: rgba(18,18,18,.92);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-xxs);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  animation: popIn 0.15s var(--ease-out);
}

.ctxmenu div {
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast);
  font-size: var(--fs-body-sm);
}

.ctxmenu div:hover { background: rgba(255,255,255,.08); }

/* ─── 22. PROFILE MODAL (fullscreen) ─── */
#profilemodal { padding: 0; }

#profilemodal .modalcard.profile-card {
  max-width: 100%;
  width: 100%;
  height: 100dvh;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: none;
}

.profile-top {
  position: relative;
  padding: var(--sp-xl) var(--sp-md) var(--sp-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xxs);
  border-bottom: 1px solid var(--border);
}

.profile-top .iconbtn {
  position: absolute;
  left: var(--sp-sm);
  top: var(--sp-md);
  font-size: 28px;
}

.profile-fields {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: transparent;
  box-shadow: none;
}

.profile-actions {
  padding: var(--sp-sm) var(--sp-md);
  display: flex;
  gap: var(--sp-xs);
  border-top: 1px solid var(--border);
}

.profile-actions .primary,
.profile-actions .ghost { flex: 1; }

/* ─── 23. LOGIN ─── */
.logobig { text-align: center; margin: var(--sp-xl) 0 var(--sp-lg); }
.logo-svg { width: 72px; height: 72px; filter: drop-shadow(0 0 16px rgba(212,175,55,.3)); }
.wordmark { font-size: var(--fs-display); font-weight: var(--fw-bold); letter-spacing: 3px; margin-top: var(--sp-xs); }
.tag { color: var(--text-muted); font-size: var(--fs-caption); letter-spacing: 1.5px; text-transform: uppercase; }

#form { display: flex; flex-direction: column; }
#form label { font-size: var(--fs-label); color: var(--text-muted); margin: var(--sp-sm) 0 var(--sp-xxs); text-transform: uppercase; letter-spacing: 0.4px; }

#form input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: var(--sp-sm) var(--sp-xxs);
  color: var(--text);
  margin-bottom: var(--sp-xxs);
  outline: none;
  font-size: var(--fs-body);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

#form input:focus {
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 var(--accent);
}

#loginbtn,
form#form button[type=submit] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1300;
  font-weight: var(--fw-bold);
  font-size: var(--fs-body);
  padding: var(--sp-md);
  border-radius: var(--r-sm);
  border: none;
  width: 100%;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: var(--sp-md);
  box-shadow: 0 4px 18px var(--accent-glow);
  transition: transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}

#loginbtn:hover,
form#form button[type=submit]:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

#loginbtn:active,
form#form button[type=submit]:active {
  transform: translateY(0) scale(0.98);
}

#loginbtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#forgotlic,
.ghost { color: var(--text-muted); }
#forgotlic { background: none; border: none; font-size: var(--fs-caption); margin-top: var(--sp-sm); font-family: var(--font); cursor: pointer; }
#forgotlic:hover { color: var(--accent); }

.sign { margin-top: var(--sp-md); text-align: center; color: var(--text-faint); font-size: var(--fs-label); line-height: var(--lh-relaxed); }

/* ─── 24. PINPAD ─── */
.pinpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  margin: var(--sp-sm) auto;
  user-select: none;
  -webkit-user-select: none;
}

.pinpad .pindots {
  display: flex;
  gap: var(--sp-md);
  margin-bottom: var(--sp-xs);
}

.pinpad .pindots span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--accent-border);
  background: transparent;
  transition: all var(--t-fast);
}

.pinpad .pindots span.on {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.pinpad .pinkeys {
  display: grid;
  grid-template-columns: repeat(3, 68px);
  gap: 8px;
  justify-content: center;
}

.pinpad .pinkeys button {
  height: 56px;
  border-radius: var(--r-md);
  font-size: 20px;
  font-weight: var(--fw-semibold);
  font-family: var(--font);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all var(--t-fast);
  cursor: pointer;
}

.pinpad .pinkeys button:hover {
  background: rgba(255,255,255,.10);
  border-color: var(--border-strong);
}

.pinpad .pinkeys button:active {
  transform: scale(0.92);
  background: var(--accent-subtle);
  border-color: var(--accent-border);
}

.pinpad .pinkeys button.empty {
  background: transparent;
  border: none;
  cursor: default;
}

/* ─── 25. SKELETON LOADING ─── */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--sp-xs);
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }

.skeleton-circle {
  border-radius: 50%;
  width: 88px;
  height: 88px;
}

.skeleton-row {
  height: 52px;
  margin-bottom: var(--sp-xs);
}

/* ─── 26. SECTION GROUPS (Settings) ─── */
.section-group {
  margin-bottom: var(--sp-md);
}

.section-group h3 {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--sp-sm);
  padding-bottom: var(--sp-xxs);
  border-bottom: 1px solid var(--border);
}

/* ─── 27. ANIMATIONS ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: none; }
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.7; filter: brightness(1.3); }
}

/* ─── 28. PANELS ─── */
.panel {
  display: none;
  padding: var(--sp-md) 0;
  animation: fadeIn 0.3s var(--ease-out) both;
}

#panel-profile,
#panel-gen { display: block; }

.panel.active { display: block; }

#panel-chat h2 { display: none; }

/* ─── 28a. CHAT FULL-HEIGHT ─── */
.chat-active .wrap {
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}
.chat-active .card.wide {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-active #panel-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  min-height: 0;
}
.chat-active #panel-chat .chat {
  flex: 1;
  height: auto !important;
  min-height: 0;
}

#sub-settings {
  animation: slideInRight 0.25s var(--ease-out) both;
}

/* ─── 29. WIDE / ADMIN ─── */
.wide { max-width: 100%; }
body.admin .topbar { position: fixed; }
body.admin #panel-gen,
body.admin #panel-list,
body.admin #panel-products {
  padding-top: var(--sp-md);
  min-height: auto;
}
body.admin .panel { animation: none; }
body.admin .card.wide { border-radius: var(--r-lg); }
body.admin .bottombar { max-width: 480px; }

/* ─── 30. MOBILE CHAT MASTER-DETAIL ─── */
.conv-back { display: none !important; }

@media (max-width: 760px) {
  .chat { height: auto !important; }
  .chat .list { width: 100%; border-right: none; }
  .chat .conv {
    display: none;
    position: absolute;
    inset: 0;
    background: var(--surface-1);
    z-index: 2;
    border-radius: var(--r-lg);
  }
  .chat { position: relative; }
  .chat.show-conv .list { display: none; }
  .chat.show-conv .conv { display: flex; }
  .conv-back { display: flex !important; margin-right: var(--sp-xxs); }
}

/* ─── 31. RESPONSIVE — TABLET ─── */
@media (min-width: 761px) and (max-width: 1024px) {
  body.admin .wrap { max-width: 800px; }
}

/* ─── 32. RESPONSIVE — DESKTOP ─── */
@media (min-width: 1025px) {
  body.admin .wrap { max-width: 1000px; }

  .item:hover,
  .prod:hover {
    border-color: var(--accent-border);
  }

  #tbl tbody tr:hover {
    background: var(--accent-subtle);
  }
}

/* ─── 33. WIDE DESKTOP ─── */
@media (min-width: 1400px) {
  body.admin .wrap { max-width: 1100px; }
}

/* ─── 34. ACCESSIBILITY — REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── 35. LOADING SPINNER ─── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── 36. BODY LOCK ─── */
body[data-locked] .wrap {
  overflow-y: hidden !important;
}

body[data-locked] #messages {
  overflow-y: hidden !important;
}

/* ─── 37. TOAST ─── */
.milana-toast {
  position: fixed;
  bottom: calc(var(--bottombar-h) + var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(28, 28, 28, 0.95);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--fs-body-sm);
  color: var(--text);
  z-index: var(--z-toast);
  opacity: 0;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  pointer-events: none;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

.milana-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.milana-toast.toast-error {
  border-color: var(--error-border);
  color: var(--error);
}

.milana-toast.toast-success {
  border-color: var(--success-border);
  color: var(--success);
}

/* ─── 38. OVERLAY BACKDROP ─── */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-sheet);
}

/* ─── 39. MOBILE KEYBOARD ─── */
@supports (height: 100dvh) {
  .chat { height: calc(100dvh - var(--topbar-h) - var(--bottombar-h) - var(--sp-xl)); }
  .chat-active .chat { height: auto !important; }
}

/* ─── 40. UTILITY ─── */
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.mt-xs { margin-top: var(--sp-xs); }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mb-xs { margin-bottom: var(--sp-xs); }
.mb-sm { margin-bottom: var(--sp-sm); }
.mb-md { margin-bottom: var(--sp-md); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-xs { gap: var(--sp-xs); }
.gap-sm { gap: var(--sp-sm); }
.w-full { width: 100%; }

/* ─── 41. REGISTRATION SCREENS ─── */
.reg-screen { display: none; animation: fadeIn 0.3s var(--ease-out) both; }
.reg-screen.active { display: block; }

.reg-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: var(--sp-lg);
}

.reg-step {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.08);
  transition: background var(--t-base);
}

.reg-step.active {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.reg-step.done {
  background: var(--ok);
}

/* Code inputs */
.code-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: var(--sp-md) 0;
}

.code-digit {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 24px;
  font-weight: var(--fw-bold);
  font-family: var(--font);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.code-digit:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

/* Tariff list */
.tariff-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.tariff-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
}

.tariff-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.tariff-item.selected {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.tariff-name {
  flex: 1;
  font-weight: var(--fw-semibold);
  font-size: var(--fs-body-sm);
}

.tariff-price {
  font-weight: var(--fw-bold);
  color: var(--accent);
  font-size: var(--fs-body);
  white-space: nowrap;
}

.tariff-badge {
  font-size: var(--fs-micro);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-sm);
  padding: 1px 8px;
  white-space: nowrap;
}

/* QR section */
.qr-amount {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  color: var(--accent);
  margin-bottom: var(--sp-xs);
}

.qr-info {
  margin-top: var(--sp-sm);
  line-height: var(--lh-relaxed);
}

.qr-info b {
  color: var(--text);
}

#qr-box img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--r-sm);
}

#qr-box canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

#bank-list a:hover {
  opacity: 0.85;
  transform: scale(1.05);
}

#bank-list a:active {
  transform: scale(0.97);
}

/* Wait screen */
.wait-icon {
  font-size: 48px;
  line-height: 1;
  animation: glowPulse 2s infinite;
}

/* ─── 42. MOBILE CODE INPUTS ─── */
@media (max-width: 400px) {
  .code-digit {
    width: 44px;
    height: 52px;
    font-size: 20px;
  }
}

/* ─── 43. MAILBOX ─── */
#panel-mail .item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
#panel-mail .item:hover {
  background: var(--surface-hover, rgba(255,255,255,0.03));
}
#panel-mail .item.unread {
  border-left: 3px solid var(--accent);
  background: rgba(212,175,55,0.03);
}
#panel-mail .item.unread b {
  color: var(--accent);
}
#mail-body {
  font-size: var(--fs-body-sm);
  line-height: 1.6;
  color: var(--text);
}
#mail-body pre {
  font-family: inherit;
  white-space: pre-wrap;
}
#mail-body iframe {
  min-height: 300px;
  background: transparent;
}
#mail-to, #mail-subject, #mail-text {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-body-sm);
  box-sizing: border-box;
}
#mail-text {
  min-height: 180px;
  resize: vertical;
}
#mail-to:focus, #mail-subject:focus, #mail-text:focus {
  outline: none;
  border-color: var(--accent);
}

/* ─── 44. LOGIN FIXES ─── */
.login-page .card { overflow: visible; }
.login-page .check label { white-space: nowrap; }

/* ─── 45. TEXT OVERFLOW FIXES ─── */
#mail-header { word-break: break-all; overflow-wrap: break-word; }
#mail-header b { white-space: normal; }
.muted { overflow-wrap: break-word; word-break: break-word; }
.bubble { overflow-wrap: anywhere; }

/* ─── 46. PRIVACY ROWS ─── */
.priv-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 4px;
}
.priv-row input, .priv-row select, .priv-row textarea { flex: 1; min-width: 0; }
.priv-sel {
  width: 110px !important;
  flex: 0 0 110px !important;
  font-size: var(--fs-body-sm);
  padding: 6px 8px;
}

/* ─── 47. MESSAGE DELETE ─── */
.msgrow { position: relative; }
.msg-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255,75,75,.15);
  color: #ff8a8a;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.msgrow.me .msg-del { right: auto; left: 4px; }
.msgrow:hover .msg-del { opacity: 1; }
.msg-del:hover { background: rgba(255,75,75,.35); }
.bubble.deleted {
  font-style: italic;
  color: var(--text-muted);
  opacity: .6;
  background: rgba(255,255,255,.02);
  border-color: transparent;
}

/* ─── 48. ONLINE DOT ─── */
.online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
  border: 2px solid var(--surface-1);
  box-shadow: 0 0 6px var(--ok);
}
.avt { position: relative; }

/* ─── 49. CHAT FILES / IMAGES ─── */
.chat-img {
  max-width: 220px;
  max-height: 220px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: block;
  margin-bottom: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.chat-file {
  display: inline-block;
  padding: 8px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-body-sm);
  margin-bottom: 6px;
  transition: background .15s;
}
.chat-file:hover { background: var(--surface-2); }
.attach-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface-1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.attach-btn svg { width: 18px; height: 18px; }
.attach-btn:hover { background: var(--surface-2); color: var(--text); }

/* ─── 50. REACTIONS ─── */
.reactions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--fs-caption);
  cursor: default;
  user-select: none;
}
.emoji-picker {
  position: fixed;
  z-index: 9999;
  display: none;
  gap: 4px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  backdrop-filter: blur(12px);
}
.emoji-picker.show { display: flex; }
.emoji-picker button {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background .12s;
}
.emoji-picker button:hover { background: var(--surface-1); }

/* ─── 51. MIC BUTTON ─── */
.mic-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface-1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.mic-btn svg { width: 18px; height: 18px; }
.mic-btn:hover { background: var(--surface-2); color: var(--text); }
.mic-btn.recording {
  background: rgba(255,59,48,.2);
  color: #ff3b30;
  animation: mic-pulse 1s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,59,48,.4); }
  50% { box-shadow: 0 0 0 8px rgba(255,59,48,0); }
}

/* ─── 52. USER PROFILE VIEW (from chat) ─── */
.user-profile-view {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
}
.user-profile-view.active { display: block; }

.user-profile-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface-1);
}

.user-profile-back {
  margin: var(--sp-sm) var(--sp-md);
}

.user-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-md) var(--sp-md) var(--sp-lg);
}

/* ─── 53. FILE PREVIEW ─── */
.file-preview {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  border-top: 1px solid var(--border);
  background: rgba(10,14,30,.6);
  backdrop-filter: blur(8px);
}
.file-preview-inner {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.file-preview-img {
  max-height: 80px;
  max-width: 160px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
}
.file-preview-audio {
  width: 100%;
  min-width: 180px;
  height: 36px;
}
.file-preview-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-body-sm);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-preview-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.file-preview-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.08);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.file-preview-close:hover {
  background: rgba(255,75,75,.2);
  color: #ff8a8a;
}

/* ─── 54. GLOBAL SEARCH OVERLAY ─── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: sheetUp 0.25s var(--ease-out);
}

.search-topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  padding-top: calc(var(--sp-sm) + env(safe-area-inset-top, 0px));
  background: rgba(16,16,16,0.95);
  backdrop-filter: var(--blur-md);
  border-bottom: 1px solid var(--border);
}

.search-topbar #search-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  padding: var(--sp-xs);
  cursor: pointer;
}

.search-topbar input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: var(--sp-sm) var(--sp-md);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body-sm);
  outline: none;
  transition: border-color var(--t-fast);
}

.search-topbar input:focus {
  border-color: var(--accent);
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-xs);
  -webkit-overflow-scrolling: touch;
}

.search-results .item {
  cursor: pointer;
}

.search-results .muted {
  padding: var(--sp-xl);
  text-align: center;
}

/* ─── 55. AVATAR UPLOAD UI ─── */
.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.avatar-upload-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xxs);
}

/* ─── 56. CHAT SWIPE TRANSITIONS ─── */
.chat .conv,
.chat .list {
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.chat.swiping .conv,
.chat.swiping .list {
  transition: none;
}

/* ─── 57. PULL-TO-REFRESH ─── */
.pull-indicator {
  text-align: center;
  padding: var(--sp-sm);
  color: var(--text-muted);
  font-size: var(--fs-caption);
  opacity: 0;
  transform: translateY(-100%);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

.pull-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

.pull-indicator .spinner {
  margin: 0 auto;
}

/* ─── 58. TAB SWIPE TRANSITION ─── */
.panel {
  will-change: transform, opacity;
}

/* ─── 59. SEARCH ICON IN TOPBAR ─── */
.topbar .search-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: var(--sp-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color var(--t-fast);
}

.topbar .search-btn:hover {
  color: var(--accent);
}

.topbar .search-btn svg {
  width: 22px;
  height: 22px;
}

/* ─── 60. CHAT LIST AVATARS ─── */
.chat .list .avt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

/* ─── 61. MESSAGE CONTEXT MENU ─── */
.ctxmenu-chat {
  position: fixed;
  z-index: 9999;
  min-width: 180px;
  background: rgba(20,20,20,.95);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-xxs);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  animation: popIn 0.15s var(--ease-out);
}
.ctxmenu-chat div {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast);
  font-size: var(--fs-body-sm);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  color: var(--text);
}
.ctxmenu-chat div:hover { background: rgba(255,255,255,.08); }
.ctxmenu-chat div.danger { color: #ff6b6b; }
.ctxmenu-chat div.danger:hover { background: rgba(255,75,75,.15); }

/* ─── 62. REPLY PREVIEW ─── */
#reply-preview {
  display: none;
  padding: var(--sp-sm) var(--sp-md);
  border-top: 1px solid var(--border);
  background: rgba(212,175,55,.06);
  align-items: center;
  gap: var(--sp-sm);
}
#reply-preview.active { display: flex; }
#reply-text {
  flex: 1;
  font-size: var(--fs-caption);
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
  padding-left: var(--sp-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: var(--lh-tight);
}
#reply-cancel {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.08);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#reply-cancel:hover { background: rgba(255,75,75,.2); color: #ff8a8a; }

/* ─── 63. REPLY QUOTE IN BUBBLE ─── */
.bubble-reply {
  background: rgba(255,255,255,.04);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  margin-bottom: 4px;
  font-size: var(--fs-caption);
  color: var(--text-muted);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msgrow.me .bubble-reply {
  background: rgba(26,19,0,.3);
  border-left-color: rgba(26,19,0,.5);
}

/* ─── 64. MESSAGE GROUPING ─── */
.msgrow.grouped { margin-top: 0; }
.msgrow.grouped .avt { visibility: hidden; }
.msgrow.group-start .bubble { border-top-right-radius: 18px; }
.msgrow.me.group-start .bubble { border-top-right-radius: 18px; border-bottom-right-radius: 5px; }
.msgrow.me.grouped .bubble { border-top-right-radius: 5px; }
.msgrow.them.group-start .bubble { border-top-left-radius: 18px; }
.msgrow.them.grouped .bubble { border-top-left-radius: 5px; }
.msgrow.grouped + .msgrow:not(.grouped) { margin-top: var(--sp-xs); }

/* ─── 65. MESSAGE STATUS CHECKMARKS ─── */
.msg-status {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  font-size: 11px;
  color: var(--text-faint);
  vertical-align: middle;
}
.msg-status .read { color: #53bdeb; }

/* ─── 66. LINKS IN MESSAGES ─── */
.bubble a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}
.bubble a:hover { text-decoration: underline; }

/* ─── 67. CALL SCREEN ─── */
.call-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: linear-gradient(180deg, #0b1020 0%, #141830 50%, #0b1020 100%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.call-screen.active { display: flex; }

.call-info {
  text-align: center;
  z-index: 2;
}
.call-info .call-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto var(--sp-md);
  overflow: hidden;
  background: linear-gradient(135deg, #3b2a7a, #2d5a9a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: var(--fw-bold);
  color: #fff;
  box-shadow: 0 0 40px rgba(212,175,55,.2);
}
.call-info .call-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.call-info .call-name {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  margin-bottom: var(--sp-xs);
}
.call-info .call-status {
  font-size: var(--fs-body-sm);
  color: var(--text-muted);
  animation: glowPulse 2s infinite;
}

#remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  display: none;
}
#remote-video.active { display: block; }

#local-video {
  position: absolute;
  bottom: 120px;
  right: 16px;
  width: 120px;
  height: 160px;
  border-radius: var(--r-md);
  object-fit: cover;
  z-index: 3;
  border: 2px solid var(--border);
  display: none;
}
#local-video.active { display: block; }

.call-controls {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: var(--sp-md);
  z-index: 3;
  padding-bottom: var(--safe-bottom);
}
.call-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  background: rgba(255,255,255,.12);
  color: #fff;
}
.call-btn:hover { transform: scale(1.08); }
.call-btn:active { transform: scale(0.95); }
.call-btn.green { background: #34c759; color: #fff; box-shadow: 0 4px 16px rgba(52,199,89,.4); }
.call-btn.red { background: #ff3b30; color: #fff; box-shadow: 0 4px 16px rgba(255,59,48,.4); }
.call-btn.muted { background: rgba(255,255,255,.08); color: var(--text-muted); }

/* ─── 68. CALL BUTTON IN CHAT HEADER ─── */
/* Звонки в вебе отключены (WEB_CALLS_ENABLED=false): кнопки скрыты. */
.convhead .call-head-btn {
  display: none;
}

/* ─── 69. INCOMING CALL OVERLAY ─── */
.call-incoming-actions {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 40px;
  z-index: 3;
  padding-bottom: var(--safe-bottom);
}

/* ─── 70. BROADCAST (трансляции) ─── */
.bcast-screen {
  position: fixed;
  inset: 0;
  z-index: 505;
  background: linear-gradient(180deg, #0b1020 0%, #141830 50%, #0b1020 100%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.bcast-screen.active { display: flex; }
.bcast-screen .call-info { z-index: 2; }
#bcast-host-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  display: none;
}
#bcast-host-video.active { display: block; }
#bcast-view-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  display: none;
}
#bcast-view-video.active { display: block; }
