
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-variant-numeric: tabular-nums; background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0f0f1a 100%); color: #e0e0e0; min-height: 100vh; padding: 20px; }
        .container { max-width: 1400px; margin: 0 auto; }
        .header { display: flex; justify-content: space-between; align-items: center; padding: 20px; margin-bottom: 20px; background: rgba(20,20,35,0.8); border-radius: 15px; border: 1px solid rgba(0,255,136,0.2); }
        .callsign { font-family: 'Orbitron', sans-serif; font-size: 2.5em; font-weight: 700; color: #00ff88; text-shadow: 0 0 20px rgba(0,255,136,0.5); }
        .time { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 2.5em; color: #ff6b35; text-shadow: 0 0 15px rgba(255,107,53,0.5); letter-spacing: 0.05em; font-variant-numeric: tabular-nums; }
        .date { font-size: 1.2em; color: #888; }
        .main-content { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
        .sun-display { background: rgba(20,20,35,0.9); border-radius: 15px; padding: 30px; border: 2px solid rgba(255,165,2,0.3); box-shadow: 0 8px 32px rgba(0,0,0,0.3); display: flex; flex-direction: column; align-items: center; justify-content: center; }
        .sun-container { width: min(100%, 450px); aspect-ratio: 1/1; margin: 10px auto; border-radius: 50%; overflow: hidden; }
        .sun-image { width: 100%; height: 100%; box-shadow: 0 0 80px rgba(255,165,2,0.6); object-fit: cover; }
        .dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 20px; }
        .card { background: rgba(20,20,35,0.9); border-radius: 15px; padding: 20px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
        .card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); }
        .card-header .icon { font-size: 1.2em; }
        .card-title { font-size: 0.9em; text-transform: uppercase; letter-spacing: 2px; color: #ff4757; font-weight: 600; }
        .location .grid-square { font-family: 'Inter', sans-serif; font-size: 2em; color: #00d4ff; margin-bottom: 10px; font-weight: 700; letter-spacing: 0.1em; }
        .location .coords { color: #888; font-size: 1em; margin-bottom: 10px; }
        .location .celestial-times { display: grid; gap: 8px; margin-top: 10px; }
        .location .celestial-row { display: flex; justify-content: space-between; padding: 8px 12px; background: rgba(255,255,255,0.03); border-radius: 8px; }
        .location .sun-row { color: #ffa502; }
        .location .moon-row { color: #a8dadc; }
        .location .celestial-label { font-size: 0.9em; font-weight: 600; }
        .location .celestial-times-text { font-size: 0.95em; font-variant-numeric: tabular-nums; }
        .location .moon-phase { font-size: 1.2em; margin-right: 8px; }
        .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
        .info-box { padding: 12px; background: rgba(255,255,255,0.05); border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); }
        .info-label { font-size: 0.8em; color: #666; text-transform: uppercase; }
        .info-value { font-size: 1.2em; color: #e0e0e0; margin-top: 5px; font-weight: 600; }
        @media (max-width: 1000px) { .main-content { grid-template-columns: 1fr; } }

        /* COMPACT Band Conditions */
        .band-conditions-grid { display:flex; flex-wrap:wrap; gap:5px; padding:5px 2px; overflow:hidden; width:100%; box-sizing:border-box; align-content:flex-start; }
        .band-box { width:56px; height:46px; flex-shrink:0; flex-grow:0; padding:3px 2px; border-radius:8px; text-align:center; font-weight:700; border:1.5px solid; transition:border-color 0.2s, box-shadow 0.2s; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; box-sizing:border-box; }
        .band-box:hover { transform: translateY(-2px); }
        .band-box.good { background: rgba(0,255,100,0.08); border-color: #00ff64; color: #00ff88; box-shadow: 0 0 8px rgba(0,255,136,0.3); }
        .band-box.fair { background: rgba(255,165,0,0.08); border-color: #ffa502; color: #ffb020; box-shadow: 0 0 8px rgba(255,165,2,0.3); }
        .band-box.poor { background: rgba(255,100,130,0.08); border-color: #ff6482; color: #ff7b9c; box-shadow: 0 0 8px rgba(255,100,130,0.3); }
        .band-name { font-size:0.75em; }
        .band-condition { font-size:0.55em; letter-spacing:0.5px; }

        .metric-bar-bg { height: 8px; border-radius: 4px; overflow: hidden; }
        .metric-bar { height: 100%; width: 0%; transition: width 0.3s ease; }
        .demo-badge { display: inline-block; background: rgba(0,255,136,0.2); color: #00ff88; font-size: 0.65em; padding: 2px 6px; border-radius: 4px; margin-left: 8px; font-weight: 600; }
        .footer { text-align: center; margin-top: 30px; color: #666; font-size: 0.9em; }

        /* Setup Modal */
        #setup-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 9999; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
        .modal-content { background: rgba(20,20,35,0.95); border: 2px solid rgba(0,255,136,0.3); border-radius: 20px; padding: 40px; max-width: 500px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 40px rgba(0,255,136,0.2); }
        .modal-header { font-size: 1.8em; font-weight: 700; color: #00ff88; margin-bottom: 10px; text-align: center; }
        .modal-subtitle { color: #aaa; text-align: center; margin-bottom: 30px; }
        .form-group { margin-bottom: 20px; }
        .form-group label { display: block; margin-bottom: 8px; color: #00ff88; font-weight: 600; font-size: 0.95em; }
        .form-group input, .form-group select { width: 100%; padding: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(0,255,136,0.3); border-radius: 8px; color: #e0e0e0; font-size: 1em; font-family: 'Inter', sans-serif; transition: border-color 0.2s, box-shadow 0.2s; }
        .form-group input:focus, .form-group select:focus { outline: none; border-color: #00ff88; background: rgba(0,255,136,0.1); box-shadow: 0 0 20px rgba(0,255,136,0.2); }
        .modal-buttons { display: flex; gap: 15px; margin-top: 30px; }
        .btn-primary { flex: 1; padding: 12px 20px; background: linear-gradient(135deg, #00ff88, #00cc6a); color: #000; border: none; border-radius: 8px; font-weight: 700; font-size: 1em; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
        .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0,255,136,0.4); }

        /* Settings Modal (dynamically created by user-settings.js) */
        .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 9999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
        .settings-modal-content { background: rgba(20,20,35,0.95); border: 2px solid rgba(255,165,2,0.3); border-radius: 20px; padding: 40px; max-width: 500px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 40px rgba(255,165,2,0.2); }
        .settings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
        .settings-header h2 { color: #ffa502; font-size: 1.5em; margin: 0; }
        .close-btn { background: none; border: none; color: #ffa502; font-size: 2em; cursor: pointer; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
        .close-btn:hover { color: #ffb733; }
        .settings-info { background: rgba(0,0,0,0.3); padding: 15px; border-radius: 8px; margin-bottom: 20px; color: #ccc; }
        .settings-info p { margin: 5px 0; font-size: 0.95em; }
        .settings-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
        .btn-save { padding: 10px; background: linear-gradient(135deg, #00ff88, #00cc6a); color: #000; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
        .btn-save:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,255,136,0.3); }
        .btn-reset { padding: 10px; background: rgba(255,71,87,0.2); color: #ff4757; border: 1px solid #ff4757; border-radius: 8px; font-weight: 600; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
        .btn-reset:hover { background: rgba(255,71,87,0.3); }
        .btn-cancel { padding: 10px; background: rgba(255,255,255,0.1); color: #aaa; border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; font-weight: 600; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; grid-column: 1 / -1; }
        .btn-cancel:hover { background: rgba(255,255,255,0.15); }
        #settings-btn { background: rgba(255,165,2,0.2); border: 1px solid rgba(255,165,2,0.4); color: #ffa502; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; transition: border-color 0.2s, box-shadow 0.2s; font-size: 0.9em; }
        #settings-btn:hover { background: rgba(255,165,2,0.3); box-shadow: 0 0 20px rgba(255,165,2,0.2); }
        #kiosk-btn { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; padding: 10px 18px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 0.9em; transition: border-color 0.2s, box-shadow 0.2s; box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3); }
        #kiosk-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5); }
        body.kiosk-mode { overflow: hidden; }
        body.kiosk-mode.view-top .bottom-section { display: none; }
        body.kiosk-mode.view-bottom .top-section { display: none; }
        .top-section, .bottom-section { transition: opacity 0.5s ease-in-out; }

        /* auto-fill handles responsive columns */
        
        @media (max-width: 768px) { .modal-content, .settings-modal-content { padding: 30px 20px; max-width: 90vw; } .modal-header { font-size: 1.4em; } .form-group input, .form-group select { padding: 14px; font-size: 16px; } .modal-buttons { flex-direction: column; } #settings-btn { padding: 10px 12px; font-size: 0.85em; } .band-conditions-grid { display:flex; flex-wrap:wrap; gap:5px; padding:5px 2px; overflow:hidden; width:100%; box-sizing:border-box; align-content:flex-start; } }
        @media (max-width: 480px) { .band-conditions-grid { display:flex; flex-wrap:wrap; gap:5px; padding:5px 2px; overflow:hidden; width:100%; box-sizing:border-box; align-content:flex-start; } .band-name { font-size:0.75em; } .band-condition { font-size:0.55em; letter-spacing:0.5px; } }
    
        /* Kiosk Mode - Card-based splitting */
        
        
        
        /* Top view - show only first 3 cards (Sun, QTH, Band Conditions) */
        
        
        /* Bottom view - hide first 3 cards */
        
        
        /* Smooth transitions */
        
        
        /* Fullscreen adjustments */
        
        


        


        /* Kiosk Mode - Simpler approach using IDs */
        
        
        
        
        /* Top view - show Sun + QTH + Band Conditions */
        
        
        /* Bottom view - hide Sun + first 2 cards (QTH, Band) */
        
        


        /* Kiosk Mode - ID-based (bulletproof) */
        body.kiosk-mode { overflow: hidden; }
        body.kiosk-mode .container { padding: 10px !important; max-width: 100vw !important; }
        
        /* Top view - show ONLY: Sun, QTH, Band Conditions */
        body.kiosk-mode.view-top #kiosk-weather,
        body.kiosk-mode.view-top #kiosk-satellites,
        body.kiosk-mode.view-top #kiosk-dx,
        body.kiosk-mode.view-top #kiosk-system { display: none !important; }
        
        /* Bottom view - show ONLY: Weather, Satellites, DX, System */
        body.kiosk-mode.view-bottom #kiosk-sun,
        body.kiosk-mode.view-bottom #kiosk-qth,
        body.kiosk-mode.view-bottom #kiosk-bands { display: none !important; }
        
        


        
        



        


        /* Kiosk Bottom View - EXACT equal widths */
        body.kiosk-mode.view-bottom .grid-3 { 
            display: flex !important; 
            flex-direction: row !important;
            flex-wrap: wrap !important;
            gap: 0 !important;
            width: 100% !important;
            justify-content: space-between !important;
        }
        
        /* Force EXACT 33.333% width for each panel */
        body.kiosk-mode.view-bottom #kiosk-satellites,
        body.kiosk-mode.view-bottom #kiosk-dx,
        body.kiosk-mode.view-bottom #kiosk-system { 
            flex: 0 0 33.333% !important;
            width: 33.333% !important;
            max-width: 33.333% !important;
            min-width: 33.333% !important;
            box-sizing: border-box !important;
            padding: 0 7.5px !important;
            margin: 0 !important;
        }
        
        /* Weather full width with margin-top */
        body.kiosk-mode.view-bottom #kiosk-weather { 
            flex: 0 0 100% !important;
            width: 100% !important;
            margin-top: 15px !important;
        }


/* ── SITE HEADER ─────────────────────────────── */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: rgba(10,10,20,0.95);
    border-bottom: 1px solid rgba(0,255,136,0.15);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 20px;
    flex-wrap: wrap;
}
.header-left  { flex: 0 0 auto; }
.header-center { flex: 1 1 auto; display: flex; justify-content: center; }
.header-right { flex: 0 0 auto; }

/* Clock Box */
.clock-box {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 8px 18px;
    text-align: center;
    min-width: 280px;
}
.clock-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}
.clock-label { font-size: 0.75em; font-weight: 700; letter-spacing: 1px; opacity: 0.7; }
.loc-label, .loc-time { color: #ff6b35; }
.utc-label, .utc-time { color: #70a1ff; }
.clock-time { font-size: 1.3em; font-weight: 700; font-family: 'Inter', monospace; }
.clock-sep  { color: #555; font-size: 1.2em; }
.clock-date { font-size: 0.8em; color: #888; margin-top: 2px; }

/* Button Box */
.btn-box {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.hdr-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88em;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-support { background: rgba(255,100,130,0.15); border-color: #ff6482; color: #ff6482; }
.btn-legend  { background: rgba(0,255,136,0.15);   border-color: #00ff88; color: #00ff88; }
.btn-kiosk   { background: linear-gradient(135deg,#667eea,#764ba2); border-color: transparent; color: #fff; }
.btn-settings{ background: rgba(255,165,2,0.15);   border-color: rgba(255,165,2,0.5); color: #ffa502; }
.hdr-btn:hover { transform: translateY(-1px); filter: brightness(1.2); }

@media (max-width: 768px) {
    .site-header { padding: 10px 14px; }
    .clock-box { min-width: auto; padding: 6px 12px; }
    .clock-time { font-size: 1.1em; }
    .hdr-btn { padding: 7px 10px; font-size: 0.8em; }
}

/* ── GRIDSTACK CONTAINER ──────────────────────── */
.gs-container {
    padding: 15px 20px;
    max-width: 100%;
    min-height: calc(100vh - 70px);
}
.grid-stack-item { will-change: transform; }
.grid-stack-item-content {
    height: 100% !important;
    overflow: clip;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.grid-stack-item-content .card {
    flex: 1;
    height: 100% !important;
    overflow: hidden !important;
    min-width: 0 !important;
    margin: 0;
    border-radius: 12px;
    box-sizing: border-box;
}
/* Drag handle - nur card-header ist greifbar */
.card-header {
    cursor: grab;
    user-select: none;
}
.card-header:active { cursor: grabbing; }

/* Resize handle styling */
.grid-stack > .grid-stack-item > .ui-resizable-se {
    background: rgba(0,255,136,0.3);
    border-radius: 0 0 8px 0;
}

/* Dezenter Scrollbar — erscheint nur bei Overflow */
.card ::-webkit-scrollbar { width: 4px; }
.card ::-webkit-scrollbar-track { background: transparent; }
.card ::-webkit-scrollbar-thumb { background: rgba(0,255,136,0.3); border-radius: 4px; }
.card ::-webkit-scrollbar-thumb:hover { background: rgba(0,255,136,0.6); }

/* Performance: Drag */
.grid-stack-item.ui-draggable-dragging * { transition: none !important; }
.grid-stack-item.ui-resizable-resizing * { transition: none !important; }
.grid-stack-item.ui-draggable-dragging { will-change: transform; z-index: 1000; }

/* Container Queries für Rufzeichen */
#widget-header { container-type: inline-size; container-name: header-widget; }
@container header-widget (min-width: 1px) {
    #header-callsign { font-size: clamp(13px, 3.5cqw, 60px) !important; }
}
/**
 * Mobile Mode Styles - Only applied when .mobile-mode class is present
 * Desktop/PC layout remains completely unchanged
 */

/* Mobile mode base */
/* Sticky Header - Buttons always visible on top */
/* Compact buttons for mobile */
/* Hide less important buttons on very small screens */
@media (max-width: 380px) {
    }

/* Main content starts below sticky header */
/* Single column layout for all widgets */
/* Card adjustments */
/* Content padding */
/* Font sizes */
/* DX Cluster - full width */
/* Satellites - compact */
/* Band conditions - scrollable */
/* Touch-friendly tap targets */
/* Disable drag on mobile (touch scrolling priority) */
/* Kiosk mode adjustments for mobile */
/* Prevent text selection on buttons */
/* Smooth scrolling */
/* Modal adjustments */
/**
 * Raspberry Pi 7" Display Mode (1024×600)
 * Optimized layout for small touchscreen displays
 */

/* ============================================
   RASPBERRY PI 7" MODE
   ============================================ */

body.raspberry-mode {
    padding: 4px;
    overflow-x: hidden;
}

/* Grid: 4 columns instead of 12 */
body.raspberry-mode .grid-stack {
    margin: 0 !important;
}

body.raspberry-mode .grid-stack-item {
    transition: none !important; /* Disable animation for performance */
}

/* ============================================
   HEADER - Ultra compact
   ============================================ */
body.raspberry-mode #widget-header {
    height: auto !important;
    min-height: 44px;
    max-height: 50px;
}

body.raspberry-mode #widget-header .card {
    padding: 4px 6px !important;
    height: auto !important;
    min-height: 44px;
}

body.raspberry-mode #widget-header #header-callsign {
    font-size: clamp(16px, 4vw, 20px);
    letter-spacing: 1px;
}

/* Buttons: Icon-only for space saving */
body.raspberry-mode #widget-header .btn-box {
    gap: 3px;
    flex-wrap: nowrap;
}

body.raspberry-mode #widget-header .hdr-btn {
    padding: 4px 6px;
    font-size: 14px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 4px;
}

/* Hide button text, show only icons */
body.raspberry-mode #widget-header .hdr-btn[data-i18n="support_btn"] {
    font-size: 0;
}
body.raspberry-mode #widget-header .hdr-btn[data-i18n="support_btn"]::before {
    content: "❤️";
    font-size: 16px;
}

body.raspberry-mode #widget-header .hdr-btn[data-i18n="legend_btn"] {
    font-size: 0;
}
body.raspberry-mode #widget-header .hdr-btn[data-i18n="legend_btn"]::before {
    content: "ℹ️";
    font-size: 16px;
}

body.raspberry-mode #widget-header .hdr-btn[data-i18n="fullscreen_btn"] {
    font-size: 0;
}
body.raspberry-mode #widget-header .hdr-btn[data-i18n="fullscreen_btn"]::before {
    content: "📺";
    font-size: 16px;
}

body.raspberry-mode #widget-header .hdr-btn[data-i18n="settings_btn"] {
    font-size: 0;
}
body.raspberry-mode #widget-header .hdr-btn[data-i18n="settings_btn"]::before {
    content: "⚙️";
    font-size: 16px;
}

/* Reset button as icon */
body.raspberry-mode #widget-header .hdr-btn[onclick*="resetGridLayout"] {
    font-size: 0;
}
body.raspberry-mode #widget-header .hdr-btn[onclick*="resetGridLayout"]::before {
    content: "🔄";
    font-size: 16px;
}

/* Kiosk page button compact */
body.raspberry-mode #kiosk-page-btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* ============================================
   CARDS - Compact styling
   ============================================ */
body.raspberry-mode .card {
    border-radius: 6px;
    margin: 0;
}

body.raspberry-mode .card-header {
    padding: 5px 8px;
    font-size: 12px;
    min-height: 28px;
}

body.raspberry-mode .card-header .icon {
    font-size: 14px;
    margin-right: 4px;
}

body.raspberry-mode .card-content,
body.raspberry-mode .grid-stack-item-content > div:not(.card-header) {
    padding: 6px;
    font-size: 11px;
}

/* ============================================
   QTH WIDGET
   ============================================ */
body.raspberry-mode #widget-qth .grid-square {
    font-size: 18px;
}

body.raspberry-mode #widget-qth .coords {
    font-size: 10px;
}

body.raspberry-mode #widget-qth .celestial-row {
    padding: 2px 0;
    font-size: 11px;
}

body.raspberry-mode #widget-qth .celestial-times-text {
    font-size: 10px;
}

/* ============================================
   BAND CONDITIONS
   ============================================ */
body.raspberry-mode #widget-bands .band-row {
    padding: 2px 4px;
    font-size: 10px;
}

body.raspberry-mode #widget-bands .band-freq {
    font-size: 9px;
}

/* ============================================
   WEATHER WIDGETS
   ============================================ */
body.raspberry-mode #widget-weather-local .weather-main,
body.raspberry-mode #widget-weather-space .weather-main {
    font-size: 20px;
}

body.raspberry-mode #widget-weather-local .weather-detail,
body.raspberry-mode #widget-weather-space .weather-detail {
    font-size: 10px;
}

/* ============================================
   SATELLITES & DX - Scrollable with fixed height
   ============================================ */
body.raspberry-mode #widget-satellites .grid-stack-item-content,
body.raspberry-mode #widget-dx .grid-stack-item-content {
    display: flex;
    flex-direction: column;
}

body.raspberry-mode #satellite-container,
body.raspberry-mode #dx-cluster-list {
    flex: 1;
    overflow-y: auto;
    max-height: none;
    font-size: 10px;
}

body.raspberry-mode #satellite-container > div,
body.raspberry-mode #dx-cluster-list > div {
    padding: 3px 4px;
    font-size: 10px;
}

/* ============================================
   SYSTEM STATS
   ============================================ */
body.raspberry-mode #widget-system .stat-row {
    padding: 2px 0;
    font-size: 10px;
}

body.raspberry-mode #widget-system .progress-bar {
    height: 6px;
}

/* ============================================
   CLOCK
   ============================================ */
body.raspberry-mode #widget-clock .time-main {
    font-size: 24px;
}

body.raspberry-mode #widget-clock .time-sub {
    font-size: 10px;
}

/* ============================================
   SUN WIDGET - SDO Image sizing
   ============================================ */
body.raspberry-mode #widget-sun img {
    max-height: 140px;
    object-fit: contain;
}

/* ============================================
   SCROLLBARS - Thin for touch
   ============================================ */
body.raspberry-mode ::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

body.raspberry-mode ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

body.raspberry-mode ::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 2px;
}

