/* ==========================================================================
   MAJLIS BOARD MANAGER - PREMIUM STYLESHEET (RTL & Multi-Brand Themes)
   ========================================================================== */

/* 1. Custom Font Face Definitions (Local Fonts from /fonts/ directory) */
@font-face {
    font-family: 'AbdoLine';
    src: url('fonts/AbdoLineHeavy.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Liftaswash';
    src: url('fonts/LiftaswashfixedRegular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AgencyB';
    src: url('fonts/AGENCYFB.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 2. Global Styling & Themes Configuration */
:root {
    /* Brand Colors - Combined theme default */
    --clr-primary: hsl(174, 80%, 34%);
    --clr-primary-glow: hsla(174, 80%, 34%, 0.35);
    --clr-accent-blue: hsl(196, 85%, 45%);
    --clr-accent-brown: hsl(38, 36%, 52%);
    --clr-accent-brown-light: hsl(38, 25%, 72%);
    
    /* Background bases */
    --clr-bg-gradient-1: hsl(175, 60%, 7%);
    --clr-bg-gradient-2: hsl(35, 25%, 10%);
    --clr-sidebar-bg: rgba(14, 28, 26, 0.68);
    --clr-card-bg: rgba(22, 38, 35, 0.58);
    --clr-card-border: rgba(210, 180, 140, 0.16);
    --clr-card-border-active: rgba(174, 80%, 34%, 0.5);
    
    /* Typography & Text */
    --clr-text-bright: hsl(38, 25%, 95%);
    --clr-text-main: hsl(174, 15%, 85%);
    --clr-text-muted: hsl(174, 12%, 66%);
    
    /* Fonts mapping with fallbacks */
    --font-regular: 'AbdoLine', 'Almarai', 'Segoe UI', sans-serif;
    --font-title: 'Liftaswash', 'Estedad', 'Cairo', sans-serif;
    --font-digital: 'AgencyB', 'Agency FB', monospace;
    
    /* System Globals */
    --glass-blur: blur(25px);
    --shadow-mac: 0 20px 60px rgba(0, 0, 0, 0.55);
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --ui-scale: 1.0;
}

.numbers-text {
    font-family: var(--font-digital) !important;
}

/* Number inputs and numeric elements use the digital/AgencyB font */
input[type="number"],
.kpi-progress-input,
.edit-member-role,
.point-number {
    font-family: var(--font-digital);
}

/* --- THEME 0: COMBINED ELITE (Turquoise Green, Light Blue, & Sandy Brown) --- */
.window-container.theme-combined {
    --clr-primary: hsl(174, 85%, 33%); /* Rich Turquoise Green */
    --clr-primary-glow: hsla(174, 85%, 33%, 0.4);
    --clr-accent-blue: hsl(196, 90%, 45%); /* Sleek Light Blue */
    --clr-accent-brown: hsl(38, 42%, 52%); /* Warm Sandy Beige Brown */
    --clr-accent-brown-light: hsl(38, 35%, 76%); /* Sandy Light Brown */
    
    --clr-bg-gradient-1: hsl(174, 60%, 5%); /* Turquoise black */
    --clr-bg-gradient-2: hsl(38, 25%, 6%); /* Gold sandy black */
    --clr-sidebar-bg: rgba(10, 24, 22, 0.72);
    --clr-card-bg: rgba(16, 28, 26, 0.58);
    --clr-card-border: rgba(210, 180, 140, 0.2);
    --clr-card-border-active: rgba(26, 188, 156, 0.55);
}

/* --- THEME 1: TRIPOLI OPTICS (Blue & Turquoise) --- */
.window-container.theme-tripoli {
    --clr-primary: hsl(174, 80%, 34%);
    --clr-primary-glow: hsla(174, 80%, 34%, 0.4);
    --clr-accent-blue: hsl(205, 90%, 42%);
    --clr-accent-brown: hsl(210, 50%, 48%);
    --clr-accent-brown-light: hsl(200, 30%, 82%);
    
    --clr-bg-gradient-1: hsl(212, 70%, 6%);
    --clr-bg-gradient-2: hsl(175, 75%, 7%);
    --clr-sidebar-bg: rgba(10, 22, 34, 0.72);
    --clr-card-bg: rgba(15, 34, 52, 0.6);
    --clr-card-border: rgba(135, 206, 250, 0.18);
    --clr-card-border-active: rgba(135, 206, 250, 0.5);
    
    --clr-text-bright: hsl(200, 25%, 96%);
    --clr-text-main: hsl(200, 15%, 86%);
    --clr-text-muted: hsl(200, 12%, 68%);
}

/* --- THEME 2: TAWQ OPTICS (Sandy Beige & Dark Taupe) --- */
.window-container.theme-tawq {
    --clr-primary: hsl(30, 35%, 45%);
    --clr-primary-glow: hsla(30, 35%, 45%, 0.35);
    --clr-accent-blue: hsl(35, 30%, 65%);
    --clr-accent-brown: hsl(30, 22%, 35%);
    --clr-accent-brown-light: hsl(35, 30%, 75%);
    
    --clr-bg-gradient-1: hsl(30, 25%, 8%);
    --clr-bg-gradient-2: hsl(35, 15%, 11%);
    --clr-sidebar-bg: rgba(22, 18, 14, 0.75);
    --clr-card-bg: rgba(32, 26, 20, 0.62);
    --clr-card-border: rgba(222, 184, 135, 0.16);
    --clr-card-border-active: rgba(222, 184, 135, 0.45);
    
    --clr-text-bright: hsl(35, 20%, 94%);
    --clr-text-main: hsl(35, 12%, 84%);
    --clr-text-muted: hsl(35, 10%, 66%);
}

/* 3. Core Document Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--clr-primary) rgba(0, 0, 0, 0.1);
}

body {
    background: radial-gradient(circle at 50% 30%, var(--clr-bg-gradient-1) 0%, var(--clr-bg-gradient-2) 100%);
    color: var(--clr-text-main);
    font-family: var(--font-regular);
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    direction: rtl;
    transition: background 0.4s ease;
}

body.royal-dark-bg {
    background: radial-gradient(circle at 50% 50%, hsl(212, 85%, 4%) 0%, hsl(175, 80%, 2%) 100%);
}

/* 4. Desktop Apple Window Frame */
.window-container {
    width: 100%;
    max-width: 1440px;
    height: auto;
    min-height: 0;
    max-height: 98dvh;
    background: rgba(10, 18, 16, 0.38);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-mac);
    backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform: scale(var(--ui-scale));
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease;
}

/* Custom background integration based on theme */
.window-container.theme-tripoli::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(8, 25, 42, 0.91) 0%, rgba(6, 30, 26, 0.95) 100%),
                url('/assets/tripoli_storefront.jpg') center/cover no-repeat;
    opacity: 0.18;
    pointer-events: none;
    z-index: -1;
}

.window-container.theme-tawq::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(28, 20, 12, 0.93) 0%, rgba(18, 14, 10, 0.97) 100%),
                url('/assets/tawq_storefront.png') center/cover no-repeat;
    opacity: 0.16;
    pointer-events: none;
    z-index: -1;
}

