/* Extracted from public/app.html: late app shell styles. */
/* Mobile responsive patch */
/* ── Mobile Responsive Patch — app.html ── */
@media (max-width: 768px) {
  /* iOS input zoom prevention */
  input, select, textarea { font-size: 16px !important; }
  .bw-btn, .bw-btn-icon { min-height: 44px; min-width: 44px; }
  .bw-chat-textarea { font-size: 16px !important; }
  .bw-members { display: none !important; }
  .bw-chat-footer { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .bw-tab { min-height: 44px; }

  /* ── Schwarzer-Balken-Fix: erzwinge 1 Spalte gegen !important in app.css ── */
  .bw-app {
    grid-template-columns: 1fr !important;
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }
  #bw-right-panel, .bw-right-panel { display: none !important; }

  /* Chat-Main: volle Höhe + flexibel */
  .bw-chat-main {
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .bw-messages-container {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
  .bw-community-banner { display: none !important; }
}

/* ── Mobile Top Header ── */
.bw-mobile-top { display: none; }

@media (max-width: 768px) {
  .bw-mobile-top {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: var(--surface-1, #0e0e16);
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  /* Header Row: Logo links, Aktionen rechts */
  .bw-mobile-header {
    display: flex;
    align-items: center;
    padding: 10px 14px 8px;
    gap: 10px;
  }
  .bw-mh-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    text-decoration: none;
    color: var(--fg, #e8e8f0);
  }
  .bw-mh-brand img { width: 22px; height: 22px; }
  .bw-mh-brand span {
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.04em;
  }
  .bw-mh-actions { display: flex; align-items: center; gap: 6px; }
  .bw-mh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s, color 0.15s;
  }
  .bw-mh-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bw-mh-btn:active { background: rgba(108,99,255,0.2); color: #a89fff; }

}

/* ── Mobile Community Sheet ── */
.bw-mob-comm-sheet {
  display: none;
}
@media (max-width: 768px) {
  .bw-mob-comm-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1300;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
  }
  .bw-mob-comm-backdrop.visible {
    opacity: 1;
    pointer-events: all;
  }
  .bw-mob-comm-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface-1, #13131f);
    border-radius: 20px 20px 0 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 1301;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
    max-height: 75vh;
  }
  .bw-mob-comm-sheet.visible {
    transform: translateY(0);
  }
  .bw-mob-comm-handle {
    width: 36px; height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.15);
    margin: 12px auto 0;
    flex-shrink: 0;
  }
  .bw-mob-comm-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 18px 8px;
    flex-shrink: 0;
  }
  .bw-mob-comm-list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    padding: 4px 10px 12px;
  }
  .bw-mob-comm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.12s;
    -webkit-tap-highlight-color: transparent;
  }
  .bw-mob-comm-item:active { background: rgba(108,99,255,0.12); }
  .bw-mob-comm-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.88rem; font-weight: 800; color: #fff;
    flex-shrink: 0; overflow: hidden;
  }
  .bw-mob-comm-icon img { width: 100%; height: 100%; object-fit: cover; }
  .bw-mob-comm-name {
    font-size: 0.9rem; font-weight: 600;
    color: var(--fg, #e8e8f0);
    flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .bw-mob-comm-arrow {
    color: rgba(255,255,255,0.25);
    font-size: 1rem;
  }
}

/* ── Mobile Bottom Navigation (Community-Aktionen) ── */
.bw-mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
  .bw-mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(62px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(14,14,22,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.07);
    z-index: 1200;
    align-items: stretch;
    justify-content: space-around;
  }
  .bw-mbn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    padding: 8px 4px;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .bw-mbn-item svg {
    width: 22px; height: 22px;
    stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
    transition: transform 0.15s;
  }
  .bw-mbn-item:active svg { transform: scale(0.88); }
  .bw-mbn-item.active { color: #6c63ff; }
  .bw-mbn-item.active svg { filter: drop-shadow(0 0 5px rgba(108,99,255,0.7)); }
  .bw-mbn-item:active { color: #6c63ff; }
}

/* ── Members Modal ──────────────────────────────────────────── */
#modal-members .bw-modal { max-width: 480px; max-height: 80vh; display: flex; flex-direction: column; }
#modal-members .bw-modal-body { overflow-y: auto; padding: 0; }
.bw-memmodal-search { width: 100%; padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--fg); font-size: 0.85rem; outline: none; box-sizing: border-box; margin-bottom: 10px; }
.bw-memmodal-search:focus { border-color: var(--accent); }
.bw-memmodal-section-label { font-size: 0.68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; padding: 8px 16px 4px; }
.bw-memmodal-item { display: flex; align-items: center; gap: 10px; padding: 7px 16px; cursor: pointer; transition: background 0.12s; }
.bw-memmodal-item:hover { background: var(--surface-3); }
.bw-memmodal-name { font-size: 0.85rem; font-weight: 600; color: var(--fg); flex: 1; }
.bw-memmodal-name.offline { color: var(--muted); opacity: 0.65; }
.bw-memmodal-role { font-size: 0.62rem; padding: 1px 5px; border-radius: 4px; font-weight: 700; }
.bw-memmodal-actions { display: flex; gap: 6px; opacity: 0; transition: opacity 0.1s; }
.bw-memmodal-item:hover .bw-memmodal-actions { opacity: 1; }
.bw-memmodal-btn { background: none; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); padding: 3px 8px; font-size: 0.72rem; cursor: pointer; transition: all 0.1s; white-space: nowrap; }
.bw-memmodal-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Follower Modal ─────────────────────────────────────────── */
#modal-followers .bw-modal { max-width: 520px; max-height: 85vh; display: flex; flex-direction: column; }
#modal-followers .bw-modal-body { overflow-y: auto; padding: 0; }
.bw-follower-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); padding: 0 16px; }
.bw-follower-tab { background: none; border: none; color: var(--muted); font-size: 0.82rem; font-weight: 600; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; }
.bw-follower-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.bw-follower-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; transition: background 0.1s; }
.bw-follower-item:hover { background: var(--surface-3); }
.bw-follower-name { font-size: 0.85rem; font-weight: 600; color: var(--fg); flex: 1; }
.bw-follower-action-btn { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); padding: 4px 10px; font-size: 0.75rem; cursor: pointer; transition: all 0.1s; }
.bw-follower-action-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.bw-follower-action-btn.danger:hover { background: var(--danger); border-color: var(--danger); }
.bw-follower-broadcast { width: 100%; padding: 14px 16px; border-top: 1px solid var(--border); }
.bw-follower-broadcast textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--fg); font-size: 0.85rem; resize: none; box-sizing: border-box; outline: none; min-height: 70px; }
.bw-follower-broadcast textarea:focus { border-color: var(--accent); }

