/* ========================================
   STRATEGIC INTELLIGENCE DASHBOARD
   Design System & Component Styles
   ======================================== */

:root {
    /* Base Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #0e0e16;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a26;
    --bg-surface: #16162266;
    --border: #1e1e2e;
    --border-hover: #2a2a3e;
    --border-subtle: rgba(30, 30, 46, 0.5);

    /* Text */
    --text-primary: #e4e4ef;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --text-bright: #ffffff;

    /* Accents */
    --accent-ai: #7c5cfc;
    --accent-ai-dim: rgba(124, 92, 252, 0.12);
    --accent-energy: #00d4aa;
    --accent-energy-dim: rgba(0, 212, 170, 0.12);
    --accent-gcc: #f59e0b;
    --accent-gcc-dim: rgba(245, 158, 11, 0.12);
    --accent-green: #22c55e;
    --accent-yellow: #eab308;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;

    /* Glass */
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);

    /* Sidebar */
    --sidebar-width: 240px;
    --sidebar-collapsed: 60px;

    /* Gradients */
    --accent-gradient: linear-gradient(135deg, var(--accent-ai), #5b3cd9);
    --accent-primary: var(--accent-ai);
    --border-color: var(--border);
    --bg-hover: var(--bg-card-hover);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-med: 0.25s ease;
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* ========================================
   LAYOUT: SIDEBAR + CONTENT
   ======================================== */
.app-layout {
    display: flex;
    height: 100vh;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width var(--transition-med);
    overflow: hidden;
    z-index: 100;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.hidden {
    width: 0;
    border-right: none;
}

/* Mobile overlay sidebar */
.sidebar.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    z-index: 300;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}

/* Sidebar backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 250;
    opacity: 0;
    transition: opacity var(--transition-med);
}

.sidebar-backdrop.visible {
    display: block;
    opacity: 1;
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    min-height: 60px;
}

.sidebar-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-ai), var(--accent-energy));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: -0.02em;
    transition: opacity var(--transition-fast);
}

.sidebar.collapsed .sidebar-brand,
.sidebar.hidden .sidebar-brand {
    opacity: 0;
    width: 0;
}

/* Sidebar Toggle */
.sidebar-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
    background: var(--glass);
}

.sidebar.collapsed .sidebar-toggle {
    margin-left: 0;
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-section-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 1rem 1rem 0.4rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-section-label {
    opacity: 0;
    height: 0;
    padding: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 450;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--glass);
}

.nav-item.active {
    color: var(--text-bright);
    background: rgba(124, 92, 252, 0.08);
    border-left-color: var(--accent-ai);
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.nav-item .nav-label {
    overflow: hidden;
    transition: opacity var(--transition-fast);
}

.sidebar.collapsed .nav-label {
    opacity: 0;
    width: 0;
}

/* Sub-items */
.nav-item.sub {
    padding-left: 2.75rem;
    font-size: 0.78rem;
}

.sidebar.collapsed .nav-item.sub {
    padding-left: 1rem;
}

.nav-item.sub .nav-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-dot.ai {
    background: var(--accent-ai);
}

.nav-dot.energy {
    background: var(--accent-energy);
}

.nav-dot.gcc {
    background: var(--accent-gcc);
}

/* Sidebar Footer — User Profile */
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.25rem;
    margin-bottom: 0.4rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.user-info {
    overflow: hidden;
    min-width: 0;
}

.user-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.45rem 0.5rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.06);
}

.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn .nav-label {
    display: none;
}

.sidebar.collapsed .sidebar-footer {
    padding: 0.5rem 0.35rem;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
}

