/* =============================================================================
   🌀 PERSISTENT HOMOLOGY — barcode + persistence diagram CSS
   ============================================================================= */

.panel-ph {
    background:
        radial-gradient(ellipse at top left, rgba(155,213,255,0.07), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(255,123,157,0.07), transparent 60%),
        linear-gradient(180deg, rgba(28,20,55,0.94), rgba(10,8,24,0.97));
    border: 1px solid rgba(155,213,255,0.30);
    border-radius: 14px;
    padding: 22px 26px;
    margin-top: 18px;
    box-shadow:
        0 10px 32px rgba(0,0,0,0.45),
        inset 0 1px 0 rgba(155,213,255,0.10);
}

.ph-headline-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 12px 0 16px;
}

.ph-headline-card {
    background: linear-gradient(180deg, rgba(155,213,255,0.06), rgba(10,8,24,0.50));
    border: 1px solid rgba(155,213,255,0.24);
    border-radius: 10px;
    padding: 12px 14px;
}

.ph-headline-label {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 10.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #b095f5;
    margin-bottom: 4px;
}

.ph-headline-value {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 22px;
    font-weight: 600;
    color: #9bd5ff;
    line-height: 1.2;
    letter-spacing: 0.8px;
}

.ph-h1-card .ph-headline-value { color: #ff7b9d; }

.ph-headline-sub {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 11px;
    color: #888aa0;
    font-style: italic;
    margin-top: 4px;
}

/* ── BARCODE CANVAS ────────────────────────────────────────────────────── */

.ph-views-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.ph-canvas-wrap {
    background: rgba(10,8,24,0.55);
    border: 1px solid rgba(212,175,55,0.14);
    border-radius: 10px;
    padding: 14px;
}

.ph-canvas-title {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
    color: #ddc88a;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}

.ph-barcode-canvas {
    width: 100%;
    height: 420px;
    display: block;
    border-radius: 6px;
}

.ph-diag-canvas {
    width: 100%;
    height: 420px;
    display: block;
    border-radius: 6px;
}

.ph-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 11px;
    color: #888aa0;
}

.ph-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ph-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 4px currentColor;
}

.ph-dot-b0 { background: #9bd5ff; color: #9bd5ff; }
.ph-dot-b1 { background: #ff7b9d; color: #ff7b9d; }

/* ── CYCLES LIST ───────────────────────────────────────────────────────── */

.ph-cycles-card {
    background: rgba(10,8,24,0.55);
    border: 1px solid rgba(212,175,55,0.14);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.ph-cycles-title {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
    color: #ddc88a;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
}

.ph-cycle-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ph-cycle-item {
    background: linear-gradient(90deg, rgba(255,123,157,0.06), transparent 80%);
    border-left: 2px solid rgba(255,123,157,0.50);
    padding: 6px 10px;
    border-radius: 0 6px 6px 0;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
}

.ph-cycle-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

.ph-cycle-rank {
    color: #ffd86b;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.ph-cycle-meta {
    color: #888aa0;
    font-size: 11px;
    font-style: italic;
}

.ph-cycle-loop {
    color: #ddc88a;
    font-size: 11.5px;
    line-height: 1.4;
    word-break: break-word;
}

.ph-cycle-closing {
    color: #9bd5ff;
    font-size: 11px;
    font-style: italic;
    margin-top: 2px;
}

/* ── INTERPRETATION + FOOT ─────────────────────────────────────────────── */

.ph-interp {
    background: linear-gradient(90deg, rgba(155,213,255,0.07), transparent 80%);
    border-left: 2px solid rgba(155,213,255,0.50);
    border-radius: 0 6px 6px 0;
    padding: 10px 16px;
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    font-size: 13px;
    color: #ddc88a;
    line-height: 1.5;
    margin-bottom: 12px;
}

.ph-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(212,175,55,0.14);
}

.ph-refresh-btn {
    background: rgba(155,213,255,0.10);
    color: #9bd5ff;
    border: 1px solid rgba(155,213,255,0.30);
    border-radius: 999px;
    padding: 5px 14px;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.ph-refresh-btn:hover:not(:disabled) {
    background: rgba(155,213,255,0.20);
    transform: translateY(-1px);
}
.ph-refresh-btn:disabled { opacity: 0.55; cursor: progress; }

.ph-foot-note {
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    font-size: 11px;
    color: #888aa0;
}

@media (max-width: 900px) {
    .ph-headline-row { grid-template-columns: repeat(2, 1fr); }
    .ph-views-row { grid-template-columns: 1fr; }
    .ph-barcode-canvas,
    .ph-diag-canvas { height: 320px; }
}
