/*==============================================
  MANTOX BLOG - UNIFIED CSS (THEME-ADAPTIVE)
  File: BaseCss.css
  Descrizione: Stili unificati compatibili con temi chiari e scuri
  Versione: 4.0 - Unified & Theme-Adaptive
==============================================*/

/*----------------------------------------------
  1. IMPORTS & FONT LOADING
----------------------------------------------*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@600;700&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&display=swap');

/*----------------------------------------------
  2. CSS VARIABLES & DESIGN TOKENS
----------------------------------------------*/
:root {
    /* === THEME VARIABLES (overridden by theme files) === */
    --bg-primary: var(--theme-bg-primary);
    --bg-secondary: var(--theme-bg-secondary);
    --bg-card: var(--theme-bg-card);
    --text-primary: var(--theme-text-primary);
    --text-secondary: var(--theme-text-secondary);
    --text-muted: var(--theme-text-muted);
    --accent-primary: var(--theme-accent-primary);
    --accent-secondary: var(--theme-accent-secondary);
    --border-color: var(--theme-border-color);
    --shadow: var(--theme-shadow);
    --shadow-hover: var(--theme-shadow-hover);
    --footer-bg: var(--theme-footer-bg, rgba(15, 15, 15, 0.98));
    /* === DESIGN SYSTEM - Theme Independent === */
    --border-radius: 12px;
    --border-radius-large: 16px;
    --border-radius-card: 16px;
    --border-radius-button: 12px;
    --border-radius-badge: 20px;
    /* === TRANSITIONS & ANIMATIONS === */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;
    --transition-spring: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* === TYPOGRAPHY === */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-family-heading: 'Playfair Display', serif;
    /* === Z-INDEX LAYERS === */
    --z-index-base: 1;
    --z-index-dropdown: 10;
    --z-index-sticky: 50;
    --z-index-filters: 80;
    --z-index-header: 100000;
    --z-index-modal: 500000;
    --z-index-toast: 1000000;
    --z-index-footer: 1000;
    /* === SPACING SCALE === */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
}

/* ═══════════════════════════════════════════════
   🛠️ UTILITY FLEX & ALIGNMENT HELPERS
   ═══════════════════════════════════════════════ */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.text-nowrap { white-space: nowrap !important; }
.text-truncate { overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
.ms-auto { margin-left: auto !important; }
.me-auto { margin-right: auto !important; }
.cursor-pointer { cursor: pointer !important; }

/*----------------------------------------------
  3. GLOBAL RESET & NORMALIZE
----------------------------------------------*/
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    font-size: 16px;
    background-color: var(--bg-primary, #0f0f0f);
    color-scheme: dark;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

html[data-theme="light"] {
    color-scheme: light;
}

body {
    font-family: var(--font-family-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
    position: relative;
}

/* ═══════════════════════════════════════════════
   ♿ A11Y: Skip to Content Link & Focus Indicator
   ═══════════════════════════════════════════════ */
.skip-to-content-link {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translate(-50%, -220%);
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    color: #ffffff !important;
    font-family: var(--font-family-primary);
    font-size: 0.92rem;
    font-weight: 700;
    padding: 0.75rem 1.4rem;
    border-radius: 30px;
    border: 2px solid #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.8);
    z-index: 100000;
    text-decoration: none;
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.skip-to-content-link:focus,
.skip-to-content-link:focus-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
    outline: 3px solid #38bdf8 !important;
    outline-offset: 3px !important;
}

:focus-visible {
    outline: 2.5px solid var(--accent-primary, #6366f1) !important;
    outline-offset: 3px !important;
}

ul, ol {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/*----------------------------------------------
  4. LAYOUT CONTAINERS
----------------------------------------------*/
.main-content {
    padding-bottom: 80px;
    min-height: calc(100vh - 80px);
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-xl);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.news-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

.article-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

/* Il primo box non deve sommare il proprio margine a quello del container: doppio spazio sotto l'header fisso */
.article-container > .accademico:first-child article,
.legal-container > .accademico:first-child article,
.legal-container .accademico article,
.accademico:first-child article {
    margin-top: 0;
}

.legal-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

/* 📖 GUIDA OPERATIVA: EXPANDED CONTAINER PER SCREENSHOT, TABELLE & WORKFLOW */
.guide-page .legal-container {
    max-width: 1180px;
    padding: 0 1.5rem;
}

@media (max-width: 1220px) {
    .guide-page .legal-container {
        max-width: 100%;
        padding: 0 1rem;
    }
}

.article-page {
    min-height: 100vh;
    background: var(--bg-primary);
    touch-action: pan-y;
}

/* ═══════════════════════════════════════════════
   🧘 ZEN READING MODE (Button & Reader Modal)
   ═══════════════════════════════════════════════ */
.article-band-zen-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: var(--border-radius, 6px);
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--accent-primary, #6366f1);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.2;
}

.article-band-zen-btn:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: var(--accent-primary, #6366f1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.article-band-zen-btn.active {
    background: var(--accent-primary, #6366f1);
    color: #ffffff;
    border-color: transparent;
}

.share-btn.share-zen {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.25);
    color: var(--accent-primary, #6366f1);
}

.share-btn.share-zen:hover {
    background: var(--accent-primary, #6366f1);
    color: #ffffff;
}

/* 🧘 ZEN READER MODAL (Standalone eBook Popup) */
.zen-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 1.5rem;
    animation: zenModalFade 0.25s ease-out;
}

@keyframes zenModalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.zen-modal-container {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: zenModalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: background-color 0.3s ease, color 0.3s ease;
}

@keyframes zenModalScale {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* 🎛️ Header */
.zen-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.75rem;
    flex-wrap: wrap;
}

.zen-badge-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.85;
}

.zen-modal-header-center {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.zen-modal-theme-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px;
    border-radius: 9999px;
}

.zen-theme-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    background: transparent;
    color: inherit;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.zen-theme-icon-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.zen-theme-icon-btn.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.zen-modal-font-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 5px;
    border-radius: 6px;
}

.zen-font-step-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.zen-font-step-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.zen-font-step-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.zen-modal-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zen-modal-close-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

/* 📖 Body & Article Typography */
.zen-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2.5rem;
    -webkit-overflow-scrolling: touch;
}

.zen-article-wrap {
    max-width: 680px;
    margin: 0 auto;
}

.zen-meta-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    margin-bottom: 1.25rem;
    opacity: 0.75;
    flex-wrap: wrap;
}

.zen-category-tag {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.zen-article-headline {
    font-family: 'Merriweather', Georgia, Cambria, serif;
    font-size: 2.1rem;
    line-height: 1.35;
    font-weight: 700;
    margin-bottom: 1.75rem;
    letter-spacing: -0.01em;
}

.zen-text-block .zen-paragraph {
    font-family: 'Merriweather', Georgia, Cambria, serif;
    font-size: 1.15rem;
    line-height: 1.95;
    margin-bottom: 1.4rem;
    letter-spacing: 0.005em;
    text-align: justify;
}

/* Expert Section inside Zen */
.zen-expert-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.zen-expert-header {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

/* Smart Q&A box inside Zen */
.zen-smartqa-box {
    margin-top: 2.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.zen-smartqa-header {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.zen-qa-item {
    margin-bottom: 1rem;
}

.zen-qa-item:last-child {
    margin-bottom: 0;
}

.zen-qa-question {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.zen-qa-answer {
    font-family: 'Merriweather', Georgia, Cambria, serif;
    font-size: 0.98rem;
    line-height: 1.75;
    opacity: 0.9;
    margin: 0;
}

.credits-linkedin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1.35rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid rgba(100, 160, 255, 0.35);
    border-radius: 999px;
    background: rgba(10, 102, 194, 0.12);
    color: #9bc7ff;
    font-size: 0.82rem;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.credits-linkedin-link:hover,
.credits-linkedin-link:focus-visible {
    background: rgba(10, 102, 194, 0.28);
    border-color: rgba(130, 185, 255, 0.7);
    color: #ffffff;
    transform: translateY(-1px);
}

.credits-linkedin-link i {
    font-size: 1.15rem;
}

.credits-project-teaser {
    max-width: 680px;
    margin: 1.35rem auto 0;
    padding: 1rem 1.15rem;
    border-left: 3px solid #10b981;
    border-radius: 0 12px 12px 0;
    background: color-mix(in srgb, #10b981 9%, transparent);
    text-align: left;
}

.credits-project-teaser-title {
    margin: 0 0 0.35rem;
    color: #34d399;
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.credits-project-teaser-text {
    margin: 0;
    color: color-mix(in srgb, var(--text-primary, #f8f7ff) 86%, transparent);
    font-size: 0.94rem;
    line-height: 1.6;
}

[data-theme="light"] .credits-project-teaser {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #059669;
}

[data-theme="light"] .credits-project-teaser-title {
    color: #047857;
}

[data-theme="light"] .credits-project-teaser-text {
    color: #26324a;
}

.credits-linkedin-link-bottom {
    margin-top: 0.8rem;
}

.zen-footer-close {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.zen-footer-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zen-footer-close-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

/* 🎨 THEMES (Relaxing & Eye-Friendly) */
.zen-modal-backdrop.zen-theme-dark {
    background: rgba(10, 15, 29, 0.85);
}
.zen-modal-backdrop.zen-theme-sepia {
    background: rgba(45, 34, 22, 0.75);
}
.zen-modal-backdrop.zen-theme-sage {
    background: rgba(14, 23, 18, 0.8);
}
.zen-modal-backdrop.zen-theme-paper {
    background: rgba(30, 30, 30, 0.65);
}

/* 🌙 Dark Midnight Slate (Default) */
.zen-modal-container.zen-theme-dark {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(129, 140, 248, 0.25) !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 25px rgba(99, 102, 241, 0.15) !important;
}
.zen-modal-container.zen-theme-dark .zen-modal-header {
    background: #1e293b !important;
    border-bottom: 1px solid rgba(129, 140, 248, 0.2) !important;
}
.zen-modal-container.zen-theme-dark .zen-article-headline {
    color: #ffffff !important;
}
.zen-modal-container.zen-theme-dark .zen-paragraph {
    color: #e2e8f0 !important;
}
.zen-modal-container.zen-theme-dark .zen-meta-top {
    color: #94a3b8 !important;
}
.zen-modal-container.zen-theme-dark .zen-category-tag {
    color: #818cf8 !important;
    background: rgba(99, 102, 241, 0.15) !important;
    padding: 0.2rem 0.6rem !important;
    border-radius: 6px !important;
}
.zen-modal-container.zen-theme-dark .zen-expert-section {
    border-top: 1px solid rgba(129, 140, 248, 0.25) !important;
    background: rgba(15, 23, 42, 0.6) !important;
    border-radius: 12px !important;
    padding: 1.25rem !important;
}
.zen-modal-container.zen-theme-dark .zen-expert-header {
    color: #a5b4fc !important;
}
.zen-modal-container.zen-theme-dark .zen-smartqa-box {
    background: rgba(30, 41, 59, 0.7) !important;
    border: 1px solid rgba(129, 140, 248, 0.2) !important;
    border-radius: 10px !important;
}
.zen-modal-container.zen-theme-dark .zen-theme-icon-btn.active {
    background: rgba(99, 102, 241, 0.35) !important;
    border-color: #818cf8 !important;
}

/* 📜 Sepia (Kindle Classic Parchment - Warm, Anti-Blue Light) */
.zen-modal-container.zen-theme-sepia {
    background: #f4ecd8 !important;
    color: #3b2d1d !important;
}
.zen-modal-container.zen-theme-sepia .zen-modal-header {
    background: #e7dcbf !important;
    border-bottom-color: rgba(59, 45, 29, 0.15) !important;
    color: #3b2d1d !important;
}
.zen-modal-container.zen-theme-sepia .zen-article-headline {
    color: #2b1f13 !important;
}
.zen-modal-container.zen-theme-sepia .zen-paragraph {
    color: #453626 !important;
}
.zen-modal-container.zen-theme-sepia .zen-meta-top {
    color: #6e5842 !important;
}
.zen-modal-container.zen-theme-sepia .zen-category-tag {
    color: #b45309 !important;
}
.zen-modal-container.zen-theme-sepia .zen-expert-section {
    border-top-color: rgba(59, 45, 29, 0.15) !important;
}
.zen-modal-container.zen-theme-sepia .zen-expert-header {
    color: #92400e !important;
}
.zen-modal-container.zen-theme-sepia .zen-smartqa-box {
    background: rgba(59, 45, 29, 0.05) !important;
    border-color: rgba(59, 45, 29, 0.15) !important;
    color: #3b2d1d !important;
}
.zen-modal-container.zen-theme-sepia .zen-modal-theme-picker,
.zen-modal-container.zen-theme-sepia .zen-modal-font-picker {
    background: rgba(59, 45, 29, 0.08) !important;
    color: #3b2d1d !important;
}
.zen-modal-container.zen-theme-sepia .zen-theme-icon-btn.active {
    background: rgba(59, 45, 29, 0.18) !important;
}
.zen-modal-container.zen-theme-sepia .zen-footer-close-btn {
    background: rgba(59, 45, 29, 0.08) !important;
    border-color: rgba(59, 45, 29, 0.2) !important;
    color: #3b2d1d !important;
}

/* 🌿 Sage Relax (Nordic Forest / E-Ink Eye Comfort) */
.zen-modal-container.zen-theme-sage {
    background: #18221c !important;
    color: #d6e2db !important;
}
.zen-modal-container.zen-theme-sage .zen-modal-header {
    background: #202c25 !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    color: #d6e2db !important;
}
.zen-modal-container.zen-theme-sage .zen-article-headline {
    color: #f0fdf4 !important;
}
.zen-modal-container.zen-theme-sage .zen-paragraph {
    color: #cbd5ce !important;
}
.zen-modal-container.zen-theme-sage .zen-meta-top {
    color: #8fa79b !important;
}
.zen-modal-container.zen-theme-sage .zen-category-tag {
    color: #34d399 !important;
}
.zen-modal-container.zen-theme-sage .zen-expert-section {
    border-top-color: rgba(52, 211, 153, 0.18) !important;
}
.zen-modal-container.zen-theme-sage .zen-expert-header {
    color: #6ee7b7 !important;
}
.zen-modal-container.zen-theme-sage .zen-smartqa-box {
    background: rgba(52, 211, 153, 0.05) !important;
    border-color: rgba(52, 211, 153, 0.15) !important;
}
.zen-modal-container.zen-theme-sage .zen-theme-icon-btn.active {
    background: rgba(52, 211, 153, 0.25) !important;
}
/* ☀️ Paper (Soft Cream / Anti-Reflective Warm Paper) */
.zen-modal-container.zen-theme-paper {
    background: #fbf9f4 !important;
    color: #242424 !important;
}
.zen-modal-container.zen-theme-paper .zen-modal-header {
    background: #f0ebe1 !important;
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
    color: #242424 !important;
}
.zen-modal-container.zen-theme-paper .zen-article-headline {
    color: #111111 !important;
}
.zen-modal-container.zen-theme-paper .zen-paragraph {
    color: #2d2d2d !important;
}
.zen-modal-container.zen-theme-paper .zen-meta-top {
    color: #666666 !important;
}
.zen-modal-container.zen-theme-paper .zen-category-tag {
    color: #4f46e5 !important;
}
.zen-modal-container.zen-theme-paper .zen-expert-section {
    border-top-color: rgba(0, 0, 0, 0.1) !important;
}
.zen-modal-container.zen-theme-paper .zen-expert-header {
    color: #4338ca !important;
}
.zen-modal-container.zen-theme-paper .zen-smartqa-box {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: #242424 !important;
}
.zen-modal-container.zen-theme-paper .zen-modal-theme-picker,
.zen-modal-container.zen-theme-paper .zen-modal-font-picker {
    background: rgba(0, 0, 0, 0.06) !important;
    color: #242424 !important;
}
.zen-modal-container.zen-theme-paper .zen-theme-icon-btn.active {
    background: rgba(0, 0, 0, 0.15) !important;
}
.zen-modal-container.zen-theme-paper .zen-footer-close-btn {
    background: rgba(0, 0, 0, 0.06) !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #242424 !important;
}

/* 🔤 Font Scaling */
.zen-modal-container.font-scale--2 .zen-paragraph { font-size: 0.95rem; line-height: 1.8; }
.zen-modal-container.font-scale--1 .zen-paragraph { font-size: 1.05rem; line-height: 1.85; }
.zen-modal-container.font-scale-0 .zen-paragraph { font-size: 1.15rem; line-height: 1.95; }
.zen-modal-container.font-scale-1 .zen-paragraph { font-size: 1.25rem; line-height: 2.0; }
.zen-modal-container.font-scale-2 .zen-paragraph { font-size: 1.38rem; line-height: 2.05; }
.zen-modal-container.font-scale-3 .zen-paragraph { font-size: 1.5rem; line-height: 2.1; }

@media (max-width: 768px) {
    .zen-modal-backdrop {
        padding: 0;
    }
    .zen-modal-container {
        max-width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    .zen-modal-body {
        padding: 1.25rem 1.25rem;
    }
    .zen-article-headline {
        font-size: 1.55rem;
    }
    .zen-text-block .zen-paragraph {
        font-size: 1.05rem;
        line-height: 1.8;
    }
}

/*----------------------------------------------
  5. GRID SYSTEMS & TV BROADCAST SLIDER
----------------------------------------------*/
.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

/* ═══════════════════════════════════════════════
   📺 TV BROADCAST NEWS SLIDER (Desktop Dynamic Mode)
   ═══════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════════
   📰 DAILY EDITION BROWSER (Sfoglio Rassegne Giornaliere in Home)
   ═══════════════════════════════════════════════════════════════════════════ */
.edition-review-wrapper {
    width: 100%;
    margin-bottom: 2rem;
}

.edition-review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.15rem;
    margin-bottom: 1.25rem;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: var(--border-radius-card);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.25);
    gap: 0.75rem;
    flex-wrap: wrap;
}

[data-theme="light"] .edition-review-header {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border: 1px solid rgba(203, 213, 225, 0.95);
    box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
}

.edition-info-left {
    display: flex;
    align-items: center;
    min-width: 220px;
}

.edition-actions-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: auto;
}

.edition-nav-group {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .edition-nav-group {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.edition-nav-group .edition-nav-btn {
    padding: 0.38rem 0.55rem;
    min-width: 32px;
    justify-content: center;
    border: none;
    background: transparent;
}

.edition-nav-group .edition-nav-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.25);
    border-color: transparent;
    color: #ffffff;
}

[data-theme="light"] .edition-nav-group .edition-nav-btn {
    background: transparent;
    border: none;
    color: #334155;
}

[data-theme="light"] .edition-nav-group .edition-nav-btn:hover:not(:disabled) {
    background: #eef2ff;
    color: #4338ca;
}

@media (max-width: 768px) {
    .edition-review-header {
        padding: 0.65rem 0.85rem;
        gap: 0.65rem;
    }
    .edition-info-left {
        width: 100%;
        min-width: 100%;
        justify-content: center;
        margin-bottom: 0.15rem;
    }
    .edition-actions-right {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }
    .edition-date-headline {
        font-size: 1.05rem;
    }
}

.edition-single-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    white-space: nowrap;
    flex-wrap: wrap;
}

.edition-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(168, 85, 247, 0.2) 100%);
    border: 1px solid rgba(99, 102, 241, 0.4);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #c7d2fe;
    text-transform: capitalize;
}

[data-theme="light"] .edition-pill-badge {
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #4f46e5;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.08);
}

.edition-date-headline {
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-size: 1.15rem;
    font-weight: 750;
    margin: 0;
    color: var(--text-primary, #ffffff);
    letter-spacing: -0.015em;
    line-height: 1.2;
}

[data-theme="light"] .edition-date-headline {
    color: #0f172a;
}

.edition-today-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-size: 0.78rem;
    font-weight: 700;
}

[data-theme="light"] .edition-today-pill {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #047857;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.08);
}

.edition-today-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: ticker-pulse 1.8s infinite;
}

.edition-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-primary, #ffffff);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edition-nav-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    color: #ffffff;
    transform: translateY(-1px);
}

.edition-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

[data-theme="light"] .edition-nav-btn {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .edition-nav-btn:hover:not(:disabled) {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4338ca;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.edition-playlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-primary, #ffffff);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.edition-playlist-btn:hover,
.edition-playlist-btn.is-open {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    color: #a5b4fc;
    transform: translateY(-1px);
}

.edition-queue-count {
    font-family: var(--font-family-mono, monospace);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
}

[data-theme="light"] .edition-playlist-btn {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .edition-playlist-btn:hover,
[data-theme="light"] .edition-playlist-btn.is-open {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4338ca;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .edition-queue-count {
    background: #e0e7ff;
    color: #4338ca;
}

.edition-listen-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.85rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.edition-listen-btn:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.5);
    transform: translateY(-1px);
}

.edition-listen-btn.is-playing {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Micro Equalizzatore Animato per il Bottone */
.edition-equalizer-mini {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.eq-mini-bar {
    width: 2.5px;
    height: 3px;
    background: #ffffff;
    border-radius: 1px;
}

.edition-listen-btn.is-playing .eq-mini-bar:nth-child(1) { animation: eq-mini-play 0.7s infinite alternate; }
.edition-listen-btn.is-playing .eq-mini-bar:nth-child(2) { animation: eq-mini-play 1.0s infinite 0.2s alternate; }
.edition-listen-btn.is-playing .eq-mini-bar:nth-child(3) { animation: eq-mini-play 0.8s infinite 0.4s alternate; }

@keyframes eq-mini-play {
    0% { height: 3px; }
    100% { height: 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ✨ 3D EDITORIAL PAGE-TURN TRANSITIONS (Edition WOW Animation System)
   ═══════════════════════════════════════════════════════════════════════════ */
.edition-flip-entry {
    animation: editionHeaderPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

@keyframes editionHeaderPop {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
        filter: blur(4px);
    }
    65% {
        transform: translateY(1.5px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.edition-cards-stage {
    position: relative;
    width: 100%;
    perspective: 1200px;
    transition: opacity 0.22s cubic-bezier(0.4, 0, 1, 1), transform 0.22s cubic-bezier(0.4, 0, 1, 1), filter 0.22s ease;
    will-change: transform, opacity;
}

.edition-cards-stage.slide-out-left {
    opacity: 0;
    transform: translateX(-40px) rotateY(6deg) scale(0.96);
    filter: blur(3px);
}

.edition-cards-stage.slide-out-right {
    opacity: 0;
    transform: translateX(40px) rotateY(-6deg) scale(0.96);
    filter: blur(3px);
}

.edition-cards-stage.slide-in-right {
    animation: stageFlipInRight 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.edition-cards-stage.slide-in-left {
    animation: stageFlipInLeft 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stageFlipInRight {
    0% {
        opacity: 0;
        transform: translateX(45px) rotateY(-8deg) scale(0.94);
        filter: blur(5px);
    }
    70% {
        transform: translateX(-2px) rotateY(1deg) scale(1.005);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotateY(0deg) scale(1);
        filter: blur(0);
    }
}

@keyframes stageFlipInLeft {
    0% {
        opacity: 0;
        transform: translateX(-45px) rotateY(8deg) scale(0.94);
        filter: blur(5px);
    }
    70% {
        transform: translateX(2px) rotateY(-1deg) scale(1.005);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotateY(0deg) scale(1);
        filter: blur(0);
    }
}

/* Cascade Staggered Card Entrance */
.edition-cards-stage.slide-in-right .content-card:nth-child(1),
.edition-cards-stage.slide-in-left .content-card:nth-child(1) {
    animation: cardCascade 0.38s cubic-bezier(0.16, 1, 0.3, 1) 0.02s both;
}
.edition-cards-stage.slide-in-right .content-card:nth-child(2),
.edition-cards-stage.slide-in-left .content-card:nth-child(2) {
    animation: cardCascade 0.38s cubic-bezier(0.16, 1, 0.3, 1) 0.07s both;
}
.edition-cards-stage.slide-in-right .content-card:nth-child(3),
.edition-cards-stage.slide-in-left .content-card:nth-child(3) {
    animation: cardCascade 0.38s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

@keyframes cardCascade {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-xl);
}

/*----------------------------------------------
  6. TYPOGRAPHY SYSTEM
----------------------------------------------*/
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
}

h3 {
    font-size: 1.75rem;
    font-weight: 600;
}

h4 {
    font-size: 1.5rem;
    font-weight: 600;
}

h5 {
    font-size: 1.25rem;
    font-weight: 500;
}

h6 {
    font-size: 1.125rem;
    font-weight: 500;
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.page-title {
    font-family: var(--font-family-heading);
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 var(--spacing-lg) 0;
}

.legal-title {
    font-family: var(--font-family-heading);
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-md) 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-title {
    font-family: var(--font-family-heading);
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--spacing-lg) 0;
    line-height: 1.2;
}

/*----------------------------------------------
  7. BUTTON SYSTEM
----------------------------------------------*/
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--border-radius-button);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    min-height: 48px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: 2px solid transparent;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
        text-decoration: none;
        color: white;
    }

    .btn-primary:active {
        transform: translateY(-1px);
    }

.btn-secondary {
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}

    .btn-secondary:hover {
        background: var(--accent-primary);
        color: white;
        transform: translateY(-2px);
        text-decoration: none;
    }

    .btn-secondary:active {
        transform: translateY(-1px);
    }

.all-news-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: var(--spacing-md) var(--spacing-xl);
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
    border-radius: var(--border-radius-button);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

    .all-news-btn:hover {
        background: var(--accent-primary);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
        text-decoration: none;
    }

.read-more-btn-centered {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.875rem var(--spacing-xl);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-button);
    font-weight: 600;
    transition: all var(--transition-normal);
    font-size: 0.95rem;
    min-width: 140px;
    text-align: center;
    justify-content: center;
}

    .read-more-btn-centered:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
        text-decoration: none;
        color: white;
        scale: 1.05;
    }

    .read-more-btn-centered:active {
        transform: translateY(-1px);
        scale: 1.02;
    }

.clear-filters-btn,
.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
    border-radius: var(--border-radius-button);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-normal);
    margin-top: var(--spacing-md);
    text-decoration: none;
    font-family: inherit;
}

    .clear-filters-btn:hover,
    .load-more-btn:hover {
        background: var(--accent-primary);
        color: white;
        transform: translateY(-2px);
        text-decoration: none;
    }

/*----------------------------------------------
  8. FORM ELEMENTS
----------------------------------------------*/
.input-base,
.search-input,
.filter-select {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-normal);
    font-family: inherit;
    min-height: 48px;
}

    .input-base:focus,
    .search-input:focus,
    .filter-select:focus {
        outline: none;
        border-color: var(--accent-primary);
        background: var(--bg-secondary);
    }

    .input-base::placeholder,
    .search-input::placeholder {
        color: var(--text-muted);
    }

.search-input {
    padding-left: 3rem;
}

.filter-select,
.category-select-modern {
    min-width: 200px;
    max-width: 300px;
    width: auto;
}

    .filter-select option,
    .category-select-modern option {
        padding: 0.5rem 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/*----------------------------------------------
  9. HEADER SYSTEM (OPZIONE 1: LINEA LASER INFERIORE)
----------------------------------------------*/
.header {
    position: sticky !important;
    top: 0 !important;
    z-index: var(--z-index-header) !important;
    padding: 0.95rem 0 !important;
    transition: all var(--transition-normal) !important;
    border-bottom: none !important;
}

body.bio-route .header {
    transform: translateY(-105%);
    transition: transform var(--transition-normal), opacity var(--transition-normal) !important;
}

body.bio-route .header.hidden {
    transform: translateY(-105%);
    opacity: 0;
    pointer-events: none;
}

body.bio-route .header:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Header nascosto quando il modal Easter Egg Credits è aperto */
.header.credits-open {
    transform: translateY(-105%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform 0.4s ease, opacity 0.4s ease !important;
}

/* Riappare se l'utente scrolla in su nel modal credits (peek) */
.header.credits-open.credits-peek {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(99, 102, 241, 0.1) 0%,
        #6366f1 25%,
        #a855f7 50%,
        #06b6d4 75%,
        rgba(99, 102, 241, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: headerLaserGlow 6s linear infinite;
    box-shadow: 0 1px 12px rgba(99, 102, 241, 0.35),
                0 0 8px rgba(6, 182, 212, 0.22);
    z-index: 101;
    pointer-events: none;
}

@keyframes headerLaserGlow {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: var(--spacing-lg);
    padding: 0 10px 0.25rem 10px;
}

.logout-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-self: start;
    gap: 0;
    position: relative;
    /* Larghezza fissa = logo (184px) + spazio drawer (48px) + gap (8px).
       Impedisce che il drawer in apertura sposti il titolo centrale. */
    width: 240px;
}

/* 🌟 Logo Bio Sliding Drawer (Nascosto a riposo, scivola fuori su hover o click) */
.logo-bio-drawer {
    display: inline-flex;
    align-items: center;
    max-width: 0;
    opacity: 0;
    transform: translateX(-14px) scale(0.92);
    overflow: hidden;
    pointer-events: none;
    transition: max-width 0.38s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.28s ease,
                transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    will-change: max-width, opacity, transform;
}

/* Reveal su Desktop al passaggio del mouse o focus da tastiera */
.logo-section:hover .logo-bio-drawer,
.logo-section:focus-within .logo-bio-drawer,
.logo-section.is-revealed .logo-bio-drawer {
    max-width: 140px;
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    margin-left: 0.5rem;
    overflow: visible;
}

/* Tooltip del drawer: ancorato al centro del bottone (non al centro del drawer).
   Il drawer è inline-flex con il bottone come unico figlio, quindi left:50%
   si centra correttamente. Nascosto quando il drawer è chiuso (pointer-events:none). */
.logo-bio-drawer[data-tooltip-pos="bottom"]::after {
    left: 50%;
}
.logo-bio-drawer[data-tooltip-pos="bottom"]::before {
    left: 50%;
}

/* 🖋️ Header Bio Feather Trigger — Piuma d'oca d'Autore */
.header-bio-feather-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    border: 1px solid rgba(168, 85, 247, 0.45);
    background: radial-gradient(circle at 35% 30%, rgba(99, 102, 241, 0.28) 0%, rgba(15, 23, 42, 0.85) 85%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #f8fafc;
    cursor: pointer;
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4),
                0 0 12px rgba(139, 92, 246, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}

.header-bio-feather-btn:hover,
.header-bio-feather-btn:focus-visible {
    transform: translateY(-2px) rotate(-8deg) scale(1.08);
    border-color: rgba(216, 180, 254, 0.95);
    background: radial-gradient(circle at 35% 30%, rgba(168, 85, 247, 0.5) 0%, rgba(30, 27, 75, 0.92) 85%);
    box-shadow: 0 6px 22px rgba(147, 51, 234, 0.6),
                0 0 18px rgba(56, 189, 248, 0.55),
                inset 0 1px 1px rgba(255, 255, 255, 0.5);
    outline: none;
}

.header-bio-feather-btn:active {
    transform: translateY(0) scale(0.94);
}

.bio-feather-icon {
    font-size: 1.12rem;
    color: #c084fc;
    transition: all 0.3s ease;
    transform: rotate(5deg);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.header-bio-feather-btn:hover .bio-feather-icon {
    color: #38bdf8;
    transform: rotate(-10deg) scale(1.15);
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.85));
}

/* Micro goccia d'inchiostro dorato/ciano sotto la punta della piuma */
.bio-feather-ink {
    position: absolute;
    bottom: 5px;
    right: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 6px #38bdf8;
    opacity: 0.85;
    transition: all 0.25s ease;
}

.header-bio-feather-btn:hover .bio-feather-ink {
    background: #facc15;
    box-shadow: 0 0 8px #facc15;
    transform: scale(1.3);
    opacity: 1;
}

/* Light Theme Styling per la piuma */
[data-theme="light"] .header-bio-feather-btn {
    border-color: rgba(99, 102, 241, 0.45);
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.98) 0%, rgba(238, 242, 255, 0.9) 100%);
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .header-bio-feather-btn .bio-feather-icon {
    color: #6366f1;
}

[data-theme="light"] .header-bio-feather-btn:hover {
    border-color: rgba(79, 70, 229, 0.85);
    background: radial-gradient(circle at 35% 30%, rgba(243, 232, 255, 0.98) 0%, rgba(224, 231, 255, 0.92) 100%);
    box-shadow: 0 5px 18px rgba(79, 70, 229, 0.35);
}

[data-theme="light"] .header-bio-feather-btn:hover .bio-feather-icon {
    color: #7c3aed;
}


.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 0;
}

.header-brand-logo {
    height: 54px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
}

.header-brand-logo.light-logo {
    display: none;
}

.header-brand-logo.dark-logo {
    display: block;
}

[data-theme="light"] .header-brand-logo.dark-logo {
    display: none !important;
}

[data-theme="light"] .header-brand-logo.light-logo {
    display: block !important;
}

[data-theme="dark"] .header-brand-logo.light-logo {
    display: none !important;
}

[data-theme="dark"] .header-brand-logo.dark-logo {
    display: block !important;
}

.logo-link:hover .header-brand-logo {
    transform: scale(1.03);
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.45));
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    outline: none !important;
}

    .header-title:focus,
    .header-title:focus-visible {
        outline: none !important;
        box-shadow: none !important;
    }

    .header-title h1,
    .header-title .header-title-text {
        margin: 0;
        font-family: 'EB Garamond', 'Playfair Display', 'Georgia', 'Cambria', 'Times New Roman', serif;
        font-size: clamp(1.4rem, 1.85vw, 1.8rem);
        font-weight: 500;
        font-style: italic;
        background: linear-gradient(90deg, #ffffff 0%, #cbd5e1 25%, #60a5fa 55%, #38bdf8 80%, #ffffff 100%);
        background-size: 200% auto;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        line-height: 1.15;
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 2rem;
        max-width: 60ch;
        overflow-wrap: break-word;
        letter-spacing: -0.01em;
        animation: header-title-shimmer 4s linear infinite;
        outline: none !important;
    }

    .header-title h1:focus,
    .header-title h1:focus-visible,
    .header-title .header-title-text:focus,
    .header-title .header-title-text:focus-visible {
        outline: none !important;
        box-shadow: none !important;
    }

/* Blazor FocusOnNavigate: prevent browser default blue focus ring on navigation target headings */
h1:focus,
h1:focus-visible,
h2:focus,
h2:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

@keyframes header-title-shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.special-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'EB Garamond', 'Playfair Display', 'Georgia', serif;
    font-size: 1.28em;
    font-weight: 700;
    font-style: italic;
    color: inherit;
    background: linear-gradient(135deg, #00f0ff 0%, #38bdf8 35%, #2563eb 70%, #60a5fa 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0.16em;
    line-height: 1;
    vertical-align: middle;
    letter-spacing: 0;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    animation: number-electric-blue-glow 2.8s ease-in-out infinite alternate;
}

@keyframes number-electric-blue-glow {
    0% { filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.45)); }
    100% { filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.85)) drop-shadow(0 0 22px rgba(37, 99, 235, 0.65)); }
}

    .special-number::before {
        display: none !important;
    }

.nav-controls {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/*----------------------------------------------
  10. LANGUAGE SWITCH
----------------------------------------------*/
.language-switch {
    display: flex;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--border-color);
}

.lang-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: 500;
    min-height: 36px;
}

    .lang-btn.active {
        background: var(--accent-primary);
        color: white;
    }

    .lang-btn:hover:not(.active) {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
    }

/*----------------------------------------------
  11. THEME TOGGLE
----------------------------------------------*/
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: 8px;
    transition: all var(--transition-normal);
}

    .theme-toggle-btn:hover {
        background: rgba(79, 70, 229, 0.1);
    }

    .theme-toggle-btn:focus {
        outline: 2px solid var(--accent-primary);
        outline-offset: 2px;
    }

.toggle-track {
    width: 60px;
    height: 32px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    position: relative;
    transition: all var(--transition-normal);
}

.toggle-thumb {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    position: absolute;
    top: 1px;
    transition: all var(--transition-spring);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

    .toggle-thumb.dark {
        left: 1px;
    }

    .toggle-thumb.light {
        left: 29px;
    }

.toggle-icon {
    font-size: 0.8rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.theme-toggle-btn:hover .toggle-thumb {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.theme-toggle-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

    .theme-toggle-btn.loading .toggle-thumb {
        animation: pulse 1s infinite;
    }

/*----------------------------------------------
  12. FILTERS SECTION
----------------------------------------------*/
.filters-section-container {
    position: sticky;
    top: 150px;
    z-index: var(--z-index-filters);
    padding: var(--spacing-lg) 0;
    margin-bottom: var(--spacing-xl);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.filters-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: var(--spacing-lg);
    align-items: center;
    padding: 0 var(--spacing-xl);
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    color: var(--text-muted);
    pointer-events: none;
    z-index: var(--z-index-base);
}

.filter-group {
    display: flex;
    align-items: center;
}

.results-info {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.filters-section-modern {
    position: relative;
    padding: 0.75rem 0;
    margin-bottom: var(--spacing-lg);
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.filters-section-modern.is-ai-scanning {
    border-bottom-color: rgba(56, 189, 248, 0.6) !important;
    box-shadow: 0 6px 28px rgba(56, 189, 248, 0.22), 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ai-scanning-laser-beam {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(99, 102, 241, 0.1) 0%,
        #6366f1 25%,
        #a855f7 50%,
        #06b6d4 75%,
        rgba(99, 102, 241, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: headerLaserGlow 1.2s linear infinite;
    box-shadow: 0 1px 12px rgba(99, 102, 241, 0.45),
                0 0 8px rgba(6, 182, 212, 0.35);
    z-index: 101;
    pointer-events: none;
}

.news-content {
    transition: opacity 0.25s ease;
}

.news-content-filtering {
    opacity: 0.90;
    transition: opacity 0.15s ease;
}

/* ═══════════════════════════════════════════════
   📊 TREND RADAR DELLA SETTIMANA
   ═══════════════════════════════════════════════ */
.trend-radar-wrapper {
    width: 100%;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.trend-radar-glass-card {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 16px;
    padding: 0.9rem 1.25rem;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.trend-radar-glass-card:hover {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 8px 25px -3px rgba(99, 102, 241, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .trend-radar-glass-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.18);
    box-shadow: 0 4px 18px -2px rgba(99, 102, 241, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .trend-radar-glass-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.14);
}

.trend-radar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.trend-radar-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.trend-radar-icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.25));
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #818cf8;
    font-size: 0.9rem;
}

.trend-radar-titles {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.trend-radar-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.trend-radar-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.trend-radar-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.trend-radar-timeframe-group {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(127, 127, 127, 0.2);
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
}

.trend-timeframe-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    padding: 0.2rem 0.55rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.trend-timeframe-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.trend-timeframe-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(6, 182, 212, 0.9));
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
    font-weight: 700;
}

.trend-radar-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.6rem;
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trend-radar-reset-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

.trend-radar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(127, 127, 127, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trend-radar-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.12);
}

/* ═══════════════════════════════════════════════
   📊 TREND RADAR DONUT CHART & INTERACTIVE LEGEND
   ═══════════════════════════════════════════════ */
.trend-radar-body-layout {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.trend-radar-chart-box {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trend-donut-container {
    position: relative;
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trend-donut-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* Inizia le fette dall'alto a ore 12 */
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.38));
}

.trend-donut-segment {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.9;
}

.trend-donut-segment:hover {
    opacity: 1;
    stroke-width: 17;
    filter: brightness(1.25);
}

.trend-donut-segment.is-selected {
    opacity: 1;
    stroke-width: 17;
    filter: drop-shadow(0 0 12px currentColor);
}

.trend-donut-center {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    line-height: 1.1;
}

.trend-donut-total {
    font-size: 2.6rem;
    font-weight: 800;
    font-family: var(--font-family-mono, monospace);
    color: var(--text-primary);
}

.trend-donut-lbl {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

/* 🎴 Legenda & Grid Items (Desktop: 4 colonne x 3 righe più compatto) */
.trend-radar-legend-box {
    flex: 1;
    min-width: 0;
}

.trend-radar-items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
    width: 100%;
}

.trend-radar-item-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.3rem;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    min-height: 72px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    position: relative;
    user-select: none;
}

.trend-radar-item-card:hover {
    border-color: var(--accent-item-color, var(--accent-primary));
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.trend-radar-item-card.is-active {
    border-color: var(--accent-item-color, var(--accent-primary));
    background: rgba(99, 102, 241, 0.18);
    box-shadow: 0 0 0 2px var(--accent-item-color, var(--accent-primary)), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.item-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
}

.item-card-cat {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
}

.item-card-emoji {
    font-size: 0.95rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.item-card-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-card-pct {
    font-family: var(--font-family-mono, monospace);
    font-size: 0.76rem;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 1px;
}

.item-card-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(127, 127, 127, 0.18);
    border-radius: 9999px;
    overflow: hidden;
}

.item-card-progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.item-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.item-card-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.item-card-active-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-item-color, var(--accent-primary));
    color: #ffffff;
    font-size: 0.6rem;
}

[data-theme="light"] .trend-radar-item-card {
    background: #ffffff;
    border-color: rgba(203, 213, 225, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .trend-radar-item-card:hover {
    background: #f8fafc;
    border-color: var(--accent-item-color, var(--accent-primary));
}

[data-theme="light"] .trend-radar-item-card.is-active {
    background: #eef2ff;
    border-color: var(--accent-item-color, var(--accent-primary));
}

.chip-color-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chip-emoji {
    font-size: 0.9rem;
    line-height: 1;
}

.chip-cat-name {
    font-weight: 600;
}

.chip-pct-badge {
    font-family: var(--font-family-mono, monospace);
    font-weight: 700;
    font-size: 0.76rem;
}

.chip-count-pill {
    background: rgba(127, 127, 127, 0.18);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.filters-stack-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0 var(--spacing-lg);
}

.search-box-row {
    width: 100%;
}

.search-box-modern.fullwidth-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.7rem 1.15rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all var(--transition-normal);
}

.search-box-modern.fullwidth-search:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18), 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.search-icon-modern {
    color: var(--accent-primary);
    margin-right: 0.75rem;
    font-size: 1rem;
}

.search-input-modern {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: var(--text-primary);
    font-size: 0.98rem;
    font-family: inherit;
    padding: 0 !important;
}

.search-input-modern::placeholder {
    color: var(--text-muted);
}

.clear-search-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.clear-search-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

.search-ai-active-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-primary, #818cf8);
    margin-right: 0.4rem;
    white-space: nowrap;
    animation: fadeIn 0.2s ease;
}

[data-theme="light"] .search-ai-active-pill {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border-color: rgba(99, 102, 241, 0.25);
}

/* RIGA 2: 4 FILTRI COMPATTI */
.filters-subrow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.65rem;
    width: 100%;
}

.filter-chip-compact {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.55rem 0.95rem;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.filter-chip-compact:hover,
.filter-chip-compact:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.filter-chip-compact.match-filter-chip {
    border-color: rgba(6, 182, 212, 0.35);
}

.filter-chip-compact.match-filter-chip:hover,
.filter-chip-compact.match-filter-chip:focus-within {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.filter-chip-compact.rating-filter-chip {
    border-color: rgba(245, 158, 11, 0.35);
}

.filter-chip-compact.rating-filter-chip:hover,
.filter-chip-compact.rating-filter-chip:focus-within {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.filter-chip-icon {
    color: var(--accent-primary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.filter-chip-icon.text-cyan {
    color: #06b6d4;
}

.filter-chip-icon.text-warning {
    color: #f59e0b;
}

.filter-chip-icon.text-accent {
    color: var(--accent-primary);
}

.filter-select-compact {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 0 0.25rem 0 0 !important;
    margin: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.filter-select-compact option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem;
}

.filter-chevron-icon {
    font-size: 0.72rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: transform 0.2s ease, color 0.2s ease;
    margin-left: 0.15rem;
}

.filter-chip-compact:hover .filter-chevron-icon,
.filter-chip-compact:focus-within .filter-chevron-icon {
    color: var(--accent-primary);
}

/* ═══════════════════════════════════════════════
   🏷️ News Trending Card (Hashtags + Counter)
   ═══════════════════════════════════════════════ */
.news-trending-card {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 12px;
    padding: 0.55rem 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.trending-left-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
}

.results-pill-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 0.42rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
    flex-shrink: 0;
}

.results-pill-compact i {
    color: #ffffff;
    font-size: 0.84rem;
}

.results-pill-compact .counter-val {
    font-weight: 700;
    font-size: 0.92rem;
    color: #ffffff;
    font-family: var(--font-family-mono, monospace);
    background: rgba(255, 255, 255, 0.22);
    padding: 1px 6px;
    border-radius: 10px;
}

.results-pill-compact .counter-txt {
    font-size: 0.8rem;
    color: #ffffff;
    white-space: nowrap;
}

.trending-header {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.trending-fire-icon {
    color: #f59e0b;
    font-size: 0.9rem;
}

.trending-title {
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

.trending-chips-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.news-trend-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font-family-primary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    line-height: 1.35;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.news-trend-chip .hash-symbol {
    color: var(--accent-secondary);
    font-weight: 700;
    margin-right: 2px;
}

.news-trend-chip:hover {
    border-color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.14);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.news-trend-chip.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.news-trend-chip.active .hash-symbol {
    color: #ffffff !important;
}

.news-trend-chip .trend-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 10px;
    background: rgba(127, 127, 127, 0.16);
    color: var(--text-muted);
    line-height: 1.2;
    transition: all var(--transition-fast);
}

.news-trend-chip:hover .trend-count-badge {
    background: rgba(79, 70, 229, 0.25);
    color: var(--accent-primary);
}

.news-trend-chip.active .trend-count-badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

/* 📱 Responsive Filters & Trend Radar Optimization for Mobile */
@media (max-width: 768px) {
    .filters-subrow {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.45rem !important;
    }

    .filter-chip-compact {
        padding: 0.45rem 0.65rem !important;
        border-radius: 10px !important;
        min-width: 0 !important;
    }

    .filter-chip-compact .filter-chip-icon {
        font-size: 0.82rem !important;
    }

    .filter-select-compact {
        font-size: 0.8rem !important;
        max-width: 100% !important;
    }

    .news-trending-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.6rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    .news-results-actions-wrap {
        justify-content: space-between !important;
        width: 100% !important;
    }

    .trend-radar-glass-card {
        padding: 0.75rem 0.9rem !important;
    }

    /* 📱 Trend Radar Mobile Layout (≤768px): Donut Chart in alto + Elenco compatto sotto */
    .trend-radar-body-layout {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.85rem !important;
    }

    .trend-radar-chart-box {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.25rem 0 !important;
    }

    .trend-donut-container {
        width: 130px !important;
        height: 130px !important;
    }

    .trend-donut-total {
        font-size: 1.5rem !important;
    }

    .trend-radar-legend-box {
        width: 100% !important;
    }

    /* Stile Elenco Compatto su Mobile (1 Colonna Fluida per zero sbordature) */
    .trend-radar-items-grid {
        grid-template-columns: 1fr !important;
        gap: 0.4rem !important;
    }

    .trend-radar-item-card {
        padding: 0.45rem 0.65rem !important;
        min-height: unset !important;
        gap: 0.35rem !important;
    }

    .item-card-title {
        font-size: 0.76rem !important;
    }

    .item-card-pct {
        font-size: 0.74rem !important;
    }

    .item-card-count {
        font-size: 0.68rem !important;
    }
}

/* ═══════════════════════════════════════════════
   🏷️ Topic Cloud Card & Section (Home & Pages)
   ═══════════════════════════════════════════════ */
.topic-cloud-section {
    margin: 1.75rem 0 2.25rem 0;
}

.topic-cloud-card {
    position: relative;
    border-radius: calc(var(--border-radius-card, 16px) + 2px);
    padding: 2px;
    background: conic-gradient(
        from var(--ai-glow-angle, 0deg),
        rgba(99, 102, 241, 0.95) 0%,
        rgba(168, 85, 247, 0.95) 25%,
        rgba(6, 182, 212, 0.95) 50%,
        rgba(59, 130, 246, 0.95) 75%,
        rgba(99, 102, 241, 0.95) 100%
    );
    animation: aiGlowRotate 8s linear infinite;
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.25),
                0 0 15px 0 rgba(6, 182, 212, 0.16);
    transition: all 0.3s ease;
}

.topic-cloud-card:hover {
    box-shadow: 0 8px 24px 0 rgba(99, 102, 241, 0.35),
                0 0 16px 2px rgba(6, 182, 212, 0.22);
    transform: translateY(-2px);
}

.topic-cloud-inner {
    background: var(--bg-card);
    border-radius: var(--border-radius-card, 16px);
    padding: 1.25rem 1.5rem;
    width: 100%;
    position: relative;
}

.topic-cloud-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.topic-cloud-title-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    justify-self: start;
}

.topic-cloud-timeframe-center {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
}

.topic-cloud-cta-wrap {
    display: flex;
    align-items: center;
    justify-self: end;
}

@media (max-width: 900px) {
    .topic-cloud-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .topic-cloud-title-group {
        width: 100%;
        justify-self: stretch;
    }

    .topic-cloud-timeframe-center {
        width: 100%;
        justify-content: center;
        justify-self: stretch;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .topic-cloud-cta-wrap {
        width: 100%;
        justify-self: stretch;
    }

    .topic-cloud-cta-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 0.65rem 1rem;
    }
}

.topic-cloud-icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #818cf8;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.topic-cloud-icon {
    font-size: 1.35rem;
    color: #f59e0b;
}

.topic-cloud-title {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.topic-cloud-subtitle {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0 0;
    line-height: 1.35;
    letter-spacing: 0.005em;
}

.topic-cloud-radar-block {
    margin-bottom: 1.25rem;
    padding-bottom: 1.15rem;
    border-bottom: 1px dashed rgba(127, 127, 127, 0.2);
}

.topic-cloud-hashtags-block {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.topic-cloud-subhead {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.topic-cloud-chips-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.topic-cloud-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    font-size: 0.84rem;
    font-weight: 500;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface, var(--bg-card));
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.topic-cloud-btn .hash-symbol {
    color: var(--accent-secondary);
    font-weight: 700;
    margin-right: 3px;
}

.topic-cloud-btn .trend-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 1px 7px;
    font-size: 0.74rem;
    font-weight: 600;
    border-radius: 12px;
    background: rgba(127, 127, 127, 0.14);
    color: var(--text-muted);
    line-height: 1.2;
}

.topic-cloud-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.12);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.topic-cloud-btn:hover .trend-count-badge {
    background: rgba(79, 70, 229, 0.22);
    color: var(--accent-primary);
}

.topic-cloud-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 1.15rem;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.86rem;
    text-decoration: none;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
    white-space: nowrap;
}

.topic-cloud-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.42);
    color: #ffffff !important;
}

.topic-cloud-cta-btn i {
    font-size: 0.8rem;
    transition: transform var(--transition-fast);
}

.topic-cloud-cta-btn:hover i.fa-arrow-right {
    transform: translateX(3px);
}

/* ═══════════════════════════════════════════════
   🧠 Semantic Dashboard Card Styles
   ═══════════════════════════════════════════════ */
.semantic-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
}

.semantic-metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.1rem var(--spacing-md);
    text-align: center;
    transition: all var(--transition-normal);
}

.semantic-metric-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.semantic-metric-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.semantic-metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-family-primary);
    color: var(--text-primary);
}

.semantic-test-box {
    margin-top: var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md) var(--spacing-lg);
}

.semantic-test-result {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.1);
    border-left: 3px solid var(--accent-primary);
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--accent-secondary);
}

/* ══════════════════════════════════════════════════════════════
   ✨ AI GLOW / NEON BORDER ANIMATION (Card & Box)
   ══════════════════════════════════════════════════════════════ */
@property --ai-glow-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes aiGlowRotate {
    0% {
        --ai-glow-angle: 0deg;
    }
    100% {
        --ai-glow-angle: 360deg;
    }
}

/*----------------------------------------------
  13. CARDS SYSTEM
----------------------------------------------*/
.news-card {
    position: relative;
    border-radius: calc(var(--border-radius-card) + 2px);
    padding: 2px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.6) 0%, rgba(168, 85, 247, 0.4) 50%, rgba(6, 182, 212, 0.6) 100%);
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.2),
                0 0 12px 0 rgba(6, 182, 212, 0.12);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    overflow: hidden;
}

.news-card:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(168, 85, 247, 0.85) 50%, rgba(6, 182, 212, 0.95) 100%);
    box-shadow: 0 8px 24px 0 rgba(99, 102, 241, 0.35),
                0 0 16px 2px rgba(6, 182, 212, 0.22);
    transform: translateY(-3px);
    z-index: 10;
}

.news-card-inner {
    background: var(--bg-card);
    border-radius: var(--border-radius-card);
    border: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
}

.card-base {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow);
    transition: all var(--transition-normal);
    position: relative;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeInUp 0.6s ease forwards;
}

    .card-base:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px 0 rgba(99, 102, 241, 0.25), 0 0 14px 0 rgba(6, 182, 212, 0.15);
        border-color: var(--accent-primary);
        z-index: 10;
    }

.card-header {
    padding: var(--spacing-lg) var(--spacing-lg) 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.card-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
    padding-top: var(--spacing-xs);
    margin-top: auto;
}

.card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.publish-date {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 1.3rem;
    font-weight: 600;
}

    .publish-date i {
        font-size: 1.4rem;
    }

.card-title {
    font-family: var(--font-family-heading);
    font-size: 1.20rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    line-height: 1.35;
    min-height: 4.05em;
    position: relative;
    overflow: visible;
}

.card-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-normal);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-title a:hover {
    color: var(--accent-primary);
}

/* 🎯 Sleek Custom Tooltip per Card Title (stile /project) */
.card-title[data-tooltip] {
    position: relative;
    cursor: pointer;
}

.card-title[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: max-content;
    max-width: 340px;
    padding: 0.65rem 0.95rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    font-size: 0.85rem;
    font-family: var(--font-family-primary);
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    backdrop-filter: blur(12px);
    z-index: 1000;
}

.card-title[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.96) transparent transparent transparent;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1001;
}

.card-title[data-tooltip]:hover::after,
.card-title[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.card-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: justify;
    flex: 1;
}

.card-extra {
    text-align: justify;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.85rem;
    margin-bottom: 0.5rem;
    padding: 0;
    min-height: 28px;
}

.tag {
    display: inline-flex;
    align-items: baseline;
    gap: 0.15rem;
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.015em;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.3;
    user-select: none;
}

.tag .tag-hash {
    color: #818cf8;
    font-weight: 700;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.tag .tag-name {
    color: inherit;
    transition: color 0.2s ease;
}

.tag:hover {
    color: #ffffff !important;
    background: rgba(99, 102, 241, 0.15) !important;
    box-shadow: none !important;
}

.tag:hover .tag-hash {
    color: #a5b4fc !important;
}

/* ═══════════════════════════════════════════════
   💬 CARD SMART Q&A PILLS (Eye-Catching & Horizontal)
   ═══════════════════════════════════════════════ */
.card-smartqa-pills {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    margin-top: 0.55rem;
    margin-bottom: 0.45rem;
    padding: 0.35rem 0.5rem;
    background: rgba(99, 102, 241, 0.05);
    /* border: 1px solid rgba(99, 102, 241, 0.15); */
    border-radius: 8px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.smartqa-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.28rem 0.6rem;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    line-height: 1.2;
    user-select: none;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
}

.smartqa-pill-btn .pill-icon {
    font-size: 0.78rem;
    transition: transform 0.2s ease;
}

.smartqa-pill-btn.pill-simple {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.25);
    background: rgba(56, 189, 248, 0.08);
}
.smartqa-pill-btn.pill-simple:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(56, 189, 248, 0.35);
}

.smartqa-pill-btn.pill-proscons {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.25);
    background: rgba(251, 191, 36, 0.08);
}
.smartqa-pill-btn.pill-proscons:hover {
    background: rgba(251, 191, 36, 0.22);
    border-color: #fbbf24;
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(251, 191, 36, 0.35);
}

.smartqa-pill-btn.pill-future {
    color: #c084fc;
    border-color: rgba(192, 132, 252, 0.25);
    background: rgba(192, 132, 252, 0.08);
}
.smartqa-pill-btn.pill-future:hover {
    background: rgba(192, 132, 252, 0.22);
    border-color: #c084fc;
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(192, 132, 252, 0.35);
}

.smartqa-pill-btn:active {
    transform: scale(0.98);
}

.category-section {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0 0.5rem;
}

/* ═══════════════════════════════════════════════
   ⭐ CARD SEARCH META ROW & RATING STARS
   ═══════════════════════════════════════════════ */
.card-search-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.card-rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 3px 9px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 16px;
    font-size: 0.76rem;
    transition: all 0.2s ease;
}

.card-rating-badge:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

.card-rating-badge .rating-icon {
    color: #818cf8;
    font-size: 0.74rem;
}

.rating-stars-list {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.rating-stars-list .star-filled {
    color: #38bdf8;
    filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.6));
}

.rating-stars-list .star-empty {
    color: rgba(148, 163, 184, 0.3);
}

.rating-score-val {
    font-weight: 700;
    font-size: 0.76rem;
    font-family: var(--font-family-mono, monospace);
    color: #38bdf8;
    margin-left: 2px;
}

.card-match-badge-wrap {
    display: inline-flex;
    align-items: center;
}

.match-type-filter-modern select {
    border-color: rgba(6, 182, 212, 0.4) !important;
}

/*----------------------------------------------
  14. ARTICLE STRUCTURE
----------------------------------------------*/
.full-article {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.article-header {
    padding: 3rem 3rem 2rem;
    text-align: center;
    background: var(--bg-secondary);
}

.article-content {
    padding: 3rem;
    font-size: 1.125rem;
    padding-bottom: 10px;
    line-height: 1.8;
    color: var(--text-secondary);
}

    .article-content p {
        margin-bottom: 1.5rem;
    }

        .article-content p:first-child {
            font-size: 1.25rem;
            color: var(--text-primary);
            font-weight: 500;
        }

.article-footer {
    padding: 2rem 3rem 3rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.breadcrumb {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.article-header-compact {
    position: relative;
    border: 2px solid transparent !important;
    background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
                conic-gradient(
                    from var(--ai-glow-angle, 0deg),
                    rgba(99, 102, 241, 0.95) 0%,
                    rgba(168, 85, 247, 0.95) 25%,
                    rgba(6, 182, 212, 0.95) 50%,
                    rgba(59, 130, 246, 0.95) 75%,
                    rgba(99, 102, 241, 0.95) 100%
                ) border-box !important;
    border-radius: calc(var(--border-radius-card) + 2px) !important;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem;
    animation: aiGlowRotate 8s linear infinite;
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.25),
                0 0 15px 0 rgba(6, 182, 212, 0.16);
    transition: all 0.3s ease;
}

.article-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.article-date {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}



.article-title-main {
    font-family: var(--font-family-heading);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-lg) 0;
    line-height: 1.3;
}

.tags-compact {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.btn-as-link {
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    margin: 0;
    text-align: inherit;
    line-height: inherit;
    outline: none;
}

.tag-minimal {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(6, 182, 212, 0.08);
    color: var(--accent-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid rgba(6, 182, 212, 0.25);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

    .tag-minimal:hover {
        background: rgba(6, 182, 212, 0.2);
        border-color: var(--accent-secondary);
        box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
        transform: translateY(-2px);
        color: #ffffff;
    }

[data-theme="light"] .tag-minimal {
    background: rgba(6, 182, 212, 0.08);
    color: #0891b2;
    border-color: rgba(6, 182, 212, 0.3);
}

[data-theme="light"] .tag-minimal:hover {
    background: rgba(6, 182, 212, 0.18);
    border-color: #0891b2;
    color: #0e7490;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.category-compact,
.category-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    white-space: nowrap;
    gap: 0.35rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid rgba(99, 102, 241, 0.25);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

    .category-compact:hover,
    .category-badge:hover {
        background: rgba(99, 102, 241, 0.22);
        border-color: var(--accent-primary);
        box-shadow: 0 0 14px rgba(99, 102, 241, 0.45);
        transform: translateY(-2px);
        color: #ffffff;
    }

/* ═══════════════════════════════════════════════
   🔗 ARTICLE SHARE BAR (Zero-Tracking / Privacy First)
   ═══════════════════════════════════════════════ */
.article-share-bar {
    position: relative;
    border: 2px solid transparent !important;
    background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
                conic-gradient(
                    from var(--ai-glow-angle, 0deg),
                    rgba(99, 102, 241, 0.95) 0%,
                    rgba(168, 85, 247, 0.95) 25%,
                    rgba(6, 182, 212, 0.95) 50%,
                    rgba(59, 130, 246, 0.95) 75%,
                    rgba(99, 102, 241, 0.95) 100%
                ) border-box !important;
    border-radius: calc(var(--border-radius-card) + 2px) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0 2rem;
    animation: aiGlowRotate 8s linear infinite;
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.25),
                0 0 15px 0 rgba(6, 182, 212, 0.16);
    transition: all 0.3s ease;
}

.share-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.share-label i {
    color: var(--accent-primary);
}

.share-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.share-copy {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent-primary);
}

.share-copy:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent-primary);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.35);
    color: #ffffff;
}

.share-copy.copied {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

.share-wa:hover {
    background: #25d366;
    border-color: #25d366;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(37, 211, 102, 0.4);
}

.share-tg:hover {
    background: #0088cc;
    border-color: #0088cc;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(0, 136, 204, 0.4);
}

.share-x:hover {
    background: #111111;
    border-color: #555555;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════════════════
   🎵 TTS Sound Wave Visualizer (Onde Audio Animate)
   ═══════════════════════════════════════════════ */
.tts-soundwave {
    display: inline-flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 14px;
    margin-left: 0.6rem;
    vertical-align: middle;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.tts-soundwave.playing {
    opacity: 1;
    transform: scale(1);
}

.tts-soundwave span {
    display: inline-block;
    width: 2.5px;
    background: linear-gradient(180deg, var(--accent-secondary, #06b6d4), var(--accent-primary, #6366f1));
    border-radius: 1.5px;
    height: 3px;
    transition: height 0.2s ease;
}

[data-theme="light"] .tts-soundwave span {
    background: linear-gradient(180deg, #0284c7 0%, #4f46e5 100%);
}

.tts-soundwave.playing span:nth-child(1) { animation: soundwaveAnim 0.8s ease-in-out infinite 0.1s; }
.tts-soundwave.playing span:nth-child(2) { animation: soundwaveAnim 0.8s ease-in-out infinite 0.3s; }
.tts-soundwave.playing span:nth-child(3) { animation: soundwaveAnim 0.8s ease-in-out infinite 0.2s; }
.tts-soundwave.playing span:nth-child(4) { animation: soundwaveAnim 0.8s ease-in-out infinite 0.4s; }

@keyframes soundwaveAnim {
    0%, 100% { height: 3px; }
    50% { height: 14px; }
}

.accademico {
    position: relative;
    border: 2px solid transparent !important;
    background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
                conic-gradient(
                    from var(--ai-glow-angle, 0deg),
                    rgba(99, 102, 241, 0.95) 0%,
                    rgba(168, 85, 247, 0.95) 25%,
                    rgba(6, 182, 212, 0.95) 50%,
                    rgba(59, 130, 246, 0.95) 75%,
                    rgba(99, 102, 241, 0.95) 100%
                ) border-box !important;
    border-radius: calc(var(--border-radius-card) + 2px) !important;
    margin: 2rem 0;
    animation: aiGlowRotate 8s linear infinite;
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.25),
                0 0 15px 0 rgba(6, 182, 212, 0.16);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.accademico .content-card {
    background: transparent;
    border: none !important;
    margin-bottom: 0;
    box-shadow: none !important;
    overflow: hidden;
}

.accademico article {
    hyphens: auto;
    -webkit-hyphens: auto;
    font-family: 'Crimson Pro', serif;
    font-size: 1.15rem;
    line-height: 1.8;
    text-align: justify;
    text-justify: inter-word;
    word-wrap: break-word;
    margin: 0;
    padding: 0;
}

.content-card {
    position: relative;
    border: 2px solid transparent !important;
    background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
                conic-gradient(
                    from var(--ai-glow-angle, 0deg),
                    rgba(99, 102, 241, 0.95) 0%,
                    rgba(168, 85, 247, 0.95) 25%,
                    rgba(6, 182, 212, 0.95) 50%,
                    rgba(59, 130, 246, 0.95) 75%,
                    rgba(99, 102, 241, 0.95) 100%
                ) border-box !important;
    border-radius: calc(var(--border-radius-card) + 2px) !important;
    margin-bottom: var(--spacing-lg);
    animation: aiGlowRotate 8s linear infinite;
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.25),
                0 0 15px 0 rgba(6, 182, 212, 0.16);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card-header-minimal {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    position: relative;
}

    .card-header-minimal h3 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-primary);
    }

.header-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.content-body {
    padding: var(--spacing-xl);
    font-size: var(--article-font-size, 1.08rem) !important;
    line-height: 1.8;
    color: var(--text-primary);
    text-align: justify;
}

    .content-body p {
        font-size: inherit !important;
        color: var(--text-primary);
        font-weight: 400;
        margin-bottom: 1.25rem;
    }

    .content-body p:first-child {
        color: var(--text-primary);
        font-weight: 400;
    }

/* Capolettera in apertura del contenuto principale (non del box "Bonus": scoped con figlio diretto) */
.content-card > .content-body p:first-child::first-letter {
    font-family: var(--font-family-heading);
    font-size: 3.4em;
    font-weight: 700;
    float: left;
    line-height: 0.8;
    padding: 0.05em 0.08em 0 0;
    color: var(--accent-primary);
}

/* Fascia titolo in cima ai box "Articolo" e "Bonus": li fa risaltare senza essere vistosa.
   Testo su --text-primary (contrasto garantito in entrambi i temi, l'accento sul solo
   colore diretto rendeva il viola illeggibile su sfondo scuro); sfondo a sfumatura invece
   di un rettangolo piatto con bordo netto, per un bordo morbido invece che "tagliato". */
.section-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 0;
    padding: 0.85rem var(--spacing-xl) 0.7rem;
    font-family: var(--font-family-heading);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    /* Angoli superiori arrotondati come la card: non fidarsi solo del clip via overflow:hidden del genitore */
    border-radius: var(--border-radius-card) var(--border-radius-card) 0 0;
}

.section-band-title {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.font-size-controls {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 4px;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.font-size-controls:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12), 0 4px 12px rgba(99, 102, 241, 0.18);
}

.font-size-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 24px;
    padding: 0 7px;
    border-radius: 9999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    font-family: var(--font-family-primary);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    line-height: 1;
}

.font-size-btn i {
    font-size: 0.55rem;
    opacity: 0.85;
    transition: transform 0.18s ease;
}

.font-size-btn span {
    font-size: 0.80rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.font-size-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.4);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
    transform: translateY(-0.5px);
}

.font-size-btn:hover:not(:disabled) i {
    transform: scale(1.15);
}

.font-size-btn:active:not(:disabled) {
    transform: scale(0.95);
    background: rgba(99, 102, 241, 0.35);
}

.font-size-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    background: transparent !important;
    border-color: transparent !important;
}

.font-size-controls .scaler-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 22px;
    padding: 0 6px;
    font-family: var(--font-family-primary);
    font-variant-numeric: tabular-nums;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--accent-light, #a5b4fc);
    background: rgba(99, 102, 241, 0.12);
    border-radius: 9999px;
    border: 1px solid rgba(99, 102, 241, 0.22);
    user-select: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

/* 🔍 Pinch Zoom Floating Feedback Toast */
.pinch-zoom-toast {
    position: fixed;
    top: 75px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    border: 1px solid rgba(99, 102, 241, 0.45);
    border-radius: 30px;
    padding: 0.5rem 1.1rem;
    font-size: 0.86rem;
    font-weight: 600;
    font-family: var(--font-family-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.25s ease;
    z-index: 9999;
    pointer-events: none;
    user-select: none;
}

.pinch-zoom-toast i {
    color: var(--accent-primary, #6366f1);
}

.pinch-zoom-toast strong {
    color: #38bdf8;
    margin-left: 2px;
}

.pinch-zoom-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

    .section-band i {
        font-size: 0.9em;
    }

.section-band-primary {
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.18), rgba(6, 182, 212, 0));
}

    .section-band-primary i {
        color: var(--accent-secondary, #06b6d4);
    }

.section-band-secondary {
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.18), rgba(6, 182, 212, 0));
}

    .section-band-secondary i {
        color: var(--accent-secondary, #06b6d4);
    }

/* ═══════════════════════════════════════════════
   🔊 TTS (Text-to-Speech) Player
   ═══════════════════════════════════════════════ */
.tts-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem var(--spacing-xl);
    margin: 0;
    background: var(--tts-bg, rgba(79, 70, 229, 0.06));
    border-bottom: 1px solid var(--tts-border, rgba(79, 70, 229, 0.12));
    font-family: var(--font-family-heading);
    font-size: 0.85rem;
    transition: all var(--transition-normal);
    user-select: none;
    box-sizing: border-box;
}

.tts-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.22rem 0.5rem;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.tts-badge-hd {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(147, 51, 234, 0.15));
    color: var(--accent-primary, #6366f1);
    border: 1px solid rgba(147, 51, 234, 0.3);
}

.tts-badge-standard {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted, #64748b);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.tts-hd-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.tts-audio-element {
    flex: 1;
    display: block;
    height: 36px;
    min-width: 0;
    border-radius: 18px;
    outline: none;
}

.tts-player.tts-hidden {
    display: none;
}

.tts-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--tts-btn-bg, var(--accent-primary));
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    padding: 0;
}

.tts-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px var(--tts-btn-shadow, rgba(79, 70, 229, 0.4));
}

.tts-btn:active {
    transform: scale(0.95);
}

.tts-btn.tts-stop {
    background: var(--tts-stop-bg, rgba(127, 127, 127, 0.25));
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.tts-btn.tts-stop:hover {
    background: rgba(220, 38, 38, 0.7);
    color: #fff;
}

.tts-progress-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.tts-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--tts-track-bg, rgba(127, 127, 127, 0.2));
    border-radius: 2px;
    overflow: hidden;
    min-width: 60px;
}

.tts-progress-fill {
    height: 100%;
    background: var(--tts-fill-bg, linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)));
    border-radius: 2px;
    width: 0%;
    transition: width 0.4s ease;
}

.tts-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.tts-player.tts-playing .tts-label {
    color: var(--accent-primary);
}

.tts-status-icon {
    margin-right: 0.2rem;
    font-size: 0.8rem;
}

.tts-status-icon.playing {
    color: var(--accent-primary, #6366f1);
}

.tts-status-icon.paused {
    color: var(--text-muted, #64748b);
}

/* Pulsing animation on play button when active */
.tts-player.tts-playing .tts-btn.tts-play {
    animation: tts-pulse 1.8s ease-in-out infinite;
}

@keyframes tts-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(79, 70, 229, 0); }
}

.source-details {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.authors-info-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.authors-list-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.author-chip {
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.source-date-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.95rem;
}

.source-link-compact {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 8px;
    text-decoration: none;
    transition: all var(--transition-normal);
}

    .source-link-compact:hover {
        background: rgba(6, 182, 212, 0.1);
        border-color: var(--accent-secondary);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
    }

.source-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.source-text {
    flex: 1;
}

.source-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.source-domain {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.source-arrow {
    color: var(--accent-secondary);
    transition: transform var(--transition-normal);
}

.source-link-compact:hover .source-arrow {
    transform: translateX(4px);
}

/* ═══════════════════════════════════════════════
   ↔️ ARTICLE ADJACENT NAVIGATION (Prev / Next Grid)
   ═══════════════════════════════════════════════ */
.article-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.75rem;
}

.article-nav-strip {
    position: relative;
    border: 2px solid transparent !important;
    background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
                conic-gradient(
                    from var(--ai-glow-angle, 0deg),
                    rgba(99, 102, 241, 0.95) 0%,
                    rgba(168, 85, 247, 0.95) 25%,
                    rgba(6, 182, 212, 0.95) 50%,
                    rgba(59, 130, 246, 0.95) 75%,
                    rgba(99, 102, 241, 0.95) 100%
                ) border-box !important;
    border-radius: calc(var(--border-radius-card) + 2px) !important;
    animation: aiGlowRotate 8s linear infinite;
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.25),
                0 0 15px 0 rgba(6, 182, 212, 0.16);
    transition: all var(--transition-normal);
    display: flex;
    overflow: hidden;
}

.article-nav-strip:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px 0 rgba(99, 102, 241, 0.35), 0 0 16px 2px rgba(6, 182, 212, 0.22);
}

.article-nav-strip-link {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.9rem 1.25rem;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.article-nav-strip-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.article-nav-strip.next .article-nav-strip-header {
    justify-content: flex-end;
}

.article-nav-strip-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary, #6366f1);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.article-nav-strip-cat {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--accent-secondary, #06b6d4);
    background: rgba(6, 182, 212, 0.1);
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
}

.article-nav-strip-main {
    display: flex;
    align-items: center;
}

.article-nav-strip.next .article-nav-strip-title {
    text-align: right;
}

.article-nav-strip-title {
    font-family: var(--font-family-heading, 'Playfair Display', serif);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.article-nav-strip:hover .article-nav-strip-title {
    color: var(--accent-primary, #6366f1);
}

.article-nav-back-row {
    margin-top: 0.75rem;
}

.article-nav-strip.back {
    cursor: pointer;
}

/* 🚀 ARTICLE & DOCUMENT CTA CARD & ACTION BUTTONS */
.article-cta-card,
.document-cta-card,
.news-bottom-cta {
    margin-top: 1.75rem !important;
}

.cta-actions-group {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cta-actions-group .cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.52rem 1.25rem;
    border-radius: 24px;
    font-size: 0.86rem;
    font-weight: 600;
    min-width: auto;
    width: auto;
    text-decoration: none;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
    white-space: nowrap;
}

.cta-actions-group .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.42);
}

.cta-actions-group .cta-button i {
    font-size: 0.82rem;
    transition: transform var(--transition-fast);
}

.cta-actions-group .cta-button:hover i.fa-arrow-right {
    transform: translateX(3px);
}

.cta-button-secondary {
    background: var(--bg-surface, var(--bg-card)) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.cta-button-secondary:hover {
    background: rgba(79, 70, 229, 0.12) !important;
    border-color: var(--accent-primary) !important;
    color: var(--accent-primary) !important;
    transform: translateY(-2px);
}

/*----------------------------------------------
  15. LOADING & STATES
----------------------------------------------*/
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

.loading-section,
.loading-container {
    text-align: center;
    padding: 4rem var(--spacing-xl);
}

    .loading-container p {
        margin-top: var(--spacing-md);
        color: var(--text-secondary);
    }

/* ═══════════════════════════════════════════════
   🧠 AI Processing Loader (Search & Filtering)
   ═══════════════════════════════════════════════ */
.ai-processing-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1.5rem;
    margin: 1rem 0 2rem;
    text-align: center;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ai-pulse-brain {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.brain-glow-icon {
    font-size: 2rem;
    color: #38bdf8;
    z-index: 2;
    animation: brainPulse 2s ease-in-out infinite;
}

.ai-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, 0.6);
    animation: pulseRing 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.ai-pulse-ring.delay {
    animation-delay: 1s;
}

@keyframes brainPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.9));
    }
}

@keyframes pulseRing {
    0% {
        transform: scale(0.6);
        opacity: 1;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.ai-processing-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}

.ai-processing-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    max-width: 480px;
}

.no-results {
    text-align: center;
    padding: 4rem var(--spacing-xl);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.no-results h2,
.no-results h3 {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.no-results p {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xl);
    color: var(--text-secondary);
}

.load-more-section {
    text-align: center;
    padding: var(--spacing-xl);
}

/*----------------------------------------------
  16. UTILITY SECTIONS
----------------------------------------------*/
.all-news-section {
    text-align: center;
    margin-top: var(--spacing-2xl);
}

.title-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.article-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--spacing-xl);
}

    .article-actions .btn-primary,
    .article-actions .btn-secondary {
        min-width: 160px;
        justify-content: center;
    }

/*----------------------------------------------
  17. EXPERT CONTENT
----------------------------------------------*/
.expert-content {
    margin: 3rem 0;
    padding: 0;
    border-top: 3px solid var(--accent-primary);
    border-bottom: 3px solid var(--accent-primary);
}

.expert-header {
    padding: 2rem 3rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

    .expert-header h3 {
        color: var(--accent-primary);
        margin: 0 0 0.5rem 0;
        font-size: 1.4rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .expert-header p {
        color: var(--text-muted);
        margin: 0;
        font-size: 0.95rem;
        font-style: italic;
    }

.expert-body {
    padding: 2rem 3rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

    .expert-body p {
        margin-bottom: 1.5rem;
        color: var(--text-secondary);
    }

        .expert-body p:first-child {
            color: var(--text-primary);
            font-weight: 500;
        }

/*----------------------------------------------
  18. FOOTER SYSTEM
----------------------------------------------*/
.minimal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-index-footer);
    padding: 1.2rem 0;
    background: var(--footer-bg);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .minimal-footer.hidden {
        transform: translateY(100%);
    }

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 var(--spacing-xl);
    gap: 0.65rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
}

    .footer-links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
        color: var(--text-secondary);
        text-decoration: none;
        font-weight: 500;
        padding: 0.5rem 0.6rem;
        border-radius: var(--border-radius);
        background: rgba(79, 70, 229, 0.05);
        border: 1px solid rgba(79, 70, 229, 0.2);
        transition: all var(--transition-normal);
        position: relative;
        overflow: hidden;
        text-align: center;
        white-space: nowrap;
    }

    .footer-links a i {
        font-size: 0.95rem;
        flex-shrink: 0;
    }

    .footer-links a .footer-link-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.88rem;
    }

@media (max-width: 1024px) and (min-width: 769px) {
    .footer-links {
        grid-template-columns: repeat(3, 1fr);
        max-width: 650px;
    }
}

        .footer-links a::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.2), transparent);
            transition: left 0.5s;
        }

        .footer-links a:hover {
            color: var(--accent-primary);
            background: rgba(79, 70, 229, 0.1);
            border-color: var(--accent-primary);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
        }

            .footer-links a:hover::before {
                left: 100%;
            }

.footer-copyright {
    text-align: center;
    width: 100%;
}

    .footer-copyright p {
        color: var(--text-muted);
        font-size: 0.8rem;
        margin: 0;
        line-height: 1.4;
    }

.powered-by {
    font-size: 0.78rem !important;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-family: inherit;
}

    .powered-by .highlight {
        color: var(--accent-primary);
        font-weight: 700;
        text-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
    }

    .powered-divider {
        color: var(--text-muted);
        opacity: 0.45;
        padding: 0 0.15rem;
    }

/*----------------------------------------------
  19. LEGAL PAGES SYSTEM
----------------------------------------------*/
.legal-page {
    min-height: 100vh;
    background: var(--bg-primary);
    padding: 0.75rem 0 2rem;
}

.legal-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 2px solid var(--border-color);
}

.legal-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0;
}

.legal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-2xl);
}

.legal-section {
    margin-bottom: var(--spacing-2xl);
}

    .legal-section:last-child {
        margin-bottom: 0;
    }

    .legal-section h2 {
        color: var(--accent-primary);
        font-size: 1.5rem;
        margin-bottom: var(--spacing-lg);
        padding-bottom: var(--spacing-sm);
        border-bottom: 2px solid rgba(79, 70, 229, 0.2);
    }

    .legal-section p {
        color: var(--text-secondary);
        font-family: 'Crimson Pro', serif;
        font-size: 1.15rem;
        line-height: 1.8;
        margin-bottom: var(--spacing-md);
        text-align: justify !important;
        text-justify: inter-word !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
    }

    .legal-section ul, .legal-section ol {
        color: var(--text-secondary);
        margin: var(--spacing-md) 0;
        padding-left: var(--spacing-xl);
    }

    .legal-section li {
        font-family: 'Crimson Pro', serif;
        font-size: 1.15rem;
        margin-bottom: var(--spacing-sm);
        line-height: 1.7;
        text-align: justify !important;
        text-justify: inter-word !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
    }

    .legal-section strong {
        color: var(--text-primary);
        font-weight: 600;
    }

    .legal-section a {
        color: var(--accent-primary);
        text-decoration: none;
        font-weight: 500;
    }

        .legal-section a:hover {
            color: var(--accent-secondary);
            text-decoration: underline;
        }

.legal-highlight {
    background: rgba(79, 70, 229, 0.05);
    border: 2px solid rgba(79, 70, 229, 0.2);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

    .legal-highlight p {
        color: var(--text-primary) !important;
        margin: 0;
    }

.legal-note {
    background: rgba(99, 102, 241, 0.04);
    border-left: 4px solid var(--accent-primary, #6366f1);
    border-radius: 0 var(--border-radius, 8px) var(--border-radius, 8px) 0;
    padding: var(--spacing-md) var(--spacing-lg);
    margin: var(--spacing-md) 0;
}

    .legal-note p {
        margin: 0;
        font-size: 1rem;
        color: var(--text-secondary);
    }

.legal-warning {
    background: rgba(245, 158, 11, 0.05);
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

    .legal-warning p {
        color: #f59e0b !important;
        margin: 0;
        font-weight: 500;
    }

.contact-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

    .contact-info h4 {
        color: var(--accent-primary);
        margin: 0 0 var(--spacing-sm) 0;
    }

    .contact-info p {
        margin: var(--spacing-sm) 0;
    }

.document-footer-wrap {
    display: flex;
    justify-content: center;
    margin: var(--spacing-xl) 0 var(--spacing-sm);
}

.document-footer-meta, .legal-footer-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    color: var(--text-muted);
    padding: 0.55rem 1.35rem;
    background: var(--bg-card, rgba(127,127,127,0.06));
    border: 1px solid var(--border-color, rgba(127,127,127,0.18));
    border-radius: var(--border-radius-pill, 50px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.legal-actions {
    text-align: center;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
    border-radius: var(--border-radius-button);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
}

    .back-btn:hover {
        background: var(--accent-primary);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    }

/*----------------------------------------------
  20. HERO PARALLAX SECTION (High-Performance GPU)
----------------------------------------------*/
.hero-parallax-section {
    position: relative;
    border-radius: calc(var(--border-radius-card) + 4px);
    padding: 2px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.8) 0%, rgba(168, 85, 247, 0.6) 50%, rgba(6, 182, 212, 0.8) 100%);
    box-shadow: 0 4px 24px -2px rgba(99, 102, 241, 0.25),
                0 0 16px 0 rgba(6, 182, 212, 0.16);
    overflow: hidden;
    min-height: 400px;
    max-height: 400px;
    opacity: 1;
    margin-bottom: 2rem;
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                min-height 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                margin-bottom 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-parallax-section.hide {
    opacity: 0;
    max-height: 0 !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0 !important;
    transform: translateY(-20px) scale(0.98);
    pointer-events: none;
}

.hero-parallax-bg {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: calc(var(--border-radius-card) + 2px);
    background: var(--bg-card);
    opacity: 0.96;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.hero-content {
    text-align: center;
    max-width: 600px;
    padding: var(--spacing-xl);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: rgba(79, 70, 229, 0.15);
    color: var(--accent-primary);
    padding: 0.5rem var(--spacing-lg);
    border-radius: var(--border-radius-badge);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    border: 1px solid rgba(79, 70, 229, 0.3);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-family: var(--font-family-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-lg) 0;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.floating-element {
    position: absolute;
    z-index: 5;
    opacity: 0.6;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

.circle-1 {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(6, 182, 212, 0.1));
    border-radius: 50%;
    top: 20%;
    left: 10%;
    animation: float1 6s infinite;
}

.circle-2 {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(79, 70, 229, 0.1));
    border-radius: 50%;
    top: 60%;
    right: 15%;
    animation: float2 8s infinite;
}

.triangle-1 {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 50px solid rgba(79, 70, 229, 0.15);
    top: 30%;
    right: 25%;
    animation: float3 7s infinite;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 500;
    background: linear-gradient(to right, #7c3aed, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

    .hero-subtitle.fade-out {
        opacity: 0;
        transform: scale(0.98);
    }

    .hero-subtitle.fade-in {
        opacity: 1;
        transform: scale(1.02);
    }

/*----------------------------------------------
  21. CTA CARD - HOMEPAGE CALL TO ACTION
----------------------------------------------*/
.cta-card {
    position: relative;
    border: 2px solid transparent !important;
    background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
                conic-gradient(
                    from var(--ai-glow-angle, 0deg),
                    rgba(99, 102, 241, 0.95) 0%,
                    rgba(168, 85, 247, 0.95) 25%,
                    rgba(6, 182, 212, 0.95) 50%,
                    rgba(59, 130, 246, 0.95) 75%,
                    rgba(99, 102, 241, 0.95) 100%
                ) border-box !important;
    border-radius: calc(var(--border-radius-card) + 2px) !important;
    margin-top: var(--spacing-2xl);
    animation: aiGlowRotate 8s linear infinite;
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.25),
                0 0 15px 0 rgba(6, 182, 212, 0.16);
    overflow: hidden;
    transition: all var(--transition-normal);
}

    .cta-card:hover {
        box-shadow: 0 8px 24px 0 rgba(99, 102, 241, 0.35), 0 0 16px 2px rgba(6, 182, 212, 0.22) !important;
        transform: translateY(-3px);
    }

    .cta-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
        opacity: 0;
        transition: opacity var(--transition-normal);
    }

    .cta-card:hover::before {
        opacity: 1;
    }

.cta-content {
    padding: 1.6rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.cta-text {
    max-width: 620px;
    text-align: center;
}

    .cta-text h3 {
        font-family: var(--font-family-heading);
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0 0 0.35rem 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        line-height: 1.3;
    }

    .cta-text h3 i {
        color: #f59e0b;
        font-size: 1.15rem;
    }

    .cta-text p {
        color: var(--text-secondary);
        margin: 0;
        font-size: 0.88rem;
        line-height: 1.45;
    }

.cta-actions-group {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 0.4rem;
}

.cta-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-button);
    font-weight: 600;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    min-width: 160px;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

    .cta-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transition: left 0.5s;
    }

    .cta-button:hover {
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
        color: white;
        text-decoration: none;
    }

        .cta-button:hover::before {
            left: 100%;
        }

        .cta-button:hover i {
            transform: translateX(4px);
        }

    .cta-button i {
        transition: transform var(--transition-normal);
    }

/*----------------------------------------------
  22. DASHBOARD SYSTEM
----------------------------------------------*/
.dashboard-container {
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #ffffff;
}

.dashboard-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

    .dashboard-header h2 {
        color: #ffffff;
        text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1600px;
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    color: #ffffff;
}

    .dashboard-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 40px rgba(0,0,0,0.4);
        border-color: rgba(255, 255, 255, 0.3);
    }

.dashboard-card-header {
    padding: 12px 20px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    min-height: 50px;
}

    .dashboard-card-header h5 {
        font-size: 0.85rem !important;
        white-space: nowrap;
    }

.dashboard-card-body {
    padding: 20px;
    color: #ffffff !important;
}

/* ══════════════════════════════════════════════════════════════
   🎨 DASHBOARD CARDS COLOR ACCENTS (/Sched)
   Top border accents & distinctive ambient glow for each module
   ══════════════════════════════════════════════════════════════ */
/* 1. Tool Hub (Arancio Caldo) */
.tool-hub-box,
.tool-hub-header {
    border-top: 2px solid #f97316 !important;
}
.tool-hub-box:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 -2px 14px rgba(249, 115, 22, 0.22) !important;
}

/* 2. Monitor Contenuti & Media (Azzurro Cielo) */
.content-monitor-card,
.content-monitor-header {
    border-top: 2px solid #0ea5e9 !important;
}
.content-monitor-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 -2px 14px rgba(14, 165, 233, 0.22) !important;
}

/* 3. Monitor Risorse & Sistema (Indaco Elettrico) */
.metrics-dashboard-card,
.metrics-card-header {
    border-top: 2px solid #6366f1 !important;
}
.metrics-dashboard-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 -2px 14px rgba(99, 102, 241, 0.22) !important;
}

/* 4. Ricerca Semantica AI (Viola AI) */
.semantic-card,
.semantic-card-header {
    border-top: 2px solid #a855f7 !important;
}
.semantic-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 -2px 14px rgba(168, 85, 247, 0.22) !important;
}

/* 5. Centro Indicizzazione SEO (Verde Smeraldo) */
.seo-card,
.seo-card-header {
    border-top: 2px solid #10b981 !important;
}
.seo-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 -2px 14px rgba(16, 185, 129, 0.22) !important;
}

/* 6. Workflow Editoriale Dinamico (Rosa Corallo) */
.wf-dashboard-card,
.wf-card-header {
    border-top: 2px solid #f43f5e !important;
}
.wf-dashboard-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 -2px 14px rgba(244, 63, 94, 0.22) !important;
}

/* 7. Automazione & Schedulatore Quartz (Blu Cobalto) */
.scheduler-unified-card,
.scheduler-unified-header {
    border-top: 2px solid #3b82f6 !important;
}
.scheduler-unified-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 -2px 14px rgba(59, 130, 246, 0.22) !important;
}

/* ⏱️ Unified Scheduler Grid & Sub-Columns */
.scheduler-unified-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.scheduler-col {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-fast);
}

.scheduler-col:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.scheduler-col.col-programming {
    border-top: 2px solid #14b8a6 !important;
}
.scheduler-col.col-programming .scheduler-col-title {
    color: #14b8a6;
}

.scheduler-col.col-controls {
    border-top: 2px solid #3b82f6 !important;
}
.scheduler-col.col-controls .scheduler-col-title {
    color: #3b82f6;
}

.scheduler-col.col-stats {
    border-top: 2px solid #eab308 !important;
}
.scheduler-col.col-stats .scheduler-col-title {
    color: #eab308;
}

.scheduler-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.5rem;
}

.scheduler-col-title {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.scheduler-col-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    white-space: nowrap;
}

.scheduler-col-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

/* 10. Gestione Backup Database & Audio (Verde Lime) */
.backup-card,
.backup-card-header {
    border-top: 2px solid #84cc16 !important;
}
.backup-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 -2px 14px rgba(132, 204, 22, 0.22) !important;
}

/* 11. Registro Log & Attività Server (Fucsia Magenta) */
.activity-card,
.log-activity-header {
    border-top: 2px solid #ec4899 !important;
}
.activity-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 -2px 14px rgba(236, 72, 153, 0.22) !important;
}

/* ═══════════════════════════════════════════════
   📊 ESECUZIONI & STATISTICHE CARD STYLES
   ═══════════════════════════════════════════════ */
.exec-info-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px 12px;
}

.exec-info-title {
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    white-space: nowrap;
}

.exec-info-time {
    font-size: 1.4rem;
    font-weight: 800;
    color: #38bdf8 !important;
    line-height: 1;
}

.exec-info-date {
    font-size: 0.82rem;
    color: #94a3b8;
    white-space: nowrap;
}

.exec-badge-time {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: auto !important;
    text-align: right !important;
    display: inline-block !important;
}

.btn-delete-time {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    font-size: 0.75rem !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    line-height: 1 !important;
}

.btn-delete-time:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* ═══════════════════════════════════════════════
   ⏰ SCHEDULE ITEM & ACTION BUTTON STYLES
   ═══════════════════════════════════════════════ */
.schedule-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding: 8px 12px !important;
    background: rgba(0, 0, 0, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
}

.schedule-time-badge {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    letter-spacing: 0.05em !important;
}

.btn-save-schedule {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    border: 1px solid #34d399 !important;
    color: #ffffff !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
    transition: all 0.2s ease !important;
}

.btn-save-schedule:hover {
    background: linear-gradient(135deg, #047857, #059669) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5) !important;
}

.btn-revert-schedule {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #cbd5e1 !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

.btn-revert-schedule:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.custom-stat-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.custom-stat-table th {
    padding: 8px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.custom-stat-table th.th-totali { color: #cbd5e1 !important; }
.custom-stat-table th.th-successi { color: #34d399 !important; }
.custom-stat-table th.th-errori { color: #f87171 !important; }

.custom-stat-table td {
    padding: 10px 12px;
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
}

.custom-stat-table td.td-totali { color: #ffffff !important; }
.custom-stat-table td.td-successi { color: #10b981 !important; text-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
.custom-stat-table td.td-errori { color: #ef4444 !important; text-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }

/* ═══════════════════════════════════════════════
   🧠 SEMANTIC CARD & 📝 PERSISTENT ACTIVITY LOG (FULL WIDTH)
   ═══════════════════════════════════════════════ */
.semantic-card,
.activity-card {
    grid-column: 1 / -1 !important;
}

.semantic-split-container {
    display: grid !important;
    grid-template-columns: 1fr 1.3fr !important;
    gap: 1.5rem !important;
    align-items: stretch !important;
    min-width: 0 !important;
    width: 100% !important;
}

.semantic-left-col {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    min-width: 0 !important;
}

.semantic-right-col {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
}

.semantic-metrics-3col {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.65rem !important;
    min-width: 0 !important;
}

@media (max-width: 992px) {
    .semantic-split-container {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
}

.dashboard-btn-danger {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    border: 1px solid rgba(252, 165, 165, 0.4) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 0.35rem 0.85rem !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

.dashboard-btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c, #dc2626) !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5) !important;
    transform: translateY(-1px);
    color: #ffffff !important;
}

.dashboard-btn-danger:disabled,
.dashboard-btn-danger[disabled] {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-reindex-vectors {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    border: 1px solid rgba(147, 197, 253, 0.4) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 0.35rem 0.85rem !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

.btn-reindex-vectors:hover {
    background: linear-gradient(135deg, #0369a1, #0284c7) !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.5) !important;
    transform: translateY(-1px);
    color: #ffffff !important;
}

.btn-reindex-vectors:disabled,
.btn-reindex-vectors[disabled] {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

.inspector-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 4px 6px 4px 12px;
    transition: all 0.25s ease;
}

.inspector-search-bar:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.inspector-search-input {
    flex: 1;
    min-width: 0 !important;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #ffffff !important;
    font-size: 0.85rem;
    font-family: inherit;
    padding: 4px 0;
}

.inspector-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.activity-log {
    max-height: 480px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 6px;
    font-family: monospace;
    font-size: 0.88rem;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    line-height: 1.45;
    word-break: break-word;
}

.log-entry.log-success {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.log-entry.log-error {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
}

.log-entry.log-warning {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.log-entry.log-info {
    border-left-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.log-time {
    font-weight: 700;
    color: #818cf8;
    white-space: nowrap;
    font-size: 0.82rem;
}

.log-message {
    flex: 1;
}

/* ══════════════════════════════════════════════════════════════
   📡 SEO & WEB INDEXING HUB (Search Console, SERP, Schema.org)
   ══════════════════════════════════════════════════════════════ */
.seo-card {
    grid-column: 1 / -1 !important;
    margin-bottom: 1.5rem !important;
}

.seo-card-header {
    border-top: 2px solid #10b981 !important;
}

.seo-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.seo-kpi-card {
    background: var(--bg-card, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.seo-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.seo-kpi-label {
    font-size: 0.70rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.seo-kpi-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seo-info-icon {
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
    opacity: 0.6;
    cursor: pointer;
    transition: opacity var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
    flex-shrink: 0;
}

.seo-info-icon:hover {
    opacity: 1;
    color: var(--accent-primary, #6366f1);
    transform: scale(1.15);
}

.seo-kpi-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seo-kpi-sub {
    font-size: 0.68rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 992px) {
    .seo-kpi-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 0.5rem;
        padding-bottom: 0.4rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .seo-kpi-card {
        flex: 0 0 160px;
        min-width: 160px;
        scroll-snap-align: start;
    }
}

.seo-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    padding: 0.5rem 0.65rem;
    background: var(--bg-card, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    align-items: center;
}

.seo-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    font-weight: 500;
    padding: 0.28rem 0.6rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    text-decoration: none;
    transition: all 0.2s ease;
}

.seo-action-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    transform: translateY(-1px);
    border-color: var(--accent-primary, #6366f1);
}

.seo-action-btn.is-primary {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.3));
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.seo-action-btn.is-primary:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(5, 150, 105, 0.5));
    color: #ffffff;
}

.seo-action-btn.is-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.seo-action-btn.is-warning:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.5));
    color: #ffffff;
}

.seo-split-container {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.25rem;
    align-items: stretch;
    min-width: 0;
}

@media (max-width: 992px) {
    .seo-split-container {
        grid-template-columns: 1fr;
    }
}

.seo-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: clamp(5rem, 11vh, 8rem) 1rem 1rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.seo-select {
    width: 100% !important;
    max-width: 100% !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: var(--text-primary) !important;
    font-size: 0.82rem !important;
    cursor: pointer;
}

[data-theme="light"] .seo-select {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

.seo-select option {
    background: #1e293b;
    color: #f8fafc;
}

[data-theme="light"] .seo-select option {
    background: #ffffff;
    color: #1e293b;
}

/* 🔍 Live Google SERP Card Preview */
.google-serp-preview {
    background: #202124;
    border: 1px solid #3c4043;
    border-radius: 10px;
    padding: 1rem 1.15rem;
    margin-top: 0.75rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    min-width: 0;
}

[data-theme="light"] .google-serp-preview {
    background: #ffffff;
    border: 1px solid #dadce0;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.12);
}

.serp-url-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.76rem;
    color: #bdc1c6;
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="light"] .serp-url-row {
    color: #4d5156;
}

.serp-favicon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #303134;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
}

[data-theme="light"] .serp-favicon {
    background: #f1f3f4;
}

.serp-title {
    font-size: 1.15rem;
    line-height: 1.35;
    font-weight: 500;
    color: #8ab4f8;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-theme="light"] .serp-title {
    color: #1a0dab;
}

.serp-snippet {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #bdc1c6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-theme="light"] .serp-snippet {
    color: #4d5156;
}

.seo-badge-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.seo-badge-optimal {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.seo-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.seo-code-pre {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    font-family: var(--font-family-mono, monospace);
    font-size: 0.74rem;
    color: #38bdf8;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

[data-theme="light"] .seo-code-pre {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0369a1;
}

.btn {
    border-width: 1px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 8px 16px;
    font-size: 0.95rem;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-align: center;
    white-space: nowrap;
}

.controls-card {
    display: flex !important;
    flex-direction: column !important;
}

.controls-card .dashboard-card-body {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.controls-card .btn-action {
    width: 100% !important;
    padding: 12px 20px !important;
    min-height: 46px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em !important;
    border-radius: 10px !important;
    transition: all 0.25s ease !important;
    cursor: pointer !important;
    margin-bottom: 16px !important;
}

.controls-card .btn-action:last-child {
    margin-bottom: 0 !important;
}

.btn-run-now {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
    border: 1px solid rgba(147, 197, 253, 0.4) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4) !important;
}

.btn-run-now:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6) !important;
    transform: translateY(-2px) !important;
}

.btn-stop-scheduler {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    border: 1px solid rgba(252, 165, 165, 0.4) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4) !important;
}

.btn-stop-scheduler:hover {
    background: linear-gradient(135deg, #b91c1c, #dc2626) !important;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.6) !important;
    transform: translateY(-2px) !important;
}

.btn-start-scheduler {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    border: 1px solid rgba(110, 231, 183, 0.4) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
}

.btn-start-scheduler:hover {
    background: linear-gradient(135deg, #047857, #059669) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6) !important;
    transform: translateY(-2px) !important;
}

.dashboard-card .btn-xs,
.dashboard-card .btn-sm {
    min-width: auto !important;
    min-height: auto !important;
    padding: 4px 10px !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
}

.btn-primary {
    background: #007bff !important;
    border-color: #007bff !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.6) !important;
}

    .btn-primary:hover {
        background: #0056b3 !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(0, 123, 255, 0.8) !important;
    }

.btn-outline-secondary {
    color: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: transparent !important;
}

    .btn-outline-secondary:hover {
        color: #ffffff !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border-color: rgba(255, 255, 255, 0.5) !important;
    }

.btn-outline-info {
    color: #17a2b8 !important;
    border-color: #17a2b8 !important;
    background: rgba(23, 162, 184, 0.1) !important;
    font-weight: 500 !important;
}

    .btn-outline-info:hover {
        background: #17a2b8 !important;
        color: #ffffff !important;
        transform: translateY(-1px) !important;
    }

/*----------------------------------------------
  23. REVIEW ACTIONS (4 UNIFORM ACTION BUTTONS)
----------------------------------------------*/
.review-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.review-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
    width: 100%;
}

.review-act-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.review-act-btn.btn-approve {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
}
.review-act-btn.btn-approve:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

.review-act-btn.btn-edit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
}
.review-act-btn.btn-edit:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.review-act-btn.btn-refuse {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
}
.review-act-btn.btn-refuse:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.review-act-btn.btn-reprocess {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
}
.review-act-btn.btn-reprocess:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.batch-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════
   🔙 ARTICLE TOP NAVIGATION / BACK TO SEARCH
   ═══════════════════════════════════════════════ */
.article-top-nav-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1.15rem;
}

.article-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.05rem;
    background: var(--bg-card, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 20px;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.article-back-btn:hover {
    background: var(--accent-primary, #6366f1);
    border-color: var(--accent-primary, #6366f1);
    color: #ffffff;
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.article-back-btn i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.article-back-btn:hover i {
    transform: translateX(-2px);
}

/* ═══════════════════════════════════════════════
   ⚙️ ADMIN ARTICLE CONTROL BAR & ACTIONS
   ═══════════════════════════════════════════════ */
.admin-article-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.5rem;
    background: rgba(79, 70, 229, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(79, 70, 229, 0.25);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
}

.user-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(79, 70, 229, 0.4);
    color: var(--accent-primary, #6366f1);
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.admin-bar-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    background: var(--accent-primary);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-status-badge {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.admin-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.admin-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-action-btn.primary {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.45);
}

.admin-action-btn.primary:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

.admin-action-btn.warning {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.admin-action-btn.warning:hover {
    background: #f59e0b;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.admin-action-btn.danger {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.admin-action-btn.danger:hover {
    background: #ef4444;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ⏰ Schedule Time Input & Add Button */
.add-schedule-group {
    margin-top: 0.5rem;
}

.schedule-time-input {
    max-width: 140px;
    height: 38px;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
    color: var(--text-primary, #ffffff);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    transition: all 0.2s ease;
}

.schedule-time-input:focus {
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.add-schedule-group {
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 0.4rem !important;
}

.btn-add-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px !important;
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: var(--accent-primary, #6366f1);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0 !important;
}

.btn-add-time:hover:not(:disabled) {
    background: var(--accent-primary, #6366f1);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.schedule-24h-select {
    width: 66px !important;
    height: 38px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.2rem 0.35rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0 !important;
}

.schedule-24h-select:focus {
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    outline: none;
}

.schedule-24h-select option {
    background: #1e1e2d;
    color: #ffffff;
    font-size: 1rem;
}

.time-colon {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-primary, #6366f1);
}

.admin-card-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

    .batch-btn:hover:not(:disabled) {
        transform: translateY(-1px);
    }
/*----------------------------------------------
  24. AUTH SYSTEM
----------------------------------------------*/
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem;
}

.login-card {
    position: relative;
    border: 2px solid transparent !important;
    background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
                conic-gradient(
                    from var(--ai-glow-angle, 0deg),
                    rgba(99, 102, 241, 0.95) 0%,
                    rgba(168, 85, 247, 0.95) 25%,
                    rgba(6, 182, 212, 0.95) 50%,
                    rgba(59, 130, 246, 0.95) 75%,
                    rgba(99, 102, 241, 0.95) 100%
                ) border-box !important;
    border-radius: calc(var(--border-radius-card) + 2px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 15px 0 rgba(6, 182, 212, 0.16) !important;
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    animation: aiGlowRotate 8s linear infinite;
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

    .login-header h2 {
        margin: 0 0 0.5rem 0;
        font-size: 1.5rem;
    }

    .login-header p {
        margin: 0;
        opacity: 0.9;
    }

.login-content {
    padding: 2rem;
}

.status-section {
    text-align: center;
    padding: 1rem 0;
}

    .status-section.error {
        color: #d32f2f;
    }

    .status-section.success {
        color: #2e7d32;
    }

.icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════
   📝 REVIEW PAGE & BATCH PUBLICATION SYSTEM
   ═══════════════════════════════════════════════ */
.review-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card, 16px);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.review-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.review-header-main .info h2 {
    font-family: var(--font-family-heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.review-header-main .info p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin: 0;
}

.review-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.review-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-radius: 20px;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: var(--bg-surface, var(--bg-card));
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.review-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.review-btn-refresh:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.review-btn-sched {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff !important;
    border: none;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.review-btn-sched:hover {
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45);
}

.review-btn-sql:hover {
    border-color: #10b981;
    color: #10b981;
}

.review-article-body {
    font-size: 0.94rem;
    line-height: 1.65;
    color: var(--text-primary, #e2e8f0);
    white-space: pre-line;
    word-break: break-word;
}

/* ═══════════════════════════════════════════════
   🌟 REVIEW CARD MODERN HEADER & CHIPS
   ═══════════════════════════════════════════════ */
.review-card-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.75rem;
    margin: -0.25rem -0.25rem 0.75rem -0.25rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px 12px 0 0;
}

[data-theme="light"] .review-card-top-bar {
    background: rgba(99, 102, 241, 0.05);
    border-bottom-color: rgba(99, 102, 241, 0.12);
}

.review-top-left, .review-top-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.review-id-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.22rem 0.5rem;
    font-family: var(--font-family-mono, monospace);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-primary, #818cf8);
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    line-height: 1;
    cursor: default;
    user-select: none;
}

[data-theme="light"] .review-id-chip {
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.25);
}

.review-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #f8fafc;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(168, 85, 247, 0.35));
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 6px;
    line-height: 1;
    cursor: default;
    user-select: none;
}

[data-theme="light"] .review-category-chip {
    color: #4c1d95;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.16));
    border-color: rgba(168, 85, 247, 0.35);
}

.review-model-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.55rem;
    font-family: var(--font-family-mono, monospace);
    font-size: 0.75rem;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 6px;
    line-height: 1;
    cursor: default;
    user-select: none;
    transition: all 0.2s ease;
}

[data-theme="light"] .review-model-chip {
    color: #0284c7;
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.25);
}

.review-rating-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 6px;
    line-height: 1;
    cursor: default;
    user-select: none;
}

[data-theme="light"] .review-rating-chip {
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
}

.review-date-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary, #cbd5e1);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    line-height: 1;
    cursor: default;
    user-select: none;
}

[data-theme="light"] .review-date-chip {
    color: #475569;
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

.review-article-card {
    position: relative;
    overflow: visible;
}

.review-card-title {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: -0.01em;
    color: var(--text-primary, #f8fafc);
    margin: 0;
}

[data-theme="light"] .review-card-title {
    color: #0f172a;
}

.review-card-text {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.94rem;
    line-height: 1.65;
    letter-spacing: 0.005em;
    color: var(--text-secondary, #cbd5e1);
    margin: 0;
}

[data-theme="light"] .review-card-text {
    color: #334155;
}

/* 🔗 Review Title Link to Original Source */
.review-title-link {
    color: inherit;
    text-decoration: none;
    display: inline;
    transition: color 0.2s ease;
}

.review-title-link:hover {
    color: var(--accent-primary, #818cf8);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

.review-title-icon {
    font-size: 0.76rem;
    margin-left: 0.35rem;
    opacity: 0.65;
    vertical-align: 0.08em;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.review-title-link:hover .review-title-icon {
    opacity: 1;
    transform: translate(1px, -1px);
    color: var(--accent-primary, #818cf8);
}

/* 🧠 Approfondimento Esperti (Bonus Article) in Review */
.review-bonus-box {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-left: 4px solid #10b981;
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    margin: 0.35rem 0;
    transition: all 0.25s ease;
}

.review-bonus-box.missing {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-left: 4px solid #f59e0b;
}

.review-bonus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.review-bonus-box.collapsed .review-bonus-header {
    margin-bottom: 0;
}

.review-bonus-box.missing .review-bonus-header {
    margin-bottom: 0.35rem;
}

.review-bonus-title {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.85rem;
    font-weight: 700;
    color: #34d399;
}

.review-bonus-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
}

.review-bonus-pill.present {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.review-bonus-pill.missing {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.review-bonus-collapse-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted, #94a3b8);
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.review-bonus-collapse-btn:hover {
    color: var(--text-primary, #f8fafc);
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.12);
}

.review-bonus-body {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.90rem;
    line-height: 1.6;
    color: #cbd5e1;
    border-top: 1px dashed rgba(16, 185, 129, 0.2);
    padding-top: 0.55rem;
    margin-top: 0.25rem;
}

.review-bonus-body p {
    margin-bottom: 0.5rem;
}

.review-bonus-body p:last-child {
    margin-bottom: 0;
}

.review-bonus-missing-desc {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.82rem;
    color: #fbbf24;
    line-height: 1.5;
}

/* 🚀 BATCH SECTION CARD */
.batch-section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card, 16px);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    margin: 1.25rem 0 2rem 0;
}

.batch-section-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.85rem;
    margin-bottom: 1.25rem;
}

.batch-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.batch-icon {
    font-size: 1.4rem;
    color: #f59e0b;
}

.batch-title {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.batch-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.batch-controls-wrap {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.batch-input-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.batch-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.batch-date-input {
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface, var(--bg-card));
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: all var(--transition-fast);
}

.batch-date-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.batch-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.4rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.batch-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.batch-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.batch-results-wrap {
    margin-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 1.25rem;
}

.batch-results-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
}

.batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.batch-table th {
    background: var(--bg-surface, rgba(127, 127, 127, 0.06));
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.batch-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.batch-table tr:hover td {
    background: var(--bg-hover, rgba(127, 127, 127, 0.04));
}

.batch-cell-date {
    font-weight: 600;
    color: var(--accent-primary);
    white-space: nowrap;
}

.batch-cell-id {
    font-family: var(--font-family-monospace, monospace);
    color: var(--text-muted);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════
   🚀 BATCH PUBLICATION RESULTS STREAM (CARD LIST)
   ═══════════════════════════════════════════════ */
.batch-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.batch-result-card {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.8rem 1.1rem;
    gap: 1.25rem;
    transition: all 0.2s ease-in-out;
}

.batch-result-card:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.batch-result-meta {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}

.batch-result-date-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.batch-result-date {
    color: #38bdf8;
    font-size: 0.86rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.batch-result-id {
    color: #94a3b8;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.batch-result-cat-row {
    display: flex;
    align-items: center;
}

.batch-result-cat {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-result-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.92rem;
    color: #f1f5f9;
    line-height: 1.45;
    word-break: break-word;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    padding-left: 1.25rem;
}

@media (max-width: 768px) {
    .batch-result-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
        padding: 0.75rem 0.85rem;
    }

    .batch-result-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        width: 100%;
        padding-bottom: 0.45rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    /* Riga 1 della card: Data a sx, ID a dx */
    .batch-result-date-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .batch-result-date {
        font-size: 0.82rem;
    }

    .batch-result-id {
        font-size: 0.76rem;
    }

    /* Riga 2 della card: Categoria badge */
    .batch-result-cat-row {
        width: 100%;
        display: flex;
    }

    .batch-result-cat {
        font-size: 0.7rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Riga 3 della card: Titolo articolo */
    .batch-result-title {
        border-left: none;
        padding-left: 0;
        font-size: 0.9rem;
        line-height: 1.4;
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════
   📊 DASHBOARD MONITOR — Pallini stato
   ═══════════════════════════════════════════════ */
.dash-dot {
    display: inline-block;
    font-size: 1.25rem;
    line-height: 1;
    vertical-align: middle;
}

.dash-dot-green  { color: #22c55e; }
.dash-dot-yellow { color: #f59e0b; }
.dash-dot-red    { color: #ef4444; }

@keyframes dash-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.25; transform: scale(1.15); }
}

.dash-dot-blink {
    animation: dash-blink 1.2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════
   🖥️ SYSTEM & RESOURCE MONITOR TELEMETRY
   ═══════════════════════════════════════════════ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.85rem;
}

.metric-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 0.75rem 0.95rem;
    transition: all var(--transition-fast);
}

.metric-box:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.55rem;
}

.metric-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.metric-title {
    font-size: 0.77rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
}

.metric-box.app-ram {
    border-top: 2px solid #38bdf8 !important;
}
.metric-box.app-ram .metric-title {
    color: #38bdf8;
}

.metric-box.server-ram {
    border-top: 2px solid #60a5fa !important;
}
.metric-box.server-ram .metric-title {
    color: #60a5fa;
}

.metric-box.cpu {
    border-top: 2px solid #c084fc !important;
}
.metric-box.cpu .metric-title {
    color: #c084fc;
}

.metric-box.health {
    border-top: 2px solid #34d399 !important;
}
.metric-box.health .metric-title {
    color: #34d399;
}

.metric-main-value {
    font-family: var(--font-family-heading);
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-unit {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.metric-body {
    padding-top: 0.45rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    font-size: 0.78rem;
}

.metric-stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.77rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.metric-stat-line span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 📊 Content Monitor Grid & Cards */
.dash-monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.dash-monitor-col {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-fast);
}

.dash-monitor-col:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.dash-monitor-col.col-articles {
    border-top: 2px solid #38bdf8 !important;
}
.dash-monitor-col.col-articles .dash-monitor-title {
    color: #38bdf8;
}

.dash-monitor-col.col-audio {
    border-top: 2px solid #c084fc !important;
}
.dash-monitor-col.col-audio .dash-monitor-title {
    color: #c084fc;
}

.dash-monitor-col.col-ai {
    border-top: 2px solid #34d399 !important;
}
.dash-monitor-col.col-ai .dash-monitor-title {
    color: #34d399;
}

.dash-monitor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.5rem;
}

.dash-monitor-title {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-monitor-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    white-space: nowrap;
}

.dash-monitor-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.dash-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    transition: background var(--transition-fast);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    gap: 0.4rem;
}

.dash-stat-row:last-child {
    border-bottom: none;
}

.dash-stat-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.dash-stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.dash-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-family-mono, monospace);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    flex-shrink: 0;
}

.dash-stat-badge.is-highlight {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #22c55e !important;
    border-color: rgba(34, 197, 94, 0.35) !important;
}

.dash-stat-badge.is-error {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.dash-stat-footer {
    margin-top: auto;
    padding-top: 0.55rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    min-height: 2.2rem;
}

.dash-stat-footer-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dash-stat-footer-value {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.col-articles-accent {
    color: #38bdf8 !important;
}

.col-audio-accent {
    color: #c084fc !important;
}

.col-ai-accent {
    color: #34d399 !important;
}

.dash-dot {
    display: inline-block;
    font-size: 0.72rem;
    line-height: 1;
    margin-left: 0.2rem;
}

.dash-dot-blink {
    animation: dashDotBlink 1.4s ease-in-out infinite alternate;
}

@keyframes dashDotBlink {
    0% { opacity: 1; filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.8)); }
    100% { opacity: 0.4; filter: none; }
}

.batch-cell-category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent-primary);
    font-size: 0.76rem;
    font-weight: 600;
}

.batch-cell-title {
    font-weight: 500;
}

.batch-empty-results {
    padding: 1rem;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 8px;
    color: #d97706;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.review-info h2 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.user-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

.deploy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-hover, rgba(127, 127, 127, 0.1));
    color: var(--text-secondary);
    border: 1px solid var(--border-color, rgba(127, 127, 127, 0.2));
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    letter-spacing: 0.02em;
    user-select: none;
    max-width: 100%;
}

.deploy-badge .deploy-short {
    display: none;
}

.deploy-badge .deploy-full {
    display: inline;
}

.deploy-badge i {
    color: var(--accent-primary, #667eea);
    font-size: 0.82rem;
    flex-shrink: 0;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .logout-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        background: linear-gradient(135deg, #ff5252, #d63031);
    }

/*----------------------------------------------
  25. ANIMATIONS
----------------------------------------------*/
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes number-glow {
    0%, 100% {
        filter: drop-shadow(0 2px 4px rgba(79, 70, 229, 0.2));
    }

    50% {
        filter: drop-shadow(0 4px 8px rgba(79, 70, 229, 0.4));
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes float1 {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-30px) rotate(-180deg);
    }
}

@keyframes float3 {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(120deg);
    }
}

/*----------------------------------------------
  26. RESPONSIVE DESIGN
----------------------------------------------*/
@media (max-width: 1024px) {
    .main-container,
    .header-content,
    .news-content,
    .article-container {
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
    }

    .news-container,
    .news-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .filters-section-container,
    .filters-section-modern {
        top: 100px;
        padding: var(--spacing-md) 0;
    }

    .filters-content,
    .filters-container,
    .news-trending-chips {
        padding: 0 var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.5rem 0 0.25rem !important;
    }

    .nav-container {
        grid-template-columns: 1fr auto !important;
        grid-template-rows: auto auto auto !important;
        gap: 0.25rem 0.5rem !important;
        padding: 0 0.75rem 0.15rem !important;
    }

    .logo-section {
        justify-self: start !important;
        align-items: center !important;
        grid-column: 1 !important;
        grid-row: 1 !important;
        order: 1 !important;
        min-width: 0 !important;
        width: auto !important; /* annulla il width: 240px desktop */
        gap: 0 !important;
        position: relative !important;
    }

    .logo-link {
        gap: 0 !important;
    }

    .header-brand-logo {
        height: 36px !important;
    }

    .logo-bio-drawer {
        transition: max-width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 0.22s ease,
                    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    .logo-section.is-revealed .logo-bio-drawer {
        max-width: 48px !important;
        margin-left: 0.35rem !important;
        overflow: visible !important;
    }

    .header-bio-feather-btn {
        width: 1.95rem !important;
        height: 1.95rem !important;
    }

    .header-bio-feather-btn .bio-feather-icon {
        font-size: 0.95rem !important;
    }

    .header-bio-feather-btn .bio-feather-ink {
        bottom: 3px !important;
        right: 4px !important;
        width: 4px !important;
        height: 4px !important;
    }

    .nav-controls {
        justify-self: end !important;
        grid-column: 2 !important;
        grid-row: 1 !important;
        order: 2 !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.35rem !important;
        flex-shrink: 0 !important;
    }

    .theme-toggle-btn {
        padding: 0.15rem !important;
    }

    .toggle-track {
        width: 38px !important;
        height: 22px !important;
    }

    .toggle-thumb {
        width: 16px !important;
        height: 16px !important;
    }

        .toggle-thumb.light {
            left: 18px !important;
        }

    .toggle-icon {
        font-size: 0.62rem !important;
    }

    .header-bookmark-btn {
        width: 30px !important;
        height: 30px !important;
        border-radius: 8px !important;
        font-size: 0.8rem !important;
    }

    .header-bookmark-badge {
        min-width: 15px !important;
        height: 15px !important;
        font-size: 0.6rem !important;
        top: -4px !important;
        right: -4px !important;
        padding: 0 3px !important;
    }

    .language-switch {
        padding: 2px !important;
        border-radius: 6px !important;
        gap: 1px !important;
    }

    .lang-btn {
        padding: 0.18rem 0.35rem !important;
        font-size: 0.68rem !important;
        min-width: 22px !important;
        border-radius: 4px !important;
    }

    /* Riga 2: Titolo centrato a tutta larghezza con font proporzionato */
    .header-title {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        justify-self: center !important;
        order: 3 !important;
        padding: 0.15rem 0.35rem !important;
        margin: 0.1rem 0 0 !important;
        width: 100% !important;
        border-radius: 10px !important;
    }

    .header-title h1,
    .header-title .header-title-text {
        font-size: clamp(0.98rem, 3.6vw, 1.16rem) !important;
        line-height: 1.35 !important;
        margin: 0 !important;
        text-align: center !important;
        font-weight: 600 !important;
        max-width: 100% !important;
        display: inline-block !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    .special-number {
        font-size: 1.15em !important;
        margin: 0 0.1em !important;
        min-width: auto !important;
        height: auto !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        display: inline-block !important;
        vertical-align: baseline !important;
    }

    /* Riga 3: Admin / Logout Bar su Mobile */
    .logout-section {
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
        order: 4 !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.6rem !important;
        width: 100% !important;
        padding: 0.22rem 0 0.1rem !important;
        border-top: 1px dashed rgba(255, 255, 255, 0.08) !important;
        margin-top: 0.15rem !important;
    }

    .user-role-badge {
        font-size: 0.65rem !important;
        padding: 0.15rem 0.45rem !important;
    }

    .logout-btn {
        padding: 0.22rem 0.55rem !important;
        font-size: 0.72rem !important;
        min-width: auto !important;
        margin-top: 0 !important;
        gap: 0.3rem !important;
    }

    .logout-text {
        display: inline !important;
        font-size: 0.72rem !important;
    }

    .page-title {
        font-size: 2rem;
    }

    .legal-title {
        font-size: 2.2rem;
    }

    .article-title {
        font-size: 2rem;
    }

    .main-container {
        padding: 0.65rem var(--spacing-md) var(--spacing-xl) !important;
    }

    .news-container, .news-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Allinea il padding laterale delle card con i filtri (filters-stack-container usa --spacing-lg) */
    .news-content {
        padding-left: var(--spacing-lg) !important;
        padding-right: var(--spacing-lg) !important;
        padding-top: 0 !important;
        padding-bottom: var(--spacing-xl) !important;
    }

    .filters-section-container,
    .filters-section-modern {
        position: static !important;
        top: auto !important;
        z-index: auto !important;
        padding: var(--spacing-md) 0;
        margin-bottom: var(--spacing-lg);
    }

    .filters-content,
    .filters-container,
    .news-trending-chips {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: 0 var(--spacing-md);
    }

    .filter-select {
        min-width: 100%;
    }

    .results-info {
        text-align: center;
        justify-content: center;
    }

    .title-section {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    .article-actions {
        flex-direction: column;
        align-items: center;
    }

        .article-actions .btn-primary,
        .article-actions .btn-secondary {
            width: 100%;
            max-width: 280px;
        }

    .btn-primary, .btn-secondary {
        padding: 0.875rem var(--spacing-lg);
        font-size: 0.95rem;
    }

    .article-container {
        padding: var(--spacing-sm) var(--spacing-xs) !important;
    }

    .accademico {
        margin: 1.5rem 0 1.25rem !important;
    }

    .accademico article,
    .accademico .content-card {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    .content-body {
        padding: 1.15rem 1.25rem 1.45rem !important;
        font-size: var(--article-font-size, 1.08rem) !important;
        line-height: 1.72 !important;
        text-align: justify !important;
        text-justify: inter-word !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
    }

    .content-body p {
        font-size: inherit !important;
        line-height: 1.78 !important;
        margin-bottom: 1.35rem !important;
        text-align: justify !important;
        text-justify: inter-word !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
    }

    .content-card > .content-body p:first-child::first-letter {
        font-family: var(--font-family-heading) !important;
        font-size: 3.1em !important;
        font-weight: 700 !important;
        float: left !important;
        line-height: 0.82 !important;
        padding: 0.05em 0.08em 0 0 !important;
        color: var(--accent-primary) !important;
    }

    .section-band {
        padding: 0.85rem 1.3rem 0.75rem !important;
        margin: 0 !important;
        font-size: 1.05rem !important;
    }

    .font-size-controls {
        gap: 2px !important;
        padding: 2px 3px !important;
    }

    .font-size-btn {
        height: 26px !important;
        padding: 0 6px !important;
        font-size: 0.75rem !important;
        border-radius: 9999px !important;
    }

    .font-size-controls .scaler-level {
        min-width: 40px !important;
        height: 20px !important;
        font-size: 0.70rem !important;
        padding: 0 4px !important;
    }

    .tts-player {
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.45rem !important;
        padding: 0.5rem 0.85rem !important;
    }

    .tts-hd-player {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.45rem !important;
        padding: 0.5rem 0.85rem !important;
        width: 100% !important;
    }

    .tts-hd-player .tts-badge {
        display: inline-flex !important;
        flex-shrink: 0 !important;
        padding: 0.2rem 0.45rem !important;
        font-size: 0.72rem !important;
    }

    .tts-hd-player .tts-audio-element {
        flex: 1 !important;
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 36px !important;
    }

    .tts-progress-wrap {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.4rem !important;
        min-width: 0 !important;
    }

    .article-header,
    .article-content,
    .article-footer {
        padding: 1.5rem 1.2rem;
    }

    .article-content {
        font-size: 1.1rem;
    }

    .breadcrumb {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .expert-header,
    .expert-body {
        padding: 1.5rem;
    }

    .minimal-footer {
        padding: 0.35rem 0.5rem 0.45rem !important;
        border-top: 1px solid rgba(99, 102, 241, 0.25) !important;
    }

    .footer-container {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        padding: 0 0.25rem !important;
        width: 100% !important;
        max-width: 100% !important;
        text-align: center;
        justify-items: center;
    }

    .footer-links {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-around !important;
        align-items: center !important;
        width: 100% !important;
        gap: 0.35rem !important;
    }

    .footer-links a {
        flex: 1 1 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        padding: 0.3rem 0.2rem !important;
        border-radius: 10px !important;
        background: rgba(99, 102, 241, 0.08) !important;
        border: 1px solid rgba(99, 102, 241, 0.2) !important;
        min-width: 0 !important;
        text-align: center !important;
    }

    .footer-links a i {
        font-size: 1.05rem !important;
        color: var(--accent-primary, #6366f1) !important;
    }

    .footer-links a .footer-link-text {
        font-size: 0.68rem !important;
        font-weight: 600 !important;
        letter-spacing: 0.01em !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        line-height: 1 !important;
    }

    .footer-links a:hover,
    .footer-links a:active {
        background: rgba(99, 102, 241, 0.18) !important;
        border-color: var(--accent-primary, #6366f1) !important;
        transform: translateY(-2px) !important;
    }

    .footer-copyright {
        display: none !important;
    }

    .article-header-compact {
        padding: var(--spacing-lg);
    }

    .article-title-main {
        font-size: 1.75rem;
    }

    .article-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .authors-info-compact,
    .source-date-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .article-bonus {
        margin: 0 var(--spacing-lg) var(--spacing-lg);
        padding: var(--spacing-md);
    }

    .source-details {
        padding: var(--spacing-lg);
    }

    .article-nav-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
        margin-top: 1.25rem !important;
    }

    .article-nav-strip-link {
        padding: 0.75rem 1rem !important;
    }

    .article-nav-strip-title {
        font-size: 0.98rem !important;
    }

    .cta-actions-group {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.6rem !important;
    }

    .cta-actions-group .cta-button {
        flex: 1 1 120px !important;
        max-width: 160px !important;
        min-width: 120px !important;
        width: auto !important;
        padding: 0.65rem 0.8rem !important;
    }

    /* Document & Legal mobile responsive typography */
    .document-container {
        margin: 0 !important;
        width: 100% !important;
        border-radius: 0 !important;
    }

    .document-header {
        padding: 2.2rem 1.25rem !important;
    }

    .document-title {
        font-size: 1.75rem !important;
    }

    .document-subtitle {
        font-size: 1.05rem !important;
    }

    .document-content {
        padding: 1.25rem 1rem !important;
    }

    .document-chapter {
        margin: 2.5rem 0 !important;
        padding-bottom: 1.5rem !important;
    }

    .document-chapter h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }

    .document-chapter h3 {
        font-size: 1.2rem !important;
        margin: 1.5rem 0 0.8rem !important;
    }

    .document-chapter p,
    .document-abstract p,
    .document-highlight p,
    .document-note p,
    .document-warning p,
    .document-success p,
    .document-workflow-box p {
        font-size: 1.08rem;
        line-height: 1.72 !important;
        margin-bottom: 1.2rem !important;
    }

    .document-chapter li {
        font-size: 1.08rem;
        line-height: 1.68 !important;
    }

    .document-toc {
        padding: 1.25rem 1rem !important;
        margin-bottom: 2rem !important;
    }

    .document-abstract {
        padding: 1.25rem 1rem !important;
        margin: 2rem 0 !important;
    }

    .project-float-scaler {
        bottom: 20px !important;
        left: 16px !important;
        right: auto !important;
        padding: 0.4rem 0.65rem !important;
        gap: 0.35rem !important;
    }
    
    .project-float-scaler .font-size-btn {
        height: 32px !important;
        padding: 0 0.6rem !important;
        font-size: 0.9rem !important;
    }

    .cta-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        text-align: center;
        gap: var(--spacing-lg);
        padding: var(--spacing-xl);
    }

    .cta-icon {
        justify-self: center;
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .cta-text h3 {
        font-size: 1.25rem;
    }

    .cta-text p {
        font-size: 0.95rem;
    }

    .cta-button {
        justify-self: center;
        width: 100%;
        max-width: 280px;
    }

    .search-box-modern {
        min-width: 100%;
    }

    .category-filter-modern,
    .results-counter-modern {
        justify-content: center;
    }

    .hero-parallax-section {
        max-height: 300px;
    }

    .logout-text {
        display: none;
    }

    .logout-btn {
        padding: 0.6rem;
        min-width: 44px;
        justify-content: center;
    }

    .review-header {
        flex-direction: column;
        align-items: start;
        gap: 1rem;
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        width: 100% !important;
        gap: 1rem !important;
    }

    .dashboard-container {
        padding: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .dashboard-card,
    .backup-card,
    .wf-panel,
    .wf-dashboard-card {
        padding: 0 !important;
        margin-bottom: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .dashboard-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.6rem !important;
        padding: 10px 12px !important;
    }

    .dashboard-card-header h5 {
        white-space: normal !important;
        font-size: 0.95rem !important;
    }

    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
    }

    .review-actions {
        flex-direction: column;
    }

        .review-actions .btn {
            width: 100%;
        }
}

@media (max-width: 480px) {
    .brand-name {
        display: none !important;
    }

    .nav-controls {
        gap: var(--spacing-sm) !important;
    }

    .header-title {
        padding: 0.15rem 0.4rem 0.1rem !important;
    }

    .header-title h1,
    .header-title .header-title-text {
        font-size: 1.15rem !important;
        line-height: 1.35 !important;
    }

    .article-container {
        padding: 0.5rem 0.25rem !important;
    }

    .content-body {
        padding: 1rem 1.1rem 1.3rem !important;
        font-size: var(--article-font-size, 1.05rem) !important;
        line-height: 1.7 !important;
        text-align: justify !important;
        text-justify: inter-word !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
    }

    .content-body p {
        font-size: inherit !important;
        line-height: 1.75 !important;
        margin-bottom: 1.2rem !important;
        text-align: justify !important;
        text-justify: inter-word !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
    }

    .section-band {
        padding: 0.75rem 1.15rem 0.65rem !important;
        font-size: 1rem !important;
    }

    .tts-player {
        padding: 0.4rem 0.65rem !important;
        margin: 0 !important;
        width: 100% !important;
        gap: 0.35rem !important;
    }

    .tts-hd-player {
        padding: 0.4rem 0.65rem !important;
        width: 100% !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.35rem !important;
    }

    .tts-hd-player .tts-audio-element {
        height: 34px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }

    .filters-section-container,
    .filters-section-modern {
        padding: var(--spacing-sm) 0;
        margin-bottom: var(--spacing-md);
    }

    .filters-content,
    .filters-container {
        padding: 0 var(--spacing-sm);
    }

    .btn-primary, .btn-secondary {
        padding: 0.75rem var(--spacing-md);
        font-size: 0.9rem;
    }

    .main-container, .legal-container {
        padding: var(--spacing-md);
    }

    .article-header-compact {
        padding: var(--spacing-lg);
    }

    .source-details {
        padding: var(--spacing-md);
    }

    .cta-content {
        padding: var(--spacing-lg);
    }

    .cta-text h3 {
        font-size: 1.1rem;
    }

    .hero-parallax-section {
        max-height: 250px;
    }
}

/*----------------------------------------------
  27. ACCESSIBILITY & PERFORMANCE
----------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
    .news-card, .card-base, .btn-primary, .btn-secondary,
    .toggle-thumb, .loading-spinner {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --border-color: #666666;
        --text-secondary: #333333;
        --text-muted: #555555;
    }
}

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

a:not([class]) {
    color: var(--accent-primary);
}

    a:not([class]):hover {
        color: var(--accent-secondary);
    }

.news-card,
.btn-primary,
.btn-secondary {
    will-change: transform;
}
/*----------------------------------------------
  SISTEMA C - BOX COORDINATI MA VARIEGATI
----------------------------------------------*/

/* 1. HIGHLIGHT generici - Verde-rosa originale */
.document-highlight {
    background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%);
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #00b894;
}

    .document-highlight p {
        color: #2c3e50;
        margin: 0;
        font-family: 'Crimson Pro', serif;
        font-size: inherit;
        line-height: 1.8;
        text-align: justify !important;
        text-justify: inter-word !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
    }

/* 2. NOTE/INFO - Blu coordinato */
.document-note {
    background: linear-gradient(120deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #2196f3;
}

    .document-note p {
        color: #1565c0;
        margin: 0;
        font-family: 'Crimson Pro', serif;
        font-size: inherit;
        line-height: 1.8;
        text-align: justify !important;
        text-justify: inter-word !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
    }

    .document-note strong {
        color: #0d47a1;
    }

/* 3. WARNING/ATTENZIONE - Viola coordinato */
.document-warning {
    background: linear-gradient(120deg, #f3e5f5 0%, #e1bee7 100%);
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #9c27b0;
}

    .document-warning p {
        color: #6a1b9a;
        margin: 0;
        font-family: 'Crimson Pro', serif;
        font-size: inherit;
        line-height: 1.8;
        text-align: justify !important;
        text-justify: inter-word !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
    }

    .document-warning strong {
        color: #4a148c;
    }

/* 4. SUCCESS/SCOPERTA - Verde coordinato */
.document-success {
    background: linear-gradient(120deg, #e8f5e8 0%, #c8e6c9 100%);
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #4caf50;
}

    .document-success p {
        color: #2e7d32;
        margin: 0;
        font-family: 'Crimson Pro', serif;
        font-size: inherit;
        line-height: 1.8;
        text-align: justify !important;
        text-justify: inter-word !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
    }

    .document-success strong {
        color: #1b5e20;
    }

/* 5. TECH/CODICE - Grigio-blu coordinato */
.document-code {
    background: linear-gradient(120deg, #eceff1 0%, #cfd8dc 100%);
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #607d8b;
    font-family: 'Courier New', monospace;
}

    .document-code p {
        color: #37474f;
        margin: 0;
        font-size: 0.95em;
        line-height: 1.6;
    }

    .document-code strong {
        color: #263238;
    }

/* 6. WORKFLOW - Arancione coordinato */
.document-workflow-box {
    background: linear-gradient(120deg, #fff3e0 0%, #ffcc80 100%);
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #ff9800;
}

    .document-workflow-box p {
        color: #e65100;
        margin: 0;
        font-family: 'Crimson Pro', serif;
        font-size: inherit;
        line-height: 1.8;
        text-align: justify !important;
        text-justify: inter-word !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
    }

    .document-workflow-box strong {
        color: #bf360c;
    }


/* ═══════════════════════════════════════════════
   📖 FLOATING READING SCALER CONTROLS (LEFT-ALIGNED)
   ═══════════════════════════════════════════════ */
.project-float-scaler {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    border-radius: 35px;
    background: rgba(30, 41, 59, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(99, 102, 241, 0.15);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: all 0.25s ease;
}

.project-float-scaler:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.25);
}

.project-float-scaler .font-size-btn {
    height: 34px;
    padding: 0 0.75rem;
    font-size: 0.95rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.project-float-scaler .font-size-btn:hover {
    background: var(--accent-primary, #6366f1);
    border-color: var(--accent-primary, #6366f1);
    color: #ffffff;
    transform: scale(1.05);
}

.scaler-level {
    font-family: var(--font-family-heading);
    font-size: 0.92rem;
    font-weight: 800;
    min-width: 28px;
    text-align: center;
    color: var(--text-primary);
    user-select: none;
}

.legal-container[style*="font-size"] .document-content,
.legal-container[style*="font-size"] .document-content p,
.legal-container[style*="font-size"] .document-chapter p,
.legal-container[style*="font-size"] .document-chapter li,
.legal-container[style*="font-size"] .document-chapter ul,
.legal-container[style*="font-size"] .document-chapter ol,
.legal-container[style*="font-size"] .document-abstract p,
.legal-container[style*="font-size"] .document-highlight p,
.legal-container[style*="font-size"] .document-note p,
.legal-container[style*="font-size"] .document-warning p,
.legal-container[style*="font-size"] .document-success p,
.legal-container[style*="font-size"] .document-workflow-box p,
.legal-container[style*="font-size"] .document-table td,
.legal-container[style*="font-size"] .document-table th {
    font-size: var(--doc-font-size, inherit) !important;
}

/* Offset per evitare che l'header sticky copra i titoli delle sezioni */
.document-chapter,
.document-abstract,
.document-toc,
.document-workflow,
.document-header,
section[id],
div[id] {
    scroll-margin-top: 100px !important;
}

/* Rimozione margini superiori ridondanti per il primo elemento di document-content */
.document-content > :first-child,
.document-content > .document-chapter:first-child {
    margin-top: 0 !important;
}

.document-content > .document-chapter:first-child > h2:first-child {
    margin-top: 0 !important;
}

/* ═══════════════════════════════════════════════
   🌟 PROJECT WHITEPAPER HERO & INTERACTIVE SHOWCASE
   ═══════════════════════════════════════════════ */
.document-header {
    position: relative;
    padding: 2.75rem 2rem 2.25rem;
    text-align: center;
    border-radius: 16px;
    margin-bottom: 2.5rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-normal);
}

.document-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.1rem;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.2rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.document-title {
    font-family: var(--font-family-heading), 'Playfair Display', serif;
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.9rem;
    letter-spacing: -0.02em;
}

.document-subtitle {
    font-family: var(--font-family-heading), sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    max-width: 750px;
    margin: 0 auto 1.75rem;
    line-height: 1.5;
    opacity: 0.92;
}

.document-hero-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}

.hero-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.9rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    color: #ffffff !important;
    text-decoration: none !important;
    cursor: pointer;
    user-select: none;
}

.hero-chip:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    color: #ffffff !important;
}

/* Tooltip Bubble */
.hero-chip[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: 280px;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    font-size: 0.8rem;
    font-family: var(--font-family-primary);
    font-weight: 400;
    line-height: 1.45;
    text-align: center;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.35);
    backdrop-filter: blur(12px);
    z-index: 100;
}

/* Tooltip Arrow */
.hero-chip[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.96) transparent transparent transparent;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 101;
}

.hero-chip[data-tooltip]:hover::after,
.hero-chip[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.document-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.35rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-btn.primary {
    background: #fff;
    color: #4f46e5;
}

.hero-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background: #f8fafc;
}

.hero-btn.secondary {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
}

.hero-btn.secondary:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.hero-btn.outline {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-btn.outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ═══════════════════════════════════════════════
   📑 MODERN INTERACTIVE TOC (TABLE OF CONTENTS)
   ═══════════════════════════════════════════════ */
.document-toc {
    padding: 2rem;
    border-radius: 14px;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.document-toc-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(127, 127, 127, 0.15);
}

.document-toc-header h2 {
    margin: 0 !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
}

.document-toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: var(--font-family-heading);
    font-size: 0.92rem;
    font-weight: 600;
}

.toc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    flex-shrink: 0;
}

.toc-title {
    flex: 1;
}

.toc-item:hover {
    transform: translateX(4px);
}

@media (max-width: 600px) {
    .document-chapter h2 {
        font-size: 1.35rem !important;
        line-height: 1.35 !important;
    }
    .document-toc-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .toc-item {
        padding: 0.6rem 0.85rem;
        font-size: 0.88rem;
        gap: 0.65rem;
    }
}

/* ═══════════════════════════════════════════════
   📊 STATS CARDS UPGRADES
   ═══════════════════════════════════════════════ */
.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    opacity: 0.85;
}

/* SVG con tooltip */
/* Rende l'SVG più grande */
.document-workflow {
    margin: 2rem 0;
    position: relative; /* Aggiunto a quello esistente */
}

    .document-workflow::before {
        content: '🔍 Doppio click per schermo intero';
        position: absolute;
        bottom: -35px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.8);
        color: white;
        padding: 6px 12px;
        border-radius: 16px;
        font-size: 0.8rem;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        white-space: nowrap;
        z-index: 10;
    }

    .document-workflow:hover::before {
        opacity: 1;
    }
    /* SVG più grande con indicazione fullscreen */
    .document-workflow svg {
        width: 100% !important;
        height: 700px !important;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background: white;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        transition: transform 0.2s ease;
    }

        .document-workflow svg:hover {
            transform: scale(1.01);
        }

    /* Tooltip per fullscreen */
    .document-workflow::after {
        content: '🔍 Doppio click per schermo intero';
        position: absolute;
        bottom: -35px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.8);
        color: white;
        padding: 6px 12px;
        border-radius: 16px;
        font-size: 0.8rem;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        white-space: nowrap;
    }

    .document-workflow:hover::after {
        opacity: 1;
    }


/* Controlli più visibili */
.svg-pan-zoom-control-background {
    fill: #ffffff !important;
    stroke: #cbd5e1 !important;
    stroke-width: 1.5 !important;
}

.svg-pan-zoom-control-text {
    fill: #334155 !important;
    font-weight: 600 !important;
}
/* Fullscreen styling */
.document-workflow:fullscreen {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

    .document-workflow:fullscreen svg {
        width: 95vw !important;
        height: 95vh !important;
        max-width: none !important;
    }

/* ═══════════════════════════════════════════════
   ⚙️ DYNAMIC WORKFLOW PANEL (DASHBOARD)
   ═══════════════════════════════════════════════ */
.wf-panel, .wf-dashboard-card {
    grid-column: 1 / -1;
    margin-bottom: 1.5rem;
}

.wf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.wf-title {
    font-family: var(--font-family-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.wf-string-pill {
    font-family: monospace;
    font-size: 0.85rem;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1, #8b5cf6));
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    letter-spacing: 0.02em;
    max-width: 100%;
    word-break: break-all;
    white-space: normal;
    text-align: center;
}

.wf-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.wf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    width: 100%;
}

.wf-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.1rem 0.75rem;
    background: var(--bg-surface, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.wf-card:hover {
    transform: translateY(-2px);
    background: var(--bg-hover, rgba(255, 255, 255, 0.06));
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 20;
}

.wf-card.selected {
    background: var(--accent-bg-subtle, rgba(99, 102, 241, 0.12));
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
}

.wf-card-checkbox {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary, #6366f1);
    cursor: pointer;
}

.wf-card-icon {
    font-size: 1.6rem;
    margin-bottom: 0.35rem;
    transition: transform 0.2s ease;
}

.wf-card:hover .wf-card-icon {
    transform: scale(1.15);
}

.wf-card-code {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.wf-card-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.wf-presets {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.wf-preset-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.2rem;
}

.wf-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    background: var(--bg-surface, rgba(255, 255, 255, 0.04));
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.wf-preset-btn:hover {
    background: var(--accent-primary, #6366f1);
    color: #ffffff;
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.wf-preset-btn.wf-preset-btn-none:hover {
    background: rgba(239, 68, 68, 0.85);
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
}

/* Responsive: Smartphone Layout */
@media (max-width: 576px) {
    .wf-panel {
        padding: 1rem;
        border-radius: 12px;
    }
    .wf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    .wf-card {
        padding: 0.85rem 0.5rem;
    }
    .wf-card-icon {
        font-size: 1.35rem;
    }
    .wf-card-code {
        font-size: 0.85rem;
    }
    .wf-card-label {
        font-size: 0.7rem;
    }
    .wf-presets {
        justify-content: stretch;
    }
    .wf-preset-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════
   💾 BACKUP MANAGEMENT PANEL
   ═══════════════════════════════════════════════ */
.backup-card {
    grid-column: 1 / -1;
    margin-bottom: 1.5rem;
}

.backup-retention-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-left: 4px solid var(--accent-primary, #3b82f6);
}

.retention-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.15);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.retention-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.retention-text {
    font-size: 0.82rem;
    color: var(--text-secondary, #94a3b8);
}

.retention-highlight {
    color: var(--accent-primary, #60a5fa);
    font-weight: 600;
}

.retention-badge-count {
    font-size: 0.82rem;
    color: var(--text-secondary, #94a3b8);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.batch-date-box {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.8rem;
}

.batch-date-label {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.78rem;
    font-weight: 500;
}

.batch-date-field {
    background: transparent;
    border: none;
    color: var(--text-primary, #ffffff);
    font-family: var(--font-family-mono, monospace);
    font-size: 0.8rem;
    padding: 0.1rem 0.3rem;
    outline: none;
    color-scheme: dark;
}

.backup-table {
    border-collapse: collapse !important;
    border-spacing: 0;
    width: 100% !important;
    table-layout: fixed !important;
}

.backup-table th {
    background: rgba(15, 23, 42, 0.6) !important;
    color: var(--text-secondary) !important;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.85rem 1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    vertical-align: middle !important;
}

.backup-table td {
    padding: 0.85rem 1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: transparent !important;
    vertical-align: middle !important;
}

.backup-table th.text-start,
.backup-table td.text-start {
    text-align: left !important;
}

.backup-table th.text-center,
.backup-table td.text-center {
    text-align: center !important;
}

.backup-table th.text-end,
.backup-table td.text-end {
    text-align: right !important;
}

.backup-table tr:hover td {
    background: rgba(99, 102, 241, 0.08) !important;
}

.dashboard-btn-action {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 0.35rem 0.75rem !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    transition: all 0.2s ease !important;
}

.dashboard-btn-action:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.dashboard-btn-primary {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 0.35rem 0.85rem !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3) !important;
    transition: all 0.2s ease !important;
}

.dashboard-btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45) !important;
    transform: translateY(-1px);
}

.dashboard-btn-warning {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 0.35rem 0.85rem !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3) !important;
    transition: all 0.2s ease !important;
}

.dashboard-btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.45) !important;
    transform: translateY(-1px);
}

.dashboard-btn-action:disabled,
.dashboard-btn-action[disabled],
.dashboard-btn-warning:disabled,
.dashboard-btn-warning[disabled],
.dashboard-btn-primary:disabled,
.dashboard-btn-primary[disabled] {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-backup-download {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    background: #10b981 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    padding: 4px 11px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35) !important;
    white-space: nowrap !important;
}

.btn-backup-download:hover {
    background: #059669 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.5) !important;
}

.btn-backup-restore {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    background: #0284c7 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    padding: 4px 11px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35) !important;
    white-space: nowrap !important;
}

.btn-backup-restore:hover {
    background: #0369a1 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.5) !important;
}

.btn-backup-delete {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    padding: 4px 9px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.btn-backup-delete:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45) !important;
}

.btn-backup-restore-full {
    width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    padding: 0.65rem 1.25rem !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
    letter-spacing: 0.02em !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.btn-backup-restore-full:hover:not(:disabled) {
    background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5) !important;
}

.btn-backup-restore-full:disabled {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ═══════════════════════════════════════════════
   💾 Backup Link & Modal Styles (Pixel-Perfect)
   ═══════════════════════════════════════════════ */
.backup-filename-link {
    color: #cbd5e1;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.backup-filename-link:hover {
    color: #38bdf8;
    text-decoration: underline !important;
}

.backup-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 110000;
    background: rgba(10, 12, 20, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeInFast 0.2s ease-out;
}

.backup-modal-card {
    position: relative;
    border: 2px solid transparent !important;
    background: linear-gradient(rgba(22, 26, 42, 0.98), rgba(22, 26, 42, 0.98)) padding-box,
                conic-gradient(
                    from var(--ai-glow-angle, 0deg),
                    rgba(99, 102, 241, 0.95) 0%,
                    rgba(168, 85, 247, 0.95) 25%,
                    rgba(6, 182, 212, 0.95) 50%,
                    rgba(59, 130, 246, 0.95) 75%,
                    rgba(99, 102, 241, 0.95) 100%
                ) border-box !important;
    border-radius: 18px;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.35);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: aiGlowRotate 8s linear infinite, reconnectSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.backup-modal-card.is-restoring {
    animation: restoreGlowPulse 1.8s ease-in-out infinite, aiGlowRotate 2.5s linear infinite !important;
    background: linear-gradient(rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.98)) padding-box,
                conic-gradient(
                    from var(--ai-glow-angle, 0deg),
                    #0284c7 0%,
                    #38bdf8 25%,
                    #818cf8 50%,
                    #06b6d4 75%,
                    #0284c7 100%
                ) border-box !important;
}

@keyframes restoreGlowPulse {
    0%, 100% {
        box-shadow: 0 0 25px rgba(2, 132, 199, 0.45), 0 20px 60px -10px rgba(0, 0, 0, 0.9);
    }
    50% {
        box-shadow: 0 0 50px rgba(56, 189, 248, 0.85), 0 20px 60px -10px rgba(0, 0, 0, 0.9);
    }
}

.backup-restoring-banner {
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.45);
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.backup-restoring-flowbar {
    height: 6px;
    background: linear-gradient(90deg, #d97706, #eab308, #fef08a, #d97706);
    background-size: 200% 100%;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.5);
    animation: restoreFlowAnimation 1.2s linear infinite;
}

@keyframes restoreFlowAnimation {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.backup-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    gap: 1rem;
}

.backup-modal-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-family-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    min-width: 0;
    flex: 1;
}

.backup-modal-body {
    padding: 1.4rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.backup-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.9rem 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.backup-info-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    color: #cbd5e1;
}

.backup-modal-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 1rem 1.2rem;
}

.backup-input {
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #f8fafc;
    font-family: var(--font-family-mono, monospace);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.backup-input:focus {
    outline: none;
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.callout-warning {
    background: rgba(234, 179, 8, 0.08);
    border-left: 4px solid #eab308;
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
    color: #fef08a;
    font-size: 0.82rem;
}

.callout-danger {
    background: rgba(239, 68, 68, 0.12);
    border-left: 4px solid #ef4444;
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
    color: #fca5a5;
    font-size: 0.82rem;
}

.callout-info {
    background: rgba(59, 130, 246, 0.08);
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
    color: #bfdbfe;
    font-size: 0.82rem;
}

.backup-restore-report {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.7);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    transition: all 0.3s ease;
}

.backup-restore-report.report-success {
    border-color: rgba(34, 197, 94, 0.45);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.15);
}

.backup-restore-report.report-danger {
    border-color: rgba(239, 68, 68, 0.45);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15);
}

.backup-mobile-card {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: all 0.2s ease;
}

.backup-mobile-card:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.16);
}

/* ═══════════════════════════════════════════════
   💾 Backup Desktop vs Mobile Visibility Switch
   ═══════════════════════════════════════════════ */
.backup-desktop-table {
    display: block !important;
}

.backup-mobile-list {
    display: none !important;
}

@media (max-width: 768px) {
    .backup-desktop-table {
        display: none !important;
    }
    
    .backup-mobile-list {
        display: flex !important;
        flex-direction: column !important;
    }
}

/* ═══════════════════════════════════════════════
   ✨ Sleek Header Action Link Buttons
   ═══════════════════════════════════════════════ */
.nav-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1.1rem;
    border-radius: 50px;
    font-family: var(--font-family-heading);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-primary) !important;
    background: var(--bg-surface, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    backdrop-filter: blur(8px);
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nav-action-btn:hover {
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1, #8b5cf6)) !important;
    color: #ffffff !important;
    border-color: transparent !border-color;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.nav-action-btn i {
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.nav-action-btn:hover i {
    transform: scale(1.15);
}

/* ═══════════════════════════════════════════════════════════════════════
   🔄 BLAZOR RECONNECTION SYSTEM — Zero-Whiteout Mobile-First
   ═══════════════════════════════════════════════════════════════════════
   
   STRATEGIA ANTI-GAP:
   Il modal è SEMPRE presente nel DOM (opacity:0, pointer-events:none a riposo).
   Non appena Blazor imposta components-reconnect-show/failed/rejected, il CSS
   attiva IMMEDIATAMENTE il backdrop blur — senza aspettare JS.
   Questo elimina il flash "Impossibile caricare la pagina" su mobile.
   Il dialog interno (.reconnect-dialog) appare con 0.25s di delay per evitare
   che lampeggi su disconnessioni brevissime (<250ms).
   ═══════════════════════════════════════════════════════════════════════ */

/* Loader iniziale statico: non dipende da Blazor, JavaScript o localStorage. */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: grid;
    place-items: center;
    background: var(--bg-primary, #0f0f0f);
    opacity: 1;
    transition: opacity 0.25s ease;
}

.app-loader-hidden {
    opacity: 0;
    pointer-events: none;
}

.app-loader-icon {
    display: block;
    width: min(160px, 42vw);
    height: auto;
}

/* Stato di riposo: modal invisibile ma nel DOM, zero impatto visivo */
#components-reconnect-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 2rem;
    /* Blur e background partono da 0 */
    background: rgba(10, 12, 20, 0) !important;
    backdrop-filter: blur(0px) !important;
    -webkit-backdrop-filter: blur(0px) !important;
    opacity: 1;
    pointer-events: none;
    transition: background 0.2s ease, backdrop-filter 0.2s ease, -webkit-backdrop-filter 0.2s ease;
    visibility: visible;
}

/* NASCOSTO: già gestito sopra con pointer-events:none, ma compatibilità Blazor */
#components-reconnect-modal.components-reconnect-hide {
    background: rgba(10, 12, 20, 0) !important;
    backdrop-filter: blur(0px) !important;
    -webkit-backdrop-filter: blur(0px) !important;
    pointer-events: none !important;
}
#components-reconnect-modal.components-reconnect-hide .reconnect-dialog {
    opacity: 0 !important;
    transform: translateY(20px) scale(0.96) !important;
    pointer-events: none !important;
}

/* ATTIVO (show / failed / rejected): backdrop blur ISTANTANEO — niente gap visivo */
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    background: rgba(10, 12, 20, 0.55) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    pointer-events: auto;
}

.reconnect-dialog {
    background: rgba(22, 26, 42, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 10px 40px -5px rgba(0, 0, 0, 0.7), 0 0 20px rgba(99, 102, 241, 0.25);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    min-width: 320px;
    max-width: 90vw;
    /* Appare solo dopo 250ms: evita lampeggio su micro-drop di rete */
    opacity: 0;
    animation: reconnectSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

@keyframes reconnectSlideUp {
    from {
        transform: translateY(20px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.reconnect-state {
    display: none;
    align-items: center;
    gap: 1rem;
}

/* Visibilità selettiva in base alle classi Blazor */
#components-reconnect-modal.components-reconnect-show .reconnect-show {
    display: flex;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-failed {
    display: flex;
}

#components-reconnect-modal.components-reconnect-rejected .reconnect-rejected {
    display: flex;
}

.reconnect-app-icon {
    display: block;
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
    .app-loader { transition: none; }
    .reconnect-dialog { animation: none; opacity: 1; }
}

.reconnect-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.reconnect-icon-wrap.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.reconnect-icon-wrap.info {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.reconnect-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.reconnect-title {
    font-family: var(--font-family-heading);
    font-size: 0.92rem;
    font-weight: 600;
    color: #ffffff;
}

.reconnect-sub {
    font-size: 0.78rem;
    color: #94a3b8;
}

.reconnect-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.reconnect-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.reconnect-action-btn.primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.reconnect-action-btn.primary:hover {
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.6);
}

/* ═══════════════════════════════════════════════
   ✨ SKELETON SHIMMER LOADING (Zero Layout Shift)
   ═══════════════════════════════════════════════ */
.skeleton-article-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    animation: fadeInFast 0.2s ease-out;
}

.skeleton-header-meta {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.skeleton-badge {
    width: 90px;
    height: 26px;
    border-radius: 20px;
    margin-bottom: 0;
}

.skeleton-badge.sm {
    width: 120px;
}

.skeleton-title {
    height: 38px;
    width: 85%;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.08) 25%, rgba(99, 102, 241, 0.2) 50%, rgba(99, 102, 241, 0.08) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.skeleton-card {
    background: var(--bg-card, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: var(--border-radius-card, 16px);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.skeleton-card.secondary {
    border-left: 3px solid var(--accent-secondary, #06b6d4);
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeInFast {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════
   📜 INFINITE SCROLL INDICATOR
   ═══════════════════════════════════════════════ */
.infinite-scroll-sentinel {
    height: 20px;
    margin: 1rem 0;
    opacity: 0;
    pointer-events: none;
}

.infinite-scroll-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 2rem 0;
    font-family: var(--font-family-heading);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    animation: fadeInFast 0.3s ease-out;
}

.infinite-scroll-end {
    text-align: center;
    padding: 2.5rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    opacity: 0.7;
}

.infinite-scroll-end i {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
    color: var(--accent-primary);
}

/* ═══════════════════════════════════════════════
   ✏️ ADMIN QUICK EDIT MODAL
   ═══════════════════════════════════════════════ */
.quick-edit-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 110000;
    background: rgba(10, 12, 20, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeInFast 0.25s ease-out;
}

.quick-edit-modal {
    position: relative;
    border: 2px solid transparent !important;
    background: linear-gradient(rgba(22, 26, 42, 0.98), rgba(22, 26, 42, 0.98)) padding-box,
                conic-gradient(
                    from var(--ai-glow-angle, 0deg),
                    rgba(99, 102, 241, 0.95) 0%,
                    rgba(168, 85, 247, 0.95) 25%,
                    rgba(6, 182, 212, 0.95) 50%,
                    rgba(59, 130, 246, 0.95) 75%,
                    rgba(99, 102, 241, 0.95) 100%
                ) border-box !important;
    border-radius: 18px;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.35);
    width: 100%;
    max-width: 780px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: aiGlowRotate 8s linear infinite, reconnectSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.quick-edit-header-title {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-family-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.quick-edit-header-title i {
    color: var(--accent-primary, #6366f1);
}

.quick-edit-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.quick-edit-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.quick-edit-body {
    padding: 1.6rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    flex: 1;
}

.quick-edit-lang-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.6rem 1rem;
}

.quick-edit-lang-buttons {
    display: flex;
    gap: 0.5rem;
}

.quick-edit-lang-btn {
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    transition: all 0.2s ease;
}

.quick-edit-lang-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.quick-edit-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-edit-label {
    font-family: var(--font-family-heading);
    font-size: 0.88rem;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-edit-sublabel {
    font-size: 0.82rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 0.4rem;
    display: block;
}

.quick-edit-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 17, 26, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 10px;
    color: #ffffff;
    font-family: var(--font-family-heading);
    font-size: 0.92rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.quick-edit-select:focus {
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.quick-edit-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(15, 17, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #ffffff;
    font-family: var(--font-family-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.quick-edit-input:focus {
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.quick-edit-textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(15, 17, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #ffffff;
    font-family: var(--font-family-body);
    font-size: 0.95rem;
    line-height: 1.6;
    outline: none;
    resize: vertical;
    min-height: 180px;
    transition: all 0.2s ease;
}

.quick-edit-textarea:focus {
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.quick-edit-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    animation: fadeInFast 0.2s ease;
}

.quick-edit-status.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.quick-edit-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.quick-edit-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    padding: 1.2rem 1.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.quick-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.3rem;
    border-radius: 10px;
    font-family: var(--font-family-heading);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-edit-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

.quick-edit-btn.secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.quick-edit-btn.primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.quick-edit-btn.primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════
   ♻️ REPROCESS MODAL & REVIEW KPI DASHBOARD STYLES
   ═══════════════════════════════════════════════════════════════════ */

.review-kpi-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

.review-kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem;
    border-radius: 20px;
    background: var(--surface-secondary, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.review-kpi-chip.action {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
}

.review-kpi-chip.action:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.review-kpi-chip.action.active {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.5);
    color: #4ade80;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.review-feedback-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.review-feedback-banner.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.review-feedback-banner.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.review-feedback-banner .banner-close-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0.2rem;
    font-size: 0.85rem;
}

.review-feedback-banner .banner-close-btn:hover {
    opacity: 1;
}

.review-reprocessing-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    border-radius: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.9rem;
    animation: fadeIn 0.2s ease;
}

.reprocess-modal-card {
    max-width: 580px;
}

.reprocess-article-preview {
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.reprocess-preview-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #94a3b8);
    font-weight: 600;
}

.reprocess-preview-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
    line-height: 1.4;
}

.reprocess-mode-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary, #e2e8f0);
}

.reprocess-option-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.reprocess-option-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
}

.reprocess-option-card.active {
    background: rgba(99, 102, 241, 0.08);
    border-color: #6366f1;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.reprocess-radio-wrap {
    padding-top: 0.15rem;
}

.reprocess-radio-wrap input[type="radio"] {
    accent-color: #6366f1;
    cursor: pointer;
    width: 17px;
    height: 17px;
}

.reprocess-option-info {
    flex: 1;
}

.reprocess-option-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
    margin-bottom: 0.25rem;
}

.reprocess-option-desc {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.45;
}

/* 🤖 Smart Q&A Review Badge & Preview in NewsCard */
.review-smartqa-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.6rem 0;
}

.review-smartqa-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.review-smartqa-badge.present {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.25);
    color: #818cf8;
    cursor: pointer;
}

.review-smartqa-badge.present:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: #6366f1;
    transform: translateY(-1px);
}

.review-smartqa-badge.missing {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.smartqa-pills-icons {
    font-size: 0.82rem;
    letter-spacing: 0.1em;
}

.review-smartqa-preview-box {
    margin-bottom: 0.85rem;
    padding: 0.85rem 1.1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.smartqa-preview-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.smartqa-preview-label {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.8rem;
    font-weight: 700;
    color: #a5b4fc;
}

.smartqa-preview-text {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.88rem;
    color: #e2e8f0;
    line-height: 1.55;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   🔍 27. SPOTLIGHT SEARCH (Ctrl + K) & NAVBAR TRIGGER STYLES
   ═══════════════════════════════════════════════════════════════════ */

body.spotlight-open {
    overflow: hidden !important;
}

/* 1. Pulsante di Ricerca nella Navbar */
.nav-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: var(--text-secondary, #94a3b8);
    font-family: var(--font-family-heading);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

.nav-search-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

.search-kbd-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 0.68rem;
    font-family: var(--font-family-mono, monospace);
    color: #cbd5e1;
    font-weight: 600;
    line-height: 1;
}

@media (max-width: 640px) {
    .search-btn-label,
    .search-kbd-badge {
        display: none;
    }
    .nav-search-btn {
        padding: 0.45rem 0.6rem;
        border-radius: 50%;
        width: 34px;
        height: 34px;
        justify-content: center;
    }
}

/* 2. Backdrop & Card Modale Sospeso */
.spotlight-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10500;
    background: rgba(10, 15, 30, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4.5rem 1rem 2rem 1rem;
    animation: spotlightFadeIn 0.2s ease-out;
}

@keyframes spotlightFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spotlight-modal-card {
    position: relative;
    width: 100%;
    max-width: 680px;
    max-height: calc(100vh - 6rem);
    background: #0f172a;
    border: 1px solid transparent;
    background-clip: padding-box;
    border-radius: 18px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(99, 102, 241, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: spotlightSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.spotlight-modal-card::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    z-index: -1;
    border-radius: 19px;
    background: conic-gradient(
        from var(--glow-angle, 0deg) at 50% 50%,
        rgba(99, 102, 241, 0.8),
        rgba(168, 85, 247, 0.8),
        rgba(6, 182, 212, 0.8),
        rgba(99, 102, 241, 0.8)
    );
    animation: aiGlowRotate 6s linear infinite;
}

@keyframes spotlightSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 3. Input Ricerca */
.spotlight-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.1rem 1.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.spotlight-input-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.spotlight-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-family: var(--font-family-heading);
    font-size: 1.15rem;
    font-weight: 500;
}

.spotlight-input::placeholder {
    color: #64748b;
    font-weight: 400;
}

.spotlight-clear-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.spotlight-clear-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.spotlight-esc-badge {
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-size: 0.7rem;
    font-family: var(--font-family-mono, monospace);
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
}

.spotlight-esc-badge:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

/* 4. Trends Bar */
.spotlight-trends-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.3rem;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    scrollbar-width: none;
}

.spotlight-trends-bar::-webkit-scrollbar {
    display: none;
}

.spotlight-trends-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.spotlight-trends-list {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.spotlight-trend-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.25rem 0.65rem;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.spotlight-trend-pill:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #ffffff;
}

.spotlight-trend-pill.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.3));
    border-color: #818cf8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.spotlight-trend-pill.spotlight-pill-rating {
    border-color: rgba(234, 179, 8, 0.25);
}

.spotlight-trend-pill.spotlight-pill-rating.active {
    background: rgba(234, 179, 8, 0.2);
    border-color: #eab308;
    color: #fef08a;
}

/* 5. Results Scroll Area */
.spotlight-results-scroll {
    flex: 1;
    max-height: 420px;
    overflow-y: auto;
    padding: 0.75rem 1.3rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.spotlight-results-scroll::-webkit-scrollbar {
    width: 6px;
}

.spotlight-results-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.spotlight-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* 6. Mini-Cards dei Risultati */
.spotlight-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.spotlight-result-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.spotlight-result-card:hover,
.spotlight-result-card.is-selected {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 12px rgba(99, 102, 241, 0.15);
}

.spotlight-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.spotlight-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.spotlight-badge.category {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.spotlight-badge.date {
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
}

.spotlight-badge.audio {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.spotlight-badge.rating {
    background: rgba(234, 179, 8, 0.12);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.25);
    font-family: var(--font-family-mono, monospace);
}

.spotlight-badge.semantic {
    background: rgba(6, 182, 212, 0.15);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.35);
}

.spotlight-badge.hybrid {
    background: rgba(168, 85, 247, 0.15);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.spotlight-badge.keyword {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.spotlight-card-title {
    color: #f1f5f9;
    font-family: var(--font-family-heading);
    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1.35;
}

.spotlight-card-snippet {
    color: #94a3b8;
    font-size: 0.82rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Evidenziazione Termine */
mark.search-highlight {
    background: rgba(250, 204, 21, 0.25);
    color: #fef08a;
    padding: 0.05rem 0.25rem;
    border-radius: 4px;
    font-weight: 600;
    border-bottom: 1.5px solid #eab308;
}

/* 7. Empty & Loading States */
.spotlight-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
}

.spotlight-empty-icon {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    opacity: 0.6;
}

.spotlight-empty-title {
    color: #f8fafc;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.spotlight-empty-sub {
    color: #94a3b8;
    font-size: 0.85rem;
    max-width: 420px;
    margin: 0 auto;
}

.spotlight-initial-guide {
    padding: 1.8rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.88rem;
}

.spotlight-loading-state {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.5rem 0;
}

.spotlight-shimmer-box {
    height: 64px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 8. Footer */
.spotlight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.75rem 1.3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 23, 42, 0.8);
    font-size: 0.75rem;
    color: #64748b;
}

.spotlight-shortcuts-hint {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.shortcut-item kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    color: #cbd5e1;
    font-family: var(--font-family-mono, monospace);
    font-size: 0.7rem;
}

.spotlight-view-all-btn {
    background: transparent;
    border: none;
    color: #818cf8;
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    padding: 0;
}

.spotlight-view-all-btn:hover {
    color: #a5b4fc;
    transform: translateX(2px);
}

@media (max-width: 640px) {
    .spotlight-backdrop {
        padding: 1.5rem 0.5rem;
    }
    .spotlight-shortcuts-hint {
        display: none;
    }
    .spotlight-modal-card {
        max-height: calc(100vh - 3rem);
    }
}

/* ═══════════════════════════════════════════════
   📄 SERVER LOG FILE INSPECTOR & MODAL
   ═══════════════════════════════════════════════ */
.log-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 110000;
    background: rgba(10, 12, 20, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    animation: fadeInFast 0.2s ease-out;
}

.log-modal-card {
    position: relative;
    background: var(--bg-card, #161a2b);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.2);
    width: 100%;
    max-width: 1100px;
    height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.25s ease;
}

.log-modal-card.is-maximized {
    max-width: 99vw;
    height: 98vh;
    border-radius: 10px;
}

.log-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.75rem;
    flex-wrap: wrap;
}

.log-modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin: 0;
}

.log-modal-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Log Activity Persistent Card & Themed Accents */
.log-activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.log-header-left {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.log-header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
}

.log-header-right {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
}

@media (max-width: 860px) {
    .log-header-center {
        order: 3;
        width: 100%;
        margin-top: 0.35rem;
    }
}

.log-card-header-title {
    color: #38bdf8;
    font-weight: 800;
    font-size: 0.98rem;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

/* Log Activity Persistent Toolbar */
.log-toolbar-subrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.6rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.log-toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.log-toolbar-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    color: var(--text-primary);
}

.log-select-picker {
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.84rem;
    font-weight: 500;
    font-family: inherit;
    height: 34px;
    outline: none;
    cursor: pointer;
    width: auto;
    min-width: 280px;
    max-width: 480px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.log-select-picker:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.log-select-picker option {
    background: #0f172a;
    color: #f8fafc;
    padding: 6px 10px;
}

.log-limit-picker {
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(192, 132, 252, 0.45);
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    height: 34px;
    outline: none;
    cursor: pointer;
    width: auto;
    min-width: 110px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.log-limit-picker:focus {
    border-color: #c084fc;
    box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.25);
}

.log-limit-picker option {
    background: #0f172a;
    color: #f8fafc;
    padding: 6px 10px;
}

.log-file-badge {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: var(--font-family-mono, monospace);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    align-items: center;
}

.log-toolbar-empty {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-style: italic;
    display: inline-flex;
    align-items: center;
}

.log-tab-pill.active.tab-scheduler {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%) !important;
    border-color: rgba(147, 197, 253, 0.5) !important;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.45);
}

.log-tab-pill.active.tab-app {
    background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%) !important;
    border-color: rgba(56, 189, 248, 0.5) !important;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.45);
}

.log-tab-pill.active.tab-system {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%) !important;
    border-color: rgba(192, 132, 252, 0.5) !important;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.45);
}

@media (max-width: 576px) {
    .log-select-picker {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
    }
}

.log-search-input {
    background: #0f1322;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    height: 34px;
    outline: none;
    min-width: 180px;
}

.log-search-input:focus, .log-select-picker:focus, .log-limit-picker:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.log-btn-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 34px;
    padding: 0 0.75rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.07);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.log-btn-tool:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    color: #fff;
    transform: translateY(-1px);
}

.log-btn-tool:active {
    transform: translateY(0);
}

.log-btn-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.log-btn-close:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    transform: scale(1.05);
}

.log-btn-expand {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 34px;
    padding: 0 0.85rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.log-btn-expand:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(168, 85, 247, 0.4));
    color: #fff;
    border-color: #818cf8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.log-tab-group {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    padding: 3px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    gap: 4px;
}

.log-tab-pill {
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.log-tab-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}

.log-tab-pill.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
    font-weight: 700;
    border-color: rgba(165, 180, 252, 0.4) !important;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.45);
}

.log-viewer-container {
    flex: 1;
    overflow-y: auto;
    background: #0b0f19;
    color: #c9d1d9;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    padding: 0.75rem 1rem;
    user-select: text;
    border-radius: 0 0 16px 16px;
}

.log-code-line {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    padding: 0.15rem 0;
    display: flex;
    gap: 0.6rem;
}

.log-code-line .line-num {
    color: #484f58;
    user-select: none;
    min-width: 42px;
    text-align: right;
    font-size: 0.75rem;
    padding-right: 0.5rem;
    border-right: 1px solid #21262d;
}

.log-code-line .line-text {
    flex: 1;
}

.log-code-line.is-step {
    color: #58a6ff;
    font-weight: 600;
    background: rgba(56, 139, 253, 0.12);
}

.log-code-line.is-step .line-text {
    color: #58a6ff;
}

.log-code-line.is-success .line-text {
    color: #3fb950;
    font-weight: 500;
}

.log-code-line.is-error {
    background: rgba(248, 81, 73, 0.12);
}

.log-code-line.is-error .line-text {
    color: #f85149;
    font-weight: 600;
}

.log-code-line.is-warning .line-text {
    color: #d29922;
}

.log-code-line.is-highlight .line-text {
    background: rgba(234, 179, 8, 0.25);
    color: #fef08a;
}

/* ═══════════════════════════════════════════════
   🚀 Sched Page Top Header (Compact & Crisp)
   ═══════════════════════════════════════════════ */
.sched-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 0.55rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    gap: 1rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.sched-top-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    flex-wrap: nowrap;
    min-width: 0;
}

.sched-top-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0;
    white-space: nowrap;
    display: inline-block;
}

.sched-top-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted, #94a3b8);
    border-left: 1px solid var(--border-color, rgba(255, 255, 255, 0.2));
    padding-left: 0.75rem;
    white-space: nowrap;
    display: inline-block;
}

.sched-top-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* ==========================================================================
   COLOR UTILITIES & FILE MANAGER / ADMIN CONSOLE DESIGN SYSTEM
   ========================================================================== */
.text-warning { color: #f59e0b !important; }
.text-info { color: #38bdf8 !important; }
.text-success { color: #22c55e !important; }
.text-danger { color: #ef4444 !important; }
.text-purple { color: #c084fc !important; }
.text-primary { color: #6366f1 !important; }
.text-secondary { color: #94a3b8 !important; }
.text-light { color: #f8fafc !important; }
.text-muted { color: #94a3b8 !important; }
.text-accent { color: var(--accent-primary, #6366f1) !important; }

/* Unified Table Container for File Manager, Config & RESX */
.fm-table-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x pan-y !important;
}

/* File Manager Table & Explorer Layout */
.fm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    color: #f8fafc;
}

.fm-table thead tr {
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.fm-table th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    white-space: nowrap;
}

.fm-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.fm-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.fm-table td {
    padding: 0.65rem 1rem;
    vertical-align: middle;
    white-space: nowrap;
}

.fm-item-name {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 500;
    color: #f8fafc;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.88rem;
}

.fm-item-name:hover {
    color: #38bdf8;
}

.fm-item-icon {
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    flex-shrink: 0;
}

.fm-breadcrumb-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #38bdf8;
    text-decoration: none;
    font-size: 0.82rem;
    font-family: var(--font-family-mono, monospace);
    cursor: pointer;
    transition: all 0.2s ease;
}

.fm-breadcrumb-chip:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #fff;
}

.fm-breadcrumb-chip.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    color: #fff;
    cursor: default;
}

/* RESX Manager Multi-Language Table */
.resx-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.88rem;
    color: #f8fafc;
}

.resx-table thead tr {
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.resx-table th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.resx-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.resx-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.resx-table td {
    padding: 0.75rem 1rem;
    vertical-align: top;
    white-space: normal;
    word-break: break-word;
}

.resx-textarea {
    width: 100% !important;
    min-height: 65px;
    background: rgba(0, 0, 0, 0.6) !important;
    color: #fff !important;
    border: 1px solid #38bdf8 !important;
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
    line-height: 1.45;
    resize: vertical;
    box-sizing: border-box;
    display: block;
}

.resx-textarea:focus {
    outline: none;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

/* Live Config Inline Edit Input */
.config-input-edit {
    width: 100% !important;
    height: 38px !important;
    background: #0b0f19 !important;
    color: #a5f3fc !important;
    border: 1px solid #38bdf8 !important;
    border-radius: 6px !important;
    padding: 0.4rem 0.75rem !important;
    font-size: 0.88rem !important;
    font-family: var(--font-family-mono, monospace) !important;
    box-sizing: border-box !important;
    display: block !important;
    transition: all 0.2s ease !important;
}

.config-input-edit:focus {
    outline: none !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35) !important;
    background: #030712 !important;
    color: #ffffff !important;
}

[data-theme="light"] .config-input-edit {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #6366f1 !important;
}

[data-theme="light"] .config-input-edit:focus {
    background: #f8fafc !important;
    color: #0f172a !important;
}

/* ═══════════════════════════════════════════════════
   🗄️ SQL Inspector & Console Styles
   ═══════════════════════════════════════════════════ */
.sql-editor-input {
    width: 100% !important;
    background: #0b0f19 !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    border-radius: 8px !important;
    padding: 0.5rem 0.75rem !important;
    font-family: var(--font-family-mono, monospace) !important;
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    display: block !important;
    transition: all 0.2s ease !important;
    color-scheme: dark;
}

textarea.sql-editor-input {
    min-height: 110px;
    resize: vertical !important;
}

.sql-editor-input:focus {
    outline: none !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35) !important;
    background: #030712 !important;
    color: #ffffff !important;
}

.sql-editor-input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2);
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sql-editor-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

[data-theme="light"] .sql-editor-input {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #6366f1 !important;
    color-scheme: light;
}

[data-theme="light"] .sql-editor-input:focus {
    background: #f8fafc !important;
    color: #0f172a !important;
}

[data-theme="light"] .sql-editor-input::-webkit-calendar-picker-indicator {
    filter: none;
    opacity: 0.75;
}

/* SQL Results Scrollable Viewport & Grid */
.sql-results-viewport {
    width: 100%;
    max-width: 100%;
    max-height: 55vh;
    overflow-x: auto;
    overflow-y: auto;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.sql-results-viewport.maximized {
    max-height: 75vh;
}

.sql-results-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-family: var(--font-family-mono, monospace);
    font-size: 0.84rem;
    color: #f8fafc;
}

.sql-results-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #0f172a;
    color: #38bdf8;
    padding: 0.65rem 1rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(56, 189, 248, 0.4);
    white-space: nowrap;
    text-align: left;
}

.sql-results-table td {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sql-results-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.08);
}

.sql-results-table.zoom-large {
    font-size: 0.95rem;
}

.sql-results-table.zoom-large td,
.sql-results-table.zoom-large th {
    padding: 0.75rem 1.2rem;
}

.sql-results-table.zoom-small {
    font-size: 0.75rem;
}

.sql-results-table.zoom-small td,
.sql-results-table.zoom-small th {
    padding: 0.35rem 0.65rem;
}

/* ═══════════════════════════════════════════════════
   🛠️ Tool Hub Navigation Cards
   ═══════════════════════════════════════════════════ */
.tool-hub-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.tool-hub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tool-hub-card.files:hover { background: rgba(59, 130, 246, 0.12); border-color: #3b82f6; }
.tool-hub-card.config:hover { background: rgba(139, 92, 246, 0.12); border-color: #8b5cf6; }
.tool-hub-card.resources:hover { background: rgba(16, 185, 129, 0.12); border-color: #10b981; }
.tool-hub-card.sql:hover { background: rgba(245, 158, 11, 0.12); border-color: #f59e0b; }

.tool-hub-title {
    color: #f8fafc;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.tool-hub-arrow {
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.2s ease, color 0.2s ease;
}

.tool-hub-card:hover .tool-hub-arrow {
    transform: translateX(3px);
    color: #fff;
}

/* SQL Console Specific Classes */
.sql-val {
    color: #f8fafc;
}

.sql-table-name {
    color: #f8fafc;
}

.sql-row-count {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.72rem;
    font-family: var(--font-family-mono, monospace);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.sql-table-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.45rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.83rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    margin-bottom: 2px;
}

.sql-table-item:hover {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}

.sql-table-item.active {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    font-weight: 600;
    border-left: 3px solid #38bdf8;
}

.sql-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.sql-quick-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #38bdf8;
    transform: translateY(-1px);
}

/* 🎯 SQL Preset Select Dropdown */
.sql-preset-select {
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.35rem 0.85rem;
    border-radius: var(--border-radius-button, 8px);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    min-width: 280px;
    max-width: 400px;
    cursor: pointer;
    font-family: var(--font-family-primary);
    transition: all var(--transition-normal);
}

.sql-preset-select:hover {
    border-color: var(--accent-primary);
}

.sql-preset-select:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.sql-preset-select optgroup {
    background-color: var(--bg-secondary, #1e293b);
    color: var(--accent-primary, #6366f1);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 6px 4px;
}

.sql-preset-select option {
    background-color: var(--bg-card, #0f172a);
    color: var(--text-primary, #f8fafc);
    font-weight: 400;
    font-size: 0.82rem;
    padding: 4px 8px;
}

.sql-empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.sql-empty-state i {
    font-size: 2.2rem;
    color: #64748b;
    opacity: 0.8;
}

.sql-empty-state p {
    font-size: 0.88rem;
    margin: 0;
    max-width: 480px;
    line-height: 1.5;
}

/* SQL Results Row Selection */
.sql-results-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

.sql-results-table tbody tr.table-row-selected {
    background: rgba(56, 189, 248, 0.22) !important;
    outline: 1px solid #38bdf8;
}

/* SQL Record Edit Modal */
.sql-record-field-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.sql-record-field-card.dirty {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
}

.sql-record-field-card.editing {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.06);
}

.sql-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.sql-field-name {
    font-family: var(--font-family-mono, monospace);
    font-weight: 700;
    font-size: 0.85rem;
    color: #38bdf8;
}

.sql-field-val-preview {
    font-family: var(--font-family-mono, monospace);
    font-size: 0.82rem;
    color: #e2e8f0;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎙️ PODCAST HERO BANNER (Home Page)
   ═══════════════════════════════════════════════════════════════════════════ */
.podcast-hero-banner {
    position: relative;
    width: 100%;
    margin: 0 0 2rem 0;
    border-radius: calc(var(--border-radius-card) + 2px);
    padding: 2px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.6) 0%, rgba(168, 85, 247, 0.4) 50%, rgba(6, 182, 212, 0.6) 100%);
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.2),
                0 0 12px 0 rgba(6, 182, 212, 0.12);
    overflow: visible;
    z-index: 10;
}


[data-theme="light"] .podcast-hero-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.2) 50%, rgba(6, 182, 212, 0.3) 100%);
    box-shadow: 0 4px 18px -2px rgba(99, 102, 241, 0.1),
                0 0 10px 0 rgba(6, 182, 212, 0.06);
    z-index: 10;
}

.podcast-hero-banner.is-active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.75) 0%, rgba(168, 85, 247, 0.6) 50%, rgba(6, 182, 212, 0.75) 100%);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.28);
}

.podcast-glow-effect {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
}

.podcast-glow-effect::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 60%);
    pointer-events: none;
    animation: podcast-glow-rotate 12s linear infinite;
}

@keyframes podcast-glow-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.podcast-banner-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.35rem 1.65rem;
    /* background: var(--bg-card); */
    border-radius: var(--border-radius-card);
    z-index: 1;
}

[data-theme="light"] .podcast-banner-inner {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(203, 213, 225, 0.85);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9), 0 2px 10px rgba(99, 102, 241, 0.04);
}

.podcast-info-box {
    width: 100%;
    min-width: 0;
}

/* Riga Superiore: Badge a SX & Icona/Equalizzatore a DX */
.podcast-top-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.podcast-badge-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.podcast-badge-main {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.podcast-badge-sub {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

[data-theme="light"] .podcast-badge-main {
    background: rgba(79, 70, 229, 0.08);
    color: #4338ca;
    border-color: rgba(79, 70, 229, 0.25);
}

[data-theme="light"] .podcast-badge-sub {
    background: rgba(5, 150, 105, 0.08);
    color: #047857;
    border-color: rgba(5, 150, 105, 0.25);
}

.podcast-top-actions-box {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. Riga Centrale di Navigazione Edizioni ([ ‹ ] Titolo [ › ])
   ═══════════════════════════════════════════════════════════════════════════ */
.podcast-nav-center-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.15rem;
    margin: 1.15rem 0 1rem 0;
    padding: 0;
    background: transparent;
    border: none;
    position: relative;
    z-index: 5;
}

.credits-bottom-player {
    position: relative;
    z-index: 20;       /* sopra .credits-viewport (z-index:5) */
    overflow: visible; /* i tooltip::after devono uscire verso l'alto */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    flex-shrink: 0;
    padding: 0.65rem 1rem;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid rgba(99, 102, 241, 0.3);
    border-bottom: 1px solid rgba(129, 140, 248, 0.72);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45);
}

/* Tooltip dentro il bottom player: z-index alto per stare sopra al viewport */
.credits-bottom-player [data-tooltip]::after,
.credits-bottom-player [data-tooltip]::before {
    z-index: 99999 !important;
}

[data-theme="light"] .credits-bottom-player {
    background: rgba(255, 255, 255, 0.94);
    border-top-color: rgba(99, 102, 241, 0.2);
    border-bottom-color: rgba(79, 70, 229, 0.58);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.1);
}

.credits-bottom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(150, 130, 255, 0.3);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.credits-project-btn {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    overflow: visible; /* non clippare i tooltip ::after/::before */
    padding: 0;
}

.credits-project-btn-logo {
    display: block;
    width: 100%;
    height: auto;
    max-height: 1.75rem;
    object-fit: contain;
}

.credits-project-btn-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
}

.credits-project-btn-glow::before {
    content: "";
    position: absolute;
    top: 0;
    left: -110%;
    width: 65%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-25deg);
}

.credits-project-btn-icon {
    position: relative;
    z-index: 1;
    color: #ffffff;
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.credits-project-btn:hover,
.credits-project-btn:focus-visible {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(52, 211, 153, 0.7);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.58), 0 0 16px rgba(6, 182, 212, 0.4);
}

.credits-project-btn:hover .credits-project-btn-glow::before,
.credits-project-btn:focus-visible .credits-project-btn-glow::before {
    animation: play-shimmer-sweep 1.2s infinite ease-in-out;
}

.credits-project-btn:hover .credits-project-btn-icon,
.credits-project-btn:focus-visible .credits-project-btn-icon {
    transform: scale(1.18) rotate(-2deg);
}

.credits-bottom-btn:hover,
.credits-bottom-btn:focus-visible {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.28);
    transform: scale(1.08);
    outline: none;
}

.credits-play-btn {
    width: 3rem;
    height: 3rem;
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1, #9333ea);
    border-color: rgba(165, 180, 252, 0.65);
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.4);
}

.credits-top-btn {
    color: #ffffff;
    background: #6366f1;
    border-color: rgba(165, 180, 252, 0.65);
}

.credits-close-btn:hover,
.credits-close-btn:focus-visible {
    color: #fecaca;
    background: rgba(220, 60, 60, 0.25);
    border-color: rgba(220, 80, 80, 0.5);
}

.podcast-nav-side-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    flex-shrink: 0;
}

.podcast-nav-edition-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 42px;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #cbd5e1;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    outline: none;
}

.podcast-nav-edition-btn.is-active-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(168, 85, 247, 0.35) 100%);
    border: 1px solid #818cf8;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.5);
}

.podcast-nav-edition-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #ffffff;
    border-color: #a5b4fc;
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.7);
    transform: scale(1.08);
}

.podcast-nav-edition-btn:disabled {
    opacity: 0.22;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    box-shadow: none;
    pointer-events: none;
}

[data-theme="light"] .podcast-nav-edition-btn {
    background: #ffffff;
    border: 1px solid rgba(203, 213, 225, 0.9);
    color: #64748b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .podcast-nav-edition-btn.is-active-btn {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid #6366f1;
    color: #4338ca;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .podcast-nav-edition-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    border-color: #4f46e5;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

[data-theme="light"] .podcast-nav-edition-btn:disabled {
    background: #f8fafc;
    border: 1px solid rgba(203, 213, 225, 0.6);
    color: #cbd5e1;
    opacity: 0.4;
}

.podcast-center-title-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    text-align: center;
    flex: 1;
}

.podcast-center-title {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 1.62rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    letter-spacing: -0.025em;
}

.podcast-title-prefix {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 750;
    letter-spacing: -0.025em;
}

.podcast-title-separator {
    color: #818cf8;
    opacity: 0.55;
    font-size: 1.35rem;
    font-weight: 400;
}

.podcast-title-date {
    color: var(--text-primary, #ffffff);
    font-weight: 600;
    letter-spacing: -0.02em;
}

[data-theme="light"] .podcast-title-prefix {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 50%, #0284c7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .podcast-title-separator {
    color: #6366f1;
    opacity: 0.8;
}

[data-theme="light"] .podcast-title-date {
    color: #0f172a;
}

/* Pulsanti Azioni Bilanciati ed Energetici */
.podcast-top-actions-box,
.podcast-actions-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.podcast-queue-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.52rem 1.15rem;
    height: 38px;
    background: rgba(255, 255, 255, 0.07);
    color: #cbd5e1;
    font-size: 0.84rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    white-space: nowrap;
}

.queue-mini-badge {
    font-family: var(--font-family-mono, monospace);
    font-size: 0.72rem;
    font-weight: 800;
    background: rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 0.2rem;
}

[data-theme="light"] .queue-mini-badge {
    background: rgba(99, 102, 241, 0.15);
    color: #4338ca;
}

.podcast-queue-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.podcast-queue-toggle-btn.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: #818cf8;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.35);
}

[data-theme="light"] .podcast-queue-toggle-btn {
    background: #ffffff;
    color: #1e293b;
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .podcast-queue-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
    color: #4338ca;
}

[data-theme="light"] .podcast-queue-toggle-btn.active {
    background: rgba(99, 102, 241, 0.18);
    border-color: #4f46e5;
    color: #4338ca;
}

/* Pulsante Play Principale con Animazione Shimmer & Neon Glow */
.podcast-play-all-btn {
    position: relative;
    overflow: visible;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.52rem 1.35rem;
    height: 38px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
    background-size: 200% 200%;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.86rem;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(79, 70, 229, 0.45), 0 0 8px rgba(6, 182, 212, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    white-space: nowrap;
}

.podcast-play-all-btn .play-btn-glow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* Shimmer beam effect isolated inside play-btn-glow */
.podcast-play-all-btn .play-btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
    transform: skewX(-25deg);
    transition: none;
    pointer-events: none;
}

.podcast-play-all-btn:hover {
    transform: translateY(-2px) scale(1.02);
    background-position: 100% 100%;
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.7), 0 0 16px rgba(6, 182, 212, 0.45);
}

.podcast-play-all-btn:hover .play-btn-glow::before {
    animation: play-shimmer-sweep 1.2s infinite ease-in-out;
}

.podcast-play-all-btn i,
.podcast-play-all-btn span:not(.play-btn-glow) {
    position: relative;
    z-index: 1;
}

.podcast-play-all-btn:hover i {
    transform: scale(1.18);
    transition: transform 0.2s ease;
}

.podcast-play-all-btn.is-playing {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.5), 0 0 12px rgba(16, 185, 129, 0.3);
}

.podcast-play-all-btn.is-playing:hover {
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.7), 0 0 16px rgba(16, 185, 129, 0.45);
}

@keyframes play-shimmer-sweep {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎵 PODCAST HERO EQUALIZER & AUDIO ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.podcast-equalizer {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    width: 34px;
    height: 24px;
    padding: 2px 0;
    margin-left: 0.5rem;
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
    background: transparent;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .podcast-equalizer {
    background: transparent;
    border: none;
    box-shadow: none;
}

.podcast-equalizer.playing {
    opacity: 1;
    transform: scale(1);
    background: transparent;
    border: none;
    box-shadow: none;
    pointer-events: auto;
}

[data-theme="light"] .podcast-equalizer.playing {
    background: transparent;
    border: none;
    box-shadow: none;
}

.eq-bar {
    display: inline-block;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 1.5px;
    transition: height 0.2s ease, background 0.2s ease;
}

[data-theme="light"] .eq-bar {
    background: rgba(99, 102, 241, 0.3);
}

.podcast-equalizer.playing .eq-bar {
    background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
}

[data-theme="light"] .podcast-equalizer.playing .eq-bar {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

/* Animazione barre equalizzatore Hero Banner - Ritmica ad onda sincronizzata come l'articolo */
.podcast-equalizer.playing .eq-bar:nth-child(1) { animation: eq-hero-wave 0.8s ease-in-out infinite 0.1s; }
.podcast-equalizer.playing .eq-bar:nth-child(2) { animation: eq-hero-wave 0.8s ease-in-out infinite 0.3s; }
.podcast-equalizer.playing .eq-bar:nth-child(3) { animation: eq-hero-wave 0.8s ease-in-out infinite 0.2s; }
.podcast-equalizer.playing .eq-bar:nth-child(4) { animation: eq-hero-wave 0.8s ease-in-out infinite 0.4s; }
.podcast-equalizer.playing .eq-bar:nth-child(5) { animation: eq-hero-wave 0.8s ease-in-out infinite 0.25s; }

@keyframes eq-hero-wave {
    0%, 100% { height: 3px; }
    50% { height: 16px; }
}

/* Animazione equalizzatori compatti (.mini-eq-bars, .banner-eq-mini, .drawer-eq-anim) */
@keyframes eq-play {
    0% { height: 2px; }
    50% { height: 8px; }
    100% { height: 4px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   📱 MICRO-PILLOLE NOTIZIE DEL GIORNO (Mobile)
   ═══════════════════════════════════════════════════════════════════════════ */
.podcast-mobile-chips-list {
    display: none;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    margin: 0.25rem 0 0.45rem;
}

.podcast-mobile-chip-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-primary, #ffffff);
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 0.82rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

[data-theme="light"] .podcast-mobile-chip-btn {
    background: #ffffff;
    border-color: rgba(99, 102, 241, 0.22);
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.podcast-mobile-chip-btn:hover,
.podcast-mobile-chip-btn:active {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.45);
}

.podcast-mobile-chip-btn.is-playing {
    background: rgba(16, 185, 129, 0.18);
    border-color: #10b981;
}

.chip-num {
    font-size: 0.74rem;
    font-weight: 700;
    color: #818cf8;
    font-family: var(--font-family-mono, monospace);
    min-width: 14px;
    line-height: 1;
}

[data-theme="light"] .chip-num {
    color: #4f46e5;
}

.chip-emoji {
    font-size: 0.95rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.chip-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 0.82rem;
    line-height: 1.35;
    color: inherit;
}

.chip-play-icon {
    font-size: 0.72rem;
    color: #818cf8;
    margin-left: auto;
    flex-shrink: 0;
}

[data-theme="light"] .chip-play-icon {
    color: #4f46e5;
}

@media (max-width: 768px) {
    .podcast-top-header-row {
        gap: 0.5rem;
    }
    .podcast-nav-center-row {
        margin: 0.75rem 0;
        gap: 0.5rem;
    }
    .podcast-center-title {
        font-size: 1.05rem;
    }
    .podcast-nav-edition-btn {
        box-sizing: border-box;
        width: 36px;
        height: 42px;
        font-size: 0.95rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   📑 SCALETTA ESPANDIBILE INTEGRATA NEL BANNER (Desktop Compatta)
   ═══════════════════════════════════════════════════════════════════════════ */
.podcast-hero-banner.has-open-queue .podcast-banner-inner {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom: none !important;
}

.podcast-banner-tracks-drawer {
    position: relative;
    z-index: 10;
    border-top: 1px solid rgba(99, 102, 241, 0.25);
    border-bottom-left-radius: var(--border-radius-card, 16px);
    border-bottom-right-radius: var(--border-radius-card, 16px);
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0.85rem 1.4rem 1rem;
    animation: drawer-fade-up 0.25s ease;
    overflow: visible;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .podcast-banner-tracks-drawer {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    border-bottom-left-radius: var(--border-radius-card, 16px);
    border-bottom-right-radius: var(--border-radius-card, 16px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.banner-tracks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.55rem;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.banner-tracks-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.banner-tracks-title i {
    color: #818cf8;
    font-size: 0.8rem;
}

.banner-tracks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.45rem 0.6rem;
    overflow: visible;
}

.banner-track-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="light"] .banner-track-card {
    background: #ffffff;
    border: 1px solid rgba(203, 213, 225, 0.85);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.banner-track-card:hover {
    background: rgba(99, 102, 241, 0.22) !important;
    border-color: rgba(129, 140, 248, 0.65) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3) !important;
    z-index: 10005 !important;
}

[data-theme="light"] .banner-track-card:hover {
    background: #ffffff !important;
    border-color: #6366f1 !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.18) !important;
}

[data-theme="light"] .banner-track-card:hover .banner-track-title {
    color: #4338ca !important;
}

.banner-track-card.is-active {
    background: rgba(99, 102, 241, 0.28) !important;
    border-color: #818cf8 !important;
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.4) !important;
    z-index: 10004;
}

[data-theme="light"] .banner-track-card.is-active {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.25) !important;
}

.banner-track-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 34px;
}

.banner-track-idx {
    font-family: var(--font-family-mono, monospace);
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    font-weight: 700;
    min-width: 14px;
}

.banner-track-emoji {
    font-size: 0.92rem;
}

.banner-eq-mini {
    display: flex;
    gap: 2px;
    height: 10px;
    align-items: flex-end;
}

.banner-eq-mini span {
    width: 2px;
    height: 3px;
    background: #6366f1;
    border-radius: 1px;
}

.banner-eq-mini span:nth-child(1) { animation: eq-play 0.6s infinite alternate; }
.banner-eq-mini span:nth-child(2) { animation: eq-play 0.9s 0.2s infinite alternate; }
.banner-eq-mini span:nth-child(3) { animation: eq-play 0.7s 0.4s infinite alternate; }

.banner-track-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.banner-track-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

[data-theme="light"] .banner-track-title {
    color: #0f172a !important;
    font-weight: 700;
}

.banner-track-card.is-active .banner-track-title {
    color: #a5b4fc;
    font-weight: 700;
}

[data-theme="light"] .banner-track-card.is-active .banner-track-title {
    color: #312e81 !important;
    font-weight: 700;
}

.banner-track-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: #cbd5e1;
}

.banner-track-cat {
    font-weight: 700;
    text-transform: uppercase;
    color: #a5b4fc;
    letter-spacing: 0.03em;
}

.banner-track-dur {
    font-family: var(--font-family-mono, monospace);
    color: #94a3b8;
    font-weight: 600;
}

[data-theme="light"] .banner-track-meta {
    color: #1e293b !important;
    font-weight: 500;
}

[data-theme="light"] .banner-track-cat {
    color: #4338ca !important;
    font-weight: 800;
}

[data-theme="light"] .banner-track-dur {
    color: #475569 !important;
    font-weight: 600;
}

.banner-track-actions-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.banner-track-play-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.banner-track-remove-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted, #64748b);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.banner-track-card:hover .banner-track-play-btn {
    background: #6366f1;
    color: #ffffff;
    transform: scale(1.1);
}

.banner-track-card.is-active .banner-track-play-btn {
    background: #10b981;
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⠿ DRAG & DROP REORDERING & TRACK REMOVAL
   ═══════════════════════════════════════════════════════════════════════════ */
.banner-track-card,
.drawer-track-item {
    user-select: none;
}

.banner-track-card.is-dragging,
.drawer-track-item.is-dragging {
    opacity: 0.45;
    transform: scale(0.98);
}

.banner-track-card.drag-over {
    border-color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.22) !important;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.4) !important;
    transform: translateY(-2px);
}

.drawer-track-item.drag-over {
    background: rgba(99, 102, 241, 0.25) !important;
    border-left: 3px solid #818cf8 !important;
}

.banner-track-drag-handle,
.drawer-track-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #64748b);
    font-size: 0.8rem;
    cursor: grab;
    padding: 0 0.2rem;
    opacity: 0.45;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.banner-track-drag-handle:active,
.drawer-track-drag-handle:active {
    cursor: grabbing;
}

.banner-track-card:hover .banner-track-drag-handle,
.drawer-track-item:hover .drawer-track-drag-handle {
    opacity: 1;
    color: #818cf8;
}

.banner-track-actions-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.banner-track-remove-btn,
.drawer-track-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-muted, #94a3b8);
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.banner-track-card:hover .banner-track-remove-btn,
.drawer-track-item:hover .drawer-track-remove-btn {
    opacity: 1;
}

.banner-track-remove-btn:hover,
.drawer-track-remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    transform: scale(1.15);
}

/* Responsive Banner Mobile */
@media (max-width: 860px) {
    .podcast-visual-box {
        gap: 0.45rem;
    }

    .podcast-mic-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
    }

    .podcast-equalizer {
        display: none !important;
    }

    .podcast-banner-inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        padding: 1.1rem 1.15rem 1.25rem;
    }

    .podcast-info-box {
        width: 100%;
        min-width: 0;
    }

    .podcast-top-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .podcast-badge-row {
        margin-bottom: 0;
        gap: 0.35rem;
    }

    .podcast-badge-main,
    .podcast-badge-sub {
        width: 28px;
        height: 28px;
        min-width: 28px;
        padding: 0 !important;
        justify-content: center;
        border-radius: 7px;
        font-size: 0.85rem;
    }

    .podcast-badge-text {
        display: none !important;
    }

    .podcast-title {
        font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
        font-size: 1.05rem;
        font-weight: 800;
        line-height: 1.25;
        margin: 0.1rem 0 0.35rem 0;
        width: 100%;
        display: inline-flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .podcast-title-separator {
        font-size: 0.95rem;
    }

    .podcast-main-content-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        width: 100%;
        margin-top: 0.1rem;
    }

    .podcast-mobile-chips-list {
        display: flex !important;
    }

    .podcast-banner-tracks-drawer {
        display: none !important;
    }

    .podcast-top-actions-box,
    .podcast-actions-box {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        margin-left: auto;
        gap: 0;
        flex-shrink: 0;
    }

    .podcast-play-all-btn {
        width: auto;
        padding: 0.42rem 0.95rem;
        height: 32px;
        font-size: 0.8rem;
        justify-content: center;
        margin: 0;
        box-shadow: 0 3px 12px rgba(79, 70, 229, 0.4);
    }

    .podcast-queue-toggle-btn {
        display: none !important;
    }

    .podcast-banner-tracks-drawer {
        padding: 1rem 1.15rem;
    }

    .banner-tracks-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🔥 TREND TICKER BAR (Live Dynamic News Carousel)
   ═══════════════════════════════════════════════════════════════════════════ */
.trend-ticker-banner {
    position: relative;
    width: 100%;
    margin: 0 0 1.25rem 0;
    border-radius: calc(var(--border-radius-card) + 2px);
    padding: 2px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.6) 0%, rgba(168, 85, 247, 0.4) 50%, rgba(6, 182, 212, 0.6) 100%);
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.2),
                0 0 12px 0 rgba(6, 182, 212, 0.12);
    overflow: visible;
    transition: all 0.3s ease;
    z-index: 1000;
}

.trend-ticker-banner:hover,
.trend-ticker-banner:has(.is-open),
.trend-ticker-banner:has([data-tooltip]:hover) {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(168, 85, 247, 0.85) 50%, rgba(6, 182, 212, 0.95) 100%);
    box-shadow: 0 8px 28px 0 rgba(99, 102, 241, 0.35),
                0 0 16px 2px rgba(6, 182, 212, 0.22);
    z-index: 10050 !important;
}

[data-theme="light"] .trend-ticker-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(168, 85, 247, 0.25) 50%, rgba(6, 182, 212, 0.35) 100%);
    box-shadow: 0 4px 18px -2px rgba(99, 102, 241, 0.12),
                0 0 10px 0 rgba(6, 182, 212, 0.08);
}

[data-theme="light"] .trend-ticker-banner:hover,
[data-theme="light"] .trend-ticker-banner:has(.is-open),
[data-theme="light"] .trend-ticker-banner:has([data-tooltip]:hover) {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.6) 0%, rgba(168, 85, 247, 0.5) 50%, rgba(6, 182, 212, 0.6) 100%);
    box-shadow: 0 6px 24px 0 rgba(99, 102, 241, 0.2);
    z-index: 10050 !important;
}

.trend-ticker-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.42rem 0.85rem;
    background: var(--bg-card);
    border-radius: var(--border-radius-card);
    z-index: 1;
    overflow: visible;
}

[data-theme="light"] .trend-ticker-inner {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.94) 100%);
    border: 1px solid rgba(99, 102, 241, 0.16);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 2px 8px rgba(99, 102, 241, 0.04);
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎛️ TICKER THEMATIC CHANNEL SELECTOR (Combo Dropdown & Auto-Cycle)
   ═══════════════════════════════════════════════════════════════════════════ */
.ticker-top-row-mobile {
    display: contents;
}

.ticker-theme-dropdown-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    z-index: 10020;
}

.ticker-theme-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(249, 115, 22, 0.2) 100%);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.ticker-theme-trigger-btn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.35) 0%, rgba(249, 115, 22, 0.35) 100%);
    border-color: #ef4444;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

[data-theme="light"] .ticker-theme-trigger-btn {
    background: linear-gradient(135deg, #fff1f2 0%, #ffedd5 100%);
    border-color: rgba(239, 68, 68, 0.35);
    color: #dc2626;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.1);
}

[data-theme="light"] .ticker-theme-trigger-btn:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fed7aa 100%);
    border-color: #ef4444;
    color: #b91c1c;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.18);
}

.ticker-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10025;
    background: transparent;
    cursor: default;
}

.ticker-theme-caret {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
    opacity: 0.8;
}

.ticker-theme-dropdown-container.is-open .ticker-theme-caret {
    transform: rotate(180deg);
}

.ticker-theme-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: #0f172a !important;
    border: 1px solid rgba(99, 102, 241, 0.45) !important;
    border-radius: 10px;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.85),
                0 0 0 1px rgba(99, 102, 241, 0.35) !important;
    animation: menuFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10030 !important;
}

[data-theme="light"] .ticker-theme-menu {
    background: #ffffff !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(99, 102, 241, 0.25) !important;
}

.ticker-theme-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-primary, #ffffff);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}

.ticker-theme-item:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.ticker-theme-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.2) 100%);
    color: #ffffff;
    border-left: 3px solid #6366f1;
}

[data-theme="light"] .ticker-theme-item {
    color: #1e293b;
}

[data-theme="light"] .ticker-theme-item:hover {
    background: #f1f5f9;
    color: #4338ca;
}

[data-theme="light"] .ticker-theme-item.active {
    background: #eef2ff;
    color: #4338ca;
    border-left-color: #4f46e5;
    font-weight: 700;
}

.ticker-theme-item-count {
    font-family: var(--font-family-mono, monospace);
    font-size: 0.68rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted, #94a3b8);
}

[data-theme="light"] .ticker-theme-item-count {
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ticker-badge-box {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0.6rem;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(249, 115, 22, 0.2) 100%);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
}

[data-theme="light"] .ticker-badge-box {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.35);
    color: #dc2626;
}

.ticker-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: ticker-pulse 1.5s infinite;
}

@keyframes ticker-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.5; }
}

.ticker-items-track {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 1.5%, black 98.5%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 1.5%, black 98.5%, transparent);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ticker-items-track.fade-out {
    opacity: 0;
    transform: translateY(4px);
}

.ticker-items-track.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.ticker-marquee-inner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: max-content;
    -webkit-animation: ticker-tv-scroll var(--ticker-speed, 45s) linear infinite;
    animation: ticker-tv-scroll var(--ticker-speed, 45s) linear infinite;
    will-change: transform;
}

/* 🛑 Pausa del Marquee al passaggio del mouse (hover), tocco touch, focus o classe attiva */
.trend-ticker-banner:hover .ticker-marquee-inner,
.ticker-items-track:hover .ticker-marquee-inner,
.ticker-marquee-inner:hover,
.ticker-marquee-inner.is-paused,
.ticker-marquee-inner:focus-within,
.ticker-chip-item:hover,
.ticker-chip-item:focus,
.ticker-chip-item:active {
    -webkit-animation-play-state: paused !important;
    animation-play-state: paused !important;
}

@-webkit-keyframes ticker-tv-scroll {
    0% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
    100% {
        -webkit-transform: translateX(-50%);
        transform: translateX(-50%);
    }
}

@keyframes ticker-tv-scroll {
    0% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
    100% {
        -webkit-transform: translateX(-50%);
        transform: translateX(-50%);
    }
}

.ticker-chip-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.36rem 0.85rem;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: var(--text-primary, #ffffff);
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-size: 0.88rem;
    font-weight: 600;
    max-width: 620px;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
}

.ticker-chip-item:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.45);
    color: #ffffff;
    transform: translateY(-1px);
    z-index: 10005 !important;
}

[data-theme="light"] .ticker-chip-item {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(203, 213, 225, 0.8);
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .ticker-chip-item:hover {
    background: #ffffff;
    border-color: #6366f1;
    color: #4338ca;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.12);
}

.ticker-cluster-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.35);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #a5b4fc;
    line-height: 1.1;
    flex-shrink: 0;
}

[data-theme="light"] .ticker-cluster-tag {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #4338ca;
}

.ticker-chip-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
    margin-right: 0.2rem;
}

[data-theme="light"] .ticker-chip-emoji {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.ticker-chip-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    font-size: 0.88rem;
    font-weight: 600;
}

.ticker-chip-arrow {
    font-size: 0.65rem;
    color: var(--text-muted, #94a3b8);
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.ticker-chip-item:hover .ticker-chip-arrow {
    opacity: 1;
    transform: translate(1px, -1px);
    color: #818cf8;
}

[data-theme="light"] .ticker-chip-item:hover .ticker-chip-arrow {
    color: #4f46e5;
}

.ticker-controls-box {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.ticker-ctrl-btn,
.ticker-close-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted, #94a3b8);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ticker-ctrl-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #ffffff;
    border-color: rgba(99, 102, 241, 0.45);
}

.ticker-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.45);
}

[data-theme="light"] .ticker-ctrl-btn,
[data-theme="light"] .ticker-close-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

[data-theme="light"] .ticker-ctrl-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    border-color: #6366f1;
}

[data-theme="light"] .ticker-close-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border-color: #ef4444;
}

/* Responsive Ticker Mobile (2-Row Ultra-Compact Layout) */
@media (max-width: 768px) {
    .trend-ticker-inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 0.38rem 0.65rem;
        gap: 0.35rem;
    }

    .ticker-top-row-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 0.5rem;
    }

    .ticker-theme-dropdown-container {
        flex-shrink: 0;
    }

    .ticker-theme-trigger-btn {
        padding: 0.28rem 0.75rem;
        font-size: 0.80rem;
        border-radius: 9px;
    }

    .ticker-badge-text {
        display: inline;
        font-size: 0.78rem;
        font-weight: 700;
    }

    .ticker-items-track {
        width: 100%;
        min-width: 0;
        overflow: hidden;
        height: 32px;
    }

    .ticker-marquee-inner {
        gap: 0.75rem;
    }

    .ticker-chip-item {
        display: inline-flex !important;
        max-width: 86vw;
        font-size: 0.84rem;
        padding: 0.26rem 0.7rem;
        border-radius: 8px;
        font-weight: 600;
    }

    .ticker-chip-title {
        font-size: 0.84rem;
        font-weight: 600;
    }

    .ticker-chip-emoji {
        width: auto !important;
        height: auto !important;
        font-size: 0.95rem !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎵 GLOBAL PERSISTENT AUDIO PLAYER (Bottom Bar)
   ═══════════════════════════════════════════════════════════════════════════ */
.global-audio-player-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    animation: player-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes player-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.global-player-bar {
    position: relative;
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1.5rem;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .global-player-bar {
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.1);
}

/* Sezione Sinistra: Info Traccia */
.player-track-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.track-emoji-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(147, 51, 234, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.mini-eq-bars {
    position: absolute;
    bottom: 3px;
    right: 3px;
    display: flex;
    gap: 1.5px;
    height: 8px;
    align-items: flex-end;
}

.mini-eq-bars span {
    width: 2px;
    height: 2px;
    background: #38bdf8;
    border-radius: 1px;
}

.mini-eq-bars.active span:nth-child(1) { animation: eq-play 0.6s infinite alternate; }
.mini-eq-bars.active span:nth-child(2) { animation: eq-play 0.9s 0.2s infinite alternate; }
.mini-eq-bars.active span:nth-child(3) { animation: eq-play 0.7s 0.4s infinite alternate; }

.track-eq-live {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 11px;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.track-eq-live span {
    width: 2px;
    height: 3px;
    background: #10b981;
    border-radius: 1px;
}

[data-theme="light"] .track-eq-live span {
    background: #059669;
}

.track-eq-live span:nth-child(1) { animation: eq-play 0.6s infinite alternate ease-in-out; }
.track-eq-live span:nth-child(2) { animation: eq-play 0.9s 0.2s infinite alternate ease-in-out; }
.track-eq-live span:nth-child(3) { animation: eq-play 0.7s 0.4s infinite alternate ease-in-out; }

.track-meta {
    min-width: 0;
}

.track-category-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

.track-category-pill {
    font-size: 0.68rem;
    font-weight: 700;
    color: #818cf8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.track-index-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.track-bonus-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

[data-theme="light"] .track-bonus-badge {
    background: rgba(5, 150, 105, 0.12);
    color: #047857;
    border-color: rgba(5, 150, 105, 0.3);
}

.track-bonus-title-prefix {
    color: #34d399;
    font-weight: 800;
}

[data-theme="light"] .track-bonus-title-prefix {
    color: #059669;
}

.track-title-container {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 8px, black calc(100% - 12px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 8px, black calc(100% - 12px), transparent);
}

.track-title-link {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    max-width: 100%;
    overflow: visible;
    transition: color 0.2s ease;
}

.track-title-inner {
    display: inline-block;
    white-space: nowrap;
    animation: marquee-title 14s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes marquee-title {
    0%, 20% {
        transform: translateX(0);
    }
    80%, 100% {
        transform: translateX(min(0px, calc(-100% + 280px)));
    }
}

.track-title-link:hover {
    color: #818cf8;
}

/* Sezione Centrale: Controlli & Scrubber */
.player-controls-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.player-buttons-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.player-btn {
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.player-btn:hover {
    color: var(--text-primary, #ffffff);
    transform: scale(1.1);
}

.prev-btn, .next-btn {
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
}

.play-pause-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.play-pause-btn:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    transform: scale(1.08);
}

.play-pause-btn.playing {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Scrubber */
.player-scrubber-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
}

.time-label {
    font-family: var(--font-family-mono, monospace);
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
    min-width: 36px;
    text-align: center;
}

.scrubber-track-container {
    flex: 1;
    padding: 0.35rem 0;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
}

.scrubber-track-container:focus-visible .scrubber-track-bg {
    height: 6px;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.scrubber-track-bg {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    transition: height 0.15s ease;
}

.scrubber-track-container:hover .scrubber-track-bg,
.scrubber-track-container:active .scrubber-track-bg {
    height: 6px;
}

.scrubber-track-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #38bdf8 100%);
    border-radius: 2px;
}

.scrubber-thumb {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
    pointer-events: none;
}

.scrubber-track-container:hover .scrubber-thumb,
.scrubber-track-container:active .scrubber-thumb,
.scrubber-track-container:focus-visible .scrubber-thumb {
    transform: translate(-50%, -50%) scale(1);
}

[data-theme="light"] .scrubber-track-bg {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .scrubber-thumb {
    background: #4f46e5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Sezione Destra: Azioni */
.player-actions-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.player-action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary, #94a3b8);
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    position: relative;
}

.player-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #ffffff);
}

.player-action-btn.queue-btn {
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
}

.player-action-btn.queue-btn.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: #6366f1;
    color: #818cf8;
}

.queue-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #6366f1;
    color: #ffffff;
    font-size: 0.6rem;
    font-family: var(--font-family-mono, monospace);
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 8px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

.speed-btn {
    font-family: var(--font-family-mono, monospace);
    min-width: 52px;
    height: 36px;
    padding: 0 0.6rem;
    font-size: 0.85rem;
    justify-content: center;
}

.player-action-btn.queue-btn {
    position: relative;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 0.9rem;
}

/* Tasto Chiudi Sbordante Elegante (Overhanging Top-Right: metà fuori e metà dentro) */
.close-btn-overhang {
    position: absolute !important;
    top: -16px !important; /* Esattamente la metà dei 32px: 16px sbordano sopra, 16px rimangono nella barra */
    right: 20px !important;
    left: auto !important;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff !important;
    border: 2px solid rgba(15, 23, 42, 0.95);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    z-index: 10001 !important;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
}

[data-theme="light"] .close-btn-overhang {
    border-color: #ffffff;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.close-btn-overhang:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.6);
}

.close-btn-overhang:active {
    transform: scale(0.95) rotate(90deg);
}

/* Su Desktop (> 1024px) i controlli velocità e scaletta sono a destra, nascondi quelli inline */
.mobile-tablet-control {
    display: none !important;
}

.desktop-only-actions {
    display: flex !important;
}

/* Titolo desktop con contenitore */
.track-title-container {
    min-width: 0;
    overflow: hidden;
}

/* Vecchia classe close-btn per compatibilità */
.close-btn {
    color: #ef4444;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* ═══════════════════════════════════════════════════════════════════════════
   📑 PLAYLIST DRAWER (Scaletta Notizie)
   ═══════════════════════════════════════════════════════════════════════════ */
.playlist-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10001;
}

.playlist-drawer-panel {
    position: fixed;
    bottom: 74px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: 480px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: drawer-fade-up 0.25s ease;
}

[data-theme="light"] .playlist-drawer-panel {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

@keyframes drawer-fade-up {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #818cf8;
}

.drawer-title-wrap h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
}

.drawer-count {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.drawer-close-btn {
    background: none;
    border: none;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.drawer-close-btn:hover {
    color: var(--text-primary, #ffffff);
}

.drawer-tracks-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.drawer-track-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drawer-track-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.drawer-track-item.is-active {
    background: rgba(99, 102, 241, 0.15);
    border-left: 3px solid #6366f1;
}

.track-item-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 36px;
}

.track-num {
    font-family: var(--font-family-mono, monospace);
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

.drawer-eq-anim {
    display: flex;
    gap: 1.5px;
    height: 10px;
    align-items: flex-end;
}

.drawer-eq-anim span {
    width: 2px;
    height: 3px;
    background: #6366f1;
    border-radius: 1px;
}

.drawer-eq-anim span:nth-child(1) { animation: eq-play 0.6s infinite alternate; }
.drawer-eq-anim span:nth-child(2) { animation: eq-play 0.9s 0.2s infinite alternate; }
.drawer-eq-anim span:nth-child(3) { animation: eq-play 0.7s 0.4s infinite alternate; }

.track-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.track-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="light"] .track-item-title {
    color: #0f172a !important;
    font-weight: 700;
}

.drawer-track-item.is-active .track-item-title {
    color: #a5b4fc;
    font-weight: 700;
}

[data-theme="light"] .drawer-track-item.is-active .track-item-title {
    color: #312e81 !important;
    font-weight: 700;
}

.track-item-cat {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    font-weight: 600;
}

[data-theme="light"] .track-item-cat {
    color: #4338ca !important;
    font-weight: 700;
}

.track-item-duration {
    font-family: var(--font-family-mono, monospace);
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
}

[data-theme="light"] .track-item-duration {
    color: #475569 !important;
    font-weight: 600;
}

/* Responsive Player Mobile & Tablet (≤ 1024px) - Layout Unificato Ergonomico */
@media (max-width: 1024px) {
    .global-audio-player-wrapper {
        box-sizing: border-box;
        max-width: 100vw;
        width: 100%;
        left: 0;
        right: 0;
        overflow: visible;
    }

    .global-player-bar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: relative;
        padding: 0.65rem 0.85rem 0.65rem;
        gap: 0.45rem;
        box-sizing: border-box;
        width: 100%;
        max-width: 100vw;
        overflow: visible; /* Necessario per il tasto X che sborda in alto a destra */
    }

    /* Tasto Chiudi Sbordante su Mobile e Tablet (metà dei 30px fuori: -15px) */
    .close-btn-overhang {
        position: absolute !important;
        top: -15px !important;
        right: 14px !important;
        left: auto !important;
        width: 30px !important;
        height: 30px !important;
        font-size: 0.8rem;
    }

    /* Riga 1: Info Traccia a larghezza piena con spazio di rispetto per la X rossa a destra */
    .player-track-info {
        width: 100%;
        min-width: 0;
        gap: 0.65rem;
        padding-right: 32px; /* Margine di sicurezza per non toccare la X sbordante */
        box-sizing: border-box;
    }

    .track-emoji-wrap {
        width: 36px;
        height: 36px;
        font-size: 1.15rem;
        border-radius: 9px;
        flex-shrink: 0;
    }

    .track-meta {
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }

    .track-category-row {
        display: flex;
        align-items: center;
        gap: 0.45rem;
        margin-bottom: 0.2rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .track-index-badge {
        font-size: 0.68rem;
        font-weight: 700;
        padding: 0.1rem 0.4rem;
        background: rgba(99, 102, 241, 0.2);
        color: #818cf8;
        border: 1px solid rgba(99, 102, 241, 0.35);
        border-radius: 5px;
        flex-shrink: 0;
    }

    [data-theme="light"] .track-index-badge {
        background: rgba(99, 102, 241, 0.12);
        color: #4f46e5;
        border-color: rgba(99, 102, 241, 0.25);
    }

    .track-category-pill {
        font-size: 0.66rem;
        font-weight: 700;
        letter-spacing: 0.04em;
    }

    .track-bonus-badge {
        font-size: 0.62rem;
        padding: 0.08rem 0.35rem;
    }

    /* Riga 2: Contenitore Titolo a piena larghezza con Scorrimento Marquee Fluido */
    .track-title-container {
        width: 100%;
        min-width: 0;
        overflow: hidden;
        position: relative;
        mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 16px), transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 16px), transparent);
    }

    .track-title-link {
        font-size: 0.85rem;
        font-weight: 700;
        white-space: nowrap;
        display: inline-flex;
        max-width: none;
        overflow: visible;
        text-decoration: none;
    }

    .track-title-inner {
        display: inline-block;
        white-space: nowrap;
        animation: marquee-mobile 12s ease-in-out infinite alternate;
        padding: 0 4px;
        will-change: transform;
    }

    @keyframes marquee-mobile {
        0%, 25% {
            transform: translateX(0%);
        }
        75%, 100% {
            transform: translateX(min(0px, calc(-100% + 80vw)));
        }
    }

    /* Riga 3: Controlli Centrali a tutta larghezza con pulsanti ingranditi */
    .player-controls-center {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
        margin: 0;
    }

    .player-buttons-row {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1.1rem;
    }

    /* Mostra i controlli velocità e scaletta nella barra pulsanti su Mobile & Tablet */
    .mobile-tablet-control {
        display: inline-flex !important;
    }

    /* Nascondi la colonna destra desktop su Mobile & Tablet */
    .desktop-only-actions {
        display: none !important;
    }

    /* Dimensioni generose dei tasti per tocco ergonomico */
    .player-action-btn.speed-btn {
        min-width: 42px;
        height: 36px;
        padding: 0 0.45rem;
        font-size: 0.78rem;
        border-radius: 9px;
    }

    .player-action-btn.queue-btn {
        width: 36px;
        height: 36px;
        font-size: 0.88rem;
        border-radius: 9px;
    }

    .prev-btn, .next-btn {
        width: 36px;
        height: 36px;
        font-size: 1.05rem;
    }

    .play-pause-btn {
        width: 46px;
        height: 46px;
        font-size: 1.15rem;
        box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
    }

    /* Riga 4: Scrubber e minutaggi con area sensibile confortevole */
    .player-scrubber-row {
        width: 100%;
        box-sizing: border-box;
        gap: 0.6rem;
    }

    .scrubber-track-container {
        flex: 1;
        min-width: 0;
        padding: 8px 0;
    }

    .scrubber-track-bg {
        height: 5px;
    }

    .scrubber-thumb {
        width: 13px;
        height: 13px;
        transform: translate(-50%, -50%) scale(1);
    }

    .time-label {
        font-size: 0.7rem;
        min-width: 34px;
    }

    .playlist-drawer-panel {
        right: 8px;
        left: 8px;
        width: auto;
        max-width: calc(100vw - 16px);
        bottom: 96px;
        max-height: 60vh;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎧 CUSTOM PODCAST QUEUE (Card Buttons & Floating Action Pill)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Pulsante Coda sulla Card dell'Articolo */
.card-queue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.25);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-left: auto;
    flex-shrink: 0;
}

[data-theme="light"] .card-queue-btn {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    color: #4f46e5;
}

.card-queue-btn:hover {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.queue-plus-sign {
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
}

.card-queue-btn.in-queue {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    transform: scale(1.05);
}

.card-queue-btn.in-queue:hover {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Pillola Flottante Coda (Bottom Left per massima visibilità e zero conflitti) */
.podcast-floating-queue-bar {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: auto;
    z-index: 9999;
    box-sizing: border-box;
    max-width: calc(100vw - 32px);
    animation: queue-pill-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: bottom 0.3s ease, transform 0.2s ease;
}

@keyframes queue-pill-pop {
    0% { transform: scale(0.7) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.queue-bar-inner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.55rem 0.85rem 0.55rem 0.65rem;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 40px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45), 0 0 20px rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .queue-bar-inner {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12), 0 0 20px rgba(99, 102, 241, 0.15);
}

.queue-bar-icon-wrap {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.queue-bar-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: #ffffff;
    font-family: var(--font-family-mono, monospace);
    font-size: 0.68rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.queue-bar-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.queue-bar-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
}

.queue-bar-meta {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
    font-family: var(--font-family-mono, monospace);
}

.queue-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.queue-bar-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.queue-bar-play-btn:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    transform: scale(1.06);
}

.queue-bar-clear-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.queue-bar-clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: #ef4444;
}

/* Pulsante "Accoda tutti" in News.razor (Armonizzato con results-pill-compact) */
.news-results-actions-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.news-add-all-queue-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.95rem;
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #818cf8;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

[data-theme="light"] .news-add-all-queue-btn {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.25);
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
}

.news-add-all-queue-btn:hover {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.news-add-all-queue-btn i {
    font-size: 0.84rem;
}

.news-add-all-queue-btn .btn-txt {
    font-size: 0.82rem;
    white-space: nowrap;
}

.news-add-all-queue-btn .btn-count-badge {
    font-family: var(--font-family-mono, monospace);
    font-size: 0.76rem;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
    padding: 1px 6px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.news-add-all-queue-btn:hover .btn-count-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ✨ CUSTOM GLASSMORPHISM TOOLTIPS (Scaletta, Accoda Tutti, Card Queue)
   ═══════════════════════════════════════════════════════════════════════════ */

.podcast-queue-toggle-btn,
.podcast-play-all-btn,
.news-add-all-queue-btn,
/* ═══════════════════════════════════════════════════════════════════════════
   🎯 UNIFIED GLOBAL TOOLTIP SYSTEM (Custom Glassmorphic CSS Tooltips)
   ═══════════════════════════════════════════════════════════════════════════ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover {
    z-index: 99999 !important;
}

/* Bubble (Default: opens upward) */
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: 320px;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.76rem;
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(99, 102, 241, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.35);
    z-index: 1000000 !important;
}

/* Arrow (Default: points downward) */
[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1000001 !important;
}

/* Hover Show */
[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* 🎯 Micro Tooltip Compatto per i Segmenti del Trend Radar */
.trend-radar-segment[data-tooltip]::after {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif) !important;
    font-size: 0.72rem !important;
    padding: 0.25rem 0.6rem !important;
    border-radius: 6px !important;
    width: max-content !important;
    max-width: 280px !important;
    white-space: nowrap !important;
    line-height: 1.25 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
    bottom: calc(100% + 6px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

.trend-radar-segment[data-tooltip]::before {
    border-width: 4px 4px 0 4px !important;
    bottom: calc(100% + 2px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

.trend-radar-segment[data-tooltip]:hover::after,
.trend-radar-segment[data-tooltip]:hover::before {
    transform: translateX(-50%) !important;
}

/* ⬇️ Tooltip con Apertura verso il BASSO (Solo dove esplicitamente richiesto con data-tooltip-pos="bottom") */
[data-tooltip-pos="bottom"]::after {
    bottom: auto;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
}

[data-tooltip-pos="bottom"]::before {
    bottom: auto;
    top: calc(100% + 2px);
    left: 50%;
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent #0f172a transparent;
    transform: translateX(-50%) translateY(-4px);
}

[data-tooltip-pos="bottom"]:hover::after,
[data-tooltip-pos="bottom"]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Allineamento controlli Header a destra per evitare sbordature oltre il bordo dello schermo */
.nav-controls [data-tooltip-pos="bottom"]::after {
    left: auto;
    right: 0;
    transform: translateY(-4px);
    text-align: right;
}

.nav-controls [data-tooltip-pos="bottom"]::before {
    left: auto;
    right: 14px;
    transform: translateY(-4px);
}

.nav-controls [data-tooltip-pos="bottom"]:hover::after,
.nav-controls [data-tooltip-pos="bottom"]:hover::before {
    transform: translateY(0);
}

/* ⬅️ Allineamento Tooltip a Sinistra (per elementi adiacenti al bordo sinistro dello schermo) */
[data-tooltip-align="left"]::after,
.podcast-badge-row [data-tooltip]::after {
    left: 0 !important;
    right: auto !important;
    transform: translateY(4px) !important;
    text-align: left !important;
}

[data-tooltip-align="left"]::before,
.podcast-badge-row [data-tooltip]::before {
    left: 10px !important;
    right: auto !important;
    transform: translateY(4px) !important;
}

[data-tooltip-align="left"]:hover::after,
[data-tooltip-align="left"]:hover::before,
.podcast-badge-row [data-tooltip]:hover::after,
.podcast-badge-row [data-tooltip]:hover::before {
    transform: translateY(0) !important;
}

[data-tooltip-align="left"][data-tooltip-pos="bottom"]::after,
.podcast-badge-row [data-tooltip-pos="bottom"]::after {
    left: 0 !important;
    right: auto !important;
    transform: translateY(-4px) !important;
    text-align: left !important;
}

[data-tooltip-align="left"][data-tooltip-pos="bottom"]::before,
.podcast-badge-row [data-tooltip-pos="bottom"]::before {
    left: 10px !important;
    right: auto !important;
    transform: translateY(-4px) !important;
}

[data-tooltip-align="left"][data-tooltip-pos="bottom"]:hover::after,
[data-tooltip-align="left"][data-tooltip-pos="bottom"]:hover::before,
.podcast-badge-row [data-tooltip-pos="bottom"]:hover::after,
.podcast-badge-row [data-tooltip-pos="bottom"]:hover::before {
    transform: translateY(0) !important;
}

/* ➡️ Tooltip con Apertura verso DESTRA (Solo per menu dropdown) */
[data-tooltip-pos="right"]::after {
    bottom: auto;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
}

[data-tooltip-pos="right"]::before {
    bottom: auto;
    left: calc(100% + 2px);
    top: 50%;
    border-width: 6px 6px 6px 0;
    border-color: transparent #0f172a transparent transparent;
    transform: translateY(-50%) translateX(-4px);
}

[data-tooltip-pos="right"]:hover::after,
[data-tooltip-pos="right"]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Light Theme Overrides */
[data-theme="light"] [data-tooltip]::after {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.25);
}

[data-theme="light"] [data-tooltip]::before {
    border-color: #ffffff transparent transparent transparent;
}

[data-theme="light"] [data-tooltip-pos="bottom"]::before {
    border-color: transparent transparent #ffffff transparent;
}

[data-theme="light"] [data-tooltip-pos="right"]::before {
    border-color: transparent #ffffff transparent transparent;
}

@media (max-width: 600px) {
    .podcast-floating-queue-bar {
        right: 10px;
        left: 10px;
        bottom: 16px;
        max-width: calc(100vw - 20px);
    }
    .queue-bar-inner {
        width: 100%;
        padding: 0.4rem 0.6rem 0.4rem 0.5rem;
        gap: 0.45rem;
        justify-content: space-between;
    }
    .queue-bar-icon-wrap {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    .queue-bar-badge {
        min-width: 16px;
        height: 16px;
        font-size: 0.62rem;
    }
    .queue-bar-label {
        font-size: 0.76rem;
    }
    .queue-bar-meta {
        font-size: 0.66rem;
    }
    .queue-bar-play-btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.74rem;
        gap: 0.3rem;
    }
    .queue-bar-clear-btn {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🔖 BOOKMARKS / SALVA PER DOPO SYSTEM (Header, Cards, Filter, Drawer)
   ═══════════════════════════════════════════════════════════════════════════ */

/* 1. Header Bookmark Button */
.header-bookmark-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary, #cbd5e1);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] .header-bookmark-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: #475569;
}

.header-bookmark-btn:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
    color: #f59e0b;
    transform: translateY(-1px) scale(1.05);
}

.header-bookmark-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
    line-height: 1;
}

/* 2. Card Header Actions (Bookmark + Audio Queue) */
.card-top-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    flex-shrink: 0;
}

.card-bookmark-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] .card-bookmark-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #94a3b8;
}

.card-bookmark-btn:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    transform: scale(1.15);
}

.card-bookmark-btn.is-bookmarked {
    background: rgba(245, 158, 11, 0.18);
    border-color: #f59e0b;
    color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
    transform: scale(1.05);
}

.card-bookmark-btn.is-bookmarked:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

/* 3. Article Page Band & Share Bookmark */
.section-band-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
    flex-shrink: 0;
}

.article-band-bookmark-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #cbd5e1);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    transition: all 0.2s ease;
    user-select: none;
    flex-shrink: 0;
}

.article-band-bookmark-btn i {
    font-size: 0.95rem;
    line-height: 1;
}

[data-theme="light"] .article-band-bookmark-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #475569;
}

.article-band-bookmark-btn:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
    color: #f59e0b;
    transform: translateY(-1px);
}

.article-band-bookmark-btn.is-bookmarked {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #f59e0b;
}

@media (max-width: 768px) {
    .section-band {
        padding: 0.6rem 0.85rem !important;
        gap: 0.4rem !important;
    }

    .section-band-title {
        min-width: 0;
        font-size: 0.86rem;
    }

    .section-band-title span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .section-band-actions {
        gap: 0.35rem;
    }

    .article-band-bookmark-btn {
        width: 28px;
        height: 28px;
        padding: 0;
        min-width: 28px;
    }
}

.share-btn.share-bookmark.bookmarked {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #f59e0b;
}

/* 4. News Page Bookmark Filter Chip */
.bookmark-filter-chip {
    cursor: pointer;
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.06);
    justify-content: flex-start !important;
    gap: 0.45rem !important;
    text-align: left;
}

.bookmark-filter-chip .chip-label {
    flex: 1;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="light"] .bookmark-filter-chip .chip-label {
    color: #1e293b;
}

.bookmark-filter-chip.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.25));
    border-color: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.bookmark-filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    margin-left: 0.25rem;
}

/* 5. Bookmarks Off-Canvas Drawer */
.bookmark-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 500000;
    animation: fadeIn 0.25s ease-out;
}

.bookmark-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    background: #131722;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
    z-index: 500001;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .bookmark-drawer {
    background: #ffffff;
    border-left-color: rgba(0, 0, 0, 0.1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
}

.bookmark-drawer-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.4rem;
    background: #131722;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .bookmark-drawer-header {
    background: #ffffff;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.bookmark-drawer-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.bookmark-drawer-icon {
    font-size: 1.2rem;
    color: #f59e0b;
}

.bookmark-drawer-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
}

[data-theme="light"] .bookmark-drawer-title {
    color: #0f172a;
}

.bookmark-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
}

.bookmark-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

[data-theme="light"] .bookmark-close-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
}

.bookmark-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.bookmark-drawer-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.4rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .bookmark-drawer-toolbar {
    background: rgba(0, 0, 0, 0.02);
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

.bookmark-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    border: none;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bookmark-tool-btn.primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.bookmark-tool-btn.primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

.bookmark-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bookmark-item-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
}

[data-theme="light"] .bookmark-item-card {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.06);
}

.bookmark-item-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(-2px);
}

[data-theme="light"] .bookmark-item-card:hover {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.1);
}

.bookmark-item-left {
    flex-shrink: 0;
}

.bookmark-item-emoji {
    font-size: 1.4rem;
    display: block;
    line-height: 1;
    margin-top: 2px;
}

.bookmark-item-body {
    flex: 1;
    min-width: 0;
}

.bookmark-item-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary, #f1f5f9);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    transition: color 0.15s ease;
}

[data-theme="light"] .bookmark-item-title {
    color: #1e293b;
}

.bookmark-item-title:hover {
    color: #f59e0b;
}

.bookmark-item-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

.bookmark-item-cat {
    color: #818cf8;
    font-weight: 600;
}

.bookmark-item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-shrink: 0;
}

.bookmark-item-queue-btn,
.bookmark-item-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s ease;
}

.bookmark-item-queue-btn {
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
}

.bookmark-item-queue-btn.in-queue {
    background: #10b981;
    color: #ffffff;
}

.bookmark-item-queue-btn:hover {
    background: #6366f1;
    color: #ffffff;
}

.bookmark-item-remove-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}

.bookmark-item-remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* 🔖 Tooltip a comparsa fluida verso SINISTRA all'interno del drawer Bookmark (Zero sbordature fuori schermo) */
.bookmark-drawer [data-tooltip]::after {
    top: 50% !important;
    bottom: auto !important;
    left: auto !important;
    right: calc(100% + 8px) !important;
    transform: translateY(-50%) translateX(4px) !important;
    white-space: nowrap !important;
}

.bookmark-drawer [data-tooltip]::before {
    top: 50% !important;
    bottom: auto !important;
    left: auto !important;
    right: calc(100% + 2px) !important;
    transform: translateY(-50%) translateX(4px) !important;
    border-width: 5px 0 5px 5px !important;
    border-style: solid !important;
    border-color: transparent transparent transparent rgba(15, 23, 42, 0.96) !important;
}

.bookmark-drawer [data-tooltip]:hover::after,
.bookmark-drawer [data-tooltip]:hover::before {
    transform: translateY(-50%) translateX(0) !important;
}

[data-theme="light"] .bookmark-drawer [data-tooltip]::before {
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.96) !important;
}

.bookmark-drawer-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
}

.empty-bookmark-icon {
    font-size: 3rem;
    color: rgba(245, 158, 11, 0.3);
    margin-bottom: 1rem;
}

.empty-bookmark-text {
    font-size: 0.9rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.5;
    margin: 0;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ✨ SPECIALIZED TOOLTIPS FOR BOOKMARKS DRAWER (Drawer Action Buttons)
   ═══════════════════════════════════════════════════════════════════════════ */

/* 2. ⬅️ Drawer Action Buttons Tooltip (Leftwards inside drawer) */
.bookmark-item-queue-btn,
.bookmark-item-remove-btn,
.bookmark-close-btn {
    position: relative;
}

.bookmark-item-queue-btn[data-tooltip]::after,
.bookmark-item-remove-btn[data-tooltip]::after,
.bookmark-close-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(4px);
    width: max-content;
    max-width: 220px;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    font-size: 0.75rem;
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 12px rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(99, 102, 241, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 10008;
}

.bookmark-item-queue-btn[data-tooltip]::before,
.bookmark-item-remove-btn[data-tooltip]::before,
.bookmark-close-btn[data-tooltip]::before {
    content: '';
    position: absolute;
    right: calc(100% + 3px);
    top: 50%;
    transform: translateY(-50%) translateX(4px);
    border-width: 5px 0 5px 5px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(15, 23, 42, 0.96);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 10009;
}

.bookmark-item-queue-btn[data-tooltip]:hover::after,
.bookmark-item-queue-btn[data-tooltip]:hover::before,
.bookmark-item-remove-btn[data-tooltip]:hover::after,
.bookmark-item-remove-btn[data-tooltip]:hover::before,
.bookmark-close-btn[data-tooltip]:hover::after,
.bookmark-close-btn[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

[data-theme="light"] .bookmark-item-queue-btn[data-tooltip]::after,
[data-theme="light"] .bookmark-item-remove-btn[data-tooltip]::after,
[data-theme="light"] .bookmark-close-btn[data-tooltip]::after {
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15), 0 0 10px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .bookmark-item-queue-btn[data-tooltip]::before,
[data-theme="light"] .bookmark-item-remove-btn[data-tooltip]::before,
[data-theme="light"] .bookmark-close-btn[data-tooltip]::before {
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.96);
}

/* 3. ➡️ Drawer Category Emoji Tooltip (Rightwards) */
.bookmark-item-left {
    position: relative;
}

.bookmark-item-left[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    width: max-content;
    max-width: 180px;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    font-size: 0.72rem;
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-weight: 600;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.3);
    backdrop-filter: blur(10px);
    z-index: 10008;
}

.bookmark-item-left[data-tooltip]::before {
    content: '';
    position: absolute;
    left: calc(100% + 3px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    border-width: 5px 5px 5px 0;
    border-style: solid;
    border-color: transparent rgba(15, 23, 42, 0.96) transparent transparent;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 10009;
}

.bookmark-item-left[data-tooltip]:hover::after,
.bookmark-item-left[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

[data-theme="light"] .bookmark-item-left[data-tooltip]::after {
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border-color: rgba(99, 102, 241, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   💬 SMART Q&A (CHIEDI ALL'AI)
   ═══════════════════════════════════════════════════════════════════════════ */

.smart-qa-container {
    margin: 2rem 0;
    padding: 1.35rem 1.5rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(99, 102, 241, 0.04) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

[data-theme="light"] .smart-qa-container {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(238, 242, 255, 0.9) 100%);
    border-color: rgba(99, 102, 241, 0.15);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

.smart-qa-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.1rem;
}

.smart-qa-header-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.smart-qa-header-title i {
    color: var(--accent-primary, #6366f1);
    font-size: 1.15rem;
}

.qa-title-text {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-family-heading, 'Inter', sans-serif);
    color: var(--text-primary, #f8fafc);
    letter-spacing: -0.01em;
}

[data-theme="light"] .qa-title-text {
    color: #0f172a;
}

.smart-qa-header-sub {
    font-size: 0.84rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.4;
}

[data-theme="light"] .smart-qa-header-sub {
    color: #64748b;
}

/* 💊 PILLS LIST */
.smart-qa-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.smart-qa-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #f1f5f9);
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

[data-theme="light"] .smart-qa-pill {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #334155;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.smart-qa-pill:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
}

.qa-pill-emoji {
    font-size: 1.05rem;
    line-height: 1;
}

.qa-pill-arrow {
    font-size: 0.68rem;
    opacity: 0.6;
    margin-left: 0.15rem;
    transition: transform 0.2s ease;
}

/* Active Pill States */
.smart-qa-pill.active.eli5 {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #fbbf24;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}

[data-theme="light"] .smart-qa-pill.active.eli5 {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
}

.smart-qa-pill.active.proscons {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #34d399;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

[data-theme="light"] .smart-qa-pill.active.proscons {
    background: #d1fae5;
    border-color: #10b981;
    color: #047857;
}

.smart-qa-pill.active.whatsnext {
    background: rgba(99, 102, 241, 0.18);
    border-color: #818cf8;
    color: #a5b4fc;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .smart-qa-pill.active.whatsnext {
    background: #e0e7ff;
    border-color: #6366f1;
    color: #4338ca;
}

/* 📋 ANSWER CARD */
.smart-qa-answer-card {
    margin-top: 1.15rem;
    padding: 1.2rem 1.4rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: slideDownQa 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .smart-qa-answer-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

@keyframes slideDownQa {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smart-qa-answer-card.qa-theme-eli5 {
    border-left: 4px solid #f59e0b;
}

.smart-qa-answer-card.qa-theme-proscons {
    border-left: 4px solid #10b981;
}

.smart-qa-answer-card.qa-theme-whatsnext {
    border-left: 4px solid #6366f1;
}

.qa-answer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .qa-answer-header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.qa-answer-badge {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.qa-badge-emoji {
    font-size: 1.15rem;
}

.qa-badge-title {
    font-weight: 700;
    font-size: 0.92rem;
    font-family: var(--font-family-heading, 'Inter', sans-serif);
    color: var(--text-primary, #f8fafc);
}

[data-theme="light"] .qa-badge-title {
    color: #0f172a;
}

.qa-answer-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.qa-action-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    font-size: 0.84rem;
    transition: all 0.2s ease;
}

[data-theme="light"] .qa-action-btn {
    background: #f1f5f9;
    color: #64748b;
}

.qa-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary, #f8fafc);
}

[data-theme="light"] .qa-action-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.qa-action-btn.qa-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.qa-answer-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.qa-answer-p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-primary, #e2e8f0);
}

[data-theme="light"] .qa-answer-p {
    color: #334155;
}

.qa-bullet-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary, #e2e8f0);
}

[data-theme="light"] .qa-bullet-item {
    color: #334155;
}

.qa-bullet-dot {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.qa-bullet-txt {
    flex: 1;
}

/* 🎯 Responsive adjustments for Smart Q&A */
@media (max-width: 768px) {
    .smart-qa-container {
        padding: 1.1rem 1rem;
        margin: 1.5rem 0;
    }

    .smart-qa-pills {
        flex-direction: column;
        align-items: stretch;
    }

    .smart-qa-pill {
        justify-content: flex-start;
        padding: 0.6rem 0.9rem;
    }

    .qa-pill-arrow {
        margin-left: auto;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   📖 OPERATIONS MANUAL & ACADEMIC DOCUMENT ENHANCEMENTS
   (Titoli compatti, font leggibili, tabelle equilibrate senza colonne giganti)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Font del testo principale per documenti accademici e manuale: identico a Project */
.accademico,
.guide-document {
    font-family: var(--font-family-primary, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 1.08rem;
    line-height: 1.75;
    color: var(--text-primary, #e2e8f0);
}

.accademico p,
.guide-document p {
    font-size: var(--article-font-size, 1.08rem) !important;
    line-height: 1.75 !important;
    margin-bottom: 1.15rem;
}

.accademico .content-body,
.accademico .content-body p,
.accademico .content-body li,
.content-body,
.content-body p,
.content-body li {
    font-size: var(--article-font-size, 1.08rem) !important;
}

.accademico li,
.guide-document li {
    font-size: var(--article-font-size, 1.05rem) !important;
    line-height: 1.7 !important;
    margin-bottom: 0.45rem;
}

/* Titoli h1, h2, h3 compatti per evitare a-capo sgradevoli */
.guide-document .document-title,
.accademico .document-title {
    font-size: clamp(1.6rem, 3.5vw, 2.3rem) !important;
    line-height: 1.25 !important;
    letter-spacing: -0.02em !important;
    word-break: normal !important;
    hyphens: none !important;
}

.guide-document .document-subtitle,
.accademico .document-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.2rem) !important;
    line-height: 1.4 !important;
    opacity: 0.9;
}

.guide-document .document-chapter h2,
.accademico .document-chapter h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.65rem) !important;
    line-height: 1.3 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.85rem !important;
}

.guide-document .document-chapter h4,
.accademico .document-chapter h4 {
    font-size: 1.12rem !important;
    line-height: 1.35 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.6rem !important;
}

/* Tabelle di configurazione compatte, equilibrate ed eleganti */
.document-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
    margin: 1.2rem 0 1.8rem 0 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
    font-size: 0.95rem !important;
}

.document-table th {
    padding: 0.75rem 1rem !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    white-space: nowrap !important;
}

.document-table td {
    padding: 0.75rem 1rem !important;
    font-size: 0.94rem !important;
    line-height: 1.5 !important;
    vertical-align: middle !important;
}

.document-table td code,
.document-table th code {
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    padding: 0.15rem 0.45rem !important;
    border-radius: 4px !important;
    background: rgba(99, 102, 241, 0.12) !important;
    color: #818cf8 !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    white-space: nowrap !important;
}

[data-theme="light"] .document-table td code {
    background: rgba(79, 70, 229, 0.08) !important;
    color: #4338ca !important;
    border-color: rgba(79, 70, 229, 0.2) !important;
}

/* Colonna chiave e default compatti per tabelle di configurazione / guida tecnica */
.guide-document .document-table:not(.sources-table):not(.pillar-table):not(.voice-table):not(.search-compare-table) td:first-child,
.document-table.config-table td:first-child {
    font-weight: 600;
    width: 25% !important;
    min-width: 180px !important;
}

.guide-document .document-table:not(.sources-table):not(.pillar-table):not(.voice-table):not(.search-compare-table) td:nth-child(2),
.document-table.config-table td:nth-child(2) {
    width: 15% !important;
    min-width: 110px !important;
}

.guide-document .document-table:not(.sources-table):not(.pillar-table):not(.voice-table):not(.search-compare-table) td:last-child,
.document-table.config-table td:last-child {
    width: auto !important;
}

/* Tabella ricettario scenari */
.document-table.recipe-table td:first-child {
    width: 30% !important;
    min-width: 200px !important;
}

.document-table.recipe-table td:nth-child(2) {
    width: 20% !important;
    min-width: 140px !important;
}

.document-table.recipe-table td:last-child {
    width: 50% !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   📋 RESPONSIVE DESIGN SYSTEM PER LE TABELLE DOCUMENTALI / PROJECT
   (Layout Desktop bilanciato & Trasformazione in Card Glassmorphic su Mobile)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Wrapper con scroll fluido orizzontale di salvaguardia */
.document-table-wrapper {
    width: 100%;
    margin: 1.5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    border-radius: 12px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    background: var(--bg-card, rgba(30, 41, 59, 0.3));
}

/* 🏷️ Badge indice numerico fonti */
.source-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 0.4rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    font-size: 0.88rem;
    font-weight: 700;
    border: 1px solid rgba(99, 102, 241, 0.3);
}
[data-theme="light"] .source-num-badge {
    background: rgba(79, 70, 229, 0.1);
    color: #4338ca;
    border-color: rgba(79, 70, 229, 0.25);
}

/* 🏷️ Badge licenza aperta */
.source-license-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.28);
    white-space: nowrap;
}
[data-theme="light"] .source-license-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.3);
}

/* 🔗 Link esterno per licenza fonte */
.source-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #38bdf8;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}
.source-link-btn:hover {
    color: #7dd3fc;
    text-decoration: underline;
}
[data-theme="light"] .source-link-btn {
    color: #0284c7;
}
[data-theme="light"] .source-link-btn:hover {
    color: #0369a1;
}

/* 🧠 / 🔤 Match Badges per Ricerca Semantica */
.match-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}
.match-badge.ai-match {
    background: rgba(6, 182, 212, 0.12);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.3);
}
[data-theme="light"] .match-badge.ai-match {
    background: rgba(6, 182, 212, 0.1);
    color: #0891b2;
    border-color: rgba(6, 182, 212, 0.25);
}
.match-badge.kw-match {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}
[data-theme="light"] .match-badge.kw-match {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    border-color: rgba(139, 92, 246, 0.25);
}

/* 🛡️ Pilastri AI Act: Titoli e articoli */
.pillar-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.35;
}
[data-theme="light"] .pillar-title {
    color: #0f172a;
}
.pillar-article {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-primary, #6366f1);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ─── DESKTOP SPECIFIC COLUMN SIZING (> 768px) ─── */
@media (min-width: 769px) {
    /* 1. Sources Table */
    .document-table.sources-table th.col-num,
    .document-table.sources-table td.col-num {
        width: 56px !important;
        min-width: 56px !important;
        max-width: 64px !important;
        text-align: center !important;
    }
    .document-table.sources-table th.col-source,
    .document-table.sources-table td.col-source {
        width: 32% !important;
        min-width: 140px !important;
        font-weight: 600;
    }
    .document-table.sources-table th.col-license,
    .document-table.sources-table td.col-license {
        width: 25% !important;
        min-width: 120px !important;
    }
    .document-table.sources-table th.col-link,
    .document-table.sources-table td.col-link {
        width: auto !important;
    }

    /* 2. Pillar Table */
    .document-table.pillar-table th.col-pillar-req,
    .document-table.pillar-table td.col-pillar-req {
        width: 25% !important;
        min-width: 160px !important;
    }
    .document-table.pillar-table th.col-pillar-law,
    .document-table.pillar-table td.col-pillar-law {
        width: 37% !important;
    }
    .document-table.pillar-table th.col-pillar-sol,
    .document-table.pillar-table td.col-pillar-sol {
        width: 38% !important;
    }

    /* 3. Voice Table */
    .document-table.voice-table th.col-voice-lang,
    .document-table.voice-table td.col-voice-lang {
        width: 20% !important;
        min-width: 130px !important;
    }
    .document-table.voice-table th.col-voice-model,
    .document-table.voice-table td.col-voice-model {
        width: 32% !important;
        min-width: 180px !important;
    }
    .document-table.voice-table th.col-voice-timbre,
    .document-table.voice-table td.col-voice-timbre {
        width: 26% !important;
    }
    .document-table.voice-table th.col-voice-target,
    .document-table.voice-table td.col-voice-target {
        width: 22% !important;
    }

    /* 4. Search Compare Table */
    .document-table.search-compare-table th.col-search-query,
    .document-table.search-compare-table td.col-search-query {
        width: 24% !important;
    }
    .document-table.search-compare-table th.col-search-type,
    .document-table.search-compare-table td.col-search-type {
        width: 18% !important;
    }
    .document-table.search-compare-table th.col-search-concept,
    .document-table.search-compare-table td.col-search-concept {
        width: 28% !important;
    }
    .document-table.search-compare-table th.col-search-result,
    .document-table.search-compare-table td.col-search-result {
        width: 30% !important;
    }
}

/* ─── MOBILE RESPONSIVE CARD TRANSFORMATION (<= 768px) ─── */
@media (max-width: 768px) {
    /* 1. SOURCES TABLE -> Sleek modern cards */
    .document-table.sources-table {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        display: block !important;
        margin: 1rem 0 !important;
    }
    .document-table.sources-table thead {
        display: none !important;
    }
    .document-table.sources-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }
    .document-table.sources-table tr {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        grid-template-rows: auto auto !important;
        align-items: center !important;
        gap: 0.45rem 0.75rem !important;
        padding: 0.85rem 1rem !important;
        border-radius: 12px !important;
        background: rgba(30, 41, 59, 0.7) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }
    [data-theme="light"] .document-table.sources-table tr {
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04) !important;
    }
    .document-table.sources-table td {
        padding: 0 !important;
        border: none !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    .document-table.sources-table td.col-num {
        grid-column: 1;
        grid-row: 1;
        width: auto !important;
    }
    .document-table.sources-table td.col-source {
        grid-column: 2;
        grid-row: 1;
        font-size: 1rem !important;
        font-weight: 700 !important;
        color: var(--text-primary, #f8fafc) !important;
    }
    .document-table.sources-table td.col-license {
        grid-column: 3;
        grid-row: 1;
        text-align: right !important;
    }
    .document-table.sources-table td.col-link {
        grid-column: 1 / span 3;
        grid-row: 2;
        padding-top: 0.45rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    }
    [data-theme="light"] .document-table.sources-table td.col-link {
        border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
    }

    /* 2. PILLAR TABLE -> Detailed legal compliance cards */
    .document-table.pillar-table {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        display: block !important;
        margin: 1rem 0 !important;
    }
    .document-table.pillar-table thead {
        display: none !important;
    }
    .document-table.pillar-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    .document-table.pillar-table tr {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.7rem !important;
        padding: 1.1rem 1.1rem !important;
        border-radius: 14px !important;
        background: rgba(30, 41, 59, 0.7) !important;
        border: 1px solid rgba(99, 102, 241, 0.25) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
    }
    [data-theme="light"] .document-table.pillar-table tr {
        background: #ffffff !important;
        border: 1px solid rgba(79, 70, 229, 0.2) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05) !important;
    }
    .document-table.pillar-table td {
        padding: 0 !important;
        border: none !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    .document-table.pillar-table td.col-pillar-req {
        padding-bottom: 0.5rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
    [data-theme="light"] .document-table.pillar-table td.col-pillar-req {
        border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    }
    .document-table.pillar-table td.col-pillar-req .pillar-title {
        font-size: 1.05rem !important;
        color: #a5b4fc !important;
    }
    [data-theme="light"] .document-table.pillar-table td.col-pillar-req .pillar-title {
        color: #4338ca !important;
    }
    .document-table.pillar-table td.col-pillar-law[data-label]::before,
    .document-table.pillar-table td.col-pillar-sol[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.76rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.25rem;
    }
    .document-table.pillar-table td.col-pillar-law[data-label]::before {
        color: #94a3b8;
    }
    [data-theme="light"] .document-table.pillar-table td.col-pillar-law[data-label]::before {
        color: #64748b;
    }
    .document-table.pillar-table td.col-pillar-law {
        font-size: 0.92rem !important;
        line-height: 1.55 !important;
        color: var(--text-primary, #e2e8f0);
    }
    .document-table.pillar-table td.col-pillar-sol {
        font-size: 0.92rem !important;
        line-height: 1.55 !important;
        background: rgba(16, 185, 129, 0.08);
        padding: 0.75rem 0.85rem !important;
        border-radius: 8px;
        border-left: 3px solid #10b981;
    }
    [data-theme="light"] .document-table.pillar-table td.col-pillar-sol {
        background: rgba(16, 185, 129, 0.06);
    }
    .document-table.pillar-table td.col-pillar-sol[data-label]::before {
        color: #10b981;
    }

    /* 3. VOICE TABLE -> Neural TTS Profile Cards */
    .document-table.voice-table {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        display: block !important;
        margin: 1rem 0 !important;
    }
    .document-table.voice-table thead {
        display: none !important;
    }
    .document-table.voice-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.85rem !important;
        width: 100% !important;
    }
    .document-table.voice-table tr {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.55rem !important;
        padding: 1rem 1.1rem !important;
        border-radius: 12px !important;
        background: rgba(30, 41, 59, 0.7) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }
    [data-theme="light"] .document-table.voice-table tr {
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04) !important;
    }
    .document-table.voice-table td {
        padding: 0 !important;
        border: none !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    .document-table.voice-table td.col-voice-lang {
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        color: var(--accent-primary, #6366f1) !important;
    }
    .document-table.voice-table td.col-voice-model code {
        display: block !important;
        padding: 0.35rem 0.55rem !important;
        font-size: 0.82rem !important;
        white-space: normal !important;
        word-break: break-all !important;
        border-radius: 6px !important;
    }
    .document-table.voice-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.76rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted, #94a3b8);
        margin-bottom: 0.15rem;
    }
    .document-table.voice-table td.col-voice-timbre,
    .document-table.voice-table td.col-voice-target {
        font-size: 0.92rem !important;
        line-height: 1.5 !important;
    }

    /* 4. SEARCH COMPARE TABLE -> Comparison Cards */
    .document-table.search-compare-table {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        display: block !important;
        margin: 1rem 0 !important;
    }
    .document-table.search-compare-table thead {
        display: none !important;
    }
    .document-table.search-compare-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.85rem !important;
        width: 100% !important;
    }
    .document-table.search-compare-table tr {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.55rem !important;
        padding: 1rem 1.1rem !important;
        border-radius: 12px !important;
        background: rgba(30, 41, 59, 0.7) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }
    [data-theme="light"] .document-table.search-compare-table tr {
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04) !important;
    }
    .document-table.search-compare-table td {
        padding: 0 !important;
        border: none !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    .document-table.search-compare-table td.col-search-query .search-query-text {
        font-size: 1.05rem !important;
        font-style: italic !important;
        font-weight: 700 !important;
        color: #f8fafc !important;
    }
    [data-theme="light"] .document-table.search-compare-table td.col-search-query .search-query-text {
        color: #0f172a !important;
    }
    .document-table.search-compare-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.76rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted, #94a3b8);
        margin-bottom: 0.15rem;
    }
    .document-table.search-compare-table td.col-search-concept,
    .document-table.search-compare-table td.col-search-result {
        font-size: 0.92rem !important;
        line-height: 1.5 !important;
    }

    /* ═══════════════════════════════════════════════════════════════════════════
       📱 UNIVERSAL MOBILE SAFEGUARDS FOR ALL OTHER TABLES ACROSS THE APPLICATION
       (Guida, Ricette, Configurazione, Log Batch, Risultati SQL, Backup, ecc.)
       ═══════════════════════════════════════════════════════════════════════════ */
    .document-table:not(.sources-table):not(.pillar-table):not(.voice-table):not(.search-compare-table) {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-x pan-y !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 1rem 0 !important;
        border-radius: 10px !important;
    }

    /* Rilassamento prima colonna su tabelle tecniche Guida su Mobile */
    .guide-document .document-table:not(.sources-table):not(.pillar-table):not(.voice-table):not(.search-compare-table) td:first-child,
    .document-table.config-table td:first-child {
        width: auto !important;
        min-width: 130px !important;
        white-space: normal !important;
    }

    .document-table:not(.sources-table):not(.pillar-table):not(.voice-table):not(.search-compare-table) th,
    .document-table:not(.sources-table):not(.pillar-table):not(.voice-table):not(.search-compare-table) td {
        white-space: normal !important;
    }

    /* Tabelle di sistema / dashboard su Mobile */
    .fm-table-container {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: 100% !important;
        width: 100% !important;
        touch-action: pan-x pan-y !important;
    }

    .fm-table,
    .resx-table {
        min-width: 580px !important;
    }

    .batch-table,
    .backup-table,
    .sql-results-table,
    .custom-stat-table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: 100% !important;
        width: 100% !important;
        touch-action: pan-x pan-y !important;
    }
}

/* 🏷️ Key Path (Visualizza le chiavi tipo xxx.yyy.zzz in riga orizzontale compatta con separatore fluido) */
.key-path {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.key-path .key-segment {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem !important;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-family: var(--font-family-monospace, monospace);
}

.key-path .key-segment.leaf {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
    font-weight: 700;
}

.key-path .key-sep {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    padding: 0 0.1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

[data-theme="light"] .key-path .key-segment {
    background: rgba(79, 70, 229, 0.06);
    color: #4338ca;
    border-color: rgba(79, 70, 229, 0.18);
}

[data-theme="light"] .key-path .key-segment.leaf {
    background: rgba(2, 132, 199, 0.08);
    color: #0369a1;
    border-color: rgba(2, 132, 199, 0.25);
}

/* 🏷️ Key Entry Compatta: Parametro + Valori (Default / Range / Info) in un'unica colonna snella */
.key-entry {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.key-meta-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.15rem;
}

.key-val-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.08rem 0.4rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted, #94a3b8);
    font-family: var(--font-mono, monospace);
}

.key-val-badge strong {
    color: #38bdf8;
    font-weight: 700;
}

.key-val-badge.range strong {
    color: #f59e0b;
}

[data-theme="light"] .key-val-badge {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

[data-theme="light"] .key-val-badge strong {
    color: #0284c7;
}

[data-theme="light"] .key-val-badge.range strong {
    color: #d97706;
}


/* 🏷️ Intestazione Capitoli: Layout editoriale pulito, elegante e proporzionato */
.document-chapter-header {
    margin-top: 2.2rem !important;
    margin-bottom: 0.9rem !important;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.document-chapter-header .chapter-number {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-primary, #6366f1);
    margin-bottom: 0.25rem;
}

[data-theme="light"] .document-chapter-header .chapter-number {
    color: #4f46e5;
}

.document-chapter-header .chapter-title {
    font-size: 1.28rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    color: var(--text-primary, #f8fafc);
    letter-spacing: -0.01em;
}

[data-theme="light"] .document-chapter-header .chapter-title {
    color: #0f172a;
}

/* 📖 Micro-link discreto alla guida posizionato accanto ai titoli dei box/card */
.card-help-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #94a3b8);
    opacity: 0.5;
    font-size: 0.85rem;
    margin-left: 0.35rem;
    padding: 0.15rem 0.25rem;
    border-radius: 4px;
    text-decoration: none !important;
    transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
    vertical-align: middle;
}

.card-help-link:hover {
    opacity: 1;
    color: #38bdf8;
    transform: scale(1.15);
}

[data-theme="light"] .card-help-link {
    color: #64748b;
}

[data-theme="light"] .card-help-link:hover {
    color: #2563eb;
}

/* ═══════════════════════════════════════════════════════════════════
   🛡️ REVIEW APPROVAL UNDO CALLOUT TOAST & MOBILE HEADER ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════════ */
.review-kpi-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    flex-wrap: nowrap;
}

/* ═══════════════════════════════════════════════
   🛡️ REVIEW APPROVAL UNDO MODAL (CENTERED WITH BACKDROP OVERLAY)
   ═══════════════════════════════════════════════ */
.review-undo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 105000;
    background: rgba(10, 15, 29, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    animation: fadeInFast 0.2s ease-out;
}

[data-theme="light"] .review-undo-overlay {
    background: rgba(15, 23, 42, 0.62);
}

.review-undo-modal {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: #0f172a;
    border: 2px solid #10b981;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 32px rgba(16, 185, 129, 0.25);
    overflow: hidden;
    animation: reviewModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .review-undo-modal {
    background: #ffffff;
    border-color: #059669;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25), 0 0 28px rgba(16, 185, 129, 0.2);
}

@keyframes reviewModalPop {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.review-undo-modal-body {
    padding: 1.4rem 1.6rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.review-undo-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.review-undo-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

[data-theme="light"] .review-undo-icon-circle {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.review-undo-modal-text {
    flex: 1;
    min-width: 0;
}

.review-undo-label {
    display: block;
    font-size: 0.76rem;
    font-weight: 800;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

[data-theme="light"] .review-undo-label {
    color: #059669;
}

.review-undo-modal-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-theme="light"] .review-undo-modal-title {
    color: #0f172a;
}

.review-undo-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .review-undo-modal-actions {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.review-undo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1.35rem;
    border-radius: 9px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: none;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.review-undo-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.55);
}

.review-undo-confirm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.15rem;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.review-undo-confirm-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
    transform: translateY(-1px);
}

[data-theme="light"] .review-undo-confirm-btn {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

[data-theme="light"] .review-undo-confirm-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #059669;
    color: #059669;
}

.review-undo-progress {
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    width: 100%;
    overflow: hidden;
}

[data-theme="light"] .review-undo-progress {
    background: rgba(0, 0, 0, 0.08);
}

.review-undo-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #f59e0b);
    transition: width 0.1s linear;
}

/* 📱 Responsive Mobile Adjustments for Review Header & Actions */
@media (max-width: 768px) {
    .sched-top-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        padding: 0.65rem 0.85rem !important;
    }

    .sched-top-header .sched-top-title-group {
        width: 100% !important;
        flex-wrap: wrap !important;
        gap: 0.35rem !important;
    }

    .sched-top-header .sched-top-title {
        font-size: 0.98rem !important;
        white-space: normal !important;
    }

    .sched-top-header .ms-auto {
        margin-left: 0 !important;
        width: 100% !important;
        display: flex !important;
        gap: 0.4rem !important;
        justify-content: space-between !important;
    }

    .sched-top-header .deploy-badge,
    .sched-top-header .nav-action-btn {
        flex: 1 1 auto !important;
        justify-content: center !important;
        text-align: center !important;
        font-size: 0.74rem !important;
        padding: 0.3rem 0.5rem !important;
    }

    .review-kpi-bar {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.4rem !important;
        flex-wrap: wrap !important;
    }

    .review-kpi-chip {
        font-size: 0.76rem !important;
        padding: 0.28rem 0.55rem !important;
        white-space: nowrap !important;
    }

    .review-actions {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.45rem !important;
    }

    .review-act-btn {
        font-size: 0.8rem !important;
        padding: 0.55rem 0.65rem !important;
    }

    .review-undo-modal {
        max-width: 94vw;
        border-radius: 14px;
    }

    .review-undo-modal-body {
        padding: 1.1rem 1rem 0.9rem;
        gap: 0.9rem;
    }

    .review-undo-modal-title {
        font-size: 0.92rem;
    }

    .review-undo-modal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 0.5rem;
    }

    .review-undo-btn,
    .review-undo-confirm-btn {
        width: 100%;
        font-size: 0.82rem;
        padding: 0.55rem 0.85rem;
        text-align: center;
    }

    /* 📱 Deploy Badge Responsive Text */
    .deploy-badge .deploy-short {
        display: inline !important;
    }
    .deploy-badge .deploy-full {
        display: none !important;
    }

    /* 📊 Dash Stat Row & Mobile Plain Text Stats (Zero borders, light & compact) */
    .dash-stat-badge,
    [data-theme="light"] .dash-stat-badge,
    [data-theme="dark"] .dash-stat-badge {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        font-size: 0.72rem !important;
        font-weight: 600 !important;
        box-shadow: none !important;
        gap: 0.2rem !important;
    }

    .dash-stat-badge.is-highlight,
    [data-theme="light"] .dash-stat-badge.is-highlight,
    [data-theme="dark"] .dash-stat-badge.is-highlight {
        background: transparent !important;
        border: none !important;
        color: #22c55e !important;
    }

    .dash-stat-badge.is-error,
    [data-theme="light"] .dash-stat-badge.is-error,
    [data-theme="dark"] .dash-stat-badge.is-error {
        background: transparent !important;
        border: none !important;
        color: #ef4444 !important;
    }

    .dash-stat-badge .dash-dot {
        font-size: 0.62rem !important;
        margin-left: 2px !important;
    }

    .dash-stat-label {
        font-size: 0.8rem !important;
        gap: 0.35rem !important;
        white-space: nowrap !important;
        flex: 1 !important;
    }

    .dash-stat-row {
        padding: 0.28rem 0.4rem !important;
        gap: 0.5rem !important;
    }

    .dash-stat-footer-label {
        font-size: 0.76rem !important;
        white-space: nowrap !important;
    }

    .dash-stat-footer-value {
        font-size: 0.78rem !important;
        white-space: nowrap !important;
    }

    /* 🧠 Semantic Split Container, Metrics & Inspector Search */
    .semantic-split-container {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .semantic-metrics-3col {
        grid-template-columns: 1fr !important;
        gap: 0.45rem !important;
    }

    .semantic-metric-card {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.45rem 0.75rem !important;
        text-align: left !important;
    }

    .semantic-metric-label {
        font-size: 0.8rem !important;
        margin-bottom: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .semantic-metric-value {
        font-size: 0.95rem !important;
        white-space: nowrap !important;
    }

    .inspector-search-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        padding: 6px 8px !important;
    }

    .inspector-search-bar .dashboard-btn-primary {
        width: 100% !important;
        justify-content: center !important;
    }

    .semantic-test-box {
        padding: 0.75rem 0.65rem !important;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   🛡️ E-E-A-T & TRUST SYSTEM (Human-in-the-Loop & Fact-Checking)
   ════════════════════════════════════════════════════════════════════════════ */
.article-trust-box {
    margin: 1.5rem 0;
    padding: 1.15rem 1.35rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.28);
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
}

[data-theme="light"] .article-trust-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #eef2ff 100%);
    border-color: #86efac;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.08);
}

.trust-box-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.trust-badge-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .trust-badge-primary {
    color: #047857;
    background: #d1fae5;
    border-color: #a7f3d0;
}

.trust-box-desc {
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.trust-box-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.78rem;
    padding-top: 0.65rem;
    border-top: 1px dashed rgba(16, 185, 129, 0.2);
}

.trust-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted, #94a3b8);
}

.trust-policy-link {
    color: var(--accent-primary, #6366f1);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s ease;
}

.trust-policy-link:hover {
    color: #10b981;
    text-decoration: underline;
}

/* 🏷️ Badge Studio Originale / DOI */
.primary-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
    margin-left: 0.5rem;
}

[data-theme="light"] .primary-source-chip {
    background: #e0e7ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

/* ════════════════════════════════════════════════════════════════════════════
   🛡️ CONDENSED EDITORIAL VERIFICATION (Dentro Source Card tra link e licenza)
   ════════════════════════════════════════════════════════════════════════════ */
.source-editorial-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem var(--spacing-md, 1rem);
    background: var(--bg-secondary);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-left: 3px solid #10b981;
    border-radius: 8px;
    font-size: 0.88rem;
    transition: all var(--transition-normal, 0.2s ease);
}

[data-theme="light"] .source-editorial-compact {
    background: #f8fafc;
    border-color: rgba(16, 185, 129, 0.3);
    border-left-color: #059669;
    box-shadow: 0 1px 4px rgba(16, 185, 129, 0.05);
}

.editorial-check-info {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.editorial-check-info i.text-success {
    color: #10b981 !important;
    font-size: 0.95rem;
}

[data-theme="light"] .editorial-check-info i.text-success {
    color: #059669 !important;
}

.editorial-policy-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent-primary, #6366f1);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.editorial-policy-link:hover {
    color: #10b981;
    text-decoration: underline;
}

[data-theme="light"] .editorial-policy-link {
    color: #4f46e5;
}

[data-theme="light"] .editorial-policy-link:hover {
    color: #059669;
}

/* ════════════════════════════════════════════════════════════════════════════
   🔬 RELATED TOPIC CLUSTERS (Articoli Correlati)
   ════════════════════════════════════════════════════════════════════════════ */
.related-articles-section {
    margin: 2.5rem 0 1.5rem 0;
}

.related-section-header {
    margin-bottom: 1.25rem;
}

.related-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.related-section-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 992px) {
    .related-articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .related-articles-grid {
        grid-template-columns: 1fr;
    }
}

.related-article-card {
    background: var(--bg-card, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition-fast, 0.2s), box-shadow var(--transition-fast, 0.2s), border-color var(--transition-fast, 0.2s);
}

.related-article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border-color: var(--accent-primary, #6366f1);
    color: inherit;
}

[data-theme="light"] .related-article-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .related-article-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #6366f1;
}

.related-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 0.5rem;
}

.related-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 0.65rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-primary, #6366f1);
    gap: 0.35rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   ♿ DIGITAL ACCESSIBILITY (A11Y) & WCAG 2.2 COMPLIANCE
   ════════════════════════════════════════════════════════════════════════════ */

/* 1. Universal High-Contrast Keyboard Focus Indicator (:focus-visible) */
:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid #38bdf8 !important;
    outline-offset: 3px !important;
    border-radius: 4px;
}

[data-theme="light"] :focus-visible {
    outline: 2px solid #0284c7 !important;
    outline-offset: 3px !important;
}

/* 2. Motion Reduction for Sensitive Users & Low-Power Crawlers */
@media (prefers-reduced-motion: reduce) {
    :not(.ticker-marquee-inner):not(.podcast-player-wave):not(.loading-spinner):not(.tts-soundwave):not(.tts-soundwave *):not(.podcast-equalizer):not(.podcast-equalizer *):not(.mini-eq-bars):not(.mini-eq-bars *):not(.drawer-eq-anim):not(.drawer-eq-anim *):not(.banner-eq-mini):not(.banner-eq-mini *):not(.track-eq-live):not(.track-eq-live *):not(.track-title-inner):not(.track-title-inner *) {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .ticker-marquee-inner {
        -webkit-animation-duration: 90s !important;
        animation-duration: 90s !important;
        -webkit-animation-iteration-count: infinite !important;
        animation-iteration-count: infinite !important;
    }

    .is-ai-scanning::before,
    .is-ai-scanning::after,
    .scanner-beam,
    .skeleton-loader,
    .loading-shimmer {
        animation: none !important;
        background-position: 0 0 !important;
    }
}

/* 3. Screen-Reader Exclusive Utilities */
.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 4. Semantic Breadcrumb Navigation */
.article-breadcrumb-nav {
    margin-bottom: 1.25rem;
    padding: 0.5rem 0.25rem;
}

.article-breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.breadcrumb-item a {
    color: var(--text-muted, #94a3b8);
    text-decoration: none;
    transition: color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.breadcrumb-item a:hover {
    color: var(--accent-primary, #6366f1);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-muted, #64748b);
    font-size: 0.65rem;
    opacity: 0.6;
}

.breadcrumb-item.active {
    color: var(--text-primary, #e2e8f0);
    font-weight: 500;
}

[data-theme="light"] .breadcrumb-item.active {
    color: #1e293b;
}

/* ═══════════════════════════════════════════════
   📸 OPERATIONAL MANUAL: DUAL-THEME ADAPTIVE SCREENSHOTS
   ═══════════════════════════════════════════════ */
.doc-screenshot-frame {
    margin: 1.5rem 0 2rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    background: var(--bg-card, #1e293b);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: all var(--transition-normal);
}

.doc-screenshot-frame:hover {
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.doc-screenshot-frame a {
    display: block;
    cursor: zoom-in;
    text-decoration: none;
}

.doc-screenshot-frame img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    image-rendering: auto;
    cursor: zoom-in;
    transition: transform 0.25s ease;
}

.doc-screenshot-frame a:hover img,
.doc-screenshot-frame:hover img {
    filter: brightness(1.02);
}

.doc-screenshot-frame figcaption {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    color: var(--text-muted, #94a3b8);
    background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500;
}

.doc-screenshot-frame figcaption i {
    color: var(--accent-primary, #6366f1);
}

/* 🌓 Automatic Dark/Light switching: pure CSS, zero JS, instant */
[data-theme="dark"] .doc-img-light {
    display: none !important;
}

[data-theme="dark"] .doc-img-dark {
    display: block !important;
}

[data-theme="light"] .doc-img-dark {
    display: none !important;
}

[data-theme="light"] .doc-img-light {
    display: block !important;
}

/* ═══════════════════════════════════════════════
   🔍 GUIDE SCREENSHOT LIGHTBOX MODAL (FULL-RES ZOOM)
   ═══════════════════════════════════════════════ */
.guide-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: rgba(10, 15, 29, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.guide-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.guide-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    z-index: 10;
    user-select: none;
}

.guide-lightbox-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guide-lightbox-title i {
    color: var(--accent-primary, #6366f1);
}

.guide-lightbox-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.guide-lightbox-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    border-radius: 8px;
    padding: 0.42rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.2;
}

.guide-lightbox-btn:hover {
    background: var(--accent-primary, #6366f1);
    border-color: var(--accent-primary, #6366f1);
    color: #fff;
    transform: translateY(-1px);
}

.guide-lightbox-btn.btn-close {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.guide-lightbox-btn.btn-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.guide-lightbox-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    cursor: zoom-out;
}

.guide-lightbox-img {
    max-width: 94vw;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.2s ease;
    cursor: zoom-in;
}

.guide-lightbox-body.zoomed {
    align-items: flex-start;
    justify-content: flex-start;
    cursor: zoom-out;
}

.guide-lightbox-body.zoomed .guide-lightbox-img {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

@media (max-width: 768px) {
    .guide-lightbox-header {
        padding: 0.5rem 0.75rem;
    }
    .guide-lightbox-title {
        font-size: 0.8rem;
    }
    .guide-lightbox-btn {
        padding: 0.35rem 0.55rem;
        font-size: 0.75rem;
    }
    .guide-lightbox-body {
        padding: 0.5rem;
    }
    .guide-lightbox-img {
        max-width: 98vw;
        max-height: 88vh;
    }
}

/* ═══════════════════════════════════════════════
   🧠 SCIENCE QUIZ GAME (GLASSMORPHIC CARD & ZEN MODAL)
   ═══════════════════════════════════════════════ */

/* --- 1. HOME GLASSMORPHIC CARD WITH DIDACTIC CAROUSEL --- */
.quiz-home-card {
    position: relative;
    margin: 2.2rem 0 1.5rem;
    padding: 2px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.45) 0%, rgba(168, 85, 247, 0.35) 50%, rgba(245, 158, 11, 0.45) 100%);
    box-shadow: 0 8px 30px -4px rgba(99, 102, 241, 0.2), 0 2px 10px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: all 0.3s ease;
}

[data-theme="light"] .quiz-home-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.2) 50%, rgba(245, 158, 11, 0.3) 100%);
    box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.12), 0 2px 8px rgba(0, 0, 0, 0.05);
}

.quiz-home-card:hover {
    box-shadow: 0 12px 38px -2px rgba(99, 102, 241, 0.3), 0 0 16px rgba(245, 158, 11, 0.2);
}

.quiz-card-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.16) 0%, rgba(245, 158, 11, 0.1) 40%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}

.quiz-card-inner {
    position: relative;
    border-radius: 16px;
    padding: 1.5rem 1.85rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    z-index: 1;
}

[data-theme="light"] .quiz-card-inner {
    background: rgba(255, 255, 255, 0.94);
}

/* Top Row: Title + Stats */
.quiz-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.quiz-radar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quiz-icon-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(168, 85, 247, 0.25)) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    color: #fbbf24 !important;
}

[data-theme="light"] .quiz-icon-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(168, 85, 247, 0.15)) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: #d97706 !important;
}

.quiz-top-stats {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
}

.quiz-home-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

[data-theme="light"] .quiz-home-stat-chip {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

.quiz-home-stat-chip.streak {
    border-color: rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.1);
}

.quiz-stat-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted, #94a3b8);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin-left: 0.25rem;
}

.quiz-stat-reset-btn i {
    transition: transform 0.25s ease;
}

.quiz-stat-reset-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.45);
    color: #ef4444;
}

.quiz-stat-reset-btn:hover i {
    transform: rotate(-45deg);
}

[data-theme="light"] .quiz-stat-reset-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #64748b;
}

[data-theme="light"] .quiz-stat-reset-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #dc2626;
}

/* Interactive Spotlight */
.quiz-interactive-spotlight {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    width: 100%;
}

.quiz-didactic-box {
    position: relative;
    background: rgba(255, 255, 255, 0.035);
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 1.15rem 1.4rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .quiz-didactic-box {
    background: rgba(0, 0, 0, 0.025);
    border-color: rgba(0, 0, 0, 0.14);
}

.quiz-didactic-box:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.45);
    border-style: solid;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.16);
}

[data-theme="light"] .quiz-didactic-box:hover {
    background: rgba(99, 102, 241, 0.05);
}

.quiz-didactic-header-meta {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    margin-bottom: 0.85rem;
    gap: 0.5rem;
}

.quiz-sample-cat {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--accent-primary, #6366f1);
}

.quiz-difficulty-badge.centered {
    justify-self: center;
    text-align: center;
}

/* Bottone Rispondi a questa Domanda in stile Podcast Shimmer Neon */
.quiz-play-hint-pill.podcast-style {
    justify-self: end;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.42rem 1.15rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
    background-size: 200% 200%;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.76rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.45), 0 0 10px rgba(6, 182, 212, 0.25);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0.01em;
}

.quiz-play-hint-pill.podcast-style .play-btn-glow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.quiz-play-hint-pill.podcast-style .play-btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    pointer-events: none;
}

.quiz-didactic-box:hover .quiz-play-hint-pill.podcast-style {
    transform: translateY(-2px) scale(1.03);
    background-position: 100% 100%;
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.7), 0 0 14px rgba(6, 182, 212, 0.45);
}

.quiz-didactic-box:hover .quiz-play-hint-pill.podcast-style .play-btn-glow::before {
    animation: play-shimmer-sweep 1.2s infinite ease-in-out;
}

.quiz-play-hint-pill.podcast-style i,
.quiz-play-hint-pill.podcast-style span:not(.play-btn-glow) {
    position: relative;
    z-index: 1;
}

.quiz-play-hint-pill.podcast-style i {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.quiz-didactic-box:hover .quiz-play-hint-pill.podcast-style i {
    transform: scale(1.15);
}

.quiz-didactic-quote {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: opacity 0.35s ease, transform 0.35s ease;
    opacity: 1;
    transform: translateY(0);
    min-height: 48px;
    width: 100%;
}

.quiz-didactic-box.is-fading .quiz-didactic-quote {
    opacity: 0;
    transform: translateY(-5px);
}

.quiz-handwritten-text {
    font-family: 'EB Garamond', 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.4;
    color: #f1f5f9;
    letter-spacing: 0.01em;
    text-align: center;
    margin: 0;
}

[data-theme="light"] .quiz-handwritten-text {
    color: #0f172a;
}

/* Navigazione Frecce Laterali Carosello Domande (< >) */
.quiz-didactic-quote-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    width: 100%;
}

.quiz-didactic-quote-row .quiz-didactic-quote {
    flex: 1;
    min-width: 0;
}

.quiz-spotlight-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-muted, #94a3b8);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    outline: none;
}

[data-theme="light"] .quiz-spotlight-nav-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #64748b;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.quiz-spotlight-nav-btn:hover {
    background: linear-gradient(135deg, var(--accent-primary, #6366f1), var(--accent-secondary, #8b5cf6));
    border-color: var(--accent-primary, #6366f1);
    color: #ffffff !important;
    transform: scale(1.12);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.55);
}

[data-theme="light"] .quiz-spotlight-nav-btn:hover {
    color: #ffffff !important;
}

.quiz-spotlight-nav-btn i {
    transition: transform 0.2s ease;
}

.quiz-spotlight-nav-btn.prev:hover i {
    transform: translateX(-1px);
}

.quiz-spotlight-nav-btn.next:hover i {
    transform: translateX(1px);
}

/* Meta Row nel Pop-up Modal: SX Categoria, CENTRO Livello, DX Link Approfondimenti */
.quiz-zen-meta-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin-bottom: 1.25rem;
    gap: 0.75rem;
    box-sizing: border-box;
}

.quiz-zen-meta-row .quiz-category-chip {
    justify-self: start;
    margin-bottom: 0;
    max-width: 100%;
}

.quiz-difficulty-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid currentColor;
    line-height: 1.2;
}

[data-theme="light"] .quiz-difficulty-badge {
    background: rgba(0, 0, 0, 0.03);
}

.quiz-zen-meta-row .quiz-difficulty-badge.centered {
    justify-self: center;
    text-align: center;
}

/* Link Approfondimenti visibile in stile Bottone Archivio Completo */
.quiz-zen-meta-row .quiz-zen-cta-link {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.38rem 0.95rem;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent-primary, #6366f1), var(--accent-secondary, #8b5cf6));
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.78rem;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.4);
    white-space: nowrap;
}

.quiz-zen-meta-row .quiz-zen-cta-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
    color: #ffffff !important;
}

.quiz-zen-meta-row .quiz-zen-cta-link i {
    font-size: 0.76rem;
    transition: transform 0.2s ease;
}

.quiz-zen-meta-row .quiz-zen-cta-link:hover i.fa-arrow-right {
    transform: translateX(3px);
}

/* Bottom Controls */
.quiz-bottom-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
    flex-wrap: wrap;
    margin-top: 0.25rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .quiz-bottom-controls {
    border-top-color: rgba(0, 0, 0, 0.06);
}

.quiz-difficulty-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.quiz-action-buttons {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.quiz-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.7rem 1.35rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
}

.quiz-home-btn.primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.quiz-home-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.quiz-home-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

[data-theme="light"] .quiz-home-btn.secondary {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
}

.quiz-home-btn.secondary:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--accent-primary, #6366f1);
    color: var(--accent-primary, #6366f1);
    transform: translateY(-2px);
}

/* Difficulty badge in QuizZenModal and Spotlight */
.quiz-difficulty-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.65rem;
    border-radius: 20px;
    border: 1px solid;
    font-size: 0.74rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
    letter-spacing: 0.02em;
}

/* --- 🎯 SELETTORE LIVELLO DIFFICOLTÀ (Home Card) --- */
.quiz-diff-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.quiz-diff-pills {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.quiz-diff-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary, #cbd5e1);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .quiz-diff-pill {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-secondary, #475569);
}

.quiz-diff-pill:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    color: var(--text-primary, #f8fafc);
    transform: translateY(-1px);
}

.quiz-diff-pill .diff-reward {
    font-size: 0.68rem;
    padding: 0.06rem 0.35rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 700;
}

[data-theme="light"] .quiz-diff-pill .diff-reward {
    background: rgba(0, 0, 0, 0.06);
}

/* Active states */
.quiz-diff-pill.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent-primary, #6366f1);
    color: #fff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .quiz-diff-pill.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-primary, #6366f1);
    color: #4338ca;
}

.quiz-diff-pill.easy.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #34d399;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

[data-theme="light"] .quiz-diff-pill.easy.active {
    background: rgba(16, 185, 129, 0.12);
    border-color: #10b981;
    color: #065f46;
}

.quiz-diff-pill.medium.active {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #fbbf24;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

[data-theme="light"] .quiz-diff-pill.medium.active {
    background: rgba(245, 158, 11, 0.12);
    border-color: #f59e0b;
    color: #92400e;
}

.quiz-diff-pill.hard.active {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f87171;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

[data-theme="light"] .quiz-diff-pill.hard.active {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
    color: #991b1b;
}

/* --- 🎲 MODAL DIFFICULTY SWITCHER --- */
.quiz-zen-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.quiz-modal-diff-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.15rem 0.25rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .quiz-modal-diff-switcher {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.quiz-modal-diff-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.45rem;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    transition: all 0.15s ease;
}

.quiz-modal-diff-pill:hover {
    color: var(--text-primary, #f8fafc);
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .quiz-modal-diff-pill:hover {
    color: var(--text-primary, #0f172a);
    background: rgba(0, 0, 0, 0.04);
}

.quiz-modal-diff-pill.active {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent-primary, #6366f1);
    color: #fff;
}

[data-theme="light"] .quiz-modal-diff-pill.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-primary, #6366f1);
    color: #4338ca;
}

.quiz-modal-diff-pill.easy.active {
    background: rgba(16, 185, 129, 0.22);
    border-color: #10b981;
    color: #34d399;
}

[data-theme="light"] .quiz-modal-diff-pill.easy.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #065f46;
}

.quiz-modal-diff-pill.medium.active {
    background: rgba(245, 158, 11, 0.22);
    border-color: #f59e0b;
    color: #fbbf24;
}

[data-theme="light"] .quiz-modal-diff-pill.medium.active {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #92400e;
}

.quiz-modal-diff-pill.hard.active {
    background: rgba(239, 68, 68, 0.22);
    border-color: #ef4444;
    color: #f87171;
}

[data-theme="light"] .quiz-modal-diff-pill.hard.active {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #991b1b;
}

@media (max-width: 768px) {
    .quiz-card-inner {
        padding: 1.15rem 1rem;
        gap: 1rem;
    }
    .quiz-home-card {
        margin: 1.5rem 0 1rem;
    }
    .quiz-top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }
    .quiz-top-stats {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }
    .quiz-didactic-box {
        padding: 1rem;
    }
    .quiz-didactic-header-meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.6rem;
    }
    .quiz-difficulty-badge.centered {
        order: 2;
    }
    .quiz-play-hint-pill.podcast-style {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.2rem;
    }
    .quiz-handwritten-text {
        font-size: 1.1rem;
    }
    .quiz-zen-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        padding: 0.6rem 1rem;
    }
    .quiz-modal-diff-switcher {
        justify-content: space-between;
        width: 100%;
    }
    .quiz-modal-diff-pill {
        flex: 1;
        text-align: center;
        padding: 0.32rem 0.2rem;
        font-size: 0.72rem;
    }
    .quiz-zen-stats-group {
        justify-content: flex-end;
    }
    .quiz-zen-meta-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.6rem;
    }
    .quiz-zen-meta-row .quiz-category-chip {
        order: 1;
    }
    .quiz-zen-meta-row .quiz-difficulty-badge.centered {
        order: 2;
        margin: 0;
    }
    .quiz-zen-meta-row .quiz-zen-cta-link {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.25rem;
        margin-left: 0;
    }
    .quiz-bottom-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .quiz-difficulty-section {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
    }
    .quiz-diff-pills {
        width: 100%;
        justify-content: flex-start;
    }
    .quiz-action-buttons {
        width: 100%;
        flex-direction: column;
        margin-left: 0;
        gap: 0.65rem;
    }
    .quiz-home-btn {
        width: 100%;
    }
}

/* --- 2. ZEN POPUP MODAL --- */
.quiz-zen-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: rgba(10, 15, 29, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
    animation: fadeInModal 0.25s ease forwards;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.quiz-zen-container {
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    background: var(--bg-card, #1e293b);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

[data-theme="light"] .quiz-zen-container {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 60px -12px rgba(99, 102, 241, 0.18);
}

/* Header */
.quiz-zen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.4rem;
    background: rgba(15, 23, 42, 0.65);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .quiz-zen-header {
    background: rgba(248, 250, 252, 0.85);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.quiz-mode-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-primary, #6366f1);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.quiz-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

/* 🎚️ Sub-bar sotto l'Header: Difficoltà a SX & Punti/Streak a DX */
.quiz-zen-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.4rem;
    background: rgba(15, 23, 42, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 0.75rem;
    flex-wrap: wrap;
    box-sizing: border-box;
    width: 100%;
}

[data-theme="light"] .quiz-zen-toolbar {
    background: rgba(241, 245, 249, 0.7);
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

.quiz-modal-diff-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .quiz-modal-diff-switcher {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

.quiz-modal-diff-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.65rem;
    border-radius: 14px;
    font-size: 0.76rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-modal-diff-pill:hover {
    color: var(--text-primary, #f8fafc);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .quiz-modal-diff-pill:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.06);
}

.quiz-modal-diff-pill.active {
    background: var(--accent-primary, #6366f1);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.quiz-modal-diff-pill.easy.active {
    background: #10b981;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.quiz-modal-diff-pill.medium.active {
    background: #f59e0b;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.quiz-modal-diff-pill.hard.active {
    background: #ef4444;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.quiz-zen-stats-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary, #f8fafc);
}

[data-theme="light"] .quiz-stat-pill {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

.quiz-stat-pill.streak-pill {
    border-color: rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.12);
}

/* Body */
.quiz-zen-body {
    padding: 1.4rem 1.6rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.quiz-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

[data-theme="light"] .quiz-category-chip {
    color: #4f46e5;
}

.quiz-question-text {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary, #f8fafc);
    margin: 0 0 1.4rem;
}

/* Options Grid */
.quiz-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.4rem;
}

.quiz-option-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #f8fafc);
    font-size: 0.96rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

[data-theme="light"] .quiz-option-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

.quiz-option-card:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--accent-primary, #6366f1);
    transform: translateX(4px);
}

.opt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

[data-theme="light"] .opt-letter {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.opt-text {
    flex: 1;
    line-height: 1.4;
}

.opt-icon {
    font-size: 1.25rem;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.opt-icon.correct-icon {
    color: #22c55e;
}

.opt-icon.wrong-icon {
    color: #ef4444;
}

/* Option States */
.quiz-option-card.correct {
    background: rgba(34, 197, 94, 0.15) !important;
    border-color: #22c55e !important;
    color: #86efac !important;
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.2);
}

[data-theme="light"] .quiz-option-card.correct {
    color: #15803d !important;
    background: rgba(34, 197, 94, 0.1) !important;
}

.quiz-option-card.wrong {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
}

[data-theme="light"] .quiz-option-card.wrong {
    color: #b91c1c !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

.quiz-option-card.dimmed {
    opacity: 0.45;
}

/* Verdict & Explanation */
.quiz-verdict-card {
    padding: 1.25rem 1.4rem;
    border-radius: 16px;
    margin-top: 1rem;
    border: 1px solid;
    animation: slideUpVerdict 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpVerdict {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.quiz-verdict-card.correct {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(16, 185, 129, 0.06) 100%);
    border-color: rgba(34, 197, 94, 0.35);
}

.quiz-verdict-card.wrong {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(244, 63, 94, 0.06) 100%);
    border-color: rgba(239, 68, 68, 0.35);
}

.quiz-verdict-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.verdict-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    font-size: 0.95rem;
}

.quiz-verdict-card.correct .verdict-tag {
    color: #4ade80;
}

.quiz-verdict-card.wrong .verdict-tag {
    color: #f87171;
}

[data-theme="light"] .quiz-verdict-card.correct .verdict-tag {
    color: #16a34a;
}

[data-theme="light"] .quiz-verdict-card.wrong .verdict-tag {
    color: #dc2626;
}

.quiz-social-proof {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.quiz-explanation-text {
    font-size: 0.94rem;
    line-height: 1.6;
    color: var(--text-primary, #f1f5f9);
    margin: 0 0 1rem;
}

[data-theme="light"] .quiz-explanation-text {
    color: #1e293b;
}

.quiz-deep-link-wrap {
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 0.8rem;
}

[data-theme="light"] .quiz-deep-link-wrap {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.quiz-article-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary, #6366f1);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.quiz-article-link:hover {
    transform: translateX(4px);
    text-decoration: underline;
}

/* Footer */
.quiz-zen-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 1.6rem;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .quiz-zen-footer {
    background: rgba(248, 250, 252, 0.85);
    border-top-color: rgba(0, 0, 0, 0.06);
}

.quiz-footer-hint {
    font-size: 0.82rem;
    color: var(--text-muted, #94a3b8);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.quiz-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1.3rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.quiz-btn.primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.quiz-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.quiz-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #f8fafc);
}

[data-theme="light"] .quiz-btn.secondary {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

/* Finished Screen */
.quiz-zen-finished {
    padding: 3rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.quiz-finish-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 2px solid #fbbf24;
    color: #fbbf24;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    box-shadow: 0 0 24px rgba(251, 191, 36, 0.3);
}

.quiz-zen-finished h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
    margin: 0 0 0.5rem;
}

.quiz-finish-desc {
    font-size: 0.95rem;
    color: var(--text-muted, #94a3b8);
    max-width: 480px;
    margin: 0 0 1.8rem;
    line-height: 1.5;
}

.quiz-finish-stats-box {
    display: flex;
    gap: 2.5rem;
    padding: 1.2rem 2.2rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 2rem;
}

[data-theme="light"] .quiz-finish-stats-box {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.quiz-finish-stat-col {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.finish-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
}

.finish-lbl {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.quiz-finish-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.quiz-zen-loading,
.quiz-zen-empty {
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════
   🛡️ CUSTOM GLASSMORPHIC ALERT & CONFIRM DIALOG
   ═══════════════════════════════════════════════════════════════════ */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    outline: none;
}

.custom-confirm-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--surface-primary, #1e293b);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 20px;
    padding: 1.75rem 1.6rem 1.4rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 0 35px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: confirmPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes confirmPopIn {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

[data-theme="light"] .custom-confirm-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 0 25px rgba(0, 0, 0, 0.05);
}

.custom-confirm-icon-wrapper {
    margin-bottom: 1rem;
}

.custom-confirm-icon-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-confirm-card.type-danger .custom-confirm-icon-badge {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

.custom-confirm-card.type-warning .custom-confirm-icon-badge {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #f59e0b;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.custom-confirm-card.type-info .custom-confirm-icon-badge {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
}

.custom-confirm-card.type-success .custom-confirm-icon-badge {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.25);
}

.custom-confirm-content {
    margin-bottom: 1.5rem;
    width: 100%;
}

.custom-confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.6rem;
    color: var(--text-primary, #f8fafc);
    letter-spacing: -0.01em;
}

[data-theme="light"] .custom-confirm-title {
    color: #0f172a;
}

.custom-confirm-message {
    font-size: 0.94rem;
    line-height: 1.55;
    color: var(--text-secondary, #cbd5e1);
    margin: 0;
    white-space: pre-line;
    word-break: break-word;
}

[data-theme="light"] .custom-confirm-message {
    color: #475569;
}

.custom-confirm-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    width: 100%;
}

.custom-confirm-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.custom-confirm-btn.cancel {
    background: var(--surface-secondary, rgba(255, 255, 255, 0.07));
    border-color: var(--border-color, rgba(255, 255, 255, 0.12));
    color: var(--text-secondary, #cbd5e1);
}

.custom-confirm-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: translateY(-1px);
}

[data-theme="light"] .custom-confirm-btn.cancel {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

[data-theme="light"] .custom-confirm-btn.cancel:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.custom-confirm-btn.confirm.type-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.custom-confirm-btn.confirm.type-danger:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
    transform: translateY(-1px);
}

.custom-confirm-btn.confirm.type-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.custom-confirm-btn.confirm.type-warning:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

.custom-confirm-btn.confirm.type-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.custom-confirm-btn.confirm.type-info:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
    transform: translateY(-1px);
}

.custom-confirm-btn.confirm.type-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.custom-confirm-btn.confirm.type-success:hover {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);
    transform: translateY(-1px);
}

/* ⏱️ Custom Confirm Countdown Progress Bar */
.custom-confirm-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

[data-theme="light"] .custom-confirm-progress {
    background: rgba(0, 0, 0, 0.08);
}

.custom-confirm-progress-bar {
    height: 100%;
    transition: width 0.1s linear;
}

.custom-confirm-card.type-danger .custom-confirm-progress-bar {
    background: linear-gradient(90deg, #ef4444, #f59e0b);
}

.custom-confirm-card.type-warning .custom-confirm-progress-bar {
    background: linear-gradient(90deg, #10b981, #f59e0b);
}

.custom-confirm-card.type-success .custom-confirm-progress-bar {
    background: linear-gradient(90deg, #10b981, #3b82f6);
}

.custom-confirm-card.type-info .custom-confirm-progress-bar {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

@media (max-width: 480px) {
    .custom-confirm-card {
        padding: 1.5rem 1.25rem 1.25rem;
    }
    
    .custom-confirm-actions {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }
    
    .custom-confirm-btn {
        width: 100%;
        flex: none;
    }
}


/* ============================================================
   🎬 EASTER EGG — CREDITS ROLL (Titoli di Coda Stile Film)
   ============================================================ */

/* ---------- BACKDROP ---------- */
.credits-backdrop {
    --credits-vertical-gap: clamp(1.5rem, 4vh, 3rem);
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, rgba(13, 13, 43, 0.52) 0%, rgba(0, 0, 8, 0.42) 100%);
    backdrop-filter: blur(3px) saturate(0.9);
    -webkit-backdrop-filter: blur(3px) saturate(0.9);
    padding: var(--credits-vertical-gap) 1rem;
    animation: creditsBackdropIn 0.4s ease-out;
    overflow: hidden;
}

[data-theme="light"] .credits-backdrop {
    background: radial-gradient(ellipse at 50% 30%, rgba(226, 232, 240, 0.48) 0%, rgba(148, 163, 184, 0.38) 100%);
}

@keyframes creditsBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- STELLE GENERATE VIA CSS ---------- */
.credits-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.credits-stars-layer {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 40%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 40% 8%,  rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 60%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 25%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 50%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 5%  80%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 90%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 33% 70%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 85%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 78% 72%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 55%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 47% 33%, rgba(200,220,255,0.8) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 63% 12%, rgba(200,220,255,0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 22% 92%, rgba(200,220,255,0.6) 0%, transparent 100%);
}

.credits-stars-layer.s1 {
    animation: starsDrift1 120s linear infinite;
    opacity: 0.6;
}
.credits-stars-layer.s2 {
    animation: starsDrift2 180s linear infinite;
    opacity: 0.4;
    transform: scale(1.2) rotate(15deg);
}
.credits-stars-layer.s3 {
    animation: starsDrift3 90s linear infinite;
    opacity: 0.3;
    transform: scale(0.8) rotate(-10deg);
}

@keyframes starsDrift1 {
    from { transform: translateY(0); }
    to   { transform: translateY(-30px); }
}
@keyframes starsDrift2 {
    from { transform: scale(1.2) rotate(15deg) translateY(0); }
    to   { transform: scale(1.2) rotate(15deg) translateY(-20px); }
}
@keyframes starsDrift3 {
    from { transform: scale(0.8) rotate(-10deg) translateY(0); }
    to   { transform: scale(0.8) rotate(-10deg) translateY(-40px); }
}

@property --credits-border-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes creditsBorderRotate {
    to {
        --credits-border-angle: 360deg;
    }
}

/* ---------- FRAME CENTRALE ---------- */
.credits-frame {
    position: relative;
    width: 100%;
    width: min(94vw, 980px);
    max-width: 980px;
    height: min(82dvh, calc(100dvh - (2 * var(--credits-vertical-gap))));
    min-height: 0;
    max-height: calc(100dvh - (2 * var(--credits-vertical-gap)));
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    border: 0;
    box-shadow:
        0 0 60px rgba(100, 80, 255, 0.15),
        0 0 120px rgba(100, 80, 255, 0.08),
        inset 0 1px 0 rgba(255,255,255,0.06);
    background: rgba(8, 6, 22, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: visible; /* visible: i tooltip position:absolute possono uscire dal frame */
}

.credits-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 10;
    padding: 5px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--credits-border-angle),
        rgba(129, 140, 248, 0.95),
        rgba(192, 132, 252, 0.95),
        rgba(34, 211, 238, 0.95),
        rgba(16, 185, 129, 0.9),
        rgba(129, 140, 248, 0.95)
    );
    animation: creditsBorderRotate 5s linear infinite;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.credits-frame > * {
    position: relative;
    z-index: 1;
}

[data-theme="light"] .credits-frame {
    background: rgba(248, 250, 252, 0.92);
}

@keyframes creditsFrameIn {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ---------- HEADER FISSO (pill + controlli) ---------- */
.credits-header {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(150, 130, 255, 0.12);
    background: rgba(12, 8, 30, 0.6);
    flex-shrink: 0;
    gap: 0.75rem;
}

.credits-easter-egg-pill {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #f0c060;
    background: rgba(240, 192, 96, 0.12);
    border: 1px solid rgba(240, 192, 96, 0.3);
    border-radius: 100px;
    padding: 0.25rem 0.75rem;
    white-space: nowrap;
}

.credits-header-controls {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    position: relative;
    z-index: 5;
}

.credits-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    border: 1px solid rgba(150, 130, 255, 0.25);
    background: rgba(120, 100, 255, 0.1);
    color: rgba(200, 190, 255, 0.85);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.credits-ctrl-btn:hover {
    background: rgba(120, 100, 255, 0.28);
    border-color: rgba(150, 130, 255, 0.5);
    color: #fff;
    transform: scale(1.08);
}

.credits-close-btn:hover {
    background: rgba(220, 60, 60, 0.25);
    border-color: rgba(220, 80, 80, 0.5);
    color: #ff8888;
}

/* ---------- VIEWPORT CON MASCHERE SFUMATE ---------- */
.credits-viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    /* scrollbar sottile: consente di leggere avanti/indietro senza invadere la modale */
    scrollbar-width: thin;       /* Firefox */
    scrollbar-color: rgba(150, 130, 255, 0.55) transparent;
    -ms-overflow-style: auto;     /* IE/Edge */
}

.credits-viewport::-webkit-scrollbar {
    width: 5px;
}

.credits-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.credits-viewport::-webkit-scrollbar-thumb {
    background: rgba(150, 130, 255, 0.55);
    border-radius: 999px;
}

.credits-viewport::-webkit-scrollbar-thumb:hover {
    background: rgba(180, 165, 255, 0.8);
}

/* Maschera sfumata top */
.credits-viewport::before {
    content: "";
    position: sticky;
    top: 0;
    display: block;
    height: 18px;
    margin-bottom: -18px;
    background: linear-gradient(to bottom, rgba(8, 6, 22, 0.62) 0%, transparent 100%);
    z-index: 2;
    pointer-events: none;
}

/* Maschera sfumata bottom — via wrapper esterno, non pseudo */

/* ---------- STRIP CONTENUTO (no animation — scroll gestito da JS) ---------- */
.credits-roll {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 0 clamp(0.45rem, 1.2vw, 1rem);
}

/* ---------- SEZIONI ---------- */
.credits-section {
    width: min(100%, 760px);
    max-width: 760px;
    box-sizing: border-box;
    align-self: center;
    margin-inline: auto;
    text-align: center;
    padding: 2.25rem 1.35rem;
    border: 2px solid transparent;
    border-radius: calc(var(--border-radius-card) + 2px);
    background:
        linear-gradient(var(--bg-card, #17132f), var(--bg-card, #17132f)) padding-box,
        linear-gradient(135deg, rgba(129, 140, 248, 0.9) 0%, rgba(192, 132, 252, 0.72) 50%, rgba(34, 211, 238, 0.9) 100%) border-box;
    box-shadow: 0 4px 20px -2px rgba(99, 102, 241, 0.24),
                0 0 16px rgba(6, 182, 212, 0.14);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.credits-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.24),
                0 0 16px rgba(6, 182, 212, 0.14);
}

.credits-section:last-of-type {
    border-bottom: none;
}

.credits-section + .credits-section {
    margin-top: 1rem;
}

.credits-ai-section {
    text-align: left;
}

.credits-ai-section .credits-section-title {
    display: table;
    margin-left: auto;
    margin-right: auto;
}

.credits-ai-list {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.credits-ai-list li {
    position: relative;
    padding-left: 1.35rem;
    color: color-mix(in srgb, var(--text-primary, #f8f7ff) 84%, transparent);
    font-size: 0.98rem;
    line-height: 1.55;
}

.credits-ai-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-secondary, #06b6d4);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

[data-theme="light"] .credits-ai-list li {
    color: color-mix(in srgb, var(--text-primary, #1f2937) 88%, transparent);
}

.credits-opening {
    padding-top: 3rem;
}

.credits-closing {
    padding-bottom: 3rem;
}

/* ---------- LOGO ---------- */
.credits-logo-wrap {
    margin-bottom: 1.5rem;
}

.credits-logo-img {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 0 18px rgba(120, 100, 255, 0.4));
}

/* Rispetta dark/light logo dell'app globale */
[data-theme="dark"]  .credits-logo-img.light-logo { display: none; }
[data-theme="dark"]  .credits-logo-img.dark-logo  { display: block; }
[data-theme="light"] .credits-logo-img.dark-logo  { display: none; }
[data-theme="light"] .credits-logo-img.light-logo { display: block; }
/* Default sicuro (dark) quando nessun tema è impostato */
.credits-logo-img.light-logo { display: none; }
.credits-logo-img.dark-logo  { display: block; }

.credits-portrait-wrap {
    display: flex;
    justify-content: center;
    margin: 0 auto 1.35rem;
}

.credits-portrait {
    display: block;
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid rgba(180, 165, 255, 0.48);
    padding: 5px;
    background: linear-gradient(145deg, rgba(150, 130, 255, 0.28), rgba(10, 8, 30, 0.72));
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 12px 34px rgba(0, 0, 0, 0.28),
        0 0 28px rgba(130, 110, 255, 0.16);
}

/* ---------- TIPOGRAFIA CREDITS ---------- */
.credits-stars-line {
    font-size: 1.1rem;
    color: #f0c060;
    letter-spacing: 0.3em;
    margin: 0.75rem 0;
    opacity: 0.85;
}

.credits-opening-line {
    font-size: 1.05rem;
    max-width: 680px;
    color: color-mix(in srgb, var(--text-primary, #f8f7ff) 86%, transparent);
    line-height: 1.72;
    margin: 0.75rem auto;
    font-style: normal;
    text-align: left;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: auto;
    text-wrap: pretty;
}

.credits-opening-copy {
    max-width: 680px;
    margin: 0 auto;
    text-align: left;
}

.credits-opening-lead {
    margin: 1.25rem 0 1.65rem;
    padding: 1rem 1.15rem;
    border-left: 3px solid #10b981;
    border-radius: 0 12px 12px 0;
    background: color-mix(in srgb, #10b981 10%, transparent);
    color: #34d399;
    font-family: var(--font-family-heading);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.45;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.24);
}

.credits-opening-detail {
    position: relative;
    margin: 0.85rem 0;
    padding-left: 1.15rem;
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.15rem;
    line-height: 1.65;
}

.credits-opening-detail::before {
    content: "";
    position: absolute;
    top: 0.7em;
    left: 0;
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background: var(--accent-secondary, #06b6d4);
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent-secondary, #06b6d4) 70%, transparent);
}

.credits-opening-signature {
    margin: 1.75rem 0 0.5rem;
    padding: 1rem 1.15rem 0 1.15rem;
    border-top: 1px solid color-mix(in srgb, #f0c060 45%, transparent);
    border-left: 3px solid #10b981;
    border-radius: 0 12px 0 0;
    color: color-mix(in srgb, var(--text-primary, #f8f7ff) 92%, transparent);
    font-family: var(--font-family-heading);
    font-size: 1.12rem;
    font-style: italic;
    line-height: 1.55;
}

[data-theme="light"] .credits-opening-lead {
    color: #047857;
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #059669;
    text-shadow: none;
}

[data-theme="light"] .credits-opening-signature {
    color: #26324a;
    border-top-color: rgba(138, 90, 0, 0.4);
    border-left-color: #059669;
}

.credits-opening-line.italic {
    font-style: italic;
    color: rgba(200, 195, 255, 0.65);
}

.credits-section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: color-mix(in srgb, var(--accent-primary, #8b7cf6) 28%, #ffffff);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.credits-section-title {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #f0c060;
    margin-bottom: 0.75rem;
    font-weight: 700;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(240, 192, 96, 0.65);
    text-shadow: 0 0 12px rgba(240, 192, 96, 0.35);
    display: inline-block;
}

.credits-name {
    font-size: 1.55rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.02em;
    margin: 0.25rem 0 0.4rem;
    text-shadow: 0 0 20px rgba(150, 130, 255, 0.5);
}

.credits-role {
    font-size: 0.88rem;
    color: color-mix(in srgb, var(--accent-secondary, #06b6d4) 42%, #ffffff);
    letter-spacing: 0.05em;
    margin: 0;
}

.credits-creator-section {
    max-width: 760px;
}

.credits-bio {
    max-width: 680px;
    margin: 1.5rem auto 0;
    text-align: left;
}

.credits-bio .credits-body-line {
    margin: 0 0 0.9rem;
    color: color-mix(in srgb, var(--text-primary, #f8f7ff) 78%, transparent);
    font-size: 0.96rem;
    line-height: 1.72;
}

.credits-bio .credits-bio-lead {
    margin-bottom: 1.6rem;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--accent-primary, #8b7cf6);
    border-radius: 0 10px 10px 0;
    background: color-mix(in srgb, var(--accent-primary, #8b7cf6) 9%, transparent);
    color: var(--text-primary, #f8f7ff);
    font-size: 1.04rem;
    font-weight: 600;
    line-height: 1.6;
}

.credits-bio-heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1.7rem 0 0.65rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid color-mix(in srgb, var(--accent-primary, #8b7cf6) 28%, transparent);
    color: #f0c060;
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.13em;
    line-height: 1.4;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(240, 192, 96, 0.32);
}

[data-theme="light"] .credits-section-title,
[data-theme="light"] .credits-bio-heading {
    color: #8a5a00;
    border-bottom-color: rgba(138, 90, 0, 0.42);
    text-shadow: none;
}

[data-theme="light"] .credits-bio .credits-bio-lead {
    border-left-color: #059669;
    background: rgba(16, 185, 129, 0.1);
    color: #26324a;
}

[data-theme="light"] .credits-opening-line {
    color: color-mix(in srgb, var(--text-primary, #1f2937) 92%, transparent);
}

[data-theme="light"] .credits-section-label {
    color: #475569;
    font-weight: 700;
    opacity: 1;
}

[data-theme="light"] .credits-name {
    color: #0f172a;
    text-shadow: none;
}

[data-theme="light"] .credits-role {
    color: #26324a;
    font-size: 0.95rem;
    font-weight: 700;
    opacity: 1;
}

.credits-bio-heading::before {
    content: "";
    width: 0.48rem;
    height: 0.48rem;
    flex: 0 0 0.48rem;
    border-radius: 50%;
    background: var(--accent-primary, #8b7cf6);
    box-shadow: 0 0 9px color-mix(in srgb, var(--accent-primary, #8b7cf6) 75%, transparent);
}

.credits-body-line {
    font-size: 0.98rem;
    color: color-mix(in srgb, var(--text-primary, #f8f7ff) 84%, transparent);
    line-height: 1.9;
    margin: 0.15rem 0;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: auto;
    text-wrap: pretty;
}

.credits-tech-stack {
    font-size: 0.92rem;
    color: #80d8ff;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.04em;
    background: rgba(128, 216, 255, 0.06);
    border: 1px solid rgba(128, 216, 255, 0.15);
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    display: inline-block;
    margin-top: 0.4rem;
}

.credits-tech-bullets {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 1.1rem;
}

.credits-tech-bullet {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.15rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid color-mix(in srgb, var(--accent-primary, #8b7cf6) 38%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-card, #1c163a) 72%, transparent);
    color: var(--text-primary, #f8f7ff);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: 0.02em;
    cursor: help;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.credits-tech-bullet:hover,
.credits-tech-bullet:focus-visible {
    transform: translateY(-2px);
    border-color: var(--accent-primary, #a89fdd);
    box-shadow: 0 5px 16px color-mix(in srgb, var(--accent-primary, #8b7cf6) 25%, transparent);
    outline: none;
}

.credits-tech-bullet-dot {
    width: 0.5rem;
    height: 0.5rem;
    flex: 0 0 0.5rem;
    border-radius: 50%;
    background: var(--accent-primary, #8b7cf6);
    box-shadow: 0 0 9px color-mix(in srgb, var(--accent-primary, #8b7cf6) 75%, transparent);
}

.credits-experience-section {
    max-width: 760px;
}

.credits-experience-item[data-tooltip]::after,
.credits-tech-bullet[data-tooltip]::after {
    width: max-content;
    max-width: min(380px, calc(100vw - 2rem));
    padding: 0.75rem 1rem;
    border: 1px solid color-mix(in srgb, var(--accent-primary, #6366f1) 28%, transparent);
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.5;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42), 0 0 12px color-mix(in srgb, var(--accent-primary, #6366f1) 15%, transparent);
}

.credits-experience-item[data-tooltip-tech]::after {
    content: attr(data-tooltip-tech) "\A" attr(data-tooltip-duration);
    white-space: pre-line;
}

.credits-experience-item[data-tooltip]::before,
.credits-tech-bullet[data-tooltip]::before {
    opacity: 0.8;
}

.credits-experience-timeline {
    position: relative;
    max-width: 560px;
    margin: 1.15rem auto 0;
    padding: 0.15rem 0;
    text-align: left;
}

.credits-experience-timeline::before {
    content: "";
    position: absolute;
    top: 0.7rem;
    bottom: 0.7rem;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    border-radius: 2px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--accent-primary, #8b7cf6) 80%, transparent),
        color-mix(in srgb, var(--accent-secondary, #38bdf8) 45%, transparent));
}

.credits-experience-item {
    position: relative;
    display: flex;
    align-items: center;
    width: calc(50% - 1.15rem);
    min-height: 3.05rem;
    margin: 0.55rem 0;
    padding: 0.72rem 1rem;
    border: 1px solid color-mix(in srgb, var(--accent-primary, #8b7cf6) 25%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-card, #1c163a) 76%, transparent);
    color: var(--text-primary, #f8f7ff);
    cursor: help;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.credits-experience-item-left {
    margin-right: auto;
    text-align: right;
}

.credits-experience-item-right {
    margin-left: auto;
    text-align: left;
}

.credits-experience-item:hover,
.credits-experience-item:focus-visible {
    transform: translateX(4px);
    border-color: var(--accent-primary, #a89fdd);
    box-shadow: 0 5px 18px color-mix(in srgb, var(--accent-primary, #8b7cf6) 20%, transparent);
    outline: none;
}

.credits-experience-node {
    position: absolute;
    width: 0.78rem;
    height: 0.78rem;
    border: 2px solid var(--bg-primary, #0f0f0f);
    border-radius: 50%;
    background: var(--accent-primary, #8b7cf6);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary, #8b7cf6) 38%, transparent),
        0 0 12px color-mix(in srgb, var(--accent-primary, #8b7cf6) 65%, transparent);
}

.credits-experience-item-left .credits-experience-node {
    right: -1.55rem;
}

.credits-experience-item-right .credits-experience-node {
    left: -1.55rem;
}

.credits-experience-item-right[data-tooltip-pos="left"]::after {
    top: 50%;
    right: calc(100% + 8px);
    bottom: auto;
    left: auto;
    transform: translateY(-50%) translateX(4px);
}

.credits-experience-item-right[data-tooltip-pos="left"]::before {
    top: 50%;
    right: calc(100% + 2px);
    bottom: auto;
    left: auto;
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent #0f172a;
    transform: translateY(-50%) translateX(4px);
}

.credits-experience-item-right[data-tooltip-pos="left"]:hover::after,
.credits-experience-item-right[data-tooltip-pos="left"]:hover::before {
    transform: translateY(-50%) translateX(0);
}

.credits-experience-client {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.credits-experience-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.credits-experience-details {
    display: none;
    color: var(--text-secondary, #cbd5e1);
    font-size: 0.78rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

[data-theme="light"] .credits-experience-item {
    background: color-mix(in srgb, var(--bg-card, #ffffff) 90%, var(--accent-primary, #6366f1));
}

[data-theme="light"] .credits-tech-bullet {
    background: color-mix(in srgb, var(--bg-card, #ffffff) 88%, var(--accent-primary, #6366f1));
    color: var(--text-primary, #1e293b);
}

@media (max-width: 600px) {
    .credits-backdrop {
        --credits-vertical-gap: 1rem;
    }

    .credits-frame {
        width: calc(100vw - 1rem);
        height: min(88dvh, calc(100dvh - (2 * var(--credits-vertical-gap))));
        max-height: calc(100dvh - (2 * var(--credits-vertical-gap)));
        border-radius: 16px;
    }

    .credits-header {
        position: relative;
        min-height: 4.1rem;
        padding: 0.65rem 0.7rem 0.65rem 0.85rem;
        gap: 0.5rem;
    }

    .credits-header-controls {
        position: absolute;
        top: 0.65rem;
        right: 0.7rem;
        gap: 0.4rem;
        display: flex !important;
        z-index: 10;
    }

    .credits-easter-egg-pill {
        max-width: calc(100% - 7rem);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .credits-ctrl-btn {
        width: 2.75rem;
        height: 2.75rem;
        min-width: 2.75rem;
        min-height: 2.75rem;
        font-size: 0.95rem;
    }

    .credits-roll {
        padding: 0 0.35rem;
    }

    .credits-section {
        padding: 1.55rem 1rem;
    }

    .credits-creator-section {
        padding-inline: 1rem;
    }

    .credits-bio {
        margin-top: 1.25rem;
    }

    .credits-bio .credits-body-line {
        margin-left: 1.35rem;
        font-size: 0.91rem;
        line-height: 1.65;
    }

    .credits-bio .credits-bio-lead {
        font-size: 0.96rem;
    }

    .credits-opening-lead {
        font-size: 1.12rem;
    }

    .credits-opening-detail {
        font-size: 1.05rem;
    }

    .credits-bio-heading {
        font-size: 0.72rem;
        letter-spacing: 0.09em;
    }

    .credits-tech-bullets {
        gap: 0.5rem;
    }

    .credits-tech-bullet {
        font-size: 0.76rem;
        padding: 0.4rem 0.65rem;
    }

    .credits-experience-timeline {
        max-width: 100%;
        padding-left: 1.2rem;
        padding-right: 0;
    }

    .credits-experience-item {
        width: 100%;
        min-height: 2.8rem;
        padding: 0.62rem 0.75rem;
        cursor: default;
    }

    .credits-experience-details {
        display: block;
    }

    .credits-experience-timeline::before {
        left: 0.39rem;
        transform: none;
    }

    .credits-experience-item-left,
    .credits-experience-item-right {
        margin-left: 0;
        margin-right: 0;
        text-align: left;
    }

    .credits-experience-item-left .credits-experience-node,
    .credits-experience-item-right .credits-experience-node {
        left: -1.07rem;
        right: auto;
    }

    .credits-experience-item[data-tooltip]::after,
    .credits-experience-item[data-tooltip]::before {
        display: none;
    }

    .credits-experience-client {
        font-size: 0.82rem;
    }

    .credits-experience-item[data-tooltip]::after,
    .credits-tech-bullet[data-tooltip]::after {
        max-width: calc(100vw - 2rem);
        padding: 0.6rem 0.75rem;
        font-size: 0.75rem;
    }
}

.credits-values-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.credits-values-list li {
    font-size: 0.96rem;
    color: rgba(200, 195, 255, 0.82);
    padding: 0.4rem 1rem;
    background: rgba(120, 100, 255, 0.07);
    border-radius: 8px;
    border: 1px solid rgba(120, 100, 255, 0.1);
    text-align: center;
}

.credits-born-label {
    font-size: 0.85rem;
    color: rgba(170, 165, 255, 0.65);
    margin: 0 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.credits-born-label strong {
    color: #fff;
}

.credits-born-place {
    font-size: 0.95rem;
    color: rgba(200, 195, 255, 0.75);
    margin: 0 0 1.5rem;
}

.credits-quote {
    font-size: 1.15rem;
    font-style: italic;
    color: #f0c060;
    line-height: 1.6;
    margin: 0.5rem 0 0.25rem;
    text-shadow: 0 0 12px rgba(240, 192, 96, 0.3);
}

.credits-quote-author {
    font-size: 0.85rem;
    color: rgba(240, 192, 96, 0.78);
    letter-spacing: 0.06em;
    margin: 0 0 1.5rem;
}

[data-theme="light"] .credits-quote {
    color: #8a5a00;
    text-shadow: none;
}

[data-theme="light"] .credits-quote-author {
    color: #8a5a00;
}

.credits-tech-line {
    font-size: 0.88rem;
    color: #80d8ff;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.03em;
    margin: 0.2rem 0;
    opacity: 0.85;
}

.credits-version {
    font-size: 0.72rem;
    color: rgba(140, 135, 200, 0.45);
    letter-spacing: 0.08em;
    margin-top: 1rem;
}

.credits-end-spacer {
    height: clamp(1.5rem, 3vh, 2.5rem);
}

/* ---------- LOGO HEADER — trigger Easter Egg ---------- */
.logo-link.credits-trigger {
    cursor: pointer;
    position: relative;
}

.logo-link.credits-trigger:focus-visible {
    outline: 2px solid rgba(150, 130, 255, 0.6);
    outline-offset: 4px;
    border-radius: 6px;
}

/* ---------- RESPONSIVE TABLET/MOBILE — bordo troppo pesante su schermi piccoli ---------- */
@media (max-width: 1024px) {
    /* Bordo animato arcobaleno del frame: resta solo su desktop */
    .credits-frame::before {
        display: none;
    }

    .credits-section {
        border-width: 0;
        background: var(--bg-card, #17132f);
        box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.35);
    }

    .credits-section:hover {
        box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.4);
    }
}

/* ---------- RESPONSIVE MOBILE ---------- */
@media (max-width: 768px) {
    .credits-frame {
        width: 100%;
        max-width: none;
        height: min(88dvh, calc(100dvh - (2 * var(--credits-vertical-gap))));
        max-height: calc(100dvh - (2 * var(--credits-vertical-gap)));
        border-radius: 14px;
    }

    .credits-roll {
        padding: 0 0.35rem;
    }

    .credits-name {
        font-size: 1.25rem;
    }

    .credits-section {
        padding: 1.75rem 0;
    }

    .credits-tech-stack {
        font-size: 0.78rem;
        padding: 0.5rem 0.75rem;
        word-break: break-word;
    }

    .credits-logo-img {
        max-width: 150px;
    }

    .credits-portrait {
        width: 140px;
        height: 140px;
    }

    .credits-quote {
        font-size: 1rem;
    }

    .credits-bottom-player {
        gap: 0.65rem;
        padding: 0.6rem 0.75rem;
    }

    .credits-bottom-btn {
        width: 2.75rem;
        height: 2.75rem;
    }

    .credits-play-btn {
        width: 3.15rem;
        height: 3.15rem;
    }
}

/* Fine 🎬 Easter Egg Credits Roll */

