/* Avena Ryn Control Center - State-of-the-Art Futuristic Cyber/Glass Design */
:root {
    --bg-dark: #07090e;
    --sidebar-bg: rgba(13, 17, 26, 0.95);
    --card-bg: rgba(18, 24, 38, 0.7);
    --card-border: rgba(99, 102, 241, 0.25);
    --card-border-glow: rgba(99, 102, 241, 0.5);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #0ea5e9;
    --secondary-glow: rgba(14, 165, 233, 0.4);
    --accent: #a855f7;
    --accent-glow: rgba(168, 85, 247, 0.4);
    --avena-sand: #d4a373;
    --avena-green: #2a9d8f;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #1e293b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Atmosphere & Dynamic Theme Gradients */
    --bg-glow-1: rgba(99, 102, 241, 0.15);
    --bg-glow-2: rgba(168, 85, 247, 0.15);
    --bg-glow-3: rgba(14, 165, 233, 0.08);
    --hero-bg-gradient: linear-gradient(135deg, rgba(18, 24, 38, 0.85), rgba(10, 15, 29, 0.9));
    --btn-primary-gradient: linear-gradient(135deg, #6366f1, #0ea5e9);
    --nav-active-gradient: linear-gradient(90deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.06));

    /* Precision Radius Hierarchy (Design Round 7) */
    --radius-sharp: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-card: 8px;
    --radius-btn: 6px;
    --radius-input: 6px;
    --radius-badge: 4px;
}

/* Theme Presets (Data-Theme Overrides) */
[data-theme="sunset"] {
    --primary: #f59e0b;
    --primary-glow: rgba(245, 158, 11, 0.4);
    --secondary: #d97706;
    --secondary-glow: rgba(217, 119, 6, 0.4);
    --accent: #d4a373;
    --accent-glow: rgba(212, 163, 115, 0.4);
    --card-border: rgba(245, 158, 11, 0.28);
    --card-border-glow: rgba(245, 158, 11, 0.55);

    --bg-glow-1: rgba(245, 158, 11, 0.16);
    --bg-glow-2: rgba(217, 119, 6, 0.14);
    --bg-glow-3: rgba(212, 163, 115, 0.10);
    --hero-bg-gradient: linear-gradient(135deg, rgba(28, 20, 12, 0.88), rgba(18, 13, 8, 0.92));
    --btn-primary-gradient: linear-gradient(135deg, #f59e0b, #d97706);
    --nav-active-gradient: linear-gradient(90deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.08));
}

[data-theme="emerald"] {
    --primary: #10b981;
    --primary-glow: rgba(16, 185, 129, 0.4);
    --secondary: #14b8a6;
    --secondary-glow: rgba(20, 184, 166, 0.4);
    --accent: #059669;
    --accent-glow: rgba(5, 150, 105, 0.4);
    --card-border: rgba(16, 185, 129, 0.28);
    --card-border-glow: rgba(16, 185, 129, 0.55);

    --bg-glow-1: rgba(16, 185, 129, 0.16);
    --bg-glow-2: rgba(20, 184, 166, 0.14);
    --bg-glow-3: rgba(5, 150, 105, 0.10);
    --hero-bg-gradient: linear-gradient(135deg, rgba(12, 28, 22, 0.88), rgba(8, 18, 14, 0.92));
    --btn-primary-gradient: linear-gradient(135deg, #10b981, #14b8a6);
    --nav-active-gradient: linear-gradient(90deg, rgba(16, 185, 129, 0.22), rgba(20, 184, 166, 0.08));
}

[data-theme="nordic"] {
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.4);
    --secondary: #06b6d4;
    --secondary-glow: rgba(6, 182, 212, 0.4);
    --accent: #64748b;
    --accent-glow: rgba(100, 116, 139, 0.4);
    --card-border: rgba(56, 189, 248, 0.28);
    --card-border-glow: rgba(56, 189, 248, 0.55);

    --bg-glow-1: rgba(56, 189, 248, 0.16);
    --bg-glow-2: rgba(6, 182, 212, 0.14);
    --bg-glow-3: rgba(100, 116, 139, 0.10);
    --hero-bg-gradient: linear-gradient(135deg, rgba(12, 24, 34, 0.88), rgba(8, 16, 24, 0.92));
    --btn-primary-gradient: linear-gradient(135deg, #38bdf8, #06b6d4);
    --nav-active-gradient: linear-gradient(90deg, rgba(56, 189, 248, 0.22), rgba(6, 182, 212, 0.08));
}

[data-theme="synthwave"] {
    --primary: #ec4899;
    --primary-glow: rgba(236, 72, 153, 0.4);
    --secondary: #f43f5e;
    --secondary-glow: rgba(244, 63, 94, 0.4);
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --card-border: rgba(236, 72, 153, 0.28);
    --card-border-glow: rgba(236, 72, 153, 0.55);

    --bg-glow-1: rgba(236, 72, 153, 0.16);
    --bg-glow-2: rgba(244, 63, 94, 0.14);
    --bg-glow-3: rgba(139, 92, 246, 0.10);
    --hero-bg-gradient: linear-gradient(135deg, rgba(28, 12, 24, 0.88), rgba(18, 8, 16, 0.92));
    --btn-primary-gradient: linear-gradient(135deg, #ec4899, #f43f5e);
    --nav-active-gradient: linear-gradient(90deg, rgba(236, 72, 153, 0.22), rgba(244, 63, 94, 0.08));
}

/* Theme Switcher Top Navbar Control */
.theme-switcher-control {
    position: relative;
}

.theme-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.85rem;
    background: rgba(13, 17, 26, 0.85);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-btn);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-trigger-btn:hover, .theme-trigger-btn:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.theme-swatch-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.theme-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.theme-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    width: 280px;
    background: rgba(10, 15, 29, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border-glow);
    border-radius: var(--radius-card);
    padding: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    display: grid;
    gap: 6px;
}

.theme-popover[hidden] {
    display: none !important;
}

.theme-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-popover-header span {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.theme-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: rgba(18, 24, 38, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-btn);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: left;
}

.theme-option-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
}

.theme-option-btn.is-active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.18);
    box-shadow: inset 0 0 0 1px var(--primary);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Animated Background Mesh & Cyber Grid */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at 15% 20%, var(--bg-glow-1) 0%, transparent 42%),
        radial-gradient(circle at 85% 80%, var(--bg-glow-2) 0%, transparent 42%),
        radial-gradient(circle at 50% 50%, var(--bg-glow-3) 0%, transparent 60%),
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    z-index: -2;
    animation: bgPulse 12s ease-in-out infinite alternate;
    transition: background 0.5s ease;
}

@keyframes bgPulse {
    0% { transform: scale(1); filter: hue-rotate(0deg); }
    100% { transform: scale(1.05); filter: hue-rotate(20deg); }
}

/* Subtle Animated Cyber Glow Light Lines */
body::after {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 45%, rgba(99, 102, 241, 0.03) 50%, transparent 55%);
    z-index: -1;
    animation: sweep 15s linear infinite;
    pointer-events: none;
}

@keyframes sweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Sharp, Futuristic Navbar */
.sidebar {
    width: 270px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 46px;
    height: calc(100vh - 46px);
    z-index: 100;
    box-shadow: 5px 0 25px rgba(0,0,0,0.5);
}


.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    position: relative;
}

.aims-logo {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.45));
}

.aims-orbit,
.aims-mark,
.aims-node {
    fill: none;
    stroke: url(#aims-gradient);
    stroke-linecap: square;
    stroke-linejoin: miter;
}

.aims-orbit {
    stroke-width: 2.1;
    stroke-dasharray: 4 3;
    opacity: 0.85;
}

.aims-mark {
    stroke-width: 3.35;
}

.aims-node {
    fill: #8b8cff;
    stroke: #dbeafe;
    stroke-width: 0.7;
}

.brand-wordmark {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.brand h2 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.36rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.13em;
    background: linear-gradient(135deg, #ffffff 8%, #bfc7ff 55%, #dcaeff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-wordmark span {
    color: #8f9bb4;
    font-size: 0.47rem;
    font-weight: 700;
    letter-spacing: 0.105em;
    line-height: 1.2;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.nav-item {
    position: relative;
    display: grid;
    grid-template-columns: 1.25rem minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    min-height: 3rem;
    padding: 0.7rem 0.8rem;
    color: #8f9bb4;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.01em;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-item i {
    width: 1.25rem;
    color: #71809a;
    font-size: 0.9rem;
    text-align: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-item span {
    min-width: 0;
}

.nav-item::before {
    content: "";
    position: absolute;
    top: 0.7rem;
    bottom: 0.7rem;
    left: -1px;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, #8b8cff, #52c7ff);
    opacity: 0;
    transform: scaleY(0.4);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-item:hover {
    color: #e5e7ff;
    background: rgba(99, 102, 241, 0.07);
}

.nav-item:hover i {
    color: #aeb7d1;
    transform: translateX(1px);
}

.nav-item.active {
    color: #ffffff;
    background: var(--nav-active-gradient);
    border-color: var(--primary-glow);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    transition: background 0.4s ease, border-color 0.4s ease;
}

.nav-item.active::before {
    opacity: 1;
    transform: scaleY(1);
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.nav-item.active i {
    color: var(--primary);
}

.character-preview-card {
    background: rgba(18, 24, 38, 0.8);
    border-radius: var(--radius-sharp);
    padding: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid var(--card-border);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.avatar-ring {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sharp);
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 0 10px var(--primary-glow);
}

.avatar-ring img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sharp);
    object-fit: cover;
}

.character-preview-card h4 {
    font-size: 0.9rem;
    color: #ffffff;
}

.character-preview-card p {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: tabFadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tabFadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */

.main-content {
    margin-left: 270px;
    flex: 1;
    padding: 2rem 2.5rem 5rem 2.5rem;
    max-width: 1550px;
}


.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--card-border);
}

.header-left-col { flex: 1; }

.top-navbar h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.header-center-col {
    flex: 1.2;
    max-width: 450px;
}

.command-search-trigger {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(13, 17, 26, 0.85);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sharp);
    padding: 0.55rem 1rem;
    color: var(--text-muted);
    font-size: 0.83rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.command-search-trigger:hover {
    border-color: var(--secondary);
    background: rgba(14, 165, 233, 0.1);
    color: #ffffff;
    box-shadow: 0 0 15px var(--secondary-glow);
}

.cmd-kbd {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #38bdf8;
    font-family: monospace;
}

.header-right-col {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.live-status-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sharp);
}

.pulse-green-dot {
    width: 8px;
    height: 8px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 10px #34d399;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.live-status-text {
    font-size: 0.7rem;
    font-weight: 800;
    color: #34d399;
    letter-spacing: 0.5px;
}

/* Global SaaS App Metrics Ribbon */
.app-metrics-ribbon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(13, 17, 26, 0.75);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sharp);
    padding: 0.75rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.metric-ribbon-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.ribbon-icon {
    font-size: 1.2rem;
}

.ribbon-label {
    display: block;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.ribbon-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
}

.ribbon-divider {
    width: 1px;
    height: 28px;
    background: var(--card-border);
}


/* Sharp Badges & Buttons */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sharp);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.badge-cyan { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.4); }
.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }

