html.i18n-pending body { visibility: hidden; }
        /* ============================================
           ПАЛИТРА — чёрно-белый, минималистичный, в духе дорогого
           итальянского бренда: белый/светло-серый фон, насыщенный
           почти-чёрный текст и акцент, никаких цветных градиентов.
           Один-единственный акцентный цвет (чёрный) — вместо
           "фирменного" цветного акцента, как у типового SaaS.
           Раньше здесь стоял тёплый фон + бирюзовый акцент — этого
           никто не одобрял, поэтому меняю на то, что прямо просили.
           ============================================ */
        :root {
            /* Смягчено по запросу: белый — тёплый мягкий оттенок вместо
               стерильного, чёрный — графитово-серый вместо почти
               чистого чёрного (#111111). Эти же значения буквально
               (не через переменные — на landing.html своя таблица
               стилей) продублированы в landing.html, чтобы обе страницы
               были на одном и том же фоне, а не просто "похожем". */
            --bg: #f7f6f4;
            --surface: #fdfcfa;
            --surface-alt: #f0efec;
            --text: #333333;
            --text-muted: #7a7873;
            --accent: #333333;
            --accent-dark: #262626;
            --accent-soft: #f0efec;
            --accent-soft-border: #333333;
            --border-soft: #e2e0da;
        }
        body {
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
            padding: 20px;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
        }
        /* Раньше порядок в DOM = порядок на экране: шапка → большая
           тёмная панель с инфо о комнате → QR-код → форма входа →
           только ПОТОМ передача файлов и чат — то есть самое главное
           (ради чего вообще открывают сайт) было ниже всего служебного.
           flex + order переставляют визуальный порядок, не трогая сам
           HTML — передача и чат теперь идут сразу за шапкой, а всё
           связанное с управлением комнатой (кому "уже был здесь один
           раз, дальше просто передаёт") — ниже, как второстепенное. */
        .top-header-bar { order: 0; }
        #transferPanel { order: 1; }
        #chatPanel { order: 2; }
        .current-room {
            background: var(--surface);
            color: var(--text);
            border: 1px solid var(--border-soft);
            border-radius: 16px;
            padding: 14px;
            margin-bottom: 16px;
            box-shadow: 0 3px 14px -7px rgba(51,51,51,0.22);
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 10px;
            align-items: stretch;
        }
        .room-row {
            min-width: 0;
            min-height: 62px;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: center;
            gap: 6px;
            padding: 10px 12px;
            background: var(--surface-alt);
            border: 1px solid var(--border-soft);
            border-radius: 12px;
            font-size: 13px;
        }
        .room-row .label {
            color: var(--text-muted);
            font-weight: 600;
            font-size: 11px;
            white-space: nowrap;
        }
        .room-row .value {
            width: 100%;
            font-weight: 600;
            font-size: 13px;
            word-break: break-word;
            overflow-wrap: anywhere;
        }
        .room-row .badge {
            font-size: 11px;
            padding: 3px 8px;
            border-radius: 20px;
            background: var(--accent) !important;
            color: white !important;
            font-weight: 600;
            vertical-align: middle;
        }
        .user-item {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 8px;
            background: var(--surface);
            border: 1px solid var(--border-soft);
            border-radius: 8px;
            font-size: 12px;
            font-weight: 500;
            color: var(--text) !important;
        }
        .user-item.connected {
            border-color: var(--accent);
            background: var(--surface);
        }
        .user-item i { font-size: 11px; }
        .room-row-online {
            grid-column: span 1;
        }
        #usersList {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            width: 100%;
        }
        #usersList .text-muted { color: var(--text-muted) !important; }
        .room-actions {
            grid-column: 1 / -1;
            display: flex;
            justify-content: flex-end;
        }
        .room-actions .btn { min-width: 160px; }

        /* Чат — не для переписки, а для быстрой передачи текста/ссылки:
           главное здесь САМ текст, а не то, кто и в каком "пузыре" его
           написал. Раньше однострочные сообщения были в цветном пузыре
           (белый текст на тёмном фоне), а многострочные — прозрачные с
           тёмным текстом (свойство has-paste переопределяло цвет из-за
           порядка правил в CSS) — визуально два разных стиля для ОДНОГО
           и того же отправителя, в зависимости от того, есть ли в
           тексте перенос строки. Теперь единый нейтральный вид для
           любого сообщения — светлый фон, тёмный текст, разница между
           "я"/"собеседник" — только тонкая цветная полоса сбоку. */
        .chat-message {
            margin-bottom: 8px;
            padding: 6px 10px;
            border-radius: 8px;
            max-width: 90%;
            background: var(--surface-alt);
            color: var(--text);
            border-left: 2px solid var(--accent);
            overflow-wrap: break-word;
            word-break: break-word;
        }
        .chat-message.me { margin-left: auto; border-left: none; border-right: 2px solid var(--accent); }
        .chat-message-header { font-size: 10px; margin-bottom: 2px; color: var(--text-muted); display: flex; justify-content: space-between; gap: 10px; }
        .chat-message a.chat-link {
            color: var(--accent-dark);
            text-decoration: underline;
            font-weight: 600;
            word-break: break-all;
        }
        .chat-link-wrap {
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }
        .chat-link-copy-btn {
            border: none;
            background: rgba(51,51,51,0.08);
            color: inherit;
            width: 20px;
            height: 20px;
            border-radius: 5px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            cursor: pointer;
            flex-shrink: 0;
            padding: 0;
        }
        .chat-link-copy-btn:hover { background: var(--accent); color: white; }
        /* Многострочные сообщения ("pastebin"-режим) — та же внешняя
           рамка/фон, что и у обычных (см. .chat-message выше), только
           паддинг чуть теснее и ширина пошире под моноширинный текст.
           Больше никакого отдельного цвета/фона здесь не задаём —
           именно это и была причина рассинхронизации. */
        .chat-message.has-paste {
            padding: 4px 4px;
            max-width: 96%;
        }
        /* Многострочные сообщения ("pastebin"-режим): моноширинный
           шрифт, номера строк слева, каждая строка — отдельная колонка,
           можно скопировать кликом по номеру.
           Было слишком просторно по высоте (стандартный line-height
           Bootstrap ~1.5 на моноширинном шрифте выглядит рыхло) и текст
           был полностью чёрным без разделения по значимости — теперь
           плотнее и номера/текст разного, приглушённого тона, ближе к
           типичному виду pastebin. */
        .paste-block {
            font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
            font-size: 12.5px;
            line-height: 1.45;
            background: rgba(0,0,0,0.035);
            border-radius: 6px;
            padding: 4px 0;
            overflow-x: auto;
        }
        .paste-row {
            display: flex;
            align-items: flex-start;
            padding: 0 10px;
        }
        .paste-row:hover { background: rgba(0,0,0,0.05); }
        .paste-line-number {
            flex-shrink: 0;
            min-width: 24px;
            text-align: right;
            margin-right: 10px;
            color: var(--text-muted);
            user-select: none;
            cursor: pointer;
        }
        .paste-line-number:hover { color: var(--accent); text-decoration: underline; }
        .paste-line-text {
            /* Длинная строка без переносов (например, длинная ссылка)
               переносится по словам/символам внутри своей визуальной
               строки — но это НЕ создаёт новый номер строки: нумерация
               считает только настоящие переводы строки (Enter) в
               исходном тексте, а не то, куда именно перенёс текст
               браузер при отрисовке. align-items: flex-start у
               .paste-row (выше) держит номер прижатым к верхней визуальной
               строке, как в обычных редакторах кода. */
            white-space: pre-wrap;
            word-break: break-word;
            overflow-wrap: break-word;
            color: var(--text);
        }
        .chat-message {
            margin-bottom: 10px;
            padding: 0;
            max-width: 92%;
            background: transparent;
            border: none;
            overflow-wrap: break-word;
            word-break: break-word;
        }
        .chat-message.me { margin-left: auto; }
        .chat-message-header {
            font-size: 10px;
            margin: 0 4px 4px;
            color: var(--text-muted);
            display: flex;
            justify-content: space-between;
            gap: 10px;
        }
        .chat-message > .small {
            padding: 9px 11px;
            border: 1px solid var(--border-soft);
            border-left: 3px solid var(--accent);
            border-radius: 10px;
            background: var(--surface);
            color: var(--text);
            line-height: 1.45;
        }
        .chat-message.me > .small {
            border-left: 1px solid var(--border-soft);
            border-right: 3px solid var(--accent);
        }
        .chat-message.has-paste { padding: 0; max-width: 96%; }
        .chat-message.has-paste .paste-block {
            border: 1px solid var(--border-soft);
            border-left: 3px solid var(--accent);
            background: var(--surface);
        }
        .chat-message.me.has-paste .paste-block {
            border-left: 1px solid var(--border-soft);
            border-right: 3px solid var(--accent);
        }

        .history-item {
            font-size: 12px;
            padding: 6px 0;
            border-bottom: 1px solid var(--surface-alt);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .history-item.success { color: #4caf50; }
        .history-item.error { color: #f44336; }
        .history-item.info { color: #2196f3; }
        .history-item.system { color: #888; font-style: italic; }
        .progress { height: 4px; border-radius: 2px; }
        .chat-messages-container {
            height: 380px;
            overflow-y: auto;
            background: var(--surface-alt);
            border-radius: 12px;
            padding: 12px;
            margin-bottom: 12px;
        }
        /* Поле ввода чата: раньше было rows="1" без авто-роста — тесно
           для текста длиннее одной строки. Теперь растёт вместе с
           текстом (до максимума, дальше — внутренняя прокрутка), и
           минимальная высота сразу удобнее для набора. */
        #chatInput {
            min-height: 44px;
            max-height: 120px;
            overflow-y: auto;
            line-height: 1.4;
            padding-top: 10px;
            padding-bottom: 10px;
        }
        /* Кнопка отправки: у Bootstrap .btn по умолчанию высота ~38px —
           меньше рекомендуемых Apple 44×44pt минимального тач-таргета,
           отсюда промахи по кнопке на iPhone.
           .input-group (Bootstrap) растягивает детей по высоте flex'ом
           (align-items: stretch) — как только textarea выросла в высоту
           (авто-рост при многострочном вводе), кнопка растягивалась
           вместе с ней и превращалась в длинную вертикальную полосу.
           align-self: flex-end фиксирует кнопку у нижнего края и не даёт
           ей тянуться за полем ввода. */
        /* Кнопка отправки: раньше — bootstrap-синяя, круглая, с иконкой
           самолётика ровно как в Telegram. Меняю форму (скруглённый
           квадрат вместо пилюли/круга), иконку (стрелка вместо самолётика)
           и цвет (акцент проекта, не синий) — чтобы не читалось как
           клон другого продукта. */
        #sendTextBtn {
            width: 44px;
            height: 44px;
            align-self: flex-end;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            background: var(--accent);
            border-color: var(--accent);
            border-radius: 12px;
        }
        #sendTextBtn:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
        #sendTextBtn:disabled { background: var(--text-muted); border-color: var(--text-muted); opacity: 0.5; }
        #sendTextBtn i {
            font-size: 16px;
        }
        /* Кнопка копирования в сообщениях чата — та же логика: делаем
           тач-таргет не меньше 44×44, а не только видимую иконку. */
        .copy-btn {
            min-width: 32px;
            min-height: 32px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        .p2p-indicator {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 500;
        }
        .p2p-indicator.active { background: #4caf50; color: white; }
        .p2p-indicator.warning { background: #ff9800; color: white; }
        .p2p-indicator i { font-size: 10px; }
        button, .btn, .user-item {
            cursor: pointer;
            -webkit-tap-highlight-color: transparent;
        }
        /* Единый минимальный тач-таргет для ВСЕХ кнопок и на десктопе, и
           на мобильных — раньше это проставлялось только на мобильных
           через JS уже после отрисовки Bootstrap-кнопок (addMobileTouchEvents),
           что давало на секунду-другую "неправильный" размер и вообще
           не применялось на десктопе. Теперь одно и то же правило для всех. */
        button.btn, .btn {
            min-height: 44px;
            touch-action: manipulation;
        }
        .btn.btn-sm {
            min-height: 36px;
        }
        /* Bootstrap-синий по умолчанию нигде раньше не переопределялся
           для .btn-primary (кнопки "Войти"/"Создать") — на чёрно-белой
           палитре это резко выбивалось бы цветом. Делаем основной
           кнопкой чёрный/белый, в духе остального интерфейса. */
        .btn-primary {
            background-color: var(--accent);
            border-color: var(--accent);
            letter-spacing: 0.4px;
        }
        .btn-primary:hover, .btn-primary:focus {
            background-color: var(--accent-dark);
            border-color: var(--accent-dark);
        }
        .btn-outline-secondary {
            color: var(--text);
            border-color: var(--text);
        }
        .btn-outline-secondary:hover {
            background-color: var(--text);
            border-color: var(--text);
        }
        /* Кнопка "Резерв" переехала из тёмной панели комнаты в белую
           карточку передачи файлов (index.html) — раньше её ховер-стиль
           был рассчитан на тёмный фон (полупрозрачный белый), на светлой
           карточке был бы почти невидим. Класс кнопки сменён на
           btn-outline-secondary — тот же тёмный контур, что и у прочих
           вторичных кнопок в карточках, ховер уже переопределён выше. */
        #forceFallbackBtn {
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            text-align: center !important;
            gap: 4px;
            white-space: nowrap;
            padding: 4px 12px !important;
            transition: opacity 0.3s ease;
        }
        #forceFallbackBtn[style*="display: none"] {
            display: none !important;
        }
        .transfer-status {
            font-size: 12px;
            color: #6c757d;
            margin-top: 8px;
            text-align: center;
        }
        /* Зона выбора/перетаскивания файла — заменяет собой две
           дублирующиеся "плавающие" кнопки (одна была в этом файле,
           вторая — независимо создавалась в app.js, обе на fixed-
           позиционировании с задержкой в 1 секунду после загрузки).
           Fixed-позиционирование на iOS Safari плывёт при появлении
           клавиатуры/адресной строки — отсюда и жалобы на "съезжает,
           пропадает". Теперь это обычный блок внутри карточки, часть
           общего потока страницы, ведёт себя одинаково на всех
           устройствах. */
        .drop-zone {
            border: 2px dashed #c8cdf0;
            border-radius: 14px;
            padding: 28px 16px;
            text-align: center;
            cursor: pointer;
            transition: border-color 0.2s, background-color 0.2s;
            background: #fafbff;
        }
        .drop-zone:hover {
            border-color: var(--accent);
            background: #f2f4ff;
        }
        .drop-zone.drag-over {
            border-color: var(--accent);
            background: #eef0ff;
        }
        .drop-zone-icon {
            font-size: 28px;
            color: var(--accent);
            margin-bottom: 8px;
            display: block;
        }
        .drop-zone-text {
            font-size: 14px;
            color: #555;
        }
        .drop-zone-text a {
            color: var(--accent);
            font-weight: 600;
            text-decoration: none;
        }
        .drop-zone-text a:hover { text-decoration: underline; }
        @media (max-width: 576px) {
            .drop-zone { padding: 20px 12px; }
            .drop-zone-icon { font-size: 24px; }
            .drop-zone-text { font-size: 13px; }
        }
        /* Индикатор "печатает…" под чатом */
        #typingIndicator {
            font-size: 12px;
            color: #888;
            font-style: italic;
            min-height: 16px;
            margin-top: 4px;
        }
        @media (max-width: 768px) {
            body { padding: 12px; }
            .chat-messages-container { height: 300px; }
            .room-row .label { min-width: 80px; }
            #forceFallbackBtn { font-size: 10px !important; padding: 4px 8px !important; }
        }

        /* ============================================
           БЛОК QR + КНОПКА ОБНОВЛЕНИЯ (центрирование)
           ============================================ */
        .qr-wrapper {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 30px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }
        #qrContainer {
            flex-shrink: 0;
        }

        .refresh-block {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 6px;
            align-self: center;
        }
        .refresh-label {
            font-size: 13px;
            font-weight: 500;
            color: var(--text);
            text-align: center;
            white-space: nowrap;
            letter-spacing: 0.3px;
        }

        .refresh-btn {
            width: 110px;
            height: 110px;
            border-radius: 50%;
            background: white;
            border: none;
            box-shadow: 0 2px 10px rgba(0,0,0,0.15);
            color: var(--accent);
            font-size: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
            flex-shrink: 0;
            position: relative;
            font-weight: 600;
        }
        .refresh-btn:hover:not(:disabled) {
            transform: rotate(90deg);
            box-shadow: 0 4px 15px rgba(0,0,0,0.25);
        }
        .refresh-btn:disabled {
            opacity: 0.6;
            transform: none !important;
            box-shadow: none !important;
            cursor: not-allowed;
        }
        .refresh-btn .icon-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            line-height: 1.2;
        }
        .refresh-btn .icon-wrap i {
            font-size: 40px;
        }

        .refresh-timer {
            font-size: 13px;
            font-weight: 600;
            color: var(--text);
            min-height: 20px;
            text-align: center;
            font-variant-numeric: tabular-nums;
        }

        @media (max-width: 576px) {
            .qr-wrapper {
                gap: 16px;
            }
            .refresh-btn {
                width: 48px;
                height: 48px;
                font-size: 18px;
            }
            .refresh-btn .icon-wrap i {
                font-size: 16px;
            }
            .refresh-label {
                font-size: 11px;
                white-space: normal;
            }
            .refresh-timer {
                font-size: 11px;
            }
        }
        .qr-scanner-video { width: 100%; max-height: 65vh; object-fit: cover; border-radius: 14px; background: #111; }
        .qr-scanner-frame { position: relative; overflow: hidden; border-radius: 14px; background: #111; }
        .qr-scanner-frame::after { content: ""; position: absolute; left: 15%; right: 15%; top: 50%; height: 2px; background: rgba(255,255,255,.85); box-shadow: 0 0 12px rgba(255,255,255,.7); pointer-events: none; }
        .qr-scanner-status { min-height: 22px; font-size: 13px; color: var(--text-muted); text-align: center; }

        .room-timer {
            display: inline-block;
            margin-left: 8px;
            padding: 2px 7px;
            border-radius: 999px;
            background: var(--surface-alt);
            color: var(--text-muted);
            font-size: 12px;
            font-weight: 600;
            font-variant-numeric: tabular-nums;
        }

        /* ============================================================
           RESPONSIVE / MOBILE-FIRST LAYER
           Базовая разметка рассчитана сначала на узкий экран; ширина
           увеличивается ступенчато для планшета и desktop. Никаких
           фиксированных desktop-only размеров и горизонтального скролла.
           ============================================================ */
        html { overflow-x: hidden; }
        body {
            width: 100%;
            max-width: 100vw;
            padding: max(10px, env(safe-area-inset-top))
                     max(10px, env(safe-area-inset-right))
                     max(10px, env(safe-area-inset-bottom))
                     max(10px, env(safe-area-inset-left));
            overflow-x: hidden;
            font-size: 15px;
        }
        .container {
            width: 100%;
            max-width: 1200px;
            padding-left: 0;
            padding-right: 0;
        }
        .top-header-bar { width: 100%; }
        .top-header-bar > .d-flex {
            gap: 10px;
            flex-wrap: wrap;
        }
        .top-header-bar h1 {
            flex: 1 1 100%;
            order: 2;
            text-align: center;
            font-size: clamp(1.35rem, 6vw, 2.1rem) !important;
            line-height: 1.2;
        }
        .top-header-bar .lang-select { order: 1; }
        .top-header-bar > .d-flex > a {
            order: 3;
            margin-left: auto;
            font-size: 13px !important;
        }
        .top-header-bar > p {
            font-size: clamp(13px, 3.6vw, 15px);
            line-height: 1.45;
            padding: 0 6px;
        }

        .current-room {
            grid-template-columns: 1fr;
            gap: 8px;
            padding: 10px;
            border-radius: 14px;
        }
        .room-row { min-height: 58px; padding: 9px 10px; }
        .room-row .label { font-size: 10px; }
        .room-row .value { font-size: 13px; }
        .room-actions { width: 100%; }
        .room-actions .btn { width: 100%; min-width: 0; }
        #usersList { min-width: 0; }

        .qr-wrapper {
            width: 100%;
            gap: 14px;
            margin-bottom: 14px;
        }
        #qrContainer {
            width: min(100%, 280px);
            max-width: 70vw;
        }
        #qrContainer img, #qrContainer canvas {
            display: block;
            width: min(100%, 280px) !important;
            height: auto !important;
            max-width: 100%;
        }
        .refresh-block { min-width: 120px; max-width: 45%; }
        .refresh-btn {
            width: clamp(64px, 18vw, 92px);
            height: clamp(64px, 18vw, 92px);
        }
        .refresh-btn .icon-wrap i { font-size: clamp(22px, 7vw, 34px); }
        .refresh-label { white-space: normal; font-size: 12px; line-height: 1.3; }

        .card {
            width: 100%;
            border-radius: 14px;
            margin-bottom: 14px;
        }
        .card-body { padding: clamp(12px, 3.5vw, 20px); }
        .card-title { font-size: 15px; }

        #joinControlsPanel .row { margin-left: 0; margin-right: 0; }
        #joinControlsPanel .row > [class*="col-"] {
            padding-left: 0;
            padding-right: 0;
        }
        #joinControlsPanel .d-flex {
            flex-wrap: wrap;
        }
        #joinControlsPanel .d-flex > .btn {
            flex: 1 1 100%;
            width: 100%;
        }
        #manualRoomId, #manualPassword { min-height: 44px; font-size: 16px; }

        #transferPanel .card-body > .d-flex {
            align-items: flex-start !important;
            gap: 8px;
        }
        #forceFallbackBtn { flex: 0 0 auto; }
        .drop-zone {
            min-height: 116px;
            padding: 22px 12px;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        .drop-zone-text { line-height: 1.45; }

        .chat-messages-container {
            height: 300px;
            min-height: 240px;
            max-height: min(52dvh, 380px);
            padding: 9px;
            border-radius: 10px;
        }
        .chat-message, .chat-message.has-paste {
            max-width: 100%;
        }
        .chat-message > .small {
            padding: 9px 10px;
            font-size: 14px;
        }
        .paste-block {
            max-width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        .paste-row { min-width: max-content; max-width: 100%; }
        #chatInput {
            width: 100%;
            min-height: 44px;
            max-height: 132px;
            font-size: 16px; /* prevents iOS Safari auto-zoom */
        }
        .input-group {
            display: flex;
            align-items: flex-end;
            gap: 8px;
        }
        .input-group #chatInput {
            border-radius: 10px !important;
        }
        #sendTextBtn {
            width: 44px;
            min-width: 44px;
            height: 44px;
            border-radius: 10px;
        }
        #typingIndicator { min-height: 18px; }

        .history-item { flex-wrap: wrap; line-height: 1.35; }
        .modal-dialog {
            width: auto;
            margin: .5rem;
        }
        .modal-content { border-radius: 16px !important; }
        .modal-body { padding: 14px; }
        .qr-scanner-video { max-height: 62dvh; }

        @media (min-width: 480px) {
            body { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
            .top-header-bar h1 { flex: 1 1 auto; order: 2; }
            .top-header-bar > .d-flex > a { margin-left: 0; }
            #joinControlsPanel .d-flex > .btn { flex: 1 1 calc(50% - 4px); width: auto; }
            #joinControlsPanel .d-flex > #joinRoomBtn { flex-basis: 100%; }
        }
        @media (min-width: 576px) {
            .current-room { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .room-actions .btn { width: auto; min-width: 160px; }
            #joinControlsPanel .d-flex > #joinRoomBtn { flex: 1 1 0; }
            #joinControlsPanel .d-flex > .btn { flex-basis: 0; }
            .qr-wrapper { gap: 22px; }
            #qrContainer { max-width: 300px; }
        }
        @media (min-width: 768px) {
            body { padding: 16px; font-size: 16px; }
            .top-header-bar h1 { flex: 1 1 auto; text-align: left; font-size: clamp(1.7rem, 3vw, 2.2rem) !important; }
            .top-header-bar > .d-flex > a { font-size: 14px !important; }
            #joinControlsPanel .row > .col-md-4 { flex: 0 0 33.333333%; width: 33.333333%; padding-left: 4px; padding-right: 4px; }
            #joinControlsPanel .d-flex > .btn { flex: 1 1 auto; }
            #joinControlsPanel .d-flex > #joinRoomBtn { flex: 1.4 1 auto; }
            .chat-messages-container { height: 340px; }
            .modal-dialog { max-width: 560px; }
        }
        @media (min-width: 992px) {
            body { padding: 20px; }
            .current-room { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 14px; }
            .room-row { min-height: 62px; padding: 10px 12px; }
            .chat-messages-container { height: 380px; }
            .modal-dialog { max-width: 600px; }
        }
        @media (hover: hover) and (pointer: fine) {
            .btn:hover, .user-item:hover, .drop-zone:hover { transition: background-color .18s ease, border-color .18s ease, transform .18s ease; }
        }
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
        }
    .language-switcher { display:flex; align-items:center; gap:8px; white-space:nowrap; }
    .language-label { font-size:13px; font-weight:600; color:var(--text-muted); }
    .lang-select { min-width:145px; min-height:40px; padding:0 38px 0 14px; border:1px solid var(--border-color, #d9d9d9); border-radius:999px; background:var(--surface, #fff); color:var(--text-color, #222); font-size:13px; font-weight:600; box-shadow:0 4px 14px rgba(0,0,0,.06); cursor:pointer; outline:none; appearance:auto; transition:box-shadow .18s ease, border-color .18s ease, transform .18s ease; }
    .lang-select:hover { border-color:#aaa; box-shadow:0 6px 18px rgba(0,0,0,.09); }
    .lang-select:focus { border-color:#999; box-shadow:0 0 0 3px rgba(0,0,0,.08); }
    .lang-select:active { transform:translateY(1px); }
/* Common footer and language control */
.copyright-footer {
    width: 100%;
    margin-top: auto;
    padding: 18px 12px 8px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}
.copyright-footer a { color: inherit; text-decoration: none; }
.language-switcher {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 8px; flex-wrap: nowrap; white-space: nowrap;
}
.language-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.language-flags { display:inline-flex; align-items:center; gap:3px; font-size:14px; letter-spacing:1px; }

