
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.fp-wrap {
    position: relative;
}

.fp-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 500;
    overflow: hidden;
    animation: fp-fade-in 120ms ease;
}
.fp-panel.fp-open {
    display: block;
}
@keyframes fp-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

body.dark-mode .fp-panel {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.fp-section {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.fp-section:last-child {
    border-bottom: none;
}

.fp-label {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: var(--fs-sm);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.fp-label span {
    font-weight: 700;
    color: var(--primary-color);
    text-transform: none;
    letter-spacing: 0;
}
.fp-family-list .fa-check {
    margin: 2px;
}

.fp-family-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 220px;
    overflow-y: auto;
}

.fp-font-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.05rem 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 80ms, border-color 80ms;
    color: var(--text-main);
    background: none;
    text-align: left;
    width: 100%;
}
.fp-font-item:hover {
    background: var(--bg-body);
}
.fp-font-item.fp-active {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.fp-font-item.fp-active .fp-check {
    opacity: 1;
}
.fp-font-name {
    flex: 1;
}
.fp-check {
    opacity: 0;
    color: var(--primary-color);
    font-size: var(--fs-xs);
    transition: opacity 120ms;
}

.fp-slider {
    width: 100%;
    margin: 0.25rem 0 0.15rem;
    accent-color: var(--primary-color);
    cursor: pointer;
}
.fp-slider-labels {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: var(--fs-xs);
}

/* A plain label-wrapped checkbox row (currently: "Hide phase highlights").
   Sized off the same tokens as .fp-label so it sits level with the sections
   above it, but not uppercased — it is a control, not a section heading. */
.fp-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-main);
    font-size: var(--fs-sm);
    user-select: none;
}
.fp-toggle-row input[type="checkbox"] {
    accent-color: var(--primary-color);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.fp-footer {
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: flex-end;
    background: var(--bg-body);
}
