/* =========================================
   Variables & Reset
   ========================================= */
:root { 
    --bg: #ffffff; 
    --card: #ffffff; 
    --text: #1d1d1f; 
    --sub: #86868b; 
    --accent: #002d72; 
    --border: #e8e8ed; 
    --skeleton: #f5f5f7; 
    --color-blue: #002d72; 
    --tag-bg: #f5f5f7; 
    --breaking: #d70000; 
    --text-nonclickable: #444444;
    --bg-read: #f5f5f5;
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
    outline: none; 
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    margin: 0; 
    /* Consolidated from second block for better mobile flow */
    padding: 0; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    min-height: 100vh; 
    -webkit-font-smoothing: antialiased; 
}

#app { 
    width: 100%; 
    max-width: 100%;
}

/* =========================================
   Header & Navigation 
   ========================================= */
.header { 
    margin: 0 0 16px; 
    width: 100%; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
}

.header h1 { 
    font-size: 22px; 
    font-weight: 700; 
    color: var(--accent); 
    margin: 0; 
    cursor: pointer; 
}

.edition { 
    font-size: 11px; 
    color: var(--sub); 
    margin-top: 2px; 
    font-weight: 500; 
}

.nav-tabs { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 16px; 
    overflow-x: auto; 
    padding-bottom: 5px; 
    scrollbar-width: none; 
}

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

.nav-btn { 
    padding: 8px 14px; 
    border-radius: 6px; 
    background: var(--card); 
    color: var(--text); 
    border: 1.2px solid var(--border); 
    font-size: 13px; 
    font-weight: 600; 
    cursor: pointer; 
    white-space: nowrap; 
    transition: all 0.2s; 
}

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

/* =========================================
   Briefing & Categories
   ========================================= */
.briefing-intro { 
    margin-bottom: 24px; 
}

.briefing-headline {
    text-align: left;
    font-size: 20px; 
    font-weight: 800; 
    line-height: 1.35; 
    margin-bottom: 8px; 
    color: var(--text); 
}

.briefing-overview { 
    font-size: 16px; 
    line-height: 1.6; 
    color: var(--sub); 
    text-align: left;
    max-width: 70ch;
}

.category-overview { 
    font-size: 16px; 
    line-height: 1.6; 
    color: var(--sub); 
    text-align: left;
    max-width: 70ch;
}

.category-block { 
    margin-bottom: 32px; 
    opacity: 0; 
    animation: fadeIn 0.5s forwards; 
}

.category-header { 
    margin: 10px 0 5px; 
    border-bottom: 2.5px solid var(--accent); 
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    width: fit-content;
}

.category-title { 
    font-size: 16px; 
    font-weight: 800; 
    color: var(--accent); 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    margin-bottom: 2px; 
}

.toggle-icon {
    font-size: 10px;
    color: var(--accent);
}

.collapsed {
    display: none;
}

/* =========================================
   Story Cards
   ========================================= */
.story-card { 
    background: var(--card); 
    padding: 8px 0px;
    border-bottom: 1px solid var(--border); 
    position: relative; 
}

.story-card:last-child { 
    border-bottom: none; 
}

.story-header { 
    margin-bottom: 8px; 
    background: #f8f8f8;
    padding: 12px;
    border-radius: 0;
}

.story-title { 
    font-size: 18px; 
    font-weight: 700; 
    margin-bottom: 6px; 
    margin-bottom: 4px; 
    line-height: 1.4; 
    color: var(--text);
}

.story-title.clickable {
    color: var(--accent);
    cursor: pointer;
}

.story-title.clickable:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.story-title.single-item-title {
    color: var(--accent);
}

.story-title:not(.single-item-title) {
    text-align: center;
}

.story-slug { 
    font-family: monospace; 
    font-size: 11px; 
    color: var(--sub); 
    margin-bottom: 4px; 
    display: block; 
    opacity: 0.7; 
    text-align: left;
}

.story-header-box .story-slug {
    margin-top: 8px;
    margin-top: 4px;
    margin-bottom: 0;
}

.story-overview { 
    font-size: 16px; 
    line-height: 1.7; 
    color: #1d1d1f; 
}

.story-overview p {
    margin: 4px 0;
}