.btn {
    padding: 0.65rem 1.2rem;
    border-radius: var(--radius-sharp);
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--btn-primary-gradient);
    color: #ffffff;
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 0 15px var(--primary-glow);
    transition: background 0.3s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.5);
}

.btn-secondary {
    background: #1f2937;
    color: #ffffff;
    border-color: var(--card-border);
}

.btn-secondary:hover {
    background: #374151;
    border-color: var(--primary);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--secondary);
    box-shadow: 0 0 10px var(--secondary-glow);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Glass Card with Sharp Edges & Cyber Glow */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sharp);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    border-color: var(--card-border-glow);
    box-shadow: 0 10px 35px rgba(99, 102, 241, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: 0.5px;
}

/* Stat Cards - Sharp & Dynamic */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(13, 17, 26, 0.8);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sharp);
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--secondary);
    box-shadow: 0 0 20px var(--secondary-glow);
}

.stat-card h3 {
    font-size: 1.7rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.stat-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Instagram Post Mockup - Sharp Frame */
.instagram-post-container {
    background: #000000;
    border-radius: var(--radius-sharp);
    border: 1px solid #262626;
    max-width: 440px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
}

.ig-header {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    gap: 0.8rem;
}

.ig-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sharp);
    object-fit: cover;
}

.ig-username {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
}

.ig-media-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    background: #121212;
}

.ig-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ig-media-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.85);
    color: #38bdf8;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sharp);
    font-size: 0.70rem;
    font-weight: 700;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.ig-caption-box {
    padding: 0 1rem 1rem 1rem;
    font-size: 0.83rem;
    color: #e5e5e5;
}

/* Checklists & Inputs */
.check-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(13, 17, 26, 0.8);
    padding: 0.80rem 1rem;
    border-radius: var(--radius-sharp);
    font-size: 0.83rem;
    border: 1px solid var(--card-border);
}

.code-textarea {
    width: 100%;
    height: 110px;
    background: #050811;
    color: #38bdf8;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sharp);
    padding: 0.8rem;
    font-family: 'Space Mono', monospace, sans-serif;
    font-size: 0.83rem;
    resize: none;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.code-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.terminal-box {
    background: #030509;
    border-radius: var(--radius-sharp);
    padding: 1.2rem;
    font-family: monospace;
    font-size: 0.83rem;
    line-height: 1.6;
    min-height: 250px;
    border: 1px solid var(--card-border);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.9);
}