/* Window Header Customization */
.window-header {
    height: 54px;
    background: rgba(12, 20, 18, 0.75);
    border-bottom: 1px solid var(--clr-card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    user-select: none;
    z-index: 10;
}

.mac-buttons {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.dot.close { background-color: #ff5f56; }
.dot.minimize { background-color: #ffbd2e; }
.dot.maximize { background-color: #27c93f; }

.window-title {
    font-family: var(--font-title);
    font-size: 14px;
    color: var(--clr-text-bright);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo-img {
    height: 22px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.card-brand-logo-img {
    height: auto;
    max-height: 48px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    flex-shrink: 0;
}

.header-icon {
    width: 16px;
    height: 16px;
    color: var(--clr-accent-brown-light);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--clr-card-border);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--clr-primary);
}

.status-indicator.live {
    animation: pulse-live 1.5s infinite alternate;
}

@keyframes pulse-live {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 var(--clr-primary-glow); }
    100% { transform: scale(1.1); box-shadow: 0 0 8px 3px var(--clr-primary-glow); }
}

/* 5. Sidebar Layout & Fixed Scrollbar Issues */
.app-workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.app-sidebar {
    width: 340px;
    background: var(--clr-sidebar-bg);
    border-left: 1px solid var(--clr-card-border);
    display: flex;
    flex-direction: column;
    padding: 18px;
    transition: all 0.35s ease;
    overflow-x: hidden; /* Prevent horizontal scrollbar on sidebar */
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sidebar-header h3 {
    font-family: var(--font-title);
    font-size: 15px;
    color: var(--clr-text-bright);
}

.add-speaker-mini {
    background: rgba(255, 255, 255, 0.04);
    color: var(--clr-accent-brown-light);
    border: 1px solid var(--clr-card-border);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-speaker-mini:hover {
    background: var(--clr-primary);
    color: #fff;
    transform: scale(1.1);
}

.search-box {
    position: relative;
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--clr-card-border);
    border-radius: var(--border-radius-sm);
    padding: 10px 35px 10px 15px;
    color: var(--clr-text-bright);
    font-size: 12.5px;
    outline: none;
}

.search-box input:focus {
    border-color: var(--clr-primary);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--clr-text-muted);
}

/* CRITICAL FIX: Safe sidebar list with NO horizontal scrollbar */
.speakers-queue-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.speakers-queue {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden !important; /* Bulletproof fix */
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 4px; /* safe breathing space */
}

.queue-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    width: calc(100% - 6px);
    margin: 0 auto;
    opacity: 0.5;
}

.queue-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2.5px);
    border-color: var(--clr-card-border-active);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    opacity: 0.75;
}

.queue-card.active {
    background: linear-gradient(135deg, rgba(26, 188, 156, 0.18) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-color: var(--clr-primary);
    box-shadow: 0 4px 20px var(--clr-primary-glow);
    border-width: 1.5px;
    opacity: 1;
}

.queue-card.completed {
    background: rgba(255, 255, 255, 0.04);
}

.queue-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-accent-brown) 100%);
    color: #fff;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
}

.queue-details {
    flex: 1;
    min-width: 0;
}

.queue-name {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 14px;
    color: var(--clr-text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-role {
    font-size: 11.5px;
    color: var(--clr-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.queue-time {
    font-family: var(--font-digital);
    font-size: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--clr-accent-brown-light);
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.queue-card.active .queue-time {
    background: var(--clr-primary);
    color: #fff;
}

/* Sidebar Keyboard Shortcuts Panel (Collapsible to prevent overlap) */
.sidebar-shortcuts {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--clr-card-border);
    border-radius: var(--border-radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-shortcuts.collapsible {
    cursor: pointer;
}

.shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.shortcuts-arrow {
    font-size: 9px;
    color: var(--clr-text-muted);
    transition: transform 0.3s ease;
}

.sidebar-shortcuts.active .shortcuts-arrow {
    transform: rotate(180deg);
    color: var(--clr-accent-brown-light);
}

.shortcuts-content {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 5px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.shortcuts-content.hidden {
    display: none !important;
}

.shortcuts-title {
    font-family: var(--font-title);
    font-size: 12px;
    font-weight: 700;
    color: var(--clr-accent-brown-light);
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.key-pill {
    background: rgba(255, 255, 255, 0.08);
    color: var(--clr-text-bright);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-digital);
    font-size: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
   color: #ebac00; ;
}

.shortcut-desc {
    color: var(--clr-text-muted);
}

/* Statistics Widget styling */
.stats-widget {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--clr-card-border);
    border-radius: var(--border-radius-md);
    padding: 12px 14px;
}

.stats-title {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 12.5px;
    color: var(--clr-accent-brown-light);
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    padding: 8px 4px;
    border-radius: var(--border-radius-sm);
}

.stat-value {
    font-family: var(--font-digital);
    font-size: 13.5px;
    font-weight: bold;
    color: var(--clr-text-bright);
}

.stat-label {
    font-size: 9px;
    color: var(--clr-text-muted);
    margin-top: 3px;
}

/* 6. Main Stage Area & Responsive Grid */
.app-main-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px; /* Removed 110px bottom padding to utilize full height since dock controls are moved */
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* Current Speaker Card */
.current-speaker-section {
    margin-bottom: 16px;
}

.current-speaker-card {
    background: var(--clr-card-bg);
    border: 1px solid var(--clr-card-border);
    border-radius: var(--border-radius-lg);
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.speaker-card-main-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
    z-index: 2;
}

.speaker-avatar-container {
    position: relative;
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    z-index: 2;
    cursor: pointer;
}

.avatar-upload-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 3;
}

.speaker-avatar-container:hover .avatar-upload-overlay {
    opacity: 1;
}

.avatar-upload-overlay svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.avatar-glow-ring {
    position: absolute;
    top: -5px; left: -5px; right: -5px; bottom: -5px;
    border-radius: 50%;
    border: 6px solid var(--clr-primary);
    box-shadow: 0 0 15px var(--clr-primary-glow);
    animation: spin-only 3.5s linear infinite;
}

.avatar-glow-ring.pulsing {
    animation: pulse-color 3.0s infinite ease-in-out, spin-only 3.5s linear infinite;
}

@keyframes pulse-color {
    0% {
        border-color: #ff3b30;
        border-width: 6px;
        box-shadow: 0 0 15px rgba(255, 59, 48, 0.7), inset 0 0 10px rgba(255, 59, 48, 0.4);
    }
    50% {
        border-color: #ffffff;
        border-width: 10px;
        box-shadow: 0 0 30px rgba(255, 255, 255, 1), inset 0 0 15px rgba(255, 255, 255, 0.6);
    }
    100% {
        border-color: #ff3b30;
        border-width: 6px;
        box-shadow: 0 0 15px rgba(255, 59, 48, 0.7), inset 0 0 10px rgba(255, 59, 48, 0.4);
    }
}

@keyframes spin-only {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.speaker-avatar-large {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-accent-brown) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 34px;
    font-weight: 800;
    color: #fff;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.speaker-badge-live {
    position: absolute;
    bottom: -6px; left: 50%;
    transform: translateX(-50%);
    background: var(--clr-primary);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.speaker-details {
    flex: 1 1 250px;
    z-index: 2;
}

.speaker-name {
    font-family: var(--font-title);
    font-size: 22px;
    font-weight: 800;
    color: var(--clr-text-bright);
    margin-bottom: 5px;
}

.speaker-role {
    font-size: 13.5px;
    color: var(--clr-accent-brown-light);
    margin-bottom: 0px;
}

.speaker-topic-pill {
    display: flex;
    align-items: center;
    position: relative;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--clr-card-border);
    padding: 10px 18px;
    border-radius: var(--border-radius-md);
    font-size: 13px;
    color: var(--clr-text-bright);
    width: 100%;
    z-index: 2;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.05);
    order: 3;
    flex-basis: 100%;
}

.pill-icon {
    width: 14px;
    height: 14px;
    color: var(--clr-primary);
}

/* Glowing Department KPIs Grid (Corporate Dashboard statistics) */
.speaker-kpis-grid {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
    width: auto;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin: 8px 0 2px 0;
}

.kpi-card-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--clr-card-border);
    border-radius: var(--border-radius-md);
    padding: 10px 14px;
    min-width: 130px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.kpi-card-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--clr-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--clr-primary-glow);
}

