/* ===== CSS Variables & Reset ===== */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-hover: #1e2a45;
    --bg-table-header: #0f172a;
    --bg-table-row-alt: #0d1424;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --text-accent: #38bdf8;

    --border-color: #1e293b;
    --border-light: #334155;

    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-orange: #f97316;

    --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-header: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --gradient-card: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 13px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background animated gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.app-container {
    position: relative;
    z-index: 1;
    max-width: 100%;
    padding: 0 16px 40px;
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--gradient-header);
    border-bottom: 1px solid var(--border-color);
    margin: 0 -16px 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.4));
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.4)); }
    50% { filter: drop-shadow(0 0 24px rgba(59, 130, 246, 0.7)); }
}

.header-info h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-panel {
    display: flex;
    gap: 16px;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 90px;
}

.status-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.status-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-accent);
    margin-top: 2px;
}

.countdown {
    color: var(--accent-amber) !important;
    animation: countdown-pulse 1s ease-in-out infinite;
}

@keyframes countdown-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.countdown-item {
    border-color: rgba(245, 158, 11, 0.3);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.connection-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-amber);
    animation: blink 1.5s ease-in-out infinite;
}

.connection-status.connected .dot {
    background: var(--accent-emerald);
    animation: none;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.connection-status.error .dot {
    background: var(--accent-rose);
    animation: none;
}

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

/* ===== Latest Result Banner ===== */
.latest-result {
    margin-bottom: 16px;
    padding: 14px 20px;
    background: var(--gradient-card);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-lg);
    animation: slide-in 0.5s var(--transition-slow);
}

@keyframes slide-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.latest-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

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

.latest-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.latest-issue {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-accent);
    margin-left: auto;
    background: rgba(59, 130, 246, 0.1);
    padding: 3px 10px;
    border-radius: 20px;
}

.latest-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.latest-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    animation: pop-in 0.3s ease backwards;
}

