/* Visual theme only. Navigation, motion and application behaviour live elsewhere. */
:root {
    color-scheme: dark;
    --color-primary: #1ed760;
    --color-primary-strong: #3be477;
    --color-primary-soft: #183b25;
    --color-on-primary: #071b0e;
    --color-page: #121212;
    --color-surface: #1c1c1c;
    --color-text: #f5f5f5;
    --color-text-muted: #b3b3b3;
    --color-border: #383838;
    --color-danger: #ff929b;
    --color-warning-text: #f5cf81;
    --color-warning-surface: #352c1b;
    --color-focus: #fff;
    --color-chord: #77dda0;
    --surface-raised: #282828;
    --radius-control: 12px;
    --radius-card: 16px;
}

html { background: #080808; }
body { min-height: 100vh; font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
::selection { background: #26653a; color: #fff; }
.app-shell { max-width: 960px; min-height: 100vh; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
main { padding-top: 24px; }
h1 { font-size: clamp(28px, 5vw, 38px); font-weight: 800; letter-spacing: -.04em; }
h2 { font-size: 22px; font-weight: 750; letter-spacing: -.025em; }
.eyebrow { color: var(--color-text-muted); letter-spacing: .06em; }
.app-header { min-height: 76px; border-bottom-color: #ffffff0d; }
.brand { font-weight: 750; letter-spacing: -.025em; }
.brand img { border-radius: 50%; }
.account-link { padding-inline: 18px; border-radius: 999px; background: var(--surface-raised); font-size: 14px; }
.app-header-detail, .app-header-library {
    position: sticky;
    isolation: isolate;
    min-height: 68px;
    background: linear-gradient(to bottom, #121212e8 0%, #121212b8 64%, transparent 100%);
    border-bottom: 0;
}
.app-header-detail::before, .app-header-library::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #0008 48%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #0008 48%, transparent 100%);
}
.app-header-detail > *, .app-header-library > * { position: relative; z-index: 1; }
.header-screen-title { font-size: 18px; font-weight: 750; letter-spacing: -.025em; }
.header-screen-title {
    justify-self: center;
    width: max-content;
    max-width: 100%;
    padding: 10px 20px;
    border: 1px solid #ffffff0a;
    border-radius: 999px;
    background: #1c1c1ccc;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}
.header-icon { color: var(--color-text); border-radius: 50%; }
.header-icon:is(button), .header-account, .header-back {
    background: #282828d9;
    border: 1px solid #ffffff0a;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}
.header-icon svg, .nav-item svg { stroke-width: 1.8; }
.header-search-panel { padding-top: 14px; padding-bottom: 4px; }
.app-header-library + main { padding-top: 22px; }
.app-header-detail + main { padding-top: 20px; }

/* Fixed, quiet navigation with an unmistakable current section. */
.bottom-nav {
    isolation: isolate;
    left: 50%;
    right: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: min(380px, calc(100% - 24px));
    transform: translateX(-50%);
    background: #1a1a1aeF;
    border: 1px solid #ffffff12;
    border-radius: 999px;
    padding: 5px;
    box-shadow: 0 10px 30px #0008;
}
.bottom-nav::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #0008 52%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #0008 52%, transparent 100%);
}
.bottom-nav > * { position: relative; z-index: 1; }
.nav-inner { max-width: none; gap: 4px; }
.nav-item { min-height: 44px; gap: 2px; border-radius: 999px; font-size: 10px; font-weight: 650; color: #a7a7a7; }
.nav-item svg { width: 23px; height: 23px; }
.nav-item[aria-current="page"] { color: #fff; background: #ffffff12; }
.nav-item[aria-current="page"] svg { fill: #ffffff20; stroke-width: 2.2; }

/* Existing controls retain their handlers and interaction states. */
.button { border-radius: 999px; font-weight: 750; padding-inline: 22px; }
.button-secondary { background: transparent; color: var(--color-text); border-color: #777; }
.button-secondary:hover { color: var(--color-text); background: var(--surface-raised); border-color: #b3b3b3; }
.button-danger, .song-delete button, .directory-archive button { color: var(--color-danger); background: transparent; }
.button-danger:hover { background: #3c2024; border-color: var(--color-danger); }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea {
    background: #242424; border-color: #505050; color: var(--color-text); font-size: 16px;
}
input::placeholder, textarea::placeholder { color: #a3a3a3; opacity: 1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--color-primary); }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
    outline: 2px solid #fff; outline-offset: -2px; box-shadow: none;
}
.header-search-panel .song-search { border-radius: 999px; border-color: transparent; background: #2a2a2a; padding-inline: 20px; }
.header-search-panel .song-search:focus { outline: 2px solid #fff; outline-offset: -2px; box-shadow: none; }
.skip-link { color: #121212; }

/* Library rows: compact, readable, with a decorative music tile. */
.songs-status { margin: 0 0 16px; font-size: 13px; }
.song-list, .service-song-list { gap: 4px; }
.song-link { min-height: 80px; gap: 14px; padding: 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; }
.song-link:hover { background: #262626; box-shadow: none; }
.song-list .song-link::before {
    content: ""; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 8px;
    background: #263c31 url('../icons/library-note.svg') center / 26px no-repeat;
}
.song-list li:nth-child(4n + 2) .song-link::before { background-color: #343046; }
.song-list li:nth-child(4n + 3) .song-link::before { background-color: #293c46; }
.song-list li:nth-child(4n) .song-link::before { background-color: #43372c; }
.song-title { font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.song-artist { margin-top: 4px; font-size: 13px; line-height: 1.45; }
.song-key { min-width: 40px; padding: 5px 9px; border-radius: 7px; background: #ffffff0a; color: #d2d2d2; text-align: center; font-size: 13px; }
.song-arrow { color: #808080; font-size: 22px; }
.song-library-action { margin-bottom: 22px; }
.service-song-position { color: #aaa; font-variant-numeric: tabular-nums; }

/* Service collection and filter chips. */
.services-tabs-row { gap: 12px; margin-bottom: 22px; }
.services-page-tabs { justify-content: flex-start; gap: 8px; padding: 0; border: 0; border-radius: 0; background: none; }
.services-page-tabs a { flex: 0 1 auto; min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 10px 18px; border-radius: 999px; background: #282828; color: #eee; }
.services-page-tabs a[aria-current] { background: #f5f5f5; color: #121212; box-shadow: none; }
.create-service-button { border-radius: 999px; padding-inline: 16px; }
.service-list-toolbar { margin: 16px 0; font-size: 13px; }
.service-sort-actions { border: 0; background: #202020; padding: 3px; border-radius: 999px; }
.service-sort-actions a { border-radius: 50%; opacity: .65; }
.service-sort-actions a[aria-current] { background: #393939; color: #fff; opacity: 1; }
.service-list { gap: 12px; margin-top: 0; }
.service-link { position: relative; padding: 20px 22px; border: 1px solid #ffffff08; border-radius: var(--radius-card); background: var(--color-surface); }
.service-link:hover { background: #282828; box-shadow: none; border-color: #ffffff12; }
.service-link .song-title { font-size: 20px; font-weight: 750; }
.service-link .song-artist { margin-top: 8px; }
.service-date { color: #c2c2c2; font-size: 13px; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.service-today-badge { background: var(--color-primary-soft); color: #81eca4; }
.services-filters { padding: 18px; border-radius: var(--radius-card); background: var(--color-surface); }
.services-empty { padding: 28px 22px; border-radius: var(--radius-card); background: var(--color-surface); line-height: 1.65; }

/* Detail headers borrow the depth of a playlist, keeping lyrics distraction-free. */
.song-hero { padding: 26px; margin-bottom: 24px; border: 1px solid #ffffff0d; border-radius: 18px; background: linear-gradient(145deg, #284236, #1a2520 72%, #1b201d); }
.service-hero { background: linear-gradient(145deg, #303b4c, #202731 72%, #1c2128); }
.app-header-detail + main .song-hero h1 { font-size: clamp(28px, 5.5vw, 38px); line-height: 1.15; font-weight: 800; }
.card-artist { color: #d0d9d2; margin-bottom: 16px; }
.song-service-caption { color: #c2cec5; }
.song-edit-action { color: #fff; opacity: .8; background: #ffffff0c; border-radius: 50%; }
.song-metadata { background: var(--color-surface); border-color: var(--color-border); }
.song-metadata-inline, .service-hero-metadata { background: transparent; }
.song-metadata-inline { margin-top: 24px; margin-bottom: 0; }
.song-metadata dt { color: #b8c0bb; font-size: 12px; }
.song-metadata-inline > div + div { border-color: #ffffff20; }
.song-metadata dd { font-variant-numeric: tabular-nums; }
.song-original-key { color: #c2cec5; opacity: 1; }
.service-hero .service-badge { background: #ffffff12; color: #e0e6ef; border-radius: 999px; padding: 5px 12px; margin-top: 14px; }
.transpose-controls { margin-top: 22px; }
.transpose-controls button, .transpose-controls select { background: #121b16; border-color: #ffffff30; }
.transpose-controls .transpose-reset { background: transparent; border-color: transparent; }
.song-lyrics { margin-top: 24px; }
.song-part { padding: 18px 20px; border: 1px solid #ffffff08; border-radius: 12px; background: #191919; margin: 14px 0; }
.song-section { color: #a8b3ab; font-size: 12px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 16px; }
.lyric-text { color: #f2f2f2; }
.chord { color: var(--color-chord); }
.service-comment-block { background: #202421; border: 1px solid #ffffff0a; border-left: 3px solid #538064; border-radius: 0 12px 12px 0; }
.service-song-navigation a, .material-list a { background: var(--color-surface); border-color: var(--color-border); }
.material-list a:hover { background: #292929; }
.song-materials { border-top-color: #ffffff1a; }
.song-materials > summary { font-size: 18px; }

/* Compact song header only; service headers retain their own layout. */
.app-header-detail + main > .song-hero:not(.service-hero),
.app-header-detail + main .service-hero {
    padding: 16px; margin-bottom: 14px; border-radius: 14px;
    background: linear-gradient(115deg, #202e25, #1b211e);
}
.app-header-detail + main > .song-hero:not(.service-hero) h1,
.app-header-detail + main .service-hero .song-detail-heading > h1 {
    font-size: clamp(22px, 4.5vw, 28px); line-height: 1.2;
    font-weight: 750; letter-spacing: -.025em; margin: 0 0 5px;
}
.song-hero:not(.service-hero) .song-detail-heading { justify-content: space-between; gap: 8px; }
.service-hero .song-detail-heading { justify-content: space-between; gap: 8px; }
.service-hero .service-badge { margin: 4px 0 12px; padding: 3px 8px; font-size: 10px; line-height: 1.4; font-weight: 600; color: #bac7be; background: #ffffff09; }
.service-hero .service-hero-metadata { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; }
.service-hero-metadata > div { display: flex; align-items: flex-start; gap: 7px; min-width: 0; max-width: 100%; }
.service-hero-metadata > div:nth-child(n + 3) { flex-basis: 100%; }
.service-hero-metadata dt { display: flex; flex: 0 0 16px; padding-top: 3px; }
.service-hero .service-hero-metadata dd { margin: 0; min-width: 0; font-size: 13px; line-height: 22px; font-weight: 500; color: #bec9c1; }
.service-hero .service-hero-metadata > div:nth-child(-n + 2) dd { color: #f5f5f5; font-size: 14px; font-weight: 650; }
.service-hero .service-notification-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid #ffffff0c; }
.service-hero .service-notify-button { min-height: 36px; padding: 6px 12px; border: 1px solid #ffffff20; border-radius: 8px; background: #ffffff08; color: #d3e6d9; font-size: 12px; font-weight: 600; }
.service-hero .service-notify-button:hover:not(:disabled) { background: #ffffff12; }
.song-hero:not(.service-hero) .card-artist { margin: 0; font-size: 13px; color: #b5c0b8; }
.song-hero:not(.service-hero) .song-service-caption { margin: 0 0 7px; font-size: 11px; line-height: 1.4; color: #a8b7ac; }
.song-hero:not(.service-hero) .song-metadata-inline { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0 0; }
.song-hero:not(.service-hero) .song-metadata-inline > div { display: flex; align-items: center; flex: 0 1 auto; gap: 6px; padding: 0; border: 0; }
.song-hero:not(.service-hero) .song-metadata-inline dt { display: flex; align-items: center; }
.song-meta-icon { display: inline-flex; color: #97aa9d; }
.song-meta-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.song-hero:not(.service-hero) .song-metadata-inline dd { margin: 0; font-size: 14px; line-height: 24px; font-weight: 650; white-space: nowrap; }
.song-meta-unit { font-size: 10px; font-weight: 500; color: #a8b7ac; }
.song-hero:not(.service-hero) .song-original-key { font-size: 11px; line-height: inherit; vertical-align: baseline; color: #a8b7ac; }
.transpose-picker { position: relative; width: max-content; max-width: 100%; margin-bottom: 2px; }
#song-card .transpose-controls { display: inline-flex; gap: 0; margin: 0; padding: 0; border: 0; border-radius: 8px; background: #282828; box-shadow: none; }
#song-card .transpose-controls > button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; min-width: 40px; min-height: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: #dedede; }
#song-card .transpose-controls > button + button { position: relative; border-left: 0; }
#song-card .transpose-controls > button + button::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: #ffffff12; pointer-events: none; }
#song-card .transpose-controls > button:first-child { border-radius: 8px 0 0 8px; }
#song-card .transpose-controls > button:last-child { border-radius: 0 8px 8px 0; }
#song-card .transpose-controls > .transpose-key-trigger { flex-basis: 82px; width: 82px; gap: 9px; font-size: 15px; font-weight: 700; color: #fff; }
.transpose-key-trigger > span:last-child { display: flex; color: #999; }
#song-card .transpose-controls svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#song-card .transpose-controls > button:hover:not(:disabled), #song-card .transpose-controls > button[aria-expanded="true"] { background: #353535; color: #fff; }
#song-card .transpose-controls > button:disabled { opacity: .35; }
#song-card .transpose-controls > button:focus-visible { position: relative; z-index: 1; outline: 2px solid #fff; outline-offset: -2px; }
.transpose-options { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 204px; max-width: calc(100vw - 40px); max-height: 224px; overflow-y: auto; overscroll-behavior: contain; padding: 5px; border: 1px solid #484848; border-radius: 10px; background: #242424; box-shadow: 0 10px 30px #0009; scrollbar-width: thin; scrollbar-color: #666 transparent; }
.transpose-options > button { position: relative; display: block; width: 100%; min-height: 34px; padding: 6px 12px 6px 32px; border: 0; border-radius: 5px; background: transparent; text-align: left; font-size: 14px; color: #eee; }
.transpose-options > button[aria-selected="true"] { color: #93e7ad; font-weight: 700; background: #2b3d30; }
.transpose-options > button[aria-selected="true"]::before { content: ''; position: absolute; left: 13px; top: 11px; width: 5px; height: 9px; border: solid currentColor; border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.transpose-options > button:hover, .transpose-options > button:focus { background: #414141; }
.song-hero:not(.service-hero) + #song-library .song-lyrics { margin-top: 14px; }

/* Performance mode: lyrics-only stage view for serving songs. */
.performance-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    margin-top: 12px;
    padding: 6px 11px;
    border: 1px solid #ffffff18;
    border-radius: 999px;
    background: #ffffff09;
    color: #cbd8cf;
    font-size: 12px;
    font-weight: 650;
}
.performance-toggle:hover { background: #ffffff12; }
.performance-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.performance-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    margin: 0 0 14px;
    padding: 8px 10px;
    border: 1px solid #ffffff12;
    border-radius: 14px;
    background: #1b1b1bea;
}
.performance-panel-title {
    min-width: 0;
    overflow: hidden;
    color: #d2d2d2;
    font-size: 13px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.performance-view-buttons { display: flex; gap: 4px; margin-left: auto; }
.performance-view-button {
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #a9a9a9;
    font-size: 11px;
    white-space: nowrap;
}
.performance-view-button.is-active { background: #ffffff12; border-color: #ffffff12; color: #fff; }
.performance-view-button:hover { background: #ffffff0d; color: #fff; }
.performance-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #ffffff14;
    border-radius: 50%;
    background: #242424e8;
    color: #f5f5f5;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
}
.performance-close:hover { background: #353535; }
.performance-close svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.performance-controls {
    position: fixed;
    z-index: 90;
    isolation: isolate;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    left: max(20px, env(safe-area-inset-left));
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}
.performance-controls::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -16px -12px -18px;
    border-radius: 28px;
    background: linear-gradient(to bottom, #12121200 0%, #121212b8 56%, #0d0d0df2 100%);
    pointer-events: none;
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #0008 42%, #000 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #0008 42%, #000 100%);
}
.performance-controls > a,
.performance-controls > .is-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid #ffffff18;
    border-radius: 50%;
    background: #242424e8;
    color: #f5f5f5;
    box-shadow: 0 5px 20px #0006;
    pointer-events: auto;
}
.performance-controls > * { position: relative; z-index: 1; }
.performance-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 32px;
    margin: 10px 0;
    padding: 0 12px;
    border: 1px solid #ffffff12;
    border-radius: 999px;
    background: #1d1d1dcc;
    color: #bdbdbd;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.performance-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    margin-inline: 8px;
}
.performance-controls > a:hover { background: #353535; }
.performance-controls > .is-disabled { opacity: .25; pointer-events: none; }
.performance-controls svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.performance-mode { overflow-x: hidden; overflow-y: auto; }
.performance-mode .app-header,
.performance-mode .bottom-nav,
.performance-mode .song-hero,
.performance-mode .service-song-navigation,
.performance-mode .song-materials { display: none !important; }
.performance-mode .app-shell { max-width: 960px; padding-bottom: 0; }
.performance-mode main { min-height: 100vh; padding-top: max(28px, env(safe-area-inset-top)); padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.performance-mode #song-library { display: block; }
.performance-mode #song-card { display: block !important; }
.performance-mode #transposed-lyrics { max-width: 760px; margin: 0 auto; }
.performance-mode .song-part { margin-block: 12px; padding: 20px 22px; }
.performance-chords .lyric-text { display: none; }
.performance-text .chord { display: none; }

@media (max-width: 520px) {
    .performance-panel { align-items: flex-start; flex-wrap: wrap; }
    .performance-panel-title { flex: 1 1 auto; line-height: 32px; }
    .performance-view-buttons { order: 3; flex: 1 1 100%; margin-left: 0; overflow-x: auto; }
    .performance-view-button { flex: 1 0 auto; }
}

/* Final performance-panel alignment: transpose-control styling, song label at the bottom. */
.performance-panel {
    display: flex;
    align-items: center;
    gap: 0 !important;
    column-gap: 0 !important;
    width: max-content;
    max-width: 100%;
    min-height: 36px;
    margin: 0 0 14px auto;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #282828;
    overflow: hidden;
}
.performance-view-buttons { display: flex; flex: 0 1 auto; min-width: 0; margin: 0; padding: 0; border-radius: 0; background: transparent; }
.performance-view-button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 11px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #999;
    font-size: 11px;
    font-weight: 650;
}
.performance-view-button + .performance-view-button { border-left: 1px solid #ffffff12; }
.performance-view-button.is-active { background: #353535; color: #fff; }
.performance-view-button:hover { background: #414141; color: #fff; }
.performance-panel .performance-close {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin-left: 0;
    border: 0;
    border-left: 1px solid #ffffff12;
    border-radius: 0 8px 8px 0;
    background: transparent;
    box-shadow: none;
}
.performance-panel .performance-close:hover { background: #414141; }
.performance-panel .performance-close {
    margin: 0 !important;
    border-radius: 0 !important;
    background: #282828;
}
.performance-center { gap: 0; }
.performance-center .performance-panel-title {
    max-width: 150px;
    overflow: hidden;
    color: #b9b9b9;
    font-size: 11px;
    font-weight: 650;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Reuse the exact geometry of the song transposer control. */
#song-card .performance-view-buttons.transpose-controls {
    display: inline-flex;
    gap: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px 0 0 8px;
    background: #282828;
    box-shadow: none;
}
#song-card .performance-view-buttons.transpose-controls > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    min-width: 40px;
    min-height: 36px;
    height: 36px;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #dedede;
    font-size: 13px;
    font-weight: 700;
}
#song-card .performance-view-buttons.transpose-controls > button + button { position: relative; border-left: 0; }
#song-card .performance-view-buttons.transpose-controls > button + button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: #ffffff12;
    pointer-events: none;
}
#song-card .performance-view-buttons.transpose-controls > button:first-child { border-radius: 8px 0 0 8px; }
#song-card .performance-view-buttons.transpose-controls > button:hover,
#song-card .performance-view-buttons.transpose-controls > button.is-active { background: #353535; color: #fff; }
#song-card .performance-view-buttons.transpose-controls > button:focus-visible { position: relative; z-index: 1; outline: 2px solid #fff; outline-offset: -2px; }
.performance-panel { background: transparent; overflow: visible; }
.performance-panel .performance-close {
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
    min-height: 36px !important;
    height: 36px;
    max-height: 36px;
    margin: 0;
    align-self: center;
    border-radius: 0 8px 8px 0 !important;
    background: #282828;
    color: #dedede;
}
.performance-panel .performance-close:hover { background: #353535; }

/* The performance view switch uses the same segmented-control language as the key picker. */
.performance-panel {
    gap: 10px;
    min-height: 36px;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
}
.performance-panel-title {
    flex: 0 1 auto;
    max-width: 32%;
    color: #aaa;
    font-size: 12px;
    font-weight: 600;
}
.performance-view-buttons {
    display: inline-flex;
    min-width: 0;
    margin-left: auto;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #282828;
}
.performance-view-button {
    min-height: 36px;
    padding: 6px 11px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #aaa;
    font-size: 11px;
    font-weight: 650;
}
.performance-view-button + .performance-view-button { border-left: 1px solid #ffffff12; }
.performance-view-button.is-active { background: #353535; color: #fff; }
.performance-view-button:hover { background: #414141; color: #fff; }
.performance-panel .performance-close {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #282828;
    box-shadow: none;
}
.performance-panel .performance-close:hover { background: #353535; }
@media (max-width: 520px) {
    .performance-panel { align-items: center; flex-wrap: nowrap; overflow-x: auto; }
    .performance-panel-title { flex: 0 0 auto; max-width: 30%; }
    .performance-view-buttons { flex: 0 0 auto; margin-left: 0; }
}

/* Standalone sign-in, independent of the application navigation shell. */
body.login-screen { background: #121212; }
.login-screen .login-main { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; min-height: 100dvh; padding: max(40px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.login-screen .auth-card { width: 100%; max-width: 360px; margin: auto; padding: 0; border: 0; border-radius: 0; background: transparent; }
.login-heading { text-align: center; margin-bottom: 32px; }
.login-mark { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 18px; background: #1ed760; color: #102618; }
.login-mark svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-brand { margin: 12px 0 30px; font-size: 14px; font-weight: 650; color: #b3b3b3; }
.login-heading h1 { margin: 0 0 8px; font-size: clamp(25px, 7vw, 32px); letter-spacing: -.035em; }
.login-caption { margin: 0; color: #a7a7a7; font-size: 14px; }
.login-screen .auth-form { gap: 8px; }
.login-screen .auth-form label { font-size: 13px; }
.login-screen .auth-form input { min-height: 50px; border-radius: 10px; background: #1c1c1c; border-color: #454545; }
.login-screen .auth-form label[for="password"] { margin-top: 12px; }
.login-screen .auth-form button { min-height: 48px; margin-top: 16px; }
.login-screen .auth-card .login-guest { display: flex; justify-content: center; align-items: center; gap: 9px; min-height: 44px; margin-top: 20px; color: #b3b3b3; font-size: 13px; text-decoration: none; }
.login-screen .auth-card .login-guest:hover { color: #fff; }
.login-screen .auth-error { padding: 12px 14px; border: 1px solid #72353c; border-radius: 10px; background: #301c20; font-size: 14px; }

.profile-shell { max-width: 720px; }
.profile-main { max-width: 480px; margin: auto; padding-top: 40px; }
.profile-card { width: 100%; }
.profile-identity { text-align: center; padding: 12px 0 30px; }
.profile-avatar { display: inline-flex; justify-content: center; align-items: center; width: 76px; height: 76px; border-radius: 50%; background: #24392c; color: #96d6aa; margin-bottom: 18px; }
.profile-avatar svg { width: 36px; height: 36px; }
.profile-card svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.profile-eyebrow { margin: 0 0 7px; color: #929c95; font-size: 12px; }
.profile-identity h1 { margin: 0; font-size: clamp(25px, 6vw, 32px); line-height: 1.2; letter-spacing: -.035em; overflow-wrap: anywhere; }
.profile-login { margin: 8px 0 14px; color: #a5a5a5; font-size: 14px; }
.profile-roles { list-style: none; padding: 0; margin: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.profile-roles li { padding: 4px 10px; border: 1px solid #ffffff12; border-radius: 999px; background: #ffffff05; color: #b7c7bc; font-size: 11px; }
.profile-section-title { margin: 0 0 12px; font-size: 13px; color: #a3a3a3; font-weight: 600; letter-spacing: 0; }
.profile-actions { overflow: hidden; border: 1px solid #ffffff0c; border-radius: 16px; background: #1c1c1c; }
.profile-actions a { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 14px; text-decoration: none; }
.profile-actions a + a { border-top: 1px solid #ffffff0a; }
.profile-actions a:hover { background: #252525; }
.profile-action-icon { display: flex; justify-content: center; align-items: center; flex: 0 0 38px; height: 38px; border-radius: 11px; background: #ffffff06; color: #b2c4b8; }
.profile-action-icon svg { width: 21px; height: 21px; }
.profile-action-copy { flex: 1; min-width: 0; }
.profile-action-copy strong { display: block; font-size: 14px; font-weight: 650; }
.profile-action-copy small { display: block; margin-top: 3px; color: #989898; font-size: 12px; }
.profile-chevron { flex: 0 0 16px; width: 16px; height: 16px; color: #777; }
.profile-logout { margin-top: 24px; }
.profile-logout .button { width: 100%; gap: 9px; min-height: 48px; border-radius: 12px; background: transparent; border-color: #ffffff12; font-size: 14px; font-weight: 600; }
.profile-logout svg { width: 18px; height: 18px; }

/* Administrative screens share the same surfaces and form language. */
.auth-card, .placeholder, .song-editor-section { background: var(--color-surface); border-color: #ffffff0d; border-radius: var(--radius-card); padding: 24px; }
.auth-card { max-width: 520px; }
.auth-name { font-size: 24px; font-weight: 750; letter-spacing: -.025em; }
.auth-card a { text-decoration-color: #777; text-underline-offset: 4px; }
.auth-form { gap: 12px; }
.auth-form label, .song-editor label, .services-filters label { font-weight: 600; }
.song-editor { gap: 18px; }
.song-editor-section { gap: 16px; }
.song-editor-section > h2 { font-size: 20px; }
.song-editor-text, .service-program-section { background: #1b201d; }
.song-editor-text > textarea { background: #151515; }
.song-format-help code { background: #ffffff10; }
.service-entry, .material-row { background: #242424; border-color: #444; border-radius: 12px; }
#song-picker-toggle, #song-picker-menu, #song-picker-options button { background: #242424; }
#song-picker-menu { border-color: #555; box-shadow: 0 16px 40px #0008; }
#song-picker-options button:hover, #song-picker-options button:focus-visible,
#song-picker-options button[aria-selected="true"] { background: #35463b; }
.directory-list a { background: var(--color-surface); border-color: #ffffff12; border-radius: 12px; padding: 18px; }
.user-role-fields { border-color: #555; }
.header-push-status.is-error, .push-status.is-error { color: var(--color-danger); }

@media (min-width: 700px) {
    body { background: #080808; }
    .app-shell { background: var(--color-page); border-inline: 1px solid #ffffff08; padding-inline: 36px; }
    .app-header-detail, .app-header-library { margin-inline: -36px; padding-inline: 36px; }
    main { padding-top: 32px; }
    .app-header-library + main, .app-header-detail + main { padding-top: 28px; }
    .song-hero { padding: 32px; }
    .service-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
    .service-list > li { display: flex; min-width: 0; }
    .service-link { width: 100%; min-height: 162px; }
}

/* Final compact performance toolbar alignment. */
#song-card .performance-panel {
    display: flex;
    flex-direction: row;
    direction: ltr;
    align-items: center;
    gap: 0 !important;
    width: 100%;
    max-width: 100%;
    justify-content: flex-end;
    margin: 0 0 14px !important;
    overflow: hidden;
    background: transparent;
}
#song-card .performance-panel .performance-view-buttons { margin: 0 !important; }
#song-card .performance-panel .performance-view-buttons { order: 1; }
#song-card .performance-panel .performance-close {
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
    min-height: 36px !important;
    height: 36px;
    max-height: 36px;
    margin: 0 !important;
    order: 2;
    border-left: 1px solid #ffffff12;
    border-radius: 0 8px 8px 0 !important;
    background: #282828;
}
#song-card .performance-panel .performance-close:hover { background: #414141; }
@media (max-width: 390px) {
    .song-link { padding-inline: 4px; gap: 10px; }
    .song-list .song-link::before { flex-basis: 40px; width: 40px; height: 44px; }
    .song-hero, .auth-card, .song-editor-section { padding: 18px; }
    .services-page-tabs a { padding-inline: 14px; }
    .song-metadata-inline > div { padding-inline: 10px; }
    .song-part { padding-inline: 14px; }
}
