/* Copyright (c) 2026 DNA Genics, S.L. All rights reserved. */

.mtv .mtv-tree-preview:has(> [data-mtv-branch-link]),
.mth-lineage-path,
.ydr-lineage-path,
.mth-timeline-side.hgv-branch-timeline,
.hgv-marker-strip {
    background: #f5f0e5;
    border: 1px solid #d9cdb8;
    border-radius: 10px;
    color: #213a2f;
}

.mtv .mtv-tree-preview:has(> [data-mtv-branch-link]) {
    flex-wrap: nowrap;
    gap: 12px;
    padding: 20px 16px 16px;
}

.mtv .mtv-tree-preview > [data-mtv-branch-link] {
    gap: 4px;
    min-width: 0;
    min-height: 44px;
    overflow-wrap: anywhere;
}

.mtv .mtv-tree-preview > [data-mtv-branch-link]::before,
.mtv .hgv-lineage-picker [data-mtv-branch-select]::before {
    content: "";
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    width: 16px;
    height: 16px;
    margin: 0 0 4px;
    border: 1px solid #5b6f5c;
    border-radius: 50%;
    background: #e2e8da;
}

.mtv .mtv-tree-preview > [data-mtv-branch-link]:not(:last-child)::after {
    content: "";
    top: 7px;
    right: auto;
    left: 50%;
    width: calc(100% + 12px);
    height: 1px;
    background: #af9870;
    pointer-events: none;
}

.mtv .mtv-tree-preview > .mtv-branch-result::before {
    background: #213a2f;
    border-color: #213a2f;
    box-shadow: 0 0 0 2px #f5f0e5, 0 0 0 3px #a07a40;
}

.mtv .mtv-tree-preview > [data-mtv-branch-link] strong {
    display: block;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #213a2f;
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    line-height: 1.1;
}

.mtv .mtv-tree-preview > [data-mtv-branch-link] span {
    color: #49564c;
    font-size: 0.8125rem;
}

.mtv.hgv-report .hgv-lineage-picker {
    border-color: #d9cdb8;
    background: #f5f0e5;
}

.mtv.hgv-report .hgv-lineage-picker [data-mtv-branch-select] {
    border-color: #879884;
    border-radius: 6px;
    background: #fffdfa;
    overflow-wrap: anywhere;
}

.mtv.hgv-report .hgv-lineage-picker [data-mtv-branch-select][aria-pressed="true"] {
    border-color: #213a2f;
    background: #213a2f;
}

.mtv .hgv-lineage-picker [data-mtv-branch-select][aria-pressed="true"]::before {
    border-color: #e2e8da;
    background: #213a2f;
    box-shadow: 0 0 0 2px #213a2f, 0 0 0 3px #d4bb8b;
}

.mth-lineage-path .mth-lineage-step,
.ydr-lineage-path .ydr-lineage-step {
    max-width: 100%;
}

.mth-lineage-path .mth-lineage-marker,
.ydr-lineage-path .ydr-lineage-marker {
    max-width: 100%;
    border: 1px solid #879884;
    background: #e2e8da;
    box-shadow: none;
    color: #213a2f;
    overflow-wrap: anywhere;
    white-space: normal;
}

.mth-lineage-path .mth-lineage-marker-current,
.ydr-lineage-path .ydr-lineage-marker-current {
    border-color: #213a2f;
    background: #213a2f;
    color: #fffdfa;
    box-shadow: 0 0 0 2px #f5f0e5, 0 0 0 3px #a07a40;
    animation: none;
}

.mth-lineage-path .arrow-right,
.ydr-lineage-path .arrow-right {
    color: #7d6239;
    background-color: #7d6239;
}

.mth-timeline-side.hgv-branch-timeline {
    align-self: start;
    padding: 14px 12px 14px 30px;
}

.mth-timeline-side.hgv-branch-timeline::before {
    top: 23px;
    bottom: 23px;
    background: #af9870;
}

.hgv-branch-timeline .mth-timeline-marker {
    margin-bottom: 18px;
}

.hgv-branch-timeline .mth-timeline-marker:last-child {
    margin-bottom: 0;
}

.hgv-branch-timeline .mth-timeline-dot {
    left: -28px;
    width: 14px;
    height: 14px;
    border: 1px solid #5b6f5c;
    background: #e2e8da;
}

.hgv-branch-timeline .mth-timeline-dot.current {
    border-color: #213a2f;
    background: #213a2f;
    box-shadow: 0 0 0 2px #f5f0e5, 0 0 0 3px #a07a40;
}

.hgv-branch-timeline .mth-timeline-label {
    color: #213a2f;
    overflow-wrap: anywhere;
}

.hgv-branch-timeline .mth-timeline-date {
    color: #49564c;
}

.hgv-marker-strip {
    margin: 16px 0;
    padding: 14px;
}

.hgv-marker-strip figcaption {
    margin: 0 0 10px;
    font-size: 0.875rem;
    font-weight: 700;
}

.hgv-marker-strip ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.25rem), 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hgv-marker-strip li {
    display: grid;
    grid-template-rows: 14px auto 1fr;
    gap: 3px;
    min-width: 0;
    margin: 0;
    padding: 8px;
    border: 1px solid #e4dac8;
    border-radius: 6px;
    background: #fffdfa;
    overflow-wrap: anywhere;
}

.hgv-marker-strip-rail {
    display: flex;
    align-items: center;
    position: relative;
}

.hgv-marker-strip-rail::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    height: 1px;
    background: #c0ae8d;
}

.hgv-marker-strip-dot {
    box-sizing: border-box;
    position: relative;
    width: 10px;
    height: 10px;
    border: 1px dashed #5e655c;
    border-radius: 50%;
    background: #fffdfa;
}

.hgv-marker-strip-dot--positive,
.hgv-marker-strip-dot--confirmed {
    border: 1px solid #213a2f;
    background: #43604d;
}

.hgv-marker-strip-dot--negative,
.hgv-marker-strip-dot--ancestral {
    border: 1px solid #866335;
    background: #d4bb8b;
}

.hgv-marker-strip code {
    padding: 0;
    background: transparent;
    color: #213a2f;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: normal;
}

.hgv-marker-strip-state {
    color: #49564c;
    font-size: 0.8125rem;
    line-height: 1.3;
}

@media (max-width: 640px) {
    .mtv .mtv-tree-preview:has(> [data-mtv-branch-link]) {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 12px;
    }

    .mtv .mtv-tree-preview > [data-mtv-branch-link] {
        display: grid;
        grid-template-columns: 16px minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-content: center;
        gap: 1px 12px;
        padding: 4px 0;
        text-align: left;
    }

    .mtv .mtv-tree-preview > [data-mtv-branch-link]::before {
        grid-row: span 2;
        margin: 0;
    }

    .mtv .mtv-tree-preview > [data-mtv-branch-link]:not(:last-child)::after {
        top: 50%;
        left: 7px;
        width: 1px;
        height: 100%;
    }

    .hgv-marker-strip {
        padding: 10px;
    }

    .hgv-marker-strip ul {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 6rem), 1fr));
    }
}
