@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    /* Rebranding variables - Overwritten at runtime via user settings */
    --brand-bg-image: url('https://raw.githubusercontent.com/youssef-boubli/assets/main/dashboard-bg.jpg');
    --brand-title: "AMUD";
    --brand-slogan: "Homelab Operations Cockpit";
    --brand-logo-url: url('/static/AMUD-logo.png');
    
    --accent-color: #cf6427; /* user defined accent */
    --accent-glow: rgba(207, 100, 39, 0.15);
    --glass-blur-intensity: 16px;
    --glass-opacity: 0.45;
    --wallpaper-overlay-strength: 0.85;
    --bento-row-height: 8.75rem;

    /* Theme-tunable surfaces (overridden by bundled theme CSS) */
    --theme-bg-fallback: #0a0b10;
    --theme-overlay-r1: 8;
    --theme-overlay-g1: 10;
    --theme-overlay-b1: 18;
    --theme-overlay-r2: 15;
    --theme-overlay-g2: 10;
    --theme-overlay-b2: 25;
    --theme-card-r: 15;
    --theme-card-g: 20;
    --theme-card-b: 25;
    
    /* Semantic Dark Theme Palette */
    --bg-card: rgba(var(--theme-card-r), var(--theme-card-g), var(--theme-card-b), var(--glass-opacity));
    --border-card: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    --radius-xl: 16px;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 4px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--theme-bg-fallback);
    background-image: var(--theme-body-stack,
        linear-gradient(160deg,
            rgba(var(--theme-overlay-r1), var(--theme-overlay-g1), var(--theme-overlay-b1), var(--wallpaper-overlay-strength)) 0%,
            rgba(var(--theme-overlay-r2), var(--theme-overlay-g2), var(--theme-overlay-b2), calc(var(--wallpaper-overlay-strength) * 0.92)) 100%),
        var(--brand-bg-image),
        radial-gradient(circle at 80% 20%, rgba(56, 189, 248, 0.12), transparent 50%),
        radial-gradient(circle at 15% 80%, rgba(168, 85, 247, 0.08), transparent 50%));
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    padding: max(2rem, env(safe-area-inset-top)) max(2rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(2rem, env(safe-area-inset-left));
    overflow-x: hidden;
    color-scheme: dark;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) rgba(0, 0, 0, 0.2);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 8px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.24);
    background-clip: padding-box;
}

html::-webkit-scrollbar-button,
body::-webkit-scrollbar-button {
    display: none;
    height: 0;
    width: 0;
}

/* Glassmorphic Core Utility */
.glass-panel {
    background: rgba(var(--theme-card-r, 15), var(--theme-card-g, 20), var(--theme-card-b, 25), var(--glass-opacity));
    border: 1px solid var(--border-card);
    backdrop-filter: blur(var(--glass-blur-intensity));
    -webkit-backdrop-filter: blur(var(--glass-blur-intensity));
    border-radius: var(--radius-xl);
    transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Card hover lift removed — metrics stay visible without pointer interaction */

/* Base Layout Container */
.dashboard-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-x: clip;
    min-width: 0;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

@media (min-width: 1280px) {
    .bento-grid:not(.bento-grid--guest-compact) {
        gap: 1.25rem;
    }

    .telemetry-row {
        gap: 1.25rem;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Topbar Header */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    animation: fadeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.05s;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    width: 2.25rem;
    height: 2.25rem;
    background-image: var(--brand-logo-url);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.brand-logo:has(.brand-logo-img) {
    background-image: none;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--text-primary) 60%, var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.topbar-action {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-card);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    background: transparent;
    font-family: inherit;
}

.topbar-action:hover {
    border-color: var(--border-hover);
}

.topbar-action i,
.topbar-action svg {
    width: 0.95rem;
    height: 0.95rem;
}

.topbar-action--accent {
    background: var(--accent-glow);
    border-color: var(--accent-color);
}

.topbar-end {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    position: relative;
}

.topbar-essential {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.topbar-overflow {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.topbar-menu-toggle {
    display: none;
}

.pwa-install-banner {
    position: fixed;
    left: max(1rem, env(safe-area-inset-left));
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.pwa-install-banner__copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pwa-install-banner__copy strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.pwa-install-banner__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (display-mode: standalone) {
    body {
        padding-top: max(0.75rem, env(safe-area-inset-top));
    }
}

.weather-widget {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Multi-node agent strip */
.nodes-strip {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--bento-radius, 14px);
    background: color-mix(in srgb, var(--glass-bg, rgba(20, 24, 32, 0.55)) 88%, transparent);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.nodes-strip-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}
.nodes-strip-title {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}
.nodes-strip-summary {
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.nodes-strip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.node-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 9.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.node-chip:hover {
    border-color: color-mix(in srgb, var(--accent-color) 55%, transparent);
}
.node-chip.is-selected {
    border-color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 18%, transparent);
}
.node-chip.is-offline {
    opacity: 0.55;
}
.node-chip-name {
    font-weight: 650;
    font-size: 0.88rem;
}
.node-chip-stats {
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.node-chip-caps {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: lowercase;
}

/* Row 1: Telemetry micro-bars */
.telemetry-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.disk-volumes-container {
    display: contents;
}

.disk-volume-card .telemetry-title {
    text-transform: capitalize;
}

.telemetry-card--host {
    grid-column: span 2;
    min-width: 280px;
}

.telemetry-card {
    padding: 0.85rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.telemetry-cpu-model {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.telemetry-spark-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.spark-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.spark-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.telemetry-sparkline {
    width: 100%;
    height: 40px;
    display: block;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.15);
}

.telemetry-sparkline--solo {
    height: 32px;
}

.telemetry-bar-fill--gpu {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.telemetry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.82rem;
    font-weight: 600;
}

.telemetry-title {
    color: var(--text-primary);
}

.telemetry-value {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.telemetry-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.telemetry-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-color));
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: width 0.5s ease-out, box-shadow 0.5s ease;
}

.telemetry-subinfo {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Row 2: Active Media Streams */
.streams-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stream-card {
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: relative;
    overflow: hidden;
    animation: fadeSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stream-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stream-meta {
    display: flex;
    gap: 0.85rem;
    align-items: center;
}

.stream-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stream-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.stream-text-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.stream-text-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

.stream-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.55rem;
    border-radius: 2px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ws-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border-card);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ws-status-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--text-muted);
}

.ws-live .ws-status-dot {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.65);
}

.ws-connecting .ws-status-dot {
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.55);
}

.ws-offline .ws-status-dot {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.55);
}

.stream-icon--logo img {
    width: 1.35rem;
    height: 1.35rem;
    object-fit: contain;
}

.stream-host-metrics {
    margin-top: 0.15rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.stream-player {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Row layout used when a poster thumbnail can appear next to the track info */
.stream-player:has(.stream-player-info) {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.stream-player-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stream-poster {
    width: 2.75rem;
    height: 4rem;
    object-fit: cover;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.stream-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.stream-playback-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.stream-ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0.2rem;
    border-radius: var(--radius-sm, 6px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.stream-ctrl-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.stream-ctrl-btn svg {
    width: 0.85rem;
    height: 0.85rem;
}

.stream-track-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stream-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.stream-play-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
}

.stream-progress-track {
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1.5px;
    position: relative;
    overflow: hidden;
}

.stream-progress-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 1.5px;
    transition: width 0.3s ease;
}

/* Rows 3+: Main app grid — flat cards reflow on category filter */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 3), 1fr);
    grid-auto-rows: minmax(var(--bento-row-height), auto);
    grid-auto-flow: row;
    gap: 1rem;
    align-items: stretch;
    overflow-x: clip;
    position: relative;
}

.bento-grid--guest-compact {
    grid-auto-rows: auto;
    gap: 0.65rem;
    align-items: start;
}

.bento-column {
    display: contents;
}

.app-card {
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: relative;
    overflow: visible;
    min-height: var(--bento-row-height);
    box-sizing: border-box;
    animation: fadeSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.app-card--guest-compact {
    height: auto;
    min-height: auto;
    padding: 0.65rem 0.85rem;
    gap: 0;
    align-self: start;
    grid-row: span 1;
    grid-column: span 1;
}

.app-card--guest-compact .app-card-header {
    align-items: center;
    width: 100%;
}

.app-card--guest-compact .app-card-identity {
    gap: 0.55rem;
    min-width: 0;
}

.app-card--guest-compact .app-card-icon {
    width: 1.85rem;
    height: 1.85rem;
    flex-shrink: 0;
}

.app-card--guest-compact .app-card-icon img {
    width: 1rem;
    height: 1rem;
}

.app-card--guest-compact .app-card-title {
    font-size: 0.88rem;
    line-height: 1.2;
}

.app-card--guest-compact .app-card-desc {
    display: none;
}

.app-card--guest-compact .app-card-badges {
    flex-shrink: 0;
}

.app-card--empty,
.filter-empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1rem;
    height: auto;
    min-height: auto;
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
}

.app-card-identity {
    display: flex;
    gap: 0.85rem;
    align-items: center;
}

.app-card-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-card-icon img {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
}

.app-card-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.app-card-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.55rem;
    border-radius: 2px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
    border: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.status-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-badge.status-offline,
.status-badge.down {
    background: #991b1b;
    color: #ffffff;
    border-color: #b91c1c;
}

.status-badge.status-offline::before,
.status-badge.down::before {
    background: #ef4444;
}

.status-badge.status-online {
    background: #166534;
    color: #ffffff;
    border-color: #16a34a;
}

.status-badge.status-online::before {
    background: #21bf4b;
    box-shadow: 0 0 0 2px rgba(33, 191, 75, 0.2), 0 0 6px rgba(33, 191, 75, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

.status-badge.status-checking,
.status-badge.status-unknown {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.12);
}

.status-badge.status-checking::before,
.status-badge.status-unknown::before {
    background: var(--text-muted);
    opacity: 0.5;
    animation: pve-pulse-dot 1.2s ease-in-out infinite;
}

.status-badge.ms {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
}

.status-badge.ms::before {
    background: var(--accent-color);
    box-shadow: 0 0 6px var(--accent-glow);
}

/* App Nested Telemetry Grid (2 or 3 columns) */
.nested-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 0.75rem;
}

.nested-metrics-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.metric-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-md);
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-top: 0.15rem;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Fixed metrics slot — integration and CPU/RAM share one footprint */
.app-card:has(.app-card-metrics-slot) {
    overflow: visible;
}

