/* Research Header */
.research-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.research-title {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: var(--glow);
    letter-spacing: 3px;
    margin: 0 0 0.5rem 0;
}

.research-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
    margin: 0;
}

/* Research Tabs */
.research-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.research-tab {
    background: var(--bg-surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-none);
    padding: var(--s-3) var(--s-6);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.research-tab:hover {
    background: var(--accent-primary-wash);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: none;
    box-shadow: var(--glow);
}

.research-tab.active {
    background: var(--accent-primary-wash);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: var(--glow);
}

.research-tab .tab-icon {
    font-size: 1.5rem;
}

.research-tab .tab-label {
    font-size: 0.9rem;
}

/* Research Status Panel */
.research-status-panel {
    background: var(--bg-surface-1);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-none);
    padding: var(--s-4);
    box-shadow: none;
}

.research-active-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.research-active-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    color: #f3f4f6;
}

.research-active-name {
    color: #fbbf24;
    font-weight: 600;
}

.research-active-timer {
    color: #d1d5db;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.research-timer-value {
    color: #fbbf24;
    font-weight: 700;
    font-size: 16px;
}

.research-queue-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.research-queue-list strong {
    color: #f3f4f6;
    margin-bottom: 8px;
    display: block;
}

.research-queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--cg-surface-bg);
    border: 1px solid var(--cg-surface-border);
    border-radius: var(--r-md);
    box-shadow: var(--cg-surface-shadow);
    transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}

.research-queue-item:hover {
    transform: translateY(-2px);
    border-color: var(--cg-surface-border-hover);
    box-shadow: var(--cg-surface-shadow-hover);
}

.research-queue-position {
    color: #60a5fa;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.research-queue-name {
    flex: 1;
    color: #e0e6ed;
    font-weight: 500;
}

.research-cancel-btn {
    padding: 4px 8px;
    font-size: 14px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    transition: all 0.2s ease;
}

.research-cancel-btn:hover {
    background: rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.7);
    color: #fff;
    transform: scale(1.1);
}

.research-tree {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 200px);
    grid-auto-rows: 200px;
    gap: 32px;
    padding: 40px 20px;
    min-height: 600px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 8px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: visible;
}

.research-tree-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 8px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 20px;
    overflow: visible;
}

.research-tier-section {
    margin-bottom: 48px;
}

.research-tier-section:last-child {
    margin-bottom: 0;
}

.research-tier-title {
    color: #fbbf24;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(251, 191, 36, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.research-tree-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.research-connection-line {
    stroke: #94a3b8;
    stroke-width: 3;
    fill: none;
    transition: all 0.3s ease;
    stroke-linecap: round;
}

.research-connection-line.connection-completed {
    stroke: #10b981;
    stroke-width: 4;
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.6));
}

.research-connection-line.connection-active {
    stroke: #fbbf24;
    stroke-width: 4.5;
    stroke-dasharray: 10,5;
    animation: dash 1.5s linear infinite;
    filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.7));
}

.research-connection-line.connection-queued {
    stroke: #60a5fa;
    stroke-width: 4;
    stroke-dasharray: 5,5;
    filter: drop-shadow(0 0 3px rgba(96, 165, 250, 0.5));
}

.research-connection-line.connection-available {
    stroke: #94a3b8;
    stroke-width: 3.5;
    opacity: 0.9;
}

.research-connection-line.connection-locked {
    stroke: #475569;
    stroke-width: 2.5;
    opacity: 0.4;
    stroke-dasharray: 4,4;
}

.research-arrow {
    fill: currentColor;
    transition: fill 0.3s ease;
}

#arrowhead {
    overflow: visible;
}

@keyframes dash {
    to {
        stroke-dashoffset: -15;
    }
}

.research-node {
    position: relative;
    z-index: 1;
    background: var(--cg-surface-bg);
    border: 1px solid var(--cg-surface-border);
    border-radius: var(--cg-surface-radius);
    padding: 16px;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
    box-shadow: var(--cg-surface-shadow);
    cursor: pointer;
    min-height: 200px;
}

.research-node-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.research-node-icon {
    font-size: 36px;
    line-height: 1;
}

.research-node-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 4px;
}

.research-node-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.research-node-title {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    line-height: 1.3;
    margin: 0;
    color: #f3f4f6;
}