/* ── Ankündigung Modal ──────────────────────────────────────── */
#modal-announce .bw-modal { max-width: 460px; }
.bw-announce-types { display: flex; gap: 8px; margin-bottom: 14px; }
.bw-announce-type-btn { flex: 1; padding: 9px 6px; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--muted); transition: all 0.15s; text-align: center; }
.bw-announce-type-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }

/* ── Sound Picker ───────────────────────────────────────────── */
#sound-picker { display: none; position: absolute; bottom: 72px; left: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px; box-shadow: var(--shadow-md); z-index: 300; width: 260px; }
.bw-sound-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bw-sound-btn { background: var(--surface-3); border: none; border-radius: 8px; padding: 8px 4px; cursor: pointer; font-size: 1.3rem; text-align: center; transition: all 0.15s; }
.bw-sound-btn:hover { background: var(--accent-subtle); transform: scale(1.1); }
.bw-sound-btn:active { transform: scale(0.95); }
.bw-sound-label { font-size: 0.58rem; color: var(--muted); display: block; margin-top: 2px; }

/* ── Chat Bildvorschau & Links ──────────────────────────────────── */
.bw-chat-img-wrap { display:block; margin:6px 0; }
.bw-chat-img-preview { max-width:280px;max-height:200px;border-radius:10px;cursor:zoom-in;border:1px solid var(--border);transition:opacity .15s,transform .15s;display:block; }
.bw-chat-img-preview:hover { opacity:.9;transform:scale(1.02); }
.bw-chat-link { color:var(--accent);text-decoration:underline;word-break:break-all;font-size:inherit; }
.bw-chat-link:hover { opacity:.8; }

