@font-face {
    font-family: 'Encode Sans';
    src: url('EncodeSans-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Segoe UI', Frutiger, 'Frutiger Linotype', 'Dejavu Sans', 'Helvetica Neue', Arial, sans-serif;
    background: #111111;
    color: #CCCCCC;
    height: 100%;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: pan-x pan-y;
}

/* Login Screen */

#login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
}

#login-screen h1 {
    font-family: 'Encode Sans', 'Segoe UI', sans-serif;
    font-size: 22px;
    font-weight: 300;
    color: white;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.login-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.brand-bold {
    font-weight: 600;
}

.login-form {
    background: #222222;
    padding: 40px;
    border-radius: 0;
    width: 100%;
    max-width: 380px;
    border: 2px solid #303030;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #222222;
    border: 2px solid #4B4B4B;
    border-radius: 0;
    color: #CCCCCC;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    user-select: text;
    -webkit-user-select: text;
}

.login-form input::placeholder {
    color: #999999;
}

.login-form input:focus {
    border-color: #26CFEC;
}

.login-form button {
    width: 100%;
    padding: 12px;
    background: #222222;
    color: #CCCCCC;
    border: 1px solid #444444;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.login-form button:hover {
    background: #AAAAAA;
    color: #111111;
    border-color: #AAAAAA;
}

.login-form button:active {
    background: #EEEEEE;
    color: #111111;
    border-color: #EEEEEE;
}

.login-error {
    color: #D11141;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
    min-height: 20px;
}

/* Certificate install section on login screen */

.cert-section {
    margin-top: 20px;
    text-align: center;
    width: 100%;
    max-width: 380px;
}

.cert-link {
    color: #6D6D6D;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.cert-link:hover {
    color: #26CFEC;
}

.cert-panel {
    display: none;
    margin-top: 12px;
    background: #222222;
    border: 2px solid #303030;
    border-radius: 0;
    padding: 20px;
    text-align: left;
}

.cert-panel.open {
    display: block;
}

.cert-hint {
    font-size: 13px;
    color: #999999;
    margin-bottom: 16px;
}

.cert-download-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: #222222;
    color: #CCCCCC;
    border: 1px solid #444444;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    margin-bottom: 16px;
    transition: all 0.15s;
}

.cert-download-btn:hover {
    background: #AAAAAA;
    color: #111111;
    border-color: #AAAAAA;
}

.cert-download-btn:active {
    background: #EEEEEE;
    color: #111111;
    border-color: #EEEEEE;
}

.cert-panel details {
    margin-bottom: 8px;
}

.cert-panel summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 0;
    color: #CCCCCC;
}

.cert-panel summary:hover {
    color: #26CFEC;
}

.cert-panel ol {
    padding: 8px 0 4px 20px;
    color: #999999;
    font-size: 12px;
    line-height: 1.8;
}

/* Intercom Screen */

#intercom-screen {
    display: none;
    flex-direction: column;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #303030;
    flex-shrink: 0;
}

.header h1 {
    font-family: 'Encode Sans', 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 300;
    color: white;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Metro Button — matches MetroFramework MetroButton (Dark theme) */

.metro-btn {
    padding: 8px 20px;
    background: #222222;
    color: #CCCCCC;
    border: 1px solid #444444;
    border-radius: 0;
    font-family: 'Segoe UI', Frutiger, 'Frutiger Linotype', 'Dejavu Sans', 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}

.metro-btn:hover {
    background: #AAAAAA;
    color: #111111;
    border-color: #AAAAAA;
}

.metro-btn:active {
    background: #EEEEEE;
    color: #111111;
    border-color: #EEEEEE;
}

.metro-btn:disabled {
    background: #303030;
    color: #6D6D6D;
    border-color: #6D6D6D;
    cursor: not-allowed;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6D6D6D;
    transition: background 0.3s;
}

.status-dot.connected {
    background: #00B159;
}

.status-dot.connecting {
    background: #FFC425;
    animation: pulse 1s ease-in-out infinite;
}

.status-dot.error {
    background: #D11141;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes talkerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.user-info {
    font-size: 13px;
    color: #999999;
}

.channel-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #444444 transparent;
}

.channel-list::-webkit-scrollbar {
    width: 6px;
}

.channel-list::-webkit-scrollbar-track {
    background: transparent;
}

.channel-list::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 3px;
}

.channel-list::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

.channel-strip {
    background: #222222;
    border: 2px solid #303030;
    border-left: 4px solid #303030;
    border-radius: 0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: opacity 0.2s;
}

.channel-strip.inactive {
    opacity: 0.4;
}

.channel-info {
    min-width: 120px;
}

.channel-name {
    font-size: 16px;
    font-weight: 500;
    color: #D5D5D5;
}