.app-card-metrics-slot {
    position: relative;
    flex-shrink: 0;
    min-height: 3.65rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 0.75rem;
    overflow: hidden;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

.app-card-metrics-slot .metric-value,
.app-card-metrics-slot .metric-label {
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

.app-card-metrics-slot .nested-metrics-grid {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.app-card-metrics-layer--infra {
    transition: opacity 0.16s ease;
}

/* Dual cards: infra hidden; integration always visible (no hover swap) */
.app-card-metrics-slot--dual .app-card-metrics-layer--infra {
    display: none;
}

.app-card-metrics-layer--integration {
    position: absolute;
    inset: 0.75rem 0 0 0;
    display: flex;
    align-items: stretch;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-card-metrics-slot--solo .app-card-metrics-layer--integration {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.app-card-metrics-slot--dual .app-card-metrics-layer--integration {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.app-card-metrics-layer--integration .nested-metrics-grid {
    width: 100%;
    align-self: stretch;
}

.app-card-metrics-slot--solo::before {
    content: '';
    display: none;
}

/* Tall cards: CPU/RAM + integration stacked — always visible */
.app-card-metrics-slot--stacked {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: auto;
    overflow: visible;
}

.app-card-metrics-slot--stacked .app-card-metrics-layer--infra,
.app-card-metrics-slot--stacked .app-card-metrics-layer--integration {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

@media (hover: none) {
    .app-card-metrics-slot--dual:not(.app-card-metrics-slot--stacked) .app-card-metrics-layer--infra {
        display: none;
    }

    .app-card-metrics-layer--integration {
        position: static;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }
}

.integration-widget--hover {
    margin-top: 0;
}

.integration-widget--always {
    margin-top: auto;
}

/* Filled tall cards — unified 8-cell / 4-row metrics grid */
.app-card.span-tall:has(.app-card-metrics-slot--filled) {
    min-height: calc(var(--bento-row-height) * 2);
}

.app-card-metrics-slot--filled {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 0;
    min-height: 0;
    overflow: visible;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 0.5rem;
}

.integration-widget--filled {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 0;
    min-height: 0;
}

.integration-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 0.45rem;
    flex: 1;
    min-height: 11.5rem;
    width: 100%;
}

.integration-metrics-grid .metric-block {
    min-height: 2.75rem;
    padding: 0.35rem 0.25rem;
}

.integration-metrics-grid .metric-value {
    font-size: 0.78rem;
    line-height: 1.2;
}

.integration-metrics-grid .metric-label {
    font-size: 0.58rem;
}

.app-card-metrics-slot--filled .app-card-metrics-fallback {
    min-height: 8.5rem;
}

/* ── RSS Feed Widget ───────────────────────────── */
.rss-feed-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 0.5rem;
}

.rss-feed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.4rem;
    border-radius: var(--radius-sm, 6px);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, transform 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.rss-feed-item:last-of-type {
    border-bottom: none;
}

.rss-feed-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
}

.rss-feed-title {
    flex: 1;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rss-feed-date {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    opacity: 0.7;
}

.rss-feed-item--text-only {
    cursor: default;
}

.rss-feed-empty {
    padding: 0.75rem 0.4rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ── Feeds page layout ─────────────────────────── */
.page-feeds .search-section {
    margin-bottom: 0.5rem;
}

.feeds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    width: 100%;
    align-items: stretch;
}

.feed-card {
    display: flex;
    flex-direction: column;
    min-height: 280px;
    padding: 1rem 1.1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feed-card:hover {
    transform: translateY(-2px);
}

.feed-card--empty {
    grid-column: 1 / -1;
    min-height: auto;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.feed-card.filter-empty-msg {
    grid-column: 1 / -1;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.feed-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.feed-card-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    flex: 1;
}

.feed-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-card-meta {
    min-width: 0;
}

.feed-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
}

.feed-card-host {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.feed-card-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.feed-category-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: color-mix(in srgb, var(--pill-color) 22%, transparent);
    color: var(--pill-color);
    border: 1px solid color-mix(in srgb, var(--pill-color) 35%, transparent);
}

.feed-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.feed-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.feed-card-body .rss-feed-list {
    flex: 1;
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.35rem;
}

.feed-card-footer {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.feed-card-visit {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: none;
}

.feed-card-visit i {
    width: 0.85rem;
    height: 0.85rem;
}

.feed-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    --tab-accent: var(--accent-color);
}

.feed-filter-tab:hover {
    border-color: color-mix(in srgb, var(--tab-accent) 45%, transparent);
}

.feed-filter-tab.active {
    background: color-mix(in srgb, var(--tab-accent) 18%, transparent);
    border-color: color-mix(in srgb, var(--tab-accent) 55%, transparent);
}

.feed-filter-tab i {
    width: 0.85rem;
    height: 0.85rem;
    opacity: 0.85;
}

.feed-hero {
    margin: 0 0 1rem;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.feed-hero-link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem;
    align-items: center;
    padding: 1.25rem 1.5rem;
    color: inherit;
    text-decoration: none;
    transition: background 0.2s ease;
}

.feed-hero-link:hover {
    background: rgba(255, 255, 255, 0.03);
}

.feed-hero-media {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feed-hero-media img {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}

.feed-hero-content {
    min-width: 0;
}

.feed-hero-eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 0.35rem;
}

.feed-hero-title {
    margin: 0;
    font-size: clamp(1.1rem, 2.5vw, 1.45rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.feed-hero-meta {
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.feed-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-color);
    white-space: nowrap;
}

.feed-hero-cta i {
    width: 0.9rem;
    height: 0.9rem;
}

.mgmt-table tr.is-dragging {
    opacity: 0.55;
}

.rss-drag-handle {
    cursor: grab;
    display: inline-flex;
    opacity: 0.4;
}

.mgmt-table tr:hover .rss-drag-handle {
    opacity: 0.85;
}

.rss-drag-handle:active {
    cursor: grabbing;
}

@media (max-width: 640px) {
    .feed-hero-link {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .feed-hero-cta {
        justify-self: start;
    }
}

/* Settings: feed icon picker */
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.15);
}

.icon-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.45rem 0.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.icon-picker-item:hover,
.icon-picker-item.selected {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
}

.icon-picker-item img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
}

.icon-picker-item span {
    font-size: 0.58rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-icon-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.4rem;
    width: 100%;
    margin-top: 0.5rem;
}

.category-icon-option {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    color: var(--text-secondary);
}

.category-icon-option.selected {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
}

.category-icon-option i {
    width: 1rem;
    height: 1rem;
}

.feed-icon-thumb {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
}

.feed-categories-block {
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .feeds-grid {
        grid-template-columns: 1fr;
    }
}

/* Wide bottom/list button links */
.link-list-card {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.link-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.link-identity svg {
    width: 1.15rem;
    height: 1.15rem;
    color: var(--text-secondary);
}

.link-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.link-list-card:hover .link-arrow {
    color: var(--accent-color);
    transform: translateX(3px);
}

/* Rebranding / Settings Drawer styling */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(1, 4, 10, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.settings-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(100vw, 420px);
    height: 100vh;
    z-index: 1010;
    padding: 1.5rem;
    border-left: 1px solid var(--border-card);
    background: linear-gradient(180deg, rgba(9, 13, 24, 0.98), rgba(10, 15, 28, 0.99));
    box-shadow: -28px 0 60px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 0.75rem;
}

.drawer-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

.form-control {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-card);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    padding: 0.7rem 0.9rem;
    outline: none;
    font-family: inherit;
    font-size: 0.88rem;
    margin-top: 0.35rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--accent-color);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label,
.form-group .form-label,
.form-group legend.form-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 1.25rem;
    min-width: 0;
}

.form-fieldset legend.form-label {
    padding: 0;
    float: none;
    width: auto;
    margin-bottom: 0.45rem;
}

.feed-cat-color-input {
    height: 3rem;
    padding: 0.2rem;
    max-width: 8rem;
    cursor: pointer;
}

.upload-zone {
    border: 2px dashed var(--border-card);
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    color: inherit;
    font: inherit;
    width: 100%;
    box-sizing: border-box;
}

.upload-zone:hover {
    border-color: var(--accent-color);
}

.upload-zone i {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--accent-color);
}

.upload-zone span {
    font-size: 0.78rem;
}

.upload-zone .upload-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.drawer-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-card);
    padding-top: 1rem;
}

.btn {
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.97);
}

