/* Viewer-specific styles */

/* Override some base styles for static viewer */
* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #0a0a0f;
    background-attachment: fixed;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background-color: #0a0a0f !important;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.05) 0%, transparent 50%) !important;
    background-attachment: fixed !important;
    background-position: 0 0 !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    display: block !important; /* Override flex from style.css */
    overflow-x: visible !important; /* Override hidden from style.css */
}

/* Ensure consistent background even with scroll */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0a0f;
    z-index: -2;
    pointer-events: none;
}

/* Dashboard specific no-scroll */
body.dashboard-view {
    overflow: hidden;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent; /* Let body background show through */
}

/* Station Selection Dashboard */
.dashboard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 1rem 2rem;
    overflow: hidden;
    background: transparent; /* Ensure transparent to show body background */
}

.station-logo-large {
    width: 320px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.5));
    animation: logoGlow 3s ease-in-out infinite;
}

.dashboard-footer {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.5)); }
    50% { filter: drop-shadow(0 0 40px rgba(0, 212, 255, 0.8)); }
}

.station-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 1200px;
    width: 100%;
    margin-top: 0.5rem;
}

.station-card {
    background: var(--gradient-surface);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.station-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.station-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.3);
}

.station-card:hover::before {
    transform: translateX(0);
}

.station-card h3 {
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.station-card .station-id {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Navigation Bar */
.viewer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(10, 10, 15, 0.95); /* Match body background color */
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-logo {
    height: 30px;
    width: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

.nav-right {
    display: flex;
    align-items: center;
}

.station-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.station-name-label,
.end-tick-label {
    color: var(--text-muted);
}

.station-name-value,
.end-tick-value {
    color: var(--text-primary);
    font-weight: 600;
}

.separator {
    color: var(--border-primary);
    margin: 0 0.5rem;
}

/* Station dropdown */
.station-dropdown {
    background: var(--bg-secondary);
    color: var(--accent-cyan);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 150px;
    max-width: 250px;
}

.station-dropdown:hover {
    border-color: var(--accent-cyan);
    background: var(--bg-tertiary);
}

.station-dropdown:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.1);
}

.station-dropdown option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    min-height: calc(100vh - 70px); /* Ensure content fills viewport minus navbar */
    background: transparent; /* Let app background show through */
}

/* Tables */
.data-table {
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

.data-table thead {
    background: var(--bg-tertiary);
}

.data-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-primary);
    position: relative;
    user-select: none;
}

.data-table th.sortable {
    cursor: pointer;
    transition: color 0.3s ease;
    padding-right: 2.5rem;
    position: relative;
}

.data-table th.sortable:hover {
    color: var(--accent-cyan);
}

.data-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 0.75rem;
    opacity: 0.3;
    transition: opacity 0.3s ease;
    margin-left: 0.5rem;
}

.data-table th.sortable:hover::after {
    opacity: 0.7;
}

.data-table th.sortable.sort-asc::after {
    content: '↑';
    opacity: 1;
    color: var(--accent-cyan);
}

.data-table th.sortable.sort-desc::after {
    content: '↓';
    opacity: 1;
    color: var(--accent-cyan);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-primary);
    transition: background 0.3s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
    cursor: pointer;
}

.data-table td {
    padding: 1rem;
    color: var(--text-primary);
}

