/* Modern Science Dark Theme - Behavioral Process Catalog */

:root {
    --accent-teal:   #4a9eba;
    --accent-blue:   #6e9fca;
    --accent-hover:  #58a6ff;
    --bg-dark:       #0d1117;
    --bg-card:       #161b22;
    --bg-panel:      #1c2128;
    --bg-stripe:     #21262d;
    --text-bright:   #e6edf3;
    --text-light:    #c9d1d9;
    --text-muted:    #9da5ad;
    --border-color:  #30363d;
    --border-subtle: #21262d;
    --tag-process-bg:   rgba(74, 158, 186, 0.15);
    --tag-author-bg:    rgba(110, 159, 202, 0.12);
    --success-green:    #3fb950;
    --warning-orange:   #d29922;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 15px;
    line-height: 1.5;
}

.container {
    width: 92%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.header {
    padding: 40px 0 32px;
    text-align: center;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.main-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 2.4rem;
    letter-spacing: -0.5px;
    line-height: 1.15;
    margin-bottom: 8px;
    color: var(--text-bright);
}

.title-line1 {
    display: block;
    color: var(--text-bright);
}

.title-line2 {
    display: block;
    color: var(--accent-teal);
}

.header-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 0.2px;
    font-weight: 400;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.nav-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
}

.nav-content {
    display: flex;
    justify-content: center;
    gap: 0;
}

.nav-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 14px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.nav-btn:hover {
    color: var(--text-bright);
}

.nav-btn.active {
    color: var(--accent-teal);
    border-bottom-color: var(--accent-teal);
}

/* ── Main Content ───────────────────────────────────────────────────────── */
.main-content {
    padding: 32px 0;
    min-height: 70vh;
}

.content-section { display: none; }
.content-section.active { display: block; }

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.section-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ── Controls Panel ─────────────────────────────────────────────────────── */
.controls-panel {
    background: var(--bg-card);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.search-container {
    display: flex;
    flex: 1;
    min-width: 280px;
}

.search-input {
    flex: 1;
    padding: 9px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 6px 0 0 6px;
    color: var(--text-bright);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--accent-teal);
}

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

.search-btn {
    padding: 9px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 0 6px 6px 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
}

.search-btn:hover {
    background: var(--bg-stripe);
    color: var(--text-bright);
}

.filter-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    padding: 9px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    font-size: 0.87rem;
    cursor: pointer;
    min-width: 130px;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-teal);
}

.export-btn {
    background: var(--bg-panel);
    color: var(--accent-teal);
    border: 1px solid var(--border-color);
    padding: 9px 16px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.87rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.export-btn:hover {
    background: var(--bg-stripe);
    border-color: var(--accent-teal);
}

/* ── Loading Indicator ──────────────────────────────────────────────────── */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.loading-indicator.hidden { display: none; }

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ── Data Table ─────────────────────────────────────────────────────────── */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.data-table {
    width: 100%;
    min-width: 1300px;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
}

.data-table th {
    background: var(--bg-panel);
    color: var(--text-muted);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.data-table th[data-sort-key] {
    cursor: pointer;
    user-select: none;
}

.data-table th[data-sort-key]::after {
    content: ' \21C5';
    opacity: 0.3;
    font-size: 0.75em;
}

.data-table th[data-sort-key]:hover::after {
    opacity: 0.6;
}

.data-table th.sort-asc::after {
    content: ' \2191';
    opacity: 1;
    color: var(--accent-teal);
}

.data-table th.sort-desc::after {
    content: ' \2193';
    opacity: 1;
    color: var(--accent-teal);
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-light);
    vertical-align: top;
}

.data-table tr:hover td {
    background: var(--bg-stripe);
}

.data-table tr:nth-child(even) td {
    background: rgba(33, 38, 45, 0.5);
}

.data-table tr:nth-child(even):hover td {
    background: var(--bg-stripe);
}

/* ── Abstract Cell ──────────────────────────────────────────────────────── */
.abstract-cell {
    max-width: 600px;
    position: relative;
}

.abstract-content {
    line-height: 1.5;
    margin: 0;
    color: var(--text-light);
}

.abstract-content.collapsed {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-height: 1.5em;
}

.abstract-content.expanded {
    white-space: normal;
    max-height: none;
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--accent-teal);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    margin-left: 4px;
    padding: 1px 4px;
    border-radius: 3px;
    transition: background 0.15s;
}