.btn-primary {
    background: var(--accent-color);
    color: #000;
}

.btn-primary:hover {
    box-shadow: 0 0 12px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: var(--border-card);
}

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

/* Premium Modal styling for Add App */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(1, 4, 10, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(95vw, 500px);
    max-height: 90vh;
    z-index: 1010;
    background: linear-gradient(180deg, rgba(9, 13, 24, 0.98), rgba(10, 15, 28, 0.99));
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.5rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 0.75rem;
}

.modal-header h2 {
    font-size: 1.3rem;
}

/* Settings Drawer Tabs layout */
.settings-tabs {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.settings-tabs::-webkit-scrollbar {
    display: none;
}

.settings-tabs .tab-btn {
    border: 1px solid transparent !important;
}

.settings-tabs .tab-btn.active {
    background: #374151 !important;
    border-color: #4b5563 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.settings-tabs .tab-btn:hover {
    background: #1f2937;
    color: #f9fafb !important;
}

/* Redesigned Settings drawer layout section container */
.settings-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-section h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
}

select.form-control option {
    background-color: #0b0d16;
    color: var(--text-primary);
}

select.form-control option:disabled {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    opacity: 1;
}

select.form-control optgroup {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
}

select.form-control optgroup option {
    background-color: #0b0d16;
    color: var(--text-primary);
    font-weight: 400;
    font-size: 0.88rem;
}

/* Integration picker (Add/Edit App) */
.integration-picker {
    position: relative;
    margin-top: 0.35rem;
}

.integration-picker-trigger {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-align: left;
    cursor: pointer;
    padding-right: 2rem;
    position: relative;
}

.integration-picker-trigger-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

.integration-picker-trigger-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.integration-picker-chevron {
    position: absolute;
    right: 0.75rem;
    width: 1rem;
    height: 1rem;
    opacity: 0.6;
    pointer-events: none;
}

