:root{
  --purple1:#6a11cb;
  --purple2:#8e2de2;

  --bg:#f3f0ff;
  --panel:#ffffff;
  --panel-soft:#f4efff;
  --text:#222222;
  --muted:#6d6d6d;
  --line:rgba(0,0,0,.08);
  --line-strong:rgba(106,17,203,.18);
  --shadow:0 10px 25px rgba(0,0,0,.06);

  --male-bg:#eaf2ff;
  --male-border:#4a90ff;

  --female-bg:#ffeaf1;
  --female-border:#ff4a6e;

  --dm-bg:transparent;
  --dm-border:transparent;
}

/* ===== BÍLÝ REŽIM ===== */
body.chat-theme-light{
  --bg:#f7f7fb;
  --panel:#ffffff;
  --panel-soft:#f3f3fa;
  --text:#202020;
  --muted:#6f6f6f;
  --line:rgba(0,0,0,.10);
  --line-strong:rgba(106,17,203,.18);
}

/* ===== TMAVÝ REŽIM ===== */
body.chat-theme-dark{
  --bg:#1d1a26;
  --panel:#24212f;
  --panel-soft:#2b2738;
  --text:#f3eefc;
  --muted:#bdb6cc;
  --line:rgba(255,255,255,.10);
  --line-strong:rgba(173,122,255,.20);
  --shadow:0 12px 28px rgba(0,0,0,.28);

  --male-bg:#23344b;
  --male-border:#5b9dff;

  --female-bg:#4a2a35;
  --female-border:#ff6a8c;

  --dm-bg:transparent;
  --dm-border:transparent;
}

/* ===== VELIKOST PÍSMA ===== */
body.chat-font-default{ font-size:16px; }
body.chat-font-medium{ font-size:17px; }
body.chat-font-large{ font-size:19px; }

html, body{
  height:100%;
  overflow:hidden;
}

body{
  display:flex;
  flex-direction:column;
  background:var(--bg) !important;
  color:var(--text);
}

.page{
  flex:1 1 auto;
  min-height:0;
}

.container{
  max-width:1450px;
  margin:0 auto;
  padding:16px 10px 18px;
  height:100%;
}

.card{
  background:var(--panel);
  border-radius:18px;
  box-shadow:var(--shadow);
  border:1px solid var(--line-strong);
}

.chat-layout{
  display:grid;
  grid-template-columns:minmax(760px, 1fr) 320px;
  gap:18px;
  height:100%;
  align-items:start;
}

/* ===== NAV MAIL BADGE ===== */
.nav-mail{
  position:relative;
}

.mail-badge{
  position:absolute;
  top:-6px;
  right:-4px;
  min-width:19px;
  height:19px;
  padding:0 5px;
  border-radius:999px;
  background:#ff365f;
  color:#fff;
  font-size:11px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  box-shadow:0 6px 14px rgba(255,54,95,.28);
}

/* ===== LEVÁ ČÁST ===== */
.chat-main{
  position:relative;
  height:100%;
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
  background:var(--panel);
}

.mini-dm-reopen-btn{
  position:fixed;
  top:90px;
  right:calc(320px + 36px);
  width:46px;
  height:46px;
  border-radius:999px;
  border:1px solid rgba(255,45,140,0.55);
  background:#111118;
  color:#fff;
  font-size:20px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 4px 16px rgba(0,0,0,.40);
  z-index:100;
  transition:.2s ease;
}

.mini-dm-reopen-btn:hover{
  transform:scale(1.1);
}

.mini-dm-reopen-badge{
  position:absolute;
  top:-4px;
  right:-4px;
  background:#e02020;
  color:#fff;
  border-radius:999px;
  font-size:10px;
  font-weight:900;
  min-width:18px;
  height:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 4px;
}

.chat-area{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding:12px;
  background:var(--panel);
}

.chat-area::-webkit-scrollbar{
  width:10px;
}

.chat-area::-webkit-scrollbar-thumb{
  background:rgba(0,0,0,.16);
  border-radius:999px;
}

.chat-area::-webkit-scrollbar-track{
  background:transparent;
}

/* ===== ŘÁDEK ZPRÁVY ===== */
.chat-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:8px;
  width:100%;
  margin-bottom:2px;
  padding:0 !important;
  border-radius:0 !important;
  border:none !important;
  min-height:auto;
  background:transparent !important;
  box-shadow:none !important;
}
.chat-row.male{
  background:var(--male-bg);
  border-color:var(--male-border);
}

.chat-row.female{
  background:var(--female-bg);
  border-color:var(--female-border);
}

.chat-row.private{
  background:var(--dm-bg) !important;
  border-color:var(--dm-border) !important;
}

.chat-row.private .row-name,
.chat-row.private .row-text,
.chat-row.private .row-content {
  color:#e53535 !important;
}

.chat-row.private .row-avatar{
  color:#fff !important;
  background:transparent !important;
}

.chat-row.me{
  box-shadow:inset 0 0 0 1px rgba(106,17,203,.14);
}

.row-left{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  flex:1 1 auto;
}

.row-avatar{
  width:38px;
  height:38px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:13px;
  color:#fff;
  flex:0 0 auto;
  background:linear-gradient(135deg,var(--purple1),var(--purple2));
  cursor:pointer;
  position:relative;
  overflow:hidden;
  border:2px solid rgba(255,255,255,.55);
  box-shadow:0 6px 18px rgba(0,0,0,.12);
}

.row-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:50%;
}

.chat-row.private .row-avatar{
  color:#222;
  background:#f2d949;
}

.row-content{
  min-width:0;
  display:flex;
  align-items:center;
  gap:5px;
  flex-wrap:wrap;
  background:transparent !important;
  padding:0 !important;
  border-radius:0 !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
  box-shadow:none !important;
}
.row-name{
  font-weight:800;
  font-size:13px;
  line-height:1.1;
}

.row-sep{
  opacity:.6;
  font-weight:800;
  font-size:13px;
  line-height:1.1;
}

.row-text{
  word-break:break-word;
  white-space:pre-wrap;
  font-weight:700;
  font-size:13px;
  line-height:1.15;
}

.row-dm{
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-size:10px;
  font-weight:900;
  opacity:.75;
}

.row-dm-to{
  display:inline-flex;
  align-items:center;
  gap:5px;
  margin-left:4px;
  vertical-align:middle;
}

.dm-to-name{
  font-weight:700;
  font-size:13px;
  color:#fff;
  white-space:nowrap;
}

.dm-to-avatar{
  width:38px;
  height:38px;
  border-radius:50%;
  object-fit:cover;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  flex-shrink:0;
  overflow:hidden;
  border:2px solid rgba(255,255,255,.55);
  box-shadow:0 6px 18px rgba(0,0,0,.12);
  background:linear-gradient(135deg,var(--purple1),var(--purple2));
  cursor:pointer;
  position:relative;
}

.dm-to-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:50%;
}