.read-more-btn:hover {
    background: rgba(74, 158, 186, 0.12);
}

/* ── Column widths ──────────────────────────────────────────────────────── */
/* 1=Title, 2=Journal, 3=Authors, 4=Year, 5=Vol, 6=Issue, 7=Pages, 8=Abstract, 9=Process, 10=Static Eq, 11=Recursive Eq */
.data-table th:nth-child(1),  .data-table td:nth-child(1)  { width: 140px; min-width: 140px; }
.data-table th:nth-child(2),  .data-table td:nth-child(2)  { width: 80px;  min-width: 80px;  }
.data-table th:nth-child(3),  .data-table td:nth-child(3)  { width: 120px; min-width: 120px; }
.data-table th:nth-child(4),  .data-table td:nth-child(4)  { width: 60px;  min-width: 60px;  }
.data-table th:nth-child(5),  .data-table td:nth-child(5)  { width: 60px;  min-width: 60px;  }
.data-table th:nth-child(6),  .data-table td:nth-child(6)  { width: 60px;  min-width: 60px;  }
.data-table th:nth-child(7),  .data-table td:nth-child(7)  { width: 80px;  min-width: 80px;  }
.data-table th:nth-child(8),  .data-table td:nth-child(8)  { min-width: 600px; }
.data-table th:nth-child(9),  .data-table td:nth-child(9)  { width: 120px; min-width: 120px; }
.data-table th:nth-child(10), .data-table td:nth-child(10) { width: 220px; min-width: 220px; }
.data-table th:nth-child(11), .data-table td:nth-child(11) { width: 220px; min-width: 220px; }

/* ── Journal Tags ──────────────────────────────────────────────────────── */
.journal-tag {
    display: inline-block;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.journal-tag.journal-jeab {
    background: rgba(74, 158, 186, 0.15);
    border: 1px solid rgba(74, 158, 186, 0.3);
    color: #4a9eba;
}

.journal-tag.journal-bp {
    background: rgba(163, 113, 207, 0.15);
    border: 1px solid rgba(163, 113, 207, 0.3);
    color: #a371cf;
}

.journal-tag.journal-jep {
    background: rgba(63, 185, 80, 0.15);
    border: 1px solid rgba(63, 185, 80, 0.3);
    color: #3fb950;
}

/* ── Tags ───────────────────────────────────────────────────────────────── */
.process-tag {
    display: inline-block;
    background: var(--tag-process-bg);
    border: 1px solid rgba(74, 158, 186, 0.3);
    border-radius: 4px;
    padding: 2px 7px;
    margin: 2px 2px 2px 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent-teal);
    white-space: nowrap;
}

.author-tag {
    display: inline-block;
    background: var(--tag-author-bg);
    border: 1px solid rgba(110, 159, 202, 0.25);
    border-radius: 4px;
    padding: 2px 7px;
    margin: 2px 2px 2px 0;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--accent-blue);
    white-space: nowrap;
    font-style: italic;
}

/* ── Article Links ──────────────────────────────────────────────────────── */
.article-link {
    color: var(--accent-teal);
    text-decoration: none;
    transition: color 0.15s;
}

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

.article-link::after {
    content: "↗";
    font-size: 0.75em;
    margin-left: 3px;
    opacity: 0.6;
}

