/* ========== TOKENS ========== */
:root {
    /* Background - Nero profondo con tono freddo */
    --bg-deep: #030305;
    --bg-surface: #0D0D12;
    --bg-elevated: #16161D;
    --border: #2C2C2E;
    --border-subtle: #1C1C1E;

    /* Testo */
    --text-primary: #F5F5F7;
    --text-secondary: #8E8E93;
    --text-muted: #48484A;

    /* Verdetti - Neon vividi */
    --verdict-true: #00FF88;
    --verdict-false: #FF3366;
    --verdict-uncertain: #FFB800;
    --verdict-true-bg: rgba(0, 255, 136, 0.12);
    --verdict-false-bg: rgba(255, 51, 102, 0.12);
    --verdict-uncertain-bg: rgba(255, 184, 0, 0.12);
    /* Verdetti estesi */
    --verdict-partial: #FFB800;          /* giallo - parzialmente vero */
    --verdict-misleading: #FF8C2B;       /* arancio - fuorviante */
    --verdict-disputed: #8FA3B8;         /* grigio-blu - fonti discordanti */
    --verdict-unverifiable: #9AA0A6;     /* grigio neutro - non verificabile */
    --verdict-partial-bg: rgba(255, 184, 0, 0.12);
    --verdict-misleading-bg: rgba(255, 140, 43, 0.12);
    --verdict-disputed-bg: rgba(143, 163, 184, 0.12);
    --verdict-unverifiable-bg: rgba(154, 160, 166, 0.12);

    /* Accent - Electric Lime (signature color) */
    --accent: #CFFF04;
    --accent-dim: rgba(207, 255, 4, 0.15);
    --accent-glow: rgba(207, 255, 4, 0.25);
    --rec-color: #FF3366;
    --rec-glow: rgba(255, 51, 102, 0.25);

    /* Spacing e Radius */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 999px;

    /* Typography */
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Fluid Typography */
    --text-xs: clamp(0.6875rem, 0.625rem + 0.25vw, 0.8125rem);    /* 11-13px */
    --text-sm: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);          /* 12-14px */
    --text-base: clamp(0.8125rem, 0.75rem + 0.3125vw, 0.9375rem);  /* 13-15px */
    --text-lg: clamp(0.875rem, 0.8rem + 0.375vw, 1.0625rem);       /* 14-17px */
    --text-xl: clamp(1.125rem, 1rem + 0.625vw, 1.375rem);          /* 18-22px */
    --text-2xl: clamp(1.25rem, 1rem + 1.25vw, 1.75rem);            /* 20-28px */
    --text-brand: clamp(1.125rem, 0.875rem + 1.25vw, 1.5rem);      /* 18-24px */

    /* Fluid Spacing */
    --space-xs: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
    --space-sm: clamp(0.75rem, 0.6rem + 0.75vw, 1.25rem);
    --space-md: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    --space-lg: clamp(1.25rem, 1rem + 1.25vw, 2rem);

    /* Easing fluido */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========== RESET ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100dvh;
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== APP WRAPPER ========== */
.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
}