.dm-to-initial{
  color:#fff;
  font-size:13px;
  font-weight:900;
  text-align:center;
}

.row-time{
  font-size:11px;
  color:#111;
  font-weight:900;
  white-space:nowrap;
  padding-top:2px;
  line-height:1;
}

/* ===== HOVER MENU U AVATARA ===== */
.avatar-hover-menu{
  position:fixed;
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:4px;
  padding:5px;
  background:#fff;
  border-radius:10px;
  box-shadow:0 10px 24px rgba(0,0,0,.22);
  z-index:5000;
}

/* Live Chat ikonka – černý ovál s textem */
.hover-livechat-btn{
  background:#111 !important;
  border-radius:20px !important;
  width:auto !important;
  padding:0 8px !important;
  min-width:36px !important;
  height:28px !important;
  color:#fff !important;
}
.hover-livechat-btn:hover{
  background:#333 !important;
}
.livechat-icon-text{
  font-size:9px;
  font-weight:700;
  line-height:1.2;
  text-align:center;
  color:#fff;
  pointer-events:none;
}

.hover-menu-btn{
  width:28px;
  height:28px;
  border:none;
  border-radius:7px;
  background:#fff;
  color:#111;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:13px;
}

.hover-menu-btn:hover{
  background:#f1f1f1;
  transform:scale(1.04);
}

.avatar-hover-menu::before{
  content:"";
  position:absolute;
  left:-6px;
  top:14px;
  border-top:6px solid transparent;
  border-bottom:6px solid transparent;
  border-right:6px solid #fff;
}

/* ===== INPUT ===== */
.chat-inputbar{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-top:1px solid var(--line);
  background:var(--panel);
}

.at-btn,
.send-btn{
  width:48px;
  height:48px;
  border:none;
  border-radius:999px;
  background:linear-gradient(135deg,var(--purple1),var(--purple2));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:17px;
  transition:.2s ease;
}

.at-btn:hover,
.send-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 24px rgba(106,17,203,.24);
}

.input-col{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.input-wrap{
  flex:1 1 auto;
  position:relative;
}

#msgInput{
  width:100%;
  height:48px;
  border-radius:999px;
  border:1px solid var(--line);
  background:transparent;
  color:var(--text);
  outline:none;
  padding:0 18px;
  font-weight:700;
}

#msgInput::placeholder{
  color:var(--muted);
}

.dm-chip{
  background:#e02020;
  border:none;
  color:#fff;
  border-radius:999px;
  padding:0 10px 0 12px;
  height:28px;
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-weight:900;
  font-size:13px;
  box-shadow:0 2px 8px rgba(224,32,32,.4);
  margin-bottom:4px;
  align-self:flex-start;
  pointer-events:all;
}

.dm-chip-close{
  background:transparent;
  border:none;
  cursor:pointer;
  color:rgba(255,255,255,.8);
  font-size:11px;
  line-height:1;
  padding:0;
}

.hint{
  position:absolute;
  left:0;
  right:0;
  top:-36px;
  font-size:12px;
  font-weight:800;
  color:#fff;
  background:#d02b2b;
  padding:4px 10px;
  border-radius:8px;
  text-align:center;
  display:none;
}

/* ===== DM PICKER ===== */
.dm-picker{
  position:absolute;
  left:18px;
  right:auto;
  width:280px;
  bottom:82px;
  background:#1e1b28 !important;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  overflow:hidden;
  box-shadow:0 24px 50px rgba(0,0,0,.55);
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
  isolation:isolate;
  z-index:200;
}

.dm-picker-list{
  background:#1e1b28 !important;
}

.dm-picker-note{
  background:#1e1b28 !important;
}

.dm-user{
  background:transparent !important;
}

.dm-picker-head{
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:#2a2040;
}

.dm-picker-close{
  background:transparent;
  border:none;
  cursor:pointer;
  color:var(--text);
  font-size:16px;
}

.dm-picker-list{
  padding:4px 8px;
  display:grid;
  gap:0px !important;
  max-height:220px;
  overflow:auto;
}

.dm-user{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:2px 8px;
  margin:0 !important;
  border-radius:8px;
  border:none;
  cursor:pointer;
  transition:.2s ease;
}

.dm-user:hover{
  transform:translateY(-1px);
  border-color:rgba(142,45,226,.28);
  box-shadow:0 10px 18px rgba(142,45,226,.10);
}

.dm-user small{
  color:var(--muted);
  font-weight:800;
}

.dm-picker-note{
  padding:10px 14px 12px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

/* ===== PRAVÁ ČÁST ===== */
.chat-sidebar{
  position:sticky;
  top:96px;
  height:calc(100vh - 120px);
  overflow:auto;
  padding:0;
  background:var(--panel-soft);
  border-radius:0;
  box-shadow:none;
  border:1px solid var(--line-strong);
  font-size:14px;
}

.chat-sidebar::-webkit-scrollbar{
  width:8px;
}

.chat-sidebar::-webkit-scrollbar-thumb{
  background:rgba(0,0,0,.18);
  border-radius:999px;
}

.chat-sidebar::-webkit-scrollbar-track{
  background:transparent;
}

.sidebar-head{
  background:#4a148c;
  color:#fff;
  font-weight:900;
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:18px;
}

.settings-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  padding:10px;
}

.settings-box{
  background:transparent;
}

.settings-box-title{
  background:rgba(106,17,203,.10);
  color:var(--text);
  font-weight:900;
  padding:8px 10px;
  margin-bottom:8px;
  text-align:center;
  font-size:15px;
}

.radio-row,
.check-row{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 6px;
  cursor:pointer;
  color:var(--text);
  font-weight:700;
  font-size:13px;
}

.radio-row input,
.check-row input{
  width:18px;
  height:18px;
  accent-color:#6a11cb;
  cursor:pointer;
  flex:0 0 auto;
}

.sidebar-section-title{
  margin:10px 10px 0;
  background:rgba(106,17,203,.10);
  color:var(--text);
  font-weight:900;
  text-align:center;
  padding:8px 10px;
  font-size:15px;
}

.check-list{
  padding:2px 10px 10px;
}

.check-row span{
  display:flex;
  align-items:center;
  gap:8px;
}

.gender-stats{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  padding:10px;
}

.gender-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:8px 6px;
  color:var(--text);
}

.gender-card i{
  font-size:28px;
  color:#6a11cb;
}

.gender-card span{
  font-weight:700;
  font-size:13px;
}

.gender-card b{
  color:var(--muted);
  font-size:13px;
}