.channel-talkers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    min-height: 18px;
}

.talker-name {
    font-size: 11px;
    color: #D11141;
    font-weight: 600;
    animation: talkerFadeIn 0.2s ease-out;
}

.talker-name + .talker-name::before {
    content: ", ";
    color: #6D6D6D;
    font-weight: 400;
}

.ptt-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #444444;
    background: #292929;
    color: #999999;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex-shrink: 0;
}

.ptt-btn:not(.disabled):hover {
    border-color: #707070;
}

.ptt-btn.active {
    background: #D11141;
    border-color: #ff5252;
    color: #fff;
    box-shadow: 0 0 20px rgba(209, 17, 65, 0.4);
}

.ptt-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.listen-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #444444;
    background: #292929;
    color: #999999;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.listen-btn.active {
    background: #074956;
    border-color: #26CFEC;
    color: #26CFEC;
}

.listen-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.latch-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #444444;
    background: #292929;
    color: #999999;
    font-size: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}

.latch-btn:not(.disabled):hover {
    border-color: #707070;
}

.latch-btn.active {
    background: #D11141;
    border-color: #ff5252;
    color: #fff;
}

.latch-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.volume-control.disabled {
    opacity: 0.3;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 6px;
    background: #333333;
    outline: none;
    border-radius: 0;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #CCCCCC;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.volume-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: #CCCCCC;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}


/* Settings VU Meter */

.settings-vu-meter {
    width: 100%;
    height: 6px;
    background: #1A1A1A;
    border-radius: 0;
    overflow: hidden;
    margin-top: 8px;
}

.settings-vu-meter-fill {
    height: 100%;
    width: 0%;
    background: #26CFEC;
    border-radius: 0;
    transition: width 0.05s;
}

/* Settings Overlay */

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.settings-panel {
    background: #1A1A1A;
    border: 2px solid #303030;
    width: 100%;
    max-width: 560px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #303030;
}

.settings-title {
    font-size: 16px;
    font-weight: 400;
    color: #26CFEC;
}

.settings-close {
    background: #222222;
    border: 1px solid #444444;
    border-radius: 0;
    color: #CCCCCC;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    width: 32px;
    height: 32px;
    line-height: 1;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-close:hover {
    background: #AAAAAA;
    color: #111111;
    border-color: #AAAAAA;
}

.settings-close:active {
    background: #EEEEEE;
    color: #111111;
    border-color: #EEEEEE;
}

.settings-body {
    padding: 20px;
}

.settings-field {
    margin-bottom: 20px;
}

.settings-field:last-child {
    margin-bottom: 0;
}

.settings-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #999999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.settings-tabs {
    display: flex;
    gap: 4px;
    padding: 6px;
}

.settings-tab {
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #242424;
    border: 1px solid #333333;
    border-radius: 0;
    color: #8C8C8C;
    cursor: pointer;
    transition: all 0.15s;
}

.settings-tab:hover {
    color: #CCCCCC;
}

.settings-tab.active {
    color: #FFFFFF;
    background: rgba(38, 207, 236, 0.33);
    border-color: #26CFEC;
}

.keybindings-scroll {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #444444 transparent;
}

.keybindings-scroll::-webkit-scrollbar {
    width: 6px;
}

.keybindings-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.keybindings-scroll::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 3px;
}

.kb-section-header {
    font-size: 11px;
    font-weight: 600;
    color: #6D6D6D;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 14px 0 6px;
}

.kb-section-header:first-child {
    margin-top: 0;
}

.kb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #252525;
    gap: 8px;
}

.kb-action-label {
    font-size: 13px;
    color: #CCCCCC;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kb-key-display {
    width: 100px;
    padding: 6px 10px;
    background: #222222;
    border: 1px solid #444444;
    color: #CCCCCC;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.kb-key-display:hover {
    border-color: #26CFEC;
}

.kb-key-display.listening {
    border-color: #26CFEC;
    color: #26CFEC;
    animation: pulse 1s ease-in-out infinite;
}

.kb-key-display.unbound {
    color: #6D6D6D;
}

.kb-clear-btn {
    width: 28px;
    align-self: stretch;
    background: transparent;
    border: 1px solid #444444;
    color: #6D6D6D;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.kb-clear-btn:hover {
    border-color: #D11141;
    color: #D11141;
}

.settings-divider {
    height: 1px;
    background: #303030;
    margin: 20px 0;
}

.settings-toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-toggle-field .settings-label {
    margin-bottom: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #333333;
    border: 1px solid #4B4B4B;
    transition: all 0.2s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: #999999;
    transition: all 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #074956;
    border-color: #26CFEC;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: #26CFEC;
}

/* Metro ComboBox */

.metro-combo {
    position: relative;
    width: 100%;
    height: 38px;
    background: #222222;
    border: 2px solid #4B4B4B;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: border-color 0.15s;
}