/* ============================================
   KIOSK MODE adjustments for Raspberry
   ============================================ */
body.raspberry-mode.kiosk-mode #widget-header {
    display: none !important;
}

body.raspberry-mode.kiosk-mode {
    padding: 0;
}

body.raspberry-mode.kiosk-mode .grid-stack {
    margin-top: 0 !important;
}

/* ============================================
   TOUCH OPTIMIZATIONS
   ============================================ */
body.raspberry-mode button,
body.raspberry-mode a {
    min-height: 32px;
    min-width: 32px;
    touch-action: manipulation;
}

/* Disable drag on touch devices */
body.raspberry-mode .grid-stack-item .card-header {
    cursor: default !important;
}

/* Prevent text selection */
body.raspberry-mode {
    user-select: none;
    -webkit-user-select: none;
}

/* But allow selection in text content */
body.raspberry-mode .card-content {
    user-select: text;
    -webkit-user-select: text;
}

/* ============================================
   MODALS - Smaller for small screen
   ============================================ */
body.raspberry-mode .modal-content {
    width: 96%;
    max-height: 90vh;
    margin: 2% auto;
}

body.raspberry-mode .modal-header {
    padding: 10px;
    font-size: 14px;
}

body.raspberry-mode .modal-body {
    padding: 10px;
    font-size: 12px;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
body.raspberry-mode #loading-overlay {
    font-size: 14px;
}
/**
 * MOBILE MODE FIX
 * Ensures widgets are properly visible in single-column layout
 */