.latest-num.prize-db { background: linear-gradient(135deg, #dc2626, #ef4444); color: white; }
.latest-num.prize-1 { background: linear-gradient(135deg, #ea580c, #f97316); color: white; }
.latest-num.prize-2 { background: linear-gradient(135deg, #d97706, #f59e0b); color: white; }
.latest-num.prize-3 { background: linear-gradient(135deg, #059669, #10b981); color: white; }
.latest-num.prize-4 { background: linear-gradient(135deg, #0284c7, #38bdf8); color: white; }
.latest-num.prize-5 { background: linear-gradient(135deg, #7c3aed, #8b5cf6); color: white; }
.latest-num.prize-6 { background: linear-gradient(135deg, #6d28d9, #a78bfa); color: white; }
.latest-num.prize-7 { background: linear-gradient(135deg, #475569, #64748b); color: white; }
.latest-num.prize-8 { background: linear-gradient(135deg, #334155, #475569); color: white; }

@keyframes pop-in {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== Controls ===== */
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }
.btn-refresh:hover { border-color: var(--accent-cyan); }
.btn-refresh svg { transition: transform 0.5s ease; }
.btn-refresh:hover svg { transform: rotate(180deg); }
.btn-clear:hover { border-color: var(--accent-rose); }

/* Toggle Switch */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    user-select: none;
}

.toggle-label input { display: none; }

.toggle-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--border-light);
    border-radius: 20px;
    transition: var(--transition-normal);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-normal);
}

.toggle-label input:checked + .toggle-slider {
    background: var(--accent-blue);
}

.toggle-label input:checked + .toggle-slider::after {
    transform: translateX(18px);
}

/* ===== Tab Navigation ===== */
.tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    flex: 1;
    justify-content: center;
    position: relative;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
}

.tab-btn svg {
    flex-shrink: 0;
}

/* ===== Tab Content ===== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: tab-fade-in 0.3s ease;
}

@keyframes tab-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Table (Shared) ===== */
.table-wrapper {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    background: var(--bg-secondary);
}

.table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 340px);
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.table-container::-webkit-scrollbar { width: 8px; height: 8px; }
.table-container::-webkit-scrollbar-track { background: transparent; }
.table-container::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
.table-container::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Frequency Table (Tab 1) ===== */
#statsTable {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
}

#statsTable thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

#statsTable thead th {
    background: var(--bg-table-header);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 8px 4px;
    text-align: center;
    border-bottom: 2px solid var(--accent-blue);
    white-space: nowrap;
    min-width: 28px;
    letter-spacing: 0.02em;
    position: relative;
}

#statsTable thead th:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Sticky first column */
.sticky-col {
    position: sticky !important;
    left: 0;
    z-index: 25 !important;
    background: var(--bg-table-header) !important;
}

.col-issue {
    min-width: 120px !important;
    max-width: 120px;
    text-align: left !important;
    padding-left: 12px !important;
}

tbody .sticky-col {
    background: var(--bg-secondary) !important;
    z-index: 10 !important;
}

tbody tr:nth-child(even) .sticky-col {
    background: var(--bg-table-row-alt) !important;
}

tbody tr:hover .sticky-col {
    background: var(--bg-hover) !important;
}

#statsTable tbody tr {
    transition: background var(--transition-fast);
}

#statsTable tbody tr:nth-child(even) {
    background: var(--bg-table-row-alt);
}

#statsTable tbody tr:hover {
    background: var(--bg-hover);
}

#statsTable tbody td {
    text-align: center;
    padding: 5px 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
    color: var(--text-muted);
    min-width: 28px;
    position: relative;
    transition: all var(--transition-fast);
}

#statsTable tbody td.has-value { color: var(--accent-cyan); font-weight: 700; }
#statsTable tbody td.has-value-2 { color: var(--accent-amber); font-weight: 700; }
#statsTable tbody td.has-value-3 { color: var(--accent-rose); font-weight: 800; }

#statsTable tbody td.issue-cell {
    text-align: left;
    padding-left: 12px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

#statsTable tbody td.issue-cell .issue-date {
    color: var(--text-primary);
    font-weight: 600;
    display: block;
}

#statsTable tbody td.issue-cell .issue-id {
    color: var(--text-muted);
    font-size: 0.65rem;
}

#statsTable tbody tr.new-row {
    animation: highlight-row 2s ease-out;
}

@keyframes highlight-row {
    0% { background: rgba(59, 130, 246, 0.2); }
    100% { background: transparent; }
}

#statsTable thead th.decade-start { border-left: 2px solid var(--border-light); }
#statsTable tbody td.decade-start { border-left: 2px solid rgba(30, 41, 59, 0.8); }

#statsTable td.col-highlight { background: rgba(59, 130, 246, 0.06); }

/* ===== Cycle Table (Tab 2) ===== */
.cycle-table-container {
    max-height: calc(100vh - 340px);
}

.cycle-table {
    border-collapse: collapse;
    width: 100%;
}

.cycle-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.cycle-table thead th {
    background: var(--bg-table-header);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 10px 12px;
    text-align: center;
    border-bottom: 2px solid var(--accent-purple);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.cycle-table .col-number {
    min-width: 50px !important;
    max-width: 60px;
    text-align: center !important;
    padding: 10px 8px !important;
}

.cycle-table .col-count { min-width: 90px; }
.cycle-table .col-maxgap { min-width: 90px; }
.cycle-table .col-currentgap { min-width: 90px; }
.cycle-table .col-diff { min-width: 90px; }
.cycle-table .col-gaplist {
    min-width: 300px;
    text-align: left !important;
}

.cycle-table tbody tr {
    transition: background var(--transition-fast);
}

.cycle-table tbody tr:nth-child(even) {
    background: var(--bg-table-row-alt);
}

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

.cycle-table tbody td {
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
    color: var(--text-secondary);
    text-align: center;
    transition: all var(--transition-fast);
}

/* Number column styling */
.cycle-table tbody td.cell-number {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    position: sticky;
    left: 0;
    z-index: 10;
}

.cycle-table tbody tr:nth-child(even) td.cell-number {
    background: var(--bg-table-row-alt);
}

.cycle-table tbody tr:hover td.cell-number {
    background: var(--bg-hover);
}

.cycle-table tbody td.cell-count {
    font-weight: 700;
    color: var(--text-accent);
}

.cycle-table tbody td.cell-maxgap {
    font-weight: 700;
    color: var(--accent-orange);
}

.cycle-table tbody td.cell-currentgap {
    font-weight: 700;
}

.cycle-table tbody td.cell-diff {
    font-weight: 700;
}

/* Highlight overdue numbers (diff <= 0 means current gap >= max gap) */
.cycle-table tbody tr.overdue {
    background: rgba(16, 185, 129, 0.08) !important;
}

.cycle-table tbody tr.overdue td.cell-diff {
    color: var(--accent-emerald);
}

.cycle-table tbody tr.overdue td.cell-currentgap {
    color: var(--accent-rose);
}

/* Warning level: close to max gap */
.cycle-table tbody tr.warning td.cell-diff {
    color: var(--accent-amber);
}

.cycle-table tbody tr.warning td.cell-currentgap {
    color: var(--accent-amber);
}

/* Gap list styling */
.cycle-table tbody td.cell-gaplist {
    text-align: left;
    font-size: 0.72rem;
    color: var(--text-muted);
    max-width: 500px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cycle-table tbody td.cell-gaplist:hover {
    white-space: normal;
    word-break: break-all;
}

.gap-chip {
    display: inline-block;
    padding: 1px 4px;
    margin: 1px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.gap-chip.gap-high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
}

.gap-chip.gap-max {
    background: rgba(244, 63, 94, 0.2);
    color: var(--accent-rose);
    font-weight: 800;
}

.gap-chip.gap-low {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
}

/* ===== Empty State ===== */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state.visible {
    display: flex;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header { padding: 12px 16px; }
    .header-right { width: 100%; flex-wrap: wrap; }
    .status-panel { flex-wrap: wrap; width: 100%; }
    .status-item { flex: 1; min-width: 70px; }
    html { font-size: 12px; }
    .col-issue { min-width: 90px !important; }
    .tab-btn { padding: 8px 12px; font-size: 0.8rem; }
    .tab-btn svg { display: none; }
}

/* ===== Utility Animations ===== */
.spin {
    animation: spin 1s linear infinite;
}

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

/* ===== Prediction Tab ===== */
.prediction-current {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.pred-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.pred-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pred-icon { font-size: 1.8rem; }

.pred-card-title h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.pred-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-top: 2px;
}

.pred-method-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.pred-numbers {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.pred-num-card {
    flex: 1;
    min-width: 120px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.pred-num-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
}

.pred-rank {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.pred-num-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 4px 0;
}

.pred-confidence {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}

.pred-conf-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.pred-conf-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--gradient-primary);
    transition: width 0.8s ease;
}

.pred-factors {
    display: flex;
    gap: 3px;
    justify-content: center;
}

.pred-factor-mini {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    opacity: 0.3;
}

.pred-factor-mini.active { opacity: 1; }
.f-overdue { background: var(--accent-rose); }
.f-proximity { background: var(--accent-orange); }
.f-deficit { background: var(--accent-amber); }
.f-recent { background: var(--accent-cyan); }
.f-consistency { background: var(--accent-emerald); }

.pred-factors-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.factor-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.factor-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

/* Accuracy Summary */
.pred-accuracy {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.accuracy-item {
    flex: 1;
    min-width: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    text-align: center;
}

.accuracy-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.accuracy-value {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.accuracy-value.accent-green { color: var(--accent-emerald); }
.accuracy-value.accent-blue { color: var(--accent-cyan); }

/* Prediction History */
.pred-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pred-history-header h3 {
    font-size: 1rem;
    color: var(--text-primary);
}

.btn-clear-pred {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-clear-pred:hover {
    border-color: var(--accent-rose);
    color: var(--accent-rose);
}

.pred-table-container { max-height: 400px; }

.pred-table {
    border-collapse: collapse;
    width: 100%;
}

.pred-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.pred-table thead th {
    background: var(--bg-table-header);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 10px 12px;
    text-align: center;
    border-bottom: 2px solid var(--accent-purple);
}

.pred-col-issue { min-width: 120px; text-align: left !important; padding-left: 12px !important; }
.pred-col-num { min-width: 80px; }
.pred-col-result { min-width: 80px; }

.pred-table tbody tr {
    transition: background var(--transition-fast);
}

.pred-table tbody tr:nth-child(even) { background: var(--bg-table-row-alt); }
.pred-table tbody tr:hover { background: var(--bg-hover); }

.pred-table tbody td {
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
    text-align: center;
    color: var(--text-secondary);
}

.pred-table tbody td.pred-issue-cell {
    text-align: left;
    padding-left: 12px;
    font-size: 0.72rem;
}

/* Hit/Miss number styling */
.pred-num-hit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 30px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.85rem;
}

.pred-num-hit.hit {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.pred-num-hit.miss {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.2);
    opacity: 0.7;
}

.pred-num-hit.pending {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.pred-result-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pred-result-badge.result-hit {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.pred-result-badge.result-miss {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-rose);
    opacity: 0.6;
}

.pred-result-badge.result-pending {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
}
