/**
 * App Common Styles
 * Shared layout, headers, cards, tabs, buttons, forms, and tables
 * Load after base.css and navigation.css
 */

/* Layout shells */
.page-shell,
.dashboard-container,
.overview-container,
.manage-container,
.settings-container,
.hub-container,
.main-container {
    max-width: var(--content-max-width, 1800px);
    padding: var(--content-padding, 2rem);
    padding-left: calc(var(--content-padding, 2rem) + 1rem);
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 1200px) {
    .page-shell,
    .dashboard-container,
    .overview-container,
    .manage-container,
    .settings-container,
    .hub-container,
    .main-container {
        padding: var(--content-padding-md, 1.5rem);
        padding-left: calc(var(--content-padding-md, 1.5rem) + 0.5rem);
    }
}

@media (max-width: 768px) {
    .page-shell,
    .dashboard-container,
    .overview-container,
    .manage-container,
    .settings-container,
    .hub-container,
    .main-container {
        padding: var(--content-padding-sm, 1.25rem);
        padding-left: var(--content-padding-sm, 1.25rem);
    }
}

/* Section wrapper */
.section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius, 12px);
    padding: 2rem;
}

.section__title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

/* Gradient headers (scoring style) */
.page-header,
.dashboard-header,
.overview-header,
.manage-header,
.surveys-header,
.settings-header,
.edit-header,
.scoring-header,
.hub-header,
.presentation-header {
    background: var(--header-gradient, linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #1a4971 100%));
    border-radius: var(--header-radius, 12px);
    padding: var(--header-padding, 2.5rem 2rem);
    margin: 0 0 2rem 0;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    box-shadow: var(--header-shadow, 0 4px 20px rgba(0, 0, 0, 0.25));
}

.page-header::after,
.dashboard-header::after,
.overview-header::after,
.manage-header::after,
.surveys-header::after,
.settings-header::after,
.edit-header::after,
.scoring-header::after,
.hub-header::after,
.presentation-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.page-header .header-content,
.dashboard-header .header-content,
.overview-header .header-content,
.manage-header .header-content,
.surveys-header .header-content,
.settings-header .header-content,
.edit-header .header-content,
.scoring-header .header-content,
.hub-header .header-content,
.presentation-header .header-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.page-header .header-content::before,
.dashboard-header .header-content::before,
.overview-header .header-content::before,
.manage-header .header-content::before,
.surveys-header .header-content::before,
.settings-header .header-content::before,
.edit-header .header-content::before,
.scoring-header .header-content::before,
.hub-header .header-content::before,
.presentation-header .header-content::before {
    content: '';
    flex-shrink: 0;
    width: var(--header-icon-size, 80px);
    height: var(--header-icon-size, 80px);
    border-radius: var(--border-radius);
    background-color: rgba(255, 255, 255, 0.15);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 40px;
    background-image: var(--header-icon, none);
}

.page-header h1,
.dashboard-header h1,
.overview-header h1,
.manage-header h1,
.surveys-header h1,
.settings-header h1,
.edit-header h1,
.scoring-header h1,
.hub-header h1,
.presentation-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #ffffff;
}

.page-header .subtitle,
.dashboard-header .subtitle,
.overview-header .subtitle,
.manage-header .subtitle,
.surveys-header .subtitle,
.settings-header .subtitle,
.edit-header .subtitle,
.scoring-header .subtitle,
.hub-header .subtitle,
.presentation-header .subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    margin: 0;
    font-weight: 400;
}

/* Page-specific header icons */
.dashboard-header .header-content::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z'/%3E%3C/svg%3E");
}

.overview-header .header-content::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
}

.manage-header .header-content::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01'/%3E%3C/svg%3E");
}

.settings-header .header-content::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.scoring-header .header-content::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z'/%3E%3C/svg%3E");
}

.hub-header .header-content::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4'/%3E%3C/svg%3E");
}

.surveys-header .header-content::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'/%3E%3C/svg%3E");
}