/* =========================================
   News Items & Clusters
   ========================================= */
.news-cluster { 
    margin-top: 8px; 
    padding-left: 12px; 
    border-left: 2px solid var(--skeleton); 
}

.news-cluster.preview-mode { 
    max-height: 580px; 
    overflow: hidden; 
    position: relative; 
}

.preview-overlay { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    height: 40px; 
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 90%); 
    pointer-events: none; 
    display: none; 
}

.news-cluster.preview-mode .preview-overlay { 
    display: block; 
}

.news-actions { 
    position: relative; 
    z-index: 10; 
    margin-top: 10px; 
    text-align: center; 
    padding-bottom: 10px; 
}

.action-btn { 
    background: var(--bg); 
    color: var(--accent); 
    border: 1.2px solid var(--accent); 
    padding: 12px 32px; 
    border-radius: 24px; 
    font-weight: 800; 
    font-size: 12px; 
    text-transform: uppercase; 
    letter-spacing: 0.08em; 
    cursor: pointer; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    transition: all 0.2s ease; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
}

.action-btn:hover { 
    background: var(--accent); 
    color: #fff; 
}

.action-btn.expanded .icon { 
    transform: rotate(180deg); 
}

.news-item { 
    padding: 12px 0; 
    border-bottom: 1px dashed var(--border); 
}

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

.news-link { 
    text-decoration: none; 
    color: inherit; 
    display: block; 
}

.news-item-title { 
    font-size: 18px; 
    font-weight: 600; 
    line-height: 1.4; 
    margin-bottom: 8px; 
    display: block; 
    color: var(--accent); 
}
/*
.news-item-title:hover { 
    text-decoration: underline;
    text-underline-offset: 4px;
}
*/

.news-meta { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 8px; 
    font-size: 12px; 
    color: var(--sub); 
    width: 100%;
}

.source-tag { 
    color: var(--accent); 
    font-weight: 700; 
    background: none; 
    padding: 0; 
    text-transform: uppercase;
}

.date-tag {
    margin-right: auto;
}