/* ── Equations ──────────────────────────────────────────────────────────── */
.equation-display {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.95em;
    color: var(--text-bright);
    margin-bottom: 6px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.equation-definitions-block {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.73rem;
    color: var(--text-muted);
    background: rgba(74, 158, 186, 0.06);
    padding: 7px 10px;
    border-radius: 4px;
    border-left: 2px solid rgba(74, 158, 186, 0.4);
    margin-top: 5px;
}

.equation-definitions-block .where-label {
    font-weight: 600;
    color: var(--accent-teal);
    margin-bottom: 4px;
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.equation-definitions-block .definition-item {
    margin-bottom: 2px;
    padding-left: 4px;
    line-height: 1.4;
    display: block;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

.static-equation, .recursive-equation {
    vertical-align: top;
    padding: 10px 14px;
}

.MathJax {
    color: var(--text-bright) !important;
}

/* ── Authors column ─────────────────────────────────────────────────────── */
.authors {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.875em;
}

/* ── Add Entry ──────────────────────────────────────────────────────────── */
.add-entry-container {
    text-align: center;
    margin-top: 24px;
}

.add-entry-btn {
    background: var(--bg-panel);
    color: var(--accent-teal);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.add-entry-btn:hover {
    background: var(--bg-stripe);
    border-color: var(--accent-teal);
}

/* ── About Section ──────────────────────────────────────────────────────── */
.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.about-card {
    background: var(--bg-card);
    padding: 28px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.about-card:hover {
    border-color: var(--accent-teal);
}

.about-card h3 {
    font-family: 'Inter', sans-serif;
    color: var(--text-bright);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.about-card p {
    line-height: 1.6;
    color: var(--text-light);
    font-size: 0.9rem;
}

.about-prose {
    margin-top: 40px;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.about-prose h3 {
    font-family: 'Inter', sans-serif;
    color: var(--text-bright);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.about-prose p {
    line-height: 1.75;
    color: var(--text-light);
    font-size: 0.92rem;
    margin-bottom: 14px;
}

.about-prose p:last-of-type {
    margin-bottom: 0;
}

.about-citation {
    font-size: 0.82rem !important;
    color: var(--text-muted) !important;
    font-style: italic;
    margin-top: 8px !important;
}

/* ── Statistics Grid ────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.stat-card {
    background: var(--bg-card);
    padding: 28px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: var(--accent-teal);
}

.stat-card h3 {
    font-family: 'Inter', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-teal);
    margin-bottom: 8px;
}

.stat-card p {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ── Review Progress ───────────────────────────────────────────────────── */
.review-progress {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px 28px;
    margin-top: 24px;
    text-align: center;
}

.review-progress h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 12px;
}

.progress-bar-container {
    background: var(--bg-dark);
    border-radius: 12px;
    height: 24px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--accent-teal), var(--success-green));
    transition: width 1s ease-out;
    min-width: 0;
}

.progress-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.progress-label strong {
    color: var(--text-light);
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    margin: 5% auto;
    padding: 28px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close-modal,
.close-edit-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    line-height: 1;
}

.close-modal:hover,
.close-edit-modal:hover { color: var(--text-bright); }

.modal-content h3 {
    font-family: 'Inter', sans-serif;
    color: var(--text-bright);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-content input,
.modal-content textarea {
    padding: 9px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-bright);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s;
}

.modal-content input:focus,
.modal-content textarea:focus {
    border-color: var(--accent-teal);
}

.submit-btn {
    background: var(--accent-teal);
    color: #0d1117;
    border: none;
    padding: 11px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.2s;
}

.submit-btn:hover { background: var(--accent-hover); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    text-align: center;
    margin-top: 48px;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Form help text ─────────────────────────────────────────────────────── */
.field-help {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 2px;
    margin-bottom: 6px;
    font-style: italic;
}

/* ── GitHub Auth Panel ──────────────────────────────────────────────────── */
.github-auth-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

.auth-content h3 {
    font-family: 'Inter', sans-serif;
    color: var(--text-bright);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.auth-content p {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.auth-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.auth-controls input {
    flex: 1;
    min-width: 240px;
    padding: 9px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-bright);
    font-family: 'Inter', sans-serif;
    outline: none;
}

.auth-controls input:focus { border-color: var(--accent-teal); }

.auth-btn {
    background: var(--accent-teal);
    color: #0d1117;
    border: none;
    padding: 9px 18px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.auth-btn:hover { background: var(--accent-hover); }

.auth-btn.secondary {
    background: var(--bg-panel);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.auth-btn.secondary:hover { background: var(--bg-stripe); }

.auth-help {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-help a {
    color: var(--accent-teal);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 4px;
}

.auth-help a:hover { text-decoration: underline; }

.auth-help small {
    display: block;
    font-size: 0.78rem;
    opacity: 0.75;
}

/* ── Pagination ─────────────────────────────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 10px 14px;
    margin: 8px 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.83rem;
    color: var(--text-muted);
}

.pagination-info strong { color: var(--text-light); }

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-indicator { color: var(--text-muted); white-space: nowrap; }

.page-btn, .size-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    transition: background 0.15s, border-color 0.15s;
}

.page-btn:hover:not(:disabled), .size-btn:hover {
    background: var(--bg-stripe);
    border-color: var(--accent-teal);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.size-btn.active {
    background: rgba(74, 158, 186, 0.15);
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    font-weight: 600;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .container { padding: 0 10px; }

    .main-title { font-size: 1.7rem; }

    .nav-content { gap: 0; overflow-x: auto; }

    .controls-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-container { justify-content: flex-start; }
    .filter-select { flex: 1; }

    .data-table {
        min-width: 900px;
        font-size: 0.82rem;
    }

    .data-table th, .data-table td { padding: 8px 8px; }

    .data-table th:nth-child(1), .data-table td:nth-child(1) { width: 120px; min-width: 120px; }
    .data-table th:nth-child(2), .data-table td:nth-child(2) { width: 70px;  min-width: 70px;  }
    .data-table th:nth-child(3), .data-table td:nth-child(3) { width: 100px; min-width: 100px; }
    .data-table th:nth-child(8), .data-table td:nth-child(8) { min-width: 200px; }

    .export-btn { font-size: 0.8rem; padding: 8px 14px; }

    .process-tag, .author-tag { font-size: 0.73rem; padding: 2px 5px; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .main-title { font-size: 1.4rem; }
    .data-table { font-size: 0.78rem; }
    .data-table th, .data-table td { padding: 7px 6px; }

    .data-table .journal-cell { display: none; }
    .data-table thead th:nth-child(2) { display: none; }
    .data-table .authors { display: none; }
    .data-table thead th:nth-child(3) { display: none; }
}

/* ── Review Status + Edit Button ────────────────────────────────────────── */
.row-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.badge-reviewed {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.3);
    white-space: nowrap;
}

.badge-needs-review {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(210, 153, 34, 0.15);
    color: #d29922;
    border: 1px solid rgba(210, 153, 34, 0.3);
    white-space: nowrap;
}

.edit-row-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    min-width: 28px;
    min-height: 28px;
}

tr:hover .edit-row-btn {
    opacity: 1;
}

/* ── Verify Button ──────────────────────────────────────────────────────── */
.signoff-btn {
    background: none;
    border: 1px solid rgba(63, 185, 80, 0.4);
    color: #3fb950;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    min-width: 28px;
    min-height: 28px;
}

tr:hover .signoff-btn { opacity: 1; }

/* ── Leaderboard ─────────────────────────────────────────────────────────── */
.leaderboard-stats {
    display: flex;
    gap: 24px;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 4px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.leaderboard-table th {
    background: var(--bg-panel);
    color: var(--text-muted);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.rank-cell {
    width: 60px;
    font-size: 1.1rem;
    text-align: center;
}

.rank-medal {
    font-size: 1.2rem;
}

.contributor-name a {
    color: var(--accent-teal);
    text-decoration: none;
    font-weight: 500;
}

.contributor-name a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.stat-cell {
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
}

.verified-cell {
    color: #3fb950;
    font-weight: 600;
}

.score-cell {
    color: var(--accent-teal);
    font-weight: 700;
}

.top-contributor td {
    background: rgba(74, 158, 186, 0.04);
}

.scoring-note {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.no-contributors {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    font-style: italic;
}

/* ── My Submissions Dashboard ──────────────────────────────────────────── */
.my-submissions {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.my-submissions h3 {
    font-family: 'Inter', sans-serif;
    color: var(--text-bright);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.my-stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.my-stat {
    flex: 1;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 14px 12px;
    text-align: center;
}

.my-stat-num {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-teal);
}

.my-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
}

.my-entries-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.my-entries-table th {
    background: var(--bg-panel);
    color: var(--text-muted);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.my-entries-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-light);
}

.my-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px 0;
    font-style: italic;
    font-size: 0.88rem;
}

.my-more-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 8px;
    font-style: italic;
}

/* ── Contributor Info Cards ──────────────────────────────────────────────── */
.contributor-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 36px;
}

.contributor-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.contributor-info-card h3 {
    color: var(--text-bright);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.contributor-info-card p {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ── Review Rubric ─────────────────────────────────────────────────────── */
.review-rubric {
    margin-top: 36px;
}

.review-rubric > h3 {
    font-family: 'Inter', sans-serif;
    color: var(--text-bright);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.rubric-intro {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.rubric-checklist {
    display: grid;
    gap: 12px;
}

.rubric-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.rubric-item h4 {
    font-family: 'Inter', sans-serif;
    color: var(--accent-teal);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.rubric-item p {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.rubric-note {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* ── Onboarding Guide ──────────────────────────────────────────────────── */
.onboarding-guide {
    margin-top: 36px;
}

.onboarding-guide > h3 {
    font-family: 'Inter', sans-serif;
    color: var(--text-bright);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.onboarding-step {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 12px;
}

.onboarding-step h4 {
    font-family: 'Inter', sans-serif;
    color: var(--accent-teal);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.onboarding-step p {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.onboarding-step a {
    color: var(--accent-teal);
    text-decoration: none;
}

.onboarding-step a:hover {
    text-decoration: underline;
}

.onboarding-step ul {
    margin: 8px 0 0 20px;
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ── Accessibility ──────────────────────────────────────────────────────── */

/* Visually hidden but available to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus outlines for keyboard navigation */
.nav-btn:focus-visible,
.page-btn:focus-visible,
.add-entry-btn:focus-visible,
.submit-btn:focus-visible,
.auth-btn:focus-visible,
.edit-row-btn:focus-visible,
.signoff-btn:focus-visible,
.export-btn:focus-visible,
.read-more-btn:focus-visible,
.search-btn:focus-visible,
.search-input:focus-visible,
.size-btn:focus-visible,
.close-modal:focus-visible,
.close-edit-modal:focus-visible,
.filter-select:focus-visible {
    outline: 2px solid var(--accent-teal);
    outline-offset: 2px;
}

/* ── Toast Notifications ───────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 22px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    z-index: 10000;
    max-width: 420px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.4s ease-out;
}

.toast-success {
    background: var(--success-green);
    color: var(--bg-dark);
    font-weight: 500;
}

.toast-error {
    background: #f85149;
    color: #fff;
    font-weight: 500;
}

.toast-exit {
    animation: slideOut 0.5s ease-in forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

/* ── Touch device fixes ─────────────────────────────────────────────────── */

/* On devices that don't support hover, always show action buttons */
@media (hover: none) {
    .edit-row-btn,
    .signoff-btn {
        opacity: 1;
    }
}