.sidebar.collapsed .logout-btn {
    justify-content: center;
    padding: 0.45rem;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.main-content::-webkit-scrollbar {
    width: 5px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Page Header */
.page-header {
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.page-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--glass);
}

/* Page Body */
.page-body {
    padding: 1.5rem 2rem;
}

/* ========================================
   PORTLET: BASE
   ======================================== */
.portlet {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

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

.portlet-header {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.portlet-body {
    padding: 0;
}

/* ========================================
   PORTLET: ARTICLE CARD
   ======================================== */
.article-portlet {
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.article-portlet.ai {
    background: linear-gradient(135deg, var(--accent-ai-dim) 0%, transparent 60%);
    border-color: rgba(124, 92, 252, 0.12);
}

.article-portlet.energy {
    background: linear-gradient(135deg, var(--accent-energy-dim) 0%, transparent 60%);
    border-color: rgba(0, 212, 170, 0.12);
}

.article-portlet.gcc {
    background: linear-gradient(135deg, var(--accent-gcc-dim) 0%, transparent 60%);
    border-color: rgba(245, 158, 11, 0.12);
}

.article-badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.6rem;
}

.article-badge.ai {
    background: var(--accent-ai-dim);
    color: var(--accent-ai);
    border: 1px solid rgba(124, 92, 252, 0.2);
}

.article-badge.energy {
    background: var(--accent-energy-dim);
    color: var(--accent-energy);
    border: 1px solid rgba(0, 212, 170, 0.2);
}

.article-badge.gcc {
    background: var(--accent-gcc-dim);
    color: var(--accent-gcc);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.article-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.article-status-chip {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.article-status-chip.published {
    color: var(--accent-green);
    background: rgba(34, 197, 94, 0.1);
}

.article-status-chip.approved {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.article-status-chip.draft {
    color: var(--accent-yellow);
    background: rgba(234, 179, 8, 0.1);
}

.article-title-link {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    cursor: pointer;
}

.article-title-link:hover {
    color: var(--text-bright);
    text-decoration: underline;
}

.article-preview {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.article-metrics-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-subtle);
}

.article-metrics-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.article-metric {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.article-metric.muted {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.7rem;
}

.article-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.article-status-chip .article-icon {
    width: 7px;
    height: 7px;
}

.article-linkedin-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(10, 102, 194, 0.1);
    color: #0a66c2;
    transition: all var(--transition-fast);
    border: 1px solid rgba(10, 102, 194, 0.15);
    text-decoration: none;
}

.article-linkedin-link:hover {
    background: rgba(10, 102, 194, 0.2);
    border-color: rgba(10, 102, 194, 0.3);
    transform: translateY(-1px);
}

.linkedin-icon {
    width: 14px;
    height: 14px;
}

.no-article-msg {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ========================================
   PORTLET: NEWS LIST
   ======================================== */
.news-list-portlet {
    max-height: 500px;
    overflow-y: auto;
}

.news-list-portlet.full-height {
    max-height: none;
}

.news-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    overflow: hidden;
}

.news-item:hover {
    background: var(--bg-card-hover);
}

.news-item:last-child {
    border-bottom: none;
}

.news-score-box {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--border);
}

.news-score-box.green {
    color: var(--accent-green);
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.15);
}

.news-score-box.yellow {
    color: var(--accent-yellow);
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.15);
}

.news-score-box.red {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
}

.news-content {
    flex: 1;
    min-width: 0;
}

.news-title-text {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-item:hover .news-title-text {
    color: var(--text-bright);
}

.news-why-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-date-text {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.traffic-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.traffic-dot.GREEN {
    background: var(--accent-green);
}

.traffic-dot.YELLOW {
    background: var(--accent-yellow);
}

.traffic-dot.RED {
    background: var(--accent-red);
}

.traffic-dot.GRAY {
    background: var(--text-muted);
}

/* ========================================
   PORTLET: STATS BAR
   ======================================== */
.stats-bar {
    display: flex;
    gap: 0;
}

.stat-item {
    flex: 1;
    padding: 1rem 1.25rem;
    border-right: 1px solid var(--border);
    text-align: center;
}

.stat-item:last-child {
    border-right: none;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
}

/* ========================================
   PORTLET: ARTICLES TABLE
   ======================================== */
.articles-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.articles-table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.articles-table thead th:hover {
    color: var(--text-secondary);
}

.articles-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.articles-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.articles-table tbody tr:last-child {
    border-bottom: none;
}

.articles-table td {
    padding: 0.7rem 1rem;
    vertical-align: middle;
}

.status-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.published {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-green);
}

.status-badge.draft {
    background: rgba(234, 179, 8, 0.1);
    color: var(--accent-yellow);
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

.topic-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
}

.metric-cell {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.metric-cell.empty {
    color: var(--text-muted);
    font-weight: 400;
}

/* ========================================
   ARTICLES PAGE: TOOLBAR, TABS, FILTERS
   ======================================== */
.articles-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.articles-search {
    flex: 1;
    max-width: 320px;
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.articles-search:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

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

.articles-vertical-filters {
    display: flex;
    gap: 0.35rem;
}

.vert-filter-btn {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.vert-filter-btn:hover {
    background: var(--glass);
    border-color: var(--text-muted);
}

.vert-filter-btn.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    font-weight: 600;
}

.articles-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.articles-tab {
    font-size: 0.77rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.articles-tab:hover {
    color: var(--text-secondary);
}

.articles-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    font-weight: 600;
}

.vertical-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 0.85rem;
    border-radius: 6px;
    background: var(--glass);
}

.vertical-icon-badge.ai {
    background: rgba(99, 102, 241, 0.12);
}

.vertical-icon-badge.energy {
    background: rgba(245, 158, 11, 0.12);
}

.vertical-icon-badge.gcc {
    background: rgba(34, 197, 94, 0.12);
}

.status-badge.approved {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

/* ========================================
   PORTLET: SETTINGS
   ======================================== */
.settings-section {
    margin-bottom: 2rem;
}

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

.settings-section-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.settings-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.settings-field.full-width {
    grid-column: span 2;
}

.settings-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.settings-value {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Fira Code', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-value.masked {
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

/* Settings inputs */
.settings-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--accent-blue);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Fira Code', monospace;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.settings-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-toggle-vis {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
}

.btn-toggle-vis:hover {
    background: var(--surface-card);
}

/* Settings action buttons */
.btn-settings {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: var(--text-secondary);
}

.btn-settings-edit:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

.btn-settings-save {
    color: var(--accent-green);
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.08);
}

.btn-settings-save:hover {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.5);
}

.btn-settings-cancel:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* ========================================
   LAYOUT HELPERS
   ======================================== */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.two-columns>* {
    min-width: 0;
    overflow: hidden;
}

.three-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

.three-columns>* {
    min-width: 0;
    overflow: hidden;
}

.single-column {
    max-width: 900px;
    width: 100%;
}

.gap-md {
    gap: 1.25rem;
}

.flex-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mb-md {
    margin-bottom: 1.25rem;
}

.mb-sm {
    margin-bottom: 0.75rem;
}

/* Topic Cards for GW overview */
.topic-card {
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-card);
}

.topic-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.topic-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.topic-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.topic-card-icon.ai {
    background: var(--accent-ai-dim);
}

.topic-card-icon.energy {
    background: var(--accent-energy-dim);
}

.topic-card-icon.gcc {
    background: var(--accent-gcc-dim);
}

.topic-card-title {
    font-size: 1rem;
    font-weight: 700;
}

.topic-card-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.topic-card-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.topic-stat-num {
    font-weight: 700;
    margin-right: 0.25rem;
}

/* Empty State */
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.empty-state-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Add GWA placeholder */
.add-gwa-placeholder {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.add-gwa-placeholder:hover {
    border-color: var(--border-hover);
    color: var(--text-secondary);
}

.add-gwa-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.add-gwa-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.add-gwa-sub {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Status dot animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.status-dot-anim {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    display: inline-block;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

/* ========================================
   ARTICLE DETAIL PAGE
   ======================================== */
.back-link {
    font-size: 0.75rem;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--text-bright);
}

.article-detail-body {
    line-height: 1.8;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 2rem;
}

.article-detail-body h1.article-detail-h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 1.25rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.article-detail-body h2.article-detail-h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.article-detail-body p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.linkedin-master-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(10, 102, 194, 0.08);
    border: 1px solid rgba(10, 102, 194, 0.2);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.78rem;
    color: var(--accent-blue);
    line-height: 1.5;
}

.linkedin-master-notice svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* ========================================
   REASONING BOX (Agent-generated articles)
   ======================================== */
.reasoning-box {
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.08) 0%, rgba(124, 92, 252, 0.04) 100%);
    border-left: 4px solid var(--accent-primary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.reasoning-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.reasoning-icon {
    font-size: 1.2rem;
}

.reasoning-summary {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.reasoning-sources {
    margin-top: 16px;
}

.reasoning-sources-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.reasoning-sources-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reasoning-sources-list li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.reasoning-sources-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.reasoning-sources-list a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.reasoning-sources-list a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.source-badge {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.source-date {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 8px;
    opacity: 0.7;
}

/* Article action buttons */
.btn-article {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn-article:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

.btn-article.btn-edit.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: auto;
}

.btn-article.btn-edit.disabled:hover {
    border-color: var(--border);
    color: var(--text-muted);
    background: var(--surface-card);
}

.btn-article.btn-linkedin {
    color: #0a66c2;
    border-color: rgba(10, 102, 194, 0.3);
    background: rgba(10, 102, 194, 0.08);
}

.btn-article.btn-linkedin:hover {
    background: rgba(10, 102, 194, 0.15);
    border-color: rgba(10, 102, 194, 0.5);
}

.btn-article.btn-publish {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.08);
    font-weight: 600;
}

.btn-article.btn-publish:hover {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.15);
}

.btn-article.btn-publish:disabled {
    opacity: 0.7;
    cursor: wait;
}

.btn-article.btn-publish.success {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.6);
    background: rgba(34, 197, 94, 0.15);
}

.btn-article.btn-publish.error {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
}

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

    to {
        transform: rotate(360deg);
    }
}

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