/* ========== HEADER ========== */
.header {
    flex-shrink: 0;
    z-index: 100;
    background: rgba(3, 3, 5, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 var(--space-md);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
}

/* ========== PROGRESS BAR (header) ========== */
.progress-container {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    flex-shrink: 1;
    min-width: 0;
}

.progress-container.visible {
    display: flex;
}

.progress-label {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.progress-bar {
    width: 100px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 300ms var(--ease-out);
    box-shadow: 0 0 8px var(--accent-glow);
}

.progress-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    min-width: 32px;
    text-align: right;
}

.progress-container.processing .progress-fill {
    animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.brand {
    display: flex;
    align-items: baseline;
    gap: clamp(4px, 1vw, 8px);
    user-select: none;
    font-family: var(--font-display);
    min-width: 0;
    flex: 1;
}

.brand-facts {
    font-size: var(--text-brand);
    font-weight: 700;
    letter-spacing: -1px;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.brand-nobs {
    font-size: var(--text-brand);
    font-weight: 500;
    letter-spacing: -1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ========== USER AREA (header right) ========== */
.user-area {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 1;
}

.user-area-login-btn {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 20px;
    min-height: 44px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: all 200ms var(--ease-out);
}

.user-area-login-btn:hover {
    background: var(--accent-dim);
    box-shadow: 0 0 15px var(--accent-glow);
}

.user-profile {
    display: none;
    align-items: center;
    gap: 10px;
    position: relative;
}

.user-profile.visible {
    display: flex;
}

.quota-indicator {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
}

.quota-indicator.warning {
    color: var(--verdict-uncertain);
    border-color: rgba(255, 184, 0, 0.3);
}

.quota-indicator.danger {
    color: var(--verdict-false);
    border-color: rgba(255, 51, 102, 0.3);
}

.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-elevated);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    /* Touch target minimo 44px tramite pseudo-elemento */
    position: relative;
}

.user-avatar-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
}

.user-avatar-btn:hover {
    border-color: var(--accent);
}

.user-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* User dropdown */
.user-dropdown {
    display: none;
    position: absolute;
    top: 44px;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 0;
    min-width: 200px;
    z-index: 300;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.user-dropdown.visible {
    display: block;
}

.user-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.user-dropdown-name {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown-email {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-dropdown-plan {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    margin-top: 6px;
    display: inline-block;
}

.user-dropdown-plan.plan-free {
    background: var(--accent-dim);
    color: var(--accent);
}

.user-dropdown-plan.plan-paid {
    background: var(--verdict-true-bg);
    color: var(--verdict-true);
}

.user-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}

.user-dropdown-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.user-dropdown-item.upgrade-btn {
    color: var(--accent);
    font-weight: 600;
}

.user-dropdown-item.logout-btn {
    color: var(--verdict-false);
    border-top: 1px solid var(--border-subtle);
    margin-top: 4px;
}

/* ========== AUTH MODAL ========== */
.auth-overlay {
    z-index: 500;
}

.auth-modal {
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========== SHARED MODAL BASE CLASSES ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.modal-overlay.visible { display: flex; }

.modal-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    padding: var(--space-lg);
    position: relative;
    animation: modal-in 300ms var(--ease-out) both;
}

.modal-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--bg-elevated);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 150ms ease, background 150ms ease;
}
.modal-close:hover {
    color: var(--text-primary);
    background: var(--border);
}

.modal-textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    resize: vertical;
}
.modal-textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.modal-textarea::placeholder {
    color: var(--text-muted);
}

.btn-pill {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 200ms ease;
}


.auth-title {
    margin-bottom: 6px;
}

.auth-subtitle {
    margin-bottom: 24px;
    line-height: 1.5;
}

.auth-google-btn {
    width: 100%;
    padding: 12px;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 200ms ease;
}

.auth-google-btn:hover {
    background: var(--border);
    border-color: var(--text-muted);
}

.auth-google-btn svg {
    width: 20px;
    height: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.auth-divider span {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== CUSTOM MODAL SYSTEM ========== */
.custom-modal-overlay {
    z-index: 10001;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.custom-modal {
    max-width: 380px;
    text-align: center;
}
.custom-modal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.custom-modal-icon.success {
    background: var(--verdict-true-bg);
    color: var(--verdict-true);
}
.custom-modal-icon.warning {
    background: var(--verdict-uncertain-bg);
    color: var(--verdict-uncertain);
}
.custom-modal-message {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}
.custom-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.custom-modal-btn {
    padding: 12px 24px;
    min-width: 100px;
}
.custom-modal-btn-primary {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent);
}
.custom-modal-btn-primary:hover {
    box-shadow: 0 0 16px var(--accent-glow);
}
.custom-modal-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
}
.custom-modal-btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* ========== CANCELLATION SURVEY MODAL ========== */
.cancel-survey-overlay {
    z-index: 10002;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.cancel-survey-modal {
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
}
.cancel-survey-title {
    text-align: center;
}
.cancel-survey-subtitle {
    text-align: center;
}
.cancel-survey-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.cancel-survey-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 200ms ease;
}
.cancel-survey-option:hover {
    border-color: var(--text-secondary);
}
.cancel-survey-option.selected {
    border-color: var(--accent);
    background: rgba(0, 255, 136, 0.05);
}
.cancel-survey-option input[type="radio"] {
    display: none;
}
.cancel-survey-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all 200ms ease;
}
.cancel-survey-option.selected .cancel-survey-radio {
    border-color: var(--accent);
}
.cancel-survey-option.selected .cancel-survey-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}
.cancel-survey-label {
    font-size: var(--text-sm);
    color: var(--text-primary);
}
.cancel-survey-textarea {
    min-height: 80px;
    margin-top: 8px;
    display: none;
}
.cancel-survey-textarea.visible {
    display: block;
}
.cancel-survey-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}
.cancel-survey-btn-danger {
    background: var(--verdict-false);
    color: white;
    border-color: var(--verdict-false);
}
.cancel-survey-btn-danger:hover {
    box-shadow: 0 0 16px rgba(255, 68, 68, 0.4);
}
.cancel-survey-btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.cancel-survey-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
}
.cancel-survey-btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* ========== HEADER NAV BUTTONS ========== */
.header-nav {
    display: flex;
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.header-nav-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 200ms ease;
    white-space: nowrap;
}
.header-nav-btn:hover {
    color: var(--text-primary);
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.05);
}