/* Ensure grid is visible */
/* Force all items to be visible and single column */
/* Header sticky at top */
/* Compact buttons */
/* Card styling */
/* Specific widget adjustments */
/* Prevent drag on mobile */
/* Touch optimizations */
/* Kiosk mode in mobile */
/* Modal adjustments */
/* Scrollbar styling */
/* Animation disable for performance */
/* Buttons zusammenschieben, nicht zu weit rechts */
/* Header Content besser ausnutzen */
/* Extra klein auf sehr kleinen Screens */
@media (max-width: 380px) {
    }

/* iPhone SE / kleine Geräte */
@media (max-width: 340px) {
    }

/* MOBILE CLOCK FIX - Force Visibility */
/* ALLE Widgets müssen 100% Breite haben */
/* Keine Gridstack Verschiebung */
/* Gridstack interne Positionierung zurücksetzen */
/* Kiosk Badge Fix - always right-align in card-header */
.card-header {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
}
.card-header .page-badge {
    margin-left: auto !important;
    flex-shrink: 0 !important;
}

/* Auf sehr kleinen Screens noch kompakter */
@media (max-width: 360px) {
    }

/* Auf kleinen Screens Buttons wrap erlauben */
@media (max-width: 380px) {
    }

/* Resize Handles sichtbarer */
/* Touch-Optimierung */
/* Auf sehr kleinen Screens nur Icons */
@media (max-width: 400px) {
    }