.kpi-card-pill::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3.5px;
    background: linear-gradient(90deg, var(--clr-primary) 0%, var(--clr-accent-blue) 100%);
}

.kpi-card-label {
    font-size: 10.5px;
    color: var(--clr-text-muted);
    margin-bottom: 4px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.kpi-card-value {
    font-family: var(--font-digital);
    font-size: 16px;
    font-weight: bold;
    color: var(--clr-text-bright);
    text-shadow: 0 0 10px var(--clr-primary-glow);
}

/* Localized Visual progress bars for Corporate KPIs */
.kpi-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
    position: relative;
}

.kpi-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--clr-primary) 0%, var(--clr-accent-blue) 100%);
    border-radius: 2px;
    width: 0%; /* Dynamic fill via JS animation */
    transition: width 1.4s cubic-bezier(0.1, 0.8, 0.25, 1);
}

/* Timer Section & Horizontal flex layout */
.timer-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.timer-stats-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 220px;
    flex-shrink: 0;
}

.timer-radial-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.03);
}

#timerCanvas {
    position: absolute;
    top: 0; left: 0;
    transform: rotate(-90deg);
}

.timer-digital-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.timer-time {
    font-family: var(--font-digital);
    font-size: 46px;
    font-weight: bold;
    color: var(--clr-text-bright);
    line-height: 1;
    letter-spacing: -1.5px;
}

.timer-label {
    font-size: 11px;
    color: var(--clr-text-muted);
    margin-top: 4px;
}

/* Discussion Points & Secretary Notes Cards (IMPROVED HEIGHT TO 360PX FOR PERFECT BOTTOM ALIGNMENT WITH STACKED TIMER+STATS) */
.speaker-summary-card, .live-notes-card {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--clr-card-border);
    border-radius: var(--border-radius-lg);
    padding: 16px 18px;
    height: 360px; /* CRITICAL UPDATE: Taller height for perfect bottom alignment with the timer-stats-column */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-header-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--clr-accent-brown-light);
    font-size: 12.5px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.summary-points {
    flex: 1;
    list-style: none;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-points li {
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--clr-text-main);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    transition: all 0.25s ease;
}

.summary-points li:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--clr-text-bright);
    transform: translateX(-4px);
}

.summary-points li::before {
    content: '✦';
    color: var(--clr-primary);
    font-size: 11px;
    margin-top: 2px;
    transition: transform 0.2s ease;
}

.summary-points li:hover::before {
    transform: scale(1.2);
    color: var(--clr-accent-brown-light);
}

/* Live Notes Notepad inside timer section */
#liveNotepad {
    width: 100%;
    flex: 1;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--clr-card-border);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    color: var(--clr-text-bright);
    font-size: 12px;
    line-height: 1.5;
    resize: none;
    outline: none;
    font-family: var(--font-regular);
}

#liveNotepad:focus {
    border-color: var(--clr-primary);
    box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.25);
}

/* Structured Notes Styles */
.notes-tab-btn {
    background: none;
    border: none;
    color: var(--clr-text-muted);
    font-size: 10.5px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.notes-tab-btn.active {
    background: var(--clr-primary) !important;
    color: white !important;
}

.note-cat-badge {
    border: 1px solid transparent;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.6;
}

.note-cat-badge.active {
    opacity: 1;
    font-weight: bold;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.1);
}

.note-cat-badge[data-cat="decision"] {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}
.note-cat-badge[data-cat="decision"].active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.note-cat-badge[data-cat="recommendation"] {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}
.note-cat-badge[data-cat="recommendation"].active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.note-cat-badge[data-cat="task"] {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}
.note-cat-badge[data-cat="task"].active {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.note-cat-badge[data-cat="general"] {
    background: rgba(156, 163, 175, 0.1);
    border-color: rgba(156, 163, 175, 0.3);
    color: #9ca3af;
}
.note-cat-badge[data-cat="general"].active {
    background: #9ca3af;
    color: white;
    border-color: #9ca3af;
}

.structured-note-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--clr-card-border);
    border-radius: 6px;
    padding: 6px 10px;
    gap: 8px;
    transition: all 0.2s;
}

.window-container.light-mode .structured-note-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

.structured-note-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(-2px);
}

.window-container.light-mode .structured-note-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.note-item-badge {
    font-size: 9.5px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: bold;
    flex-shrink: 0;
}

.note-item-badge.decision {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.note-item-badge.recommendation {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.note-item-badge.task {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.note-item-badge.general {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.note-item-text {
    flex: 1;
    font-size: 11.5px;
    color: var(--clr-text-main);
    line-height: 1.4;
}

.note-item-delete {
    background: none;
    border: none;
    color: var(--clr-text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.note-item-delete:hover {
    color: var(--danger-color);
}

/* Next Speaker Dock styles */
.next-speaker-dock {
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed var(--clr-card-border);
    border-radius: var(--border-radius-md);
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0px; /* removed bottom margin as the floating bar is moved */
    transition: all 0.3s ease;
}

.next-label {
    font-family: var(--font-title);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--clr-accent-brown-light);
}

.next-card-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.next-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--clr-accent-brown-light);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 13px;
}

.next-details h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--clr-text-bright);
}

.next-details p {
    font-size: 12px;
    color: var(--clr-text-muted);
}

.next-duration {
    font-family: var(--font-digital);
    font-size: 12px;
    color: var(--clr-text-muted);
}

/* Sidebar Integrated Dock Controls */
.dock-controls {
    position: static;
    transform: none;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--clr-card-border);
    backdrop-filter: var(--glass-blur);
    padding: 8px 10px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    width: 100%;
    margin-top: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    z-index: 5;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.dock-controls:hover {
    padding-bottom: 8px;
    padding-top: 8px;
    background: rgba(0, 0, 0, 0.3);
}

.dock-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--clr-text-bright);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-btn svg {
    width: 14px;
    height: 14px;
}

#playIcon {
    transform: translateX(-1.5px);
}

.dock-btn.primary {
    background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-primary-glow) 100%);
    color: #fff;
    box-shadow: 0 3px 8px var(--clr-primary-glow);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dock-btn.primary svg {
    width: 18px;
    height: 18px;
}

.dock-btn.primary:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 15px rgba(26, 188, 156, 0.4);
}

.dock-btn.secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.dock-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.08) translateY(-2px);
}

.dock-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 2px;
}

/* 7. Settings Modal Customizer overlay */
.customizer-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.customizer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.customizer-panel {
    width: 500px;
    height: 100%;
    background: rgba(14, 20, 18, 0.96);
    border-right: 1px solid var(--clr-card-border);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.6);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.customizer-overlay.active .customizer-panel {
    transform: translateX(0);
}

.panel-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--clr-card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-family: var(--font-title);
    font-size: 16px;
    color: var(--clr-text-bright);
}