/* ========== FAQ MODAL ========== */
.faq-modal {
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
}
.faq-title {
    text-align: center;
    margin-bottom: 20px;
}
.faq-item {
    border-bottom: 1px solid var(--border-subtle);
}
.faq-item:last-child {
    border-bottom: none;
}
.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    transition: color 200ms ease;
}
.faq-question:hover {
    color: var(--accent);
}
.faq-chevron {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    transition: transform 300ms ease;
    color: var(--text-secondary);
}
.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease, padding 300ms ease;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}
.faq-item.open .faq-answer {
    max-height: 300px;
    padding-bottom: 16px;
}

/* ========== FEEDBACK MODAL ========== */
.feedback-modal {
    max-width: 440px;
}
.feedback-title {
    text-align: center;
}
.feedback-subtitle {
    text-align: center;
}
.feedback-type-selector {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}
.feedback-type-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-elevated);
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 200ms ease;
}
.feedback-type-btn.active {
    background: var(--accent);
    color: var(--bg-deep);
    font-weight: 600;
}
.feedback-textarea {
    min-height: 100px;
    margin-bottom: 4px;
}
.feedback-char-count {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 12px;
}
.feedback-email {
    margin-bottom: 16px;
}
.feedback-submit {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: var(--bg-deep);
    border: none;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
}
.feedback-submit:hover:not(:disabled) {
    box-shadow: 0 0 16px var(--accent-glow);
}
.feedback-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: var(--bg-elevated);
    border: none;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
}

.auth-tab.active {
    background: var(--accent-dim);
    color: var(--accent);
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    min-height: 48px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px; /* Previene zoom su iOS */
    margin-bottom: 12px;
    transition: border-color 200ms ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent);
}

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

.auth-submit {
    width: 100%;
    padding: 12px;
    min-height: 48px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #000;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 200ms ease;
}

.auth-submit:hover {
    box-shadow: 0 0 20px var(--accent-glow);
}

.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-error {
    color: var(--verdict-false);
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}

.auth-error.visible {
    display: block;
}

.forgot-password {
    display: block;
    text-align: right;
    color: var(--accent);
    font-size: 13px;
    margin: -4px 0 12px 0;
    padding: 8px 0;
    text-decoration: none;
    transition: opacity 200ms ease;
}

.forgot-password:hover {
    opacity: 0.8;
}

.forgot-password.hidden {
    display: none;
}

/* ========== QUOTA MODAL (upgrade) ========== */
.quota-modal-content {
    text-align: center;
}

.quota-modal-content .auth-title {
    margin-bottom: 12px;
}

.quota-price {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    margin: 16px 0 4px;
}

.quota-price-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.quota-features {
    text-align: left;
    margin: 16px 0 24px;
}

.quota-features li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 6px 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quota-features li::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ========== DASHBOARD PANEL ========== */
.dashboard-overlay {
    z-index: 450;
}

.dashboard-modal {
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}

.dashboard-title {
    font-size: 20px;
    margin-bottom: 20px;
}


.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.dashboard-stat {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.dashboard-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.dashboard-stat-value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.session-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.session-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 200ms ease;
}

.session-item:hover {
    border-color: var(--accent);
}