.metro-combo:hover {
    border-color: #26CFEC;
}

.metro-combo.open {
    border-color: #26CFEC;
}

.metro-combo-display {
    padding: 7px 32px 7px 12px;
    font-size: 14px;
    color: #CCCCCC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 20px;
}

.metro-combo-arrow {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999999;
    font-size: 10px;
    pointer-events: none;
    border-left: 1px solid #3A3A3A;
}

.metro-combo-dropdown {
    display: none;
    position: absolute;
    left: -2px;
    right: -2px;
    top: 100%;
    background: #222222;
    border: 2px solid #26CFEC;
    border-top: none;
    z-index: 200;
    max-height: 200px;
    overflow-y: auto;
}

.metro-combo.open .metro-combo-dropdown {
    display: block;
}

.metro-combo-item {
    padding: 8px 12px;
    font-size: 14px;
    color: #CCCCCC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.1s;
}

.metro-combo-item:hover {
    background: #26CFEC;
    color: #111111;
}

.metro-combo-item.selected {
    background: #074956;
    color: #26CFEC;
}

.metro-combo-item.selected:hover {
    background: #26CFEC;
    color: #111111;
}

/* Intercom Body — side-by-side on desktop */

.intercom-body {
    display: flex;
    gap: 16px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* User List Panel (PTP) — right sidebar on desktop */

.user-list-panel {
    width: 260px;
    flex-shrink: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #444444 transparent;
}

.user-list-panel::-webkit-scrollbar {
    width: 6px;
}

.user-list-panel::-webkit-scrollbar-track {
    background: transparent;
}

.user-list-panel::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 3px;
}

.user-list-panel::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

.users-fab {
    display: none;
}

.user-list-header {
    font-size: 14px;
    font-weight: 600;
    color: #999999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.user-list-close {
    display: none;
    background: #222222;
    border: 1px solid #444444;
    border-radius: 0;
    color: #CCCCCC;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    width: 36px;
    height: 36px;
    line-height: 1;
    transition: all 0.15s;
    align-items: center;
    justify-content: center;
}

.user-list-close:hover {
    background: #AAAAAA;
    color: #111111;
    border-color: #AAAAAA;
}

.user-list-close:active {
    background: #EEEEEE;
    color: #111111;
    border-color: #EEEEEE;
}