.btn-article.btn-save {
    color: var(--accent-green);
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.08);
}

.btn-article.btn-save:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
}

.btn-article.btn-cancel {
    color: var(--text-muted);
}

/* Editor */
.article-detail-editor {
    padding: 0;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: rgba(124, 92, 252, 0.04);
}

.editor-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-ai);
    margin-right: auto;
}

.article-textarea {
    width: 100%;
    min-height: 500px;
    padding: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

/* Table title link */
.table-title-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.table-title-link:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   Best practice min width: 320px (iPhone SE)
   Breakpoints: 1200px (desktop), 768px (tablet), 480px (mobile)
   ======================================== */

/* Large desktop — content breathes */
@media (min-width: 1201px) {
    .page-body {
        padding: 1.5rem 2rem;
    }
}

/* Tablet / narrow desktop — stack grids, adjust padding */
@media (max-width: 1200px) {
    .two-columns {
        grid-template-columns: 1fr;
    }

    .three-columns {
        grid-template-columns: 1fr 1fr !important;
    }

    .page-body {
        padding: 1.25rem 1.25rem;
    }

    .page-header {
        padding: 1.25rem 1.25rem 0.85rem;
    }

    .single-column {
        max-width: 100%;
    }
}

/* Tablet — sidebar overlay */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        height: 100vh;
        z-index: 200;
    }

    .sidebar.collapsed,
    .sidebar.hidden {
        width: 0;
        border-right: none;
    }

    .main-content {
        width: 100%;
    }

    .three-columns {
        grid-template-columns: 1fr !important;
    }

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

    .page-body {
        padding: 1rem;
    }

    .page-header {
        padding: 1rem 1rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .page-header-right {
        width: 100%;
        justify-content: flex-end;
    }

    .settings-group {
        grid-template-columns: 1fr;
    }

    .articles-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .articles-search {
        max-width: 100%;
    }

    .articles-tabs {
        overflow-x: auto;
    }

    .settings-field.full-width {
        grid-column: span 1;
    }

    .article-portlet {
        padding: 1rem 1.15rem;
    }

    .stats-bar {
        flex-wrap: wrap;
    }

    .stat-item {
        flex: 1 1 calc(50% - 1px);
        border-bottom: 1px solid var(--border);
    }

    .stat-item:last-child {
        border-bottom: none;
    }

    .articles-table {
        font-size: 0.75rem;
    }

    .article-detail-body {
        padding: 1.25rem;
    }

    .linkedin-master-notice {
        font-size: 0.72rem;
    }
}