.genre-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.genre-badge.analysis { background: #e3f2fd; color: #1976d2; border: 1px solid #bbdefb; }
.genre-badge.analysis { background: #e3f2fd; color: #002d72; border: 1px solid #002d72; }
.genre-badge.hard-news { display: none; }

.news-summary { 
    font-size: 16px; 
    color: #444; 
    line-height: 1.6; 
    margin-top: 4px; 
    max-width: 70ch;
}

.news-summary ul { 
    margin: 0; 
    padding: 0; 
    list-style: none; 
}

.news-summary li { 
    position: relative; 
    padding-left: 15px; 
    margin-bottom: 3px; 
    display: block; 
}

.news-summary li::before { 
    content: ""; 
    position: absolute; 
    left: 0; 
    top: 7px; 
    width: 6px; 
    height: 6px; 
    background-color: var(--accent); 
    border-radius: 50%; 
}

.news-footer { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
    margin-top: 10px; 
    padding-top: 8px; 
    border-top: 1px dotted #f0f0f0; 
}

.footer-left { 
    display: flex; 
    flex-direction: column; 
    max-width: 85%; 
}

.original-title { 
    font-size: 11px; 
    font-style: italic; 
    color: #999; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    margin-bottom: 4px; 
}

.news-id { 
    margin-left: auto; 
    font-family: monospace; 
    font-size: 10px; 
    color: #ccc; 
    flex-shrink: 0; 
}

.expert-citations {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.citation-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--sub);
    background: var(--tag-bg);
    padding: 2px 6px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid var(--border);
    white-space: nowrap;
    transition: all 0.2s;
    cursor: pointer;
}

.citation-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* =========================================
   Breaking News
   ========================================= */
.breaking-news-wrapper {
    background-color: #fff9f9;
    margin: 20px -12px 20px;
    padding: 20px 12px;
    border-top: 2px solid var(--breaking);
    border-bottom: 1px solid var(--border);
}

.breaking-header {
    font-size: 13px;
    font-weight: 800;
    color: var(--breaking);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.breaking-dot { 
    width: 8px; 
    height: 8px; 
    background: var(--breaking); 
    border-radius: 50%; 
    animation: pulse 1s infinite; 
}

/* =========================================
   Compact Section (Upcoming / Uncategorized)
   ========================================= */
.compact-section {
    margin: 16px 0 24px 0;
    padding: 0 4px;
}

.compact-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.compact-item {
    font-size: 16px;
    line-height: 1.4;
    padding: 4px 0;
    cursor: pointer;
    color: var(--text);
    font-weight: 500;
}

.compact-item:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* =========================================
   Detail & Expert Views
   ========================================= */
#detail-container { display: none; background: var(--bg); min-height: 100vh; padding: 20px 0; }
#detail-container.active { display: block; animation: fadeIn 0.3s ease; }

.detail-title { font-size: 24px; font-weight: 800; line-height: 1.3; margin-bottom: 12px; color: var(--text); }
.detail-summary { font-size: 18px; line-height: 1.6; color: var(--text); margin-bottom: 32px; background-color: #f8f8f8; border-left: 4px solid var(--accent); padding: 12px 16px; }
.subtle-source-link { display: block; margin-top: 16px; margin-bottom: 32px; font-size: 18px; color: var(--sub); text-decoration: none; line-height: 1.5; cursor: pointer; }

/* Ensure context title in expert drawer doesn't conflict with the main drawer title */
.expert-drawer-content .detail-title {
    font-size: 20px !important;
    margin-bottom: 8px;
}

.expert-drawer-content .detail-summary {
    margin-bottom: 0px;
}

.expert-drawer-content .detail-title-row {
    margin-bottom: 8px;
}

.expert-drawer-content .priority-dot-large {
    margin-top: 6px;
}

.expert-drawer-content .subtle-source-link {
    margin-bottom: 8px;
    font-size: 14px;
}

.expert-section { margin-top: 32px; border-top: 2px solid var(--border); padding-top: 24px; }
.expert-label { font-size: 10px; font-weight: 700; color: var(--sub); letter-spacing: 0.5px; margin-top: 4px; text-transform: uppercase; text-align: center; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expert-label.active { color: var(--accent); }
.expert-toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.expert-toolbar-item { display: flex; flex-direction: column; align-items: center; width: 64px; cursor: pointer; }

.expert-card { background: #f9f9f9; border: 1px solid var(--border); border-radius: 0; padding: 16px; margin-bottom: 24px; }
.expert-header { font-weight: 700; font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: var(--accent); }

.expert-body {
    font-size: 16px;
    line-height: 1.6;
    max-width: 100%;
    overflow-wrap: break-word;
}

.expert-body h1, .expert-body h2, .expert-body h3, .expert-body h4, .expert-body h5, .expert-body h6 {
    font-size: 18px !important;
    font-weight: bold;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.expert-body ul, .expert-body ol {
    padding-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.expert-body li {
    margin-bottom: 4px;
}

.expert-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.expert-body th, .expert-body td {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    text-align: left;
}

.expert-body th {
    background-color: #f5f5f7;
    font-weight: 600;
}

.expert-anchor { display: block; position: relative; top: -100px; visibility: hidden; }

.expert-card-footer { margin-bottom: 24px; padding-left: 4px; }
.back-to-top-link { font-size: 11px; color: var(--sub); cursor: pointer; opacity: 0.6; transition: opacity 0.2s; display: inline-block; }
.back-to-top-link:hover { opacity: 1; text-decoration: underline; }

/* =========================================
   Avatars
   ========================================= */
.avatar-group {
    display: flex;
    flex-direction: row;
    margin-left: 8px;
    align-items: center;
}

/* Expert Avatar & Status Indicators */
.expert-avatar-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin: 0 2px;
}

.expert-avatar-container.clickable {
    cursor: pointer;
}

.expert-avatar-base {
    border: 2px solid #fff !important;
    font-weight: 800 !important;
    color: #fff !important;
    box-sizing: border-box;
}

/* Status Rings */
.expert-status-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.expert-status-ring.processing {
    border: 3px solid transparent;
    border-top-color: #FFD700;
    border-right-color: #FFD700;
    animation: spin 1s linear infinite;
}

.expert-status-ring.ready {
    border: 3px solid #002d72;
}

/* Status Dots */
.expert-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    z-index: 10;
}

.expert-status-dot.queue {
    background-color: #FFD700;
    animation: pulse 1.5s infinite;
}

.expert-status-dot.error {
    background-color: #d32f2f;
}

.expert-status-dot.ready {
    background-color: var(--accent);
}

.expert-badge-unread {
    position: absolute;
    top: -4px;
    right: -4px;
    left: auto;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color:  var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 0 0 2px #fff;
}

/* Only show badge (green dot) for the first item in the active group stack */
.expert-active-group .expert-avatar-container:not(:first-child) .MuiBadge-badge {
    display: none !important;
}

/* Expert Group Layout */
.expert-group-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.expert-bottom-bar .expert-group-container {
    gap: 12px;
}

/* Avatar Group Overrides for Read Items */
.expert-read-group {
    display: flex;
    align-items: center;
}

.expert-read-group .expert-wrapper {
    margin: 0 !important;
    margin-left: -16px !important;
}

.expert-read-group .expert-wrapper:first-child {
    margin-left: 0 !important;
}

/* Avatar Group Overrides for Read Items */
.expert-read-group .MuiAvatar-root {
    border: 2px solid #fff !important;
    cursor: pointer;
    font-weight: 800;
    box-sizing: content-box;
    margin-left: -16px !important;
}

.expert-read-group .MuiAvatar-root:first-child {
    margin-left: 0 !important;
}

/* Active/Unread Group Stacking */
.expert-active-group {
    display: flex;
    align-items: center;
}

.expert-active-group .expert-wrapper {
    margin: 0 !important;
    margin-left: -8px !important;
}

.expert-active-group .expert-wrapper:first-child {
    margin-left: 0 !important;
}

/* Expert Selector Drawer */
.expert-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 56px);
    gap: 12px;
    justify-content: center;
    max-width: 340px;
    margin: 0 auto;
}

.expert-selector-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 56px;
    cursor: pointer;
    position: relative;
}

/* =========================================
   Expert Monitor & Loading
   ========================================= */

.expert-inbox-view{
    padding-top: 6px !important;
}

#expert-monitor {
    /* Legacy container, keeping just in case JS references it */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 320px;
    align-items: flex-end;
}

.expert-monitor-snackbar {
    transition: top 0.3s ease, opacity 0.3s ease, transform 0.3s ease !important;
}

.expert-monitor-snackbar.exiting {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
    pointer-events: none;
}

#expert-monitor-loading {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 450px;
    transition: all 0.3s ease;
    align-items: flex-end;
}