.session-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.session-item-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.session-item-duration {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.session-item-stats {
    font-size: 13px;
    color: var(--text-muted);
}

.session-detail-list {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.session-detail-list.visible {
    display: flex;
}

.session-fc-item {
    padding: 10px 12px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border);
}

.session-fc-item.verdict-true { border-left-color: var(--verdict-true); }
.session-fc-item.verdict-false { border-left-color: var(--verdict-false); }
.session-fc-item.verdict-uncertain { border-left-color: var(--verdict-uncertain); }
.session-fc-item.verdict-partial { border-left-color: var(--verdict-partial); }
.session-fc-item.verdict-misleading { border-left-color: var(--verdict-misleading); }
.session-fc-item.verdict-disputed { border-left-color: var(--verdict-disputed); }
.session-fc-item.verdict-unverifiable { border-left-color: var(--verdict-unverifiable); }

.session-fc-claim {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.session-fc-verdict {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.session-empty {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ========== REC BUTTON OVERLAY (stato iniziale) ========== */
.rec-button-overlay {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.rec-button-overlay.hidden {
    display: none;
}

.rec-button-overlay .audio-source-toggle {
    margin-bottom: 8px;
}

/* ========== REC DOCK (stato attivo, nel flow) ========== */
.rec-dock {
    flex-shrink: 0;
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    min-height: 80px;
    background: rgba(13, 13, 18, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
}

.rec-dock.visible {
    display: flex;
}

.rec-timer {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 500;
    color: var(--rec-color);
    transition: opacity 200ms var(--ease-out), top 200ms var(--ease-out);
    pointer-events: none;
    text-shadow: 0 0 10px var(--rec-glow);
    opacity: 0;
}

.rec-dock.recording .rec-timer {
    opacity: 1;
}

.rec-dock.visible .rec-timer {
    position: absolute;
    top: -28px; /* Floats above the dock, detaching it from flex flow */
    left: 50%;
    transform: translateX(-50%);
}

.rec-dock.visible .rec-dock-center-stack {
    position: relative;
    justify-content: center;
    height: 100%;
}

#waveform-canvas {
    width: 160px;
    height: 40px;
    opacity: 0;
    transition: opacity 200ms var(--ease-out);
    pointer-events: none;
}

.rec-dock.recording #waveform-canvas {
    opacity: 1;
}

.rec-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--border);
    background: var(--bg-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 200ms var(--ease-out);
}

.rec-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
}

.rec-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.rec-btn-dot {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 50%;
    transition: all 200ms var(--ease-out);
    box-shadow: 0 0 15px var(--accent-glow);
}

.rec-dock.recording .rec-btn {
    border-color: var(--rec-color);
    border-radius: 12px;
    background: rgba(255, 51, 102, 0.05);
    animation: none; /* No pulse, solid stop button */
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.2);
}

.rec-dock.recording .rec-btn:hover {
    border-color: var(--rec-color);
    background: rgba(255, 51, 102, 0.15);
}

.rec-dock.recording .rec-btn-dot {
    width: 24px;
    height: 24px;
    background: var(--rec-color);
    border-radius: 4px; /* Classic square for STOP */
    box-shadow: 0 0 15px var(--rec-glow);
}

/* Let's keep pulse for something else if needed, but remove from button */

/* ========== AUDIO SOURCE TOGGLE ========== */
.audio-source-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 4px;
}

.source-option {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.source-option:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

.source-option.active {
    background: rgba(255, 255, 255, 0.15); /* Subtler active state instead of full green */
    color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.rec-dock.recording .audio-source-toggle {
    opacity: 0.7;
    pointer-events: none;
}

/* Right side group: waveform + timer */
.rec-dock-right {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    flex: 1;
}

/* Center group: rec button */
.rec-dock-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Left group: audio toggle */
.rec-dock-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
}

/* Initially, children are stacked (column) - no groups needed */
/* When visible, children are in row groups */
.rec-dock:not(.visible) .rec-dock-left,
.rec-dock:not(.visible) .rec-dock-center,
.rec-dock:not(.visible) .rec-dock-right {
    min-width: unset;
    justify-content: center;
}

.mobile-transcript-btn {
    display: none;
}

/* Hide only the right (waveform) in initial state - show toggle (left) and button (center) */
.rec-dock:not(.visible) .rec-dock-right {
    display: none;
}

/* Center group: dimensione naturale per mantenere il bottone centrato */

/* ========== FEED (two-column grid) ========== */
.feed {
    flex-grow: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
    position: relative; /* Per rec-button-overlay */
    padding: var(--space-md);
    gap: var(--space-lg);
}

/* Desktop: due colonne affiancate */
@media (min-width: 1024px) {
    .feed {
        flex-direction: row;
        width: 100%;
        max-width: 1400px;
        margin: 0 auto;
    }

    .transcript-panel {
        width: 40%;
        min-width: 320px;
        flex-shrink: 0;
        order: -1; /* Posiziona sempre a sinistra delle cards */
    }

    .cards-column {
        flex-grow: 1;
        flex-basis: 60%;
        min-width: 0;
    }
}

/* Mobile/Tablet: colonna singola */
@media (max-width: 1023px) {
    .feed {
        flex-direction: column;
    }

    .transcript-panel {
        display: none; /* Mostrato solo via bottom sheet */
    }

    .cards-column {
        flex-grow: 1;
        width: 100%;
    }

    /* Nasconde toggle audio su mobile (non supportato) */
    .audio-source-toggle {
        display: none !important;
    }
}

.cards-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 24px;
    padding-right: 8px;
    visibility: hidden;
    -webkit-overflow-scrolling: touch;
}

.cards-column.visible {
    visibility: visible;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-sm);
    text-align: center;
    padding: var(--space-md);
    padding-top: 22dvh;
    pointer-events: none;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.empty-state.fading-out {
    opacity: 0;
    pointer-events: none;
}