.research-node-description {
    font-size: 11px;
    color: #d1d5db;
    line-height: 1.4;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.research-node-time {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
}

.research-node-bonus {
    font-size: 11px;
    color: #fbbf24;
    text-align: center;
}

.research-node-bonus strong {
    color: #fbbf24;
}

.research-node:hover {
    transform: translateY(-2px);
    border-color: var(--cg-surface-border-hover);
    box-shadow: var(--cg-surface-shadow-hover);
}

.research-node-available {
    box-shadow: var(--cg-surface-shadow);
}

.research-node-available:hover {
    transform: translateY(-2px);
    border-color: var(--cg-surface-border-hover);
    box-shadow: var(--cg-surface-shadow-hover);
}

.research-node-locked {
    opacity: 0.5;
    filter: grayscale(0.8);
    cursor: not-allowed;
}

.research-node-locked:hover {
    transform: none;
    border-color: var(--cg-surface-border);
    box-shadow: var(--cg-surface-shadow);
}

.research-node-active {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    animation: pulse-glow 2s ease-in-out infinite;
}

.research-node-completed {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
}

.research-node-queued {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

.research-node-status {
    margin-top: auto;
    display: flex;
    justify-content: center;
}

.research-node-status-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.research-timer {
    font-size: 11px;
    color: #fbbf24;
    font-weight: 600;
    text-align: center;
    background: rgba(251, 191, 36, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.research-timer-large {
    font-size: 18px;
    color: #fbbf24;
    font-weight: 700;
    text-align: center;
    background: rgba(251, 191, 36, 0.15);
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid rgba(251, 191, 36, 0.4);
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.2);
}

.research-modal-timer-box .research-timer-large {
    margin-top: 0;
    border-radius: 14px;
}

.research-node-start-btn {
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.research-node-start-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.research-node-start-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(251, 191, 36, 0.5);
    }
    50% {
        box-shadow: 0 4px 24px rgba(251, 191, 36, 0.7);
    }
}

.research-node-icon-large {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 8px;
}

.research-node-title {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 8px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.research-node-costs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    font-size: 11px;
    margin-top: auto;
}

.cost-item {
    color: #fbbf24;
    white-space: nowrap;
    background: rgba(251, 191, 36, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.research-node-status-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    z-index: 10;
}

.research-node-status-overlay.locked {
    background: rgba(107, 114, 128, 0.9);
    color: white;
}

.research-node-status-overlay.in-progress {
    background: rgba(251, 191, 36, 0.9);
    color: #78350f;
}

.research-node-status-overlay.completed {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.research-node-status-overlay.queued {
    background: rgba(96, 165, 250, 0.9);
    color: white;
    font-size: 14px;
}

/* Research detail modal — glass card, touch-friendly, bottom sheet on narrow viewports */
.research-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top, 16px)) max(16px, env(safe-area-inset-right, 16px)) max(16px, env(safe-area-inset-bottom, 16px)) max(16px, env(safe-area-inset-left, 16px));
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.research-modal-dialog {
    width: min(100%, 28rem);
    margin: auto;
    position: relative;
    z-index: 1051;
    display: flex;
    align-items: stretch;
}

.research-modal-sheet {
    width: 100%;
    max-height: min(90vh, 42rem);
    display: flex;
    flex-direction: column;
    border-radius: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(165deg, rgba(30, 41, 59, 0.97) 0%, rgba(15, 23, 42, 0.98) 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 24px 48px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.research-modal-grab {
    display: none;
    height: 4px;
    width: 40px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
    flex-shrink: 0;
}

.research-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 1.1rem 1.1rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.research-modal-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.research-modal-title {
    margin: 0;
    font-size: clamp(1.05rem, 3.5vw, 1.25rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #f8fafc;
    word-break: break-word;
}

.research-modal-icon {
    font-size: clamp(1.75rem, 5vw, 2rem);
    line-height: 1;
    flex-shrink: 0;
}

.research-modal-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px;
}

.research-modal-close {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin: -6px -8px 0 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    touch-action: manipulation;
}

.research-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}

.research-modal-body {
    padding: 1rem 1.1rem 1.15rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.research-modal-description {
    margin: 0 0 1rem;
    color: #cbd5e1;
    font-size: 0.9375rem;
    line-height: 1.55;
}

.research-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.1rem;
}

.research-modal-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(100, 116, 139, 0.35);
}

.research-modal-chip-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.research-modal-block {
    margin-bottom: 1rem;
}

.research-modal-block:last-of-type {
    margin-bottom: 0;
}

.research-modal-block-title {
    margin: 0 0 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
}

.research-modal-costs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cost-badge {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fef3c7;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.28);
}

.research-modal-prereq-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.research-modal-prereq-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.35;
    border: 1px solid transparent;
}

.research-modal-prereq-item.is-done {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(52, 211, 153, 0.25);
    color: #a7f3d0;
}

.research-modal-prereq-item.is-pending {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.22);
    color: #fecaca;
}

.research-modal-prereq-ico {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
    font-weight: 700;
}

.research-modal-prereq-name {
    min-width: 0;
    word-break: break-word;
}

.research-modal-effect {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(45, 212, 191, 0.06);
    border: 1px solid rgba(45, 212, 191, 0.2);
}

.research-modal-effect-text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #ccfbf1;
}

.research-modal-timer-box {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.research-modal-timer-lbl {
    display: block;
    margin-bottom: 0.5rem;
}

.research-modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: stretch;
    padding: 0.85rem 1.1rem max(0.85rem, env(safe-area-inset-bottom, 0.85rem));
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.5);
}

.research-modal-btn {
    flex: 1 1 auto;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
    touch-action: manipulation;
}