#expert-monitor-toasts {
    position: fixed;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    transition: all 0.3s ease;
    max-width: 450px;
    align-items: flex-end;
}

#expert-monitor-toasts > * { pointer-events: auto; }

.monitor-loading-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    pointer-events: auto;
    width: fit-content;
}

.monitor-label { font-size: 11px; font-weight: 700; color: var(--sub); text-transform: uppercase; }

.toast-content { flex: 1; min-width: 0; }
.toast-title { 
    font-size: 13px; 
    font-weight: 700; 
    color: var(--text); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.toast-sub { font-size: 11px; color: var(--accent); font-weight: 600; }
.toast-close { 
    background: none; border: none; color: var(--sub); font-size: 18px; cursor: pointer; padding: 0 4px; 
}

/* =========================================
   Floating Elements & Loaders
   ========================================= */
.floating-back-btn { 
    display: none; 
    align-items: center; 
    justify-content: center; 
    text-decoration: none; 
    color: var(--accent); 
    width: 40px; 
    height: 40px; 
    background: rgba(255, 255, 255, 0.95); 
    border: 1.2px solid var(--border); 
    border-radius: 50%; 
    font-size: 18px; 
    z-index: 1200; 
    backdrop-filter: blur(10px); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
    cursor: pointer; 
    position: fixed; 
    bottom: 30px; 
    left: 20px; 
}

.floating-back-btn.visible { display: flex; }

.loading-screen { 
    text-align: center; 
    padding-top: 80px; 
    color: var(--sub); 
    font-size: 14px; 
    font-weight: 600; 
}

.loading-avatar-wrapper { position: relative; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.loading-avatar-wrapper .avatar { z-index: 2; }
.loading-ring { width: 40px; height: 40px; border: 3px solid rgba(0, 45, 114, 0.2); border-top-color: #002d72; border-radius: 50%; animation: spin 1s linear infinite; }

.spinner { width: 16px; height: 16px; border: 2px solid var(--accent); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; }

/* Clip Menu Item (Shared for Tabs and Buttons) */
.clip-menu-item {
    min-height: 32px !important;
    height: 32px !important;
    min-width: auto !important;
    border-radius: 16px !important;
    padding: 0 16px !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    text-transform: none !important;
    color: var(--sub) !important;
    border: 1px solid rgba(0, 0, 0, 0.23) !important;
    background-color: transparent !important;
    transition: all 0.2s !important;
    box-shadow: none !important;
    white-space: nowrap !important;
}

.clip-menu-item.active, 
.clip-menu-item.Mui-selected,
.clip-menu-item.MuiButton-contained {
    color: #fff !important;
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
}

.clip-menu-item:hover:not(.active):not(.Mui-selected):not(.MuiButton-contained) {
    background-color: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.23) !important;
}

.clip-menu-item:active {
    transform: scale(0.96) !important;
}

/* =========================================
   Animations
   ========================================= */
@keyframes fadeIn { 
    to { opacity: 1; } 
}

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

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

@keyframes rotate-blue {
    0% { transform: rotate(0deg); border-color: #002d72 transparent transparent transparent; }
    50% { transform: rotate(180deg); border-color: transparent #002d72 transparent transparent; }
    100% { transform: rotate(360deg); border-color: #002d72 transparent transparent transparent; }
}

/* =========================================
   Media Queries
   ========================================= */

/* Desktop / Tablet Alignment */
@media (min-width: 601px) {
    .floating-back-btn { left: calc(50% - 345px); top: 80px; bottom: auto; }
    
    #expert-monitor-toasts { bottom: 90px; right: 20px; }
    #expert-monitor-loading:empty + #expert-monitor-toasts { bottom: 20px; }
}

/* Mobile Overrides (High Specificity) */
@media screen and (max-width: 600px) {
    .header h1 { font-size: 24px; }
    .edition { font-size: 13px; }
    .nav-btn { font-size: 15px; }
    .briefing-headline { font-size: 22px; }
    .briefing-overview { font-size: 18px; }
    .category-overview { font-size: 18px; }
    .category-title { font-size: 18px; }
    .story-title { font-size: 20px; }
    .story-slug { font-size: 13px; }
    .story-overview { font-size: 18px; }
    .action-btn { font-size: 13px; }
    .news-item-title { font-size: 18px; }
    .news-meta { font-size: 14px; }
    .news-summary { font-size: 18px; }
    .original-title { font-size: 13px; }
    .news-id { font-size: 12px; }
    .loading-screen { font-size: 16px; }
    .breaking-header { font-size: 15px; }
    .compact-item-title { font-size: 18px; }
    .compact-genre-label { font-size: 13px; }
    .compact-date-text { font-size: 13px; }
    .detail-title { font-size: 26px; }
    .detail-summary { font-size: 20px; }
    .subtle-source-link { font-size: 20px; }
    .expert-label { font-size: 14px; }
    .expert-btn { font-size: 15px; }
    .expert-header { font-size: 16px; }
    .expert-body { font-size: 18px; }
    .mini-badge { font-size: 11px; }
    .floating-back-btn { font-size: 20px; }
    
    /* Mobile Monitor Adjustments */
    #expert-monitor-toasts {
        top: 20px; left: 50%; transform: translateX(-50%);
        width: 90%; align-items: center;
    }
    #expert-monitor-loading {
        bottom: 20px; right: 20px; left: auto;
        max-width: calc(100% - 40px);
    }
    .monitor-loading-group { max-width: 100%; }
    .expert-body { font-size: 18px; }
}

/* =========================================
   React Component Classes (Refactored)
   ========================================= */
.app-bar { color: var(--text) !important; }
.app-bar .MuiContainer-root { max-width: 550px !important; }
.app-logo { margin-right: 16px !important; color: var(--accent) !important; font-weight: 700 !important; }
.nav-tab { font-weight: 600 !important; }

.briefing-container { padding-top: 16px; padding-bottom: 32px; max-width: 550px !important; }
.edition-info { margin-top: 8px; display: block; font-size: 0.75rem; color: var(--sub); }
.reload-btn { margin-left: 8px; background: none; border: none; cursor: pointer; font-size: 14px; color: #666; }

.breaking-news-content { background: var(--card); border-radius: 8px; border: 1px solid var(--border); padding: 16px; }

.chip-domain { height: 20px !important; font-size: 0.7rem !important; background-color: #e2e8f0 !important; }
.chip-date { color: var(--sub) !important; font-size: 0.75rem !important; border-color: var(--border) !important; }
.chip-genre { height: 20px !important; font-size: 0.7rem !important; background-color: #ebf8ff !important; color: #002d72 !important; }

.news-item-experts { display: flex; gap: 2px; }

.story-header-box { border-left: 4px solid var(--accent); padding: 12px 12px; margin-bottom: 12px; background-color: #f8f8f8; }
.story-header-box { border-left: 4px solid var(--accent); padding: 8px 12px; margin-bottom: 8px; background-color: #f8f8f8; }
.story-header-box.clickable { cursor: pointer; }
.expand-btn {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--accent) !important; 
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin: 12px auto 8px auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0px;
    cursor: pointer !important;
    user-select: none !important;
    background-color: transparent !important;
    border: none !important;
    border-bottom: 2.0px solid transparent !important;
    width: fit-content;
    transition: border-color 0.2s;
}

.expand-btn:hover {
    border-bottom-color: var(--accent) !important;
    text-decoration: none !important;
}

.expand-label {
    margin-bottom: 0px;
}

.expand-icon {
    font-size: 10px;
    color: var(--accent);
}

.inbox-group-header { padding: 8px 12px; background-color: #f8f8f8; }
.inbox-group-header.clickable { cursor: pointer; }
.inbox-group-title { font-size: 1rem; margin-bottom: 6px; text-align: left; line-height: 1.3; font-weight: 400; color: var(--text); }

.detail-header-nav { display: flex; justify-content: space-between; margin-bottom: 16px; }
.detail-meta { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.detail-divider { margin-top: 32px !important; margin-bottom: 32px !important; }
.detail-container { padding-top: 24px; padding-bottom: 40px; max-width: 550px !important; }
.detail-citations { margin-bottom: 24px; display: flex; gap: 8px; flex-wrap: wrap; }

.expert-pending-box { display: flex; align-items: center; gap: 16px; padding: 16px; background-color: #f8f9fa; border-radius: 8px; margin-bottom: 16px; }

.detail-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 12px;
    padding-bottom: 0px;
    border-top: 1px solid #eee;
}

.footer-powered { display: flex; align-items: center; justify-content: center; font-size: 12px; color: #888; }

.monitor-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.monitor-panel { padding: 8px; min-width: 200px; cursor: pointer; background-color: white; border-left: 4px solid #002d72; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.monitor-list { margin-top: 8px; max-height: 200px; overflow-y: auto; }
.monitor-item { display: flex; align-items: center; gap: 8px; margin-top: 4px; cursor: pointer; padding: 4px; }
.monitor-item:hover { background-color: #f5f5f5; }
.loading-ring-wrapper { position: relative; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.loading-ring-anim { position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: #002d72; animation: spin 1s linear infinite; }

.expert-avatar-container { position: relative; display: inline-block; }
.expert-avatar-container.clickable { cursor: pointer; }
.expert-title { font-weight: 600; font-size: 16px; color: var(--text); }

.news-item-original-title {
    font-size: 12px;
    color: #999;
    line-height: 1.2;
    padding-left: 15px;
}
.news-item-original-title.clickable { cursor: pointer; }
.news-item-original-title.clickable:hover {
    text-decoration: underline;
}

/* Layout Utilities */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-between-start { display: flex; justify-content: space-between; align-items: flex-start; }
.flex-between-end { display: flex; justify-content: space-between; align-items: flex-end; }
.flex-center { display: flex; align-items: center; }
.flex-column-center { display: flex; flex-direction: column; align-items: center; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.text-center { text-align: center; }

/* Spacing Utilities */
.m0 { margin: 0 !important; }
.mb6 { margin-bottom: 6px !important; }
.mb8 { margin-bottom: 8px !important; }
.mb16 { margin-bottom: 16px !important; }
.mr8 { margin-right: 8px !important; }
.ml8 { margin-left: 8px !important; }
.mt8 { margin-top: 8px !important; }

/* Component Styles */
.priority-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; margin-left: 8px; flex-shrink: 0; opacity: 0.5; }
.priority-dot-large { width: 12px; height: 12px; border-radius: 50%; margin-top: 8px; margin-left: 12px; flex-shrink: 0; opacity: 0.5; }
.news-item-source-name { font-weight: bold; font-size: 0.75rem; margin-right: 8px; color: #000; }
.news-item-id-text { font-size: 11px; color: #ccc; margin-left: 4px; }
.news-item-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f5f5f5;
}
.detail-id-text { color: #999; font-size: 12px; margin-right: 8px; }
.detail-footer-box { display: flex; align-items: center; justify-content: center; border-top: 1px solid #eee; padding: 16px 0; }
.footer-powered-text { text-align: center; color: var(--sub); font-size: 0.75rem; font-weight: 500; opacity: 0.6; }
.app-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 24px;
    padding-bottom: 24px;
    gap: 8px;
    color: var(--sub);
    width: 100%;
}
.expert-avatar-large { width: 40px !important; height: 40px !important; font-size: 18px !important; font-weight: bold !important; border: 2px solid #fff !important; }
.compact-row { display: flex; align-items: center; }
.compact-item-title { 
    font-size: 16px; 
    flex: 1; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    line-height: 1.2;
}
.compact-item-title.clickable { cursor: pointer; }
.dialog-pre-box { margin: 0; font-size: 0.85rem; font-family: Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.reload-menu-last-loaded { padding: 4px 16px; font-size: 0.75rem; color: #999; }
.reload-dialog-timestamp { font-size: 0.9em; color: #666; }

/* Genre label in compact rows */
.compact-genre-label {
    font-size: 0.75rem; /* Matches .news-item-source-name */
    color: var(--primary-color, #002d72);
    font-weight: bold;
    margin-right: 8px;
    text-transform: uppercase;
    line-height: 1.2;
}

/* Date text in compact rows */
.compact-date-text {
    font-size: 0.75rem; /* Matches .news-item-source-name */
    line-height: 1.2;
}

.news-cluster > .compact-news-row:first-child {
    border-top: none !important;
}

/* Expert Badges */
.expert-badge-queued .MuiBadge-badge {
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 2px #fff;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expert-badge-queued .MuiBadge-badge .material-symbols-outlined {
    font-size: 8px;
    color: #fff;
    animation: hourglass-spin 8s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes hourglass-spin {
    0% { transform: rotate(0deg); }
    40% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
    90% { transform: rotate(180deg); }
    100% { transform: rotate(360deg); }
}

.expert-badge-check .MuiBadge-badge {
    background-color: #9e9e9e;
    color: #fff;
    box-shadow: 0 0 0 2px #fff;
    width: 14px;
    height: 14px;
    min-width: 14px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expert-badge-check .MuiBadge-badge .material-symbols-outlined {
    font-size: 14px;
    color: #fff;
}

.expert-badge-failed .MuiBadge-badge {
    background-color: #d32f2f;
    box-shadow: 0 0 0 2px #fff;
}

.expert-badge-stale .MuiBadge-badge {
    background-color: #ffa000;
    box-shadow: 0 0 0 2px #fff;
}

.expert-badge-success .MuiBadge-badge {
    background-color: var(--accent);
    box-shadow: 0 0 0 2px #fff;
}

/* App Header (Briefing) */
.app-header-container {
    padding-top: 32px;
    padding-bottom: 0;
    max-width: 550px !important;
}

.app-header-title {
    font-weight: 700 !important;
    color: var(--accent) !important;
    margin-bottom: 4px !important;
}

.app-header-date {
    color: var(--sub) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.8rem !important;
    margin-bottom: 8px !important;
}

@media (max-width: 600px) {
    .app-header-container {
        padding-top: 16px;
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Expert Inbox Header */
.expert-inbox-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 16px;
}
