:root {
    --nx-tool-mhw-cool: #38bdf8;
    --nx-tool-mhw-warm: #ea580c;
    --nx-tool-mhw-teal: #0d9488;
}

.nx-hero-question {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nx-tool-mhw-teal, #0d9488);
    margin: 0 0 0.35rem;
    line-height: 1.35;
}

.nx-hero-badge-row {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nx-hero-status {
    background: var(--surface-elevated, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 500;
}

.mhw-hero-map {
    height: 200px;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid var(--border-subtle);
}

.mhw-signature-panel {
    border-left: 3px solid var(--nx-tool-mhw-warm, #ea580c);
}

.mhw-signature-panel .mhw-hobday-scale {
    height: 4.2rem;
    margin-top: 1.25rem;
}

#mhw-map {
    height: 400px;
    border-radius: 8px;
}

.chart-wrap {
    height: 280px;
    position: relative;
    margin-top: 0.75rem;
}

.chart-wrap--enso {
    height: 220px;
}

.mhw-hobday-scale {
    position: relative;
    height: 3.25rem;
    margin: 1rem 0 0.5rem;
    border-radius: 8px;
    background: linear-gradient(
        90deg,
        #38bdf8 0%,
        #38bdf8 18%,
        #fef08a 22%,
        #fbbf24 38%,
        #f97316 55%,
        #ef4444 72%,
        #991b1b 100%
    );
    border: 1px solid var(--border-subtle);
}

.mhw-hobday-scale::before {
    content: "";
    position: absolute;
    left: 18%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.mhw-hobday-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    cursor: default;
    z-index: 2;
}

.mhw-hobday-marker:focus-visible {
    outline: 2px solid var(--accent, #38bdf8);
    outline-offset: 2px;
}

.mhw-hobday-marker-label {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--surface-elevated, #1e293b);
    color: var(--text-primary);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    pointer-events: none;
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Hide by default - markers cluster too tightly at the cold end of the ruler
       and stacking labels produced a black smear. Show on hover / focus. */
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 5;
}

.mhw-hobday-marker:hover .mhw-hobday-marker-label,
.mhw-hobday-marker:focus-visible .mhw-hobday-marker-label,
.mhw-hobday-marker:focus .mhw-hobday-marker-label {
    opacity: 1;
}

.mhw-hobday-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.mhw-leg::before {
    content: "";
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 2px;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.mhw-leg--none::before { background: #38bdf8; }
.mhw-leg--1::before { background: #fef08a; }
.mhw-leg--2::before { background: #fbbf24; }
.mhw-leg--3::before { background: #f97316; }
.mhw-leg--4::before { background: #ef4444; }

.mhw-localized {
    margin-top: 0.5rem;
}

.mhw-localized-card {
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    border-left: 4px solid var(--nx-tool-mhw-warm, #ea580c);
}

.mhw-localized-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

.mhw-localized-stat {
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.25rem 0;
}

.mhw-localized-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.mhw-localized-picker select {
    min-height: 2.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-elevated);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.mhw-enso-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.mhw-enso-card {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 0.85rem;
}

.mhw-enso-card strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.mhw-sparkline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.mhw-sparkline-item {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.5rem 0.65rem 0.35rem;
}

.mhw-sparkline-item h3 {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
}

.mhw-sparkline-wrap {
    height: 100px;
    position: relative;
}

.event-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.event-card {
    padding: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
}

.event-card.cat-3,
.event-card.cat-4 {
    border-left-color: #ef4444;
}

.mhw-timeline {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    border-left: 2px solid var(--border-subtle);
}

.mhw-timeline li {
    position: relative;
    padding: 0 0 1rem 1rem;
    font-size: 0.9rem;
    line-height: 1.45;
}

.mhw-timeline li::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 0.35rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--nx-tool-mhw-warm, #ea580c);
}

.mhw-timeline li.mhw-timeline--now::before {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.mhw-timeline-year {
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 0.35rem;
}

.mhw-impact-bullets li {
    border-left-color: var(--nx-tool-mhw-warm, #ea580c);
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 900px) {
    .split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .mhw-hobday-marker-label {
        display: none;
    }
}
