:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(18, 24, 38, 0.85);
    --bg-card-hover: rgba(28, 36, 56, 0.95);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(59, 130, 246, 0.4);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-subtle: #6b7280;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-gold: #f59e0b;
    --accent-purple: #8b5cf6;
    --accent-red: #ef4444;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-tag {
    font-size: 11px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.sync-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.nav-tabs {
    display: flex;
    gap: 4px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    color: #fff;
    background: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-action {
    background: #1f2937;
    border: 1px solid #374151;
    color: #fff;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action:hover {
    background: #374151;
    border-color: #4b5563;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Main Container */
.main-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
}

/* Trainer Hero */
.trainer-hero {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.35) 0%, rgba(17, 24, 39, 0.8) 100%);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.trainer-avatar-ring {
    position: relative;
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.team-emblem {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.level-badge {
    position: absolute;
    bottom: -6px;
    background: #0f172a;
    border: 2px solid #3b82f6;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
}

.trainer-identity h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.trainer-subtext {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.pill-team {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 11px;
}

.dot-sep {
    color: var(--text-subtle);
}

/* Level Progress Block */
.hero-center {
    flex: 1;
    max-width: 440px;
}

.level-progress-block {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
}

.level-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.cap-tag {
    font-size: 10px;
    background: #f59e0b;
    color: #000;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
}

.xp-ratio {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #93c5fd;
    font-weight: 600;
}

.progress-bar-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    border-radius: 6px;
    transition: width 0.8s ease-in-out;
}

.progress-sub-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* Stat Pills */
.stat-pill-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.stat-pill {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 130px;
}

.pill-icon {
    font-size: 20px;
}

.pill-value {
    font-size: 14px;
    font-weight: 800;
    display: block;
    color: #fff;
}

.pill-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tab Panes */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Filter Toolbar */
.filter-toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.search-box {
    display: flex;
    align-items: center;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    flex: 1;
    min-width: 280px;
}

.search-icon {
    margin-right: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.search-box input {
    background: none;
    border: none;
    color: #fff;
    font-size: 13px;
    width: 100%;
    outline: none;
}

.clear-search-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
}

.filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chip {
    background: #1e293b;
    border: 1px solid #334155;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    color: #fff;
    border-color: #475569;
}

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

.chip-shiny.active { background: #d97706; border-color: #f59e0b; }
.chip-hundo.active { background: #b91c1c; border-color: #ef4444; }
.chip-highiv.active { background: #047857; border-color: #10b981; }

.sort-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.sort-box select {
    background: #0f172a;
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

/* Pokemon Grid */
.pokemon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.poke-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.poke-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
    background: var(--bg-card-hover);
}

.poke-card.is-hundo {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.15);
}

.card-top-badges {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.cp-badge {
    background: #1e293b;
    border: 1px solid #334155;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.iv-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.iv-100 { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; box-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }
.iv-90 { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #10b981; }
.iv-80 { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid #3b82f6; }
.iv-low { background: rgba(107, 114, 128, 0.2); color: #9ca3af; border: 1px solid #4b5563; }

.poke-sprite-container {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
    position: relative;
}

.poke-sprite {
    max-height: 110px;
    max-width: 110px;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
    transition: transform 0.2s;
}

.poke-card:hover .poke-sprite {
    transform: scale(1.08);
}

.poke-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poke-subinfo {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.iv-bar-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.iv-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.iv-label { width: 24px; }
.iv-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.iv-fill { height: 100%; border-radius: 2px; }
.iv-fill-atk { background: #ef4444; }
.iv-fill-def { background: #3b82f6; }
.iv-fill-sta { background: #10b981; }
.iv-num { width: 14px; text-align: right; font-family: 'JetBrains Mono', monospace; }

/* Item Bag Grid */
.items-summary-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.item-categories-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.item-cat-btn {
    background: #1f2937;
    border: 1px solid #374151;
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.item-card-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-card-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.item-card-count {
    font-size: 13px;
    color: #60a5fa;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

.stats-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.stat-metrics-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.stat-row-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #fff;
}

.type-chart-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.type-stat-bar {
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 16px;
    width: 480px;
    max-width: 90%;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-lg {
    width: 680px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.dropzone {
    border: 2px dashed #4b5563;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

.dropzone-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.dropzone-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.file-watcher-hint {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 14px;
}

/* Raw JSON Viewer */
.raw-json-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
}

.raw-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

pre code {
    display: block;
    background: #0b0f19;
    padding: 16px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    max-height: 600px;
    overflow: auto;
    color: #a7f3d0;
}


/* Account Picker */
.account-picker-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 3px 8px;
}

.account-icon {
    font-size: 14px;
}

.account-select {
    background: transparent;
    border: none;
    color: #f3f4f6;
    font-size: 12px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.account-select option {
    background: #1f2937;
    color: #fff;
}

.btn-setup {
    background: linear-gradient(135deg, #059669, #10b981) !important;
}

.btn-setup:hover {
    filter: brightness(1.15);
}

/* Pokemon Form Tags */
.poke-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    margin-bottom: 6px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.2px;
}

.tag-alola {
    background: rgba(6, 182, 212, 0.2);
    border: 1px solid #06b6d4;
    color: #67e8f9;
}

.tag-galar {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid #a855f7;
    color: #d8b4fe;
}

.tag-hisui {
    background: rgba(234, 179, 8, 0.2);
    border: 1px solid #eab308;
    color: #fef08a;
}

.tag-event {
    background: rgba(249, 115, 22, 0.25);
    border: 1px solid #f97316;
    color: #fdba74;
}

.tag-size {
    background: rgba(107, 114, 128, 0.25);
    border: 1px solid #6b7280;
    color: #d1d5db;
}

.tag-form {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid #3b82f6;
    color: #93c5fd;
}

.tag-shadow {
    background: rgba(139, 92, 246, 0.3);
    border: 1px solid #8b5cf6;
    color: #c4b5fd;
}

.tag-purified {
    background: rgba(245, 158, 11, 0.25);
    border: 1px solid #f59e0b;
    color: #fde68a;
}

/* Pokédex Tracker */
.pokedex-summary-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.pokedex-stat-box {
    flex: 1;
    min-width: 280px;
}

.pokedex-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pokedex-prog-text {
    font-size: 13px;
    font-weight: 700;
    color: #34d399;
    font-family: 'JetBrains Mono', monospace;
}

.dex-quick-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.dex-quick-stat {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 14px;
    min-width: 90px;
    text-align: center;
}

.dex-num {
    font-size: 18px;
    font-weight: 800;
    color: #60a5fa;
    font-family: 'JetBrains Mono', monospace;
}

.dex-lbl {
    font-size: 11px;
    color: var(--text-muted);
}

.gen-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 18px;
}

.gen-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.gen-btn:hover {
    color: #fff;
    border-color: #475569;
}

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

.pokedex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.pokedex-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.pokedex-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}

.pokedex-card.missing {
    opacity: 0.38;
    filter: grayscale(1);
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.pokedex-card.missing:hover {
    opacity: 0.7;
    filter: grayscale(0.5);
}

.pokedex-card.owned {
    border-color: rgba(59, 130, 246, 0.35);
}

.dex-num-badge {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-subtle);
    font-family: 'JetBrains Mono', monospace;
}

.dex-owned-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #34d399;
    padding: 1px 5px;
    border-radius: 10px;
}

.dex-sprite-wrap {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0 6px 0;
}

.dex-sprite {
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
}

.dex-species-name {
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.dex-card-indicators {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    min-height: 16px;
}

.indicator-shiny {
    font-size: 11px;
}

.indicator-hundo {
    font-size: 10px;
    font-weight: 800;
    background: #ef4444;
    color: #fff;
    padding: 0 4px;
    border-radius: 3px;
}

/* Deep Inspector Styles */
.deep-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.deep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
}

.deep-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 20px;
}

.deep-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.deep-table-wrap {
    max-height: 420px;
    overflow-y: auto;
}

.deep-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.deep-table th {
    text-align: left;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-muted);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.deep-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-badge {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    display: inline-block;
}

.status-consumed {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid #ef4444;
}

.status-available {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid #10b981;
}

/* Setup Guide Modal */
.setup-guide-box {
    padding: 6px 4px;
}

.endpoint-highlight {
    background: #0f172a;
    border: 1px solid #3b82f6;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.endpoint-highlight label {
    font-size: 12px;
    font-weight: 700;
    color: #93c5fd;
    display: block;
    margin-bottom: 6px;
}

.copy-input-row {
    display: flex;
    gap: 8px;
}

.copy-input-row input {
    flex: 1;
    background: #1e293b;
    border: 1px solid #475569;
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    outline: none;
}

.url-subhint {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 8px;
}

.instructions-steps h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #f3f4f6;
}

.instructions-steps ol {
    padding-left: 20px;
    font-size: 13px;
    color: #d1d5db;
    line-height: 1.8;
}


/* Inferred Pokédex Unlocks */
.pokedex-card.unlocked {
    border-color: rgba(14, 165, 233, 0.45);
    background: rgba(14, 165, 233, 0.08);
}

.dex-unlocked-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 9px;
    font-weight: 700;
    background: rgba(14, 165, 233, 0.2);
    border: 1px solid #0ea5e9;
    color: #38bdf8;
    padding: 1px 5px;
    border-radius: 10px;
}

/* ==========================================================================
   Historical Storage & Timeline Styling
   ========================================================================== */
.history-dashboard-header {
    background: var(--card-bg, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.history-meta-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.meta-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #94a3b8);
    font-weight: 600;
}

.meta-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 800;
    color: #38bdf8;
}

.history-actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-secondary {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

.btn-secondary:hover {
    background: #475569 !important;
}

.history-timeline-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timeline-entry-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.2s, border-color 0.2s;
}

.timeline-entry-card:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
}

.timeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 10px;
}

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

.timeline-clock {
    font-size: 18px;
}

.timeline-date-str {
    font-weight: 700;
    font-size: 15px;
    color: #f8fafc;
}

.timeline-source-pill {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid #0284c7;
    color: #38bdf8;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.timeline-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.timeline-metric-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-title {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.metric-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 700;
    color: #e2e8f0;
}

.delta-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 6px;
}

.delta-green {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.delta-blue {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.delta-purple {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.timeline-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #64748b;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.catches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 6px;
}

.catch-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.catch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #f1f5f9;
}

.catch-iv-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #1e293b;
    color: #38bdf8;
}

.catch-hundo {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.1) !important;
}

.catch-shiny {
    border-color: #ec4899 !important;
}

/* Retention Form */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.config-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-form .input-text {
    background: #1e293b;
    border: 1px solid #475569;
    color: #f8fafc;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 8px;
    outline: none;
}

.config-form .input-text:focus {
    border-color: #38bdf8;
}

.form-hint {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
}

.checkbox-group {
    flex-direction: row !important;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #e2e8f0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0284c7;
    cursor: pointer;
}

.form-actions-row {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 10px;
}

