/* ==========================================================================
   SHARED STYLES
   Common across index.html, maps.html, and chat-watcher.html
   ========================================================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: clip;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    opacity: 0.9;
    font-size: 1.1em;
}

.nav {
    background: #f8f9fa;
    padding: 15px 30px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.nav a:hover {
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #495057;
}


/* ==========================================================================
   INDEX.HTML — Quest & Inventory Tracker
   ========================================================================== */

.file-loader {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.file-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.file-input-group label {
    font-weight: 600;
    min-width: 180px;
    color: #495057;
}

.file-input-group input[type="file"] {
    flex: 1;
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.file-input-group input[type="file"]:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.status {
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    display: none;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.status.loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

.quest-browser,
.inventory-browser {
    padding: 30px;
}

.quest-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.quest-stats .stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.quest-stats .stat-card .number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.quest-stats .stat-card .label {
    opacity: 0.9;
    font-size: 0.9em;
}

.search-bar {
    margin-bottom: 25px;
}

.search-bar input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.quest-list {
    display: grid;
    gap: 20px;
}

.quest-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.quest-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.quest-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.quest-track-btn {
    font-size: 1em;
    color: #adb5bd;
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 2px 7px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
}

.quest-track-btn:hover {
    color: #ffc107;
    border-color: #ffc107;
    background: #fff8e1;
}

.quest-track-btn.tracked {
    color: #ffc107;
    border-color: #ffc107;
    background: #fff8e1;
}

.quest-track-btn.tracked:hover {
    color: #dc3545;
    border-color: #dc3545;
    background: #fff0f0;
}

.quest-wiki-btn {
    font-size: 0.8em;
    color: #6c757d;
    text-decoration: none;
    padding: 3px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.2s;
}

.quest-wiki-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.quest-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #212529;
    margin-bottom: 5px;
}

.quest-title a:hover {
    color: #667eea;
    text-decoration: underline;
}

.quest-npc {
    color: #667eea;
    font-weight: 500;
    font-size: 0.95em;
}

.quest-level {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.quest-description {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 15px;
}

.quest-objectives {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.quest-objectives h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quest-objectives ul {
    list-style: none;
    padding-left: 0;
}

.quest-objectives li {
    padding: 5px 0;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.quest-objectives li.obj-turnin {
    opacity: 0.55;
    font-style: italic;
}

.obj-type-icon,
.obj-type-arrow {
    flex-shrink: 0;
    font-size: 0.9em;
    color: #667eea;
    font-weight: bold;
    min-width: 18px;
}

.obj-item-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 3px;
    vertical-align: middle;
}

.obj-text {
    flex: 1;
}

.obj-count {
    background: #667eea;
    color: white;
    font-size: 0.78em;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes quest-highlight-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.6); border-color: #667eea; }
    50%  { box-shadow: 0 0 0 8px rgba(102, 126, 234, 0); border-color: #667eea; }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

.quest-card-highlight {
    animation: quest-highlight-pulse 0.6s ease-out 2;
    border-color: #667eea !important;
}

.quest-rewards {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.reward-item {
    background: #e7f3ff;
    color: #004085;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
}

.location-accordion {
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
}

.accordion-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.accordion-header.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2em;
    font-weight: 600;
}

.accordion-header.active .accordion-title {
    color: white;
}

.quest-count-badge {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.accordion-header.active .quest-count-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.empty-slots-badge {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.empty-slots-badge.full {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.accordion-header.active .empty-slots-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.accordion-icon {
    font-size: 1.2em;
    transition: transform 0.3s;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
    color: white;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-content.active {
    max-height: 10000px;
    transition: max-height 0.5s ease-in;
}

/* ── Tracked Quests section ─────────────────────────────── */
.tracked-quests-section {
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: clip;
}

.tracked-quests-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 600;
    user-select: none;
    transition: background 0.2s;
}

.tracked-quests-header:hover {
    background: linear-gradient(135deg, #218838 0%, #1aab80 100%);
}

.tracked-quests-header.active {
    background: linear-gradient(135deg, #1e7e34 0%, #17a673 100%);
}

.tracked-quests-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tracked-quests-header .quest-count-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.tracked-quests-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.tracked-quests-content.active {
    max-height: 20000px;
    transition: max-height 0.6s ease-in;
}

/* ── Ready for Turn-In section ──────────────────────────── */
.turnin-section {
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: clip;
}

.turnin-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #0077cc 0%, #00aacc 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    font-weight: 700;
    font-size: 1em;
    user-select: none;
    transition: background 0.2s;
}
.turnin-header:hover {
    background: linear-gradient(135deg, #0066b3 0%, #0099b3 100%);
}
.turnin-header.active {
    background: linear-gradient(135deg, #005599 0%, #0088a0 100%);
}

.turnin-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.turnin-header .quest-count-badge {
    background: rgba(255,255,255,0.3);
    color: white;
}

.turnin-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.turnin-content.active {
    max-height: 20000px;
    transition: max-height 0.6s ease-in;
}

.turnin-area-group {
    padding: 10px 16px 4px;
}
.turnin-area-group + .turnin-area-group {
    border-top: 1px solid #d4e0f5;
}
.turnin-area-header {
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #0077cc;
    margin-bottom: 8px;
}

.turnin-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.turnin-quest-card {
    background: #f4f8ff;
    border: 1px solid #d4e0f5;
    border-radius: 8px;
    padding: 12px 14px;
}

.turnin-quest-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}

.turnin-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.turnin-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.88em;
}

.turnin-item-icon {
    width: 18px;
    height: 18px;
    image-rendering: pixelated;
    vertical-align: middle;
    flex-shrink: 0;
}

.turnin-item-name {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    min-width: 0;
}

.turnin-item-needed {
    color: #6c757d;
    font-weight: 400;
}

.turnin-item-locs {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.turnin-split-note {
    font-size: 0.78em;
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 1px 7px;
}

.quick-objectives-section {
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.quick-objectives-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.quick-objectives-header:hover {
    background: linear-gradient(135deg, #ffb300 0%, #f57c00 100%);
}

.quick-objectives-header.active {
    background: linear-gradient(135deg, #ffa000 0%, #f57c00 100%);
}

.quick-objectives-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.quick-objectives-header .quest-count-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.quick-objectives-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.quick-objectives-content.active {
    max-height: 10000px;
    transition: max-height 0.5s ease-in;
}

.quick-objectives-zone {
    border-bottom: 1px solid #e9ecef;
}

.quick-objectives-zone:last-child {
    border-bottom: none;
}

.quick-objectives-zone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
}

.quick-objectives-zone-header:hover {
    background: #e9ecef;
}

.quick-objectives-zone-header.active {
    background: #fff3cd;
}

.quick-objectives-zone-title {
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-objectives-zone-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.quick-objectives-zone-content.active {
    max-height: 5000px;
    transition: max-height 0.5s ease-in;
}

.quick-objectives-list {
    list-style: none;
    padding: 15px 20px;
    margin: 0;
    display: grid;
    gap: 8px;
    background: white;
}

.quick-objective-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #ffc107;
    flex-wrap: wrap;
}

.quick-objective-text {
    flex: 1;
    color: #212529;
    font-size: 0.9em;
    line-height: 1.5;
    min-width: 0;
}

.quick-objective-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.quick-obj-jump-btn {
    font-size: 0.78em;
    color: #495057;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
    font-style: italic;
}

.quick-obj-jump-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.quick-obj-wiki-btn {
    font-size: 0.82em;
    color: #6c757d;
    text-decoration: none;
    padding: 2px 6px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-obj-wiki-btn:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.accordion-quests {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    background: #fafbfc;
}

@media (max-width: 1200px) {
    .accordion-quests {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .accordion-quests {
        grid-template-columns: 1fr;
    }
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tab {
    flex: 1;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab:hover {
    background: #e9ecef;
    color: #495057;
}

.tab.active {
    color: #667eea;
    background: white;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

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

.item-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.item-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

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

.item-name-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.item-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.item-name {
    font-weight: 600;
    color: #212529;
    font-size: 1.05em;
}

.item-stack {
    background: #e7f3ff;
    color: #004085;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.item-value {
    color: #6c757d;
    font-size: 0.9em;
}

.item-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 0.85em;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.item-detail-badge {
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.05);
    color: #495057;
    font-weight: 500;
}

/* Rarity-based item coloring */
.item-card.rarity-uncommon {
    background: linear-gradient(135deg, #d4f4dd 0%, #e8f9ed 100%);
    border-color: #28a745;
}

.item-card.rarity-uncommon:hover {
    border-color: #218838;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.item-card.rarity-rare {
    background: linear-gradient(135deg, #cfe2ff 0%, #e7f1ff 100%);
    border-color: #0d6efd;
}

.item-card.rarity-rare:hover {
    border-color: #0b5ed7;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.item-card.rarity-exceptional {
    background: linear-gradient(135deg, #ffe5e5 0%, #fff0f0 100%);
    border-color: #dc3545;
}

.item-card.rarity-exceptional:hover {
    border-color: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.item-card.rarity-epic {
    background: linear-gradient(135deg, #e8d4f8 0%, #f3e8fc 100%);
    border-color: #9333ea;
}

.item-card.rarity-epic:hover {
    border-color: #7c2cbf;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

.item-card.rarity-legendary {
    background: linear-gradient(135deg, #fff4cc 0%, #fff9e6 100%);
    border-color: #ffc107;
}

.item-card.rarity-legendary:hover {
    border-color: #e0a800;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.vault-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    grid-column: 1 / -1;
}

.vault-summary-label {
    font-weight: 600;
    color: #495057;
}

.vault-summary-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
}

/* Nested vault accordions inside area accordions */
.area-vaults-content {
    padding: 8px 0 4px;
}

.nested-vault-accordion {
    margin: 0 0 4px 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.nested-vault-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    padding: 12px 16px !important;
    font-size: 0.95em;
}

.nested-vault-header:hover {
    background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%) !important;
}

.nested-vault-header.active {
    background: linear-gradient(135deg, #e8ecff 0%, #d8deff 100%) !important;
    color: #4a5cc7 !important;
}

.nested-vault-header.active .accordion-title {
    color: #4a5cc7 !important;
}

.nested-vault-header.active .accordion-icon {
    color: #4a5cc7 !important;
}

/* Compact area-level vault summary */
.area-vaults-content > .vault-summary {
    margin: 8px 0 4px;
    padding: 10px 12px;
    font-size: 0.9em;
}

/* Stores Browser */
.stores-browser {
    padding: 30px;
}

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

.store-table thead th {
    text-align: left;
    padding: 8px 14px;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
    white-space: nowrap;
}

.store-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.store-table tbody tr:last-child td {
    border-bottom: none;
}

.store-table tbody tr:hover td {
    background: #f8f9ff;
}

.store-table .col-name {
    font-weight: 600;
    font-size: 1em;
    min-width: 130px;
}

.store-table .col-cap {
    font-size: 0.9em;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.store-table .col-cap.no-cap {
    color: #adb5bd;
}

.store-table .col-buys {
    font-size: 0.85em;
    color: #6c757d;
    width: 45%;
}

.store-table .col-tooltip {
    width: 36px;
    text-align: right;
}

.favor-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.favor-badge.favor-despised    { background: #f8d7da; color: #721c24; }
.favor-badge.favor-disliked    { background: #fde8d0; color: #8a3a00; }
.favor-badge.favor-neutral     { background: #e9ecef; color: #495057; }
.favor-badge.favor-comfortable { background: #d1ecf1; color: #0c5460; }
.favor-badge.favor-friends     { background: #d4edda; color: #155724; }
.favor-badge.favor-closefriends { background: #cfe2ff; color: #084298; }
.favor-badge.favor-bestfriends { background: #e8d4f8; color: #5a1a8c; }
.favor-badge.favor-likefamily  { background: #fff3cd; color: #856404; }
.favor-badge.favor-soulmates   { background: #fce8f0; color: #7c1546; }
.favor-badge.favor-unknown     { background: #f8f9fa; color: #6c757d; border: 1px solid #dee2e6; }

.tooltip-container {
    position: relative;
    flex-shrink: 0;
}

.tooltip-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    font-weight: 700;
    font-size: 0.75em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.tooltip-btn:hover {
    background: #667eea;
    color: white;
}

.tooltip-content {
    display: none;
    position: absolute;
    z-index: 200;
    right: 0;
    top: calc(100% + 6px);
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    min-width: 500px;
    overflow: hidden;
}

.tooltip-container.tooltip-open .tooltip-content {
    display: block;
}

.tooltip-container.tooltip-flip-up .tooltip-content {
    top: auto;
    bottom: calc(100% + 6px);
}

.tooltip-btn.tooltip-active {
    background: #667eea;
    color: white;
}

.tooltip-title {
    padding: 10px 12px 6px;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
}

.tooltip-title-divider {
    border-top: 2px solid #e9ecef;
    margin-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.favor-items-btn {
    font-size: 0.75em;
    padding: 2px 7px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: normal;
    transition: background 0.15s;
}
.favor-items-btn:hover { background: #5a6fd6; }

/* Clickable stat card for actions */
.quest-stats .stat-card-action {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    opacity: 0.55;
}
.quest-stats .stat-card-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    opacity: 0.8;
}
.quest-stats .stat-card-action--has-dupes {
    opacity: 1;
}
.quest-stats .stat-card-action--has-dupes:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102,78,162,0.45);
}

/* Duplicate items modal */
.duplicate-items-modal {
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    width: 560px;
    max-width: 92vw;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.duplicate-items-modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}
.dup-summary {
    padding: 8px 16px 4px;
    font-size: 0.82em;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 4px;
}
.dup-item-row {
    padding: 8px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.dup-item-row:last-child { border-bottom: none; }
.dup-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.92em;
    margin-bottom: 5px;
}
.dup-item-icon {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    flex-shrink: 0;
}
.dup-vaults {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-left: 32px;
}
.dup-vault-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: #f0f4ff;
    border: 1px solid #c9d4f5;
    border-radius: 12px;
    font-size: 0.8em;
    color: #4a5590;
}
.dup-qty {
    color: #888;
    font-size: 0.9em;
}

/* Favor items modal */
.favor-items-modal {
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    width: 480px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.favor-items-modal-body {
    overflow-y: auto;
    flex: 1;
}
.favor-items-group-header {
    padding: 8px 12px 4px;
    font-size: 0.78em;
    font-weight: 700;
    border-top: 1px solid #e9ecef;
}
.favor-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
}
.favor-items-table th {
    padding: 4px 12px;
    text-align: left;
    font-size: 0.78em;
    font-weight: 600;
    color: #6c757d;
    background: #f8f9fa;
}
.favor-items-table th:last-child { text-align: right; }
.favor-items-table td {
    padding: 5px 12px;
    border-top: 1px solid #f0f0f0;
    vertical-align: middle;
}
.favor-items-table td:last-child { text-align: right; }
.favor-items-table tr:hover td { background: #f8f9fa; }

.cap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.cap-table th {
    text-align: left;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
}

.cap-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
    text-align: left;
}

.cap-table tr:last-child td {
    border-bottom: none;
}

.cap-table tr.cap-row-current td {
    background: #d4edda;
    color: #155724;
    font-weight: 600;
}

.cap-table tr.cap-row-unlocked td {
    background: #f0f4ff;
    color: #3a5a9c;
}

.cap-table tr.cap-row-locked td {
    color: #adb5bd;
}

.stores-region-npcs {
    padding: 0;
}

/* Allow tooltips to escape accordion overflow clipping */
.stores-browser .location-accordion {
    overflow: visible;
}

.stores-browser .accordion-content.active {
    overflow: visible;
}

/* Vendor tracker — remaining gold / reset timer */
.col-reset {
    font-size: 0.85em;
    white-space: nowrap;
    color: #6c757d;
    min-width: 65px;
}

.col-reset.reset-ready {
    color: #28a745;
    font-weight: 600;
}

.col-actions {
    width: 56px;
    text-align: right;
}

.remaining-high { color: #155724; font-weight: 600; }
.remaining-med  { color: #856404; font-weight: 600; }
.remaining-low  { color: #721c24; font-weight: 600; }

.tracker-container {
    position: relative;
    flex-shrink: 0;
}

.tracker-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #6c757d;
    background: white;
    color: #6c757d;
    font-size: 0.7em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.tracker-btn:hover,
.tracker-btn.tracker-active {
    background: #6c757d;
    color: white;
}

.col-star {
    width: 28px;
    padding-left: 10px !important;
    padding-right: 4px !important;
}

.star-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #ced4da;
    font-size: 0.95em;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.star-btn:hover {
    color: #f0ad4e;
    background: #fff8e1;
}

.star-btn.starred {
    color: #f0ad4e;
}

.store-table .col-star-header {
    width: 28px;
    padding-left: 10px !important;
    padding-right: 4px !important;
}

.store-table .col-region {
    font-size: 0.8em;
    color: #6c757d;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Store tab toolbar */
.store-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e9ecef;
}

.store-toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.store-toolbar-label {
    font-size: 0.75em;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.store-toolbar-input {
    flex: 1 1 200px;
    padding: 9px 13px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.store-toolbar-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.store-toolbar-toggle {
    padding: 9px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    background: white;
    color: #495057;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    white-space: nowrap;
}

.store-toolbar-toggle:hover {
    border-color: #667eea;
    background: #f0f2ff;
    color: #667eea;
}

.tracker-popup {
    display: none;
    position: absolute;
    z-index: 200;
    right: 0;
    top: calc(100% + 6px);
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    width: 220px;
    padding: 12px;
}

.tracker-container.tracker-open .tracker-popup {
    display: block;
}

.tracker-popup-label {
    display: block;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 5px;
    margin-top: 10px;
}

.tracker-popup-label:first-child { margin-top: 0; }

.tracker-popup input[type="number"] {
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9em;
}

.tracker-popup input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.tracker-remaining-input {
    width: 100%;
    box-sizing: border-box;
}

.tracker-reset-inputs {
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 0.85em;
    color: #495057;
}

.tracker-reset-inputs input { width: 46px; }

.tracker-popup-btns {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.tracker-save-btn {
    flex: 1;
    padding: 5px 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.tracker-save-btn:hover { background: #5a6fd6; }

.tracker-clear-btn {
    padding: 5px 10px;
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.2s;
}

.tracker-clear-btn:hover { background: #e9ecef; }

/* Tracker modal */
.tracker-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tracker-modal {
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    width: 300px;
    overflow: hidden;
}

.tracker-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tracker-modal-title {
    font-weight: 700;
    font-size: 0.95em;
    color: #495057;
}

.tracker-modal-close {
    width: 26px;
    height: 26px;
    border: none;
    background: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 1em;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.tracker-modal-close:hover {
    background: #dee2e6;
    color: #212529;
}

.tracker-modal-body {
    padding: 16px;
}

.tracker-modal-body input[type="number"] {
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9em;
}

.tracker-modal-body input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.tracker-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    background: #f8f9fa;
}


/* ==========================================================================
   MAPS.HTML — Interactive Maps
   ========================================================================== */

/* maps.html — wider, full-height flex container */
body.maps-page .container {
    max-width: 1800px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

/* maps.html — nav uses space-between for the toggle button */
body.maps-page .nav {
    justify-content: space-between;
    gap: 0;
}

body.maps-page .nav .settings-wrapper {
    margin-left: 0;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.toggle-controls-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-controls-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.toggle-controls-btn .arrow {
    transition: transform 0.3s;
}

.toggle-controls-btn.collapsed .arrow {
    transform: rotate(180deg);
}

.map-controls {
    padding: 20px 30px;
    background: white;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    transition: all 0.3s ease;
}

.map-controls.collapsed {
    max-height: 0;
    padding: 0 30px;
    border-bottom: none;
    overflow: hidden;
}

.map-selector {
    flex: 1;
    min-width: 200px;
}

.wiki-link-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s;
    display: none;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.wiki-link-btn.visible {
    display: flex;
}

.wiki-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.map-selector select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.map-selector select:hover {
    border-color: #667eea;
}

.map-selector select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Custom searchable dropdown */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select-input {
    width: 100%;
    padding: 12px;
    padding-right: 40px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.searchable-select-input:hover {
    border-color: #667eea;
}

.searchable-select-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    cursor: text;
}

.searchable-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6c757d;
    transition: transform 0.3s;
}

.searchable-select.open .searchable-select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.searchable-select.open .searchable-select-dropdown {
    display: block;
}

.searchable-select-option {
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
}

.searchable-select-option:hover {
    background: #f8f9fa;
}

.searchable-select-option.focused {
    background: #e9ecef;
}

.searchable-select-option.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.searchable-select-option.hidden {
    display: none;
}

.searchable-select-no-results {
    padding: 12px;
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

.info-panel {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.info-badge {
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-badge strong {
    color: #667eea;
}

#map {
    flex: 1;
    background: #2c3e50;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    font-size: 1.2em;
}

/* Custom map marker styles */
.custom-marker {
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.custom-marker:hover {
    transform: scale(1.2);
    z-index: 1000 !important;
}

.marker-npc {
    background: #28a745;
    width: 24px;
    height: 24px;
}

.marker-landmark {
    background: #ffc107;
    border-radius: 4px;
    width: 20px;
    height: 20px;
}

.marker-portal {
    background: #9333ea;
    width: 24px;
    height: 24px;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    margin: 15px;
    min-width: 200px;
}

.popup-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
}

.popup-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 8px;
}

.popup-type.npc {
    background: #d4edda;
    color: #155724;
}

.popup-type.portal {
    background: #e7d4f8;
    color: #5a189a;
}

.popup-type.landmark {
    background: #fff3cd;
    color: #856404;
}

.popup-coords {
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 8px;
    font-family: monospace;
}

.leaflet-control-layers {
    border-radius: 8px;
    border: 2px solid rgba(0,0,0,0.2);
}

.debug-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85em;
    font-family: monospace;
    z-index: 1000;
    display: none;
}

.debug-info.visible {
    display: block;
}

.adjacent-zones {
    padding: 15px 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    display: none;
    transition: all 0.3s ease;
    max-height: 300px;
    overflow: hidden;
}

.adjacent-zones.visible {
    display: block;
}

.adjacent-zones.collapsed {
    max-height: 0;
    padding: 0 30px;
    border-bottom: none;
}

.adjacent-zones-section {
    margin-bottom: 15px;
}

.adjacent-zones-section:last-child {
    margin-bottom: 0;
}

.adjacent-zones-title {
    font-size: 0.9em;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

.adjacent-zones-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.adjacent-zone-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.adjacent-zone-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}


/* ==========================================================================
   CHAT-WATCHER.HTML — Chat Watcher
   ========================================================================== */

.back-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.controls {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.control-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.control-row label {
    font-weight: 600;
    color: #495057;
}

.control-row input[type="text"],
.control-row input[type="number"],
.control-row input[type="url"] {
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s;
}

.control-row input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.control-row input[type="file"] {
    padding: 8px;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.button-group {
    display: flex;
    gap: 10px;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.status-bar {
    padding: 15px 30px;
    background: #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6c757d;
}

.status-dot.active {
    background: #28a745;
    animation: pulse 2s infinite;
}

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

.chat-display {
    padding: 30px;
    height: 600px;
    overflow-y: auto;
    background: #fafbfc;
}

.chat-line {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: white;
    border-left: 3px solid #e9ecef;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

.chat-line.matched {
    background: #fff3cd;
    border-left-color: #ffc107;
    font-weight: 600;
}

.chat-line.npc-chatter {
    background: #e7f3ff;
    border-left-color: #0d6efd;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 600;
    color: #212529;
}

.test-sound-btn {
    padding: 6px 12px;
    font-size: 0.9em;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.test-sound-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.help-text {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* Player.log watcher bar (top of Vendors tab) */
.player-log-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.player-log-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.player-log-btn.player-log-active {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.player-log-status {
    font-size: 0.82em;
    color: #6c757d;
    font-style: italic;
}

/* ==========================================================================
   VENDOR PRICE TRACKER
   ========================================================================== */

.vendor-price-browser {
    padding: 30px;
}

.price-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.price-log-hint {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 20px;
}

.price-search {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
}

.price-search:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-price-sort {
    padding: 12px 16px;
    background: #3a3a3a;
    color: #ccc;
    border: 1px solid #555;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.95em;
    transition: all 0.2s;
}

.btn-price-sort:hover {
    background: #484848;
    color: #fff;
}

.btn-add-item {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.95em;
    transition: all 0.2s;
}

.btn-add-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-retire-old {
    padding: 12px 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.95em;
    transition: all 0.2s;
}

.btn-retire-old:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.price-category {
    margin-bottom: 6px;
}
.price-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #e8eaf6;
    border: 1px solid #c5cff5;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 0.88em;
    color: #3949ab;
}
.price-category-header:hover {
    background: #dde0f5;
}
.price-category-header.expanded {
    border-radius: 6px 6px 0 0;
}
.price-category-arrow {
    font-size: 0.65em;
    transition: transform 0.15s;
    display: inline-block;
}
.price-category-header.expanded .price-category-arrow {
    transform: rotate(90deg);
}
.price-category-label {
    flex: 1;
}
.price-category-count {
    font-weight: 400;
    font-size: 0.85em;
    color: #5c6bc0;
}
.price-category-body {
    display: none;
    border: 1px solid #c5cff5;
    border-top: none;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
}
.price-category-body.expanded {
    display: block;
}
.price-category-body .price-item-accordion {
    margin-bottom: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}
.price-category-body .price-item-accordion:last-child {
    border-bottom: none;
}

.price-item-accordion {
    margin-bottom: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.price-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: background 0.2s;
}

.price-item-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.price-item-header.expanded {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.price-item-name {
    flex: 1;
    font-weight: 600;
    font-size: 1.1em;
    color: #212529;
}

.price-item-header.expanded .price-item-name {
    color: white;
}

.price-item-stats {
    display: flex;
    gap: 16px;
    font-size: 0.85em;
    color: #6c757d;
    flex-shrink: 0;
}

.price-item-header.expanded .price-item-stats {
    color: rgba(255, 255, 255, 0.8);
}

.price-stat strong {
    color: #495057;
    font-weight: 700;
}

.price-item-header.expanded .price-stat strong {
    color: white;
}

.price-stat { white-space: nowrap; }

.price-item-delete-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    opacity: 0.5;
    transition: all 0.2s;
    line-height: 1;
    flex-shrink: 0;
}

.price-item-delete-btn:hover {
    opacity: 1;
    background: rgba(220, 53, 69, 0.15);
}

.price-item-header.expanded .price-item-delete-btn {
    color: rgba(255, 255, 255, 0.7);
}

.price-item-header.expanded .price-item-delete-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.price-item-arrow {
    font-size: 1em;
    transition: transform 0.3s;
    color: #6c757d;
    flex-shrink: 0;
}

.price-item-header.expanded .price-item-arrow {
    transform: rotate(180deg);
    color: white;
}

.price-item-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.price-item-content.expanded {
    max-height: 5000px;
    transition: max-height 0.5s ease-in;
}

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

.price-entries-table thead th {
    text-align: left;
    padding: 8px 14px;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
    white-space: nowrap;
}

.price-entries-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    font-size: 0.9em;
}

.price-entries-table tbody tr:last-child td {
    border-bottom: none;
}

.price-entries-table tbody tr:hover td {
    background: #f8f9ff;
}

.price-entry-retired td {
    opacity: 0.4;
    text-decoration: line-through;
}

.entry-price {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.entry-location { color: #495057; }

.entry-age {
    color: #6c757d;
    font-size: 0.85em;
    white-space: nowrap;
}

.entry-date {
    font-size: 0.82em;
    color: #6c757d;
    white-space: nowrap;
}

.entry-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.entry-btn {
    padding: 3px 9px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.78em;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.entry-btn.btn-retire   { color: #856404; border-color: #ffc107; }
.entry-btn.btn-retire:hover   { background: #fff3cd; }
.entry-btn.btn-unretire { color: #155724; border-color: #28a745; }
.entry-btn.btn-unretire:hover { background: #d4edda; }
.entry-btn.btn-edit     { color: #667eea; border-color: #667eea; }
.entry-btn.btn-edit:hover     { background: #f0f2ff; }
.entry-btn.btn-delete   { color: #dc3545; border-color: #dc3545; }
.entry-btn.btn-delete:hover   { background: #f8d7da; }

.price-add-entry-row {
    padding: 10px 14px;
    border-top: 2px solid #e9ecef;
    background: #f8f9fa;
    text-align: right;
}

.btn-add-entry {
    padding: 6px 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-entry:hover { background: #5a6fd6; }

/* Price entry & add-item modals */
.price-modal {
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    width: 380px;
    overflow: hidden;
}

.price-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.price-modal-title {
    font-weight: 700;
    font-size: 0.95em;
    color: #495057;
}

.price-modal-close {
    width: 26px;
    height: 26px;
    border: none;
    background: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 1em;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.price-modal-close:hover {
    background: #dee2e6;
    color: #212529;
}

.price-modal-body {
    padding: 16px;
    display: grid;
    gap: 12px;
}

.price-modal-label {
    display: block;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 4px;
}

.price-modal-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.95em;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
}

.price-modal-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.price-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    background: #f8f9fa;
    justify-content: flex-end;
}

/* Vendor capture auto-fill toast */
.capture-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #155724;
    color: #d4edda;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.875em;
    z-index: 2000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

/* ==========================================================================
   SHOPS SELLING LIVE CARD (Prices tab)
   ========================================================================== */

.shops-card {
    background: #f0f4ff;
    border: 1px solid #c5cff5;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.shops-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #e8eeff;
    border-bottom: 1px solid #c5cff5;
    gap: 8px;
}

.shops-card-title {
    font-weight: 700;
    font-size: 0.95em;
    color: #3a4a99;
}

.shops-card-subtitle {
    font-size: 0.82em;
    color: #6c757d;
    font-weight: normal;
}

.shops-card-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 0.95em;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
}
.shops-card-close:hover {
    background: #dee2e6;
    color: #343a40;
}

.shops-card-body {
    padding: 10px 14px 12px;
}

.shops-card-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    margin-bottom: 6px;
}
.shops-card-table th {
    text-align: left;
    padding: 3px 8px;
    color: #6c757d;
    font-weight: 600;
    font-size: 0.9em;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}
.shops-card-table td {
    padding: 3px 8px;
    vertical-align: top;
}
.shops-card-table td:first-child {
    font-family: monospace;
    font-weight: 700;
    color: #495057;
    white-space: nowrap;
    width: 54px;
}
.shops-card-table td:last-child {
    color: #6c757d;
}

.shops-card-elsewhere {
    font-size: 0.82em;
    color: #6c757d;
    padding-top: 6px;
    margin-top: 2px;
    border-top: 1px solid #dee2e6;
}

.shops-card-prices {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #c5cff5;
}
.shops-card-prices-title {
    font-size: 0.82em;
    font-weight: 700;
    color: #3a4a99;
    margin-bottom: 5px;
}
.shops-card-price-row {
    font-size: 0.82em;
    color: #495057;
    padding: 2px 0;
    display: flex;
    gap: 6px;
    align-items: baseline;
    flex-wrap: wrap;
}
.shops-card-price-gold {
    font-weight: 700;
    color: #155724;
}
.shops-card-price-loc {
    color: #6c757d;
}
.shops-card-price-age {
    color: #adb5bd;
    font-size: 0.9em;
}

.shops-add-price-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.78em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.5;
}
.shops-add-price-btn:hover {
    background: #218838;
}
.shops-price-known {
    background: #155724;
}
.shops-price-known:hover {
    background: #0d3d17;
}

/* ── Storage Overview ─────────────────────────────────────────────────── */
#storageOverview {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    margin-bottom: 12px;
    overflow: visible;
}
.storage-overview {
    padding: 0;
}
.storage-root-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    user-select: none;
    transition: background 0.2s;
}
.storage-root-header.active {
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #dee2e6;
}
.storage-root-header:hover { background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%); }
.storage-root-header .accordion-icon {
    font-size: 0.8em;
    color: #6c757d;
    transition: transform 0.2s;
}
.storage-root-header.active .accordion-icon { transform: rotate(180deg); }
.storage-overview-title {
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #495057;
}
.storage-root-content {
    display: none;
    padding: 8px 12px 10px;
}
.storage-root-content.active {
    display: block;
}
.storage-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    font-weight: 700;
    color: #495057;
    padding: 5px 4px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 2px;
    cursor: pointer;
    user-select: none;
    border-radius: 3px;
}
.storage-area-header:hover { background: #f1f3f5; }
.storage-area-header .accordion-icon {
    font-size: 0.8em;
    color: #868e96;
    transition: transform 0.2s;
}
.storage-area-header.active .accordion-icon { transform: rotate(180deg); }
.storage-area-total {
    font-size: 0.85em;
    font-weight: 600;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    padding: 1px 7px;
    margin-left: 5px;
}
.storage-area-content {
    display: none;
    padding-bottom: 4px;
}
.storage-area-content.active {
    display: block;
}
.storage-npc-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 0;
    font-size: 0.88em;
}
.storage-npc-name {
    flex: 1;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.storage-npc-slots {
    font-size: 0.85em;
    color: #495057;
    font-weight: 600;
    white-space: nowrap;
}
/* Narrow tooltip for storage tier table */
.storage-tip-content {
    min-width: 220px !important;
    max-width: 280px;
    z-index: 1000;
}
.storage-level-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 4px;
}
.storage-level-table td {
    padding: 4px 12px;
    font-size: 0.85em;
    border-top: 1px solid #f0f0f0;
}
.storage-level-row-current td {
    background: #e8f4fd;
    font-weight: 700;
    color: #0066cc;
}
.storage-tier-label {
    color: #495057;
}
.storage-tier-slots {
    text-align: right;
    color: #212529;
    white-space: nowrap;
}


/* ==========================================================================
   SETTINGS COG MENU
   ========================================================================== */

.settings-wrapper {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}

.cog-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.15em;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cog-btn:hover {
    background: #e9ecef;
    color: #495057;
    transform: rotate(30deg);
}

.settings-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 9999;
    padding: 6px 0;
}

.settings-dropdown.open {
    display: block;
}

.settings-section-label {
    padding: 4px 14px 2px;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.theme-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    font-size: 0.9em;
    color: #212529;
    cursor: pointer;
    user-select: none;
    gap: 12px;
    transition: background 0.15s;
}

.theme-toggle-label:hover {
    background: #f8f9fa;
    border-radius: 4px;
}

.toggle-track {
    width: 34px;
    height: 18px;
    background: #dee2e6;
    border-radius: 9px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-track.on {
    background: #667eea;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.toggle-track.on .toggle-thumb {
    left: 18px;
}


/* ==========================================================================
   DARK MODE — html[data-theme="dark"]
   ========================================================================== */

html[data-theme="dark"] body {
    background: linear-gradient(135deg, #1a0d3d 0%, #2d1060 100%);
}

html[data-theme="dark"] .container {
    background: #1e1e2e;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* Nav */
html[data-theme="dark"] .nav {
    background: #252540;
    border-bottom-color: #3a3a5a;
}

html[data-theme="dark"] .nav a {
    color: #8899ff;
}

html[data-theme="dark"] .nav b {
    color: #e0e0f0;
}

html[data-theme="dark"] .cog-btn {
    color: #8888aa;
}

html[data-theme="dark"] .cog-btn:hover {
    background: #3a3a5a;
    color: #e0e0f0;
}

html[data-theme="dark"] .settings-dropdown {
    background: #252540;
    border-color: #3a3a5a;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .settings-section-label {
    color: #6666aa;
}

html[data-theme="dark"] .theme-toggle-label {
    color: #e0e0f0;
}

html[data-theme="dark"] .theme-toggle-label:hover {
    background: #3a3a5a;
    border-radius: 4px;
}

/* File loader / controls panels */
html[data-theme="dark"] .file-loader,
html[data-theme="dark"] .controls,
html[data-theme="dark"] .status-bar,
html[data-theme="dark"] .player-log-bar,
html[data-theme="dark"] .map-controls,
html[data-theme="dark"] .adjacent-zones,
html[data-theme="dark"] .timers-controls {
    background: #252540;
    border-bottom-color: #3a3a5a;
}

html[data-theme="dark"] .file-loader code {
    background: #1a1a2e !important;
    color: #aaaacc !important;
}

/* details/summary in file-loader (inline style overrides) */
html[data-theme="dark"] .file-loader details summary {
    background: #252540 !important;
    color: #c0c0e0 !important;
}

html[data-theme="dark"] .file-loader details > div {
    background: #1e1e2e !important;
    color: #c0c0e0 !important;
}

/* Inline-styled helper text in file-loader */
html[data-theme="dark"] .file-loader > div {
    color: #8888aa !important;
}

/* Tabs */
html[data-theme="dark"] .tabs {
    background: #252540;
    border-bottom-color: #3a3a5a;
}

html[data-theme="dark"] .tab {
    color: #8888aa;
}

html[data-theme="dark"] .tab:hover {
    background: #3a3a5a;
    color: #c0c0e0;
}

html[data-theme="dark"] .tab.active {
    background: #1e1e2e;
    color: #8899ff;
    border-bottom-color: #8899ff;
}

/* Generic text */
html[data-theme="dark"] .empty-state {
    color: #8888aa;
}

html[data-theme="dark"] .empty-state h3 {
    color: #aaaacc;
}

html[data-theme="dark"] .help-text,
html[data-theme="dark"] .price-log-hint {
    color: #8888aa;
}

/* Inputs & selects */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #2a2a44;
    border-color: #3a3a5a;
    color: #e0e0f0;
}

html[data-theme="dark"] input[type="text"]:focus,
html[data-theme="dark"] input[type="number"]:focus,
html[data-theme="dark"] input[type="url"]:focus,
html[data-theme="dark"] input[type="search"]:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    border-color: #8899ff;
    box-shadow: 0 0 0 3px rgba(136, 153, 255, 0.15);
}

html[data-theme="dark"] input[type="text"]::placeholder,
html[data-theme="dark"] input[type="search"]::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #6666aa;
}

/* Search bar */
html[data-theme="dark"] .search-bar input,
html[data-theme="dark"] .store-toolbar-input,
html[data-theme="dark"] .price-search {
    background: #2a2a44;
    border-color: #3a3a5a;
    color: #e0e0f0;
}

html[data-theme="dark"] .search-bar input:focus,
html[data-theme="dark"] .store-toolbar-input:focus,
html[data-theme="dark"] .price-search:focus {
    border-color: #8899ff;
    box-shadow: 0 0 0 3px rgba(136, 153, 255, 0.15);
}

html[data-theme="dark"] .store-toolbar-toggle {
    background: #2a2a44;
    border-color: #3a3a5a;
    color: #c0c0e0;
}

html[data-theme="dark"] .store-toolbar-toggle:hover {
    border-color: #8899ff;
    background: #30305a;
    color: #8899ff;
}

html[data-theme="dark"] .searchable-select-input {
    background: #2a2a44;
    border-color: #3a3a5a;
    color: #e0e0f0;
}

html[data-theme="dark"] .searchable-select-dropdown {
    background: #252540;
    border-color: #8899ff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .searchable-select-option {
    color: #e0e0f0;
}

html[data-theme="dark"] .searchable-select-option:hover,
html[data-theme="dark"] .searchable-select-option.focused {
    background: #3a3a5a;
}

/* Buttons */
html[data-theme="dark"] .btn-secondary {
    background: #4a4a6a;
}

html[data-theme="dark"] .btn-secondary:hover {
    background: #5a5a7a;
}

/* Control row labels */
html[data-theme="dark"] .control-row label,
html[data-theme="dark"] .file-input-group label {
    color: #c0c0e0;
}

/* Status messages */
html[data-theme="dark"] .status.success {
    background: #0d3320;
    color: #6ee09a;
    border-color: #1a5c38;
}

html[data-theme="dark"] .status.error {
    background: #3d1020;
    color: #f08090;
    border-color: #6a1a2e;
}

html[data-theme="dark"] .status.loading {
    background: #0d2a40;
    color: #70c0e0;
    border-color: #1a4a68;
}

/* Tracked quests section */
html[data-theme="dark"] .tracked-quests-section {
    background: #252540;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .tracked-quests-header {
    background: linear-gradient(135deg, #1a6b2e 0%, #157a57 100%);
}

html[data-theme="dark"] .tracked-quests-header:hover {
    background: linear-gradient(135deg, #1f7d36 0%, #1a8f65 100%);
}

html[data-theme="dark"] .quest-track-btn {
    color: #5a5a7a;
    border-color: #3a3a5a;
    background: none;
}

html[data-theme="dark"] .quest-track-btn:hover {
    color: #ffc107;
    border-color: #ffc107;
    background: #2a2510;
}

html[data-theme="dark"] .quest-track-btn.tracked {
    color: #ffc107;
    border-color: #856404;
    background: #2a2510;
}

html[data-theme="dark"] .quest-track-btn.tracked:hover {
    color: #f08090;
    border-color: #6a1a2e;
    background: #3d1020;
}

/* Quest cards */
html[data-theme="dark"] .quest-card {
    background: #252540;
    border-color: #3a3a5a;
}

html[data-theme="dark"] .quest-card:hover {
    border-color: #8899ff;
    box-shadow: 0 4px 12px rgba(136, 153, 255, 0.2);
}

html[data-theme="dark"] .quest-title {
    color: #e0e0f0;
}

html[data-theme="dark"] .quest-card-highlight {
    border-color: #8899ff !important;
}

html[data-theme="dark"] .quest-title a {
    color: #e0e0f0;
}

html[data-theme="dark"] .quest-title a:hover {
    color: #8899ff;
}

html[data-theme="dark"] .quest-npc {
    color: #8899ff;
}

html[data-theme="dark"] .quest-description {
    color: #9090b0;
}

html[data-theme="dark"] .quest-objectives {
    background: #1e1e2e;
}

html[data-theme="dark"] .quest-objectives h4 {
    color: #aaaacc;
}

html[data-theme="dark"] .quest-objectives li {
    color: #9090b0;
}

html[data-theme="dark"] .obj-type-icon,
html[data-theme="dark"] .obj-type-arrow {
    color: #8899ff;
}

html[data-theme="dark"] .obj-count {
    background: #4455cc;
}

html[data-theme="dark"] .reward-item {
    background: #1a2a4a;
    color: #7ab0f0;
}

/* Accordion headers */
html[data-theme="dark"] .accordion-header {
    background: linear-gradient(135deg, #252540 0%, #1e1e30 100%);
    color: #e0e0f0;
}

html[data-theme="dark"] .accordion-header:hover {
    background: linear-gradient(135deg, #2a2a50 0%, #252540 100%);
}

html[data-theme="dark"] .accordion-title {
    color: #e0e0f0;
}

html[data-theme="dark"] .quest-count-badge {
    background: rgba(136, 153, 255, 0.15);
    color: #8899ff;
}

html[data-theme="dark"] .location-accordion {
    background: #1e1e2e;
    border-color: #3a3a5a;
}

html[data-theme="dark"] .accordion-quests {
    background: #1a1a2a;
}

/* Ready for turn-in section */
html[data-theme="dark"] .turnin-section {
    background: #252540;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .turnin-header {
    background: linear-gradient(135deg, #0055aa 0%, #0088aa 100%);
}
html[data-theme="dark"] .turnin-header:hover {
    background: linear-gradient(135deg, #0066cc 0%, #009acc 100%);
}
html[data-theme="dark"] .turnin-header.active {
    background: linear-gradient(135deg, #004488 0%, #007799 100%);
}
html[data-theme="dark"] .turnin-quest-card {
    background: #1a1e38;
    border-color: #2a2e58;
}
html[data-theme="dark"] .turnin-item-name {
    color: #c0c0e0;
}
html[data-theme="dark"] .turnin-item-needed {
    color: #8888aa;
}
html[data-theme="dark"] .turnin-area-group + .turnin-area-group {
    border-color: #2a2e58;
}
html[data-theme="dark"] .turnin-area-header {
    color: #5599dd;
}
html[data-theme="dark"] .turnin-split-note {
    background: #3a2e00;
    border-color: #a08000;
    color: #d4aa00;
}

/* Quick objectives */
html[data-theme="dark"] .quick-objectives-section {
    background: #252540;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .quick-objectives-zone {
    border-bottom-color: #3a3a5a;
}

html[data-theme="dark"] .quick-objectives-zone-header {
    background: #252540;
}

html[data-theme="dark"] .quick-objectives-zone-header:hover {
    background: #2e2e50;
}

html[data-theme="dark"] .quick-objectives-zone-header.active {
    background: #2e2820;
}

html[data-theme="dark"] .quick-objectives-zone-title {
    color: #c0c0e0;
}

html[data-theme="dark"] .quick-objectives-list {
    background: #1e1e2e;
}

html[data-theme="dark"] .quick-objective-item {
    background: #252540;
}

html[data-theme="dark"] .quick-objective-text {
    color: #e0e0f0;
}

html[data-theme="dark"] .quest-wiki-btn {
    color: #8888aa;
    border-color: #3a3a5a;
}

html[data-theme="dark"] .quest-wiki-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

html[data-theme="dark"] .quick-obj-jump-btn {
    background: #2a2a44;
    color: #c0c0e0;
    border-color: #3a3a5a;
}

html[data-theme="dark"] .quick-obj-jump-btn:hover {
    background: #8899ff;
    color: #1a1a2a;
    border-color: #8899ff;
}

html[data-theme="dark"] .quick-obj-wiki-btn {
    color: #8888aa;
    border-color: #3a3a5a;
}

html[data-theme="dark"] .quick-obj-wiki-btn:hover {
    background: #4a4a6a;
    color: #e0e0f0;
    border-color: #5a5a7a;
}

/* Item cards */
html[data-theme="dark"] .item-card {
    background: #252540;
    border-color: #3a3a5a;
}

html[data-theme="dark"] .item-card:hover {
    border-color: #8899ff;
    box-shadow: 0 4px 12px rgba(136, 153, 255, 0.2);
}

html[data-theme="dark"] .item-name {
    color: #e0e0f0;
}

html[data-theme="dark"] .item-stack {
    background: #1a2a4a;
    color: #7ab0f0;
}

html[data-theme="dark"] .item-value {
    color: #9090b0;
}

html[data-theme="dark"] .item-detail-badge {
    background: rgba(255, 255, 255, 0.05);
    color: #9090b0;
}

html[data-theme="dark"] .item-details {
    border-top-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .item-card.rarity-uncommon {
    background: linear-gradient(135deg, #0d2a18 0%, #152a1e 100%);
    border-color: #28a745;
}

html[data-theme="dark"] .item-card.rarity-rare {
    background: linear-gradient(135deg, #0d1a40 0%, #152242 100%);
    border-color: #0d6efd;
}

html[data-theme="dark"] .item-card.rarity-exceptional {
    background: linear-gradient(135deg, #3d0d10 0%, #3a1010 100%);
    border-color: #dc3545;
}

html[data-theme="dark"] .item-card.rarity-epic {
    background: linear-gradient(135deg, #260d3a 0%, #2a1040 100%);
    border-color: #9333ea;
}

html[data-theme="dark"] .item-card.rarity-legendary {
    background: linear-gradient(135deg, #3a2800 0%, #3a2d00 100%);
    border-color: #ffc107;
}

/* Vault summary */
html[data-theme="dark"] .vault-summary {
    background: linear-gradient(135deg, #252540 0%, #1e1e2e 100%);
}

html[data-theme="dark"] .vault-summary-label {
    color: #c0c0e0;
}

html[data-theme="dark"] .vault-summary-value {
    color: #8899ff;
}

html[data-theme="dark"] .nested-vault-accordion {
    border-color: #3a3a5a;
}

html[data-theme="dark"] .nested-vault-header {
    background: linear-gradient(135deg, #252540 0%, #1e1e2e 100%) !important;
}

html[data-theme="dark"] .nested-vault-header:hover {
    background: linear-gradient(135deg, #2a2a50 0%, #252540 100%) !important;
}

html[data-theme="dark"] .nested-vault-header.active {
    background: linear-gradient(135deg, #1e2255 0%, #181e50 100%) !important;
    color: #8899ff !important;
}

html[data-theme="dark"] .nested-vault-header.active .accordion-title,
html[data-theme="dark"] .nested-vault-header.active .accordion-icon {
    color: #8899ff !important;
}

/* Store table */
html[data-theme="dark"] .store-table thead th {
    background: #252540;
    border-bottom-color: #3a3a5a;
    color: #8888aa;
}

html[data-theme="dark"] .store-table tbody td {
    border-bottom-color: #2a2a40;
}

html[data-theme="dark"] .store-table tbody tr:hover td {
    background: #2a2a50;
}

html[data-theme="dark"] .store-table .col-name {
    color: #e0e0f0;
}

html[data-theme="dark"] .store-table .col-cap {
    color: #c0c0e0;
}

html[data-theme="dark"] .store-table .col-buys {
    color: #9090b0;
}

html[data-theme="dark"] .store-table .col-region {
    color: #8888aa;
}

html[data-theme="dark"] .store-toolbar-label {
    color: #8888aa;
}

/* Favor badges — dark mode */
html[data-theme="dark"] .favor-badge.favor-despised    { background: #3d1020; color: #f08090; }
html[data-theme="dark"] .favor-badge.favor-disliked    { background: #3a2010; color: #f0a070; }
html[data-theme="dark"] .favor-badge.favor-neutral     { background: #2a2a40; color: #a0a0c0; }
html[data-theme="dark"] .favor-badge.favor-comfortable { background: #0d2a3a; color: #70c0e0; }
html[data-theme="dark"] .favor-badge.favor-friends     { background: #0d2a1a; color: #6ee09a; }
html[data-theme="dark"] .favor-badge.favor-closefriends { background: #0d1a3a; color: #70a0f0; }
html[data-theme="dark"] .favor-badge.favor-bestfriends { background: #220d3a; color: #c080f0; }
html[data-theme="dark"] .favor-badge.favor-likefamily  { background: #3a2800; color: #f0c060; }
html[data-theme="dark"] .favor-badge.favor-soulmates   { background: #350d28; color: #f080c0; }
html[data-theme="dark"] .favor-badge.favor-unknown     { background: #2a2a40; color: #8888aa; border-color: #3a3a5a; }

/* Tooltip content */
html[data-theme="dark"] .tooltip-content {
    background: #252540;
    border-color: #3a3a5a;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .tooltip-btn {
    background: #1e1e2e;
    border-color: #8899ff;
    color: #8899ff;
}

html[data-theme="dark"] .tooltip-btn:hover,
html[data-theme="dark"] .tooltip-btn.tooltip-active {
    background: #8899ff;
    color: #1e1e2e;
}

html[data-theme="dark"] .tooltip-title {
    color: #8888aa;
    border-bottom-color: #3a3a5a;
}

html[data-theme="dark"] .tooltip-title-divider {
    border-top-color: #3a3a5a;
}

/* Cap table */
html[data-theme="dark"] .cap-table th {
    background: #252540;
    border-bottom-color: #3a3a5a;
    color: #aaaacc;
}

html[data-theme="dark"] .cap-table td {
    border-bottom-color: #2a2a40;
    color: #c0c0e0;
}

html[data-theme="dark"] .cap-table tr.cap-row-current td {
    background: #0d2a1a;
    color: #6ee09a;
}

html[data-theme="dark"] .cap-table tr.cap-row-unlocked td {
    background: #0d1a3a;
    color: #7ab0f0;
}

html[data-theme="dark"] .cap-table tr.cap-row-locked td {
    color: #4a4a6a;
}

/* Tracker popup */
html[data-theme="dark"] .tracker-popup {
    background: #252540;
    border-color: #3a3a5a;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .tracker-popup-label {
    color: #8888aa;
}

html[data-theme="dark"] .tracker-popup input[type="number"] {
    background: #2a2a44;
    border-color: #3a3a5a;
    color: #e0e0f0;
}

html[data-theme="dark"] .tracker-reset-inputs {
    color: #c0c0e0;
}

html[data-theme="dark"] .tracker-clear-btn {
    background: #2a2a44;
    border-color: #3a3a5a;
    color: #9090b0;
}

html[data-theme="dark"] .tracker-clear-btn:hover {
    background: #3a3a5a;
}

html[data-theme="dark"] .tracker-btn {
    background: #1e1e2e;
    border-color: #6a6a8a;
    color: #8888aa;
}

html[data-theme="dark"] .tracker-btn:hover,
html[data-theme="dark"] .tracker-btn.tracker-active {
    background: #6a6a8a;
    color: white;
}

/* Tracker / price / favor / duplicate modals */
html[data-theme="dark"] .tracker-modal,
html[data-theme="dark"] .price-modal,
html[data-theme="dark"] .favor-items-modal,
html[data-theme="dark"] .duplicate-items-modal {
    background: #1e1e2e;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .tracker-modal-header,
html[data-theme="dark"] .price-modal-header {
    background: #252540;
    border-bottom-color: #3a3a5a;
}

html[data-theme="dark"] .tracker-modal-title,
html[data-theme="dark"] .price-modal-title {
    color: #c0c0e0;
}

html[data-theme="dark"] .tracker-modal-close,
html[data-theme="dark"] .price-modal-close {
    color: #8888aa;
}

html[data-theme="dark"] .tracker-modal-close:hover,
html[data-theme="dark"] .price-modal-close:hover {
    background: #3a3a5a;
    color: #e0e0f0;
}

html[data-theme="dark"] .tracker-modal-body input[type="number"],
html[data-theme="dark"] .price-modal-input {
    background: #2a2a44;
    border-color: #3a3a5a;
    color: #e0e0f0;
}

html[data-theme="dark"] .tracker-modal-footer,
html[data-theme="dark"] .price-modal-footer {
    background: #252540;
    border-top-color: #3a3a5a;
}

html[data-theme="dark"] .price-modal-label {
    color: #8888aa;
}

html[data-theme="dark"] .tracker-modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

/* Duplicate items modal — dark mode */
html[data-theme="dark"] .dup-summary {
    color: #8888aa;
    border-bottom-color: #3a3a5a;
}
html[data-theme="dark"] .dup-item-row {
    border-bottom-color: #2a2a40;
}
html[data-theme="dark"] .dup-item-name {
    color: #c0c0e0;
}
html[data-theme="dark"] .dup-vault-chip {
    background: #1e2040;
    border-color: #3a3a6a;
    color: #9090cc;
}
html[data-theme="dark"] .dup-qty {
    color: #6666aa;
}

/* Favor items modal */
html[data-theme="dark"] .favor-items-group-header {
    border-top-color: #3a3a5a;
    color: #aaaacc;
}

html[data-theme="dark"] .favor-items-table th {
    background: #252540;
    color: #8888aa;
}

html[data-theme="dark"] .favor-items-table td {
    border-top-color: #2a2a40;
    color: #c0c0e0;
}

html[data-theme="dark"] .favor-items-table tr:hover td {
    background: #2a2a44;
}

/* Chat watcher */
html[data-theme="dark"] .chat-display {
    background: #141420;
}

html[data-theme="dark"] .chat-line {
    background: #1e1e2e;
    border-left-color: #3a3a5a;
    color: #c0c0e0;
}

html[data-theme="dark"] .chat-line.matched {
    background: #3a2d00;
    border-left-color: #ffc107;
}

html[data-theme="dark"] .chat-line.npc-chatter {
    background: #0d1a3a;
    border-left-color: #4a80ff;
}

html[data-theme="dark"] .status-bar {
    background: #252540;
    color: #c0c0e0;
}

/* Stat cards */
html[data-theme="dark"] .stat-card {
    background: #252540;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .stat-label {
    color: #8888aa;
}

html[data-theme="dark"] .stat-value {
    color: #e0e0f0;
}

/* Price tracker */
html[data-theme="dark"] .price-category-header {
    background: #1e2255;
    border-color: #2d3580;
    color: #8899ff;
}

html[data-theme="dark"] .price-category-header:hover {
    background: #252a60;
}

html[data-theme="dark"] .price-category-count {
    color: #7788cc;
}

html[data-theme="dark"] .price-category-body {
    border-color: #2d3580;
}

html[data-theme="dark"] .price-item-accordion {
    background: #1e1e2e;
    border-color: #3a3a5a;
}

html[data-theme="dark"] .price-item-header {
    background: linear-gradient(135deg, #252540 0%, #1e1e2e 100%);
}

html[data-theme="dark"] .price-item-header:hover {
    background: linear-gradient(135deg, #2a2a50 0%, #252540 100%);
}

html[data-theme="dark"] .price-item-name {
    color: #e0e0f0;
}

html[data-theme="dark"] .price-item-stats {
    color: #8888aa;
}

html[data-theme="dark"] .price-stat strong {
    color: #c0c0e0;
}

html[data-theme="dark"] .price-item-arrow {
    color: #8888aa;
}

html[data-theme="dark"] .price-entries-table thead th {
    background: #252540;
    border-bottom-color: #3a3a5a;
    color: #8888aa;
}

html[data-theme="dark"] .price-entries-table tbody td {
    border-bottom-color: #2a2a40;
}

html[data-theme="dark"] .price-entries-table tbody tr:hover td {
    background: #2a2a50;
}

html[data-theme="dark"] .entry-price,
html[data-theme="dark"] .entry-location {
    color: #c0c0e0;
}

html[data-theme="dark"] .entry-age,
html[data-theme="dark"] .entry-date {
    color: #8888aa;
}

html[data-theme="dark"] .entry-btn {
    background: #2a2a44;
    border-color: #3a3a5a;
    color: #c0c0e0;
}

html[data-theme="dark"] .price-add-entry-row {
    background: #252540;
    border-top-color: #3a3a5a;
}

/* Shops card */
html[data-theme="dark"] .shops-card {
    background: #1a1e40;
    border-color: #2d3580;
    border-left-color: #8899ff;
}

html[data-theme="dark"] .shops-card-header {
    background: #1e2255;
    border-bottom-color: #2d3580;
}

html[data-theme="dark"] .shops-card-title {
    color: #8899ff;
}

html[data-theme="dark"] .shops-card-subtitle {
    color: #8888aa;
}

html[data-theme="dark"] .shops-card-close {
    color: #8888aa;
}

html[data-theme="dark"] .shops-card-close:hover {
    background: #3a3a5a;
    color: #e0e0f0;
}

html[data-theme="dark"] .shops-card-table th {
    color: #8888aa;
    border-bottom-color: #3a3a5a;
}

html[data-theme="dark"] .shops-card-table td {
    color: #c0c0e0;
}

html[data-theme="dark"] .shops-card-table td:first-child {
    color: #c0c0e0;
}

html[data-theme="dark"] .shops-card-table td:last-child {
    color: #8888aa;
}

html[data-theme="dark"] .shops-card-elsewhere {
    color: #8888aa;
    border-top-color: #3a3a5a;
}

html[data-theme="dark"] .shops-card-prices {
    border-top-color: #2d3580;
}

html[data-theme="dark"] .shops-card-prices-title {
    color: #8899ff;
}

html[data-theme="dark"] .shops-card-price-row {
    color: #c0c0e0;
}

html[data-theme="dark"] .shops-card-price-gold {
    color: #6ee09a;
}

html[data-theme="dark"] .shops-card-price-loc {
    color: #8888aa;
}

html[data-theme="dark"] .shops-card-price-age {
    color: #6666aa;
}

/* Storage overview */
html[data-theme="dark"] #storageOverview {
    background: #1e1e2e;
    border-color: #3a3a5a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .storage-root-header {
    background: linear-gradient(135deg, #252540 0%, #1e1e2e 100%);
}

html[data-theme="dark"] .storage-root-header.active {
    border-bottom-color: #3a3a5a;
}

html[data-theme="dark"] .storage-root-header:hover {
    background: linear-gradient(135deg, #2a2a50 0%, #252540 100%);
}

html[data-theme="dark"] .storage-overview-title {
    color: #aaaacc;
}

html[data-theme="dark"] .storage-root-header .accordion-icon {
    color: #8888aa;
}

html[data-theme="dark"] .storage-area-header {
    color: #c0c0e0;
    border-bottom-color: #3a3a5a;
}

html[data-theme="dark"] .storage-area-header:hover {
    background: #2a2a44;
}

html[data-theme="dark"] .storage-area-total {
    color: #8899ff;
    background: rgba(136, 153, 255, 0.12);
}

html[data-theme="dark"] .storage-npc-name {
    color: #e0e0f0;
}

html[data-theme="dark"] .storage-npc-slots {
    color: #c0c0e0;
}

html[data-theme="dark"] .storage-level-table td {
    border-top-color: #2a2a40;
    color: #c0c0e0;
}

html[data-theme="dark"] .storage-level-row-current td {
    background: #0d1e3a;
    color: #7ab0f0;
}

html[data-theme="dark"] .storage-tier-label {
    color: #c0c0e0;
}

html[data-theme="dark"] .storage-tier-slots {
    color: #e0e0f0;
}

/* Maps page */
html[data-theme="dark"] .map-controls {
    background: #252540;
    border-bottom-color: #3a3a5a;
}

html[data-theme="dark"] .map-selector select {
    background: #2a2a44;
    border-color: #3a3a5a;
    color: #e0e0f0;
}

html[data-theme="dark"] .info-badge {
    background: #252540;
    color: #c0c0e0;
}

html[data-theme="dark"] .info-badge strong {
    color: #8899ff;
}

html[data-theme="dark"] .adjacent-zones-title {
    color: #c0c0e0;
}

html[data-theme="dark"] .debug-info {
    background: rgba(30, 30, 46, 0.95);
    color: #c0c0e0;
}

/* Remaining gold colors */
html[data-theme="dark"] .remaining-high { color: #6ee09a; }
html[data-theme="dark"] .remaining-med  { color: #f0c060; }
html[data-theme="dark"] .remaining-low  { color: #f08090; }

html[data-theme="dark"] .col-reset {
    color: #8888aa;
}

html[data-theme="dark"] .col-reset.reset-ready {
    color: #6ee09a;
}

/* Character picker — needs !important to beat inline styles */
html[data-theme="dark"] #characterPicker {
    background: #2a2a44 !important;
    border-color: #3a3a5a !important;
    color: #e0e0f0 !important;
}

html[data-theme="dark"] #characterPickerRow label {
    color: #c0c0e0 !important;
}

html[data-theme="dark"] #reportsWatchStatus {
    color: #8888aa;
}

/* Leaflet popup */
html[data-theme="dark"] .leaflet-popup-content-wrapper {
    background: #252540;
    color: #e0e0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .leaflet-popup-tip {
    background: #252540;
}

html[data-theme="dark"] .popup-title {
    color: #e0e0f0;
}

html[data-theme="dark"] .popup-coords {
    color: #8888aa;
}

/* ==========================================================================
   DARK MODE — timers.html specific inline-style overrides
   ========================================================================== */

html[data-theme="dark"] .toggle-group {
    background: #1e1e2e;
    border-color: #3a3a5a;
}

html[data-theme="dark"] .toggle-group label {
    color: #c0c0e0;
}

html[data-theme="dark"] .timers-body {
    background: #1e1e2e;
}

html[data-theme="dark"] .add-entry-form {
    background: #252540;
    border-color: #3a3a5a;
}

html[data-theme="dark"] .add-entry-form h3 {
    color: #c0c0e0;
}

html[data-theme="dark"] .form-field label {
    color: #8888aa;
}

html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field select {
    background: #2a2a44;
    border-color: #3a3a5a;
    color: #e0e0f0;
}

html[data-theme="dark"] .cooldown-inputs span {
    color: #8888aa;
}

html[data-theme="dark"] .area-group-entries {
    border-color: #3a3a5a;
}

html[data-theme="dark"] .timer-entry {
    border-bottom-color: #2a2a40;
}

html[data-theme="dark"] .timer-entry:hover {
    background: #252540;
}

html[data-theme="dark"] .entry-name {
    color: #e0e0f0;
}

html[data-theme="dark"] .entry-cooldown-label,
html[data-theme="dark"] .countdown-label,
html[data-theme="dark"] .last-triggered {
    color: #8888aa;
}

html[data-theme="dark"] .entry-type-badge.boss {
    background: #3d0d10;
}

html[data-theme="dark"] .entry-type-badge.chest {
    background: #3a2800;
}

html[data-theme="dark"] .btn-reset-timer {
    background: #2a2a44;
    color: #c0c0e0;
}

html[data-theme="dark"] .btn-reset-timer:hover {
    background: #3a3a5a;
}

html[data-theme="dark"] .btn-delete {
    background: none;
    color: #6666aa;
    border-color: #3a3a5a;
}

html[data-theme="dark"] .btn-delete:hover {
    color: #f08090;
    border-color: #f08090;
}

html[data-theme="dark"] .toast {
    background: #252540;
    color: #e0e0f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .toast-title {
    color: #e0e0f0;
}

html[data-theme="dark"] .toast-msg {
    color: #8888aa;
}

html[data-theme="dark"] .toast-close {
    color: #6666aa;
}

html[data-theme="dark"] .toast-close:hover {
    color: #c0c0e0;
}