.integration-picker-panel {
    position: absolute;
    z-index: 1200;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    max-height: min(320px, 50vh);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-card);
    background: var(--bg-secondary, #12141c);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.integration-picker-panel[hidden] {
    display: none !important;
}

.integration-picker-search {
    margin: 0.5rem;
    flex-shrink: 0;
}

.integration-picker-list {
    overflow-y: auto;
    padding: 0.25rem 0.5rem 0.5rem;
}

.integration-picker-group-label {
    padding: 0.5rem 0.5rem 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: transparent;
}

.integration-picker-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.45rem 0.5rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.integration-picker-option:hover,
.integration-picker-option:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.integration-picker-option-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

.integration-picker-option-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Delete application button */
.btn-delete-app {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-delete-app:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.btn-delete-app svg {
    width: 0.95rem;
    height: 0.95rem;
}

/* Edit application button */
.btn-edit-app {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-edit-app:hover {
    color: var(--accent-color);
    background: var(--accent-glow);
}

.btn-edit-app svg {
    width: 0.95rem;
    height: 0.95rem;
}

/* Card Status indicator dots */
.app-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.green {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.orange {
    background-color: #f97316;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
}

.status-dot.blue {
    background-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-glow);
}

.status-dot.red {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

/* Hero Section (Greeting & Clock) */
.hero-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem;
    gap: 2rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    animation: fadeSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.1s;
}

.greeting-box {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1 1 auto;
    min-width: 0;
}

.greeting-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
    color: var(--text-primary);
}

.greeting-title #greeting-text {
    color: transparent;
    background: linear-gradient(
        90deg,
        var(--text-primary) 0%,
        var(--text-primary) 40%,
        var(--accent-color) 50%,
        var(--text-primary) 60%,
        var(--text-primary) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShimmer 6s ease-in-out infinite;
}

html[data-greeting-animations="0"] .greeting-title #greeting-text {
    animation: none;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
    background: none;
}

@supports not (-webkit-background-clip: text) {
    .greeting-title #greeting-text {
        color: var(--text-primary);
        background: none;
        animation: none;
    }
}

.username-highlight {
    -webkit-text-fill-color: var(--accent-color);
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-glow);
}

.greeting-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.clock-box {
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    background: rgba(15, 20, 25, calc(var(--glass-opacity) - 0.1));
}

.clock-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.clock-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: var(--text-primary);
    text-shadow: 0 0 30px var(--accent-glow);
}

.clock-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.clock-ampm {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-color);
}

.clock-label {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
}

.hero-widgets {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    flex-shrink: 0;
}

.weather-box {
    display: none;
    padding: 0.85rem 1.5rem;
    align-items: center;
    background: rgba(15, 20, 25, calc(var(--glass-opacity) - 0.1));
}

.weather-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.weather-temp {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.35rem, 6vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1;
    white-space: nowrap;
    color: var(--text-primary);
    text-shadow: 0 0 30px var(--accent-glow);
}

.weather-temp--compact {
    font-size: clamp(1.15rem, 5vw, 1.85rem);
}

.weather-temp--wide {
    font-size: clamp(0.95rem, 4.5vw, 1.5rem);
    letter-spacing: -0.03em;
}

.weather-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    gap: 0.15rem;
}

.weather-meta i,
.weather-meta svg {
    width: 1.15rem;
    height: 1.15rem;
    color: var(--accent-color);
}

.weather-label {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.search-toggle {
    display: none;
}

/* Search Bar Wrapper & Input */
.search-bar-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0 1rem;
    animation: fadeSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.15s;
}

.search-bar {
    width: 100%;
    max-width: 680px;
    display: flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: rgba(15, 20, 25, calc(var(--glass-opacity) - 0.1));
}

.search-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    padding: 0.2rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.28);
}

.search-mode-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.search-mode-btn:hover {
    color: var(--text-secondary);
}

.search-mode-btn.active {
    background: var(--accent-glow);
    color: var(--accent-color);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color) 35%, transparent);
}

.shortcuts-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.shortcuts-panel {
    padding: 1.5rem;
    max-width: 420px;
    width: 90%;
}

.shortcuts-panel h3 {
    margin: 0 0 1rem;
}

.shortcuts-panel ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.shortcuts-panel li {
    padding: 0.35rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.shortcuts-panel kbd {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.8rem;
}

.search-engine-select {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    padding-right: 0.5rem;
    min-width: 5.5rem;
}

.search-engine-select option {
    background-color: #0b0d16;
    color: var(--text-primary);
}

.search-input-divider {
    width: 1px;
    height: 1.25rem;
    background-color: var(--border-card);
    margin: 0 0.75rem;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.search-icon {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--text-muted);
}

.search-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Category Filters Tabs */
.category-filters-wrapper {
    padding: 0 1rem;
    margin-bottom: 1rem;
    animation: fadeSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.2s;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filter-tab {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    border-radius: 30px;
    color: var(--text-secondary);
    padding: 0.45rem 1.15rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-2px) scale(1.03);
}

.filter-tab.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
    box-shadow: 0 0 12px var(--accent-glow);
}

.filter-count {
    font-size: 0.72rem;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.05rem 0.35rem;
    border-radius: 10px;
}

.filter-tab.active .filter-count {
    background: rgba(0, 0, 0, 0.15);
}

.health-status-hint {
    margin: 1rem auto 0;
    max-width: 720px;
    padding: 0.8rem 1rem;
    border: 1px solid #b45309;
    border-radius: var(--radius-md);
    background: #78350f;
    color: #fef3c7;
    font-size: 0.82rem;
    text-align: center;
}

.form-help {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.4;
}

.form-advanced-block {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.15);
}

.form-advanced-block summary {
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    user-select: none;
}

.form-advanced-block summary:hover {
    color: var(--text-primary);
}

.icon-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.icon-input-row .form-control {
    flex: 1;
    min-width: 0;
}

.icon-input-row .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.duplicate-warning {
    color: #f59e0b;
}

/* Single-Column Stream layout */
.streams-row.single-col {
    grid-template-columns: 1fr;
}

/* Manage Categories modal glass panel - disable hover lift */
.modal .glass-panel:hover {
    transform: none;
    box-shadow: none;
}

/* Credential form feedback messages */
#cred-error-msg, #cred-success-msg {
    font-size: 0.78rem;
    margin-top: 0.35rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}

#cred-error-msg {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

#cred-success-msg {
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Color input styling */
input[type="color"].form-control {
    padding: 0.15rem;
    cursor: pointer;
}