.empty-state svg {
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state .empty-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    text-align: center;
}

.empty-state .empty-sub {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 340px;
    line-height: 1.6;
    text-align: center;
}

/* Center-stack: stacks timer above button in initial (column) layout */
.rec-dock-center-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* ========== FACT CARD ========== */
.fact-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    padding: var(--space-md);
    animation: card-in 250ms var(--ease-out) both;
    position: relative;
    overflow: hidden;
    transition: transform 150ms var(--ease-out), border-color 200ms ease;
    flex-shrink: 0; /* Impedisce compressione delle cards */
}

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

/* Glow bar sinistra */
.fact-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--border);
    transition: background 200ms ease, box-shadow 200ms ease;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.fact-card.verdict-true::before {
    background: var(--verdict-true);
    box-shadow: 0 0 20px var(--verdict-true), 0 0 40px rgba(0, 255, 136, 0.3);
}
.fact-card.verdict-false::before {
    background: var(--verdict-false);
    box-shadow: 0 0 20px var(--verdict-false), 0 0 40px rgba(255, 51, 102, 0.3);
}
.fact-card.verdict-uncertain::before {
    background: var(--verdict-uncertain);
    box-shadow: 0 0 20px var(--verdict-uncertain), 0 0 40px rgba(255, 184, 0, 0.3);
}
.fact-card.verdict-partial::before {
    background: var(--verdict-partial);
    box-shadow: 0 0 20px var(--verdict-partial), 0 0 40px rgba(255, 184, 0, 0.3);
}
.fact-card.verdict-misleading::before {
    background: var(--verdict-misleading);
    box-shadow: 0 0 20px var(--verdict-misleading), 0 0 40px rgba(255, 140, 43, 0.3);
}
.fact-card.verdict-disputed::before {
    background: var(--verdict-disputed);
    box-shadow: 0 0 20px var(--verdict-disputed), 0 0 40px rgba(143, 163, 184, 0.3);
}
.fact-card.verdict-unverifiable::before {
    background: var(--verdict-unverifiable);
    box-shadow: 0 0 20px var(--verdict-unverifiable), 0 0 40px rgba(154, 160, 166, 0.3);
}
.fact-card.analyzing::before {
    background: var(--accent);
    box-shadow: 0 0 20px var(--accent), 0 0 40px var(--accent-glow);
    animation: glow-pulse 2s ease infinite;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 15px var(--accent), 0 0 30px var(--accent-glow); }
    50% { box-shadow: 0 0 25px var(--accent), 0 0 50px var(--accent-glow); }
}

.fc-section-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.fc-claim {
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--text-primary);
}

.fc-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 16px 0;
}

/* ========== VERDICT BADGE ========== */
.verdict-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    transition: all 150ms ease;
}

.verdict-badge svg {
    width: 14px;
    height: 14px;
}

.verdict-badge.badge-true {
    background: var(--verdict-true-bg);
    color: var(--verdict-true);
    border-color: rgba(0, 255, 136, 0.3);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.15);
}

.verdict-badge.badge-false {
    background: var(--verdict-false-bg);
    color: var(--verdict-false);
    border-color: rgba(255, 51, 102, 0.3);
    box-shadow: 0 0 12px rgba(255, 51, 102, 0.15);
}

.verdict-badge.badge-uncertain {
    background: var(--verdict-uncertain-bg);
    color: var(--verdict-uncertain);
    border-color: rgba(255, 184, 0, 0.3);
    box-shadow: 0 0 12px rgba(255, 184, 0, 0.15);
}

.verdict-badge.badge-partial {
    background: var(--verdict-partial-bg);
    color: var(--verdict-partial);
    border-color: rgba(255, 184, 0, 0.3);
    box-shadow: 0 0 12px rgba(255, 184, 0, 0.15);
}

.verdict-badge.badge-misleading {
    background: var(--verdict-misleading-bg);
    color: var(--verdict-misleading);
    border-color: rgba(255, 140, 43, 0.3);
    box-shadow: 0 0 12px rgba(255, 140, 43, 0.15);
}

.verdict-badge.badge-disputed {
    background: var(--verdict-disputed-bg);
    color: var(--verdict-disputed);
    border-color: rgba(143, 163, 184, 0.3);
    box-shadow: 0 0 12px rgba(143, 163, 184, 0.15);
}

.verdict-badge.badge-unverifiable {
    background: var(--verdict-unverifiable-bg);
    color: var(--verdict-unverifiable);
    border-color: rgba(154, 160, 166, 0.3);
    box-shadow: 0 0 12px rgba(154, 160, 166, 0.15);
}

