/* CSS Custom Properties - Light theme (default) */
:root {
    --bg: #ffffff;
    --text: #1a1a2e;
    --card-bg: #f8f9fa;
    --accent: #2563eb;
    --accent-subtle: rgba(37, 99, 235, 0.1);
    --border: #e2e8f0;
    --text-muted: #64748b;
    --nav-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.08);
}

/* Dark theme overrides */
[data-theme="dark"] {
    --bg: #0d1117;
    --text: #e6edf3;
    --card-bg: #161b22;
    --accent: #58a6ff;
    --accent-subtle: rgba(88, 166, 255, 0.15);
    --border: #30363d;
    --text-muted: #8b949e;
    --nav-bg: #161b22;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

nav .nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav .nav-links a {
    color: var(--text-muted);
    font-weight: 500;
}

nav .nav-links a:hover {
    color: var(--text);
    text-decoration: none;
}

/* Nav dropdown */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: inherit;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.nav-dropdown-btn:hover {
    color: var(--text);
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 200;
    padding-top: 0.6rem;
}
/* Invisible bridge between button and menu to prevent hover gap */
.nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 0.5rem;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 400;
}
.nav-dropdown-menu a:hover {
    background: var(--accent-subtle, rgba(88,166,255,0.1));
    color: var(--accent);
}

#theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Main content */
main {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab {
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-muted);
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text);
    text-decoration: none;
    border-color: var(--accent);
}

.tab.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* Magazine Grid */
.magazine-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Featured Card */
.featured-card {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    min-height: 400px;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 20px,
            rgba(255, 255, 255, 0.03) 20px,
            rgba(255, 255, 255, 0.03) 22px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 20px,
            rgba(255, 255, 255, 0.03) 20px,
            rgba(255, 255, 255, 0.03) 22px
        ),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.featured-card a {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 400px;
    color: #ffffff;
}

.featured-card a:hover {
    text-decoration: none;
}

.featured-overlay {
    padding: 2rem;
    background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.7) 15%, rgba(0, 0, 0, 0.85) 100%);
    margin-top: auto;
    padding-top: 3rem;
}

.featured-title {
    font-size: 1.8rem;
    margin: 0.5rem 0;
    line-height: 1.3;
}

.featured-excerpt {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Sidebar Stack */
.sidebar-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}
.sidebar-stack .article-card {
    flex: 1;
}

/* Article Card */
.article-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.article-card a {
    color: var(--text);
    display: block;
}

.article-card a:hover {
    text-decoration: none;
}