@media (max-width: 1024px) {
    body {
        background-attachment: scroll;
    }

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .telemetry-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .telemetry-card--host {
        grid-column: span 2;
    }

    .topbar {
        position: relative;
        z-index: 100;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0.5rem;
        margin-bottom: 0.25rem;
    }

    .brand-section {
        grid-column: 2;
        justify-content: center;
    }

    .topbar-end {
        grid-column: 3;
        justify-self: end;
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        margin-left: 0;
    }

    .topbar-overflow {
        display: none;
        position: absolute;
        top: calc(100% + 0.5rem);
        right: 0;
        min-width: min(18rem, calc(100vw - 2rem));
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem;
        border-radius: 12px;
        background: rgba(10, 11, 16, 0.96);
        border: 1px solid var(--border-card);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
        z-index: 50;
    }

    .topbar-overflow.is-open {
        display: flex;
        position: fixed;
        top: calc(env(safe-area-inset-top) + 3.5rem);
        right: max(1rem, env(safe-area-inset-right));
        left: auto;
        z-index: 200;
    }

    .topbar-overflow .topbar-action,
    .topbar-overflow form {
        width: 100%;
    }

    .topbar-overflow .topbar-action {
        justify-content: flex-start;
    }

    .topbar-menu-toggle {
        display: inline-flex;
        min-height: 44px;
        min-width: 44px;
        justify-content: center;
    }
}

/* Responsive adjustments for new sections */
@media (max-width: 768px) {
    body {
        padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
        background-attachment: scroll;
    }

    .bento-grid:not(.bento-grid--guest-compact) {
        grid-template-columns: 1fr;
    }

    .bento-grid--guest-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .telemetry-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .telemetry-card {
        padding: 0.7rem 0.85rem;
    }

    .telemetry-title {
        font-size: 0.72rem;
    }

    .telemetry-value {
        font-size: 0.85rem;
    }

    .telemetry-card--host {
        grid-column: span 2;
    }

    .streams-row {
        grid-template-columns: 1fr;
    }

    .hero-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.25rem;
    }

    .greeting-box {
        width: 100%;
        align-items: center;
    }

    .greeting-title {
        overflow-wrap: break-word;
        max-width: 100%;
        font-size: 1.85rem;
    }

    .hero-widgets {
        width: 100%;
        justify-content: center;
    }

    .hero-widgets .clock-box,
    .weather-box {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
    }

    .weather-box {
        display: flex;
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .topbar-essential .weather-widget {
        display: none;
    }

    .clock-time {
        font-size: 2rem;
    }

    .app-card--guest-compact .app-card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.45rem;
        flex-wrap: nowrap;
    }

    .app-card--guest-compact .app-card-identity {
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
        width: 100%;
    }

    .app-card--guest-compact .app-card-title {
        font-size: 0.78rem;
        overflow-wrap: break-word;
    }

    .app-card:not(.app-card--guest-compact) .app-card-header {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .app-card-identity {
        min-width: 0;
    }

    .app-card:not(.app-card--guest-compact) .app-card-identity {
        flex: 1 1 auto;
        min-width: 0;
    }

    .app-card:not(.app-card--guest-compact) .app-card-badges {
        width: auto;
        flex-wrap: wrap;
        flex-shrink: 0;
        gap: 0.4rem;
        justify-content: flex-end;
    }

    .app-card:not(.app-card--guest-compact) {
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        padding: 0.85rem;
    }

    .app-card--guest-compact .app-card-badges {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.35rem;
        justify-content: center;
    }

    .container-controls {
        flex-shrink: 0;
    }

    .stream-main {
        flex-wrap: wrap;
    }

    .brand-title {
        font-size: 1.15rem;
    }

    .btn,
    .btn-ctrl,
    .nav-item,
    .form-control {
        min-height: 44px;
    }

    .search-bar-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .search-toggle {
        display: inline-flex;
        align-self: center;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem;
        border: 1px solid var(--border-card);
        cursor: pointer;
        color: var(--text-primary);
        background: rgba(15, 20, 25, calc(var(--glass-opacity) - 0.1));
    }

    .search-toggle i,
    .search-toggle svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .search-bar-wrapper:not(.is-expanded) .search-bar {
        display: none;
    }

    .search-bar-wrapper.is-expanded .search-toggle {
        display: none;
    }

    .search-bar-wrapper.is-expanded .search-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pwa-install-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .pwa-install-banner__actions {
        width: 100%;
    }

    .pwa-install-banner__actions .topbar-action {
        flex: 1;
        justify-content: center;
    }

    .app-card:not(.app-card--guest-compact).span-tall:has(.app-card-metrics-slot--filled),
    .app-card:not(.app-card--guest-compact):has(.app-card-metrics-slot--filled) {
        min-height: auto;
    }

    .app-card:not(.app-card--guest-compact) .integration-metrics-grid {
        min-height: auto;
        gap: 0.3rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .app-card:not(.app-card--guest-compact) .integration-metrics-grid .metric-block {
        min-height: 2rem;
        padding: 0.25rem 0.15rem;
    }

    .app-card:not(.app-card--guest-compact) .integration-metrics-grid .metric-value {
        font-size: 0.72rem;
    }

    .app-card:not(.app-card--guest-compact) .app-card-desc {
        display: none;
    }

    .btn-edit-app {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 520px) {
    .app-card:not(.app-card--guest-compact) .integration-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-card:not(.app-card--guest-compact) .integration-metrics-grid .metric-value {
        font-size: 0.68rem;
    }

    .app-card:not(.app-card--guest-compact) .app-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .app-card:not(.app-card--guest-compact) .app-card-badges {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        gap: 0.85rem;
    }

    .telemetry-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .clock-box,
    .weather-box,
    .search-bar,
    .app-card,
    .stream-card {
        padding: 0.9rem;
    }

    .app-card--guest-compact .app-card-badges {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Container Controls & Cockpit buttons */
.container-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 0.15rem;
}

.btn-ctrl {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    color: var(--text-secondary);
    width: 1.45rem;
    height: 1.45rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ctrl:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}


.btn-ctrl:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.container-controls.loading {
    border-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-glow);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Support / Donation card */
.support-section {
    margin-top: 2rem;
}

.support-card {
    padding: 1.75rem 2rem;
    border-radius: var(--radius-xl, 16px);
    text-align: center;
}

.support-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.support-head h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.support-msg {
    max-width: 640px;
    margin: 0 auto 1.25rem auto;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.support-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.support-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: #f9fafb;
    border: 1px solid #334155;
    background: #1e293b;
    transition: all 0.2s ease;
}

.support-link:hover {
    background: var(--accent-glow);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-1px);
}

.telemetry-card.agent-offline {
    opacity: 0.55;
}

.telemetry-card.agent-offline .telemetry-title::after {
    content: ' · Agent offline';
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
}

/* System Updates Styles */
.update-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, rgba(210, 153, 34, 0.12), rgba(245, 158, 11, 0.08));
    border-bottom: 1px solid rgba(210, 153, 34, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    font-size: 0.88rem;
    transition: all 0.3s ease;
}

.update-banner-content {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fce3b6;
}

.update-banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
    display: inline-block;
    animation: pulse-dot 1.8s infinite ease-in-out;
}

