/* ── Mobile tracker pills (all share the same base) ── */
#fv-mobile-pill,
#hdr-act-pill,
#fv-retrofit-pill,
#fv-build-pill {
    display: none;
    position: fixed;
    top: calc(var(--overlay-top, 3.75rem) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-hud);
    flex-direction: column;
    min-width: 70%;
    pointer-events: auto;
    background: rgba(13, 14, 18, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-radius: 1.9rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

@media not ((min-width: 768px) and (pointer: fine)) {
    #fv-mobile-pill[data-visible='true'],
    #hdr-act-pill[data-visible='true'],
    #fv-retrofit-pill[data-visible='true'],
    #fv-build-pill[data-visible='true'] {
        display: flex;
    }
}

.fv-pill-row {
    display: flex;
    align-items: stretch;
    min-height: 3.8rem;
    white-space: nowrap;
}

.fv-pill-step {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    padding: 0 0.9rem;
    border-right: 1px solid rgb(39 35 28);
    gap: 0.05rem;
}

/* Switcher chevron - in flex flow, appears directly below the step text */
.fv-pill-switcher {
    background: none;
    border: none;
    padding: 0;
    pointer-events: none; /* parent .fv-pill-step handles the click */
    color: rgba(197, 160, 89, 0.45);
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: -3px;
    margin-top: 2px;
}

.fv-pill-switcher[hidden],
.fv-pill-step:not([data-switchable='true']) .fv-pill-switcher {
    display: none !important;
}

.fv-pill-step:hover .fv-pill-switcher {
    color: rgba(197, 160, 89, 0.85);
}

.fv-pill-switcher svg {
    transition: transform 0.2s ease;
}

.fv-pill-switcher[data-open='true'] svg {
    transform: rotate(180deg);
}

.act-pill-skill-icon {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    opacity: 0.85;
    flex-shrink: 0;
}

/* Invisible spacer mirrors the icon width so the text stays centred */
#hdr-act-pill .fv-pill-task {
    gap: 0.5rem;
}

#fv-retrofit-pill .fv-pill-task,
#fv-build-pill .fv-pill-task {
    gap: 0.5rem;
}

#fv-retrofit-pill .context-icon--ship,
#fv-build-pill .context-icon--ship {
    width: 3.2rem;
    height: auto;
    flex-shrink: 0;
    margin-left: -2.2rem;
}

#fv-retrofit-pill .context-icon-ship-img--portrait,
#fv-build-pill .context-icon-ship-img--portrait {
    transform: rotate(90deg);
    width: 100%;
    object-fit: contain;
    display: block;
}
#hdr-act-pill .fv-pill-task::after {
    content: '';
    display: block;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}

#fv-pill-step,
#act-pill-skill {
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    color: rgba(197, 160, 89, 0.6);
    line-height: 1;
}

.fv-pill-step-label {
    font-family: var(--font-body);
    font-size: 0.5rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(197, 160, 89, 0.35);
    white-space: nowrap;
    line-height: 1;
}

.fv-pill-task {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    overflow: hidden;
}

.fv-pill-task-inner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    overflow: hidden;
}

#fv-pill-task {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    color: var(--gold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.fv-pill-count {
    font-family: var(--font-body);
    font-size: var(--font-size-md);
    color: rgba(197, 160, 89, 0.55);
    line-height: 1.2;
}

.fv-pill-chevron {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    padding: 0 0.9rem;
    border-left: 1px solid rgb(39 35 28);
    color: rgba(197, 160, 89, 0.5);
}

.fv-pill-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(197, 160, 89, 0.12);
}

.fv-pill-fill {
    height: 100%;
    width: 100%;
    background: var(--color-wood);
    transform: scaleX(0);
    transform-origin: left center;
}

.fv-pill-chevron svg {
    transition: transform 0.2s ease;
}

#fv-mobile-pill[data-expanded='true'] .fv-pill-chevron svg,
#fv-retrofit-pill[data-expanded='true'] .fv-pill-chevron svg,
#fv-build-pill[data-expanded='true'] .fv-pill-chevron svg {
    transform: rotate(180deg);
}

/* Drawer */
.fv-pill-drawer {
    display: none;
    padding: 2rem;
    border-top: 1px solid rgba(197, 160, 89, 0.25);
}

#fv-mobile-pill[data-expanded='true'] .fv-pill-drawer {
    display: block;
}

#hdr-act-pill[data-expanded='true'] .fv-pill-drawer,
#fv-retrofit-pill[data-expanded='true'] .fv-pill-drawer,
#fv-build-pill[data-expanded='true'] .fv-pill-drawer {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.6rem;
}

.act-pill-skills-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Override the short-screen 4-card cap from char-summary.css */
#act-pill-skills-grid .pp-skill-card:nth-child(n + 5) {
    display: grid;
}

.act-pill-drawer-actions {
    display: flex;
    gap: 0.4rem;
}

.fv-pill-drawer-label {
    display: block;
    font-family: var(--font-body);
    font-size: var(--font-size-md);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(197, 160, 89, 0.45);
    margin-bottom: 0.2rem;
}

.fv-pill-drawer-label--why {
    margin-top: 0.75rem;
}

.fv-pill-drawer-desc,
.fv-pill-drawer-why {
    font-family: var(--font-body);
    font-size: var(--font-size-md);
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
    margin: 0;
    white-space: normal;
}

.fv-pill-drawer-desc {
    margin-bottom: var(--space-md);
}

/* ── Tracker switcher drawer ──
   Inline drawer inside the pill - same expand mechanism as the right-chevron drawer. */
.fv-pill-switcher-drawer {
    display: none;
    border-top: 1px solid rgba(197, 160, 89, 0.25);
}

#hdr-act-pill[data-switcher-open='true'] .fv-pill-switcher-drawer,
#fv-mobile-pill[data-switcher-open='true'] .fv-pill-switcher-drawer,
#fv-retrofit-pill[data-switcher-open='true'] .fv-pill-switcher-drawer,
#fv-build-pill[data-switcher-open='true'] .fv-pill-switcher-drawer {
    display: block;
}

/* Hide the right-chevron drawer while the switcher drawer is open */
#hdr-act-pill[data-switcher-open='true'] .fv-pill-drawer,
#fv-mobile-pill[data-switcher-open='true'] .fv-pill-drawer,
#fv-retrofit-pill[data-switcher-open='true'] .fv-pill-drawer,
#fv-build-pill[data-switcher-open='true'] .fv-pill-drawer {
    display: none;
}

.tsd-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1rem;
    background: none;
    border: none;
    border-top: 1px solid rgba(197, 160, 89, 0.1);
    cursor: pointer;
    text-align: left;
}

.tsd-row:first-child {
    border-top: none;
}

.tsd-row:hover {
    background: rgba(197, 160, 89, 0.06);
}

.tsd-row--selected {
    background: rgba(197, 160, 89, 0.04);
}

.tsd-check {
    width: 0.9rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(197, 160, 89, 0.9);
}

.tsd-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    overflow: hidden;
    min-width: 0;
}

.tsd-type {
    font-family: var(--font-body);
    font-size: 0.5rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(197, 160, 89, 0.45);
    line-height: 1;
}

.tsd-name {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    color: rgba(229, 220, 200, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.tsd-progress {
    flex-shrink: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-md);
    color: rgba(197, 160, 89, 0.6);
}