/* Auf kleinen Screens etwas kompakter */
@media (max-width: 380px) {
    }

/* Kein Zwischenraum zwischen Boxen */
/* Höherer Header */
/* Resize Handles sichtbar */
/* Touch-Griffe für Resize */
/* Gridstack interne Margins entfernen */
/* Card direkt aneinander */
/* Erste und letzte Card abrunden */
/* Nur Header hat etwas Abstand nach oben */
/* Uhr direkt andocken - kein Abstand */
/* ALLE Boxen direkt andocken */
/* Nur erste Box oben abrunden */
/* Letzte Box unten abrunden */
/* Gridstack interne Abstände killen */
/* Übergang Header → Uhr nahtlos */

/* ============================================
   MOBILE LAYOUT - CLEAN START
   ============================================ */

body.mobile-mode {
    padding: 5px;
    margin: 0;
}

/* Gridstack: Keine internen Abstände */
body.mobile-mode .grid-stack {
    margin: 0;
    padding: 0;
}

body.mobile-mode .grid-stack-item {
    margin: 0 0 1px 0;
    padding: 0;
    position: relative;
}

/* Alle Cards gleich aussehen */
body.mobile-mode .grid-stack-item .card {
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Erste Card oben rund */
body.mobile-mode .grid-stack-item:first-child .card {
    border-radius: 12px 12px 0 0;
}

/* Letzte Card unten rund */
body.mobile-mode .grid-stack-item:last-child .card {
    border-radius: 0 0 12px 12px;
    border-bottom: none;
}

/* Header: 230px hoch */
body.mobile-mode #widget-header .card {
    min-height: 230px;
    height: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

body.mobile-mode #widget-header #header-callsign {
    font-size: 1.6em;
}