.edit-header .header-content::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z'/%3E%3C/svg%3E");
}

.presentation-header .header-content::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath d='M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z'/%3E%3C/svg%3E");
}

/* Header actions/tabs */
.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.header-navigation {
    display: flex;
    gap: 0.5rem;
    margin: 1.25rem 0 1.5rem 0;
    flex-wrap: wrap;
}

.nav-tab {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-sm);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition, all 0.3s ease);
    text-align: center;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.nav-tab.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

/* Header stats */
.header-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-card, var(--bg-secondary));
    border-radius: var(--border-radius, 12px);
    padding: 1rem 1.5rem;
    min-width: 110px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition, all 0.3s ease);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: var(--bg-tertiary);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.stat-card.critical::before { background: var(--color-danger, #ef4444); }
.stat-card.high::before { background: var(--color-warning, #f97316); }
.stat-card.medium::before { background: var(--color-warning, #eab308); }
.stat-card.low::before { background: var(--color-success, #22c55e); }

.stat-card.critical .stat-value { color: var(--color-danger, #ef4444); }
.stat-card.high .stat-value { color: var(--color-warning, #f97316); }
.stat-card.medium .stat-value { color: var(--color-warning, #eab308); }
.stat-card.low .stat-value { color: var(--color-success, #22c55e); }

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1rem;
    transition: transform var(--transition-normal, 0.3s ease);
}

.back-link:hover {
    transform: translateX(-4px);
}

/* Cards */
.card {
    background: var(--bg-card, var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius, 12px);
    padding: 1.5rem;
    transition: var(--transition, all 0.2s ease);
}

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

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-normal, 0.3s ease);
    text-decoration: none;
    color: inherit;
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.95rem; }
.btn-lg { padding: 1rem 1.75rem; font-size: 1.05rem; }

.btn-primary {
    background: var(--btn-primary-bg, #6366f1);
    color: var(--btn-primary-text, #ffffff);
    border: 1px solid var(--btn-primary-bg, #6366f1);
}

.btn-primary:hover {
    background: var(--btn-primary-bg-hover, #4f46e5);
    border-color: var(--btn-primary-bg-hover, #4f46e5);
}

.btn-secondary {
    background: var(--btn-secondary-bg, transparent);
    color: var(--btn-secondary-text, #e2e8f0);
    border: 1px solid var(--btn-secondary-border, #334155);
}

.btn-secondary:hover {
    background: var(--btn-secondary-bg-hover, #1f2937);
    color: var(--btn-secondary-text-hover, #cbd5e1);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
    background: var(--bg-tertiary);
}

.btn-danger {
    background: var(--color-danger, #ef4444);
    color: #fff;
    border: 1px solid var(--color-danger, #ef4444);
}

.btn-danger:hover { background: var(--color-danger-hover, #dc2626); }

.btn-success {
    background: var(--color-success, #22c55e);
    color: #fff;
    border: 1px solid var(--color-success, #22c55e);
}

.btn-success:hover { background: var(--color-success-hover, #16a34a); }

/* Badges / pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab {
    padding: 0.65rem 1.25rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
    font-weight: 600;
}

.tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Forms */
.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-normal, 0.3s ease);
    font-family: inherit;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--accent-primary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.form-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.form-error {
    color: var(--color-danger, #ef4444);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius, 12px);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.data-table thead th {
    text-align: left;
    padding: 0.9rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

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

/* Empty / no-data */
.empty-state,
.no-data-card {
    background: var(--bg-card, var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    text-align: center;
}

.empty-state h2,
.no-data-card h2 {
    font-size: 1.5rem;
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
}

.empty-state p,
.no-data-card p {
    color: var(--text-secondary);
    margin: 0 0 1.25rem 0;
    line-height: 1.5;
}

/* Migrated inline styles */
.is-hidden { display: none; }
.muted-note { margin-top:12px; color:#6b7280; }
.hide-init { display: none; }
.spacer-top { margin-top: 2rem; }
.w-0 { width: 0%; }

/* Selector cards (migrated from inline) */
.selector-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; padding: 1rem 0; }
.selector-card { text-decoration: none; color: inherit; padding: 1.5rem; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); transition: all 0.2s; background: var(--bg-secondary); }
.selector-card:hover { border-color: var(--text-muted); transform: translateY(-2px); }
.selector-card h3 { margin: 0 0 0.5rem 0; color: var(--text-primary); }
.selector-card p { margin: 0; color: var(--text-secondary); font-size: 0.875rem; }
.selector-card .selector-actions { display: flex; gap: 1rem; margin-top: 1rem; }

/* ========================================
   Modal Component
   Base styles for all modals across the app
   ======================================== */

/* Modal overlay - covers entire screen */
.modal-overlay,
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.visible,
.modal.visible {
    display: flex;
    backdrop-filter: blur(2px);
}

/* Modal content container */
.modal-content {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius, 12px);
    box-shadow: var(--shadow-xl, 0 20px 60px rgba(0, 0, 0, 0.3));
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Modal sizes */
.modal-content.modal-sm { max-width: 360px; }
.modal-content.modal-lg { max-width: 640px; }
.modal-content.modal-xl { max-width: 800px; }

/* Modal header */
.modal-header {
    padding: var(--card-gap, 1.5rem);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap-md, 1rem);
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-subtitle {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Modal close button */
.modal-close {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--border-radius-sm, 8px);
    transition: var(--transition, all 0.2s ease);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Modal body */
.modal-body {
    padding: var(--card-gap, 1.5rem);
    overflow-y: auto;
    flex: 1;
}

/* Modal footer */
.modal-footer {
    padding: var(--card-gap, 1.5rem);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--gap-md, 1rem);
}

/* Modal list (for selection modals) */
.modal-list {
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm, 0.75rem);
    max-height: 300px;
    overflow-y: auto;
}

.modal-list button,
.modal-list-item {
    width: 100%;
    padding: var(--gap-md, 1rem);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm, 8px);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
    font-size: 0.95rem;
}

.modal-list button:hover,
.modal-list-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

/* ========================================
   Section Header Component
   Standard header for content sections
   ======================================== */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap-md, 1rem);
    margin-bottom: var(--card-gap, 1.5rem);
    flex-wrap: wrap;
}

.section-header h2,
.section-header h3 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
}

.section-header h2 { font-size: 1.5rem; }
.section-header h3 { font-size: 1.25rem; }

.section-header p {
    margin: 0.25rem 0 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: var(--gap-sm, 0.75rem);
}

.emulator-banner { display:none; position:fixed; bottom:0; left:0; right:0; background:#dc2626; color:white; text-align:center; padding:0.5rem; font-size:0.85rem; z-index:9999; }

/* Loading gate - requires explicit opt-in via data-loading-visual attribute */
.loading-mask-target {
    position: relative;
}

/* Smooth transitions for loading state changes */
.loading-mask-target > :not(.loading-overlay) {
    transition: opacity 0.2s ease;
}

.loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6), rgba(51, 65, 85, 0.6));
    align-items: center;
    justify-content: center;
    z-index: 20;
}

/* Only show overlay when explicitly opted in via data attribute */
.loading-mask-target.is-loading[data-loading-visual] .loading-overlay {
    display: flex;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    color: #fff;
    text-align: center;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

.loading-message {
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Only dim content when explicitly opted in AND loading */
.loading-mask-target.is-loading[data-loading-visual] > :not(.loading-overlay) {
    opacity: 0.2;
    pointer-events: none;
}

.loading-mask-target.has-error[data-loading-visual] > :not(.loading-overlay) {
    opacity: 0.4;
}

/* Explicitly restore opacity when ready */
.loading-mask-target.is-ready > :not(.loading-overlay) {
    opacity: 1;
}

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