.user-list-item {
    background: #222222;
    border: 2px solid #303030;
    padding: 10px 16px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-list-item.all-call-item {
    border-color: #26CFEC;
}

.user-list-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.user-list-name {
    font-size: 14px;
    color: #D5D5D5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-list-section-header {
    font-size: 11px;
    font-weight: 600;
    color: #6D6D6D;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 10px 0 4px;
}

.user-list-group-header {
    font-size: 11px;
    font-weight: 600;
    color: #999999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 10px 0 4px;
    padding-left: 10px;
    border-left: 3px solid #6D6D6D;
}

.user-list-name-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-list-username {
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-list-title {
    font-size: 12px;
    color: #888888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.star-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

.star-btn:hover {
    transform: scale(1.2);
}

.star-btn.starred svg {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

.user-list-empty {
    font-size: 13px;
    color: #6D6D6D;
    padding: 8px 0;
}

.ptp-btn {
    width: 48px;
    height: 48px;
    font-size: 10px;
    flex-shrink: 0;
}

.all-call-btn {
    border-color: #26CFEC;
    color: #26CFEC;
}

.all-call-btn.active {
    background: #26CFEC;
    border-color: #26CFEC;
    color: #111111;
    box-shadow: 0 0 20px rgba(38, 207, 236, 0.4);
}

.ptp-incoming-indicator {
    display: none;
}

/* Missed PTP indicator on user rows */

.user-list-item.missed-ptp {
    border-color: #26CFEC;
    background: rgba(38, 207, 236, 0.1);
}

.user-list-item.missed-ptp .user-list-username::after {
    content: "Missed PTP";
    margin-left: 8px;
    font-size: 10px;
    font-weight: 600;
    color: #26CFEC;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Active PTP indicator — someone is currently PTP-ing you */

.user-list-item.ptp-active {
    border-color: #26CFEC;
    background: rgba(38, 207, 236, 0.15);
    animation: ptpPulse 1s ease-in-out infinite;
}

.user-list-item.ptp-active .user-list-username::after {
    content: "Speaking";
    margin-left: 8px;
    font-size: 10px;
    font-weight: 600;
    color: #26CFEC;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes ptpPulse {
    0%, 100% { border-color: #26CFEC; background: rgba(38, 207, 236, 0.1); }
    50% { border-color: #26CFEC; background: rgba(38, 207, 236, 0.25); }
}

/* FAB alert state */

.users-fab.alert {
    border-color: #26CFEC;
    animation: fabPulse 1s ease-in-out infinite;
}

@keyframes fabPulse {
    0%, 100% { background: #222222; border-color: #26CFEC; color: #26CFEC; }
    50% { background: #26CFEC; border-color: #26CFEC; color: #111111; }
}

/* PTP / All-Call Status Dot States */

.status-dot.ptp {
    background: #26CFEC;
    animation: pulse 1s ease-in-out infinite;
}

.status-dot.allcall {
    background: #26CFEC;
    animation: pulse 1s ease-in-out infinite;
}

/* Debug Stats Overlay (toggle with ` key) */

.debug-stats {
    position: fixed;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #333333;
    padding: 10px 14px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    color: #AAAAAA;
    z-index: 500;
    line-height: 1.5;
    min-width: 340px;
    max-width: 480px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    pointer-events: none;
    user-select: none;
}

.debug-stats .ds-title {
    color: #26CFEC;
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.debug-stats .ds-section {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #333333;
}

.debug-stats .ds-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.debug-stats .ds-label {
    color: #777777;
}

.debug-stats .ds-value {
    color: #CCCCCC;
    text-align: right;
    word-break: break-all;
}

.debug-stats .ds-value.good { color: #00B159; }
.debug-stats .ds-value.warn { color: #FFC425; }
.debug-stats .ds-value.bad { color: #D11141; }

/* ── PGM Feed Strip ── */

.pgm-strip {
    border-color: #074956;
}

.pgm-badge {
    display: inline-block;
    background: #26CFEC;
    color: #111111;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    margin-right: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.pan-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pan-label-text {
    font-size: 10px;
    color: #6D6D6D;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.pan-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: #3D3D3D;
    border-radius: 0;
    outline: none;
}

.pan-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 16px;
    background: #26CFEC;
    border-radius: 0;
    cursor: pointer;
}

.pan-slider::-moz-range-thumb {
    width: 12px;
    height: 16px;
    background: #26CFEC;
    border: none;
    border-radius: 0;
    cursor: pointer;
}

.pan-label {
    font-size: 11px;
    color: #AAAAAA;
    min-width: 30px;
}

/* ── Narrow desktop: tighten spacing while keeping 2-column layout ── */

@media (max-width: 960px) {
    .intercom-body {
        gap: 10px;
    }

    .user-list-panel {
        width: 220px;
    }

    .channel-strip {
        padding: 12px 14px;
        gap: 10px;
    }

    .ptt-btn, .listen-btn {
        width: 64px;
        height: 64px;
        font-size: 11px;
    }

    .latch-btn {
        width: 34px;
        height: 34px;
        font-size: 7px;
    }

    .channel-controls {
        gap: 8px;
    }

    .volume-slider {
        width: 90px;
    }

    .header-right {
        gap: 10px;
    }

    .header h1 {
        font-size: 14px;
    }
}

/* ── Mobile: single column with user panel as overlay ── */

@media (max-width: 760px) {
    .settings-tabs {
        display: none;
    }

    .settings-panel {
        max-width: 420px;
    }

    .header h1 {
        display: none;
    }

    .login-brand h1 {
        font-size: 18px;
        letter-spacing: 1px;
    }

    #intercom-screen {
        padding: 12px;
    }

    .intercom-body {
        flex-direction: column;
    }

    .user-list-panel {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.85);
        z-index: 90;
        padding: 20px;
        padding-top: 60px;
        overflow-y: auto;
    }

    .user-list-panel.mobile-open {
        display: block;
    }

    .user-list-panel .user-list-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .user-list-close {
        display: flex;
    }

    .users-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: #222222;
        border: 2px solid #444444;
        color: #CCCCCC;
        cursor: pointer;
        z-index: 80;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        transition: all 0.15s;
    }

    .users-fab:hover, .users-fab.active {
        background: #26CFEC;
        border-color: #26CFEC;
        color: #111111;
    }

    .channel-strip {
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
    }

    .channel-info {
        order: 1;
        width: 100%;
        min-width: unset;
    }

    .channel-name {
        min-width: unset;
    }

    .channel-strip > .listen-btn {
        order: 2;
        width: 96px;
        height: 96px;
        font-size: 14px;
    }

    .channel-strip > .volume-control {
        order: 3;
        flex: 1;
        min-width: 0;
        margin-left: 0;
    }

    .channel-strip > .volume-control .volume-slider {
        flex: 1;
        min-width: 0;
        width: auto;
    }

    .channel-strip > .latch-btn {
        order: 4;
        width: 52px;
        height: 52px;
        font-size: 9px;
    }

    .channel-strip > .ptt-btn {
        order: 5;
        width: 96px;
        height: 96px;
        font-size: 14px;
    }

}