/* Canale ERRORE: stato di sistema, non un verdetto. Stile neutro/smorzato. */
.verdict-badge.badge-error {
    background: rgba(120, 120, 130, 0.10);
    color: var(--text-muted);
    border-color: rgba(120, 120, 130, 0.3);
    box-shadow: none;
}
.fact-card.fact-card-error {
    opacity: 0.85;
}
.fact-card.fact-card-error::before {
    background: var(--text-muted);
    box-shadow: none;
    opacity: 0.5;
}

/* Motivazione verdetto: perche' QUESTO e non quello adiacente */
.fc-rationale {
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 6px;
    padding-left: 10px;
    border-left: 2px solid var(--border);
}

.fc-result {
    font-size: var(--text-sm);
    line-height: 1.75;
    color: var(--text-secondary);
}

.fc-result strong {
    color: var(--text-primary);
    font-weight: 600;
}

.fc-claim-title {
    font-family: var(--font-display);
}

/* ========== COLLAPSIBLE CARD ========== */
.fc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding-left: 8px;
}

.fc-header .verdict-badge {
    margin-bottom: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.fc-claim-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.fc-chevron {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: transform 200ms var(--ease-out);
}

.fact-card.expanded .fc-chevron {
    transform: rotate(180deg);
}

.fc-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms var(--ease-out), opacity 200ms ease;
    opacity: 0;
}

.fact-card.expanded .fc-card-body {
    max-height: 60vh;
    opacity: 1;
    overflow-y: auto;
}

.fact-card.analyzing .fc-card-body {
    max-height: 60vh;
    opacity: 1;
    overflow-y: auto;
}

.fc-card-body-inner {
    padding-top: 16px;
    padding-left: 8px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 14px;
}

/* ========== ANALYZING STATE ========== */
.fc-analyzing {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.analyzing-dots {
    display: flex;
    gap: 4px;
}

.analyzing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: dot-pulse 1.4s ease infinite;
    box-shadow: 0 0 8px var(--accent-glow);
}

.analyzing-dots span:nth-child(2) { animation-delay: 0.15s; }
.analyzing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot-pulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.1); }
}

/* ========== STATUS BAR ========== */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(13, 13, 18, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-subtle);
    padding: 10px var(--space-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--verdict-uncertain);
    transform: translateY(100%);
    transition: transform 200ms var(--ease-out);
}

.status-bar.visible {
    transform: translateY(0);
}

.status-bar .analyzing-dots span {
    background: var(--verdict-uncertain);
    box-shadow: 0 0 8px rgba(255, 184, 0, 0.3);
}

/* ========== TRANSCRIPT PANEL (left column) ========== */
.transcript-panel {
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transition: opacity 200ms var(--ease-out), visibility 200ms;
}

.transcript-panel.visible {
    visibility: visible;
    opacity: 1;
}

.transcript-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
}

.transcript-header .fc-section-label {
    margin-bottom: 0;
}

.transcript-toggle {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    transition: color 200ms ease, background 200ms ease;
}

.transcript-toggle:hover {
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

.transcript-body {
    font-family: var(--font-mono); /* Hacker terminal style */
    font-size: 13px; /* Slightly smaller for mono */
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.7); /* Muted tech color */
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    transition: max-height 300ms var(--ease-out);
}

.transcript-body.collapsed {
    max-height: 0;
    overflow: hidden;
    flex: 0;
}

/* Placeholder quando transcript vuoto */
.transcript-body:empty::before {
    content: 'Listening...';
    color: var(--text-muted);
    font-style: italic;
    font-size: var(--text-sm);
    display: block;
    text-align: center;
    padding: 40px 20px;
}

.transcript-body span.chunk-text {
    display: inline;
}

.transcript-body span.chunk-text + span.chunk-text::before {
    content: ' ';
}

.transcript-body span.new-chunk {
    animation: highlight-fade 2s ease-out;
}

@keyframes highlight-fade {
    from { background: var(--accent-dim); border-radius: 2px; }
    to { background: transparent; }
}

/* ========== TRANSCRIPT TIMESTAMP ========== */
.transcript-timestamp {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    opacity: 0.7;
    margin-right: 4px;
}