.article-card h3 {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-card .excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Bottom Grid */
.bottom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Type Badges */
.type-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.badge-deal { background: #e94560; }
.badge-roundup { background: #4ecdc4; }
.badge-alert { background: #f9a826; color: #1a1a2e; }
.badge-summary { background: #2563eb; }

/* Article Hero Image */
.article-hero {
    position: relative;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    max-height: 450px;
}

.article-hero img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 450px;
}

.image-attribution {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-top-left-radius: 6px;
}

/* Card Thumbnail */
.article-card.has-thumb a {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    min-height: 0;
}

.card-thumb {
    flex-shrink: 0;
    width: 100px;
    min-height: 75px;
    border-radius: 6px;
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-body {
    flex: 1;
    min-width: 0;
}

/* Featured card with image */
.featured-card.has-image {
    background-image: none; /* override the gradient when image is set via inline style */
}

/* Bottom grid thumbnail layout */
.bottom-grid .article-card.has-thumb a {
    flex-direction: column;
}

.bottom-grid .card-thumb {
    width: 100%;
    height: 160px;
    border-radius: 6px 6px 0 0;
    margin: -1.25rem -1.25rem 1rem -1.25rem;
    width: calc(100% + 2.5rem);
}

/* Article Detail */
.article-detail {
    max-width: 1100px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 2rem;
}

.article-header h1 {
    font-size: 2.2rem;
    margin: 0.75rem 0;
    line-height: 1.3;
}

.published-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.article-content p {
    margin-bottom: 1.2rem;
}

.article-content h3 {
    margin-top: 1.8rem;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content hr.topic-break,
.article-content hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 2rem 0;
    position: relative;
}

.article-content hr.topic-break::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent);
    margin: -2px auto 0;
    border-radius: 2px;
}

/* Sources Section */
.article-sources {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    margin-bottom: 2rem;
}

.article-sources h3 {
    margin-bottom: 0.75rem;
}

.article-sources ul {
    list-style: none;
    padding: 0;
}

.article-sources li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.article-sources li:last-child {
    border-bottom: none;
}

/* Vote Section */
.vote-section {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

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

.vote-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vote-count {
    font-weight: 600;
}

/* Under Review */
.under-review {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.under-review h1 {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Subscribe Page */
.subscribe-page {
    max-width: 500px;
    margin: 2rem auto;
    text-align: center;
}

.subscribe-page h1 {
    margin-bottom: 0.5rem;
}

.subscribe-page > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.subscribe-form {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.subscribe-form input[type="email"] {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 1rem;
    flex: 1;
    max-width: 300px;
}

.subscribe-form button {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.subscribe-form button:hover {
    opacity: 0.9;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.message.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

[data-theme="dark"] .message.error {
    background: #3b1114;
    color: #f87171;
    border-color: #7f1d1d;
}

[data-theme="dark"] .message.success {
    background: #052e16;
    color: #4ade80;
    border-color: #14532d;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* Login Form */
.login-form {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px var(--shadow);
}

.login-form h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.login-form input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-form button {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.login-form button:hover {
    opacity: 0.9;
}

.login-form .error {
    color: #dc2626;
    background: #fef2f2;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

[data-theme="dark"] .login-form .error {
    background: #3b1114;
    color: #f87171;
}

/* Admin Dashboard */
.admin-dashboard {
    max-width: 1100px;
    margin: 0 auto;
}

.admin-dashboard h1 {
    margin-bottom: 1.5rem;
}

.admin-table {
    width: 100%;
    word-wrap: break-word;
}
.admin-table th:first-child,
.admin-table td:first-child {
    width: 45%;
}

.admin-table details summary {
    cursor: pointer;
    font-weight: 600;
}

.admin-table .article-detail {
    padding: 1rem;
    margin-top: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.admin-table .article-content {
    font-size: 0.95rem;
    line-height: 1.7;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.inline-form {
    display: inline;
}

.btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: #ffffff;
    transition: opacity 0.2s;
}

.btn:hover { opacity: 0.85; }

.btn-primary { background: var(--accent); }
.btn-approve { background: #16a34a; }
.btn-reject { background: #dc2626; }
.btn-revise { background: #f59e0b; }
.btn-unpublish { background: #6b7280; }
.btn-warn { background: #6b7280; }
.btn-danger { background: #dc2626; }

.revision-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
    min-height: 60px;
    margin-bottom: 0.5rem;
    resize: vertical;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #ffffff;
}

.badge-deal { background: #e94560; }
.badge-roundup { background: #4ecdc4; }
.badge-alert { background: #f9a826; color: #1a1a2e; }
.badge-summary { background: #2563eb; }

/* Admin Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background: var(--card-bg);
}

/* Preview Modal */
.preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem;
}

.preview-overlay.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: rgba(0, 0, 0, 0.75);
}

.preview-modal {
    background: var(--bg);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    min-height: 80vh;
    max-height: 90vh;
    margin: 2rem auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1001;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.preview-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.preview-close:hover {
    color: var(--text);
}

.preview-body {
    padding: 2.5rem 3rem;
}

.preview-body .article-detail {
    max-width: none;
    margin: 0;
}

.preview-body .article-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.preview-body .article-content p {
    margin-bottom: 1.2rem;
    line-height: 1.8;
}

.preview-body .article-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.preview-body .article-content ul,
.preview-body .article-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.preview-body .article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.preview-body .article-content hr.topic-break,
.preview-body .article-content hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 1.5rem 0;
}

.preview-body .article-content hr.topic-break::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent);
    margin: -2px auto 0;
    border-radius: 2px;
}

.preview-admin-info {
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--border);
    background: var(--card-bg);
}

.preview-link {
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    line-height: 1.4;
}

.preview-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .preview-overlay {
        padding: 0.5rem;
    }
    .preview-modal {
        margin: 0.5rem auto;
    }
    .preview-body {
        padding: 1rem;
    }
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.status-badge.revising {
    background: #fef3c7;
    color: #92400e;
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.unpublished {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.draft {
    background: #e5e7eb;
    color: #6b7280;
}

[data-theme="dark"] .status-badge.draft {
    background: #374151;
    color: #9ca3af;
}

.row-revising {
    background: #fffbeb !important;
}

[data-theme="dark"] .status-badge.revising {
    background: #451a03;
    color: #fbbf24;
}

[data-theme="dark"] .status-badge.unpublished {
    background: #450a0a;
    color: #fca5a5;
}

[data-theme="dark"] .row-revising {
    background: #1c1917 !important;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Admin Sources & Critic Sections */
.admin-sources-section,
.admin-critic-section {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.admin-sources-section h4,
.admin-critic-section h4 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-sources-section ul {
    list-style: none;
    padding: 0;
}

.admin-sources-section li {
    padding: 0.35rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.admin-sources-section li:last-child {
    border-bottom: none;
}

.critic-checks {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.critic-check {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.check-pass {
    background: #dcfce7;
    color: #16a34a;
}

.check-fail {
    background: #fef2f2;
    color: #dc2626;
}

[data-theme="dark"] .check-pass {
    background: #052e16;
    color: #4ade80;
}

[data-theme="dark"] .check-fail {
    background: #3b1114;
    color: #f87171;
}

.critic-issues {
    padding-left: 1.2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.critic-issues li {
    padding: 0.25rem 0;
}

/* Admin Navigation */
.admin-nav {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.admin-nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}
.admin-nav a:hover {
    color: var(--accent);
    background: var(--card-bg);
    text-decoration: none;
}
.admin-nav a.active {
    color: var(--accent);
    font-weight: 600;
}
.admin-nav .logout-btn {
    margin-left: auto;
    color: #dc2626;
}

/* Back Link */
.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.back-link:hover {
    color: var(--accent);
    text-decoration: none;
}

/* Vote Prompt */
.vote-prompt {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

/* Source Form */
.source-form {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.source-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.source-form .form-group {
    display: flex;
    flex-direction: column;
}

.source-form .form-group label {
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.source-form .form-group input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
}

.source-form .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* Dark mode theme toggle visibility */
[data-theme="dark"] #theme-toggle {
    border-color: var(--text-muted);
    color: var(--text);
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .bottom-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }

    nav {
        padding: 0.75rem 1rem;
    }

    .magazine-grid {
        grid-template-columns: 1fr;
    }

    .featured-card a {
        min-height: 280px;
    }

    .featured-title {
        font-size: 1.3rem;
    }

    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .article-header h1 {
        font-size: 1.6rem;
    }

    .article-hero {
        max-height: 250px;
        margin-bottom: 1.5rem;
    }

    .article-hero img {
        max-height: 250px;
    }

    .article-card.has-thumb a {
        flex-direction: row;
    }

    .bottom-grid .article-card.has-thumb a {
        flex-direction: row;
    }

    .bottom-grid .card-thumb {
        width: 100px;
        height: 75px;
        margin: 0;
        border-radius: 6px;
    }

    .subscribe-form {
        flex-direction: column;
        align-items: center;
    }

    .subscribe-form input[type="email"] {
        max-width: 100%;
        width: 100%;
    }

    .category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        mask-image: linear-gradient(to right, black 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
        padding-right: 2rem;
    }

    .source-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Hero Banner */
.hero-banner {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 12px;
    color: #ffffff;
}

.hero-banner h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.hero-banner p {
    font-size: 1.1rem;
    opacity: 0.85;
}

[data-theme="dark"] .hero-banner {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #1a2332 100%);
    border: 1px solid var(--border);
}

/* Vote Card */
.vote-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    margin-top: 2rem;
}

.vote-card .vote-prompt {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.vote-card .vote-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.vote-card .vote-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Article Two-Column Layout */
.article-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.article-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}

.sidebar-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.sidebar-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.sidebar-section p {
    font-size: 0.95rem;
    line-height: 1.6;
}

.key-details {
    list-style: none;
    padding: 0;
}

.key-details li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.key-details li:last-child {
    border-bottom: none;
}

.article-links {
    list-style: none;
    padding: 0;
}

.article-links li {
    padding: 0.35rem 0;
}

.article-links a {
    font-size: 0.9rem;
    font-weight: 500;
}

.article-main {
    min-width: 0;
}

@media (max-width: 768px) {
    .article-layout {
        grid-template-columns: 1fr;
    }
    .article-sidebar {
        position: static;
    }
}

/* Preview Actions */
.preview-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    position: sticky;
    bottom: 0;
    background: var(--bg);
    border-top: 2px solid var(--border);
    padding: 12px 0;
    z-index: 10;
    margin-top: 16px;
}

/* Editor notes - hidden on public site, visible in admin preview */
.editor-note {
    display: none;
}
.preview-body .editor-note {
    display: block;
    background: #fef3c7;
    color: #92400e;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-top: 12px;
    border-left: 3px solid #f59e0b;
}
[data-theme="dark"] .preview-body .editor-note {
    background: #451a03;
    color: #fbbf24;
}

/* Issue 12: Sources URLs truncation */
.admin-table td a[href] {
    display: inline-block;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* Admin table title overflow fix */
.admin-table td:first-child {
    max-width: 400px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.admin-table td:first-child a {
    display: block;
    line-height: 1.4;
}

@media (max-width: 1024px) {
    .admin-table td:first-child {
        max-width: 250px;
    }
    .admin-table td a[href] {
        max-width: 180px;
    }
}

@media (max-width: 768px) {
    .admin-table td:first-child {
        max-width: 180px;
    }
    .admin-table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Issue 2: Preview sidebar responsive */
    .preview-body .article-layout {
        grid-template-columns: 1fr;
    }
    .preview-body .article-sidebar {
        position: static;
    }

    /* Issue 12: Sources table URL cells - mobile override */
    .admin-table td a[href] {
        max-width: 120px;
    }

    /* Issue 6: Hero card title readability */
    .featured-overlay {
        background: linear-gradient(transparent 20%, rgba(0,0,0,0.85));
    }

    /* Issue N2: Hide columns on mobile */
    .hide-mobile {
        display: none;
    }

    /* Issue 7 + 13: Sidebar compact on mobile */
    .sidebar-section {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    .sidebar-section h4 {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }
    .sidebar-section p,
    .sidebar-section li {
        font-size: 0.85rem;
    }
    .key-details li {
        padding: 0.25rem 0;
    }

    /* Issue 9 + 14: Admin nav horizontal scroll with fade hint */
    .admin-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        position: relative;
        mask-image: linear-gradient(to right, black 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
        padding-right: 2rem;
    }

    /* Issue 10: Category filter pills touch-friendly */
    .tab {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.5rem 1rem;
    }
}

/* Issue 4: Dashboard table at tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .admin-table th,
    .admin-table td {
        padding: 0.85rem 1.1rem;
    }
    .admin-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.status-badge.pending {
    background: #dbeafe;
    color: #1e40af;
}
[data-theme="dark"] .status-badge.pending {
    background: #1e3a5f;
    color: #93c5fd;
}

/* Dim text */
.dim {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Scout's Take */
.scouts-take {
    background: var(--card-bg);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}
.scout-label {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* Flagged rows */
tr.flagged { background: #fef2f2; }
[data-theme="dark"] tr.flagged { background: #3b1114; }
.flag-icon { color: #dc2626; margin-left: 0.25rem; }

/* ========== Card Pages ========== */

/* Cards listing hero */
.cards-hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}
.cards-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.cards-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Issuer groups */
.cards-category-group {
    margin-bottom: 2.5rem;
}
.category-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

/* Card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.card-grid-item {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    color: var(--text);
    text-decoration: none;
}
.card-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}
.card-grid-image {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border);
}
.card-grid-image img {
    max-width: 200px;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.card-grid-body {
    padding: 1rem;
}
.card-grid-body h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.card-grid-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Issuer badge */
.issuer-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

/* Category badge */
.category-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    margin-left: 0.5rem;
    color: var(--text-muted);
}

/* Card detail page */
.card-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* Card detail — sidebar layout */
.card-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: start;
}
.card-sidebar {
    position: sticky;
    top: 5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}
.card-sidebar-image {
    margin-bottom: 1rem;
}
.card-sidebar-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Apply/Details button */
.card-apply-btn {
    display: block;
    text-align: center;
    padding: 0.6rem 1rem;
    margin-top: 1rem;
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.15s;
}
.card-apply-btn:hover {
    opacity: 0.85;
}

/* TOC in sidebar */
.card-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.card-toc li { padding: 0.2rem 0; }
.card-toc li a {
    font-size: 0.88rem;
    color: var(--accent);
    text-decoration: none;
    display: block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s;
}
.card-toc li a:hover {
    background: rgba(88,166,255,0.1);
}

/* Desktop title (hidden on mobile) */
.card-desktop-title h1 {
    font-size: 1.75rem;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

/* Mobile header + pills (hidden on desktop) */
.card-mobile-header {
    display: none;
}
.card-mobile-pills {
    display: none;
}

/* Card sections */
.card-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 5rem;
}
.card-section:last-child {
    border-bottom: none;
}
.card-section h2 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}
.card-section-content {
    line-height: 1.7;
    font-size: 1rem;
}
.card-section-content p {
    margin-bottom: 0.75rem;
}
.card-section-content ul,
.card-section-content ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}
.card-section-content li {
    margin-bottom: 0.35rem;
}

/* Scout's Verdict (card detail page) */
.scouts-verdict {
    background: var(--card-bg);
    border-left: 4px solid var(--accent);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    scroll-margin-top: 5rem;
}
.scouts-verdict-content {
    line-height: 1.7;
    font-size: 1rem;
}
.scouts-verdict-content p {
    margin-bottom: 0.5rem;
}

/* Recent changes */
.recent-changes {
    margin-top: 2rem;
    scroll-margin-top: 5rem;
}
.recent-changes h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}
.changes-list {
    list-style: none;
    padding: 0;
}
.changes-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    align-items: baseline;
    flex-wrap: wrap;
}
.changes-list li:last-child {
    border-bottom: none;
}
.change-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 100px;
}
.change-summary {
    flex: 1;
}
.change-link {
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Cards listing page */
.cards-listing {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Card pages responsive — tablet */
@media (max-width: 900px) {
    .card-layout {
        grid-template-columns: 200px 1fr;
        gap: 1.25rem;
    }
    .card-toc li a { font-size: 0.82rem; }
}

/* Card pages responsive — mobile */
@media (max-width: 768px) {
    .card-layout {
        display: block;
    }
    .card-sidebar {
        display: none;
    }
    .card-desktop-title {
        display: none;
    }
    .card-mobile-header {
        display: block;
        background: var(--card-bg);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 1rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    .card-mobile-image {
        width: 180px;
        margin: 0 auto 0.75rem;
    }
    .card-mobile-image img {
        width: 100%;
        height: auto;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    .card-mobile-header h1 {
        font-size: 1.2rem;
        margin-top: 0.4rem;
        line-height: 1.2;
    }
    .card-mobile-pills {
        display: flex;
        gap: 0.35rem;
        overflow-x: auto;
        padding: 0.6rem 0;
        margin-bottom: 1rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .card-mobile-pills::-webkit-scrollbar { display: none; }
    .card-mobile-pills a {
        display: inline-block;
        flex-shrink: 0;
        padding: 0.3rem 0.7rem;
        background: var(--card-bg);
        color: var(--text-muted);
        border: 1px solid var(--border);
        border-radius: 16px;
        font-size: 0.78rem;
        text-decoration: none;
        white-space: nowrap;
    }
    .card-mobile-pills a:hover {
        background: rgba(88,166,255,0.1);
        color: var(--accent);
        border-color: var(--accent);
    }
    .changes-list li {
        flex-direction: column;
        gap: 0.25rem;
    }
    .cards-hero h1 {
        font-size: 1.5rem;
    }
}

/* --- Search --- */

/* Nav search */
.nav-search {
    display: flex;
    align-items: center;
    position: relative;
}
.nav-search button#search-toggle {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}
.nav-search-form {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 100;
}
.nav-search-form.active {
    display: block;
}
.nav-search-form input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.9rem;
    width: 220px;
}
.nav-search-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Search page */
.search-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1rem;
}
.search-page h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.search-form input {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 1rem;
}
.search-form input:focus {
    outline: none;
    border-color: var(--accent);
}
.search-form button {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}
.search-form button:hover {
    opacity: 0.9;
}
.search-empty {
    color: var(--text-muted);
    font-size: 1.05rem;
}
.search-section {
    margin-bottom: 2rem;
}
.search-section h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}
.search-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.search-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.search-item:last-child {
    border-bottom: none;
}
.search-item-title {
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    font-size: 1.05rem;
}
.search-item-title:hover {
    text-decoration: underline;
}
.search-item-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}
.search-item-excerpt mark {
    background: rgba(37, 99, 235, 0.15);
    color: var(--text);
    padding: 0 2px;
    border-radius: 2px;
}
.search-pagination {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.btn-page {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
}
.btn-page:hover {
    background: rgba(37, 99, 235, 0.08);
}
.tag-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.tag-pill { padding: 0.4rem 0.8rem; border-radius: 20px; border: 1px solid var(--border);
            color: var(--text-muted); font-size: 0.85rem; text-decoration: none; transition: all 0.15s; }
.tag-pill.active, .tag-pill:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.article-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.5rem 0; }
.tag-badge { padding: 0.15rem 0.5rem; border-radius: 4px; background: var(--accent-subtle);
             color: var(--accent); font-size: 0.75rem; text-decoration: none; font-weight: 500; }
.tag-badge:hover { background: var(--accent); color: #fff; }

/* ========== Compare Page ========== */
.compare-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
}
.compare-page h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}
.compare-intro {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Selector form */
.compare-selector-form {
    max-width: 900px;
}
.compare-selector-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.compare-selector-row label {
    flex: 1;
    min-width: 250px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.compare-select {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.9rem;
    width: 100%;
}
.compare-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Table wrapper */
.compare-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
}

/* Table */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 600px;
}
.compare-table th,
.compare-table td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

/* Zebra striping */
.compare-table tbody tr:nth-child(even) {
    background: var(--card-bg);
}

/* Column tinting for 2nd and 3rd card columns */
.compare-table th.compare-card-col:nth-child(3),
.compare-table td:nth-child(3) {
    background: rgba(37, 99, 235, 0.03);
}
[data-theme="dark"] .compare-table th.compare-card-col:nth-child(3),
[data-theme="dark"] .compare-table td:nth-child(3) {
    background: rgba(88, 166, 255, 0.04);
}

/* Label column — fixed narrow width, card columns share remaining space equally */
.compare-label-col {
    font-weight: 600;
    white-space: nowrap;
    width: 18%;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Card column header */
.compare-card-col {
    text-align: center;
    min-width: 180px;
}
.compare-card-img {
    max-width: 140px;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    margin-bottom: 0.5rem;
}
.compare-header-select {
    font-weight: 600;
    font-size: 0.82rem;
    width: 100%;
    display: block;
}
.compare-fee {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* Winner star */
.compare-winner {
    color: var(--accent);
    font-weight: 600;
}

/* Section headers (collapsible) */
.compare-section-header td {
    font-weight: 700;
    font-size: 0.95rem;
    background: var(--card-bg);
    border-bottom: 2px solid var(--border);
    padding: 0.75rem 0.85rem;
}
.compare-section-header:hover td {
    background: var(--accent-subtle);
}
.compare-toggle-icon {
    display: inline-block;
    width: 1em;
    font-size: 0.75rem;
    margin-right: 0.35rem;
    vertical-align: middle;
}

/* Scout's Take row */
.compare-scouts-take td {
    border-top: 2px solid var(--border);
    padding-top: 1rem;
}
.compare-verdict {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive: sticky first column on mobile */
@media (max-width: 768px) {
    .compare-page {
        padding: 0.5rem;
    }

    /* Make the table wrapper show a right-edge shadow as a scroll hint */
    .compare-table-wrap {
        position: relative;
    }
    .compare-table-wrap::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 24px;
        height: 100%;
        background: linear-gradient(to right, transparent, rgba(0,0,0,0.08));
        pointer-events: none;
    }

    .compare-table .compare-label-col {
        position: sticky;
        left: 0;
        background: var(--bg);
        z-index: 1;
        min-width: 90px;
        max-width: 110px;
        font-size: 0.78rem;
        white-space: normal;
        word-break: break-word;
        padding: 0.5rem 0.5rem;
    }
    .compare-table tbody tr:nth-child(even) .compare-label-col {
        background: var(--card-bg);
    }
    .compare-table th,
    .compare-table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.82rem;
    }
    .compare-table td {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    .compare-card-col {
        min-width: 150px;
        text-align: center;
    }

    /* Stack card image and select vertically; make select full-width of its column */
    .compare-card-col {
        display: table-cell; /* keep table cell layout */
    }
    .compare-card-img {
        max-width: 90px;
        display: block;
        margin: 0 auto 0.4rem;
    }
    .compare-header-select {
        font-size: 0.7rem;
        min-width: 0;
        max-width: none;
        width: 100%;
        box-sizing: border-box;
    }

    /* Verdict text smaller on mobile */
    .compare-verdict {
        font-size: 0.8rem;
    }

    /* Welcome bonus cells: prevent overflow */
    .compare-table td {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    /* Selector page: make dropdowns full-width on mobile */
    .compare-selector-row {
        flex-direction: column;
    }
    .compare-selector-row label {
        min-width: 0;
        width: 100%;
    }
    .compare-select {
        min-width: 0;
        width: 100%;
    }
}

/* === Card embeds at bottom of article === */
.card-embeds { margin-top: 32px; }
.card-embeds-heading {
    margin: 0 0 4px;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
    font-weight: 600;
}
.card-embed {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 16px 0;
    box-shadow: 0 2px 6px var(--shadow);
}
.card-embed-top { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.card-embed-logo { width: 96px; height: 60px; border-radius: 6px; flex-shrink: 0;
    object-fit: contain; background: var(--bg); border: 1px solid var(--border); }
.card-embed-name { font-size: 18px; font-weight: 600; margin: 0; }
.card-embed-name a { color: var(--text); text-decoration: none; }
.card-embed-name a:hover { color: var(--accent); }
.card-embed-issuer { color: var(--text-muted); font-size: 12px; }
.card-embed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    margin-bottom: 12px; }
.card-embed-grid .stat b { display: block; color: var(--text-muted); font-weight: 500;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.card-embed-grid .stat span { font-size: 14px; font-weight: 500; color: var(--text); }
.card-embed-verdict { font-size: 13px; color: var(--text); border-left: 3px solid var(--accent);
    padding: 2px 12px; margin: 0 0 12px; font-style: italic; }
.card-embed-cta { display: inline-block; background: var(--accent); color: var(--bg);
    padding: 8px 16px; border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: 500; }
.card-embed-cta:hover { filter: brightness(0.92); }

/* === Admin: linked-cards curation UI === */
.admin-shell { background: var(--card-bg); padding: 16px 24px;
    border-bottom: 1px solid var(--border); font-size: 13px; }
.admin-shell .crumbs a { color: var(--accent); text-decoration: none; }
.admin-form { padding: 24px 32px; background: var(--bg); color: var(--text); }
.admin-form h2 { margin: 0 0 4px; font-size: 22px; }
.admin-form .form-meta { color: var(--text-muted); margin-bottom: 24px; font-size: 13px; }
.admin-section-title { margin: 24px 0 8px; font-size: 14px; font-weight: 600;
    display: flex; justify-content: space-between; align-items: baseline; color: var(--text); }
.admin-section-title small { color: var(--text-muted); font-weight: 400; }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px;
    background: var(--card-bg); font-size: 14px; color: var(--text); }
.admin-row.linked    { background: var(--accent-subtle); border-color: var(--accent); }
.admin-row.suggested { background: var(--card-bg); border-color: var(--border); border-style: dashed; }
.admin-row .row-logo { width: 48px; height: 30px; border-radius: 3px; background: var(--bg);
    border: 1px solid var(--border); object-fit: contain; flex-shrink: 0; }
.admin-row .row-info { flex: 1; }
.admin-row .row-info b { font-weight: 600; }
.admin-row .row-info small { color: var(--text-muted); display: block; font-size: 12px; }
.admin-row .row-mention-count { color: var(--accent); font-size: 12px; padding: 2px 8px;
    background: var(--accent-subtle); border-radius: 10px; white-space: nowrap; }
.btn-icon { border: 1px solid var(--border); background: var(--bg); border-radius: 4px;
    padding: 4px 8px; cursor: pointer; font-size: 13px; color: var(--text-muted); }
.btn-icon.danger:hover  { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent); }
.btn-icon.success:hover { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent); }
.admin-input-group { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; }
.admin-input-group label { font-size: 13px; font-weight: 600; color: var(--text); }
.admin-input-group input { padding: 8px 12px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 14px; font-family: inherit;
    background: var(--bg); color: var(--text); }
.admin-input-group small { color: var(--text-muted); font-size: 12px; }
.admin-actions { display: flex; gap: 12px; margin-top: 24px; padding-top: 20px;
    border-top: 1px solid var(--border); }
.admin-actions .btn-primary { background: var(--accent); color: var(--bg); border: none;
    padding: 10px 20px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.admin-actions .btn-primary:hover { filter: brightness(0.92); }
.btn-secondary { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border);
    padding: 10px 20px; border-radius: 6px; font-size: 14px; cursor: pointer; text-decoration: none; }