.update-banner-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-update-banner {
    background: #92400e;
    border: 1px solid #d97706;
    color: #ffffff;
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    font-size: 0.78rem;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-update-banner:hover {
    background: rgba(210, 153, 34, 0.3);
    border-color: rgba(210, 153, 34, 0.6);
    transform: translateY(-1px);
}

.btn-update-dismiss {
    background: none;
    border: none;
    color: #d29922;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.1rem 0.3rem;
    transition: color 0.2s ease;
}

.btn-update-dismiss:hover {
    color: #fff;
}

.dashboard-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: right;
}

.version-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.65;
    transition: all 0.3s ease;
    cursor: default;
}

.version-badge:hover {
    opacity: 1;
}

.version-badge.update-available {
    background-color: #0a0b10;
    color: #fbbf24;
    opacity: 1;
    font-weight: 600;
    animation: pulse-glow 2s infinite ease-in-out;
}

/* System Tab Badges & Cards */
.badge-success {
    background: #166534 !important;
    color: #ffffff !important;
    border: 1px solid #16a34a !important;
}

.badge-failed {
    background: #991b1b !important;
    color: #ffffff !important;
    border: 1px solid #b91c1c !important;
}

.badge-info {
    background: #1e40af !important;
    color: #ffffff !important;
    border: 1px solid #2563eb !important;
}

/* Proxmox-inspired status chips */
.pve-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.75rem;
    border-radius: 2px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
}

.pve-badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pve-badge--proxmox {
    background: #92400e;
    color: #ffffff;
    border: 1px solid #d97706;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.pve-badge--proxmox::before {
    background: #e5a024;
    box-shadow: 0 0 0 2px rgba(229, 160, 36, 0.2), 0 0 8px rgba(229, 160, 36, 0.55);
}

.pve-badge--docker {
    background: #1e40af;
    color: #ffffff;
    border: 1px solid #2563eb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.pve-badge--docker::before {
    background: #2496f3;
    box-shadow: 0 0 0 2px rgba(36, 150, 243, 0.2), 0 0 8px rgba(36, 150, 243, 0.45);
}

.pve-badge--native {
    background: #475569;
    color: #ffffff;
    border: 1px solid #64748b;
}

.pve-badge--native::before {
    background: #94a3b8;
}

.pve-badge--online {
    background: #166534;
    color: #ffffff;
    border: 1px solid #16a34a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.pve-badge--online::before {
    background: #21bf4b;
    box-shadow: 0 0 0 2px rgba(33, 191, 75, 0.2), 0 0 8px rgba(33, 191, 75, 0.55);
    animation: pve-pulse-dot 2s ease-in-out infinite;
}

.pve-badge--offline {
    background: #991b1b;
    color: #ffffff;
    border: 1px solid #b91c1c;
}

.pve-badge--offline::before {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.pve-badge--pending {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.pve-badge--pending::before {
    background: var(--text-muted);
    opacity: 0.45;
    animation: pve-pulse-dot 1.2s ease-in-out infinite;
}

@keyframes pve-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.88); }
}

.sys-version-tag {
    font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.22rem 0.6rem;
    border-radius: 2px;
    letter-spacing: 0.03em;
}

.sys-info-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 3px;
    overflow: hidden;
}

.sys-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 0.9rem;
    background: rgba(0, 0, 0, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sys-info-row:last-child {
    border-bottom: none;
}

.sys-info-row:nth-child(even) {
    background: rgba(0, 0, 0, 0.1);
}

.sys-info-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

/* Settings layout — thin dark scrollbars */
.settings-sidebar,
.settings-main {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) rgba(0, 0, 0, 0.25);
}

.settings-sidebar::-webkit-scrollbar,
.settings-main::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.settings-sidebar::-webkit-scrollbar-track,
.settings-main::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.settings-sidebar::-webkit-scrollbar-thumb,
.settings-main::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    background-clip: padding-box;
}

.settings-sidebar::-webkit-scrollbar-thumb:hover,
.settings-main::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
    background-clip: padding-box;
}

.settings-sidebar::-webkit-scrollbar-corner,
.settings-main::-webkit-scrollbar-corner {
    background: transparent;
}

.settings-sidebar::-webkit-scrollbar-button,
.settings-main::-webkit-scrollbar-button {
    display: none;
    height: 0;
    width: 0;
}

.settings-block .changelog-preview {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.settings-block .changelog-preview::-webkit-scrollbar {
    width: 5px;
}

.settings-block .changelog-preview::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 3px;
}

.update-available-card {
    background: rgba(245, 158, 11, 0.02) !important;
}

.up-to-date-card {
    background: rgba(34, 197, 94, 0.01) !important;
}

/* Small loading spinner */
.spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--accent-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 6px rgba(245, 158, 11, 0.3); }
    50% { text-shadow: 0 0 14px rgba(245, 158, 11, 0.8); }
}

.pulse-dot {
    animation: pulse-dot 1.8s infinite ease-in-out;
}

/* ============================================================
   PHASE 1: CINEMATIC ANIMATIONS & VISUAL POLISH
   ============================================================ */

@keyframes fadeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes textShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(33, 191, 75, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(33, 191, 75, 0); }
}

/* Staggered entrance delays (base animations live on each component rule) */
.telemetry-card:nth-child(1) { animation-delay: 0.12s; }
.telemetry-card:nth-child(2) { animation-delay: 0.18s; }
.telemetry-card:nth-child(3) { animation-delay: 0.24s; }
.telemetry-card:nth-child(4) { animation-delay: 0.30s; }
.telemetry-card:nth-child(5) { animation-delay: 0.36s; }
.telemetry-card:nth-child(6) { animation-delay: 0.42s; }

.stream-card:nth-child(1) { animation-delay: 0.25s; }
.stream-card:nth-child(2) { animation-delay: 0.32s; }

.app-card:nth-child(1) { animation-delay: 0.15s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }
.app-card:nth-child(3) { animation-delay: 0.25s; }
.app-card:nth-child(4) { animation-delay: 0.3s; }
.app-card:nth-child(5) { animation-delay: 0.35s; }
.app-card:nth-child(6) { animation-delay: 0.4s; }
.app-card:nth-child(7) { animation-delay: 0.43s; }
.app-card:nth-child(8) { animation-delay: 0.46s; }
.app-card:nth-child(9) { animation-delay: 0.49s; }
.app-card:nth-child(n+10) { animation-delay: 0.52s; }

/* App card hover lift removed */
.app-card.glass-panel {
    transition: background 0.25s ease, border-color 0.25s ease;
}

/* Settings page wallpaper layers (behind layout chrome) */
.wallpaper-bg,
.wallpaper-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.wallpaper-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.wallpaper-overlay {
    background: var(
        --brand-overlay-gradient,
        linear-gradient(135deg, rgba(8, 10, 18, 0.85) 0%, rgba(15, 10, 25, 0.8) 100%)
    );
}

body.settings-page {
    padding: 0;
    overflow: hidden;
    background-image: none;
}

:root[data-theme="light"] body.settings-page {
    background-color: #f0f2f5;
    color-scheme: light;
}

:root[data-theme="light"] .wallpaper-overlay {
    opacity: 0.55;
}