/* Mobile — minimal padding, inline elements stack */
@media (max-width: 480px) {
    body {
        min-width: 320px;
    }

    .page-body {
        padding: 0.75rem;
    }

    .page-header {
        padding: 0.75rem 0.75rem 0.6rem;
    }

    .page-title {
        font-size: 1rem;
    }

    .page-subtitle {
        font-size: 0.68rem;
    }

    .portlet {
        border-radius: 8px;
    }

    .article-portlet {
        padding: 0.85rem 1rem;
    }

    .article-title-link {
        font-size: 0.88rem;
    }

    .article-metrics-bar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .article-detail-body {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .article-detail-body h1.article-detail-h1 {
        font-size: 1.2rem;
    }

    .article-textarea {
        min-height: 300px;
        padding: 1rem;
        font-size: 0.8rem;
    }

    .btn-article {
        font-size: 0.7rem;
        padding: 0.35rem 0.65rem;
    }

    .stat-item {
        flex: 1 1 100%;
        padding: 0.75rem;
    }

    .news-item {
        padding: 0.6rem 0.85rem;
    }

    .news-score-box {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-icon {
    font-weight: 700;
    font-size: 0.9rem;
}

.toast-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.toast-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.toast-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #3b82f6;
}

/* ========================================
   DELETE BUTTON
   ======================================== */
.btn-article.btn-delete {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.25);
    background: transparent;
}

.btn-article.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
}