.close-panel-btn {
    background: none;
    border: none;
    color: var(--clr-text-muted);
    font-size: 26px;
    cursor: pointer;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.panel-tabs {
    display: flex;
    background: rgba(0,0,0,0.3);
    border-radius: var(--border-radius-sm);
    padding: 4px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 8px;
    color: var(--clr-text-muted);
    font-size: 12.5px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 700;
}

.tab-btn.active {
    background: var(--clr-primary);
    color: #fff;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Forms Settings controls styles */
.add-speaker-form h4, .members-edit-list h4 {
    font-family: var(--font-title);
    color: var(--clr-accent-brown-light);
    font-size: 13.5px;
    margin-bottom: 12px;
}

.form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.form-row input, .panel-input {
    flex: 1;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--clr-card-border);
    border-radius: var(--border-radius-sm);
    padding: 9px 12px;
    color: var(--clr-text-bright);
    font-size: 12px;
    outline: none;
}

.form-row input:focus, .panel-input:focus {
    border-color: var(--clr-primary);
}

.form-group {
    margin-bottom: 10px;
}

.panel-input {
    width: 100%;
}

.form-action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.submit-btn {
    flex: 1;
    background: var(--clr-primary);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 12.5px;
}

.cancel-btn {
    background: rgba(255,255,255,0.06);
    color: var(--clr-text-bright);
    border: 1px solid var(--clr-card-border);
    border-radius: var(--border-radius-sm);
    padding: 10px 15px;
    font-weight: 700;
    cursor: pointer;
    font-size: 12.5px;
}

/* Dynamic pointbuilder tag system styles */
.points-builder-group label {
    display: block;
    font-size: 11.5px;
    color: var(--clr-text-muted);
    margin-bottom: 6px;
}

.points-builder-input {
    display: flex;
    gap: 6px;
}

.points-builder-input input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--clr-card-border);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    color: var(--clr-text-bright);
    font-size: 12px;
    outline: none;
}

.add-point-tag-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--clr-card-border);
    color: var(--clr-text-bright);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 11.5px;
    cursor: pointer;
    font-weight: bold;
}

.add-point-tag-btn:hover {
    background: var(--clr-primary);
}

.form-points-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    max-height: 80px;
    overflow-y: auto;
    background: rgba(0,0,0,0.15);
    padding: 6px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255,255,255,0.02);
}

.point-tag {
    background: rgba(26, 188, 156, 0.12);
    border: 1px solid rgba(26, 188, 156, 0.25);
    color: var(--clr-text-bright);
    font-size: 10.5px;
    padding: 3px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.point-tag-remove {
    cursor: pointer;
    color: #ff5f56;
    font-weight: bold;
    font-size: 12px;
}

/* Edit Speaker itemized lists */
.edit-queue-container {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.edit-member-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--clr-card-border);
    padding: 10px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.edit-member-info {
    flex: 1;
    min-width: 0;
}

.edit-member-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--clr-text-bright);
}

.edit-member-role {
    font-size: 10px;
    color: var(--clr-text-muted);
}

.edit-member-actions {
    display: flex;
    gap: 4px;
}

.edit-act-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--clr-text-bright);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 11px;
}

.edit-act-btn:hover {
    background: rgba(255,255,255,0.12);
}

.edit-act-btn.edit-sp:hover {
    background: var(--clr-primary);
    color: white;
}

.edit-act-btn.delete:hover {
    background: #ff5f56;
    color: #fff;
}

/* Corporate Brand Multi-cards Selector */
.brand-options-cards {
    display: flex;
    gap: 8px;
}

.brand-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--clr-card-border);
    border-radius: var(--border-radius-sm);
    padding: 12px 6px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.brand-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.brand-card.active {
    border-color: var(--clr-primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 10px var(--clr-primary-glow);
}

.brand-card-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.brand-card-dot.combined { background: linear-gradient(135deg, hsl(174, 80%, 34%), hsl(38, 36%, 52%)); }
.brand-card-dot.tripoli { background: hsl(205, 90%, 42%); }
.brand-card-dot.tawq { background: hsl(30, 35%, 45%); }

.brand-card span {
    font-size: 10.5px;
    color: var(--clr-text-bright);
}

/* KPI Customizer inputs styling */
.kpis-builder-container {
    background: rgba(0,0,0,0.15);
    padding: 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255,255,255,0.02);
    margin-bottom: 12px;
}

.kpis-builder-container label {
    display: block;
    font-size: 11.5px;
    color: var(--clr-text-muted);
    margin-bottom: 6px;
}

.kpi-fields-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.kpi-fields-row input:first-child {
    flex: 2;
}

.kpi-fields-row input:last-child {
    flex: 1;
    text-align: center;
}

/* Layout Scale and sizing triggers */
.setting-group {
    margin-bottom: 16px;
    background: rgba(0,0,0,0.12);
    padding: 14px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255,255,255,0.02);
}

.setting-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--clr-accent-brown-light);
    margin-bottom: 8px;
}

.scale-options, .icon-size-options, .sidebar-pos-options, .font-size-options {
    display: flex;
    gap: 6px;
}

.scale-btn, .size-btn, .pos-btn, .font-sz-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--clr-card-border);
    color: var(--clr-text-main);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
}

.scale-btn.active, .size-btn.active, .pos-btn.active, .font-sz-btn.active {
    background: var(--clr-primary);
    color: #fff;
    border-color: var(--clr-primary);
}

.toggle-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
}

.toggle-control input[type="checkbox"] {
    width: 34px;
    height: 18px;
    appearance: none;
    background: #333;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
}

.toggle-control input[type="checkbox"]:checked {
    background: var(--clr-primary);
}

.toggle-control input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    top: 2px; left: 2px;
    transition: transform 0.25s;
}

.toggle-control input[type="checkbox"]:checked::before {
    transform: translateX(16px);
}

.danger-btn {
    background: rgba(255,95,86,0.1);
    border: 1px solid rgba(255,95,86,0.25);
    color: #ff5f56;
    width: 100%;
    padding: 9px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 11.5px;
}

.danger-btn:hover {
    background: #ff5f56;
    color: #fff;
}

.secondary-btn {
    background: rgba(26,188,156,0.1);
    border: 1px solid rgba(26,188,156,0.25);
    color: var(--clr-primary);
    width: 100%;
    padding: 9px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 11.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: var(--clr-primary);
    color: #fff;
}

.panel-divider {
    border: 0;
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 15px 0;
}

.panel-tip {
    font-size: 10px;
    color: var(--clr-text-muted);
    margin-top: -6px;
    margin-bottom: 10px;
}

/* Alarm Flash Screen Overlay */
.alarm-flash-screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 95, 86, 0.15);
    z-index: 99;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.alarm-flash-screen.flash {
    animation: alarm-flashing 1.2s infinite;
}