.research-modal-btn-secondary {
    flex: 1 1 40%;
    background: rgba(71, 85, 105, 0.45);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.research-modal-btn-secondary:hover {
    background: rgba(71, 85, 105, 0.75);
}

.research-modal-btn-primary {
    flex: 1 1 55%;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ecfdf5;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.research-modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
}

@media (max-width: 576px) {
    .research-modal-overlay {
        align-items: flex-end;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .research-modal-dialog {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .research-modal-sheet {
        max-height: min(88dvh, 36rem);
        border-radius: 1.25rem 1.25rem 0 0;
    }

    .research-modal-grab {
        display: block;
    }

    .research-modal-header {
        padding: 0.35rem 1rem 0.75rem;
    }

    .research-modal-body {
        padding: 0.85rem 1rem 1rem;
    }

    .research-modal-footer {
        flex-direction: column;
        padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom, 12px));
    }

    .research-modal-btn {
        width: 100%;
        flex: none;
    }
}

/* Responsive adjustments for header and tabs */
@media (max-width: 768px) {
    .research-title {
        font-size: 1.8rem;
    }
    
    .research-subtitle {
        font-size: 0.9rem;
    }
    
    .research-tabs {
        flex-direction: column;
    }
    
    .research-tab {
        width: 100%;
        justify-content: center;
    }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .research-tree {
        grid-template-columns: repeat(4, 180px);
        gap: 24px;
    }
    
    .research-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .research-tree {
        grid-template-columns: repeat(3, 160px);
        gap: 20px;
    }
    
    .research-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .research-node {
        padding: 12px;
        min-height: 180px;
    }
    
    .research-node-icon {
        font-size: 32px;
    }
    
    .research-node-title {
        font-size: 12px;
    }
    
    .research-node-start-btn {
        font-size: 11px;
        padding: 6px 10px;
    }
}

@media (max-width: 600px) {
    .research-tree {
        grid-template-columns: repeat(2, 140px);
        gap: 16px;
        padding: 20px 10px;
    }
    
    .research-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .research-tree-container {
        padding: 20px 10px;
    }
    
    .research-node {
        padding: 10px;
        min-height: 160px;
    }
    
    .research-node-icon {
        font-size: 28px;
    }
    
    .research-node-title {
        font-size: 11px;
    }
    
    .cost-badge {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .research-node-start-btn {
        font-size: 10px;
        padding: 6px 8px;
    }
}

/* SVG research graph (prototype-style tree) */
.research-svg-wrap {
    width: 100%;
}

.research-svg-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: min(88vh, 960px);
    padding: 4px 0 12px;
    -webkit-overflow-scrolling: touch;
}

.research-svg {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.research-svg .rs-node {
    transition: opacity 0.12s ease;
}

.research-svg .rs-node-inner {
    transform-box: fill-box;
    transform-origin: center center;
    transition: transform 0.22s cubic-bezier(0.34, 1.22, 0.64, 1);
}

.research-svg .rs-node:not(.rs-node-dim):hover .rs-node-inner {
    transform: scale(1.04);
}

.research-svg .rs-node-dim {
    opacity: 0.12;
}

/* Stronger fade for nodes outside the “missing only” hover path */
.research-svg-wrap.rs-narrow-hover .research-svg .rs-node-dim {
    opacity: 0.05;
}

.research-svg-wrap.rs-narrow-hover .research-svg path.rs-edge-dim {
    stroke-opacity: 0.03 !important;
}

.research-svg .rs-node-inner > .rs-node-rect {
    filter: url(#rs-tile-drop);
    transition: stroke-width 0.18s ease, filter 0.2s ease, stroke 0.18s ease;
}

.research-svg .rs-node:not(.rs-node-dim):hover .rs-node-rect {
    stroke-width: 1.65;
}

.research-svg .rs-node-icon-img {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
    pointer-events: none;
}

/* Tiles: only icon + name — available glows green; rest red-tinted & muted */
.research-svg .rs-node-tile-available .rs-node-rect {
    filter: url(#rs-tile-drop) drop-shadow(0 0 14px rgba(52, 211, 153, 0.55)) drop-shadow(0 0 28px rgba(45, 212, 191, 0.28));
}

.research-svg .rs-node-tile-done .rs-node-rect {
    filter: url(#rs-tile-drop);
}

.research-svg .rs-node-tile-miss .rs-node-rect {
    filter: url(#rs-tile-drop) drop-shadow(0 0 10px rgba(248, 113, 113, 0.5));
}

.research-svg .rs-node-tile-locked .rs-node-rect,
.research-svg .rs-node-tile-busy .rs-node-rect {
    filter: url(#rs-tile-drop) grayscale(0.42) brightness(0.9);
}

.research-svg .rs-node-tile-locked image,
.research-svg .rs-node-tile-busy image {
    filter: grayscale(0.55) brightness(0.82);
}

.research-svg path.rs-edge-unlock {
    filter: drop-shadow(0 0 3px rgba(226, 75, 74, 0.45));
}