.data-table td.muted {
    color: var(--text-muted);
}

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 1rem;
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.back-button:hover {
    background: var(--bg-surface);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* Agent Detail Styles */
.agent-detail {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 2rem;
    border: 1px solid var(--border-primary);
}

.agent-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item span {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

/* Chat History */
.chat-history {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.chat-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    opacity: 1;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

/* Thinking Content */
.thinking-toggle {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    cursor: pointer;
    color: var(--accent-purple);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.thinking-toggle:hover {
    background: rgba(139, 92, 246, 0.2);
}

.thinking-content {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 0.25rem;
    padding: 1rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: none;
}

.thinking-content.visible {
    display: block;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-primary);
    align-items: center;
}

.filter-bar select,
.filter-bar input {
    padding: 0.5rem 1rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.25rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-bar input {
    flex: 1;
    min-width: 200px;
}

.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.clear-filters-btn {
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.clear-filters-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 500;
}

.loading > div {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 2rem;
    height: 2rem;
    margin-left: 1rem;
    border: 3px solid var(--border-primary);
    border-radius: 50%;
    border-top-color: var(--accent-cyan);
    border-right-color: var(--accent-cyan);
    animation: spin 0.8s linear infinite;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    color: #fca5a5;
    margin: 2rem 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Load More Button */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: 2rem;
    margin-top: 1rem;
}

.load-more-button {
    padding: 0.75rem 2rem;
    background: var(--gradient-surface);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.load-more-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    opacity: 0.2;
    transition: left 0.3s ease;
}

.load-more-button:hover {
    background: var(--bg-surface);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.load-more-button:hover::before {
    left: 0;
}

.load-more-button:active {
    transform: translateY(0);
}

/* ==================== MARKDOWN STYLES FROM FRONTEND ==================== */
/* These styles match the main station frontend markdown rendering */

.markdown-content-host pre,
.chat-bubble pre {
    background: #272935 !important;
    border: 1px solid var(--border-secondary);
    color: var(--text-primary);
    padding: 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-all;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.markdown-content-host pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-accent);
    opacity: 0.6;
}

.markdown-content-host code:not(pre code),
.chat-bubble code:not(pre code) {
    background: rgba(100, 116, 139, 0.2);
    color: #cbd5e1;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    border: 1px solid rgba(100, 116, 139, 0.4);
}

.markdown-content-host blockquote {
    border-left: 3px solid var(--accent-cyan);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-secondary);
    font-style: italic;
    background: rgba(0, 212, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 0 0.375rem 0.375rem 0;
}

.markdown-content-host table {
    border-collapse: collapse;
    width: auto;
    max-width: 100%;
    margin: 1rem 0;
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: table;
    table-layout: auto;
}

.markdown-content-host th,
.markdown-content-host td {
    border: 1px solid var(--border-primary);
    padding: 0.75rem;
    text-align: left;
    vertical-align: middle;
    word-wrap: break-word;
    white-space: normal;
}

.markdown-content-host th {
    background: var(--gradient-surface);
    font-weight: 600;
    color: var(--accent-cyan);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.markdown-content-host td {
    background: rgba(15, 20, 25, 0.4);
    color: var(--text-primary);
}

.markdown-content-host tbody tr:nth-child(even) td {
    background: rgba(26, 31, 46, 0.4);
}

.markdown-content-host tbody tr:hover td {
    background: var(--bg-tertiary);
}

.markdown-content-host hr {
    border: none;
    height: 1px;
    background: var(--gradient-accent);
    margin: 2rem 0;
    opacity: 0.6;
}

/* Headings in markdown */
.markdown-content-host h1,
.markdown-content-host h2,
.markdown-content-host h3,
.markdown-content-host h4,
.markdown-content-host h5,
.markdown-content-host h6 {
    color: var(--accent-cyan);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.markdown-content-host h1 { font-size: 2rem; }
.markdown-content-host h2 { font-size: 1.75rem; }
.markdown-content-host h3 { font-size: 1.5rem; }
.markdown-content-host h4 { font-size: 1.25rem; }
.markdown-content-host h5 { font-size: 1.125rem; }
.markdown-content-host h6 { font-size: 1rem; }

/* Lists */
.markdown-content-host ul,
.markdown-content-host ol {
    margin: 1rem 0;
    padding-left: 2rem;
    color: var(--text-primary);
}

.markdown-content-host li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* Links */
.markdown-content-host a {
    color: var(--accent-cyan);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.markdown-content-host a:hover {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

/* Paragraphs */
.markdown-content-host p {
    margin: 1rem 0;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Strong and emphasis */
.markdown-content-host strong {
    color: var(--text-primary);
    font-weight: 600;
}

.markdown-content-host em {
    color: var(--text-secondary);
    font-style: italic;
}

/* Images */
.markdown-content-host img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .viewer-nav {
        flex-direction: column;
        padding: 1rem;
    }

    .nav-left {
        flex-direction: column;
        width: 100%;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .station-info {
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .station-dropdown {
        min-width: 120px;
        max-width: 200px;
        margin: 0.25rem 0;
    }

    .station-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .agent-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .station-grid {
        grid-template-columns: 1fr;
    }
}

/* Archive Styles */
.archive-detail {
    margin-top: 1rem;
}

.archive-header {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 2rem;
    border: 1px solid var(--border-primary);
    margin-bottom: 2rem;
}

.archive-title {
    color: var(--text-primary);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.archive-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metadata-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metadata-value {
    color: var(--text-primary);
    font-weight: 500;
}

.archive-abstract {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    border-left: 3px solid var(--accent-cyan);
}

.archive-abstract h3 {
    color: var(--accent-cyan);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.archive-abstract p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.archive-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 1rem;
    color: var(--accent-cyan);
    font-size: 0.875rem;
}

/* Archive message styles */
.archive-message {
    background: var(--gradient-surface);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    position: relative;
    width: 100%;
    max-width: none;
    margin-bottom: 1rem;
}

.archive-message.reviewer-message {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-color: rgba(139, 92, 246, 0.3);
}

.message-title {
    color: var(--accent-cyan);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-primary);
    margin-top: 0.25rem;
}

/* Archive table column widths */
.archive-table .archive-name-col {
    min-width: 280px;
    width: 37%;
}

.archive-table .archive-id-col {
    width: 4%;
    max-width: 45px;
}

.archive-table .archive-author-col {
    width: 9%;
    min-width: 80px;
}

.archive-table .archive-model-col {
    width: 9%;
    min-width: 80px;
}

.archive-table .archive-creation-col,
.archive-table .archive-update-col {
    width: 9%;
    min-width: 70px;
}

.archive-table .archive-responses-col {
    width: 5%;
    min-width: 40px;
}

.archive-table .archive-words-col {
    width: 5%;
    min-width: 45px;
}

.archive-table .archive-score-col {
    width: 5%;
    min-width: 40px;
}

/* Archive table cell text handling */
.archive-table tbody td:first-child {
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Memory Styles */
.memory-detail {
    margin-top: 1rem;
}

.memory-header {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 2rem;
    border: 1px solid var(--border-primary);
    margin-bottom: 2rem;
}

.memory-title {
    color: var(--text-primary);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.memory-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.memory-abstract {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    border-left: 3px solid var(--accent-cyan);
}

.memory-abstract h3 {
    color: var(--accent-cyan);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.memory-abstract p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.memory-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Memory message styles */
.memory-message {
    background: var(--gradient-surface);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    position: relative;
    width: 100%;
    max-width: none;
    margin-bottom: 1rem;
}

/* Memory table column widths - same for both public and private */
.memory-table .memory-name-col {
    min-width: 280px;
    width: 37%;
}

.memory-table .memory-id-col {
    width: 4%;
    max-width: 45px;
}

.memory-table .memory-author-col {
    width: 9%;
    min-width: 80px;
}

.memory-table .memory-model-col {
    width: 9%;
    min-width: 80px;
}

.memory-table .memory-creation-col,
.memory-table .memory-update-col {
    width: 9%;
    min-width: 70px;
}

.memory-table .memory-messages-col {
    width: 5%;
    min-width: 40px;
}

.memory-table .memory-words-col {
    width: 5%;
    min-width: 45px;
}

/* Memory table cell text handling */
.memory-table tbody td:first-child {
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mail table column styles */
.mail-table .mail-name-col {
    min-width: 220px;
    width: 28%;
}

.mail-table .mail-id-col {
    width: 4%;
    max-width: 45px;
}

.mail-table .mail-author-col {
    width: 9%;
    min-width: 80px;
}

.mail-table .mail-model-col {
    width: 9%;
    min-width: 80px;
}

.mail-table .mail-recipients-col {
    width: 10%;
    min-width: 90px;
    max-width: 120px;
}

.mail-table .mail-creation-col,
.mail-table .mail-update-col {
    width: 9%;
    min-width: 70px;
}

.mail-table .mail-messages-col {
    width: 5%;
    min-width: 40px;
}

.mail-table .mail-words-col {
    width: 5%;
    min-width: 45px;
}

/* Mail table cell text handling */
.mail-table tbody td:first-child {
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-table tbody td:nth-child(5) {  /* Recipients column */
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mail Detail Styles */
.mail-detail {
    margin-top: 1rem;
}

.mail-header {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 2rem;
    border: 1px solid var(--border-primary);
    margin-bottom: 2rem;
}

.mail-title {
    color: var(--text-primary);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.mail-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.mail-abstract {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    border-left: 3px solid var(--accent-cyan);
}

.mail-abstract h3 {
    color: var(--accent-cyan);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.mail-abstract p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.mail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Mail message specific styles */
.mail-message {
    background: var(--gradient-surface);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    position: relative;
    width: 100%;
    max-width: none;
    margin-bottom: 1rem;
}

.mail-message .message-title {
    color: var(--accent-cyan);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

/* Research Styles */
.research-detail {
    margin-top: 1rem;
}

.research-header {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 2rem;
    border: 1px solid var(--border-primary);
    margin-bottom: 2rem;
}

.research-title {
    color: var(--text-primary);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.research-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.research-abstract {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    border-left: 3px solid var(--accent-cyan);
}

.research-abstract h3 {
    color: var(--accent-cyan);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.research-abstract p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.research-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.research-evaluation-details {
    margin-top: 1.5rem;
}

.research-evaluation-details h3 {
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.evaluation-message {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.875rem;
}

.secondary-metrics-table {
    margin-top: 1rem;
    background: var(--gradient-surface);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
}

.secondary-metrics-table th {
    background: var(--bg-tertiary);
    color: var(--accent-cyan);
    padding: 0.75rem 1rem;
    text-align: center;
    border-right: 1px solid var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.875rem;
    white-space: nowrap;
}

.secondary-metrics-table th:last-child {
    border-right: none;
}

.secondary-metrics-table td {
    padding: 0.75rem 1rem;
    text-align: center;
    border-right: 1px solid rgba(139, 139, 139, 0.1);
    font-weight: 600;
    color: #ffd700;
}

.secondary-metrics-table td:last-child {
    border-right: none;
}

.secondary-metrics-table tbody tr:last-child td {
    border-bottom: none;
}

.research-content {
    margin-top: 2rem;
}

.research-content h2 {
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    padding: 0;
    margin-bottom: 2rem;
    overflow: hidden;
}

.code-block pre {
    margin: 0;
    color: var(--text-primary);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.code-block code.language-python {
    color: #f8f8f2;
    background: #282a36;
    display: block;
    padding: 1rem;
    border-radius: 0.25rem;
    line-height: 1.5;
}

/* Highlight.js overrides for better contrast */
.hljs {
    background: #282a36 !important;
    color: #f8f8f2 !important;
}

.logs-block {
    background: #1a1a1a;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    padding: 0;
    overflow: hidden;
    max-height: 600px;
    overflow-y: auto;
}

.logs-block pre {
    margin: 0;
    padding: 1rem;
    color: #00ff00;
    background: #0d0d0d;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

/* Research table column styles */
.research-table .research-name-col {
    min-width: 300px;
    width: 35%;
}

.research-table .research-author-col {
    width: 12%;
    min-width: 100px;
}

.research-table .research-model-col {
    width: 12%;
    min-width: 100px;
}

.research-table .research-tick-col {
    width: 10%;
    min-width: 90px;
}

.research-table .research-score-col {
    width: 8%;
    min-width: 70px;
    font-weight: 600;
}

.research-table .research-breakthrough-col {
    width: 10%;
    min-width: 80px;
    text-align: center;
}

/* Breakthrough styles */
.score-breakthrough {
    color: #ffd700;
    font-weight: bold;
}

.breakthrough-yes {
    color: #00ff00;
    font-weight: bold;
    text-align: center;
}

.breakthrough-no {
    color: var(--text-muted);
    text-align: center;
}