body.mobile-mode #widget-header .btn-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

body.mobile-mode #widget-header .hdr-btn {
    padding: 8px 12px;
    font-size: 11px;
}

/* ============================================
   MOBILE FULL WIDTH FIX
   ============================================ */

/* ALLE Widgets volle Breite */
body.mobile-mode .grid-stack-item {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
}

/* Gridstack Container */
body.mobile-mode .grid-stack {
    width: 100% !important;
}

/* Gridstack Item Content */
body.mobile-mode .grid-stack-item-content {
    width: 100% !important;
    left: 0 !important;
}

/* ============================================
   MOBILE NO GAP - AGGRESSIVE
   ============================================ */

/* Gridstack interne Margin killen */
body.mobile-mode .grid-stack {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body.mobile-mode .grid-stack > .grid-stack-item {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    top: auto !important;
    position: relative !important;
}

/* Gridstack Item Content */
body.mobile-mode .grid-stack-item > .grid-stack-item-content {
    margin: 0 !important;
    padding: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    position: relative !important;
}

/* Direkte Nachbarn - kein Abstand */
body.mobile-mode .grid-stack-item + .grid-stack-item {
    margin-top: 0 !important;
}

/* Cards direkt aneinander */
body.mobile-mode .grid-stack-item .card {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Header kein margin-bottom */
body.mobile-mode #widget-header {
    margin-bottom: 0 !important;
}

body.mobile-mode #widget-header .card {
    margin-bottom: 0 !important;
    border-bottom: none !important;
}

/* Uhr kein margin-top, border-top weg */
body.mobile-mode #widget-clock {
    margin-top: 0 !important;
}

body.mobile-mode #widget-clock .card {
    margin-top: 0 !important;
    border-top: none !important;
}

/* ============================================
   MOBILE HEADER 130px + 50px BUTTON SPACE
   ============================================ */

body.mobile-mode #widget-header,
body.mobile-mode #widget-header .card {
    min-height: 130px !important;
    height: 130px !important;
}

/* 50px Platz unter den Buttons */
body.mobile-mode #widget-header .btn-box {
    margin-bottom: 50px !important;
}

/* ============================================
   MOBILE HEADER FIX - PADDING BOTTOM
   ============================================ */

body.mobile-mode #widget-header,
body.mobile-mode #widget-header .card {
    min-height: 180px !important;
    height: auto !important;
    padding-bottom: 50px !important;
}

/* Margin entfernen, Padding verwenden */
body.mobile-mode #widget-header .btn-box {
    margin-bottom: 0 !important;
}


/* Gwen Fix: Sun widget immer sichtbar! */
#widget-sun { display: flex !important; }
#widget-sun img { display: block !important; opacity: 1 !important; }
body.kiosk-mode.view-bottom #widget-sun { display: flex !important; }