/* ========== PREVIEW LIVE ========== */
.preview-text {
    display: inline;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.8;
}
.preview-text .preview-content {
    animation: pulse-preview 1.5s ease-in-out infinite;
}
.preview-text::after {
    content: '█';
    animation: blink-cursor 1s step-start infinite;
    margin-left: 4px;
    color: var(--accent);
}
@keyframes pulse-preview {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
@keyframes blink-cursor {
    50% { opacity: 0; }
}

/* ========== FACT-CHECKED HIGHLIGHT ========== */
.chunk-text.fact-checking {
    background: rgba(255, 184, 0, 0.2);
    border-left: 2px solid var(--verdict-uncertain);
    padding-left: 6px;
    margin-left: -8px;
    padding-right: 4px;
    border-radius: 2px;
    animation: pulse-checking 1.5s ease-in-out infinite;
}
@keyframes pulse-checking {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.chunk-text.fact-checked {
    background: rgba(139, 92, 246, 0.12);
    border-left: 2px solid var(--accent);
    padding-left: 6px;
    margin-left: -8px;
    padding-right: 4px;
    border-radius: 2px;
}

.chunk-text.fact-checked-true {
    background: rgba(34, 197, 94, 0.12);
    border-left-color: #22c55e;
}

.chunk-text.fact-checked-false {
    background: rgba(239, 68, 68, 0.12);
    border-left-color: #ef4444;
}

.chunk-text.fact-checked-uncertain {
    background: rgba(251, 191, 36, 0.12);
    border-left-color: #fbbf24;
}

.chunk-text.fact-checked-partial {
    background: rgba(255, 184, 0, 0.12);
    border-left-color: var(--verdict-partial);
}

.chunk-text.fact-checked-misleading {
    background: rgba(255, 140, 43, 0.12);
    border-left-color: var(--verdict-misleading);
}

.chunk-text.fact-checked-disputed {
    background: rgba(143, 163, 184, 0.12);
    border-left-color: var(--verdict-disputed);
}

.chunk-text.fact-checked-unverifiable {
    background: rgba(154, 160, 166, 0.12);
    border-left-color: var(--verdict-unverifiable);
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== RESPONSIVE ========== */

/* Tablet e sotto (< 768px) */
@media (max-width: 768px) {
    .feed {
        max-width: 720px;
    }
    .header {
        /* Hide progress stats to save vertical space */
        .progress-container { display: none !important; }
    }
    .header-nav { display: none; }
    
    /* Hide audio toggle globally on mobile when active, show transcript btn */
    .rec-dock.visible .audio-source-toggle {
        display: none;
    }
    .rec-dock.visible .mobile-transcript-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 20px;
        padding: 8px 12px;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: background 0.2s ease;
    }
    
    /* Bottom Sheet styling for Transcript */
    .transcript-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 75vh;
        max-height: none;
        z-index: 500;
        margin: 0;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
        opacity: 1;
        visibility: visible;
        padding-top: 24px;
        background: var(--bg-surface);
    }
    
    .transcript-panel::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255,255,255,0.2);
        border-radius: 4px;
    }
    
    .transcript-panel.sheet-open {
        transform: translateY(0);
    }
    
    /* Dim overlay for bottom sheet */
    .sheet-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(2px);
        z-index: 400;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .sheet-overlay.visible {
        display: block;
        opacity: 1;
    }
    
    .transcript-toggle {
        display: none;
    }
    
    .user-dropdown {
        right: -10px;
    }
    /* Modali piu' stretti su tablet */
    .auth-modal, .dashboard-modal {
        padding: 24px;
    }
}


/* Mobile (< 480px) */
@media (max-width: 480px) {
    .header { height: 52px; }
    .feed {
        padding: 16px 16px 0;
        margin: 0 auto;
        gap: 14px;
    }
    .cards-column {
        padding-bottom: 24px;
    }
    .fact-card { padding: 14px; }
    /* On mobile, slightly smaller button in initial state */
    .rec-btn { width: 72px; height: 72px; border-width: 3px; }
    .rec-btn-dot { width: 28px; height: 28px; }
    .rec-dock.recording .rec-btn-dot { width: 20px; height: 20px; }
    .rec-dock.visible {
        min-height: 60px;
        padding: 0 16px;
    }
    #waveform-canvas { width: 120px; height: 32px; }

    /* Compatta la progress bar su mobile */
    .progress-bar { width: 60px; }
    .progress-label { display: none; }

    /* Modali full-width su mobile */
    .auth-modal {
        width: 95%;
        padding: 20px;
        border-radius: 12px;
    }
    .dashboard-modal {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
        border-radius: 12px;
    }

    /* Dashboard stats a tutta larghezza su mobile piccoli */
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Empty state - adjust for mobile */
    .empty-state { padding: var(--space-md); padding-top: 25dvh; }

    /* Consent banner */
    .consent-banner { padding: 16px; }
    .consent-categories { gap: 8px; }
    .consent-category { padding: 8px 10px; font-size: 12px; }
    .consent-actions { gap: 8px; }
    .consent-btn { padding: 10px 16px; font-size: 12px; }

    /* Quota modal */
    .quota-price { font-size: 28px; }
    .quota-features li { font-size: 13px; }

    .transcript-body { font-size: 13px; }

    /* User dropdown accessibile */
    .user-dropdown { min-width: 180px; }
    .user-dropdown-item { padding: 12px 16px; min-height: 44px; }

    /* Footer piu' compatto */
    .site-footer { padding: 10px 12px; font-size: 7px; }
    .site-footer .footer-sep { margin: 0 4px; }
}