.term-head { color: #818cf8; font-weight: 700; }
.term-pass { color: #34d399; }
.term-fail { color: #f87171; }

.custom-select {
    background: #0d111a;
    color: #fff;
    border: 1px solid var(--card-border);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sharp);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Master Portrait Frame - Sharp & Cyber */
.master-portrait-frame {
    max-width: 280px;
    margin: 0 auto;
    border-radius: var(--radius-sharp);
    padding: 3px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 0 25px var(--primary-glow);
}

.master-img {
    width: 100%;
    border-radius: var(--radius-sharp);
    display: block;
}

.traits-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.trait-tag {
    background: rgba(99, 102, 241, 0.12);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sharp);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Tab Switching */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1024px) {
    .content-split-layout { grid-template-columns: 1fr; }
    .sidebar { width: 100%; height: auto; position: relative; }
    .main-content { margin-left: 0; }
    .app-container { flex-direction: column; }
}


/* A.I.M.S. Editorial Calendar */
.calendar-hero,
.community-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin: 0 0 1.5rem;
    padding: 1.35rem 1.65rem;
    border-radius: var(--radius-card);
    background: var(--hero-bg-gradient);
    border: 1px solid var(--card-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    transition: background 0.4s ease, border-color 0.4s ease;
}

.eyebrow {
    color: #7dd3fc;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 800;
}

.calendar-hero h2,
.community-hero h2 {
    margin: 0.25rem 0 0.4rem;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: clamp(1.65rem, 3vw, 2.3rem);
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.calendar-hero p,
.community-hero p {
    max-width: 720px;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.55;
    margin: 0;
}

.calendar-actions,
.calendar-hero-actions,
.community-hero-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    flex: 0 0 auto;
    align-self: center;
}

.calendar-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.1rem;
}

.calendar-summary-card {
    min-height: 126px;
    padding: 1rem;
    background: linear-gradient(145deg, rgba(21, 29, 46, 0.92), rgba(13, 18, 30, 0.85));
    border: 1px solid var(--card-border);
    border-top-color: rgba(125, 211, 252, 0.32);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.summary-label {
    color: var(--text-muted);
    font-size: 0.71rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.calendar-summary-card strong {
    color: #f8fafc;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.9rem;
    line-height: 1;
}

.summary-detail {
    color: #6ee7b7;
    font-size: 0.76rem;
    font-weight: 600;
}

.summary-detail.muted { color: #94a3b8; }
.summary-detail.pinterest { color: #e2e8f0; }
.summary-detail.pinterest span { color: #64748b; margin: 0 0.25rem; }

.calendar-board { overflow: hidden; }
.calendar-board-header { align-items: center; }
.calendar-board-header h3 { margin-bottom: 0.2rem; }
.calendar-board-header p { color: var(--text-muted); font-size: 0.76rem; }

.calendar-legend {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.legend-dot {
    width: 7px;
    height: 7px;
    display: inline-block;
    margin-right: 0.3rem;
    border-radius: 50%;
}

.legend-dot.ready { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.6); }
.legend-dot.slot { background: #64748b; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(135px, 1fr));
    gap: 0.65rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.calendar-day {
    min-height: 192px;
    padding: 0.75rem;
    background: rgba(7, 11, 20, 0.62);
    border: 1px solid rgba(71, 85, 105, 0.46);
    transition: border-color 0.18s ease, background 0.18s ease;
}

.calendar-day.is-today {
    background:
        linear-gradient(145deg, rgba(14, 165, 233, 0.13), rgba(7, 11, 20, 0.72));
    border-color: rgba(125, 211, 252, 0.92);
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.2),
        0 10px 28px rgba(14, 165, 233, 0.12),
        inset 0 1px 0 rgba(224, 242, 254, 0.08);
}

.calendar-day.is-today .calendar-day-header { color: #bae6fd; }
.calendar-day.is-today .calendar-day-header strong { color: #f0f9ff; }

.calendar-day.drag-over {
    background: rgba(14, 165, 233, 0.1);
    border-color: #38bdf8;
}

.calendar-day-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.71rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}

.calendar-day-header strong { color: #e2e8f0; font-size: 1rem; }

.calendar-today-badge {
    margin-left: auto;
    padding: 0.16rem 0.36rem;
    color: #082f49;
    background: #7dd3fc;
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.32);
    font-size: 0.5rem;
    line-height: 1;
    letter-spacing: 0.07em;
}
.calendar-dropzone {
    min-height: 130px;
    display: grid;
    align-content: start;
    gap: 0.45rem;
}

.calendar-add-post {
    width: 1.75rem;
    height: 1.75rem;
    display: grid;
    place-items: center;
    justify-self: center;
    color: #7dd3fc;
    cursor: pointer;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.42);
    border-radius: 50%;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.calendar-add-post:hover,
.calendar-add-post:focus-visible {
    color: #e0f2fe;
    background: rgba(14, 165, 233, 0.18);
    border-color: rgba(125, 211, 252, 0.78);
    transform: scale(1.06);
}

.calendar-add-post:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.72);
    outline-offset: 2px;
}

.calendar-post {
    width: 100%;
    display: grid;
    gap: 0.3rem;
    padding: 0.62rem;
    text-align: left;
    color: #e2e8f0;
    cursor: grab;
    background: linear-gradient(145deg, rgba(22, 101, 85, 0.27), rgba(30, 41, 59, 0.82));
    border: 1px solid rgba(52, 211, 153, 0.42);
    border-left: 3px solid #34d399;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.calendar-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 22px rgba(15, 23, 42, 0.6);
}

.calendar-post.dragging { opacity: 0.45; }
.calendar-post-top, .calendar-post-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    color: #a7f3d0;
    font-size: 0.62rem;
    font-weight: 700;
}

.calendar-post strong { color: #f8fafc; font-size: 0.69rem; letter-spacing: 0.07em; }
.calendar-post-title { color: #cbd5e1; font-size: 0.72rem; line-height: 1.25; }
.calendar-post-footer { color: #94a3b8; font-size: 0.57rem; }
.calendar-post-footer span { margin-left: auto; color: #64748b; }

.status-tag {
    font-size: 0.52rem;
    letter-spacing: 0.08em;
    font-weight: 900;
}

.status-ready { color: #6ee7b7; }

.calendar-empty {
    width: 100%;
    min-height: 55px;
    display: grid;
    place-items: center;
    gap: 0.3rem;
    color: #64748b;
    background: rgba(15, 23, 42, 0.22);
    border: 1px dashed rgba(100, 116, 139, 0.48);
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.calendar-empty:hover {
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(56, 189, 248, 0.65);
}

.calendar-notice {
    display: flex;
    gap: 0.7rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    color: #94a3b8;
    background: rgba(14, 165, 233, 0.06);
    border-left: 2px solid #38bdf8;
    font-size: 0.77rem;
}

.calendar-notice i { color: #7dd3fc; margin-top: 0.1rem; }
.calendar-notice strong { color: #e2e8f0; }

@media (max-width: 1100px) {
    .calendar-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calendar-hero { align-items: start; flex-direction: column; }
}

@media (max-width: 640px) {
    .calendar-summary-grid { grid-template-columns: 1fr; }
    .calendar-actions { width: 100%; }
    .calendar-actions .btn { flex: 1; padding-inline: 0.6rem; }
}


/* Calendar editor */
.calendar-editor-modal[hidden] { display: none; }

.calendar-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.calendar-editor-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.78);
    backdrop-filter: blur(7px);
}

.calendar-editor-dialog {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: min(760px, calc(100vh - 2.5rem));
    overflow: auto;
    background: linear-gradient(145deg, #121a2b, #0b111d);
    border: 1px solid rgba(99, 102, 241, 0.62);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.56), 0 0 45px rgba(99, 102, 241, 0.13);
}

.calendar-editor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.3rem 1.4rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.32);
}

.calendar-editor-header h2 {
    margin-top: 0.35rem;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.45rem;
}

.icon-button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(100, 116, 139, 0.52);
    cursor: pointer;
}

.icon-button:hover { color: #f8fafc; border-color: #7dd3fc; }

.calendar-editor-form { padding: 1.35rem 1.4rem 1.4rem; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.form-field {
    display: grid;
    gap: 0.38rem;
    color: #cbd5e1;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.form-field-wide { grid-column: 1 / -1; }

.form-field input,
.form-field select {
    width: 100%;
    color: #e2e8f0;
    background: rgba(3, 7, 18, 0.56);
    border: 1px solid rgba(100, 116, 139, 0.56);
    border-radius: 0;
    padding: 0.7rem 0.75rem;
    font: 500 0.86rem 'Inter', sans-serif;
    outline: none;
}

.form-field select option { background: #0f172a; }
.form-field input:focus,
.form-field select:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12); }

.calendar-editor-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.4rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(100, 116, 139, 0.25);
}

.calendar-editor-footer-actions { display: flex; gap: 0.6rem; margin-left: auto; }
.btn-danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.6); background: rgba(127, 29, 29, 0.16); }
.btn-danger:hover { color: #fff; background: rgba(220, 38, 38, 0.38); }

.calendar-post.is-review {
    background: linear-gradient(145deg, rgba(180, 83, 9, 0.26), rgba(30, 41, 59, 0.82));
    border-color: rgba(251, 191, 36, 0.45);
    border-left-color: #fbbf24;
}

.calendar-post.is-draft {
    background: linear-gradient(145deg, rgba(71, 85, 105, 0.22), rgba(30, 41, 59, 0.82));
    border-color: rgba(148, 163, 184, 0.42);
    border-left-color: #94a3b8;
}

.status-review { color: #fde68a; }
.status-draft { color: #cbd5e1; }

@media (max-width: 560px) {
    .calendar-editor-modal { padding: 0.5rem; }
    .form-grid { grid-template-columns: 1fr; }
    .form-field-wide { grid-column: auto; }
    .calendar-editor-footer { flex-direction: column-reverse; }
    .calendar-editor-footer-actions { margin-left: 0; }
    .calendar-editor-footer .btn { flex: 1; }
}


/* Full monthly calendar */
.calendar-board-controls {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.calendar-nav-button {
    width: 30px;
    height: 30px;
    font-size: 0.72rem;
}

.calendar-month-picker {
    height: 30px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.55rem;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(100, 116, 139, 0.52);
}

.calendar-month-picker input {
    max-width: 112px;
    color: #e2e8f0;
    background: transparent;
    border: 0;
    font: 700 0.68rem 'Inter', sans-serif;
    outline: 0;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(135px, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.45rem;
    overflow-x: auto;
}

.calendar-weekdays span {
    min-width: 135px;
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    min-height: 152px;
}

.calendar-day-outside {
    background: rgba(2, 6, 14, 0.25);
    border-color: rgba(51, 65, 85, 0.22);
    pointer-events: none;
}

@media (max-width: 900px) {
    .calendar-board-header { align-items: flex-start; gap: 0.8rem; }
    .calendar-board-controls { flex-wrap: wrap; justify-content: flex-end; }
    .calendar-legend { width: 100%; justify-content: flex-end; }
}


/* Global choropleth KPI map */
.global-kpi-map {
    margin-top: 1.25rem;
    overflow: visible;
}

.global-map-header {
    align-items: end;
    gap: 1rem;
}

.global-map-header h3 { margin-bottom: 0.28rem; }
.global-map-header p { color: var(--text-muted); font-size: 0.78rem; }

.global-map-controls {
    display: grid;
    gap: 0.35rem;
    min-width: 190px;
}

.global-map-controls label {
    color: #94a3b8;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.global-map-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 1rem;
    color: #94a3b8;
    font-size: 0.72rem;
}

.global-map-status code {
    color: #c4b5fd;
    font: 600 0.7rem 'SFMono-Regular', Consolas, monospace;
}

.global-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 1rem;
    align-items: stretch;
}

.global-map-canvas {
    position: relative;
    min-height: 330px;
    overflow: hidden;
    background:
        radial-gradient(circle at 52% 28%, rgba(99, 102, 241, 0.16), transparent 44%),
        linear-gradient(145deg, rgba(7, 14, 28, 0.94), rgba(15, 23, 42, 0.86));
    border: 1px solid rgba(99, 102, 241, 0.28);
}

.global-map-canvas svg {
    display: block;
    width: 100%;
    height: auto;
}

.choropleth-graticule {
    fill: none;
    stroke: rgba(148, 163, 184, 0.22);
    stroke-width: 0.65;
}

.choropleth-feature {
    stroke: rgba(203, 213, 225, 0.3);
    stroke-width: 0.42;
    transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
    cursor: pointer;
    outline: none;
}

.choropleth-feature:hover,
.choropleth-feature:focus,
.choropleth-feature.is-selected {
    stroke: #e9d5ff;
    stroke-width: 1.1;
    filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.72));
}

.global-map-loading,
.global-map-error {
    min-height: 330px;
    display: grid;
    place-content: center;
    gap: 0.65rem;
    padding: 1.5rem;
    color: #94a3b8;
    text-align: center;
    font-size: 0.8rem;
}

.global-map-error i { color: #fbbf24; font-size: 1.3rem; }

.global-map-tooltip {
    position: absolute;
    z-index: 4;
    min-width: 174px;
    max-width: 200px;
    display: grid;
    gap: 0.2rem;
    padding: 0.64rem 0.72rem;
    color: #e2e8f0;
    background: rgba(8, 13, 25, 0.95);
    border: 1px solid rgba(192, 132, 252, 0.7);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.42);
    pointer-events: none;
}

.global-map-tooltip strong { font-size: 0.78rem; }
.global-map-tooltip span { color: #c4b5fd; font-size: 0.7rem; }

.global-map-insight {
    display: flex;
    flex-direction: column;
    min-height: 330px;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.56);
    border: 1px solid rgba(100, 116, 139, 0.44);
}

.global-map-insight h4 {
    margin: 0.35rem 0 0.42rem;
    color: #f8fafc;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.08rem;
    line-height: 1.15;
}

.global-map-insight > p:not(.global-map-hint) {
    color: #94a3b8;
    font-size: 0.75rem;
    line-height: 1.45;
}

.global-map-top-list {
    display: grid;
    gap: 0.42rem;
    margin-top: 1rem;
}

.global-market-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1.4rem 1fr auto;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem;
    color: #cbd5e1;
    text-align: left;
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid transparent;
    cursor: pointer;
}

.global-market-row:hover { border-color: rgba(125, 211, 252, 0.72); background: rgba(14, 165, 233, 0.1); }
.global-market-row > span { color: #64748b; font-size: 0.64rem; font-weight: 800; }
.global-market-row strong { font-size: 0.72rem; }
.global-market-row em { color: #c4b5fd; font-size: 0.69rem; font-style: normal; font-weight: 800; }

.global-map-hint {
    margin-top: auto;
    padding-top: 1rem;
    color: #64748b;
    font-size: 0.68rem;
    line-height: 1.35;
}

.choropleth-legend {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.8rem;
    color: #94a3b8;
    font-size: 0.65rem;
}

.choropleth-legend-scale {
    width: min(230px, 38vw);
    height: 7px;
    background: linear-gradient(90deg, #263246, #315b9c, #467cda, #7c5af8, #c084fc);
}

@media (max-width: 900px) {
    .global-map-header { align-items: flex-start; flex-direction: column; }
    .global-map-controls { width: 100%; }
    .global-map-layout { grid-template-columns: 1fr; }
    .global-map-insight { min-height: auto; }
    .global-map-hint { margin-top: 1rem; }
}

@media (max-width: 560px) {
    .global-map-canvas { min-height: 245px; }
    .global-map-loading, .global-map-error { min-height: 245px; }
    .choropleth-legend { align-items: flex-start; flex-wrap: wrap; }
    .choropleth-legend-scale { width: 100%; order: 3; }
}


/* Brushable device trend chart */
.device-trend-card { margin-top: 1.25rem; overflow: visible; }

.device-chart-header {
    align-items: center;
    gap: 1rem;
}

.device-chart-header h3 { margin-bottom: 0.28rem; }
.device-chart-header p { color: var(--text-muted); font-size: 0.78rem; }

.device-chart-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.device-chart-legend {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: #cbd5e1;
    font-size: 0.69rem;
    font-weight: 700;
}

.device-chart-legend span,
.device-chart-tooltip span {
    display: flex;
    align-items: center;
    gap: 0.38rem;
}

.device-chart-legend i,
.device-chart-tooltip i {
    width: 8px;
    height: 8px;
    display: inline-block;
    background: var(--series-color);
    border-radius: 50%;
    box-shadow: 0 0 8px color-mix(in srgb, var(--series-color) 65%, transparent);
}

.device-chart-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    color: #94a3b8;
    font-size: 0.72rem;
}

.device-chart-data-hook { margin-left: auto; }
.device-chart-data-hook code { color: #c4b5fd; font: 600 0.69rem 'SFMono-Regular', Consolas, monospace; }

.device-chart-canvas {
    position: relative;
    min-height: 360px;
    overflow: hidden;
    background:
        radial-gradient(circle at 38% 25%, rgba(124, 90, 248, 0.1), transparent 42%),
        linear-gradient(145deg, rgba(7, 14, 28, 0.94), rgba(15, 23, 42, 0.84));
    border: 1px solid rgba(99, 102, 241, 0.28);
}

.device-chart-canvas svg { display: block; width: 100%; height: auto; }

.device-chart-background { opacity: 0.85; }
.device-chart-grid .tick line { stroke: rgba(100, 116, 139, 0.22); }
.device-chart-y-axis text,
.device-chart-x-axis text { fill: #7c8aa3; font: 600 10px 'Inter', sans-serif; }
.device-chart-y-axis .domain,
.device-chart-x-axis .domain { stroke: rgba(100, 116, 139, 0.35); }
.device-chart-line { filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.18)); }

.device-chart-focus-line {
    stroke: rgba(226, 232, 240, 0.55);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.device-chart-focus circle {
    stroke: #f8fafc;
    stroke-width: 1.5;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.35));
}

.device-chart-overlay { cursor: crosshair; }

.device-chart-brush-background {
    fill: rgba(15, 23, 42, 0.72);
    stroke: rgba(100, 116, 139, 0.28);
}

.device-chart-brush .selection {
    fill: rgba(99, 102, 241, 0.16);
    stroke: #818cf8;
    stroke-width: 1.2;
}

.device-chart-brush .handle { fill: #a5b4fc; }
.device-chart-brush .overlay { cursor: crosshair; }

.device-chart-tooltip {
    position: absolute;
    z-index: 4;
    min-width: 178px;
    display: grid;
    gap: 0.38rem;
    padding: 0.7rem 0.76rem;
    color: #e2e8f0;
    background: rgba(8, 13, 25, 0.96);
    border: 1px solid rgba(125, 211, 252, 0.62);
    box-shadow: 0 12px 26px rgba(0,0,0,0.42);
    pointer-events: none;
}

.device-chart-tooltip strong {
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.32);
    font-size: 0.77rem;
}

.device-chart-tooltip span { color: #aebbd0; font-size: 0.68rem; }
.device-chart-tooltip em { margin-left: auto; color: #f8fafc; font-style: normal; font-weight: 800; }

.device-chart-loading,
.device-chart-error {
    min-height: 360px;
    display: grid;
    place-content: center;
    gap: 0.65rem;
    padding: 1.5rem;
    color: #94a3b8;
    text-align: center;
    font-size: 0.8rem;
}

.device-chart-error i { color: #fbbf24; }

.device-chart-brush-hint {
    margin-top: 0.65rem;
    color: #64748b;
    font-size: 0.68rem;
    text-align: center;
}

@media (max-width: 900px) {
    .device-chart-header { align-items: flex-start; flex-direction: column; }
    .device-chart-header-actions { width: 100%; justify-content: space-between; }
}

@media (max-width: 620px) {
    .device-chart-header-actions { align-items: flex-start; flex-direction: column; }
    .device-chart-legend { flex-wrap: wrap; }
    .device-chart-data-hook { width: 100%; margin-left: 0; }
    .device-chart-canvas { min-height: 260px; }
    .device-chart-loading, .device-chart-error { min-height: 260px; }
}


/* Refined fixed global footer */
.minimal-global-footer {
    width: 100%;
    height: 46px;
    position: fixed;
    inset: auto 0 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 clamp(1rem, 2.4vw, 2.5rem);
    color: #94a3b8;
    background:
        linear-gradient(90deg, rgba(12, 16, 27, 0.985), rgba(7, 10, 18, 0.985)),
        rgba(7, 9, 14, 0.98);
    border-top: 1px solid rgba(100, 116, 139, 0.32);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(18px);
}

.minimal-global-footer::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, rgba(99, 102, 241, 0.72) 32%, rgba(56, 189, 248, 0.56) 68%, transparent 95%);
    opacity: 0.62;
}

.minimal-footer-content {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.minimal-footer-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.minimal-footer-mark {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    display: grid;
    place-items: center;
    color: #f8fafc;
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.9), rgba(14, 165, 233, 0.68));
    border: 1px solid rgba(165, 180, 252, 0.48);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.18);
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
}

.minimal-footer-wordmark {
    min-width: 0;
    display: grid;
    gap: 0.04rem;
    line-height: 1;
}

.minimal-footer-wordmark strong {
    color: #e2e8f0;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.minimal-footer-wordmark small {
    color: #53627a;
    font-size: 0.52rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.minimal-footer-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
}

.minimal-footer-status {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    color: #8290a6;
    font-size: 0.62rem;
    font-weight: 600;
    white-space: nowrap;
}

.minimal-footer-status i {
    width: 6px;
    height: 6px;
    display: inline-block;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.09), 0 0 8px rgba(52, 211, 153, 0.45);
}

.minimal-footer-divider {
    width: 1px;
    height: 18px;
    background: rgba(100, 116, 139, 0.3);
}

.minimal-footer-copy {
    color: #64748b;
    font-size: 0.62rem;
    white-space: nowrap;
}

.minimal-footer-btn {
    height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.7rem;
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.46);
    border: 1px solid rgba(100, 116, 139, 0.42);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font: 700 0.64rem 'Inter', sans-serif;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.minimal-footer-btn > i:first-child { color: #7dd3fc; }

.minimal-footer-btn small {
    padding-left: 0.45rem;
    color: #7c8aa3;
    border-left: 1px solid rgba(100, 116, 139, 0.34);
    font-size: 0.53rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.minimal-footer-btn-arrow {
    color: #64748b;
    font-size: 0.52rem;
    transition: transform 0.18s ease;
}

.minimal-footer-btn:hover {
    color: #f8fafc;
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(125, 211, 252, 0.56);
    transform: translateY(-1px);
}

.minimal-footer-btn:hover .minimal-footer-btn-arrow {
    color: #7dd3fc;
    transform: translateX(2px);
}

.minimal-footer-btn:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 2px;
}

@media (max-width: 760px) {
    .minimal-footer-wordmark small,
    .minimal-footer-status,
    .minimal-footer-divider {
        display: none;
    }
}

@media (max-width: 520px) {
    .minimal-global-footer { padding-inline: 0.7rem; }
    .minimal-footer-content { gap: 0.55rem; }
    .minimal-footer-meta { gap: 0.5rem; }
    .minimal-footer-copy { display: none; }
    .minimal-footer-btn small { display: none; }
}

/* Polished, high-clarity imprint dialog */
.imprint-modal-dialog {
    width: min(840px, calc(100vw - 2rem));
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    background: linear-gradient(155deg, rgba(13, 17, 28, 0.98), rgba(9, 13, 22, 0.99));
    border: 1px solid rgba(82, 199, 255, 0.35);
    border-top: 3px solid #52c7ff;
    border-radius: 8px;
    box-shadow: 0 28px 85px rgba(0, 0, 0, 0.72), 0 0 40px rgba(82, 199, 255, 0.15);
    backdrop-filter: blur(24px);
}

.imprint-modal-header {
    padding: 1.2rem 1.5rem;
    background: rgba(15, 22, 38, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.imprint-modal-header h2 {
    margin-top: 0.3rem;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.2rem, 2.2vw, 1.45rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.imprint-modal-body {
    padding: 1.25rem 1.5rem 1rem;
    color: var(--text-main);
    font-size: 0.82rem;
    line-height: 1.5;
}

.imprint-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.imprint-info-card,
.imprint-ai-card {
    min-width: 0;
    background: linear-gradient(135deg, rgba(20, 28, 46, 0.8), rgba(13, 18, 32, 0.85));
    border: 1px solid rgba(139, 140, 255, 0.28);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.imprint-info-card:hover,
.imprint-ai-card:hover {
    border-color: rgba(82, 199, 255, 0.5);
}

.imprint-info-card {
    padding: 1.1rem 1.2rem;
}

.imprint-info-card h4,
.imprint-ai-card h4 {
    margin-bottom: 0.85rem;
    color: #ffffff;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.imprint-info-card dl {
    display: grid;
    gap: 0.65rem;
    margin: 0;
}

.imprint-info-card dl div {
    display: grid;
    gap: 0.12rem;
}

.imprint-info-card dt {
    color: #52c7ff;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.imprint-info-card dd {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.4;
}

.imprint-info-card dd small {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 400;
}

.imprint-ai-card {
    margin-top: 1rem;
    padding: 1.1rem 1.2rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.07), rgba(9, 13, 22, 0.9));
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.imprint-ai-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.imprint-ai-card header h4 { margin-bottom: 0; }

.imprint-ai-card header > span {
    padding: 0.25rem 0.65rem;
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.4);
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.imprint-ai-card > p {
    margin-top: 0.7rem;
    color: #cbd5e1;
    font-size: 0.82rem;
    line-height: 1.5;
}

.imprint-disclosure-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 0.75rem;
    margin-top: 0.85rem;
}

.imprint-disclosure-list > div {
    display: contents;
}

.imprint-disclosure-list span {
    align-self: center;
    color: #38bdf8;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.imprint-disclosure-list code {
    min-width: 0;
    color: #7dd3fc;
    background: rgba(6, 10, 18, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.22);
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font: 600 0.72rem/1.4 'SFMono-Regular', Consolas, monospace;
    overflow-wrap: anywhere;
}

.imprint-legal-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    background: rgba(56, 189, 248, 0.05);
    border: 1px dashed rgba(56, 189, 248, 0.25);
    border-radius: 10px;
    font-size: 0.78rem;
    text-align: center;
}

.imprint-modal-footer {
    min-height: auto;
    justify-content: flex-end;
    padding: 0.9rem 1.5rem;
    background: rgba(10, 15, 26, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 680px) {
    .imprint-modal-dialog { width: min(100vw - 1rem, 840px); }
    .imprint-modal-header,
    .imprint-modal-body,
    .imprint-modal-footer { padding-inline: 1rem; }
    .imprint-grid { grid-template-columns: 1fr; }
    .imprint-ai-card { margin-top: 0.8rem; }
    .imprint-legal-note { align-items: flex-start; text-align: left; flex-direction: column; }
    .imprint-disclosure-list { grid-template-columns: 1fr; }
}

@media (max-height: 720px) and (min-width: 621px) {
    .imprint-modal-dialog {
        transform: scale(0.9);
        transform-origin: center;
    }
}

/* Live KPI overview and content funnel */
.analytics-live { overflow: hidden; }

.analytics-live-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1.5rem;
    padding: 1.3rem 1.5rem 1rem;
    background:
        radial-gradient(circle at 15% 0%, rgba(14, 165, 233, 0.1), transparent 35%),
        rgba(15, 23, 42, 0.34);
}

.analytics-live-header h3 {
    margin: 0.32rem 0 0.25rem;
    color: #f8fafc;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.analytics-live-header p {
    color: #8290a6;
    font-size: 0.76rem;
}

.analytics-period-control {
    display: grid;
    gap: 0.38rem;
    justify-items: end;
}

.analytics-period-control > span {
    color: #64748b;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.analytics-period-filter {
    display: inline-flex;
    padding: 0.22rem;
    background: rgba(3, 7, 18, 0.54);
    border: 1px solid rgba(100, 116, 139, 0.34);
}

.analytics-period-filter button {
    min-height: 30px;
    padding: 0 0.72rem;
    color: #718096;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: 700 0.64rem 'Inter', sans-serif;
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.analytics-period-filter button:hover { color: #cbd5e1; }

.analytics-period-filter button.is-active {
    color: #f8fafc;
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.62), rgba(14, 165, 233, 0.34));
    box-shadow: 0 5px 14px rgba(79, 70, 229, 0.16);
}

.analytics-period-filter button:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 1px;
}

.analytics-live-summary {
    min-height: 45px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1.5rem;
    background: rgba(3, 7, 18, 0.28);
    border-top: 1px solid rgba(100, 116, 139, 0.2);
    border-bottom: 1px solid rgba(100, 116, 139, 0.24);
}

.analytics-live-summary > div {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
}

.analytics-live-summary > div span {
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.analytics-live-summary > div strong {
    color: #fde68a;
    font-size: 0.74rem;
}

.analytics-live-summary > div strong[data-tone="go"] { color: #6ee7b7; }

.analytics-live-summary p {
    margin-left: auto;
    color: #64748b;
    font-size: 0.63rem;
}

.analytics-live-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    padding: 1rem;
}

.analytics-live-loading {
    grid-column: 1 / -1;
    min-height: 150px;
    display: grid;
    place-content: center;
    gap: 0.5rem;
    color: #64748b;
    text-align: center;
}

.analytics-live-card {
    min-width: 0;
    padding: 0.95rem;
    background: linear-gradient(145deg, rgba(14, 20, 33, 0.96), rgba(7, 12, 22, 0.94));
    border: 1px solid rgba(100, 116, 139, 0.32);
    border-top: 2px solid rgba(251, 191, 36, 0.7);
}

.analytics-live-card[data-tone="go"] { border-top-color: rgba(52, 211, 153, 0.78); }
.analytics-live-card[data-tone="stop"] { border-top-color: rgba(251, 113, 133, 0.78); }

.analytics-live-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin-bottom: 0.8rem;
}

.analytics-live-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.analytics-live-status {
    color: #fde68a;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.analytics-live-card[data-tone="go"] .analytics-live-status { color: #6ee7b7; }
.analytics-live-card[data-tone="stop"] .analytics-live-status { color: #fda4af; }

.analytics-live-label {
    display: block;
    color: #8290a6;
    font-size: 0.66rem;
    font-weight: 700;
}

.analytics-live-value-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 0.28rem 0 0.75rem;
}

.analytics-live-value-row > strong {
    color: #f8fafc;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: clamp(1.35rem, 2.1vw, 1.7rem);
}

.analytics-live-delta {
    color: #6ee7b7;
    font-size: 0.58rem;
    font-weight: 800;
    white-space: nowrap;
}

.analytics-live-delta.is-down { color: #fda4af; }

.analytics-live-target {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.56rem;
}

.analytics-live-target strong {
    color: #94a3b8;
    font-size: 0.58rem;
    text-align: right;
}

.analytics-live-progress {
    height: 4px;
    margin-top: 0.55rem;
    overflow: hidden;
    background: rgba(51, 65, 85, 0.48);
}

.analytics-live-progress i {
    height: 100%;
    display: block;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.analytics-live-card[data-tone="go"] .analytics-live-progress i {
    background: linear-gradient(90deg, #059669, #34d399);
}

.content-funnel { overflow: hidden; }

.content-funnel-header {
    align-items: center;
    gap: 1rem;
}

.content-funnel-header h3 { margin-bottom: 0.25rem; }
.content-funnel-header p { color: #8290a6; font-size: 0.72rem; }

.content-funnel-period {
    padding: 0.35rem 0.55rem;
    color: #c4b5fd;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(129, 140, 248, 0.24);
    font-size: 0.6rem;
    font-weight: 800;
    white-space: nowrap;
}

.content-funnel-body {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(230px, 0.65fr);
    gap: 1rem;
    align-items: stretch;
}

.content-funnel-visual {
    min-height: 250px;
    display: grid;
    align-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(3, 7, 18, 0.32);
    border: 1px solid rgba(100, 116, 139, 0.28);
}

.content-funnel-stage {
    width: max(var(--funnel-width), 34%);
    min-width: 190px;
    margin-inline: auto;
    padding: 0.55rem 0.72rem;
    color: #cbd5e1;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.18), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(129, 140, 248, 0.3);
    transition: width 0.24s ease, border-color 0.18s ease;
}

.content-funnel-stage:hover { border-color: rgba(125, 211, 252, 0.58); }

.content-funnel-stage > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.content-funnel-stage span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
}

.content-funnel-stage span i { width: 14px; color: #7dd3fc; }

.content-funnel-stage strong {
    color: #f8fafc;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.86rem;
}

.content-funnel-stage small {
    display: block;
    margin-top: 0.18rem;
    color: #64748b;
    font-size: 0.55rem;
}

.content-funnel-insight {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.1rem;
    background: linear-gradient(145deg, rgba(16, 24, 40, 0.94), rgba(7, 12, 22, 0.94));
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.content-funnel-insight > strong {
    margin: 0.55rem 0 0.2rem;
    color: #f8fafc;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 2rem;
}

.content-funnel-insight > p {
    color: #8290a6;
    font-size: 0.69rem;
    line-height: 1.5;
}

.content-funnel-bottleneck {
    display: grid;
    gap: 0.28rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(100, 116, 139, 0.28);
}

.content-funnel-bottleneck span {
    color: #64748b;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.content-funnel-bottleneck strong {
    color: #fde68a;
    font-size: 0.7rem;
}

@media (max-width: 1100px) {
    .analytics-live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
    .analytics-live-header { grid-template-columns: 1fr; align-items: start; }
    .analytics-period-control { justify-items: start; }
    .analytics-live-summary { align-items: flex-start; flex-wrap: wrap; }
    .analytics-live-summary p { width: 100%; margin-left: 0; order: 3; }
    .content-funnel-body { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .analytics-live-header { padding: 1.1rem; }
    .analytics-period-filter { width: 100%; }
    .analytics-period-filter button { flex: 1; }
    .analytics-live-summary { padding-inline: 1.1rem; }
    .analytics-live-grid { grid-template-columns: 1fr; padding: 0.7rem; }
    .content-funnel-stage { min-width: 0; width: 100%; }
}

/* KPI pilot decision system */
.kpi-goals { overflow: hidden; }

.kpi-goals-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2rem;
    align-items: center;
    padding: 1.35rem 1.5rem;
    background:
        radial-gradient(circle at 12% 0%, rgba(99, 102, 241, 0.14), transparent 38%),
        rgba(15, 23, 42, 0.38);
    border-bottom: 1px solid rgba(100, 116, 139, 0.3);
}

.kpi-goals-header h3 {
    margin: 0.35rem 0 0.35rem;
    color: #f8fafc;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.kpi-goals-header p {
    max-width: 720px;
    color: #8d9ab0;
    font-size: 0.82rem;
    line-height: 1.55;
}

.kpi-success-rule {
    min-width: 176px;
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    text-align: center;
    background: linear-gradient(145deg, rgba(6, 78, 59, 0.46), rgba(15, 23, 42, 0.72));
    border: 1px solid rgba(52, 211, 153, 0.4);
    box-shadow: 0 12px 30px rgba(5, 150, 105, 0.09);
}

.kpi-success-rule span {
    color: #6ee7b7;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.kpi-success-rule strong {
    color: #ecfdf5;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.65rem;
    line-height: 1;
}

.kpi-success-rule small {
    color: #94a3b8;
    font-size: 0.62rem;
}

.kpi-decision-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    padding: 0.75rem 1.5rem;
    color: #7c8aa3;
    background: rgba(4, 8, 16, 0.34);
    border-bottom: 1px solid rgba(100, 116, 139, 0.22);
    font-size: 0.65rem;
}

.kpi-decision-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.kpi-decision-legend i {
    width: 7px;
    height: 7px;
    display: inline-block;
    border-radius: 50%;
}

.kpi-decision-legend strong { color: #cbd5e1; }
.kpi-decision-legend .is-stop i { background: #fb7185; box-shadow: 0 0 8px rgba(251, 113, 133, 0.45); }
.kpi-decision-legend .is-optimize i { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.4); }
.kpi-decision-legend .is-go i { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.45); }

.kpi-targets-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    padding: 1rem;
}

.kpi-target-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 1.1rem;
    background: linear-gradient(145deg, rgba(14, 20, 33, 0.96), rgba(8, 13, 23, 0.94));
    border: 1px solid rgba(100, 116, 139, 0.34);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-target-card:hover {
    transform: translateY(-2px);
    border-color: rgba(129, 140, 248, 0.52);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.kpi-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.kpi-sequence {
    color: #cbd5e1;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.kpi-sequence code {
    margin-left: 0.35rem;
    padding: 0.16rem 0.34rem;
    color: #818cf8;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.22);
    font: 700 0.58rem 'SFMono-Regular', Consolas, monospace;
    letter-spacing: 0.04em;
}

.kpi-priority {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.27rem 0.48rem;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.kpi-priority.is-core {
    color: #fda4af;
    background: rgba(190, 24, 93, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.kpi-priority.is-support {
    color: #fde68a;
    background: rgba(180, 83, 9, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.kpi-target-card > h4 {
    margin-bottom: 0.28rem;
    color: #f8fafc;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.02rem;
}

.kpi-explanation {
    min-height: 2.5em;
    color: #7c8aa3;
    font-size: 0.72rem;
    line-height: 1.45;
}

.kpi-primary-goal {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.9rem 0 0.65rem;
    padding: 0.75rem 0.85rem;
    background: rgba(6, 78, 59, 0.18);
    border-left: 3px solid #34d399;
}

.kpi-primary-goal span {
    color: #6ee7b7;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.kpi-primary-goal strong {
    color: #ecfdf5;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.15rem;
}

.kpi-timeframe {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.85rem;
    color: #8997ad;
    font-size: 0.67rem;
}

.kpi-timeframe i { color: #7dd3fc; }

.kpi-thresholds {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: auto;
    border: 1px solid rgba(100, 116, 139, 0.28);
}

.kpi-thresholds > div {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
    padding: 0.62rem 0.68rem;
    background: rgba(15, 23, 42, 0.44);
}

.kpi-thresholds > div + div { border-left: 1px solid rgba(100, 116, 139, 0.24); }

.kpi-thresholds span {
    color: #64748b;
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.kpi-thresholds strong {
    color: #cbd5e1;
    font-size: 0.72rem;
}

.kpi-thresholds .is-stop { border-top: 2px solid rgba(251, 113, 133, 0.68); }
.kpi-thresholds .is-optimize { border-top: 2px solid rgba(251, 191, 36, 0.68); }
.kpi-thresholds .is-go { border-top: 2px solid rgba(52, 211, 153, 0.72); }
.kpi-thresholds .is-stop strong { color: #fda4af; }
.kpi-thresholds .is-optimize strong { color: #fde68a; }
.kpi-thresholds .is-go strong { color: #6ee7b7; }

@media (max-width: 900px) {
    .kpi-goals-header { grid-template-columns: 1fr; gap: 1rem; }
    .kpi-success-rule { width: min(100%, 240px); text-align: left; }
    .kpi-targets-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .kpi-goals-header { padding: 1.1rem; }
    .kpi-decision-legend { align-items: flex-start; flex-direction: column; padding-inline: 1.1rem; }
    .kpi-targets-grid { padding: 0.7rem; }
    .kpi-card-top { align-items: flex-start; }
    .kpi-priority { white-space: nowrap; }
    .kpi-primary-goal { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
    .kpi-thresholds { grid-template-columns: 1fr; }
    .kpi-thresholds > div + div { border-top: 1px solid rgba(100, 116, 139, 0.24); border-left: 0; }
}


/* Unified sidebar navigation refinement */
.nav-menu {
    position: relative;
    gap: 0.125rem;
    margin: 0 -0.35rem;
    padding: 0.35rem;
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 0.9rem;
    background: rgba(8, 12, 24, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.nav-item {
    grid-template-columns: 1.5rem minmax(0, 1fr);
    gap: 0.7rem;
    min-height: 2.85rem;
    padding: 0.62rem 0.75rem;
    border: 0;
    border-radius: 0.65rem;
    color: #8e9ab2;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0;
    background: transparent;
    box-shadow: none;
}

.nav-item::before {
    top: 0.65rem;
    bottom: 0.65rem;
    left: 0;
    width: 2px;
}

.nav-item i {
    width: 1.5rem;
    font-size: 0.92rem;
}

.nav-item:hover {
    color: #e9edff;
    background: rgba(255, 255, 255, 0.045);
}

.nav-item.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(109, 105, 255, 0.22), rgba(83, 197, 255, 0.07));
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.nav-item.active i {
    color: #b9c8ff;
}

.nav-item span {
    overflow-wrap: normal;
    word-break: normal;
}


/* Compact engine diagnostics in the application header */
.header-right-col { position: relative; }
.engine-status-control { position: relative; }
.engine-status-trigger {
    min-height: 2.85rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.48rem 0.68rem;
    color: #e2e8f0;
    cursor: pointer;
    background: rgba(12, 18, 31, 0.82);
    border: 1px solid rgba(100, 116, 139, 0.38);
    border-radius: 0.7rem;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.engine-status-trigger:hover,
.engine-status-trigger:focus-visible,
.engine-status-control.is-open .engine-status-trigger {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(125, 211, 252, 0.58);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.28);
}
.engine-status-trigger:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.72);
    outline-offset: 2px;
}
.engine-status-copy { min-width: 8.7rem; display: grid; gap: 0.1rem; text-align: left; }
.engine-status-copy strong { font-size: 0.72rem; line-height: 1.2; }
.engine-status-copy small { color: #7c8aa3; font-size: 0.58rem; white-space: nowrap; }
.engine-status-alert {
    padding: 0.26rem 0.42rem;
    color: #fde68a;
    background: rgba(180, 83, 9, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.32);
    border-radius: 999px;
    font-size: 0.56rem;
    font-weight: 800;
    white-space: nowrap;
}
.engine-status-chevron { color: #64748b; font-size: 0.65rem; transition: transform 0.18s ease; }
.engine-status-control.is-open .engine-status-chevron { transform: rotate(180deg); }
.engine-status-popover {
    width: min(28rem, calc(100vw - 2rem));
    position: absolute;
    z-index: 80;
    top: calc(100% + 0.65rem);
    right: 0;
    padding: 1rem;
    color: #cbd5e1;
    background: rgba(7, 12, 22, 0.98);
    border: 1px solid rgba(100, 116, 139, 0.42);
    border-radius: 0.85rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(18px);
}
.engine-status-popover[hidden] { display: none; }
.engine-popover-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.engine-popover-eyebrow { color: #7dd3fc; font-size: 0.55rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.engine-popover-header h2 { margin-top: 0.18rem; color: #f8fafc; font-size: 1rem; }
.engine-health-badge { display: inline-flex; align-items: center; gap: 0.32rem; color: #6ee7b7; font-size: 0.62rem; font-weight: 800; }
.engine-popover-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0.9rem 0; }
.engine-popover-summary > div { display: grid; gap: 0.2rem; padding: 0.62rem; background: rgba(15, 23, 42, 0.7); border: 1px solid rgba(100, 116, 139, 0.24); }
.engine-popover-summary span { color: #64748b; font-size: 0.54rem; text-transform: uppercase; }
.engine-popover-summary strong { font-size: 0.7rem; }
.engine-issue-list { display: grid; gap: 0.4rem; }
.engine-issue-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.7rem; background: rgba(120, 53, 15, 0.1); border-left: 2px solid #f59e0b; font-size: 0.64rem; }
.engine-issue-list small { color: #fcd34d; white-space: nowrap; }
.engine-log-details { margin-top: 0.75rem; border-top: 1px solid rgba(100, 116, 139, 0.24); }
.engine-log-details summary { padding: 0.72rem 0; color: #94a3b8; cursor: pointer; font-size: 0.64rem; font-weight: 700; list-style: none; }
.engine-log-details summary::-webkit-details-marker { display: none; }
.engine-log-details summary i { margin-right: 0.4rem; color: #7dd3fc; }
.engine-log {
    max-height: 12rem;
    overflow: auto;
    padding: 0.75rem;
    font: 0.58rem/1.55 'SFMono-Regular', Consolas, monospace;
    background: #030509;
    border: 1px solid rgba(100, 116, 139, 0.26);
}
.engine-run-button { width: 100%; justify-content: center; margin-top: 0.8rem; }

@media (max-width: 720px) {
    .engine-status-copy small,
    .engine-status-alert { display: none; }
    .engine-status-copy { min-width: 0; }
    .engine-status-popover { position: fixed; top: 4.75rem; right: 1rem; left: 1rem; width: auto; }
}


/* Social account management mockup */
.social-accounts-entry {
    width: calc(100% - 1.5rem);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    margin: auto 0.75rem 1rem;
    padding: 0.72rem;
    color: #e2e8f0;
    cursor: pointer;
    text-align: left;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(100, 116, 139, 0.32);
    border-radius: 0.8rem;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.social-accounts-entry:hover,
.social-accounts-entry:focus-visible {
    background: rgba(30, 41, 59, 0.88);
    border-color: rgba(125, 211, 252, 0.62);
    transform: translateY(-1px);
}
.social-accounts-entry:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 2px; }
.social-accounts-entry .avatar-ring { width: 2.65rem; height: 2.65rem; }
.social-accounts-entry .avatar-ring img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.social-accounts-entry-copy { min-width: 0; display: grid; gap: 0.28rem; }
.social-accounts-entry-copy strong { overflow: hidden; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.social-accounts-entry-copy small { display: flex; align-items: center; gap: 0.35rem; color: #94a3b8; font-size: 0.58rem; }
.social-accounts-entry > i { color: #64748b; font-size: 0.68rem; }
.social-accounts-dialog {
    width: min(46rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}
.social-accounts-dialog .calendar-editor-header { padding: 1.25rem; }
.social-accounts-dialog .calendar-editor-header p { max-width: 35rem; margin-top: 0.5rem; color: #94a3b8; font-size: 0.72rem; }
.social-accounts-body { display: grid; gap: 1rem; padding: 1rem 1.25rem; }
.social-accounts-notice { display: flex; align-items: flex-start; gap: 0.65rem; margin: 0; padding: 0.8rem; color: #bae6fd; background: rgba(14,165,233,.08); border: 1px solid rgba(56,189,248,.25); font-size: 0.68rem; line-height: 1.45; }
.social-account-list { display: grid; gap: 0.75rem; }
.social-account-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 1rem; padding: 1rem; background: rgba(15,23,42,.62); border: 1px solid rgba(100,116,139,.28); border-radius: 6px; }
.social-platform-icon { width: 2.45rem; height: 2.45rem; display: grid; place-items: center; color: #fff; background: var(--platform-color); border-radius: 6px; font-size: 1.15rem; }
.social-account-copy { min-width: 0; display: grid; gap: 0.2rem; }
.social-account-copy strong { color: #f8fafc; font-size: 0.78rem; }
.social-account-copy small { color: #7c8aa3; font-size: 0.62rem; }
.social-account-actions { display: flex; align-items: center; gap: 0.45rem; }
.social-connection-status { display: inline-flex; align-items: center; gap: 0.32rem; color: #6ee7b7; font-size: 0.6rem; font-weight: 700; }
.social-connection-status.offline { color: #94a3b8; }
.social-account-action { min-height: 2.25rem; padding: 0.45rem 0.62rem; color: #cbd5e1; cursor: pointer; background: transparent; border: 1px solid rgba(100,116,139,.42); border-radius: 4px; font-size: 0.62rem; font-weight: 700; }
.social-account-action.primary { color: #e0f2fe; background: rgba(14,165,233,.13); border-color: rgba(56,189,248,.48); }
.social-account-action:hover, .social-account-action:focus-visible { border-color: #7dd3fc; }
.social-account-action:focus-visible { outline: 2px solid rgba(125,211,252,.7); outline-offset: 2px; }
.social-accounts-footer {
    align-items: center;
    gap: 1rem;
    margin-top: 0;
    padding: 1rem 1.25rem;
}
.social-accounts-footer > span { color: #64748b; font-size: 0.62rem; }
@media (max-width: 620px) {
    .social-account-row { grid-template-columns: auto minmax(0,1fr); }
    .social-account-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .social-accounts-footer { align-items: flex-start; gap: 0.75rem; }
}


/* UI/UX polish — consistent rhythm, touch targets and responsive app navigation */
:where(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid #7dd3fc; outline-offset: 3px; }
.btn, .icon-button, .nav-item, .command-search-trigger, .social-account-action { min-height: 2.75rem; }
.command-search-trigger { width: 100%; text-align: left; }
.glass-card, .calendar-summary-card, .stat-card { border-radius: var(--radius-card); }
.card-header { gap: 1rem; }
.card-body { padding: 0; }
.tab-panel.active { animation-duration: 0.22s; }
.calendar-empty { min-height: 2.75rem; }
.calendar-add-post { width: 2.75rem; height: 2.75rem; }
.social-accounts-notice, .engine-issue-list > div { border-radius: 4px; }
.social-account-row { min-height: 5.25rem; }
.social-account-action { padding-inline: 0.85rem; }
#toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    max-width: 460px;
    width: calc(100vw - 2.5rem);
}

.toast-item {
    pointer-events: auto;
    backdrop-filter: blur(16px);
    border-radius: var(--radius-sharp);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
    border: 1px solid var(--card-border-glow);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(35px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}


@media (max-width: 1024px) {
    .app-container { display: block; }
    .sidebar {
        width: 100%; height: auto; position: sticky; inset: 0 0 auto; z-index: 110;
        display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
        gap: 1rem; padding: 0.75rem 1rem; background: rgba(7, 11, 20, 0.96);
        border-right: 0; border-bottom: 1px solid var(--card-border);
        box-shadow: 0 12px 30px rgba(0,0,0,.28); backdrop-filter: blur(18px);
    }
    .brand { margin: 0; }
    .brand-wordmark span { display: none; }
    .nav-menu { min-width: 0; display: flex; gap: 0.35rem; overflow-x: auto; padding: 0.2rem; scrollbar-width: none; }
    .nav-menu::-webkit-scrollbar { display: none; }
    .nav-item { flex: 0 0 auto; margin: 0; padding: 0.65rem 0.8rem; white-space: nowrap; }
    .social-accounts-entry { width: auto; min-width: 12rem; margin: 0; padding: 0.55rem 0.7rem; }
    .social-accounts-entry .avatar-ring { width: 2.2rem; height: 2.2rem; }
    .main-content { max-width: none; margin-left: 0; padding: 1.5rem 1.25rem 4rem; }
    .top-navbar { flex-wrap: wrap; align-items: flex-start; }
    .header-left-col { flex: 1 1 18rem; }
    .header-center-col { order: 3; flex: 1 0 100%; max-width: none; }
    .calendar-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calendar-board .card-body { overflow-x: auto; }
    .calendar-weekdays, .calendar-grid { min-width: 760px; }
}
@media (max-width: 700px) {
    .sidebar { grid-template-columns: minmax(0, 1fr) auto; gap: 0.65rem; padding: 0.65rem 0.75rem; }
    .brand-wordmark { display: none; }
    .nav-menu { grid-column: 1 / -1; grid-row: 2; margin: 0 -0.15rem; }
    .nav-item { min-height: 2.6rem; padding: 0.55rem 0.7rem; }
    .nav-item span { font-size: 0.72rem; }
    .social-accounts-entry { min-width: 0; }
    .social-accounts-entry-copy strong { display: none; }
    .social-accounts-entry-copy small { white-space: nowrap; }
    .main-content { padding: 1rem 0.75rem 3rem; }
    .top-navbar { gap: 0.85rem; margin-bottom: 1rem; padding-bottom: 1rem; }
    .top-navbar h1 { font-size: 1.45rem; }
    .subtitle { margin-top: 0.25rem; font-size: 0.78rem; line-height: 1.45; }
    .header-right-col { margin-left: auto; }
    .engine-status-trigger { min-height: 2.75rem; }
    .calendar-hero { align-items: flex-start; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
    .calendar-hero p { font-size: 0.84rem; line-height: 1.55; }
    .calendar-actions { width: 100%; }
    .calendar-actions .btn { flex: 1; justify-content: center; }
    .calendar-summary-grid { grid-template-columns: 1fr; gap: 0.65rem; }
    .calendar-summary-card { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 0.3rem 1rem; padding: 0.85rem 1rem; }
    .calendar-summary-card strong { grid-column: 2; grid-row: 1 / span 2; font-size: 1.55rem; }
    .summary-detail { font-size: 0.7rem; }
    .calendar-board-header { align-items: stretch; flex-direction: column; }
    .calendar-board-controls { justify-content: space-between; }
    .calendar-legend { justify-content: flex-start; }
    .social-accounts-dialog { width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); }
    .social-account-row { align-items: start; gap: 0.75rem; padding: 0.85rem; }
    .social-account-actions { justify-content: stretch; }
    .social-account-action { flex: 1; }
    .engine-popover-summary { grid-template-columns: 1fr; }
    .engine-issue-list > div { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
}
@media (prefers-reduced-motion: reduce) { .tab-panel.active, .pulse-green-dot, .status-dot { animation: none !important; } }

/* Community inbox */
.nav-item[data-tab="community"]{display:flex;align-items:center;flex-wrap:nowrap}.nav-item[data-tab="community"]>span:not(.nav-count){flex:0 1 auto}.nav-count{min-width:1.3rem;height:1.3rem;display:inline-grid;flex:0 0 auto;place-items:center;margin-left:.4rem;padding:0 .32rem;color:#07111d;background:#67e8f9;border-radius:99px;font-size:.58rem;font-weight:800}
.demo-label{display:inline-flex;align-items:center;gap:.45rem;padding:.5rem .7rem;color:#bae6fd;background:rgba(14,165,233,.09);border:1px solid rgba(56,189,248,.25);border-radius:.55rem;font-size:.64rem;font-weight:700;white-space:nowrap}
.community-toolbar{display:flex;align-items:center;gap:.55rem;margin-bottom:1rem;padding:.75rem}.community-search{min-width:14rem;flex:1;display:flex;align-items:center;gap:.6rem;padding:0 .8rem;color:#64748b;background:rgba(15,23,42,.7);border:1px solid rgba(100,116,139,.35);border-radius:.65rem}.community-search input{width:100%;min-height:2.75rem;color:#e2e8f0;background:transparent;border:0;outline:0}
.community-filter,.community-toolbar select{min-height:2.75rem;padding:.55rem .75rem;color:#94a3b8;cursor:pointer;background:#0f172a;border:1px solid rgba(100,116,139,.3);border-radius:.58rem;font-size:.67rem;font-weight:700}.community-filter.is-active{color:#e0f2fe;background:rgba(14,165,233,.14);border-color:rgba(56,189,248,.48)}
.community-layout{min-height:34rem;display:grid;grid-template-columns:minmax(18rem,.85fr) minmax(24rem,1.4fr);gap:1rem}.community-inbox,.community-conversation{min-width:0;overflow:hidden}.community-panel-header,.conversation-header{display:flex;align-items:center;gap:.75rem;padding:1rem;border-bottom:1px solid rgba(100,116,139,.22)}.community-panel-header h3{margin:0;font-size:.85rem}.community-panel-header p{margin:.2rem 0 0;color:#64748b;font-size:.62rem}
.community-list{max-height:39rem;overflow-y:auto}.community-item{width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:.75rem;padding:.9rem 1rem;color:inherit;cursor:pointer;text-align:left;background:transparent;border:0;border-bottom:1px solid rgba(100,116,139,.16)}.community-item:hover,.community-item.is-active{background:rgba(14,165,233,.07)}.community-item.is-active{box-shadow:inset 3px 0 #38bdf8}
.community-avatar{width:2.35rem;height:2.35rem;display:grid;place-items:center;color:#e0f2fe;background:linear-gradient(135deg,rgba(99,102,241,.45),rgba(14,165,233,.36));border:1px solid rgba(125,211,252,.25);border-radius:50%;font-size:.62rem;font-weight:800}.community-item-main{min-width:0;display:grid;gap:.24rem}.community-item-line{display:flex;justify-content:space-between;gap:.5rem}.community-item-line strong{overflow:hidden;color:#e2e8f0;font-size:.7rem;text-overflow:ellipsis;white-space:nowrap}.community-item-line small,.community-item-meta{color:#64748b;font-size:.57rem}.community-item-meta{display:flex;align-items:center;gap:.32rem}.community-item-message{overflow:hidden;color:#94a3b8;font-size:.64rem;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.community-unread-dot{width:.48rem;height:.48rem;margin-top:.35rem;background:#38bdf8;border-radius:50%;box-shadow:0 0 10px rgba(56,189,248,.6)}
.community-placeholder{min-height:28rem;display:grid;place-content:center;justify-items:center;gap:.55rem;padding:2rem;color:#64748b;text-align:center}.community-placeholder i{font-size:2rem;color:#38bdf8}.community-placeholder h3{margin:.3rem 0 0;color:#cbd5e1;font-size:.85rem}.community-placeholder p{margin:0;font-size:.68rem}.conversation-header>span:nth-child(2){min-width:0;display:grid;gap:.2rem}.conversation-header strong{color:#f1f5f9;font-size:.78rem}.conversation-header small{color:#64748b;font-size:.6rem}.community-done-button{min-height:2.75rem;margin-left:auto;padding:.5rem .75rem;color:#bae6fd;cursor:pointer;background:rgba(14,165,233,.08);border:1px solid rgba(56,189,248,.3);border-radius:.55rem;font-size:.62rem;font-weight:700}
.conversation-body{min-height:17rem;display:grid;align-content:start;gap:1rem;padding:1.25rem;background:rgba(2,6,23,.2)}.conversation-context{display:flex;align-items:center;gap:.65rem;padding:.7rem;color:#7dd3fc;background:rgba(14,165,233,.06);border:1px solid rgba(56,189,248,.18);border-radius:.6rem}.conversation-context span{display:grid;gap:.12rem}.conversation-context small{color:#64748b;font-size:.55rem}.conversation-context strong{color:#cbd5e1;font-size:.64rem}.conversation-message{max-width:78%;padding:.85rem 1rem;background:rgba(30,41,59,.78);border:1px solid rgba(100,116,139,.24);border-radius:.8rem .8rem .8rem .2rem}.conversation-message small{color:#64748b;font-size:.55rem}.conversation-message p{margin:.35rem 0 0;color:#e2e8f0;font-size:.72rem;line-height:1.55}
.community-reply-form{display:grid;gap:.6rem;padding:1rem 1.25rem 1.25rem;border-top:1px solid rgba(100,116,139,.18)}.community-reply-form label{color:#94a3b8;font-size:.62rem;font-weight:700}.community-reply-form textarea{width:100%;resize:vertical;padding:.8rem;color:#e2e8f0;background:rgba(15,23,42,.72);border:1px solid rgba(100,116,139,.35);border-radius:.65rem;font:inherit;font-size:.7rem;line-height:1.5}.community-reply-actions{display:flex;align-items:center;justify-content:flex-end;gap:.55rem}.community-reply-actions>span{margin-right:auto;color:#64748b;font-size:.57rem}

.sentiment-badge { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .45rem; border-radius: 99px; font-size: .56rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.sentiment-badge.positive { color: #4ade80; background: rgba(34, 197, 94, 0.14); border: 1px solid rgba(74, 222, 128, 0.3); }
.sentiment-badge.neutral  { color: #38bdf8; background: rgba(56, 189, 248, 0.14); border: 1px solid rgba(56, 189, 248, 0.3); }
.sentiment-badge.negative { color: #f87171; background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(248, 113, 113, 0.3); }
.sentiment-badge.inquiry  { color: #c084fc; background: rgba(192, 132, 252, 0.14); border: 1px solid rgba(192, 132, 252, 0.3); }
.sentiment-topic-tag { display: inline-block; padding: .15rem .4rem; color: #94a3b8; background: rgba(30, 41, 59, 0.8); border: 1px solid rgba(100, 116, 139, 0.3); border-radius: .4rem; font-size: .58rem; margin-top: .2rem; margin-right: .3rem; }
.conversation-sentiment-box { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .65rem 1.25rem; background: rgba(15, 23, 42, 0.4); border-bottom: 1px solid rgba(100, 116, 139, 0.15); font-size: .65rem; }

@media(max-width:900px){.community-toolbar{align-items:stretch;flex-wrap:wrap}.community-search{flex:1 0 100%}.community-layout{grid-template-columns:1fr}.community-inbox{max-height:27rem}}
@media(max-width:620px){.community-hero{align-items:flex-start;flex-direction:column}.community-toolbar .community-filter{flex:1}.community-toolbar select{width:100%}.community-layout{min-height:0}.community-reply-actions{align-items:stretch;flex-direction:column}.community-reply-actions>span{margin:0}.community-reply-actions .btn{justify-content:center}.conversation-header{align-items:flex-start;flex-wrap:wrap}.community-done-button{width:100%;margin-left:0}}

/* Predictive Growth & Virality Score Badges (Agent 11 & Agent 09) */
.virality-score-panel {
    background: rgba(13, 17, 26, 0.85);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 8px;
    padding: 1.1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.virality-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}
.virality-pill.virality-viral { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.virality-pill.virality-high { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }
.virality-pill.virality-medium { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.virality-pill.virality-low { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }

.optimal-time-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.2s ease;
}
.optimal-time-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.optimal-slot-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.optimal-slot-day {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
}
.optimal-slot-time {
    font-size: 0.85rem;
    color: #38bdf8;
    font-weight: 600;
}
.optimal-slot-score {
    font-size: 1.1rem;
    font-weight: 800;
    color: #34d399;
}

/* Phase 6 Agent Swarm Monitor Panel Styles */
.swarm-agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1rem;
}

@media (max-width: 992px) {
    .swarm-bottom-split {
        grid-template-columns: 1fr !important;
    }
}

.swarm-terminal-log::-webkit-scrollbar {
    width: 6px;
}
.swarm-terminal-log::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
.swarm-terminal-log::-webkit-scrollbar-thumb {
    background: rgba(139, 140, 255, 0.3);
    border-radius: 3px;
}
.swarm-terminal-log::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 140, 255, 0.6);
}

/* --- Brand Switcher Control --- */
.brand-switcher-control {
    position: relative;
}

.brand-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.85rem;
    background: rgba(13, 17, 26, 0.85);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-btn);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.brand-trigger-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand-trigger-avatar {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
}

.brand-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    width: 290px;
    background: rgba(10, 15, 29, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border-glow);
    border-radius: var(--radius-card);
    padding: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    display: grid;
    gap: 6px;
}

.brand-popover[hidden] {
    display: none !important;
}

.brand-option-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 8px 10px;
    background: rgba(18, 24, 38, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-btn);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: left;
}

.brand-option-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
}

.brand-option-btn.is-active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.18);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.brand-option-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}

.brand-option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-option-info strong {
    font-size: 0.82rem;
    color: #f8fafc;
}

.brand-option-info small {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* --- Tone-of-Voice & Persona Sliders --- */
.tone-slider-group {
    margin-bottom: 1rem;
}

.tone-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
    color: #cbd5e1;
    font-weight: 600;
}

.tone-slider-header span.value-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--primary-glow);
    border-radius: 4px;
    color: var(--secondary);
}

.tone-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #0d111a;
    outline: none;
    accent-color: var(--primary);
    cursor: pointer;
}

.tone-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Hashtag Manager & First Comment --- */
.hashtag-presets-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.hashtag-group-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 4px;
    color: var(--secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hashtag-group-btn:hover {
    background: rgba(14, 165, 233, 0.25);
    border-color: var(--secondary);
}

.first-comment-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: var(--radius-btn);
    font-size: 0.8rem;
    color: #e9d5ff;
}

/* --- Approval Pipeline Badges --- */
.badge-draft { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }
.badge-review { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-approved { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }

/* --- White-Label Report Modal --- */
.report-modal-content {
    max-width: 820px;
    background: #090d16;
    border: 1px solid var(--card-border-glow);
    border-radius: var(--radius-card);
    padding: 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.report-brand-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.report-brand-meta img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.report-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.report-metric-card {
    background: rgba(18, 24, 38, 0.8);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 1rem;
}

.report-metric-card small {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.report-metric-card strong {
    display: block;
    font-size: 1.4rem;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
}

/* --- Smart Giveaway & Contest Picker Studio --- */
.winner-story-card {
    background: linear-gradient(145deg, rgba(28, 12, 24, 0.95), rgba(12, 18, 32, 0.95));
    border: 1px solid var(--card-border-glow);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.winner-story-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
    opacity: 0.3;
    pointer-events: none;
}

.winner-avatar-frame {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 0.75rem;
    padding: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    box-shadow: 0 0 25px var(--primary-glow);
}

.winner-avatar-frame img, .winner-avatar-frame div {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.winner-handle {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
}

.winner-comment-box {
    background: rgba(8, 12, 22, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-btn);
    padding: 0.85rem 1.1rem;
    margin: 1rem 0;
    font-size: 0.88rem;
    color: #e2e8f0;
    font-style: italic;
}

.fairness-seed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 4px;
    color: #6ee7b7;
    font-size: 0.68rem;
    font-family: monospace;
}