@keyframes alarm-flashing {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* RTL Left Sidebar Adjustment classes toggled by layout preferences */
.window-container.sidebar-left .app-workspace {
    flex-direction: row-reverse;
}

.window-container.sidebar-left .app-sidebar {
    border-left: none;
    border-right: 1px solid var(--clr-card-border);
}

/* Dynamic styling for larger fonts on 1.15x scale */
.window-container.scale-large {
    --ui-scale: 1.05;
}

.window-container.scale-small {
    --ui-scale: 0.92;
}

.window-container.icon-small .dock-controls {
    padding: 6px 15px;
}

.window-container.icon-small .dock-btn {
    width: 28px;
    height: 28px;
}

.window-container.icon-small .dock-btn.primary {
    width: 32px;
    height: 32px;
}

.window-container.icon-small .dock-btn svg {
    width: 14px;
    height: 14px;
}

/* --- Dynamic Font Size Scaling overrides --- */
.window-container.font-small {
    font-size: 12px;
}
.window-container.font-small .speaker-name { font-size: 18px; }
.window-container.font-small .speaker-role { font-size: 11px; }
.window-container.font-small .speaker-topic-pill { font-size: 10.5px; }
.window-container.font-small .queue-name { font-size: 12px; }
.window-container.font-small .queue-role { font-size: 10px; }
.window-container.font-small .timer-time { font-size: 38px; }
.window-container.font-small .summary-points li { font-size: 11px; }
.window-container.font-small #liveNotepad { font-size: 11px; }
.window-container.font-small .stats-value { font-size: 11.5px; }

.window-container.font-large {
    font-size: 15px;
}
.window-container.font-large .speaker-name { font-size: 24px; }
.window-container.font-large .speaker-role { font-size: 15px; }
.window-container.font-large .speaker-topic-pill { font-size: 14px; }
.window-container.font-large .queue-name { font-size: 15px; }
.window-container.font-large .queue-role { font-size: 12px; }
.window-container.font-large .timer-time { font-size: 52px; }
.window-container.font-large .summary-points li { font-size: 14px; }
.window-container.font-large #liveNotepad { font-size: 13.5px; }
.window-container.font-large .stats-value { font-size: 15.5px; }

.window-container.font-xlarge {
    font-size: 17px;
}
.window-container.font-xlarge .speaker-name { font-size: 27px; }
.window-container.font-xlarge .speaker-role { font-size: 17px; }
.window-container.font-xlarge .speaker-topic-pill { font-size: 15.5px; }
.window-container.font-xlarge .queue-name { font-size: 16.5px; }
.window-container.font-xlarge .queue-role { font-size: 13.5px; }
.window-container.font-xlarge .timer-time { font-size: 58px; }
.window-container.font-xlarge .summary-points li { font-size: 15.5px; }
.window-container.font-xlarge #liveNotepad { font-size: 15px; }
.window-container.font-xlarge .stats-value { font-size: 17px; }

.hidden {
    display: none !important;
}

/* ==========================================================================
   KPI DETAILS DIALOG MODAL (Cupertino Glassmorphism Style)
   ========================================================================== */
.kpi-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 15, 14, 0.65);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.kpi-modal-card {
    width: 95%;
    max-width: 620px;
    background: rgba(14, 25, 23, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

.kpi-modal-overlay.active .kpi-modal-card {
    transform: scale(1) translateY(0);
}

.kpi-modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-modal-header h3 {
    font-family: var(--font-title);
    font-size: 15px;
    color: var(--clr-text-bright);
    font-weight: 700;
}

.kpi-modal-close {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--clr-text-muted);
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    transition: all 0.2s ease;
}

.kpi-modal-close:hover {
    background: #ff5f56;
    color: white;
    transform: scale(1.08);
}

.kpi-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kpi-modal-progress-row {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.kpi-modal-radial-progress {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: conic-gradient(var(--clr-primary) 0%, rgba(255, 255, 255, 0.06) 0);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: background 0.4s ease;
}

.kpi-modal-radial-progress::after {
    content: '';
    position: absolute;
    width: 61px;
    height: 61px;
    background: rgba(14, 25, 23, 0.98);
    border-radius: 50%;
    z-index: 1;
}

.kpi-modal-radial-progress span {
    font-family: var(--font-digital);
    font-size: 20px;
    font-weight: bold;
    color: var(--clr-text-bright);
    position: relative;
    z-index: 2;
    text-shadow: 0 0 10px var(--clr-primary-glow);
}

.kpi-modal-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-modal-meta h4 {
    font-family: var(--font-title);
    font-size: 16px;
    color: var(--clr-text-bright);
    font-weight: 700;
}

.kpi-modal-meta span {
    font-size: 11.5px;
    color: var(--clr-text-muted);
}

.kpi-modal-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (max-width: 600px) {
    .kpi-modal-details-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-detail-section {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--clr-card-border);
    border-radius: var(--border-radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kpi-detail-section h5 {
    font-family: var(--font-title);
    font-size: 12px;
    color: var(--clr-accent-brown-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 5px;
    font-weight: bold;
}

.kpi-detail-section p {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--clr-text-main);
}

/* ==========================================================================
   APPEARANCE MODE CONTROLS & PREMIUM LIGHT MODE OVERRIDES
   ========================================================================== */
.theme-mode-options {
    display: flex;
    gap: 6px;
}

.mode-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--clr-card-border);
    color: var(--clr-text-main);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11.5px;
    transition: all 0.2s ease;
    font-family: var(--font-regular);
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mode-btn.active {
    background: var(--clr-primary);
    color: #fff;
    border-color: var(--clr-primary);
}

/* --- LIGHT MODE STYLING & OVERRIDES --- */
body.light-mode {
    background: radial-gradient(circle at 50% 30%, hsl(175, 45%, 96%) 0%, hsl(35, 25%, 93%) 100%);
    color: hsl(174, 50%, 15%);
}

.window-container.light-mode {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    
    --clr-sidebar-bg: rgba(240, 243, 246, 0.88);
    --clr-card-bg: rgba(255, 255, 255, 0.88);
    --clr-card-border: rgba(0, 0, 0, 0.08);
    --clr-card-border-active: var(--clr-primary);
    
    --clr-text-bright: hsl(174, 60%, 10%);
    --clr-text-main: hsl(174, 40%, 20%);
    --clr-text-muted: hsl(174, 20%, 45%);
    --clr-accent-brown-light: hsl(38, 50%, 35%);
}

/* Specific elements adjustments for Light Mode */
.window-container.light-mode .window-header {
    background: rgba(245, 247, 250, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.window-container.light-mode .status-indicator {
    background-color: var(--clr-primary);
}

.window-container.light-mode .header-status {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--clr-text-main);
}

.window-container.light-mode .window-title {
    color: var(--clr-text-bright);
}

.window-container.light-mode .search-box input {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--clr-text-bright);
}

.window-container.light-mode .search-box input:focus {
    border-color: var(--clr-primary);
    background: #fff;
}

.window-container.light-mode .search-icon {
    color: var(--clr-text-muted);
}

.window-container.light-mode .queue-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.06);
    opacity: 0.5;
}

.window-container.light-mode .queue-card:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--clr-primary);
    opacity: 0.75;
}

.window-container.light-mode .queue-card.active {
    background: linear-gradient(135deg, rgba(26, 188, 156, 0.12) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-color: var(--clr-primary);
    opacity: 1;
}

.window-container.light-mode .queue-card.completed {
    background: rgba(255, 255, 255, 0.65);
}

.window-container.light-mode .queue-time {
    background: rgba(0, 0, 0, 0.05);
    color: var(--clr-accent-brown-light);
}

.window-container.light-mode .queue-card.active .queue-time {
    background: var(--clr-primary);
    color: #fff;
}

.window-container.light-mode .sidebar-shortcuts {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.window-container.light-mode .key-pill {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: hsl(38, 85%, 35%);
}

.window-container.light-mode .stats-widget {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.window-container.light-mode .stats-title {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.window-container.light-mode .stat-card {
    background: rgba(0, 0, 0, 0.02);
}

.window-container.light-mode .stat-value {
    color: var(--clr-text-bright);
}

.window-container.light-mode .speaker-topic-pill {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--clr-text-bright);
}

.window-container.light-mode .kpi-card-pill {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.window-container.light-mode .kpi-card-pill:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--clr-primary);
}

.window-container.light-mode .kpi-card-value {
    color: var(--clr-text-bright);
    text-shadow: none;
}

.window-container.light-mode .kpi-progress-container {
    background: rgba(0, 0, 0, 0.06);
}

.window-container.light-mode .timer-radial-wrapper {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.window-container.light-mode .timer-time {
    color: var(--clr-text-bright);
}

.window-container.light-mode .speaker-summary-card, 
.window-container.light-mode .live-notes-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.window-container.light-mode .card-header-icon {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.window-container.light-mode .summary-points li:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--clr-text-bright);
}

.window-container.light-mode #liveNotepad {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--clr-text-bright);
}

.window-container.light-mode .next-speaker-dock {
    background: rgba(255, 255, 255, 0.4);
    border: 1px dashed rgba(0, 0, 0, 0.12);
}

.window-container.light-mode .next-avatar {
    background: rgba(0, 0, 0, 0.04);
    color: var(--clr-accent-brown-light);
}

.window-container.light-mode .next-details h4 {
    color: var(--clr-text-bright);
}

.window-container.light-mode .dock-controls {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.window-container.light-mode .dock-btn.secondary {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--clr-text-main);
}

.window-container.light-mode .dock-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.08);
}