/* ========================================
   EDITOR FIELDS (Article Edit Mode)
   ======================================== */
.editor-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

.editor-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.editor-field-row {
    display: flex;
    gap: 1rem;
}

.editor-field-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.editor-input {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.editor-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.editor-select {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.editor-select:focus {
    border-color: var(--accent-blue);
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* ========================================
   PIPELINE BUTTONS
   ======================================== */
.btn-pipeline {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-pipeline:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

.btn-pipeline-main {
    color: var(--accent-green);
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.06);
}

.btn-pipeline-main:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
}

.btn-pipeline-live {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.06);
}

.btn-pipeline-live:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Pipeline status display */
.pipeline-status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.pipeline-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pipeline-status-dot.running {
    background: var(--accent-green);
    animation: pulse 1.5s infinite;
}

.pipeline-status-dot.idle {
    background: var(--text-muted);
}

.pipeline-log {
    margin-top: 0.5rem;
    max-height: 180px;
    overflow-y: auto;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.pipeline-log-line {
    padding: 0.2rem 0.75rem;
    font-size: 0.7rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    word-break: break-all;
}

.pipeline-log-line:last-child {
    border-bottom: none;
}

/* Settings action button (LinkedIn Connect etc) */
.btn-settings-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid rgba(10, 102, 194, 0.3);
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(10, 102, 194, 0.06);
    color: #0a66c2;
}

.btn-settings-action:hover {
    background: rgba(10, 102, 194, 0.15);
    border-color: rgba(10, 102, 194, 0.5);
}

/* Approved status badge */
.status-badge.approved {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

/* Article status chip approved */
.article-status-chip.approved {
    color: var(--accent-blue);
}

/* ========================================
   COVER IMAGE SECTION
   ======================================== */
.cover-image-section {
    margin-top: 1rem;
}

.cover-image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cover-image-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-regen-full {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.btn-regen-full:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.btn-regen-full:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cover-prompt-area {
    margin-bottom: 1rem;
}

.cover-prompt-textarea {
    width: 100%;
    min-height: 70px;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-card);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    line-height: 1.5;
    resize: vertical;
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
    margin-top: 0.35rem;
}

.cover-prompt-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* 2x2 image grid */
.cover-images-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.cover-images-loading,
.cover-images-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Each image card */
.cover-image-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    aspect-ratio: 1;
}

.cover-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.3s ease;
}

.cover-image-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Selection overlay */
.cover-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.cover-image-checkmark {
    font-size: 3rem;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* Selected state */
.cover-image-card.selected {
    border-color: #22c55e;
}

.cover-image-card.selected img {
    filter: grayscale(70%) brightness(0.6);
}

.cover-image-card.selected .cover-image-overlay {
    opacity: 1;
}

/* Responsive: stack on mobile */
@media (max-width: 600px) {
    .cover-images-grid {
        grid-template-columns: 1fr;
    }
}