.me-row{
  margin:0 10px;
  padding:10px 0;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.me-user{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.me-avatar{
  width:34px;
  height:34px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color:#fff;
  background:linear-gradient(135deg,var(--purple1),var(--purple2));
  flex:0 0 auto;
}

.me-name{
  font-weight:800;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:13px;
}

.leave-btn{
  border:none;
  border-radius:999px;
  background:linear-gradient(135deg,var(--purple1),var(--purple2));
  color:#fff;
  font-weight:800;
  padding:8px 12px;
  cursor:pointer;
  white-space:nowrap;
  font-size:12px;
}

.room-count{
  padding:10px 10px 8px;
  text-align:center;
  color:var(--muted);
  font-weight:700;
  font-size:13px;
}

.search{
  width:calc(100% - 20px);
  margin:0 10px 10px;
  height:38px;
  border-radius:999px;
  border:2px solid rgba(58,63,145,.7);
  background:transparent;
  color:var(--text);
  outline:none;
  padding:0 14px;
  font-weight:700;
  font-size:13px;
}

.search::placeholder{
  color:var(--muted);
}

.users-list{
  margin:0 10px;
  border-top:1px solid var(--line);
  min-height:80px;
}

.user-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}

.user-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.user-avatar{
  width:28px;
  height:28px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color:#fff;
  background:linear-gradient(135deg,var(--purple1),var(--purple2));
  flex:0 0 auto;
}

.user-meta{
  min-width:0;
}

.user-meta b{
  display:block;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:13px;
}

.user-meta small{
  color:var(--muted);
  font-weight:700;
  font-size:12px;
}

.user-badge{
  font-size:11px;
  font-weight:900;
  color:var(--muted);
  background:rgba(0,0,0,.06);
  padding:4px 8px;
  border-radius:999px;
  white-space:nowrap;
}

.empty-line{
  padding:14px 0;
  color:var(--muted);
  font-weight:700;
  display:flex;
  align-items:center;
  gap:8px;
  border-bottom:1px solid var(--line);
  font-size:13px;
}

.sidebar-foot{
  margin:12px 10px 0;
  padding:12px 0 14px;
  border-top:1px solid var(--line);
}

.tiny{
  font-size:11px;
  line-height:1.35;
  color:var(--muted);
  font-weight:800;
}

/* ===== MINI DM POPUP ===== */
.mini-dm-popup{
  position:fixed;
  right:22px;
  bottom:18px;
  width:320px;
  height:420px;
  background:var(--panel);
  border:1.5px solid rgba(255,45,140,0.90) !important;
  border-radius:16px;
  box-shadow:0 18px 40px rgba(0,0,0,.25),
             0 0 12px rgba(255,45,140,0.35),
             0 0 28px rgba(255,45,140,0.15) !important;
  z-index:6000;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.mini-dm-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px;
  background:#111118;
  border-bottom:1px solid rgba(255,45,140,0.55);
  color:#fff;
}

.mini-dm-user{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.mini-dm-avatar{
  width:34px;
  height:34px;
  border-radius:50%;
  background:rgba(255,255,255,.2);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  flex:0 0 auto;
}

.mini-dm-name{
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.mini-dm-head-actions{
  display:flex;
  align-items:center;
  gap:6px;
}

.mini-dm-emoji-btn,
.mini-dm-minimize,
.mini-dm-close{
  width:32px;
  height:32px;
  border:none;
  border-radius:999px;
  background:rgba(255,255,255,.16);
  color:#fff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

.mini-dm-popup.minimized .mini-dm-messages,
.mini-dm-popup.minimized .mini-dm-inputbar,
.mini-dm-popup.minimized .mini-dm-emoji-panel{
  display:none !important;
}

.mini-dm-popup.minimized{
  height:auto;
}

.mini-dm-messages{
  flex:1 1 auto;
  overflow:auto;
  padding:12px;
  background:var(--panel);
}

.mini-dm-msg{
  margin-bottom:10px;
  display:flex;
}

.mini-dm-msg.me{
  justify-content:flex-end;
}

.mini-dm-bubble{
  max-width:78%;
  padding:8px 10px;
  border-radius:12px;
  font-size:13px;
  font-weight:700;
  line-height:1.3;
  border:1px solid var(--line);
  background:rgba(106,17,203,.08);
  color:var(--text);
}

.mini-dm-msg.me .mini-dm-bubble{
  background:rgba(142,45,226,.16);
}

.mini-dm-msg.other .mini-dm-bubble{
  background:rgba(0,0,0,.04);
}

.mini-dm-time{
  margin-top:4px;
  font-size:10px;
  color:var(--muted);
  font-weight:800;
}

.mini-dm-emoji-panel{
  display:grid;
  grid-template-columns:repeat(8, 1fr);
  gap:6px;
  padding:10px;
  border-top:1px solid var(--line);
  background:var(--panel-soft);
}

.mini-dm-emoji-panel button{
  border:none;
  background:transparent;
  font-size:20px;
  cursor:pointer;
  border-radius:8px;
  padding:4px;
}

.mini-dm-emoji-panel button:hover{
  background:rgba(106,17,203,.10);
}

.mini-dm-inputbar{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px;
  border-top:1px solid var(--line);
  background:var(--panel);
}

.mini-dm-inputbar input{
  flex:1 1 auto;
  height:40px;
  border-radius:999px;
  border:1px solid var(--line);
  background:transparent;
  color:var(--text);
  outline:none;
  padding:0 14px;
  font-weight:700;
}

.mini-dm-inputbar input::placeholder{
  color:var(--muted);
}

.mini-dm-inputbar button{
  width:40px;
  height:40px;
  border:1px solid rgba(255,45,140,0.55);
  border-radius:999px;
  background:#111118;
  color:#fff;
  cursor:pointer;
}

/* ===== TMAVÝ REŽIM - PŘEBARVENÍ ===== */
body.chat-theme-dark .chat-main,
body.chat-theme-dark .chat-area,
body.chat-theme-dark .chat-inputbar,
body.chat-theme-dark .chat-sidebar,
body.chat-theme-light .dm-picker{
  background:#f5f3ff !important;
  border-color:rgba(0,0,0,.12) !important;
}

body.chat-theme-dark .dm-picker,
body.chat-theme-dark .mini-dm-popup,
body.chat-theme-dark .mini-dm-messages,
body.chat-theme-dark .mini-dm-inputbar{
  background:var(--panel) !important;
  color:var(--text) !important;
}

body.chat-theme-dark .chat-sidebar{
  background:var(--panel-soft) !important;
}

body.chat-theme-dark #msgInput,
body.chat-theme-dark .search,
body.chat-theme-dark .mini-dm-inputbar input{
  background:rgba(255,255,255,.04);
  color:var(--text);
  border-color:rgba(255,255,255,.22);
}

body.chat-theme-dark #msgInput::placeholder,
body.chat-theme-dark .search::placeholder,
body.chat-theme-dark .mini-dm-inputbar input::placeholder{
  color:var(--muted);
}

body.chat-theme-dark .settings-box-title,
body.chat-theme-dark .sidebar-section-title{
  background:rgba(255,255,255,.08);
  color:var(--text);
}

body.chat-theme-dark .user-badge{
  background:rgba(255,255,255,.08);
  color:var(--muted);
}

body.chat-theme-dark .tiny,
body.chat-theme-dark .room-count,
body.chat-theme-dark .empty-line,
body.chat-theme-dark .user-meta small,
body.chat-theme-dark .row-time,
body.chat-theme-dark .mini-dm-time{
  color:var(--muted);
}

body.chat-theme-dark .dm-chip{
  background:#6a5d25;
  color:#fff7c8;
  border-color:rgba(255,255,255,.16);
}

body.chat-theme-dark .dm-chip-close{
  color:#fff7c8;
}

body.chat-theme-dark .avatar-hover-menu{
  background:var(--panel);
  border-color:var(--line);
}

body.chat-theme-dark .hover-menu-btn:hover{
  background:rgba(255,255,255,.06);
}

body.chat-theme-dark .mini-dm-msg.other .mini-dm-bubble{
  background:rgba(255,255,255,.06);
}

body.chat-theme-dark .mini-dm-emoji-panel{
  background:var(--panel-soft);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1180px){
  .chat-layout{
    grid-template-columns:1fr;
  }

  .chat-sidebar{
    position:static;
    height:auto;
    border-radius:18px;
  }
}

@media (max-width: 760px){
  .settings-grid{
    grid-template-columns:1fr;
  }

  .chat-inputbar{
    gap:8px;
    padding:10px;
  }

  .at-btn,
  .send-btn{
    width:44px;
    height:44px;
  }

  .row-content{
    display:block;
  }

  .row-time{
    font-size:11px;
  }

  .row-avatar{
    width:30px;
    height:30px;
    font-size:11px;
  }

  .dm-to-avatar{
    width:30px;
    height:30px;
    font-size:11px;
  }

  .mini-dm-popup{
    width:calc(100vw - 20px);
    right:10px;
    bottom:10px;
  }
}
/* =====================================
   LOBBY VÝBĚR MÍSTNOSTI
   ===================================== */
   .live-chat-lobby{
    flex:1 1 auto;
    display:grid;
    place-items:center;
    padding:24px;
    min-height:100%;
    background:var(--panel);
  }
  
  .live-chat-lobby-card{
    width:min(100%, 480px);
    background:rgba(255,255,255,.96);
    border:1px solid var(--line-strong);
    border-radius:22px;
    box-shadow:0 18px 40px rgba(0,0,0,.10);
    padding:28px 24px;
    display:flex;
    flex-direction:column;
    gap:14px;
    text-align:center;
  }
  
  .live-chat-lobby-card h2{
    font-size:36px;
    line-height:1.15;
    color:#6a11cb;
    margin-bottom:8px;
    font-weight:900;
  }
  
  .live-chat-lobby-card select{
    width:100%;
    height:54px;
    border-radius:999px;
    border:2px solid rgba(106,17,203,.55);
    outline:none;
    padding:0 18px;
    font-size:16px;
    font-weight:700;
    background:#fff;
    color:#333;
  }
  
  .live-chat-lobby-card button{
    height:52px;
    border:none;
    border-radius:999px;
    background:linear-gradient(135deg,var(--purple1),var(--purple2));
    color:#fff;
    font-weight:900;
    font-size:18px;
    cursor:pointer;
    transition:.2s ease;
  }
  
  .live-chat-lobby-card button:hover{
    transform:translateY(-1px);
    box-shadow:0 12px 24px rgba(106,17,203,.24);
  }
  
  /* =====================================
     EMOJI DOLE V INPUTU
     ===================================== */
  .emoji-btn{
    width:48px;
    height:48px;
    border:none;
    border-radius:999px;
    background:linear-gradient(135deg,var(--purple1),var(--purple2));
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    font-size:17px;
    transition:.2s ease;
  }
  
  .emoji-btn:hover{
    transform:translateY(-1px);
    box-shadow:0 12px 24px rgba(106,17,203,.24);
  }
  
  .chat-emoji-panel{
    position:absolute;
    left:0;
    right:0;
    bottom:60px;
    background:#111118;
    border-radius:16px;
    border:1px solid rgba(255,45,140,0.45);
    box-shadow:0 8px 32px rgba(0,0,0,.60);
    padding:12px;
    display:grid;
    grid-template-columns:repeat(8, 1fr);
    gap:8px;
    z-index:4500;
  }
  
  .chat-emoji-panel button{
    border:none;
    background:transparent;
    font-size:22px;
    cursor:pointer;
    border-radius:10px;
    padding:6px;
  }
  
  .chat-emoji-panel button:hover{
    background:rgba(106,17,203,.10);
  }
  
 
  /* =====================================
   LIVE CHAT VIDEO BACKGROUND + GLASS UI
===================================== */
body.live-chat-video-page{
  position:relative;
  background:#140c20 !important;
}

.live-chat-video-bg{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  z-index:-2;
  pointer-events:none;
}

.live-chat-video-overlay{
  position:fixed;
  inset:0;
  background:
    linear-gradient(180deg, rgba(23,8,38,.35) 0%, rgba(23,8,38,.25) 35%, rgba(23,8,38,.40) 100%);
  z-index:-92;
  pointer-events:none;
}

body.live-chat-video-page .page,
body.live-chat-video-page .container{
  position:relative;
  z-index:1;
}

body.live-chat-video-page .container{
  max-width:1500px;
  padding:18px 14px 20px;
}

body.live-chat-video-page .room-entry-wrap{
  min-height:calc(100vh - 150px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px 1vw 4px 24px;
}

body.live-chat-video-page .room-entry-card,
body.live-chat-video-page .live-chat-lobby-card{
  width:min(100%, 430px);
  margin-left:auto;
  margin-right:auto;
  background:#1a1a1a !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
  box-shadow:0 24px 60px rgba(0,0,0,0.60) !important;
  border:1px solid rgba(255,255,255,0.08) !important;
}

body.live-chat-video-page .chat-layout{
  grid-template-columns:minmax(760px,1fr) 340px;
  gap:18px;
  height:auto;
  min-height:calc(100vh - 150px);
  align-items:stretch;
}

body.live-chat-video-page .chat-main{
  height:calc(100vh - 150px);
  background:rgba(255, 255, 255, 0.327);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(8px);
  border:1px solid rgba(255, 255, 255, 0.127);
  box-shadow:0 18px 44px rgba(0, 0, 0, 0.115);
}

body.live-chat-video-page .chat-area{
  background:rgba(255, 255, 255, 0.258);
}

body.live-chat-video-page .chat-inputbar{
  background:rgba(255, 255, 255, 0.099);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

body.live-chat-video-page .chat-sidebar{
  position:relative;
  top:0;
  height:calc(100vh - 150px);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  background:rgb(255, 255, 255);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border:1px solid rgba(255, 255, 255, 0.082);
  border-radius:18px;
  box-shadow:0 18px 44px rgba(0, 0, 0, 0.063);
  padding:12px;
}

.sidebar-toggle-btn{
  width:100%;
  border:1px solid rgba(255,45,140,0.55);
  border-radius:16px;
  background:#111118;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 16px;
  font-weight:900;
  font-size:18px;
  cursor:pointer;
  box-shadow:0 4px 16px rgba(0,0,0,.40);
  transition:.22s ease;
  margin-bottom:12px;
}

.sidebar-toggle-btn:hover{
  transform:translateY(-1px);
}

.sidebar-toggle-left{
  display:flex;
  align-items:center;
  gap:10px;
}

.sidebar-toggle-arrow{
  transition:transform .24s ease;
}

.sidebar-toggle-btn.collapsed .sidebar-toggle-arrow{
  transform:rotate(-90deg);
}

.settings-panel{
  overflow:visible;
  max-height:none;
  opacity:1;
  transition:opacity .22s ease, margin .22s ease;
  margin-bottom:12px;
}

.settings-panel.collapsed{
  max-height:0;
  height:0;
  overflow:hidden;
  opacity:0;
  margin-bottom:0;
  pointer-events:none;
}

.sidebar-users-wrap{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  background:rgba(255,255,255,.30);
  border:1px solid rgba(106,17,203,.10);
  border-radius:16px;
  overflow:hidden;
}

.sidebar-users-wrap .sidebar-section-title{
  margin:0;
  border-radius:0;
}

.sidebar-users-wrap .users-list{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  margin:0 10px;
}

.sidebar-users-wrap .sidebar-foot{
  margin:10px;
  margin-top:0;
  padding:10px 0 0;
}

body.live-chat-video-page .dm-picker,
body.live-chat-video-page .public-emoji-panel,
body.live-chat-video-page .avatar-hover-menu,
body.live-chat-video-page .mini-dm-popup{
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

body.chat-theme-dark.live-chat-video-page .chat-main,
body.chat-theme-dark.live-chat-video-page .chat-sidebar{
  background:rgba(24,18,36,.12) !important;
  border-color:rgba(255,255,255,.10) !important;
  backdrop-filter:blur(8px) !important;
  -webkit-backdrop-filter:blur(8px) !important;
}
body.live-chat-video-page .public-emoji-panel,
body.chat-theme-dark.live-chat-video-page .public-emoji-panel{
  background:#111118 !important;
  border:1px solid rgba(255,45,140,0.45) !important;
}
body.chat-theme-dark.live-chat-video-page .mini-dm-popup{
  background:rgba(24,18,36,.12) !important;
  backdrop-filter:blur(8px) !important;
  -webkit-backdrop-filter:blur(8px) !important;
}

body.chat-theme-dark.live-chat-video-page .dm-picker,
body.live-chat-video-page .dm-picker{
  background:#1e1b28 !important;
  border-color:rgba(255,255,255,.12) !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}
body.chat-theme-dark.live-chat-video-page .chat-area{
  background:rgba(24,18,36,.2) !important;
}
body.chat-theme-dark.live-chat-video-page .chat-inputbar{
  background:rgba(24,18,36,.22) !important;
  border-color:rgba(255,255,255,.10) !important;
  backdrop-filter:blur(6px) !important;
  -webkit-backdrop-filter:blur(6px) !important;
}

body.chat-theme-dark.live-chat-video-page .sidebar-users-wrap{
  background:rgba(255,255,255,.04) !important;
  border-color:rgba(255,255,255,.08) !important;
}

body.chat-theme-light.live-chat-video-page .chat-main,
body.chat-theme-light.live-chat-video-page .chat-sidebar,
body.chat-theme-light.live-chat-video-page .chat-inputbar{
  background:rgba(255,255,255,.84) !important;
}

@media (max-width: 1180px){
  body.live-chat-video-page .chat-layout{
    grid-template-columns:1fr;
    min-height:auto;
  }

  body.live-chat-video-page .chat-main{
    height:70vh;
  }

  body.live-chat-video-page .chat-sidebar{
    height:auto;
    min-height:unset;
  }

  .sidebar-users-wrap .users-list{
    max-height:320px;
  }
}

@media (max-width: 760px){
  body.live-chat-video-page .container{
    padding:12px 10px 16px;
  }

  .sidebar-toggle-btn{
    font-size:16px;
    padding:12px 14px;
  }

  body.live-chat-video-page .room-entry-card,
  body.live-chat-video-page .live-chat-lobby-card{
    padding:22px 18px;
  }
}

/* ===============================
   LIVE CHAT CLEAN SIDEBAR FIX
================================ */

.settings-panel .check-list{
  display:none !important;
}

.sidebar-users-wrap{
  margin-top:0;
}

.me-row{
  align-items:center;
  gap:10px;
}

.me-user{
  flex:1 1 auto;
  min-width:0;
}

.me-avatar,
.user-avatar,
.row-avatar,
.mini-dm-avatar{
  overflow:hidden;
}

.me-avatar img,
.user-avatar img,
.row-avatar img,
.mini-dm-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:50%;
}

.me-avatar{
  width:42px;
  height:42px;
  font-size:15px;
}

.user-avatar{
  width:36px;
  height:36px;
  font-size:13px;
}

.me-name{
  max-width:105px;
}

.leave-btn{
  flex:0 0 auto;
  max-width:132px;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sidebar-users-wrap .sidebar-section-title{
  font-size:17px;
  padding:11px 10px;
}

.gender-stats{
  padding:12px 10px 8px;
}

.room-count{
  padding-top:8px;
}

.users-list{
  padding-top:4px;
}

body.live-chat-video-page .chat-sidebar{
  overflow:hidden;
}

body.live-chat-video-page .settings-panel{
  margin-bottom:10px;
}

body.live-chat-video-page .sidebar-users-wrap{
  flex:1 1 auto;
  min-height:0;
}
.me-avatar,
.user-avatar,
.mini-dm-avatar{
  overflow:hidden;
}

.me-avatar img,
.user-avatar img,
.mini-dm-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:50%;
}

body.live-chat-video-page .settings-grid{
  padding:8px 10px 6px;
  gap:8px;
}

body.live-chat-video-page .settings-box-title{
  padding:7px 8px;
  margin-bottom:6px;
  font-size:14px;
}

body.live-chat-video-page .radio-row{
  padding:4px 6px;
  font-size:13px;
}

body.live-chat-video-page .sidebar-section-title{
  margin-top:8px;
  padding:8px 10px;
}

body.live-chat-video-page .gender-stats{
  padding:8px 10px;
}

body.live-chat-video-page .me-row{
  padding:8px 0;
}

body.live-chat-video-page .room-count{
  padding:8px 10px 6px;
}

body.live-chat-video-page .search{
  height:34px;
  margin-bottom:8px;
}

.me-avatar{
  overflow:hidden;
  background:linear-gradient(135deg,var(--purple1),var(--purple2));
}

.me-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:50%;
}
.user-avatar img,
.me-avatar img,
.row-avatar img,
.mini-dm-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:50%;
  display:block;
}
.dm-user-left{
  display:flex;
  align-items:center;
  gap:6px;
}

.dm-user .user-avatar{
  width:36px !important;
  height:36px !important;
  font-size:12px !important;
}

.dm-mini-actions{
  display:flex;
  align-items:center;
  gap:25px;
  margin-left:auto;
}

.dm-mini-btn{
  width:22px;
  height:22px;
  border:none;
  border-radius:50%;
  background:transparent;
  color:#ffffff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  transition:.15s;
}

.dm-mini-btn:hover{
  background:#7c3aed;
  color:#fff;
  transform:scale(1.08);
}

.dm-user-text{
  display:flex;
  flex-direction:column;
  justify-content:center;
  line-height:1.1;
}

.dm-user{
  min-height:unset;
}

.row-avatar{
  overflow:visible !important;
}

.avatar-inline-menu{
  position:absolute;
  left:calc(100% + 2px);
  top:0;
  display:none;
  flex-direction:column;
  gap:4px;
  padding:5px;
  background:#fff;
  border-radius:10px;
  box-shadow:0 10px 24px rgba(0,0,0,.22);
  z-index:20;
}

.row-avatar:hover .avatar-inline-menu{
  display:flex;
}

.avatar-inline-menu::before{
  content:"";
  position:absolute;
  left:-6px;
  top:14px;
  border-top:6px solid transparent;
  border-bottom:6px solid transparent;
  border-right:6px solid #fff;
}

.avatar-inline-btn{
  width:28px;
  height:28px;
  border:none;
  border-radius:7px;
  background:#fff;
  color:#111;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:13px;
}

.avatar-inline-btn:hover{
  background:#f1f1f1;
}

/* ===============================
   CLEAN SIDEBAR TOP INFO FINAL
================================ */


.gender-stats {
  display: none !important;
}

.sidebar-top-simple {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 4px 2px 10px !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
}

.sidebar-top-simple .left-part {
  font-size: 15px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}

.sidebar-top-simple .center-part {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.sidebar-top-simple .me-avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
}

.sidebar-top-simple .me-name {
  font-size: 13px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.sidebar-top-simple .leave-btn {
  padding: 7px 9px !important;
  font-size: 12px !important;
  border-radius: 16px !important;
  white-space: nowrap !important;
  max-width: 80px !important;
}

.gender-stats,
.sidebar-top-simple {
  display: none !important;
}

.sidebar-user-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 4px 2px 10px !important;
  margin: 0 !important;
}

.sidebar-user-actions .me-avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
}

.sidebar-user-actions .me-name {
  flex: 1 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.sidebar-user-actions .leave-btn {
  padding: 7px 10px !important;
  font-size: 12px !important;
  border-radius: 16px !important;
  white-space: nowrap !important;
}

.sidebar-users-wrap {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}

.sidebar-users-wrap .sidebar-section-title {
  display: none !important;
}

.sidebar-user-actions {
  margin-top: -55px !important;
  margin-bottom: 10px !important;
}

/* Velikost písma přímo v chatu */
body.chat-font-medium .chat-area,
body.chat-font-medium .chat-area *,
body.chat-font-medium #msgInput,
body.chat-font-medium .users-list,
body.chat-font-medium .users-list * {
  font-size: 17px !important;
}

body.chat-font-large .chat-area,
body.chat-font-large .chat-area *,
body.chat-font-large #msgInput,
body.chat-font-large .users-list,
body.chat-font-large .users-list * {
  font-size: 20px !important;
}

/* =====================================
   LIVE CHAT – HINT VIDITELNÝ POD INPUTEM
===================================== */

.chat-inputbar {
  position: relative;
  padding-bottom: 30px !important;
}

.input-wrap {
  position: relative;
}

.hint {
  bottom: -30px !important;
  left: 0 !important;
  right: 0 !important;
  width: fit-content !important;
  margin: 0 auto !important;
}

/* =====================================
   MOBILE CHAT SETTINGS PANEL FIX
===================================== */

@media (max-width: 600px){

  /* celé nastavení přilepit dolů */
  body.live-chat-video-page .chat-sidebar{
    position:fixed !important;
    left:10px !important;
    right:10px !important;
    bottom:80px !important;
    top:auto !important;
    height:auto !important;
    max-height:78vh !important;
    z-index:9999 !important;
    border-radius:22px !important;
    overflow:visible !important;
  }

  /* tlačítko nastavení */
  .sidebar-toggle-btn{
    margin:0 !important;
    border-radius:18px !important;
  }

  /* panel otevřít směrem nahoru */
  .settings-panel{
    position:absolute !important;
    left:0 !important;
    right:0 !important;
    bottom:72px !important;
    background:rgba(255,255,255,.96) !important;
    border-radius:20px !important;
    padding:10px !important;
    box-shadow:0 -10px 30px rgba(0,0,0,.22) !important;
    max-height:60vh !important;
    overflow-y:auto !important;
  }

  /* zavřený stav */
  .settings-panel.collapsed{
    display:none !important;
  }

  /* seznam lidí menší */
  .sidebar-users-wrap{
    max-height:120px !important;
    overflow-y:auto !important;
    margin-top:8px !important;
  }

  /* jen ikonka + počet */
  .room-count{
    position:absolute !important;
    top:-44px !important;
    right:4px !important;
    background:linear-gradient(135deg,#6a11cb,#8e2de2) !important;
    color:#fff !important;
    border-radius:999px !important;
    padding:6px 12px !important;
    font-size:13px !important;
    font-weight:900 !important;
    box-shadow:0 8px 20px rgba(0,0,0,.25) !important;
  }
}

/* MOBILE - nastavení chatu zavírání oprava */
@media (max-width: 600px) {
  .settings-panel {
    bottom: 64px !important;
    z-index: 9998 !important;
  }

  .sidebar-toggle-btn {
    position: relative !important;
    z-index: 10000 !important;
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .room-count {
    top: -38px !important;
    right: 10px !important;
    z-index: 10001 !important;
    font-size: 12px !important;
    padding: 5px 10px !important;
  }
}

/* MOBILE - schovat spodní uživatele pod nastavením */
@media (max-width: 600px) {
  .sidebar-user-actions,
  .sidebar-users-wrap,
  .search,
  .users-list,
  .me-row {
    display: none !important;
  }

  body.live-chat-video-page .chat-main {
    height: calc(100vh - 320px) !important;
  }

  body.live-chat-video-page .chat-sidebar {
    bottom: 74px !important;
  }

  .settings-panel {
    bottom: 74px !important;
  }
}

/* MOBILE - nastavení čitelné v tmavém režimu */
@media (max-width: 600px) {
  body.chat-theme-dark .settings-panel,
  body.chat-theme-dark .settings-panel * {
    color: #222 !important;
    opacity: 1 !important;
  }

  body.chat-theme-dark .settings-panel .settings-box-title {
    color: #222 !important;
    background: rgba(106, 17, 203, 0.14) !important;
  }

  body.chat-theme-dark .settings-panel .radio-row,
  body.chat-theme-dark .settings-panel .radio-row span {
    color: #222 !important;
    font-weight: 800 !important;
  }
}

/* =========================================
   MOBILNÍ ROZŠÍŘENÍ 320 – 611 px
   ========================================= */

@media (max-width: 611px) {

  .navbar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: sticky !important;
    top: 0 !important;
    padding: 0 108px 0 0 !important;
    height: auto !important;
    min-height: 52px !important;
  }

  .logo {
    flex: 0 0 auto !important;
    position: static !important;
    transform: none !important;
  }

  .logo img {
    height: 32px !important;
    max-width: 140px !important;
    display: block !important;
  }

  .nav-links {
    display: none !important;
  }

  .nav-icons {
    position: absolute !important;
    right: 12px !important;
    top: 7px !important;
    transform: none !important;
    gap: 12px !important;
    display: flex !important;
  }

  .icon-circle {
    width: 38px !important;
    height: 38px !important;
    font-size: 16px !important;
  }

  /* Sidebar – nad spodní lištu a foot */
  body.live-chat-video-page .chat-sidebar {
    bottom: 74px !important;
    left: 8px !important;
    right: 8px !important;
    overflow: visible !important;
  }

  /* Sidebar foot – na mobilu skryto */
  .sidebar-foot {
    display: none !important;
  }

  .tiny {
    white-space: normal !important;
    overflow: visible !important;
    display: block !important;
    font-size: 10px !important;
    line-height: 1.4 !important;
    color: #e00 !important;
  }

  /* Kontejner – zmenšit o výšku spodní lišty (≈70px) */
  .page {
    padding-bottom: 70px !important;
  }

  .container {
    height: calc(100vh - 52px - 180px) !important;
    padding-bottom: 0 !important;
  }

  .chat-layout {
    height: 100% !important;
  }

  /* Chat vstupní bar */
  .chat-inputbar {
    padding: 8px 8px 10px !important;
    gap: 6px !important;
  }

  .at-btn,
  .send-btn,
  .emoji-btn {
    width: 38px !important;
    height: 38px !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
  }

  #msgInput {
    height: 38px;
    min-height: 38px !important;
    max-height: 120px !important;
    font-size: 14px !important;
    padding: 9px 14px !important;
    resize: none !important;
    overflow-y: hidden !important;
    line-height: 1.45 !important;
    box-sizing: border-box !important;
    display: block !important;
    border-radius: 20px !important;
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
  }

  /* Chat zprávy */
  .row-name,
  .row-sep,
  .row-text {
    font-size: 12px !important;
  }

  /* DM zprávy na mobilu – text na nový řádek pod jmény */
  .chat-row.private .row-text {
    flex-basis: 100% !important;
    margin-top: 1px !important;
  }

  .row-avatar {
    width: 30px !important;
    height: 30px !important;
    font-size: 11px !important;
  }

  /* Avatar zarovnaný nahoře u dlouhých zpráv na mobilu */
  .row-left {
    align-items: flex-start !important;
  }

  .row-time {
    font-size: 10px !important;
  }

  /* Lobby card */
  .live-chat-lobby-card {
    padding: 18px 14px !important;
    border-radius: 18px !important;
  }

  .live-chat-lobby-card h2 {
    font-size: 24px !important;
    margin-bottom: 6px !important;
  }

  .live-chat-lobby-card select {
    height: 44px !important;
    font-size: 14px !important;
  }

  .live-chat-lobby-card button {
    height: 44px !important;
    font-size: 15px !important;
  }

  /* Video chat hlavní panel – zkrátit aby byl inputbar nad sidebar/foot/nav */
  body.live-chat-video-page .chat-main {
    height: calc(100vh - 52px - 208px) !important;
  }

  /* Mini DM popup – nad spodní navigací (≈70px) */
  .mini-dm-popup {
    width: calc(100vw - 16px) !important;
    right: 8px !important;
    left: 8px !important;
    bottom: 78px !important;
    height: calc(100vh - 160px) !important;
    max-height: 420px !important;
  }

  /* Emoji panel – mobile fix */
  .chat-emoji-panel {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 145px !important;
    width: auto !important;
    background: #111118 !important;
    border: 1px solid rgba(255,45,140,0.45) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.80) !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 6px !important;
    padding: 10px !important;
    z-index: 99999 !important;
  }

  .chat-emoji-panel button {
    font-size: 18px !important;
    padding: 4px !important;
  }

  /* DM picker */
  .dm-picker {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
  }

  .dm-picker-list {
    max-height: 160px !important;
  }

  /* Sidebar – odstraň bílý rámeček na mobilu */
  body.live-chat-video-page .chat-sidebar {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  /* Sidebar toggle btn */
  .sidebar-toggle-btn {
    font-size: 15px !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    margin-bottom: 0 !important;
  }

  /* Nastavení chatu – fixní nad sidebar-foot + lištou */
  .settings-panel {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 180px !important;
    top: auto !important;
    max-height: calc(100vh - 140px) !important;
    overflow-y: auto !important;
    background: rgba(255,255,255,0.97) !important;
    border-radius: 20px !important;
    padding: 12px !important;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.25) !important;
    z-index: 9999 !important;
  }

  .settings-panel.collapsed {
    display: none !important;
  }
}

/* ============================================================
   DARK PREMIUM THEME – LIVE CHAT (≤ 768 px)
   Nevypíná existující theme systém – jen sjednocuje lobby kartu
   a základní pozadí na black premium.
   ============================================================ */
@media (max-width: 768px) {
  /* Pozadí stránky (override live-chat.css body rule) */
  body {
    background: #0f0f0f !important;
  }

  /* Lobby karta */
  .live-chat-lobby,
  .live-chat-lobby-card {
    background: rgba(30, 30, 36, 0.97) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    box-shadow: 0 24px 50px rgba(0,0,0,0.50) !important;
  }

  .live-chat-lobby-card h2 {
    color: #ff3b7a !important;
  }

  .live-chat-lobby-card p,
  .live-chat-lobby-card small {
    color: rgba(255,255,255,0.65) !important;
  }

  .live-chat-lobby-card select {
    background: rgba(255,255,255,0.07) !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,0.15) !important;
  }

  .live-chat-lobby-card button {
    background: linear-gradient(135deg, #ff3b7a, #d6005a) !important;
    box-shadow: 0 8px 22px rgba(255,59,122,0.35) !important;
    border: none !important;
  }

  /* Sidebar toggle */
  .sidebar-toggle-btn {
    background: #111118 !important;
    border: 1px solid rgba(255,45,140,0.55) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.40) !important;
  }

  /* Room count badge */
  .room-count {
    background: linear-gradient(135deg, #ff3b7a, #d6005a) !important;
    box-shadow: 0 8px 20px rgba(255,59,122,0.25) !important;
  }

  /* Send / AT buttons */
  .at-btn,
  .send-btn,
  .emoji-btn {
    background: linear-gradient(135deg, #ff3b7a, #d6005a) !important;
    box-shadow: 0 6px 16px rgba(255,59,122,0.25) !important;
  }

  /* Avatar bez fotky – tmavé + FA user icon */
  .user-avatar,
  .row-avatar,
  .me-avatar,
  .mini-dm-avatar {
    background: rgba(255,255,255,0.08) !important;
    background-image: none !important;
    box-shadow: none !important;
    position: relative !important;
  }

  .user-avatar:not(:has(img))::before,
  .row-avatar:not(:has(img))::before,
  .me-avatar:not(:has(img))::before,
  .mini-dm-avatar:not(:has(img))::before {
    content: "\f007";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 55%;
    color: rgba(255,255,255,0.75) !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
  }

  .user-avatar:not(:has(img)),
  .row-avatar:not(:has(img)),
  .me-avatar:not(:has(img)),
  .mini-dm-avatar:not(:has(img)) {
    color: transparent !important;
  }
}

/* ============================================================
   DARK LOBBY – platí na VŠECH šířkách obrazovky (desktop i mobil)
   Override CSS proměnných --panel / --bg v lobby boxu.
   ============================================================ */
.live-chat-lobby {
  background: #0f0f0f !important;
}

.live-chat-lobby-card {
  background: rgba(30, 30, 36, 0.97) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 24px 50px rgba(0,0,0,0.50) !important;
  color: #ffffff !important;
}

.live-chat-lobby-card h2 {
  color: #ff3b7a !important;
}

.live-chat-lobby-card p,
.live-chat-lobby-card small,
.live-chat-lobby-card .lobby-rules,
.live-chat-lobby-card li {
  color: rgba(255,255,255,0.65) !important;
}

.live-chat-lobby-card select {
  background: rgba(255,255,255,0.07) !important;
  color: #ffffff !important;
  border-color: rgba(255,255,255,0.15) !important;
}

.live-chat-lobby-card select option {
  background: #1e1e24;
  color: #ffffff;
}

.live-chat-lobby-card button {
  background: linear-gradient(135deg, #ff3b7a, #d6005a) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 8px 22px rgba(255,59,122,0.35) !important;
}

@media (max-width: 768px) {
  .mini-dm-reopen-btn{
    right: 12px;
    top: 80px;
    bottom: auto;
  }
}

/* ── Messenger User Panel ── */
.messenger-user-panel{
  position:fixed;
  bottom:150px;
  right:16px;
  width:220px;
  background:#1e1b28;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  box-shadow:0 8px 32px rgba(0,0,0,.5);
  z-index:9998;
  overflow:hidden;
}

.messenger-user-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  background:#2a2040;
  color:#fff;
  font-weight:700;
  font-size:13px;
  gap:8px;
}

.messenger-user-panel-close{
  background:transparent;
  border:none;
  color:rgba(255,255,255,.7);
  cursor:pointer;
  font-size:14px;
  padding:0;
  line-height:1;
}

.messenger-user-panel-list{
  padding:6px;
  display:flex;
  flex-direction:column;
  gap:2px;
  max-height:260px;
  overflow-y:auto;
}

.messenger-user-row{
  display:flex;
  align-items:center;
  gap:8px;
  padding:5px 8px;
  border-radius:8px;
  cursor:pointer;
  transition:.15s ease;
  color:#fff;
}

.messenger-user-row:hover{
  background:rgba(255,255,255,.08);
}

.messenger-user-row .row-avatar{
  width:32px !important;
  height:32px !important;
  font-size:11px !important;
  flex-shrink:0;
}

.messenger-user-row-name{
  font-size:13px;
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.messenger-panel-empty{
  padding:12px;
  text-align:center;
  color:rgba(255,255,255,.4);
  font-size:12px;
}

@media (max-width:768px){
  .messenger-user-panel{
    right:8px;
    bottom:140px;
    width:calc(100vw - 16px);
    max-width:280px;
  }
}

/* ── Mute Toast ── */
.mute-toast{
  position:fixed;
  top:80px;
  left:50%;
  transform:translateX(-50%);
  background:#1a0a0a;
  border:2px solid #e02020;
  border-radius:16px;
  padding:16px 20px;
  display:flex;
  align-items:flex-start;
  gap:14px;
  max-width:360px;
  width:calc(100% - 32px);
  z-index:99999;
  box-shadow:0 8px 32px rgba(224,32,32,.35);
  animation:muteToastIn .3s ease;
}

@keyframes muteToastIn{
  from{ opacity:0; transform:translateX(-50%) translateY(-16px); }
  to{   opacity:1; transform:translateX(-50%) translateY(0); }
}

.mute-toast-icon{
  font-size:28px;
  color:#e02020;
  flex:0 0 auto;
  margin-top:2px;
}

.mute-toast-body{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.mute-toast-body strong{
  color:#fff;
  font-size:15px;
  font-weight:900;
}

.mute-toast-body span{
  color:#ccc;
  font-size:13px;
  line-height:1.4;
}

@media (min-width: 600px) and (max-width: 790px) {
  .mobile-bottom-nav { display: none !important; }
}

@media (min-width: 791px) and (max-width: 1024px) {
  .navbar .nav-links { display: none !important; }
}

/* Sidebar 600–1025px: lišta dole, uživatelé schovaní */
@media (min-width: 600px) and (max-width: 1025px) {
  body.live-chat-video-page .chat-sidebar {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    top: auto !important;
    height: auto !important;
    z-index: 9999 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overflow: visible !important;
  }

  body.live-chat-video-page .sidebar-users-wrap,
  body.live-chat-video-page .search,
  body.live-chat-video-page .me-row,
  body.live-chat-video-page .users-list,
  body.live-chat-video-page .sidebar-user-actions,
  body.live-chat-video-page .sidebar-section-title,
  body.live-chat-video-page .room-count {
    display: none !important;
  }

  body.live-chat-video-page .chat-main {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    height: calc(100vh - 130px) !important;
    display: flex !important;
    flex-direction: column !important;
  }

  body.live-chat-video-page .chat-area {
    flex: 1 !important;
    overflow-y: auto !important;
    padding-bottom: 70px !important;
  }

  body.live-chat-video-page .chat-inputbar {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 56px !important;
    z-index: 9998 !important;
  }

  /* Panel teleportovaný do <body> — černý text */
  body > #settingsPanel,
  body > #settingsPanel * {
    --text: #111 !important;
    color: #111 !important;
  }

  /* Chat bubble ikonka → pravý roh */
  .mini-dm-reopen-btn {
    right: 16px !important;
    top: 80px !important;
    left: auto !important;
  }

  /* DM picker "Vyber uživatele" → nad lištu Nastavení, užší */
  .dm-picker {
    position: fixed !important;
    left: 80px !important;
    right: 80px !important;
    width: auto !important;
    bottom: 130px !important;
    z-index: 10001 !important;
  }
}