.window-container.light-mode .dock-btn.secondary svg {
    color: var(--clr-text-main);
}

.window-container.light-mode .dock-divider {
    background: rgba(0, 0, 0, 0.1);
}

/* Customizer Panel in Light Mode */
.window-container.light-mode .customizer-panel {
    background: rgba(250, 251, 253, 0.98);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: -10px 0 40px rgba(0,0,0,0.15);
}

.window-container.light-mode .customizer-overlay {
    background: rgba(0, 0, 0, 0.25);
}

.window-container.light-mode .panel-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.window-container.light-mode .panel-tabs {
    background: rgba(0,0,0,0.04);
}

.window-container.light-mode .tab-btn {
    color: var(--clr-text-muted);
}

.window-container.light-mode .tab-btn.active {
    background: var(--clr-primary);
    color: #fff;
}

.window-container.light-mode .form-row input, 
.window-container.light-mode .panel-input,
.window-container.light-mode .points-builder-input input {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(0,0,0,0.12);
    color: var(--clr-text-bright);
}

.window-container.light-mode .form-row input:focus, 
.window-container.light-mode .panel-input:focus,
.window-container.light-mode .points-builder-input input:focus {
    border-color: var(--clr-primary);
    background: #fff;
}

.window-container.light-mode .add-point-tag-btn,
.window-container.light-mode .cancel-btn {
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.08);
    color: var(--clr-text-bright);
}

.window-container.light-mode .add-point-tag-btn:hover {
    background: var(--clr-primary);
    color: white;
}

.window-container.light-mode .form-points-tags {
    background: rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.04);
}

.window-container.light-mode .kpis-builder-container,
.window-container.light-mode .setting-group {
    background: rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.05);
}

.window-container.light-mode .edit-member-item {
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(0,0,0,0.06);
}

.window-container.light-mode .edit-act-btn {
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
    color: var(--clr-text-bright);
}

.window-container.light-mode .edit-act-btn:hover {
    background: rgba(0,0,0,0.08);
}

.window-container.light-mode .edit-act-btn.edit-sp:hover {
    background: var(--clr-primary);
    color: white;
}

.window-container.light-mode .brand-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.window-container.light-mode .brand-card:hover {
    background: rgba(255, 255, 255, 0.9);
}

.window-container.light-mode .brand-card.active {
    border-color: var(--clr-primary);
    background: rgba(255, 255, 255, 0.95);
}

.window-container.light-mode .scale-btn, 
.window-container.light-mode .size-btn, 
.window-container.light-mode .pos-btn, 
.window-container.light-mode .font-sz-btn,
.window-container.light-mode .mode-btn {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--clr-text-main);
}

.window-container.light-mode .scale-btn.active, 
.window-container.light-mode .size-btn.active, 
.window-container.light-mode .pos-btn.active, 
.window-container.light-mode .font-sz-btn.active,
.window-container.light-mode .mode-btn.active {
    background: var(--clr-primary);
    color: #fff;
    border-color: var(--clr-primary);
}

.window-container.light-mode .panel-divider {
    background: rgba(0, 0, 0, 0.08);
}

.window-container.light-mode .danger-btn {
    background: rgba(255,95,86,0.05);
    border: 1px solid rgba(255,95,86,0.15);
}

.window-container.light-mode .danger-btn:hover {
    background: #ff5f56;
    color: white;
}

/* KPI Details Dialog in Light Mode */
.kpi-modal-overlay.light-mode {
    background: rgba(0, 0, 0, 0.18);
}

.kpi-modal-overlay.light-mode .kpi-modal-card {
    background: rgba(250, 251, 253, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.15);
}

.kpi-modal-overlay.light-mode .kpi-modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.kpi-modal-overlay.light-mode .kpi-modal-header h3 {
    color: hsl(174, 60%, 10%);
}

.kpi-modal-overlay.light-mode .kpi-modal-close {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: hsl(174, 20%, 45%);
}

.kpi-modal-overlay.light-mode .kpi-modal-radial-progress::after {
    background: rgba(250, 251, 253, 0.98);
}

.kpi-modal-overlay.light-mode .kpi-modal-radial-progress span {
    color: hsl(174, 60%, 10%);
    text-shadow: none;
}

.kpi-modal-overlay.light-mode .kpi-modal-meta h4 {
    color: hsl(174, 60%, 10%);
}

.kpi-modal-overlay.light-mode .kpi-modal-meta span {
    color: hsl(174, 20%, 45%);
}

