/* Styles for the 16S phylogeny page. Kept outside Tailwind so the page
   works without rebuilding the theme CSS. */

.phy-subtitle {
    margin-top: 0.25rem;
    color: #4b5563;
    font-size: 0.9rem;
}

.phy-card {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 1rem;
}

.phy-empty code {
    background: #f3f4f6;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
}

.phy-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

.phy-field {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #374151;
}

.phy-field select,
.phy-field input {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.875rem;
    background: #fff;
}

.phy-search input {
    width: 16rem;
    max-width: 60vw;
}

.phy-check {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #374151;
    cursor: pointer;
}

#phy-reset {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.3rem 0.75rem;
    background: #f9fafb;
    cursor: pointer;
}

#phy-reset:hover {
    background: #f3f4f6;
}

.phy-status {
    margin-left: auto;
    color: #6b7280;
}

.phy-body {
    display: flex;
    gap: 1rem;
    padding-top: 0.75rem;
}

.phy-tree {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 78vh;
    overflow: hidden;
    border: 1px solid #f3f4f6;
    border-radius: 0.375rem;
}

.phy-tree svg {
    display: block;
}

.phy-side {
    width: 15rem;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.phy-side h2 {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
}

.phy-legend {
    list-style: none;
    padding: 0;
    margin: 0;
}

.phy-legend li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.1rem 0;
}

.phy-legend .swatch {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 0.15rem;
    flex-shrink: 0;
}

.phy-legend .student-swatch {
    border-radius: 50%;
}

.phy-legend .count {
    margin-left: auto;
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
}

.phy-detail {
    margin-top: 1rem;
    padding: 0.6rem;
    background: #f9fafb;
    border-radius: 0.375rem;
    line-height: 1.5;
    word-break: break-word;
}

.phy-detail dt {
    color: #6b7280;
}

.phy-detail dd {
    margin: 0 0 0.3rem 0;
}

/* Tree marks. The SVG is scaled to fit the panel and zooms with its viewBox,
   so keep line widths in screen pixels whatever the zoom. */
.phy-tree svg {
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.phy-tree svg.phy-dragging {
    cursor: grabbing;
}

.phy-tree .phy-branches path {
    stroke-width: 0.8px;
    vector-effect: non-scaling-stroke;
}

.phy-tree .phy-leaders line {
    stroke-width: 0.5px;
    stroke-opacity: 0.45;
    vector-effect: non-scaling-stroke;
}

.phy-tree .phy-tip {
    cursor: pointer;
}

.phy-tree .phy-tip.phy-student {
    font-weight: 600;
}

.phy-tree .phy-tip.phy-match {
    fill: #111827;
    font-weight: 700;
    paint-order: stroke;
    stroke: #fde047;
    stroke-width: 3px;
    vector-effect: non-scaling-stroke;
}

.phy-tree.phy-dim .phy-tip:not(.phy-match):not(.phy-student) {
    opacity: 0.2;
}

#phy-download {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.3rem 0.75rem;
    background: #f9fafb;
    cursor: pointer;
}

#phy-download:hover {
    background: #f3f4f6;
}

@media (max-width: 768px) {
    .phy-body {
        flex-direction: column;
    }

    .phy-side {
        width: auto;
    }

    .phy-tree {
        height: 65vh;
    }
}
