/* Staff page: continuously scrolling grand-staff sight singing. */

.staff-stage {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 6px 0 2px;
    padding: 8px 8px 6px;
    border: 1px solid rgba(134, 239, 172, 0.18);
    border-radius: var(--radius-card);
    background: rgba(13, 40, 24, 0.93);
}

.staff-stage-host {
    width: 100%;
}

.staff-scroll-empty {
    display: none;
}

.staff-scroll-shell {
    position: relative;
    width: var(--staff-width, 100%);
    /* Left-aligned: a narrowed staff hugs the left edge like everything
       else on the page, it does not float in the middle. */
    margin: 0;
    border-radius: var(--radius-group);
    background: #f8fafc;
    overflow: hidden;
}

.staff-scroll-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.staff-scroll-viewport-page {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.staff-scroll-strip {
    position: relative;
    will-change: transform;
}

.staff-scroll-chunk {
    position: absolute;
    top: 0;
}

.staff-scroll-chunk svg {
    display: block;
    max-width: none;
}

/* The shared degree token on the white staff band: dark ink, centered on
   its notehead, purely informational (never a click target here). */
.staff-scroll-chunk .staff-degree-token {
    position: absolute;
    transform: translateX(-50%);
    color: #166534;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.72rem;
    line-height: 1;
    pointer-events: none;
}

.staff-scroll-header {
    position: absolute;
    top: 0;
    left: 0;
    /* Opaque: scrolling notes disappear beneath the clefs/key signature. */
    background: #f8fafc;
    border-right: 1px solid rgba(15, 23, 42, 0.18);
    pointer-events: none;
    z-index: 2;
}

.staff-scroll-header svg {
    display: block;
}

.staff-scroll-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 3;
}

.staff-stage-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 14px;
    width: 100%;
    min-height: 18px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.8rem;
}

.staff-sung-line-choice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.staff-sung-line-row .vf-btn,
.staff-stage-meta > .vf-btn {
    padding: 1px 8px;
    font-size: 0.75rem;
    text-transform: none;
}

.staff-pitch-readout {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    color: #86efac;
    min-width: 150px;
}

.staff-status-readout {
    color: rgba(255, 255, 255, 0.6);
}

.staff-mode-row .vf-btn,
.staff-duration-row .vf-btn {
    text-transform: none;
}

.staff-control-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.staff-control-card {
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-card);
    background: rgba(0, 0, 0, 0.18);
}

/* Bottom row of the control area: page-level utility actions (Copy
   Text), left aligned, just above the Past Runs history. */
.staff-utility-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
}

.staff-listen-button.listening {
    border-color: rgba(245, 158, 11, 0.85);
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.32);
}

/* Only the selected style's lesson row shows (.segment-row's display
   would otherwise beat the hidden attribute). */
.staff-lesson-row[hidden] {
    display: none;
}

.staff-palette-line {
    margin: 4px 2px 2px;
    color: #86efac;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.78rem;
    text-align: left;
    cursor: help;
}

.staff-palette-line .staff-palette-label {
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.68rem;
    margin-right: 6px;
}

.staff-session-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
    width: 100%;
    overflow: hidden;
}

.staff-session-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-session-detail {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
    white-space: nowrap;
}

/* Compact layout: staff.js puts .staff-compact on body in landscape-
   short viewports and whenever fullscreen is active. Singing happens
   sideways on a phone, where height is the scarce resource: the site
   header gives way, the sticky transport becomes a slim solid bar
   (translucency reads badly over the white staff), and the stage
   sheds its margins - the staff gets the height. */
body.staff-compact #siteHeader {
    display: none;
}

body.staff-compact main {
    padding: 4px 8px;
}

body.staff-compact .voice-controls-row {
    min-height: 44px;
    margin-bottom: 6px;
    background: rgba(7, 26, 16, 0.96);
}

body.staff-compact .voice-controls-row .stop-button,
body.staff-compact .voice-controls-row .play-button,
body.staff-compact .voice-controls-row .next-button,
body.staff-compact .voice-controls-row .repeat-button {
    height: 44px;
    min-width: 72px;
    padding: 4px 12px;
}

body.staff-compact .voice-controls-row .button-icon {
    display: none;
}

body.staff-compact .voice-controls-row .button-text {
    font-size: 1rem;
}

body.staff-compact .staff-stage {
    margin: 0 0 4px;
    padding: 4px 6px;
}