.kpi-modal-overlay.light-mode .kpi-modal-progress-row {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.kpi-modal-overlay.light-mode .kpi-detail-section {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.kpi-modal-overlay.light-mode .kpi-detail-section h5 {
    color: hsl(38, 50%, 35%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.kpi-modal-overlay.light-mode .kpi-detail-section p {
    color: hsl(174, 40%, 20%);
}

/* Advanced KPI fields container in tab */
.window-container.light-mode #kpiAnalyticsTab div {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   RESPONSIVE DESIGN — Touch-friendly & Multi-device
   ========================================================================== */

/* --- Responsive: fluid height (1200px+) --- */
@media (min-width: 1201px) {
    .window-container {
        height: auto;
        min-height: 0;
        max-height: 95dvh;
    }
}

/* --- Small desktop / laptops (≤ 1200px) --- */
@media (max-width: 1200px) {
    .window-container {
        max-width: 100%;
        border-radius: 0;
        border: none;
        max-height: 100dvh;
    }
    .app-sidebar {
        width: 280px;
        padding: 14px;
    }
    .app-main-stage {
        padding: 16px;
    }
    .current-speaker-card {
        padding: 16px 18px;
    }
    .speaker-name {
        font-size: 18px;
    }
    .speaker-role {
        font-size: 12px;
    }
    .speaker-avatar-container {
        width: 72px;
        height: 72px;
    }
    .speaker-avatar-large {
        font-size: 26px;
    }
    .timer-section {
        gap: 14px;
    }
    .timer-stats-column {
        width: 180px;
    }
    .timer-radial-wrapper {
        width: 170px;
        height: 170px;
    }
    #timerCanvas {
        width: 170px !important;
        height: 170px !important;
    }
    .timer-time {
        font-size: 32px;
    }
    .speaker-summary-card, .live-notes-card {
        height: auto;
        min-height: 240px;
        padding: 12px 14px;
    }
}

/* --- Small desktop / laptops (≤ 1024px) --- */
@media (max-width: 1024px) {
    .app-sidebar {
        width: 260px;
        padding: 12px;
    }
    .search-box input {
        font-size: 12px;
        padding: 8px 30px 8px 12px;
    }
    .timer-section {
        gap: 12px;
    }
    .timer-stats-column {
        width: 160px;
    }
    .timer-radial-wrapper {
        width: 150px;
        height: 150px;
    }
    #timerCanvas {
        width: 150px !important;
        height: 150px !important;
    }
    .timer-time {
        font-size: 28px;
    }
    .speaker-summary-card, .live-notes-card {
        min-height: 200px;
    }
}

/* --- Tablets (≤ 900px) - sidebar narrower --- */
@media (max-width: 900px) {
    .app-sidebar {
        width: 220px;
        padding: 10px;
    }
    .speakers-queue-container {
        max-height: calc(100% - 100px);
    }
    .queue-card {
        padding: 8px 10px;
        gap: 8px;
    }
    .queue-name {
        font-size: 12px;
    }
    .sidebar-header h3 {
        font-size: 13px;
    }
    .search-box {
        margin-bottom: 10px;
    }
    .search-box input {
        font-size: 11px;
        padding: 6px 26px 6px 10px;
    }
    .dock-btn {
        width: 34px;
        height: 34px;
    }
    .dock-btn svg {
        width: 15px;
        height: 15px;
    }
}

/* --- Tablets (≤ 768px) - stack layout --- */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    .window-container {
        height: auto;
        min-height: 100dvh;
        max-height: none;
        border-radius: 0;
    }
    .window-header {
        height: 48px;
        padding: 0 12px;
    }
    .window-title {
        font-size: 12px;
        gap: 6px;
    }
    .header-logo-img {
        height: 18px;
        max-width: 80px;
    }
    .card-brand-logo-img {
        max-height: 36px;
        max-width: 72px;
    }
    .header-status {
        font-size: 10px;
        padding: 3px 8px;
    }
    .mac-buttons .dot {
        width: 10px;
        height: 10px;
    }

    .app-workspace {
        flex-direction: column;
    }
    .app-sidebar {
        width: 100%;
        max-height: 45vh;
        border-left: none;
        border-bottom: 1px solid var(--clr-card-border);
        padding: 12px;
    }
    .speakers-queue-container {
        max-height: 28vh;
    }
    .queue-card {
        padding: 10px 12px;
        gap: 10px;
    }
    .queue-name {
        font-size: 12px;
    }
    .queue-role {
        font-size: 10px;
    }
    .sidebar-shortcuts {
        display: none;
    }

    .app-main-stage {
        padding: 12px;
        overflow: visible;
    }
    .current-speaker-section {
        margin-bottom: 12px;
    }
    .current-speaker-card {
        padding: 14px 16px;
        gap: 12px;
    }
    .speaker-card-main-row {
        gap: 12px;
    }
    .speaker-avatar-container {
        width: 60px;
        height: 60px;
    }
    .speaker-avatar-large {
        font-size: 22px;
    }
    .avatar-glow-ring {
        border-width: 5px;
    }
    .speaker-name {
        font-size: 16px;
    }
    .speaker-role {
        font-size: 11px;
    }
    .speaker-badge-live {
        font-size: 7px;
        padding: 2px 8px;
    }
    .speaker-topic-pill {
        font-size: 11px;
        padding: 8px 12px;
        gap: 10px;
    }
    .speaker-kpis-grid {
        gap: 6px;
    }
    .kpi-card-pill {
        min-width: 100px;
        padding: 8px 10px;
    }
    .kpi-card-value {
        font-size: 13px;
    }

    .timer-section {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    .timer-stats-column {
        width: 100%;
        flex-direction: row;
        gap: 12px;
        align-items: center;
        justify-content: center;
    }
    .timer-radial-wrapper {
        width: 140px;
        height: 140px;
    }
    #timerCanvas {
        width: 140px !important;
        height: 140px !important;
    }
    .timer-time {
        font-size: 28px;
    }
    .timer-label {
        font-size: 10px;
    }
    .stats-widget {
        flex: 1;
        min-width: 0;
    }
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
    .stat-value {
        font-size: 12px;
    }
    .speaker-summary-card, .live-notes-card {
        height: auto;
        min-height: 180px;
        padding: 12px;
    }
    .summary-points li {
        font-size: 11px;
    }

    .dock-controls {
        padding: 8px 6px;
        gap: 4px;
    }
    .dock-btn {
        width: 36px;
        height: 36px;
    }
    .dock-btn svg {
        width: 16px;
        height: 16px;
    }
    .dock-divider {
        height: 24px;
        margin: 0 2px;
    }

    .next-speaker-dock {
        padding: 10px 14px;
        margin-bottom: 12px;
    }
    .next-card-content {
        gap: 10px;
    }
    .next-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    .next-details h4 {
        font-size: 12px;
    }
    .next-details p {
        font-size: 10px;
    }
}

/* --- Phones (≤ 600px) --- */
@media (max-width: 600px) {
    .window-header {
        height: 44px;
        padding: 0 8px;
    }
    .window-title {
        font-size: 10px;
        gap: 4px;
    }
    .header-logo-img {
        height: 16px;
        max-width: 60px;
    }
    .card-brand-logo-img {
        max-height: 28px;
        max-width: 56px;
    }
    .header-status {
        font-size: 9px;
        padding: 2px 6px;
    }
    .status-indicator {
        width: 6px;
        height: 6px;
    }
    .mac-buttons .dot {
        width: 8px;
        height: 8px;
    }

    .app-sidebar {
        max-height: 38vh;
        padding: 10px;
    }
    .sidebar-header h3 {
        font-size: 13px;
    }
    .search-box input {
        font-size: 11px;
        padding: 8px 30px 8px 10px;
    }
    .queue-card {
        padding: 8px 10px;
        gap: 8px;
    }
    .queue-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .queue-name {
        font-size: 11px;
    }
    .queue-time {
        font-size: 10px;
        padding: 2px 6px;
    }

    .app-main-stage {
        padding: 8px;
    }
    .current-speaker-card {
        padding: 12px;
        border-radius: var(--border-radius-md);
    }
    .speaker-avatar-container {
        width: 52px;
        height: 52px;
    }
    .speaker-avatar-large {
        font-size: 18px;
    }
    .avatar-glow-ring {
        border-width: 4px;
    }
    .speaker-name {
        font-size: 14px;
    }
    .speaker-role {
        font-size: 10px;
    }
    .speaker-topic-pill {
        font-size: 10px;
        padding: 6px 10px;
        gap: 8px;
    }
    .kpi-card-pill {
        min-width: 80px;
        padding: 6px 8px;
    }
    .kpi-card-label {
        font-size: 9px;
    }
    .kpi-card-value {
        font-size: 12px;
    }
    .kpi-progress-container {
        height: 3px;
    }

    .timer-stats-column {
        flex-direction: column;
        gap: 10px;
    }
    .timer-radial-wrapper {
        width: 120px;
        height: 120px;
    }
    #timerCanvas {
        width: 120px !important;
        height: 120px !important;
    }
    .timer-time {
        font-size: 24px;
    }
    .stats-widget {
        width: 100%;
    }
    .stats-grid {
        gap: 3px;
    }
    .stat-value {
        font-size: 11px;
    }
    .stat-label {
        font-size: 8px;
    }

    .speaker-summary-card, .live-notes-card {
        min-height: 150px;
        padding: 10px;
    }
    .card-header-icon {
        font-size: 11px;
    }
    .summary-points li {
        font-size: 10px;
    }
    #newNoteText {
        font-size: 10px !important;
        padding: 5px 8px !important;
    }
    #addNoteBtn {
        font-size: 10px !important;
        padding: 0 8px !important;
    }
    .note-cat-badge {
        font-size: 10px;
        padding: 3px 7px;
    }

    .dock-controls {
        padding: 6px 4px;
        gap: 3px;
    }
    .dock-btn {
        width: 32px;
        height: 32px;
    }
    .dock-btn svg {
        width: 14px;
        height: 14px;
    }
    .dock-divider {
        height: 20px;
        margin: 0 1px;
    }

    .next-speaker-dock {
        padding: 8px 10px;
    }
    .next-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    .next-details h4 {
        font-size: 11px;
    }
    .next-details p {
        font-size: 9px;
    }
    .next-duration {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* --- Very small phones (≤ 400px) --- */
@media (max-width: 400px) {
    .window-header {
        height: 40px;
        padding: 0 6px;
    }
    .window-title {
        font-size: 9px;
        gap: 3px;
    }
    .header-logo-img {
        height: 14px;
        max-width: 50px;
    }
    .header-status {
        font-size: 8px;
        padding: 2px 5px;
    }
    .mac-buttons .dot {
        width: 7px;
        height: 7px;
    }
    .app-sidebar {
        max-height: 35vh;
        padding: 8px;
    }
    .queue-card {
        padding: 6px 8px;
        gap: 6px;
    }
    .queue-avatar {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
    .queue-name {
        font-size: 10px;
    }
    .current-speaker-card {
        padding: 10px;
    }
    .speaker-name {
        font-size: 13px;
    }
    .speaker-role {
        font-size: 9px;
    }
    .kpi-card-pill {
        min-width: 70px;
        padding: 4px 6px;
    }
    .kpi-card-value {
        font-size: 11px;
    }
    .kpi-card-label {
        font-size: 8px;
    }
    .timer-radial-wrapper {
        width: 100px;
        height: 100px;
    }
    #timerCanvas {
        width: 100px !important;
        height: 100px !important;
    }
    .timer-time {
        font-size: 20px;
    }
    .dock-btn {
        width: 28px;
        height: 28px;
    }
    .dock-btn svg {
        width: 12px;
        height: 12px;
    }
}

/* --- Customizer panel responsive --- */
@media (max-width: 768px) {
    .customizer-overlay {
        padding: 0;
    }
    .customizer-panel {
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        border-radius: 0;
    }
    .panel-tabs {
        flex-wrap: wrap;
        gap: 4px;
    }
    .tab-btn {
        font-size: 11px;
        padding: 6px 10px;
    }
    .panel-content {
        padding: 14px;
    }
    .form-row {
        flex-direction: column;
        gap: 6px;
    }
    .kpi-fields-row {
        flex-direction: column;
        gap: 6px;
    }
    .kpi-progress-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .customizer-panel {
        padding: 0;
    }
    .panel-header {
        padding: 10px 14px;
    }
    .panel-header h2 {
        font-size: 14px;
    }
    .tab-btn {
        font-size: 10px;
        padding: 5px 8px;
    }
    .panel-content {
        padding: 10px;
    }
    .form-group-label {
        font-size: 11px;
    }
    input[type="text"],
    input[type="number"],
    .panel-input {
        font-size: 11px;
        padding: 6px 8px;
    }
    .submit-btn {
        font-size: 11px;
        padding: 8px 12px;
    }
    .danger-btn {
        font-size: 11px;
        padding: 8px 12px;
    }
    .secondary-btn {
        font-size: 11px;
        padding: 8px 12px;
    }
}/* --- Touch-friendly improvements for all mobile/tablet --- */
@media (hover: none) and (pointer: coarse) {
    .queue-card:hover {
        transform: none;
    }
    .queue-card.active {
        transform: none;
    }
    .kpi-card-pill:hover {
        transform: none;
    }
    .dock-btn:hover {
        transform: none;
    }
    .dock-btn:active {
        transform: scale(0.92);
    }
    .dot:hover {
        transform: none;
    }
    .add-speaker-mini:hover {
        transform: none;
    }
    .queue-card {
        -webkit-tap-highlight-color: transparent;
    }
    .dock-btn,
    .tab-btn,
    .brand-card,
    .scale-btn,
    .font-sz-btn,
    .size-btn,
    .pos-btn,
    .mode-btn,
    .note-cat-badge,
    #addNoteBtn,
    .submit-btn,
    .danger-btn,
    .secondary-btn {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}



/* ==========================================================================
   SIDE FLASH ALERTS — Stylish right-side notifications
   ========================================================================== */
.majlis-flash-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-width: 400px;
    width: auto;
    pointer-events: none;
}

.majlis-flash-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    font-family: 'Almarai', 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    direction: rtl;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    transform: translateX(-120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.majlis-flash-alert::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,255,255,0.5), rgba(255,255,255,0.2));
    transform: scaleX(1);
    transform-origin: right;
    transition: none;
}