:root[data-theme="light"] .wallpaper-bg {
    opacity: 0.45;
}

/* Appearance tab layout — preview band + settings grid */
.appearance-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.appearance-preview-section {
    margin: 0;
}

.appearance-preview-header {
    margin-bottom: 1rem;
}

.appearance-preview-header h3 {
    margin-bottom: 0.35rem;
}

.appearance-preview-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.45;
}

.appearance-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.appearance-settings-grid .settings-block--full {
    grid-column: 1 / -1;
}

.appearance-settings-grid .settings-block--pair {
    align-self: stretch;
}

.appearance-pair-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.appearance-pair-row--triple {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.branding-visual-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.upload-zone--compact {
    padding: 0.65rem 0.75rem;
    margin-top: 0.5rem;
}

.upload-zone--compact i {
    width: 1.25rem;
    height: 1.25rem;
}

.theme-picker-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.theme-picker-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.theme-picker-category {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid var(--border-card);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.theme-picker-category:hover,
.theme-picker-category.is-active {
    border-color: var(--accent-color);
    color: var(--text-primary);
    background: var(--accent-glow);
}

.theme-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    max-height: 420px;
    overflow-y: auto;
    padding: 0.25rem;
    margin-bottom: 0.75rem;
}

.theme-picker-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 2px solid var(--border-card);
    border-radius: 12px;
    background: var(--bg-card);
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.theme-picker-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.theme-picker-card.is-active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color), 0 8px 24px var(--accent-glow);
}

.theme-picker-preview {
    aspect-ratio: 16 / 10;
    background-size: cover;
    background-position: center;
    background-color: rgba(0, 0, 0, 0.35);
}

.theme-picker-card-body {
    padding: 0.5rem 0.6rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.theme-picker-card-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.theme-picker-card-tags {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.theme-picker-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.theme-picker-status {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

.theme-light-mode-warning {
    font-size: 0.8rem;
    color: #1c1917;
    background: #fde68a;
    border: 1px solid #d97706;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: block;
}

@media (max-width: 960px) {
    .appearance-settings-grid {
        grid-template-columns: 1fr;
    }

    .appearance-settings-grid .settings-block--full,
    .appearance-settings-grid .settings-block--pair {
        grid-column: auto;
    }

    .appearance-pair-row,
    .appearance-pair-row--triple {
        grid-template-columns: 1fr;
    }

    .branding-visual-grid {
        grid-template-columns: 1fr;
    }
}

/* Live preview mini-scene on settings Appearance tab */
.preview-scene {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    min-height: 280px;
    border: 1px solid var(--border-card);
    background: #0a0b10;
}

.preview-scene-wallpaper,
.preview-scene-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.preview-scene-wallpaper {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.preview-scene-overlay {
    background: var(--brand-overlay-gradient);
}

.preview-scene-body {
    position: relative;
    z-index: 1;
    padding: 1.25rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 1rem;
    align-items: end;
    min-height: 260px;
}

@media (max-width: 720px) {
    .preview-scene-body {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

.preview-grid-demo {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(var(--preview-grid-cols, 3), 1fr);
    grid-auto-rows: minmax(2.25rem, auto);
    grid-auto-flow: row dense;
    align-items: stretch;
    align-content: end;
    min-height: 8rem;
}

.preview-grid-cell {
    height: 100%;
    min-height: 2.25rem;
    border-radius: calc(var(--radius-xl, 16px) * 0.65);
    background: var(--preview-bg, rgba(15, 20, 25, 0.45));
    border: 1px solid var(--border-card);
    backdrop-filter: blur(var(--preview-blur, 16px));
    -webkit-backdrop-filter: blur(var(--preview-blur, 16px));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 0 12px var(--accent-glow);
}

.preview-grid-cell.is-accent {
    background: color-mix(in srgb, var(--preview-accent, var(--accent-color)) 22%, var(--preview-bg, rgba(15, 20, 25, 0.45)));
    border-color: color-mix(in srgb, var(--preview-accent, var(--accent-color)) 45%, transparent);
}

.preview-grid-cell--tall {
    grid-row: span 2;
}

/* Ambient floating orbs — pure CSS background effects */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(100px);
    opacity: 0.4;
}

body::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    top: -200px;
    right: -150px;
    animation: floatOrb1 25s ease-in-out infinite;
}

body::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    bottom: -200px;
    left: -100px;
    animation: floatOrb2 30s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-80px, 60px) scale(1.1); }
    50% { transform: translate(-40px, 120px) scale(0.95); }
    75% { transform: translate(60px, 40px) scale(1.05); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, -60px) scale(1.15); }
    66% { transform: translate(40px, -120px) scale(0.9); }
}

/* ============================================================
   PHASE 2: DRAG & DROP STYLES
   ============================================================ */

/* Drag handle — always subtly visible for admins */
.drag-handle {
    position: absolute;
    top: 0.35rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2.5rem;
    height: 0.35rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    cursor: grab;
    opacity: 0.45;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 5;
}

.drag-handle::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2.75rem;
    height: 2.75rem;
}

.app-card:hover .drag-handle {
    opacity: 1;
}

.drag-handle:hover {
    background: var(--accent-color);
}

.drag-handle:active {
    cursor: grabbing;
}

.reorder-hint-banner {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    margin-bottom: 0.65rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-card);
    background: rgba(var(--theme-card-r, 15), var(--theme-card-g, 20), var(--theme-card-b, 25), 0.55);
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.reorder-hint-banner.is-visible {
    display: flex;
}

/* Card being dragged */
.app-card.dragging {
    opacity: 0.55;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 20px var(--accent-glow);
    z-index: 100;
    transition: none;
    pointer-events: none;
}