/* Small mobile (< 360px) */
@media (max-width: 360px) {
    .header { height: 48px; }
    .feed { padding: 12px 12px 0; gap: 10px; }
    .cards-column { max-height: none; padding-bottom: 24px; }
    .fact-card { padding: 12px; }
    .rec-btn { width: 64px; height: 64px; }
    .rec-btn-dot { width: 24px; height: 24px; }
    .rec-dock.recording .rec-btn-dot { width: 18px; height: 18px; }
    .rec-dock.visible { min-height: 56px; }
    #waveform-canvas { width: 100px; height: 28px; }
    /* Nascondi progress su schermi molto piccoli */
    .progress-container.visible { display: none; }
    /* Auth modal ancora piu' stretto */
    .auth-modal, .dashboard-modal { padding: 16px; }
    .auth-google-btn { font-size: 13px; padding: 10px; }
    .auth-tab { padding: 8px; font-size: 12px; }
    .auth-input { padding: 10px 12px; font-size: 13px; }
    /* Consent tutto verticale */
    .consent-actions { flex-direction: column; }
    .consent-btn { width: 100%; text-align: center; }
}

/* Landscape mobile - compact layout */
@media (max-height: 500px) and (orientation: landscape) {
    .header { height: 44px; }
    .feed { padding-top: 12px; padding-bottom: 0px; }
    .empty-state { min-height: calc(100dvh - 44px - 120px); gap: 12px; padding: 20px; }
    .cards-column { max-height: none; padding-bottom: 12px; }
    .rec-btn { width: 56px; height: 56px; border-width: 2px; }
    .rec-btn-dot { width: 20px; height: 20px; }
    .rec-dock.recording .rec-btn-dot { width: 16px; height: 16px; }
    .rec-dock.visible { min-height: 52px; padding: 0 12px; }
    #waveform-canvas { width: 80px; height: 24px; }
    .site-footer { padding: 6px 12px; font-size: 7px; }
    /* Nascondi transcript in landscape */
    .transcript-panel { display: none; }
}

/* Tall phone screens (notch/dynamic island) */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: env(safe-area-inset-top, 0px);
    }
}

/* ========== FOCUS VISIBLE ========== */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ========== SELECTION ========== */
::selection {
    background: var(--accent-dim);
    color: var(--text-primary);
}

/* ========== FOOTER ========== */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: right;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    font-size: 7px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-deep);
    z-index: 50;
}

.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 200ms;
}

.site-footer a:hover {
    color: var(--accent);
}

.site-footer .footer-sep {
    margin: 0 8px;
}

/* Nasconde footer quando rec-dock visibile */
body:has(.rec-dock.visible) .site-footer {
    display: none;
}

/* ========== GDPR CONSENT BANNER ========== */
.consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    padding: var(--space-md) var(--space-md);
    transform: translateY(100%);
    transition: transform 400ms var(--ease-out);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.consent-banner.visible {
    transform: translateY(0);
}

.consent-banner-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.consent-banner-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.consent-banner-text a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consent-banner-text a:hover {
    color: var(--text-primary);
}

.consent-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.consent-category {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    min-height: 44px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    transition: border-color 200ms;
}

.consent-category:hover {
    border-color: var(--accent);
}

.consent-category.disabled {
    opacity: 0.5;
    cursor: default;
}

.consent-category input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 200ms;
}

.consent-category input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.consent-category input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: solid var(--bg-deep);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.consent-category input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: default;
}

.consent-category-label {
    font-family: var(--font-body);
    font-weight: 500;
}

.consent-category-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}

.consent-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.consent-btn {
    font-size: 13px;
    padding: 10px 20px;
    min-height: 44px;
    white-space: nowrap;
}

.consent-btn-accept {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent);
}

.consent-btn-accept:hover {
    box-shadow: 0 0 16px var(--accent-glow);
}

.consent-btn-reject {
    background: transparent;
    color: var(--text-secondary);
}

.consent-btn-reject:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.consent-btn-save {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.consent-btn-save:hover {
    border-color: var(--accent);
}

@media (min-width: 640px) {
    .consent-banner-inner {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }
    .consent-banner-text {
        flex: 1;
        min-width: 240px;
    }
    .consent-actions {
        flex-shrink: 0;
    }
}