.majlis-flash-alert.show {
    transform: translateX(0);
    opacity: 1;
}

.majlis-flash-alert.progressing::after {
    transition: transform var(--progress-dur, 6s) linear;
    transform: scaleX(0);
}

.majlis-flash-alert.hide {
    transform: translateX(-120%);
    opacity: 0;
}

.majlis-flash-alert.hide::after {
    transition: none;
    transform: scaleX(0);
}

.majlis-flash-success {
    background: linear-gradient(135deg, #0d4f1a, #1b6b2a);
    color: #fff;
    border-right: 4px solid #66bb6a;
}

.majlis-flash-error {
    background: linear-gradient(135deg, #7f1d1d, #9b2222);
    color: #fff;
    border-right: 4px solid #ef5350;
}

.majlis-flash-warning {
    background: linear-gradient(135deg, #80350a, #99440e);
    color: #fff;
    border-right: 4px solid #ff9800;
}

.majlis-flash-alert .flash-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.majlis-flash-alert .flash-msg {
    flex: 1;
    min-width: 0;
    font-weight: 500;
}

.majlis-flash-alert .flash-dismiss {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

.majlis-flash-alert .flash-dismiss:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

@media (max-width: 480px) {
    .majlis-flash-container {
        bottom: 16px;
        left: 12px;
        right: 12px;
        max-width: none;
    }
    .majlis-flash-alert {
        font-size: 12px;
        padding: 12px 16px;
        gap: 10px;
    }
}

/* ==========================================================================
   MEETING DATE BADGE (Multi-meeting support)
   ========================================================================== */
.meeting-date-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 11px;
    color: var(--clr-text-bright, #fff);
    white-space: nowrap;
    margin-right: 8px;
    direction: ltr;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   DATE PICKER GROUP (Customizer layout tab)
   ========================================================================== */
.date-picker-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.date-picker-group .date-input {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--clr-card-border);
    color: var(--clr-text-bright);
    padding: 8px 10px;
    border-radius: 6px;
    font-family: var(--font-regular);
    font-size: 13px;
    outline: none;
    color-scheme: dark;
}

.date-picker-group .date-input:focus {
    border-color: var(--clr-primary, #3b82f6);
}

/* ==========================================================================
   MEETINGS LIST (Customizer layout tab)
   ========================================================================== */
.meetings-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--border-radius-sm);
    padding: 4px;
}

.meetings-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 12px;
    transition: background 0.2s, border-color 0.2s;
}

.meetings-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.meetings-list-item.active-meeting {
    border-color: var(--clr-primary, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
}

.meeting-date-text {
    flex: 0 0 auto;
    font-weight: bold;
    color: var(--clr-text-bright);
    direction: ltr;
    font-family: var(--font-digital), monospace;
    font-size: 11px;
    min-width: 80px;
}

.meeting-status {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--clr-text-muted);
    font-size: 11px;
}

.meeting-status.status-active {
    color: #4ade80;
}

.meeting-status.status-completed {
    color: var(--clr-text-muted);
}

.load-meeting-btn {
    flex: 0 0 auto;
    padding: 4px 12px;
    font-size: 11px;
    border: 1px solid var(--clr-card-border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--clr-text-bright);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.load-meeting-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.load-meeting-btn:active {
    background: rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .meeting-date-badge {
        font-size: 10px;
        padding: 1px 8px;
        margin-right: 4px;
    }
    .meetings-list-item {
        flex-wrap: wrap;
    }
    .meeting-date-text {
        min-width: 70px;
        font-size: 10px;
    }
}