/* ── Screen-Indikator im Kanal-Item ─────────────────────────────── */
.bw-ch-screen-ind {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(225,29,72,0.15); border: 1px solid rgba(225,29,72,0.35);
  border-radius: 5px; padding: 1px 5px;
  font-size: 0.55rem; font-weight: 700; color: #e11d48;
  margin-left: auto; flex-shrink: 0;
  animation: wb-live-pulse 1.5s infinite;
}
/* ── Rail-Icon-Button ───────────────────────────────────────────── */
.bw-rail-icon-btn { width:32px;height:32px;border-radius:8px;border:none;background:none;cursor:pointer;color:var(--muted);display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s;flex-shrink:0; }
.bw-rail-icon-btn:hover { background:var(--surface-3);color:var(--fg); }
/* ── Discord-Style User-Card in der Rail ───────────────────────── */
.bw-rail-usercard { display:flex;align-items:center;gap:6px;padding:6px 4px;border-radius:10px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.06);margin:0 2px;cursor:default;transition:background .15s;width:calc(100% - 4px);box-sizing:border-box; }
.bw-rail-usercard:hover { background:rgba(255,255,255,.07); }
.bw-rail-uc-avatar-wrap { position:relative;flex-shrink:0;cursor:pointer; }
.bw-rail-uc-avatar { width:32px!important;height:32px!important;font-size:.72rem!important;border-radius:50%!important;cursor:pointer; }
.bw-rail-uc-status { position:absolute;bottom:-1px;right:-1px;width:10px;height:10px;border-radius:50%;border:2px solid var(--surface-1,#111);background:#22c55e; }
.bw-rail-uc-status.away { background:#f59e0b; }
.bw-rail-uc-status.offline { background:#6b7280; }
.bw-rail-uc-info { flex:1;min-width:0;cursor:pointer; }
.bw-rail-uc-name { font-size:.72rem;font-weight:700;color:var(--fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2; }
.bw-rail-uc-statustext { font-size:.58rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:1px; }
.bw-rail-uc-actions { display:flex;gap:2px;flex-shrink:0; }
.bw-rail-uc-btn { width:26px;height:26px;border-radius:6px;border:none;background:none;cursor:pointer;color:var(--muted);display:flex;align-items:center;justify-content:center;transition:background .12s,color .12s; }
.bw-rail-uc-btn:hover { background:rgba(255,255,255,.1);color:var(--fg); }
.bw-rail-uc-btn.muted { color:var(--danger);background:rgba(239,68,68,.12); }
/* ── Discord-Style Mitgliederliste ──────────────────────────────── */
#dc-members-panel.visible { display: flex !important; }
.dc-group-label { padding:6px 8px 3px; font-size:.58rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.07em; }
.dc-member-row { display:flex; align-items:center; gap:8px; padding:5px 8px; border-radius:6px; cursor:pointer; transition:background .1s; position:relative; }
.dc-member-row:hover { background:rgba(255,255,255,.06); }
.dc-member-avatar { width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:.68rem; font-weight:700; color:#fff; overflow:hidden; flex-shrink:0; position:relative; }
.dc-status-dot { position:absolute; bottom:0; right:0; width:9px; height:9px; border-radius:50%; border:2px solid #111; }
.dc-status-dot.online  { background:#22c55e; }
.dc-status-dot.away    { background:#f59e0b; }
.dc-status-dot.offline { background:#6b7280; }
.dc-member-name { font-size:.8rem; font-weight:600; color:var(--fg); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.dc-member-row.offline .dc-member-name { color:var(--muted); opacity:.6; }
.dc-member-streaming { font-size:.62rem; color:#e11d48; }
.dc-ctx-item { padding:7px 10px; border-radius:4px; cursor:pointer; color:var(--fg); transition:background .1s; display:flex; align-items:center; gap:8px; font-size:.82rem; }
.dc-ctx-item:hover { background:rgba(108,99,255,.25); color:#fff; }
.dc-ctx-item.danger { color:#f87171; }
.dc-ctx-item.danger:hover { background:rgba(239,68,68,.25); color:#fca5a5; }
.dc-ctx-sep { height:1px; background:rgba(255,255,255,.07); margin:3px 0; }
#rp-btn-members-dc.active { color:var(--accent); background:var(--accent-subtle); }

/* ── Kamera PiP im Screen-Tile ─────────────────────────────────── */
.bw-screen-cam-pip {
  position: absolute;
  bottom: 48px;
  right: 10px;
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow: 0 3px 12px rgba(0,0,0,0.55);
  z-index: 5;
  cursor: move;
  background: #111;
}

/* ── Benachrichtigungen Settings ──── */
.bw-notif-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.bw-notif-row:last-child { border-bottom: none; }
.bw-notif-label { font-size: 0.85rem; color: var(--fg); }
.bw-notif-sublabel { font-size: 0.73rem; color: var(--muted); margin-top: 2px; }
.bw-toggle { width: 38px; height: 22px; border-radius: 11px; background: var(--border); border: none; cursor: pointer; position: relative; transition: background 0.2s; flex-shrink: 0; }
.bw-toggle.on { background: var(--accent); }
.bw-toggle::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform 0.2s; }
.bw-toggle.on::after { transform: translateX(16px); }

/* Preloader keyframes */
@keyframes preloaderPulse{0%,100%{opacity:0.6;transform:scale(1)}50%{opacity:1;transform:scale(1.08)}}@keyframes preloaderBar{0%{width:0%;margin-left:0}50%{width:80%;margin-left:0}100%{width:0%;margin-left:100%}}

/* WaveStream slider */
/* ── WaveStream Slider Block ── */
        .ws-slider-wrap {
          padding: 10px 12px 10px;
          border-bottom: 1px solid var(--border);
          flex-shrink: 0;
          background: linear-gradient(180deg,
            color-mix(in oklab, #6C63FF 8%, var(--surface-2)) 0%,
            var(--surface-2) 100%);
        }

        /* Obere Zeile: Icon + Label + Live-Zähler */
        .ws-slider-top {
          display: flex;
          align-items: center;
          gap: 8px;
          margin-bottom: 9px;
        }
        .ws-live-dot {
          width: 7px; height: 7px;
          border-radius: 50%;
          background: linear-gradient(135deg, #6C63FF, #00c2ff);
          flex-shrink: 0;
          animation: pulse-dot 1.4s ease-in-out infinite;
        }
        .ws-label {
          flex: 1;
          font-size: .78rem;
          font-weight: 700;
          color: var(--fg);
          letter-spacing: .01em;
        }
        .ws-count {
          font-size: .65rem;
          font-weight: 600;
          color: #00c2ff;
          background: rgba(0,194,255,.1);
          border: 1px solid rgba(0,194,255,.2);
          border-radius: 10px;
          padding: 1px 7px;
          display: none;
        }
        .ws-count.has-live { display: inline-block; }

        /* ── Der eigentliche Slider ── */
        .ws-toggle-row {
          display: flex;
          align-items: center;
          gap: 10px;
        }

        /* Äußeres Label = clickable Track-Container */
        .ws-toggle-label {
          position: relative;
          width: 56px;
          height: 28px;
          flex-shrink: 0;
          cursor: pointer;
          -webkit-tap-highlight-color: transparent;
        }
        .ws-toggle-label input {
          opacity: 0;
          width: 0; height: 0;
          position: absolute;
        }

        /* Track */
        .ws-track {
          position: absolute;
          inset: 0;
          border-radius: 28px;
          background: var(--surface-3);
          border: 1.5px solid var(--border);
          transition: background .3s, border-color .3s, box-shadow .3s;
        }

        /* Thumb */
        .ws-thumb {
          position: absolute;
          top: 3px; left: 3px;
          width: 20px; height: 20px;
          border-radius: 50%;
          background: var(--muted);
          transition: transform .3s cubic-bezier(.34,1.56,.64,1),
                      background .3s, box-shadow .3s;
          z-index: 1;
          display: flex; align-items: center; justify-content: center;
          font-size: 9px;
        }

        /* AN-Zustand */
        .ws-toggle-label input:checked ~ .ws-track {
          background: linear-gradient(135deg, #6C63FF, #00c2ff);
          border-color: transparent;
          box-shadow:
            0 0 0 3px rgba(108,99,255,.25),
            0 0 16px rgba(0,194,255,.35);
          animation: ws-track-pulse 2s ease-in-out infinite;
        }
        .ws-toggle-label input:checked ~ .ws-thumb {
          transform: translateX(28px);
          background: #fff;
          box-shadow: 0 2px 8px rgba(108,99,255,.5);
        }

        @keyframes ws-track-pulse {
          0%,100% {
            box-shadow: 0 0 0 3px rgba(108,99,255,.25),
                        0 0 14px rgba(0,194,255,.3);
          }
          50% {
            box-shadow: 0 0 0 5px rgba(108,99,255,.15),
                        0 0 24px rgba(0,194,255,.55);
          }
        }

        /* Status-Text */
        .ws-status-text {
          font-size: .72rem;
          font-weight: 600;
          color: var(--muted);
          transition: color .3s;
          flex: 1;
          line-height: 1.3;
        }
        .ws-status-text .ws-status-main {
          display: block;
        }
        .ws-status-text .ws-status-sub {
          display: block;
          font-size: .62rem;
          font-weight: 400;
          color: var(--muted);
          opacity: .7;
          margin-top: 1px;
        }
        .ws-status-text.is-on .ws-status-main { color: #00c2ff; }
        .ws-status-text.is-on .ws-status-sub  { color: rgba(0,194,255,.6); opacity:1; }
