:root {
  --ink: #19332d;
  --muted: #63736e;
  --brand: #286153;
  --brand-dark: #173f36;
  --brand-soft: #e8f3ef;
  --accent: #e98362;
  --accent-soft: #fff0ea;
  --cream: #fbfaf6;
  --line: #dce6e2;
  --white: #fff;
  --shadow-sm: 0 3px 14px rgba(30, 66, 57, .08);
  --shadow-lg: 0 18px 55px rgba(30, 66, 57, .13);
  --radius: 18px;
  --radius-lg: 28px;
  --bs-primary: #286153;
  --bs-primary-rgb: 40, 97, 83;
  --bs-body-font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bs-body-color: #19332d;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--cream); min-height: 100vh; font-size: 1rem; }
h1, h2, h3 { letter-spacing: -.025em; font-weight: 750; }
a { color: var(--brand); }
.muted, .text-muted { color: var(--muted) !important; }
.eyebrow { margin: 0 0 .45rem; text-transform: uppercase; letter-spacing: .13em; font-size: .75rem; font-weight: 800; color: var(--brand); }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 9999; padding: .75rem 1rem; background: #fff; border-radius: 10px; }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid #e98362 !important; outline-offset: 3px; }

.topbar { position: sticky; top: 0; z-index: 1000; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: var(--brand); color: white; font-size: 1.4rem; box-shadow: 0 6px 15px rgba(40,97,83,.22); }
.brand strong { display: block; font-size: 1.05rem; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: .76rem; margin-top: .2rem; }
.main-nav { display: flex; align-items: center; gap: .3rem; }
.nav-link-pill { display: inline-flex; align-items: center; min-height: 44px; padding: .6rem .85rem; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font-weight: 650; text-decoration: none; }
.nav-link-pill:hover { background: var(--brand-soft); color: var(--brand-dark); }
.nav-add { gap: .25rem; background: var(--brand); color: white; padding-inline: 1rem; }
.nav-add:hover { background: var(--brand-dark); color: white; }
.app-shell { padding-top: 2.5rem; padding-bottom: 5rem; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.75rem; }
.page-heading h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); }
.page-heading p { max-width: 650px; margin: .5rem 0 0; color: var(--muted); font-size: 1.05rem; }
.surface { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.surface-pad { padding: clamp(1.25rem, 3vw, 2rem); }
.soft-panel { padding: 1.2rem; border-radius: 16px; background: var(--brand-soft); }

.btn { min-height: 46px; padding: .65rem 1.1rem; border-radius: 12px; font-weight: 700; transition: box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid transparent; }
.btn-soft:hover { background: #dcece6; color: var(--brand-dark); }
.btn-outline-secondary { --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--brand-soft); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #bfd1ca; }
.btn-danger-soft { color: #963625; background: #fff0ed; border: 1px solid #f4cfc7; }
.form-control, .form-select { min-height: 50px; border-radius: 12px; border-color: #cbd9d4; padding: .7rem .85rem; font-size: 1rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .25rem rgba(40,97,83,.12); }
.form-label, legend { font-weight: 750; color: var(--ink); }
.form-hint { margin-top: .35rem; color: var(--muted); font-size: .9rem; }

.notice { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: 15px; border: 1px solid #b9d9cd; background: #edf8f4; }
.notice-icon { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: white; font-weight: 800; }
.notice-warning { border-color: #f0d3a0; background: #fff8e9; }
.notice-warning .notice-icon { background: #ad7422; }

/* Transient feedback */
.app-toast { position: fixed; top: 1rem; right: 1rem; z-index: 2000; width: min(420px, calc(100vw - 2rem)); display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: .8rem; padding: .9rem 1rem; border: 1px solid #b9d9cd; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); transition: opacity .2s ease, transform .2s ease; }
.app-toast-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 900; }
.app-toast-copy strong, .app-toast-copy span { display: block; }
.app-toast-copy span { margin-top: .12rem; color: var(--muted); font-size: .88rem; }
.app-toast-close { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1; }
.app-toast-close:hover { background: var(--brand-soft); color: var(--ink); }
.app-toast.is-hiding { opacity: 0; transform: translateY(-8px); }

/* Library */
.library-experience { position: relative; }
.library-searchbar { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: .65rem; padding: .8rem; margin-bottom: .45rem; }
.library-searchbar .form-hint { grid-column: 1 / -1; margin: -.15rem 0 0; }
.search-wrap { position: relative; }
.search-wrap .form-control { height: 58px; padding-left: 3rem; font-size: 1.08rem; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.2rem; pointer-events: none; }
.mobile-filter-button { display: none; }
.selected-filter-bar { min-width: 0; display: flex; grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; align-items: center; gap: .4rem; padding-top: .15rem; color: var(--muted); font-size: .85rem; }
.selected-filter-bar > * { flex: 0 0 auto; }
.selected-filter-bar.is-empty { display: none; }
.selected-filter-hint { font-size: .82rem; }
.selected-filter { min-height: 34px; padding: .3rem .62rem; border: 1px solid #bfd5cd; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.selected-filter:hover { border-color: var(--brand); background: #dcece6; }
.selected-filter span { margin-left: .22rem; font-size: 1.05rem; }
.clear-filter-link { margin-left: .25rem; font-weight: 750; }
.library-layout { display: block; }
.filter-sidebar { position: fixed; inset: 92px auto 20px 20px; z-index: 1600; width: min(340px, calc(100vw - 40px)); max-height: none; overflow-y: auto; padding: 1.1rem; visibility: hidden; opacity: 0; transform: translateX(calc(-100% - 30px)); pointer-events: none; transition: opacity .15s ease, transform .18s ease; box-shadow: var(--shadow-lg); }
.library-experience.filters-open .filter-sidebar { visibility: visible; opacity: 1; transform: translateX(0); pointer-events: auto; }
.filter-sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-bottom: .75rem; }
.filter-sidebar-header h2 { margin: 0; font-size: 1.35rem; }
.filter-header-actions { display: flex; align-items: center; gap: .15rem; }
.filter-section-toggle { min-height: 32px; padding: .25rem .38rem; border: 0; border-radius: 8px; background: transparent; color: var(--brand); font-size: .68rem; font-weight: 760; white-space: nowrap; }
.filter-section-toggle:hover { background: var(--brand-soft); }
.filter-show-button { display: inline-flex; align-items: center; gap: .35rem; min-height: 38px; padding: .38rem .65rem; border: 1px solid #c9dbd4; border-radius: 10px; background: #fff; color: var(--brand-dark); font-size: .8rem; font-weight: 780; white-space: nowrap; }
.filter-show-button:hover { background: var(--brand-soft); border-color: #aac8bd; }
.filter-show-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.filter-show-button b { min-width: 21px; padding: .08rem .35rem; border-radius: 999px; background: var(--brand); color: #fff; font-size: .68rem; text-align: center; }
.filter-close { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.filter-close:hover { background: var(--brand-soft); color: var(--ink); }
.filter-close svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.facet-group { min-width: 0; margin: 0; border-top: 1px solid #edf1ef; }
.facet-group summary { min-height: 48px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: .5rem; padding: .65rem .25rem; border-radius: 9px; font-size: .88rem; font-weight: 780; cursor: pointer; list-style: none; }
.facet-group summary::-webkit-details-marker { display: none; }
.facet-group summary:hover { color: var(--brand); background: #f4f8f6; }
.facet-active { padding: .15rem .42rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: .68rem; font-weight: 800; }
.facet-chevron { width: 17px; height: 17px; fill: none; stroke: #6f817b; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.facet-group[open] .facet-chevron { transform: rotate(180deg); }
.facet-options { display: grid; gap: .1rem; padding: 0 0 .7rem; }
.facet-option { display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: .5rem; min-height: 38px; padding: .3rem .35rem; border-radius: 9px; color: #42554f; cursor: pointer; }
.facet-option:hover { background: #f4f8f6; }
.facet-option input { position: absolute; opacity: 0; pointer-events: none; }
.facet-check { width: 19px; height: 19px; display: grid; place-items: center; border: 1.5px solid #aec3bc; border-radius: 5px; background: #fff; color: transparent; font-size: .72rem; font-weight: 900; }
.facet-option input:checked + .facet-check { border-color: var(--brand); background: var(--brand); color: #fff; }
.facet-option input:focus-visible + .facet-check { outline: 3px solid var(--accent); outline-offset: 2px; }
.facet-name { overflow: hidden; font-size: .88rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.facet-option:has(input:checked) .facet-name { color: var(--brand-dark); font-weight: 800; }
.facet-option.is-unavailable { opacity: .42; cursor: not-allowed; }
.filter-mobile-footer { display: none; }
.filter-backdrop { position: fixed; inset: 0; z-index: 1500; display: block; width: 100%; border: 0; background: rgba(16,37,32,.34); visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.library-experience.filters-open .filter-backdrop { visibility: visible; opacity: 1; pointer-events: auto; }
.library-results { min-width: 0; }
.results-bar { min-height: 52px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .65rem 1rem; margin: 0 0 1rem; color: var(--muted); }
.results-heading { display: flex; align-items: center; gap: .65rem; min-width: max-content; }
.results-count { display: flex; align-items: baseline; gap: .4rem; }
.results-count strong { color: var(--ink); font-size: 1.35rem; }
.results-controls { display: flex; grid-column: 2; grid-row: 1; align-items: center; justify-content: flex-end; gap: .75rem; min-width: 0; }
.sort-control { display: flex; align-items: center; gap: .45rem; }
.sort-control label { margin: 0; color: var(--muted); font-size: .78rem; font-weight: 750; white-space: nowrap; }
.sort-control .form-select { width: 175px; min-height: 40px; padding-block: .35rem; font-size: .86rem; }
.library-experience.is-updating .library-results { opacity: .55; }
.song-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.song-card { display: flex; flex-direction: column; min-height: 230px; padding: 1.2rem; text-decoration: none; color: var(--ink); transition: box-shadow .18s ease, border-color .18s ease; }
.song-card:hover { color: var(--ink); box-shadow: 0 8px 28px rgba(30, 66, 57, .12); border-color: #bdd2ca; }
.song-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.song-card h2 { margin: 0; font-size: 1.3rem; }
.song-show { margin: .45rem 0 0; color: #40534d; font-size: .92rem; }
.song-artist { margin: .2rem 0 0; color: var(--muted); font-size: .84rem; }
.song-key-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .55rem; padding: .7rem 0 0; margin: .7rem 0 0; border-top: 1px solid #edf1ef; }
.song-key-facts div { min-width: 0; }
.song-key-facts dt { margin-bottom: .15rem; color: #788680; font-size: .64rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.song-key-facts dd { margin: 0; overflow: hidden; color: #40534d; font-size: .78rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.song-show span, .song-artist span { display: block; margin-bottom: .08rem; color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.pdf-badge { white-space: nowrap; padding: .35rem .65rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: .78rem; font-weight: 800; }
.pdf-badge.missing { background: #f1f1ef; color: #6d746f; }
.song-card .chip-row { display: flex; flex-wrap: wrap; align-content: flex-start; gap: .35rem; margin-top: 1rem; }
.chip { display: inline-flex; margin: 0 .3rem .3rem 0; padding: .3rem .6rem; border-radius: 999px; background: #f2f5f3; color: #52615d; font-size: .82rem; }
.song-card .chip { margin: 0; }
.chip-tag { background: var(--accent-soft); color: #854633; }
.chip-source { border: 1px solid #d5ddd9; background: #fff; color: #596863; }
.song-card-actions { display: flex; gap: .6rem; margin-top: auto; padding-top: 1.1rem; }
.view-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.view-switch button { min-height: 34px; padding: .3rem .65rem; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .85rem; font-weight: 750; }
.view-switch button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-dark); }
.library-view[hidden] { display: none !important; }
.song-table { width: 100%; min-width: 940px; border-collapse: collapse; }
.song-table th { padding: .8rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); background: #f8faf9; font-size: .75rem; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.song-table td { padding: .85rem 1rem; border-bottom: 1px solid #edf1ef; color: #41534e; font-size: .9rem; vertical-align: middle; }
.song-table tbody tr:last-child td { border-bottom: 0; }
.song-table tbody tr:hover { background: #fbfdfc; }
.song-table-title { color: var(--ink); font-weight: 800; text-decoration: none; }
.song-table-title:hover { color: var(--brand); text-decoration: underline; }
.song-table-subtitle { max-width: 300px; margin-top: .25rem; overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.table-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.table-tags span { color: #8a5746; font-size: .72rem; }
.table-actions { display: flex; justify-content: flex-end; gap: .4rem; white-space: nowrap; }

/* Guided setup and song flow */
.flow-shell { max-width: 860px; margin-inline: auto; }
.flow-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1.5rem; }
.flow-step { display: flex; align-items: center; gap: .55rem; color: #7b8984; font-size: .9rem; font-weight: 700; }
.flow-step::before { content: attr(data-step); width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #e8ecea; }
.flow-step.active { color: var(--brand-dark); }
.flow-step.active::before, .flow-step.done::before { background: var(--brand); color: white; }
.flow-card { overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.flow-card-body { padding: clamp(1.4rem, 5vw, 3rem); }
.flow-card h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); }
.teaching-step h1 { max-width: 680px; }
.song-teaching-form { margin-top: 1.6rem !important; }
.teaching-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.teaching-choice-group { min-width: 0; padding: 1rem; margin: 0; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfb; }
.teaching-choice-wide { grid-column: 1 / -1; }
.teaching-choice-group legend { float: none; width: auto; padding: 0; margin: 0 0 .65rem; font-size: .88rem; }
.teaching-choice-options { display: flex; flex-wrap: wrap; gap: .45rem; }
.teaching-choice { position: relative; cursor: pointer; }
.teaching-choice input { position: absolute; opacity: 0; pointer-events: none; }
.teaching-choice span { min-height: 38px; display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .7rem; border: 1px solid #cbd9d4; border-radius: 10px; background: #fff; color: #435650; font-size: .86rem; font-weight: 680; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.teaching-choice svg { width: 15px; height: 15px; display: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.teaching-choice:hover span { border-color: #9fbbb1; background: #f2f8f5; }
.teaching-choice input:checked + span { border-color: var(--brand); background: var(--brand); color: #fff; }
.teaching-choice input:checked + span svg { display: block; }
.teaching-choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.song-form-section { padding: 1.15rem; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfb; }
.song-form-section > h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.song-form-section > h2 + .text-muted { margin: -.65rem 0 1rem; font-size: .88rem; }
.song-edit-form .teaching-choice-group { background: #fff; }
.flow-footer { display: flex; justify-content: space-between; gap: .8rem; padding-top: 1.5rem; margin-top: 1.5rem; border-top: 1px solid var(--line); }
.choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.choice-card { display: flex; flex-direction: column; padding: 1.25rem; border: 2px solid var(--line); border-radius: 18px; background: white; }
.choice-card.recommended { border-color: var(--brand); box-shadow: 0 8px 25px rgba(40,97,83,.1); }
.choice-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: .85rem; border-radius: 14px; background: var(--brand-soft); color: var(--brand); font-size: 1.45rem; font-weight: 800; }
.choice-card .btn { margin-top: auto; }
.shortcut-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.shortcut-row:last-child { border: 0; }
.shortcut-status { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 900; }
.setup-visual { display: grid; place-items: center; min-height: 230px; margin: 1.25rem 0; border-radius: 22px; background: linear-gradient(145deg,#e5f2ed,#f8f1e5); overflow: hidden; }
.cloud-flow { display: flex; align-items: center; gap: 1rem; }
.visual-device, .visual-cloud, .visual-library { width: 105px; min-height: 115px; display: grid; place-items: center; padding: .8rem; border-radius: 20px; background: white; box-shadow: var(--shadow-sm); text-align: center; font-weight: 750; }
.visual-arrow { color: var(--brand); font-size: 1.6rem; }
.upload-zone { display: block; padding: 1.5rem; border: 2px dashed #accac0; border-radius: 18px; background: #f6fbf9; text-align: center; cursor: pointer; }
.upload-zone:hover { border-color: var(--brand); background: var(--brand-soft); }
.upload-zone input { max-width: 390px; margin: .8rem auto 0; }
.pdf-connect-simple { max-width: 620px; margin: 0 auto; padding-block: clamp(.5rem, 2vw, 1.25rem); text-align: center; }
.pdf-connect-simple h1 { margin-bottom: .5rem; }
.pdf-connect-simple .choice-icon { margin-bottom: 1rem; }
.current-pdf { display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; margin: .4rem 0 1rem; padding: .55rem .8rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: .9rem; }
.pdf-connect-button { width: 100%; max-width: 420px; margin-top: .9rem; }
.pdf-connect-links { display: flex; justify-content: center; gap: .65rem; margin-top: 1.15rem; font-weight: 650; }

/* Detail and utility pages */
.detail-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(260px,.7fr); gap: 1.25rem; align-items: start; }
.detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
.detail-item { padding: 1rem; border-radius: 14px; background: #f7f9f8; }
.detail-item span { display: block; color: var(--muted); font-size: .82rem; margin-bottom: .25rem; }
.pdf-manage-links { display: flex; align-items: center; justify-content: center; gap: .55rem; margin-top: .85rem; color: #91a09b; font-size: .85rem; }
.pdf-manage-links a { font-weight: 700; text-decoration: none; }
.pdf-manage-links form { margin: 0; }
.pdf-manage-links button { padding: 0; border: 0; background: transparent; color: #a34535; font: inherit; font-weight: 700; }
.pdf-manage-links a:hover, .pdf-manage-links button:hover { text-decoration: underline; }
.help-heading { margin-bottom: 1.25rem; }
.help-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.help-card { display: flex; flex-direction: column; align-items: flex-start; gap: .85rem; padding: 1.25rem; }
.help-card-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--brand-soft); color: var(--brand); font-size: 1.25rem; font-weight: 800; }
.help-card h2 { margin: 0; font-size: 1.15rem; }
.help-card p { margin: .35rem 0 0; color: var(--muted); font-size: .9rem; }
.help-card .btn { margin-top: auto; }
.help-shortcuts { margin-top: 1rem; }
.help-section-heading h2 { margin: 0; }
.help-section-heading p:last-child { margin: .35rem 0 0; color: var(--muted); }
.shortcut-install-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; margin-top: 1.25rem; }
.shortcut-install-card { display: grid; grid-template-columns: auto minmax(0,1fr); gap: .75rem; align-items: start; padding: 1rem; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfb; }
.shortcut-install-card h3 { margin: .1rem 0 .25rem; font-size: 1rem; }
.shortcut-install-card p { margin: 0; color: var(--muted); font-size: .84rem; }
.shortcut-install-card .btn, .shortcut-unavailable { grid-column: 2; justify-self: start; }
.shortcut-unavailable { color: var(--muted); font-size: .78rem; font-weight: 700; }
.help-backup-callout { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding: 1.25rem; }
.help-backup-callout h2 { margin: 0; font-size: 1.2rem; }
.help-backup-callout p:last-child { margin: .3rem 0 0; color: var(--muted); }
.backup-shell { max-width: 920px; margin: 0 auto; }
.backup-primary { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 1.25rem; padding: clamp(1.3rem,4vw,2rem); }
.backup-primary-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 19px; background: var(--brand-soft); color: var(--brand); font-size: 2rem; }
.backup-primary h1 { margin: 0; font-size: clamp(1.7rem,4vw,2.35rem); }
.backup-primary-copy > p:not(.eyebrow) { margin: .5rem 0; color: var(--muted); }
.backup-facts { display: flex; flex-wrap: wrap; gap: .4rem .8rem; color: #51645e; font-size: .78rem; font-weight: 700; }
.backup-reminder { margin: .8rem 0 1rem; color: var(--muted); font-size: .85rem; text-align: center; }
.backup-restore { overflow: hidden; }
.backup-restore summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; cursor: pointer; list-style: none; }
.backup-restore summary::-webkit-details-marker { display: none; }
.backup-restore summary strong, .backup-restore summary small { display: block; }
.backup-restore summary small { margin-top: .2rem; color: var(--muted); font-size: .8rem; font-weight: 400; }
.backup-restore[open] summary { border-bottom: 1px solid var(--line); }
.backup-restore-body { padding: 1.25rem; }
.empty-state { padding: 4rem 1.5rem; text-align: center; }
.empty-icon { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 1rem; border-radius: 24px; background: var(--brand-soft); color: var(--brand); font-size: 2rem; }

/* Warm-up Studio */
.warmup-admin-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(330px,1fr)); gap: 1rem; }
.warmup-admin-card { padding: 1.35rem; }
.publish-badge { padding: .35rem .65rem; border-radius: 999px; background: #eff1f0; color: #68736f; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.publish-badge.live { background: var(--brand-soft); color: var(--brand-dark); }
.pattern-readout { padding: .85rem 1rem; border-radius: 13px; background: #f5f8f7; color: var(--brand-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 750; text-align: center; overflow-x: auto; }
.warmup-editor-shell { max-width: 1140px; margin: auto; }
.warmup-editor-form { display: grid; grid-template-columns: minmax(0,1fr) 230px; gap: 1.25rem; align-items: start; }
.warmup-editor-help { position: sticky; top: 100px; padding: 1.15rem; }
.warmup-editor-help ol { padding-left: 1.25rem; margin: .8rem 0; color: var(--muted); }
.editor-step { width: 32px; height: 32px; display: inline-grid; place-items: center; margin: 0 .55rem .8rem 0; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; }
.editor-step + h2 { display: inline-block; }
.pattern-presets { display: flex; flex-wrap: wrap; gap: .55rem; }
.pattern-preview { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border-radius: 14px; background: var(--brand-soft); }
.pattern-preview span { color: var(--muted); font-size: .85rem; font-weight: 700; }
.pattern-preview strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.editor-mini-player { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid #b9d9cd; border-radius: 16px; background: linear-gradient(135deg,#edf8f4,#f8fbfa); }
.mini-player-label,.editor-mini-player > div:first-child strong { display: block; }
.mini-player-label { color: var(--muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.editor-mini-player label { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; font-weight: 700; }
.mini-player-options { display: flex; align-items: center; gap: .75rem; }
.editor-mini-player .form-select { min-width: 90px; min-height: 44px; padding-block: .45rem; }
.voice-range-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .8rem; }
.voice-range-card { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .6rem; padding: 1rem; border: 1px solid var(--line); border-radius: 15px; background: #f8faf9; }
.voice-range-card legend { grid-column: 1/-1; float: none; width: auto; margin: 0 0 .35rem; font-size: 1rem; }
.voice-range-card label { color: var(--muted); font-size: .75rem; font-weight: 750; }
.voice-range-card .form-control { min-height: 44px; padding: .5rem; }
.existing-audio audio { width: min(100%,520px); }
.publish-panel { border-color: #accdc1; }
.publish-panel .form-switch { display: flex; align-items: flex-start; gap: .65rem; padding-left: 0; }
.publish-panel .form-check-input { flex: 0 0 auto; width: 3rem; height: 1.55rem; margin: .1rem 0 0; }
.publish-panel .form-check-label span { display: block; color: var(--muted); font-weight: 400; }

/* Public warm-up library and player */
.warmup-public { background: #f7f5ef; }
.warmup-public-header { border-bottom: 1px solid rgba(25,51,45,.09); background: rgba(255,255,255,.88); backdrop-filter: blur(16px); }
.warmup-public-main { padding-top: clamp(2.5rem,7vw,5.5rem); padding-bottom: 4rem; }
.public-label { padding: .45rem .75rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: .78rem; font-weight: 750; }
.warmup-hero { max-width: 730px; margin-bottom: 3.5rem; }
.warmup-hero h1 { font-size: clamp(2.8rem,8vw,5.5rem); line-height: .98; }
.warmup-hero > p:last-child { max-width: 600px; color: var(--muted); font-size: clamp(1.05rem,2.4vw,1.3rem); }
.public-category { margin: 0 0 3rem; }
.public-category > h2 { margin-bottom: 1rem; font-size: 1.35rem; }
.public-warmup-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(310px,1fr)); gap: .85rem; }
.public-warmup-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; min-height: 150px; padding: 1.25rem; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s ease,box-shadow .15s ease; }
.public-warmup-card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(30,66,57,.12); }
.public-warmup-card h3 { margin: 0 0 .35rem; font-size: 1.2rem; }
.public-warmup-card p { margin: 0 0 .55rem; color: var(--muted); }
.warmup-note { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: var(--brand-soft); color: var(--brand); font-size: 1.45rem; }
.warmup-meta { color: var(--brand); font-size: .8rem; font-weight: 750; }
.card-arrow { font-size: 1.5rem; }
.public-safety { max-width: 700px; margin: 4rem auto 0; padding: 1rem; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .9rem; }
.player-back { max-width: 820px; margin: 0 auto 1.2rem; }
.player-back a { font-weight: 700; text-decoration: none; }
.warmup-player { max-width: 820px; margin: auto; }
.player-heading { margin-bottom: 1.5rem; text-align: center; }
.player-heading h1 { margin: .8rem 0 .45rem; font-size: clamp(2.3rem,7vw,4rem); }
.player-heading p { max-width: 620px; margin: auto; color: var(--muted); font-size: 1.1rem; }
.teacher-cue,.demo-player,.range-picker,.piano-console { margin-bottom: 1rem; padding: clamp(1.15rem,4vw,1.75rem); border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm); }
.teacher-cue { display: flex; gap: 1rem; align-items: flex-start; background: #fffaf0; }
.teacher-cue > span { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #f4dfad; }
.teacher-cue p { margin: .3rem 0 0; color: #5f625d; white-space: pre-line; }
.demo-player { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.demo-player span { display: block; color: var(--muted); font-size: .88rem; }
.demo-player audio { width: min(360px,100%); }
.range-picker h2 { margin: 0; font-size: 1.25rem; }
.range-picker > p { margin: .3rem 0 1rem; color: var(--muted); }
.voice-choice-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: .6rem; }
.voice-choice { min-height: 82px; padding: .7rem; border: 2px solid var(--line); border-radius: 15px; background: #fff; color: var(--ink); }
.voice-choice strong,.voice-choice span { display: block; }
.voice-choice span { margin-top: .2rem; color: var(--muted); font-size: .78rem; }
.voice-choice.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(40,97,83,.08); }
.piano-console { padding: clamp(1.3rem,5vw,2.5rem); background: var(--brand-dark); color: #fff; }
.console-status { display: grid; place-items: center; min-height: 155px; text-align: center; }
.console-status > span:first-child { color: rgba(255,255,255,.68); font-weight: 700; }
.console-status > strong { font-size: clamp(3.5rem,13vw,6.5rem); line-height: 1; }
.syllable-display { color: #f4b59e; font-size: 1.25rem; font-weight: 800; }
.playback-progress { height: 7px; margin: .3rem 0 1.4rem; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; }
.playback-progress > div { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s linear; }
.player-controls { display: flex; justify-content: center; align-items: center; gap: .8rem; }
.btn-player-primary,.btn-player-secondary { border: 0; color: #fff; font-weight: 800; }
.btn-player-primary { min-width: 220px; min-height: 64px; padding: 1rem 1.4rem; border-radius: 20px; background: var(--accent); font-size: 1.08rem; }
.btn-player-primary:disabled { opacity: .75; }
.btn-player-secondary { min-width: 85px; min-height: 55px; border-radius: 17px; background: rgba(255,255,255,.13); }
.btn-player-secondary:disabled { opacity: .35; }
.player-settings { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1.5rem; color: rgba(255,255,255,.72); font-size: .85rem; }
.player-settings label { display: flex; align-items: center; gap: .55rem; }
.player-settings select { padding: .45rem; border: 0; border-radius: 8px; }
.player-safety { color: var(--muted); text-align: center; font-size: .88rem; }

/* Authentication */
.auth-page { background: white; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(340px,.9fr) minmax(420px,1.1fr); }
.auth-welcome { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(2rem,6vw,5rem); color: white; background: linear-gradient(145deg,#163f36,#2b6859); overflow: hidden; }
.auth-welcome h1 { max-width: 560px; font-size: clamp(2.5rem,5vw,4.7rem); }
.auth-welcome p { max-width: 540px; font-size: 1.1rem; color: rgba(255,255,255,.8); }
.welcome-art { position: relative; height: 280px; display: grid; place-items: center; }
.music-card-art { width: 240px; padding: 1.5rem; border-radius: 24px; background: rgba(255,255,255,.96); color: var(--ink); transform: rotate(-4deg); box-shadow: 0 25px 60px rgba(0,0,0,.22); }
.music-card-art span, .music-card-art strong { display: block; }
.music-card-art strong { font-size: 1.35rem; margin-top: .4rem; }
.floating-note { position: absolute; color: #f3b69f; font-size: 3.5rem; }
.note-one { left: 12%; top: 15%; transform: rotate(-15deg); }
.note-two { right: 13%; bottom: 12%; transform: rotate(12deg); }
.auth-form-wrap { display: flex; flex-direction: column; justify-content: center; padding: clamp(1.5rem,8vw,7rem); }
.auth-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 3rem; }
.auth-card { width: 100%; max-width: 480px; }
.auth-card h1 { font-size: 2.5rem; }

@media (max-width: 991px) {
  .brand small { display: none; }
  .library-searchbar { grid-template-columns: minmax(0,1fr) auto auto; }
  .mobile-filter-button { display: inline-flex; align-items: center; gap: .35rem; }
  .mobile-filter-button span { min-width: 23px; padding: .1rem .38rem; border-radius: 999px; background: var(--brand); color: #fff; font-size: .72rem; }
  .filter-sidebar { inset: 0 auto 0 0; width: min(360px, 90vw); border: 0; border-radius: 0 20px 20px 0; transform: translateX(-102%); }
  .filter-show-button { display: none; }
  body.library-filters-open { overflow: hidden; }
  .filter-mobile-footer { position: sticky; bottom: -1.1rem; display: flex; align-items: center; gap: .7rem; padding: .8rem 0 1rem; background: #fff; }
  .filter-mobile-footer .btn { flex: 1; }
  .desktop-filter-toggle { display: none; }
  .detail-layout { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-welcome { display: none; }
  .auth-form-wrap { min-height: 100vh; align-items: center; }
  .warmup-editor-form { grid-template-columns: 1fr; }
  .warmup-editor-help { display: none; }
  .voice-range-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .help-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar-inner { min-height: 66px; }
  .brand strong { font-size: .92rem; }
  .brand-mark { width: 38px; height: 38px; }
  .main-nav .nav-link-pill:not(.nav-add):not(.nav-more) { display: none; }
  .app-shell { padding-top: 1.4rem; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading .btn { width: 100%; }
  .library-searchbar { grid-template-columns: 1fr 1fr; }
  .library-searchbar .search-wrap { grid-column: 1 / -1; }
  .library-searchbar .btn { width: 100%; }
  .song-grid, .choice-grid, .detail-list, .teaching-choice-grid { grid-template-columns: 1fr; }
  .teaching-choice-wide { grid-column: auto; }
  .flow-progress { gap: .2rem; }
  .flow-step { flex-direction: column; text-align: center; font-size: .72rem; }
  .flow-footer { flex-direction: column-reverse; }
  .flow-footer .btn { width: 100%; }
  .cloud-flow { gap: .4rem; transform: scale(.82); }
  .song-card-actions { flex-direction: column; }
  .song-card-actions .btn { width: 100%; }
  .results-bar { align-items: stretch; gap: .7rem; grid-template-columns: 1fr; }
  .results-heading, .results-controls, .selected-filter-bar { grid-column: 1; }
  .results-heading { grid-row: 1; }
  .results-controls { grid-row: 2; }
  .selected-filter-bar { grid-row: 3; }
  .results-controls { width: 100%; flex-wrap: wrap; }
  .sort-control { flex: 1 1 190px; }
  .sort-control .form-select { width: 100%; }
  .results-controls .view-switch { margin-left: auto; }
  .app-toast { top: .75rem; right: .75rem; width: calc(100vw - 1.5rem); }
  .voice-range-grid,.voice-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .demo-player { align-items: stretch; flex-direction: column; }
  .editor-mini-player { grid-template-columns: 1fr; }
  .editor-mini-player label { justify-content: space-between; }
  .mini-player-options { align-items: stretch; flex-direction: column; }
  .demo-player audio { width: 100%; }
  .player-settings { align-items: stretch; flex-direction: column; gap: .8rem; }
  .player-settings label { justify-content: space-between; }
  .public-label { display: none; }
  .shortcut-install-grid { grid-template-columns: 1fr; }
  .help-backup-callout { align-items: stretch; flex-direction: column; }
  .backup-primary { grid-template-columns: 1fr; text-align: left; }
  .backup-primary .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