/* Drop target indicator — subtle highlight only */
.app-card.drag-over {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Insertion marker — shown during drag preview */
.drop-insertion-marker {
    position: absolute;
    height: 3px;
    background: var(--accent-color);
    box-shadow: 0 0 12px var(--accent-glow);
    pointer-events: none;
    z-index: 50;
    border-radius: 2px;
    display: none;
}

/* Smooth reorder transition — disabled during drag to avoid layout jumps */
.bento-grid.reordering .app-card:not(.dragging) {
    transition: none;
}

/* ============================================================
   PHASE 3: PER-CARD SIZING (BENTO SPANS)
   ============================================================ */

.app-card.span-2 {
    grid-column: span 2;
}

.app-card.span-tall {
    grid-row: span 2;
}

/* Collapse spans on mobile */
@media (max-width: 768px) {
    .app-card.span-2,
    .app-card.span-tall {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* ============================================================
   PHASE 5: LIGHT MODE (structural globals — palettes live in themes)
   ============================================================ */

:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="light"] body {
    background-color: var(--theme-bg-fallback, #f8fafc);
    color: var(--text-primary);
    color-scheme: light;
    scrollbar-color: rgba(0, 0, 0, 0.16) rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] body::before,
:root[data-theme="light"] body::after {
    opacity: 0.35;
}

/* AMUD light mode — default (bundled in style.css) */
:root[data-theme="light"][data-theme-id="default"] {
    --theme-bg-fallback: #f4f6f9;
    --theme-card-r: 255;
    --theme-card-g: 252;
    --theme-card-b: 248;
    --bg-card: rgba(255, 252, 248, var(--glass-opacity));
    --accent-color: #b45309;
    --accent-glow: rgba(207, 100, 39, 0.2);
    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #78716c;
    --border-card: rgba(207, 100, 39, 0.14);
    --border-hover: #b45309;
    --success: #16a34a;
    --success-bg: rgba(22, 163, 74, 0.12);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.1);
    color-scheme: light;
}

:root[data-theme="light"][data-theme-id="default"] body {
    background-color: var(--theme-bg-fallback);
    color: var(--text-primary);
}

/* Light mode glass panels */
:root[data-theme="light"] .glass-panel {
    background: rgba(var(--theme-card-r, 255), var(--theme-card-g, 255), var(--theme-card-b, 255), var(--glass-opacity));
    border-color: var(--border-card);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Light mode brand title */
:root[data-theme="light"] .brand-title {
    background: linear-gradient(135deg, var(--text-primary) 60%, var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Light mode greeting shimmer */
:root[data-theme="light"] .greeting-title {
    background: linear-gradient(
        90deg,
        var(--text-primary) 0%,
        var(--text-primary) 40%,
        var(--accent-color) 50%,
        var(--text-primary) 60%,
        var(--text-primary) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Light mode status badges */
:root[data-theme="light"] .status-badge.status-online {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

:root[data-theme="light"] .status-badge.status-offline,
:root[data-theme="light"] .status-badge.down {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

:root[data-theme="light"] .status-badge.ms {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Light mode modals and drawers */
:root[data-theme="light"] .modal {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.99));
    border-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .modal-backdrop,
:root[data-theme="light"] .drawer-backdrop {
    background: rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] .settings-drawer {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.99));
}

:root[data-theme="light"] .form-control {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

:root[data-theme="light"] select.form-control option {
    background-color: #ffffff;
    color: var(--text-primary);
}

:root[data-theme="light"] select.form-control option:disabled {
    color: var(--text-muted);
}

:root[data-theme="light"] select.form-control optgroup {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-muted);
}

:root[data-theme="light"] select.form-control optgroup option {
    background-color: #ffffff;
    color: var(--text-primary);
}

:root[data-theme="light"] .integration-picker-panel {
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

:root[data-theme="light"] .integration-picker-option:hover,
:root[data-theme="light"] .integration-picker-option:focus-visible {
    background: rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

:root[data-theme="light"] .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* Light mode scrollbar */
:root[data-theme="light"] html::-webkit-scrollbar-thumb,
:root[data-theme="light"] body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

:root[data-theme="light"] html::-webkit-scrollbar-track,
:root[data-theme="light"] body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
}

/* Light mode telemetry */
:root[data-theme="light"] .telemetry-bar-container {
    background: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .stream-progress-track {
    background: rgba(0, 0, 0, 0.06);
}

/* Light mode clock */
:root[data-theme="light"] .clock-time {
    text-shadow: none;
}

/* Light mode support card */
:root[data-theme="light"] .support-link {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

/* Light mode search */
:root[data-theme="light"] .search-engine-select {
    color: var(--text-secondary);
}

:root[data-theme="light"] .search-engine-select option {
    background-color: #ffffff;
    color: var(--text-primary);
}

/* Light mode ws status pill */
:root[data-theme="light"] .ws-status-pill {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

/* Light mode filter tab active */
:root[data-theme="light"] .filter-tab {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
}

:root[data-theme="light"] .filter-tab.active {
    color: var(--text-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

:root[data-theme="light"] .health-status-hint {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

:root[data-theme="light"] .drag-handle {
    background: rgba(0, 0, 0, 0.12);
}

:root[data-theme="light"] .app-card.dragging {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), 0 0 24px var(--accent-glow);
}

:root[data-theme="light"] .greeting-subtitle,
:root[data-theme="light"] .clock-date {
    color: var(--text-secondary);
}

:root[data-theme="light"] .preview-scene {
    background: var(--theme-bg-fallback, #e2e8f0);
    border-color: var(--border-card, rgba(0, 0, 0, 0.08));
}

:root[data-theme="light"] .appearance-preview-header p {
    color: var(--text-secondary);
}

:root[data-theme="light"] .preview-scene-overlay {
    opacity: 0.35;
}

/* Light mode nested metrics */
:root[data-theme="light"] .nested-metrics-grid {
    border-top-color: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .metric-block {
    background: rgba(0, 0, 0, 0.02);
}

/* Light mode RSS feed widget */
:root[data-theme="light"] .rss-feed-list {
    border-top-color: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .rss-feed-item {
    border-bottom-color: rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .rss-feed-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Light mode update banner */
:root[data-theme="light"] .update-banner {
    background: linear-gradient(135deg, rgba(255, 237, 186, 0.8), rgba(255, 243, 207, 0.6));
    border-bottom-color: rgba(210, 153, 34, 0.3);
}

/* Light mode settings page */
:root[data-theme="light"] .settings-sidebar {
    background: rgba(255, 255, 255, 0.7);
    border-right-color: rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .settings-block {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .nav-item.active {
    background: var(--accent-glow);
}

/* Light mode container controls */
:root[data-theme="light"] .container-controls {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .btn-ctrl {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
}

/* ============================================================
   PHASE 6: VIDEO WALLPAPER SUPPORT
   ============================================================ */

.video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -2;
    pointer-events: none;
}

/* When video bg is present, remove body background-image */
body.has-video-bg {
    background-image: none !important;
}

body.has-webgl-bg {
    background-color: transparent !important;
    background-image: none !important;
}

#amud-webgl-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

#amud-webgl-bg canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

body.taghawsa-css-fallback::before {
    display: block !important;
    opacity: 1 !important;
}

/* Disable heavy WebGL layer on mobile when CSS fallback is active */
@media (max-width: 768px) {
    body.has-webgl-bg::before,
    body.has-webgl-bg::after {
        display: none !important;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .greeting-title #greeting-text {
        animation: none !important;
        color: var(--text-primary);
        -webkit-text-fill-color: var(--text-primary);
        background: none;
    }

    body.has-webgl-bg::before,
    body.has-webgl-bg::after,
    #amud-webgl-bg {
        display: none !important;
    }
}

.category-sections {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.category-section {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--bento-radius, 12px);
    background: rgba(255, 255, 255, 0.02);
}

.category-section-title {
    cursor: pointer;
    padding: 0.65rem 1rem;
    font-weight: 600;
    list-style: none;
}

.dashboard-widgets-row {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dashboard-widget-card {
    padding: 1rem;
}

.status-table th,
.status-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.embed-panel {
    min-height: 70vh;
}

.embed-panel-frame {
    display: block;
    width: 100%;
    min-height: 70vh;
    border: 0;
}
