:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #172033;
  background: #e9edf3;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 92% 0, #dbeafe, transparent 38rem), #e9edf3; }
body.shelf-body {
  --ink: #2a2a28;
  --muted: #6a655c;
  --paper: #f4efe6;
  --sheet: #fbf7ef;
  --line: #d9d0c1;
  --accent: #3f5d4a;
  --accent-soft: #dce8e0;
  --lamp: #b7791f;
  --warn: #8a6a1f;
  --tape: #cbb896;
  padding-bottom: 6.75rem;
  font-family: Figtree, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255,255,255,.55), transparent 22rem),
    radial-gradient(circle at 88% 0%, rgba(220, 210, 180, .35), transparent 26rem),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(42, 42, 40, .015) 3px, rgba(42, 42, 40, .015) 4px),
    linear-gradient(165deg, #f7f2e8 0%, #efe8dc 48%, #e8e2d4 100%);
}
main { width: 100%; margin: 0; padding: 1.25rem; }
.app-nav { position: sticky; top: .75rem; z-index: 5; display: flex; justify-content: flex-end; gap: .45rem; }
.app-nav a { padding: .65rem .85rem; border: 1px solid #b8c3d3; border-radius: 999px; background: rgba(255,255,255,.92); color: #172033; font-weight: 800; text-decoration: none; box-shadow: 0 8px 24px rgba(26,45,75,.08); }
header { max-width: 820px; padding: 2rem 0 2.5rem; }
.lab-header { max-width: none; padding: .75rem 0 1.25rem; text-align: left; }.lab-header h1 { font-size: clamp(2.5rem, 5vw, 4.8rem); }.lab-header > p:last-child { max-width: 680px; margin: .5rem 0 0; }
/* CRES-LAB-SHELL-001: Lab shares Room/Lumen shell; desk scrolls without Library bookshelf. */
body.lab-shell { padding-bottom: 0; }
body.lab-shell .lab-app {
  overflow: auto;
  height: auto;
  min-height: calc(100vh - 3.75rem);
  min-height: calc(100dvh - 3.75rem);
  padding: 1rem 0 2.5rem;
}
body.lab-shell .lab-desk { max-width: 100%; }
body.lab-shell .lab-header h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -.02em;
}
body.lab-shell .experiment-lab {
  margin-top: 0;
  border: 1px solid var(--line, #d9d0c1);
  border-radius: 1rem;
  background: var(--sheet, #fbf7ef);
  box-shadow: none;
}
body.lab-shell .experiment-drop-zone {
  border-color: var(--tape, #cbb896);
  background: rgba(255, 255, 255, .55);
  color: var(--accent, #3f5d4a);
}
body.lab-shell .experiment-drop-zone[data-dragging="true"] {
  border-color: var(--accent, #3f5d4a);
  background: var(--accent-soft, #dce8e0);
}
body.lab-shell .lab-settings {
  display: block;
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line, #d9d0c1);
  border-radius: .85rem;
  background: rgba(255, 255, 255, .7);
}
body.lab-shell .lab-settings .form-label { font-size: .78rem; font-weight: 600; color: var(--muted, #6a655c); }
body.lab-shell label.file { position: relative; overflow: hidden; }
body.lab-shell .experiment-card,
body.lab-shell .experiment-workspace,
body.lab-shell .projection-panel {
  border-color: var(--line, #d9d0c1);
  background: rgba(255, 255, 255, .88);
}
body.lab-shell .experiment-card[data-selected="true"] {
  border-color: var(--accent, #3f5d4a);
  box-shadow: 0 0 0 2px rgba(63, 93, 74, .18);
}
body.lab-shell .mode-badge {
  background: var(--accent-soft, #dce8e0);
  color: var(--accent, #3f5d4a);
}
body.lab-shell #run-experiment { background: var(--accent, #3f5d4a); }
.eyebrow, .step { color: #2457c5; font-size: .75rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: .35rem 0 1rem; font-size: clamp(3.2rem, 8vw, 7rem); line-height: .88; letter-spacing: -.06em; }
h2 { margin: .2rem 0; font-size: clamp(1.7rem, 3vw, 2.7rem); letter-spacing: -.035em; }
h3 { margin-top: 0; }
header > p:last-child, .import-panel p, #item-summary { color: #526078; font-size: 1.08rem; line-height: 1.6; }
.import-panel { display: grid; grid-template-columns: 1fr 2fr; gap: 1.5rem; align-items: end; padding: 1.5rem; border: 1px solid #cbd5e1; border-radius: 22px; background: rgba(255,255,255,.84); box-shadow: 0 18px 50px rgba(26,45,75,.1); }
.import-panel form { display: grid; gap: 1rem; }
.metadata-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
label { display: grid; gap: .4rem; font-size: .78rem; font-weight: 800; }
input[type="text"], input[type="search"], input:not([type]) { width: 100%; padding: .7rem .8rem; border: 1px solid #b8c3d3; border-radius: 9px; background: white; font: inherit; }
select, input[type="number"] { width: 100%; padding: .7rem .8rem; border: 1px solid #b8c3d3; border-radius: 9px; background: white; font: inherit; }
.file { display: inline-block; padding: .9rem 1rem; border-radius: 10px; color: white; background: #2457c5; cursor: pointer; text-align: center; }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.import-panel button, .generation-panel button { justify-self: start; padding: .85rem 1.15rem; border: 0; border-radius: 10px; background: #172033; color: white; font: inherit; font-weight: 800; cursor: pointer; }
.supported { grid-column: 3; margin: 0; font-size: .68rem !important; text-align: center; }
#status { min-height: 1.5rem; margin: 1rem 0; color: #42526b; }
.library, .workbench, .experiment-lab { margin-top: 4rem; }
.experiment-lab { padding: 1rem; border: 1px solid #cbd5e1; border-radius: 18px; background: rgba(255,255,255,.72); }
.lab-settings { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem; margin: 1.25rem 0 2rem; padding: 1rem; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; }
.experiment-lab .section-heading { align-items: center; }
.experiment-lab .section-heading p { max-width: 700px; color: #526078; }
.lab-supported { grid-column: auto; text-align: left; }
.experiment-drop-zone { display: grid; place-items: center; min-height: 92px; margin: .75rem 0; padding: 1rem; border: 2px dashed #8da3c2; border-radius: 14px; background: #f8fafc; color: #2457c5; cursor: pointer; font-size: 1rem; text-align: center; }
.experiment-drop-zone[data-dragging="true"] { border-color: #2457c5; background: #eef4ff; }
.experiment-drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.experiment-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1rem; min-height: 70vh; margin-top: 1rem; align-items: start; }
.experiment-artifacts { position: sticky; top: 1rem; display: grid; align-content: start; gap: .4rem; max-height: calc(100vh - 2rem); overflow-y: auto; padding-right: .25rem; }
.experiment-card { display: grid; grid-template-columns: 1fr auto; gap: .3rem .5rem; padding: .65rem; border: 1px solid #cbd5e1; border-radius: 9px; background: white; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.experiment-card strong, .experiment-card > span:not(.badge), .experiment-card progress { grid-column: 1 / -1; }.experiment-card .badge { grid-column: 2; grid-row: 1; }
.experiment-card[data-selected="true"] { border-color: #2457c5; box-shadow: 0 0 0 2px rgba(36,87,197,.15); }
.experiment-card > span:not(.badge) { color: #637188; font-size: .78rem; }
.experiment-card .badge { justify-self: start; }
.experiment-card progress { width: 100%; }
.experiment-workspace { min-width: 0; padding: 1rem; border: 1px solid #cbd5e1; border-radius: 14px; background: white; }
.workspace-state { display: flex; gap: .5rem; align-items: center; }.mode-badge { padding: .35rem .55rem; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-size: .72rem; font-weight: 850; text-transform: uppercase; }
.workspace-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.experiment-metadata { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; padding: .9rem; border-radius: 10px; background: #f1f5f9; }
.experiment-metadata dt { font-weight: 850; }.experiment-metadata dd { margin: 0; color: #526078; }
.capability-list { display: grid; gap: .45rem; padding: 0; list-style: none; }
.capability-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem; border-bottom: 1px solid #e2e8f0; }.capability-list span { color: #526078; }
.experiment-pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; padding: 0; list-style: none; }
.experiment-pipeline li { display: grid; gap: .25rem; padding: .6rem; border-top: 4px solid #cbd5e1; background: #f8fafc; font-size: .72rem; align-content: start; }
.experiment-pipeline li[data-status="complete"],
.experiment-pipeline li[data-status="ready"] { border-color: #16a34a; }
.experiment-pipeline li[data-status="partial"] { border-color: #d97706; }
.experiment-pipeline li[data-status="processing"] { border-color: #2457c5; }
.experiment-pipeline li[data-status="failed"] { border-color: #dc2626; }
.experiment-pipeline li[data-status="not-implemented"],
.experiment-pipeline li[data-status="not-supported"],
.experiment-pipeline li[data-status="not-run"],
.experiment-pipeline li[data-status="pending"] { border-color: #94a3b8; }
.experiment-pipeline .stage-status { color: #526078; text-transform: uppercase; font-weight: 800; }
.experiment-pipeline .stage-detail { display: grid; gap: .35rem; margin: .35rem 0 0; }
.experiment-pipeline .stage-detail > div { display: grid; gap: .1rem; }
.experiment-pipeline .stage-detail dt { font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
.experiment-pipeline .stage-detail dd { margin: 0; color: #172033; overflow-wrap: anywhere; line-height: 1.35; }
.evidence-results li[data-result="partial"] { background: #fffbeb; color: #92400e; }
.evidence-results li[data-result="not-implemented"],
.evidence-results li[data-result="not-supported"],
.evidence-results li[data-result="not-run"] { background: #e2e8f0; color: #334155; }
#run-experiment { padding: .8rem 1rem; border: 0; border-radius: 10px; background: #2457c5; color: white; font: inherit; font-weight: 850; cursor: pointer; }
.projection-comparison { display: grid; gap: 1rem; margin-top: 1rem; }.projection-comparison > section { min-width: 0; }.projection-panel { min-height: 360px; overflow: auto; padding: .8rem; border: 1px solid #cbd5e1; border-radius: 12px; background: #f8fafc; }.projection-panel embed { width: 100%; min-height: 78vh; border: 0; }.projection-panel audio { width: 100%; }.projection-panel svg { width: 100%; height: auto; }.source-preview { max-height: 70vh; margin: 0; padding: .8rem; background: #172033; color: #e8eef9; white-space: pre-wrap; }.projection-controls { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: -.8rem -.8rem .6rem; padding: .65rem .8rem; background: rgba(248,250,252,.96); border-bottom: 1px solid #cbd5e1; }.projection-controls button { padding: .5rem .7rem; }.projection-controls label { display: flex; align-items: center; gap: .4rem; }.midi-events { max-height: 56vh; overflow: auto; padding-left: 1.5rem; font-family: ui-monospace, monospace; font-size: .76rem; }
.experiment-workspace[data-mode="score"] .projection-comparison { grid-template-columns: 1fr; }.experiment-workspace[data-mode="score"] .projection-panel { min-height: 72vh; }.experiment-workspace[data-mode="performance"] .projection-comparison { grid-template-columns: 270px minmax(0, 1fr); }.experiment-workspace[data-mode="performance"] .projection-panel { min-height: 58vh; }.experiment-workspace[data-mode="audio"] .projection-comparison { grid-template-columns: minmax(240px, .45fr) minmax(0, 1.55fr); }.experiment-workspace[data-mode="audio"] .projection-panel { min-height: 300px; }
.midi-summary { display: grid; grid-template-columns: max-content 1fr; gap: .4rem .8rem; }.midi-summary dt { font-weight: 850; }.midi-summary dd { margin: 0; }.transport { display: grid; grid-template-columns: auto 1fr auto auto; gap: .65rem; align-items: center; margin-top: .75rem; padding: .75rem; border-radius: 10px; background: #e8eef9; }.transport button { padding: .65rem .8rem; border: 0; border-radius: 8px; background: #172033; color: white; font-weight: 800; }.transport label { display: flex; align-items: center; gap: .4rem; }.projection-warning { padding: .7rem; border-left: 4px solid #d97706; background: #fffbeb; color: #92400e; }
.evidence-results { display: grid; gap: .5rem; padding-left: 1.4rem; }.evidence-results li { padding: .55rem; border-radius: 8px; background: #f1f5f9; }.evidence-results li[data-result="passed"] { background: #ecfdf5; color: #166534; }.evidence-results li[data-result="not-run"] { background: #fef3c7; color: #92400e; }
.section-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 1.2rem; }
.search { width: min(350px, 100%); }
.library-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.library-card { display: grid; gap: .75rem; min-height: 180px; padding: 1.25rem; border: 1px solid #cbd5e1; border-radius: 17px; background: #fff; color: inherit; font: inherit; text-align: left; cursor: pointer; box-shadow: 0 13px 35px rgba(26,45,75,.08); }
.library-card:hover, .library-card:focus-visible { border-color: #2457c5; transform: translateY(-2px); }
.library-card strong { font-size: 1.35rem; }
.library-card > span { color: #637188; }
.card-top { display: flex; justify-content: space-between; gap: .6rem; align-items: center; font-size: .72rem; }
.badge { padding: .3rem .5rem; border-radius: 999px; background: #dcfce7; color: #166534; font-weight: 850; text-transform: uppercase; }
.badge.review_required { background: #fef3c7; color: #92400e; }
.badge.failed { background: #fee2e2; color: #991b1b; }
.display-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; width: min(760px, 100%); }
.governance-summary { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; }
.governance-summary span { padding: .35rem .55rem; border: 1px solid #b8c3d3; border-radius: 999px; background: rgba(255,255,255,.75); font-size: .72rem; font-weight: 800; }
.toggle { display: flex; align-items: center; }
.score-card { overflow: auto; min-height: 230px; padding: 2rem; border-radius: 22px; background: #fbfaf4; box-shadow: 0 22px 60px rgba(26,45,75,.14); }
.generation-panel { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: 1rem 1.25rem; border: 1px solid #cbd5e1; border-radius: 14px; background: rgba(255,255,255,.8); }
.generation-panel p { margin: .3rem 0 0; color: #526078; }
#score-output { width: max-content; min-width: 100%; }
.review-callout { width: min(620px, 100%); padding: 2rem; border-left: 5px solid #d97706; background: #fffbeb; }
.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.evidence-grid > section { padding: 1.25rem; border-radius: 16px; background: rgba(255,255,255,.75); }
.source-link { display: block; margin: .55rem 0; color: #2457c5; overflow-wrap: anywhere; }
.resource-row { display: grid; gap: .65rem; margin: .75rem 0; padding: .85rem; border: 1px solid #d8dee8; border-radius: 12px; background: white; }
.resource-row p { margin: .25rem 0; font-size: .82rem; overflow-wrap: anywhere; }
.resource-row a { color: #2457c5; font-weight: 750; }
.resource-progress { display: flex; align-items: center; gap: .7rem; }
.resource-progress progress { flex: 1; }
.resource-row details { margin: 0; }
.resource-group { padding: .8rem 0; border-bottom: 1px solid #d8dee8; }
.resource-group h4 { margin: 0 0 .45rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.resource-empty { margin: .3rem 0 !important; font-style: italic; }
.manifestation { margin: .35rem 0; padding: .5rem .65rem; border-left: 3px solid #2457c5; background: #eef4ff; color: #172033 !important; }
.journey { list-style: none; margin: 0; padding: 0; }
.journey li { display: grid; grid-template-columns: 1.8rem 1fr; gap: .7rem; padding: .65rem 0; border-bottom: 1px solid #d8dee8; }
.journey li > span { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #dcfce7; color: #166534; font-weight: 900; }
.journey strong, .journey p { display: block; margin: 0; }
.journey .warning-step > span { background: #fef3c7; color: #92400e; }
.journey .pending-step > span { background: #e2e8f0; color: #475569; }
.resource-form { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid #cbd5e1; }
.secondary { align-self: end; background: #172033; }
.evidence-grid p { margin: .45rem 0; color: #526078; }
details { margin-top: 1rem; border-radius: 14px; background: #172033; color: #e8eef9; }
summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 750; }
pre { overflow: auto; margin: 0; padding: 0 1.25rem 1.25rem; line-height: 1.55; }
.empty { grid-column: 1 / -1; padding: 2rem; border: 1px dashed #9aa9bd; border-radius: 15px; text-align: center; }
.high-contrast { background: white; color: black; }
.high-contrast .experiment-lab, .high-contrast .lab-settings, .high-contrast .experiment-workspace, .high-contrast .projection-panel { border: 3px solid black; background: white; box-shadow: none; }
.high-contrast .import-panel, .high-contrast .library-card, .high-contrast .score-card, .high-contrast .evidence-grid > section { border: 3px solid black; background: white; box-shadow: none; }
.high-contrast header > p:last-child, .high-contrast #status, .high-contrast #item-summary, .high-contrast .evidence-grid p { color: black; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.paper-icon { display: block; flex: 0 0 auto; opacity: .92; }
.paper-icon-invert { filter: invert(1) brightness(1.05); }
.paper-app { display: grid; grid-template-columns: 1fr; width: min(100%, 72rem); margin: 0 auto; padding: 0 0 2rem; }
.paper-rail { display: none; }
.paper-stage { min-width: 0; padding: 1rem 1rem 2rem; }
.shelf-topbar { position: relative; padding: 1rem 0 1.35rem; }
.shelf-topbar h1 { margin: .15rem 0 .7rem; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: clamp(2.6rem, 10vw, 4.4rem); line-height: .9; letter-spacing: -.02em; color: var(--ink); }
.shelf-topbar #welcome-message { margin: 0; max-width: 34rem; color: var(--muted); font-size: 1.05rem; line-height: 1.5; }
body.shelf-body .eyebrow { color: var(--accent); letter-spacing: .16em; }
.paper-lab-link { position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .8rem; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; box-shadow: 2px 3px 0 rgba(42, 42, 40, .06); transform: rotate(1.2deg); }
.paper-lab-link::before { content: ""; position: absolute; top: -8px; left: 18%; width: 42%; height: 12px; background: linear-gradient(90deg, transparent, rgba(203, 184, 150, .85), transparent); transform: rotate(-2deg); }
.shelf-screen { display: none; animation: shelf-in .35s ease; }
.shelf-screen.is-active { display: grid; gap: 1.45rem; }
@keyframes shelf-in { from { opacity: 0; transform: translateY(.35rem); } to { opacity: 1; transform: none; } }
.shelf-lede { margin: .35rem 0 0; color: var(--muted); line-height: 1.5; }
.shelf-section h3, .shelf-screen > h2, .work-view h3 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(1.55rem, 4vw, 2.1rem); font-weight: 700; }
.paper-card { position: relative; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.35), transparent 40%), var(--sheet); box-shadow: 0 1px 0 rgba(255,255,255,.65) inset, 0 10px 24px rgba(42, 42, 40, .07); clip-path: polygon(0.6% 0, 100% 0.8%, 99.2% 100%, 0 98.8%); }
.shelf-search-launch, .collection-card, .shelf-work-card, .artifact-tile, .touch-primary, .touch-secondary, .paper-import, .shelf-nav button, .import-option, .rail-collection { min-height: 3.2rem; touch-action: manipulation; }
.shelf-search-launch.paper-strip { display: flex; align-items: center; gap: .85rem; width: 100%; padding: 1rem 1.15rem; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); font: inherit; font-size: 1.15rem; font-weight: 700; cursor: pointer; text-align: left; box-shadow: 0 8px 20px rgba(42, 42, 40, .06); clip-path: none; }
.shelf-search-launch .paper-strip-end { margin-left: auto; opacity: .65; }
.shelf-health.paper-card { padding: 1.1rem 1.15rem; }
.shelf-health-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: .85rem; }
.shelf-health-row h3 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; }
body.shelf-body .badge { border-radius: 0; background: transparent; color: var(--accent); border: 0; padding: 0; font-family: Figtree, sans-serif; font-size: .72rem; letter-spacing: .1em; }
body.shelf-body .badge::before { content: "? "; color: var(--accent); }
.library-counts { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin: 0; }
.library-counts > div { padding: .85rem .9rem; border: 1px solid rgba(217, 208, 193, .8); background: rgba(255, 252, 246, .75); }
.library-counts dt { font-size: .7rem; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.library-counts dd { margin: .35rem 0 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.8rem; font-weight: 700; }
.type-counts { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.type-counts li { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .65rem; border: 1px solid var(--line); background: rgba(255,255,255,.45); color: var(--ink); font-size: .78rem; font-weight: 700; }
.type-counts li::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); }
.collection-shelf, .expression-shelf, .artifact-shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-top: 1rem; }
.collection-card { display: grid; gap: .4rem; align-content: start; min-height: 8rem; padding: 1.05rem 1.1rem; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.collection-card[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.collection-card:nth-child(3n) { transform: rotate(-.4deg); }
.collection-card:nth-child(4n) { transform: rotate(.5deg); }
.collection-card strong { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.35rem; }
.collection-count { color: var(--muted); font-weight: 700; font-size: .9rem; }
.works-list { display: grid; gap: .9rem; margin-top: 1rem; }
.work-card, .shelf-work-card { display: grid; gap: .35rem; width: 100%; padding: 1.15rem 1.2rem; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.work-card[data-status="unresolved"], .shelf-work-card[data-status="unresolved"] { box-shadow: inset 4px 0 0 var(--lamp), 0 10px 24px rgba(42, 42, 40, .07); }
.work-card[data-status="confirmed"], .shelf-work-card[data-status="confirmed"] { box-shadow: inset 4px 0 0 var(--accent), 0 10px 24px rgba(42, 42, 40, .07); }
.work-card-top { display: flex; justify-content: space-between; gap: .75rem; align-items: start; }
.work-card strong, .shelf-work-card strong { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.55rem; line-height: 1.1; }
.work-composer { margin: 0; font-weight: 700; color: var(--ink); }
.work-meta, .work-uncertainty { margin: .2rem 0 0; color: var(--muted); }
.work-uncertainty { color: var(--warn); font-weight: 700; }
.work-actions { margin-top: .75rem; display: flex; gap: .65rem; flex-wrap: wrap; }
.touch-primary, .touch-secondary, .touch-ghost, .source-form button, .work-actions button, .source-card button { padding: .95rem 1.15rem; border: 0; font: inherit; font-weight: 800; cursor: pointer; }
.touch-primary, .source-form button, .source-card button, .work-actions .touch-primary { background: linear-gradient(180deg, #4d6d59, var(--accent)); color: #f8f4ec; box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 8px 18px rgba(42, 42, 40, .16); }
.touch-secondary, .work-actions .touch-secondary { background: #2f3330; color: #f8f4ec; }
.touch-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.library-search-form, .shelf-search-form { display: grid; gap: .9rem; padding: 1.1rem; }
.shelf-search-field input { min-height: 3.5rem; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: 0; background: #fffdf8; font-size: 1.15rem; }
.shelf-filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.search-status { margin: .25rem 0 0; color: var(--muted); }
.artifact-tree-panel { overflow: auto; max-height: min(70vh, 40rem); }
.artifact-tree { list-style: none; margin: 0; padding: .35rem .5rem .75rem; }
.artifact-tree .artifact-tree { padding: 0 0 0 1.1rem; margin: 0; border-left: 1px solid var(--line, #d9d0c1); }
.artifact-tree-node { margin: .1rem 0; }
.artifact-tree-summary,
.artifact-tree-file {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .45rem .55rem;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.artifact-tree-summary:hover,
.artifact-tree-file:hover { background: var(--accent-soft, #dce8e0); }
.artifact-tree-summary { list-style: none; }
.artifact-tree-summary::-webkit-details-marker { display: none; }
.artifact-tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.artifact-tree-meta { color: var(--muted, #6a655c); font-size: .78rem; white-space: nowrap; }
.artifact-tree-source > .artifact-tree-branch > .artifact-tree-summary .artifact-tree-name { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.15rem; }
.artifact-tree-file .badge { font-size: .65rem; text-transform: uppercase; }
.search-works-heading { margin-top: .5rem; }
.understanding-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 991.98px) {
  .understanding-layout { grid-template-columns: 1fr; }
}
.ng-observation-list { display: grid; gap: .45rem; max-height: min(70vh, 36rem); overflow: auto; }
.ng-observation-card {
  display: grid;
  gap: .2rem;
  width: 100%;
  padding: .65rem .7rem;
  border: 1px solid var(--line, #d9d0c1);
  border-radius: .65rem;
  background: rgba(255, 255, 255, .75);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ng-observation-card span { color: var(--muted, #6a655c); font-size: .72rem; overflow-wrap: anywhere; }
.ng-observation-card.is-selected,
.ng-observation-card:hover { border-color: var(--accent, #3f5d4a); background: var(--accent-soft, #dce8e0); }
.understanding-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.ng-lab-frame {
  width: 100%;
  min-height: min(70vh, 36rem);
  border: 1px solid var(--line, #d9d0c1);
  border-radius: 1rem;
  background: #0f172a;
}
.cognitive-blade .blade-sections { display: grid; gap: .85rem; margin: 0; }
.cognitive-blade .blade-sections > div { display: grid; gap: .25rem; }
.cognitive-blade dt { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #6a655c); }
.cognitive-blade dd { margin: 0; }
.cognitive-blade ul { margin: 0; padding-left: 1.1rem; }
.source-form, .shelf-source-form { display: grid; gap: .85rem; padding: 1.1rem; }
.source-list { display: grid; gap: .85rem; margin-top: 1rem; }
.source-card, .shelf-source-card { display: grid; gap: 1rem; padding: 1.15rem; }
.source-card span { display: block; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.source-card .source-meta { margin-top: .35rem; color: var(--accent); font-weight: 700; }
.work-view { display: grid; gap: .35rem; padding: 1.2rem; }
.work-view-composer { margin: 0; font-size: 1.15rem; font-weight: 700; }
.expression-card, .artifact-tile { display: grid; gap: .3rem; min-height: 6.5rem; padding: 1rem; border: 1px solid var(--line); background: var(--sheet); text-align: left; }
.artifact-tile { color: inherit; font: inherit; cursor: pointer; }
.artifact-tile strong, .expression-card strong { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.2rem; }
.artifact-tile > span, .expression-card > span:last-child { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.artifact-detail { padding: 1.2rem; }
.artifact-detail-meta { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1rem; margin: 1rem 0 0; }
.artifact-detail-meta dt { font-weight: 800; }
.artifact-detail-meta dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.artifact-list { display: grid; gap: .55rem; }
.artifact-row { display: grid; gap: .35rem; padding: .85rem 1rem; border: 1px solid var(--line); background: var(--sheet); }
.artifact-row span { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.artifact-source { color: var(--accent) !important; font-weight: 700; }
.shelf-back { justify-self: start; display: inline-flex; align-items: center; gap: .45rem; min-height: 2.8rem; padding: .7rem 1rem; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.paper-empty { position: relative; display: grid; justify-items: center; gap: .75rem; padding: 2rem 1.25rem 1.4rem; text-align: center; }
.paper-empty[hidden] { display: none !important; }
.paper-empty-art { margin-top: .5rem; }
.paper-clip { position: absolute; top: -.55rem; right: 1.1rem; transform: rotate(18deg); }
.paper-import-mobile {
  position: fixed; right: 1rem; bottom: 5.4rem; z-index: 8; width: auto; margin: 0;
  padding: .95rem 1.1rem; box-shadow: 0 12px 26px rgba(42, 42, 40, .22);
}
@media (min-width: 960px) {
  .paper-import-mobile { display: none; }
}
.shelf-nav.paper-bottom-nav { position: fixed; left: 50%; bottom: .65rem; z-index: 9; transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, 1fr); gap: .2rem; width: min(calc(100% - 1.25rem), 34rem); padding: .4rem; border: 1px solid var(--line); background: rgba(251, 247, 239, .94); backdrop-filter: blur(10px); box-shadow: 0 14px 36px rgba(42, 42, 40, .14); }
.shelf-nav button { display: grid; justify-items: center; gap: .2rem; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; padding: .45rem .2rem; }
.shelf-nav button.is-active { background: var(--accent-soft); color: var(--accent); }
.import-sheet { width: min(calc(100% - 1.5rem), 28rem); border: 0; padding: 0; background: transparent; }
.import-sheet::backdrop { background: rgba(42, 42, 40, .42); }
.import-sheet-inner { display: grid; gap: .85rem; padding: 1.35rem; }
.import-option { width: 100%; }
.import-progress { min-height: 1.4rem; margin: 0; color: var(--accent); font-weight: 700; }
@media (min-width: 960px) {
  body.shelf-body:not(.workspace-shell) { padding-bottom: 1.5rem; }
  body:not(.workspace-shell) .paper-app { grid-template-columns: 15.5rem minmax(0, 1.4fr) 15.5rem; gap: 0; min-height: 100vh; width: min(100%, 88rem); }
  body:not(.workspace-shell) .identity-card { display: none; }
  body:not(.workspace-shell) .paper-context {
    display: flex; flex-direction: column; gap: .85rem; position: sticky; top: 0; align-self: start;
    min-height: 100vh; padding: 1.25rem 1rem 1.5rem; border-left: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,.28), transparent 28%), var(--sheet);
  }
  body:not(.workspace-shell) .paper-rail { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; align-self: start; min-height: 100vh; padding: 1.25rem .85rem 1.5rem; border-right: 1px solid var(--line); background: linear-gradient(90deg, rgba(42,42,40,.04) 0 10px, transparent 10px), linear-gradient(180deg, rgba(255,255,255,.25), transparent 30%), var(--sheet); box-shadow: 8px 0 24px rgba(42, 42, 40, .04); }
  .paper-rail-brand { display: flex; align-items: center; gap: .55rem; padding: .35rem .55rem; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.7rem; font-weight: 700; color: var(--accent); }
  .paper-rail-nav { display: grid; gap: .35rem; }
  .paper-rail-nav button { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .7rem .75rem; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
  .paper-rail-nav button.is-active { background: var(--accent-soft); }
  .paper-rail-label { margin: .4rem .55rem .35rem; font-size: .68rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .rail-collection-list { display: grid; gap: .2rem; }
  .rail-collection { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .55rem; width: 100%; padding: .55rem .65rem; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: .92rem; text-align: left; cursor: pointer; }
  .rail-collection[aria-pressed="true"] { background: rgba(63, 93, 74, .1); }
  .rail-collection-count { color: var(--muted); font-size: .8rem; font-weight: 700; }
  .paper-rail-clef { margin: auto .75rem .25rem; opacity: .28; }
  .paper-import { width: calc(100% - 1rem); margin: .5rem .5rem 0; }
  .shelf-nav.paper-bottom-nav { display: none; }
  .library-counts { grid-template-columns: repeat(4, 1fr); }
  .collection-shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .source-card, .shelf-source-card { grid-template-columns: 1fr auto; align-items: center; }
}
@media (max-width: 900px) { .import-panel { grid-template-columns: 1fr; } .supported { grid-column: 1; text-align: left; } .library-grid { grid-template-columns: 1fr 1fr; } .section-heading { align-items: start; flex-direction: column; } .display-controls, .lab-settings { grid-template-columns: 1fr 1fr; } .experiment-layout, .projection-comparison { grid-template-columns: 1fr; } .experiment-pipeline { grid-template-columns: 1fr; } .transport { grid-template-columns: 1fr; } .source-form, .artifact-row { grid-template-columns: 1fr; } }
@media (max-width: 560px) { main { width: 100%; padding: .5rem; } .metadata-grid, .library-grid, .display-controls, .evidence-grid, .resource-form { grid-template-columns: 1fr; } .score-card { padding: 1rem; } .collection-shelf, .expression-shelf, .artifact-shelf, .shelf-filter-row { grid-template-columns: 1fr; } }

.identity-card { display: grid; gap: .55rem; padding: 1.1rem 1.15rem; margin-bottom: .25rem; }
.identity-instruments { display: flex; flex-wrap: wrap; gap: .45rem; }
.identity-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .55rem; border: 1px solid var(--line); background: rgba(255,255,255,.5); font-size: .85rem; font-weight: 700; }
.primary-shelf-banner { padding: 1rem 1.1rem; }
.paper-context { display: none; }
.context-headline { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.7rem; }
.context-block { padding-top: .55rem; border-top: 1px solid rgba(217, 208, 193, .85); }
.context-block h3 { margin: 0 0 .35rem; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.context-list { margin: 0; padding-left: 1.1rem; color: var(--ink); }
.rail-profile { padding: .35rem .55rem 0.75rem; border-bottom: 1px solid rgba(217, 208, 193, .85); }
.rail-profile-name { margin: .15rem 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.45rem; font-weight: 700; }
.profile-instruments-field { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .75rem; border: 1px solid var(--line); padding: .85rem; }
.profile-instruments-field label { display: flex; align-items: center; gap: .45rem; font-size: .92rem; }
.profile-sheet .import-sheet-inner { max-height: min(85vh, 40rem); overflow: auto; }
@media (min-width: 960px) {
  .rail-profile { display: grid; gap: .35rem; }
}
@media (max-width: 959px) {
  .rail-profile { display: none; }
}
/* CRES-UX-004 ereader */
body.ereader-library {
  --ink: #2f2b26;
  --muted: #7a7368;
  --sheet: #faf6ee;
  --paper: #f3ebe0;
  --line: #e0d5c4;
  --accent: #4a6354;
  --accent-soft: #e4eee7;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-weight: 400;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.5), transparent 42rem),
    radial-gradient(circle at 90% 10%, rgba(210, 190, 150, .18), transparent 28rem),
    linear-gradient(180deg, #f7f1e6 0%, #efe6d8 100%);
}
body.ereader-library .shelf-topbar h1,
body.ereader-library .shelf-section h3,
body.ereader-library .shelf-screen > h2,
body.ereader-library .work-view h3,
body.ereader-library .book-cover strong,
body.ereader-library .collection-card strong,
body.ereader-library .rail-profile-name,
body.ereader-library .context-headline {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
}
body.ereader-library .shelf-topbar h1 {
  font-size: clamp(2.8rem, 8vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: .92;
}
.greeting-line {
  margin: 0 0 .35rem;
  color: var(--accent);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-style: italic;
  font-weight: 500;
}
.ereader-opening { max-width: 42rem; padding-bottom: 1.75rem; }
.ereader-search {
  max-width: 40rem; margin: 0 auto; justify-content: flex-start;
  min-height: 3.6rem; border-radius: 0; box-shadow: 0 10px 28px rgba(47, 43, 38, .06);
}
.music-room-cover {
  border: 0; background: transparent; box-shadow: none; clip-path: none;
  padding: .25rem 0 1rem; margin: 0;
}
.music-room-cover .eyebrow { letter-spacing: .18em; font-weight: 600; }
.continue-reading {
  display: grid; gap: .45rem; max-width: 36rem; padding: 1.25rem 1.35rem;
  border: 1px solid var(--line); background: var(--sheet);
  box-shadow: 0 12px 30px rgba(47, 43, 38, .05);
}
.continue-reading[hidden] { display: none !important; }
.ereader-quiet-meta {
  border: 0; background: transparent; box-shadow: none; clip-path: none; padding: .25rem 0;
}
.ereader-quiet-meta .library-counts > div {
  border: 0; background: transparent; padding: .35rem 0;
}
.ereader-quiet-meta .library-counts dd {
  font-weight: 500; font-size: 1.55rem;
}
.book-shelf {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1rem;
}
.shelf-folder {
  position: relative;
  min-height: 9.5rem; padding: 1.15rem 1rem 1rem;
  border: 1px solid var(--line); background: linear-gradient(165deg, #fffdf8, var(--sheet));
  box-shadow: 0 8px 20px rgba(47, 43, 38, .05);
  clip-path: none;
  transform: none !important;
}
.shelf-folder::before {
  content: ""; position: absolute; top: -7px; left: 12px; width: 42%; height: 8px;
  background: rgba(224, 213, 196, .95); border: 1px solid var(--line); border-bottom: 0;
}
.book-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 1rem;
}
.book-cover {
  position: relative; min-height: 11.5rem; padding: 1.15rem 1rem 1rem 1.25rem;
  border: 1px solid var(--line); background: linear-gradient(180deg, #fffdf9, #f4ebe0);
  box-shadow: 0 14px 28px rgba(47, 43, 38, .07); clip-path: none;
}
.book-cover-spine {
  position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
  background: linear-gradient(90deg, rgba(74, 99, 84, .35), rgba(74, 99, 84, .08));
}
.book-cover strong { font-size: 1.35rem; font-weight: 600; line-height: 1.15; }
.reading-page {
  max-width: 44rem; margin: 0 auto; padding: 1.5rem 1.35rem 2rem;
  border: 1px solid var(--line); background: var(--sheet);
  box-shadow: 0 18px 40px rgba(47, 43, 38, .06);
}
.edition-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .85rem;
}
.edition-tile, .expression-card {
  min-height: 7rem; border: 1px solid var(--line); background: #fffdf8;
  box-shadow: 0 6px 16px rgba(47, 43, 38, .04);
}
.paper-empty { padding: 2.5rem 1.5rem; gap: 1rem; }
.paper-empty > p:first-of-type {
  font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.7rem; font-weight: 500;
}
body.ereader-library .touch-primary,
body.ereader-library .touch-secondary,
body.ereader-library .paper-import {
  min-height: 44px; font-weight: 600; letter-spacing: .01em;
}
body.ereader-library .shelf-nav button,
body.ereader-library .collection-card,
body.ereader-library .shelf-work-card,
body.ereader-library .shelf-search-launch {
  min-height: 44px;
}
body.ereader-library .badge { font-weight: 600; opacity: .8; }
@media (min-width: 960px) {
  body.ereader-library:not(.workspace-shell) .paper-app {
    grid-template-columns: 13rem minmax(0, 1fr) 13.5rem;
    width: min(100%, 96rem);
  }
  body.ereader-library:not(.workspace-shell) .paper-rail {
    opacity: .92; box-shadow: none; background: rgba(250, 246, 238, .72);
  }
  body.ereader-library .paper-stage { padding: 1.5rem 2rem 3rem; }
  body.ereader-library:not(.workspace-shell) .paper-context {
    opacity: .9; background: rgba(250, 246, 238, .55); box-shadow: none;
  }
  body.ereader-library .identity-card { display: none; }
  body.ereader-library .book-row { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
  body.ereader-library .book-shelf { grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }
}
@media (max-width: 959px) {
  body.ereader-library .paper-app { width: 100%; }
  body.ereader-library .paper-stage { padding: 1rem 1rem 2.5rem; }
  body.ereader-library .ereader-search { max-width: none; }
}

/* CRES-UX-005 quiet musical identity + CRES-UX-006 bookshelf shell */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
body.bookshelf-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 0;
}
body.bookshelf-shell .app-chrome {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: .75rem 1.25rem;
  width: min(100%, 96rem);
  margin: 0 auto;
  padding: .65rem 1rem;
  border-bottom: 1px solid rgba(224, 213, 196, .85);
  background: rgba(250, 246, 238, .92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 12;
}
.chrome-leading,
.chrome-trailing {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}
.chrome-brand {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .02em;
}
.chrome-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem;
}
.chrome-nav button {
  min-height: 44px;
  padding: .45rem .9rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.chrome-nav button.is-active,
.chrome-nav button[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}
.chrome-about {
  min-height: 44px;
  padding: .45rem .7rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.identity-control {
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: 44px; padding: .45rem .8rem;
  border: 1px solid transparent; background: transparent;
  color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
}
.identity-control:hover,
.identity-control:focus-visible,
.chrome-about:hover,
.chrome-about:focus-visible {
  border-color: var(--line); background: rgba(255, 255, 255, .45);
}
.identity-dot {
  width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px rgba(74, 99, 84, .15);
}
.identity-panel .import-sheet-inner { gap: 1rem; }
.shelf-drawer-open,
.shelf-drawer-close {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
  padding: .4rem .7rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .55);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.music-shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.music-shelf-head .paper-rail-label { margin: 0; }
.music-shelf .paper-rail-label {
  margin: 0 0 .35rem .35rem;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.music-shelf .rail-collection-list { display: grid; gap: .2rem; }
.music-shelf .rail-collection {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .55rem .65rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .92rem;
  text-align: left;
  cursor: pointer;
}
.music-shelf .rail-collection[aria-pressed="true"] { background: rgba(63, 93, 74, .1); }
.music-shelf .rail-collection-count { color: var(--muted); font-size: .8rem; font-weight: 700; }
.music-shelf .paper-rail-clef { margin: auto .75rem .25rem; opacity: .28; }
.music-shelf .paper-import { width: calc(100% - 1rem); margin: .5rem .5rem 0; }
.shelf-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 14;
  background: rgba(47, 43, 38, .35);
  border: 0;
}
body.quiet-identity .paper-context { display: none; }
body.quiet-identity .identity-card,
body.quiet-identity .rail-profile { display: none !important; }

/* Portrait / phone: legacy custom drawer ? disabled under workspace-shell (Bootstrap Offcanvas owns it). */
@media (max-width: 959px) {
  body.bookshelf-shell:not(.workspace-shell) .app-chrome {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  body.bookshelf-shell:not(.workspace-shell) .chrome-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    order: 3;
  }
  body.bookshelf-shell:not(.workspace-shell) .paper-app {
    width: 100%;
    padding-bottom: 5rem;
  }
  body.bookshelf-shell:not(.workspace-shell) .paper-import-mobile {
    bottom: 1.25rem;
  }
  body.bookshelf-shell:not(.workspace-shell) .music-shelf {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 15;
    width: min(18.5rem, 86vw);
    padding: 1rem .85rem 1.25rem;
    border-right: 1px solid var(--line);
    background: var(--sheet);
    box-shadow: 16px 0 40px rgba(47, 43, 38, .18);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  body.bookshelf-shell:not(.workspace-shell).shelf-drawer-open .music-shelf {
    transform: translateX(0);
  }
  body.bookshelf-shell:not(.workspace-shell) .shelf-drawer-backdrop[hidden] {
    display: none !important;
  }
}

@media (min-width: 960px) {
  body.bookshelf-shell:not(.workspace-shell) .shelf-drawer-open,
  body.bookshelf-shell:not(.workspace-shell) .shelf-drawer-close,
  body.bookshelf-shell:not(.workspace-shell) .shelf-drawer-backdrop {
    display: none !important;
  }
  body.bookshelf-shell:not(.workspace-shell) .paper-app {
    width: min(100%, 96rem);
    margin: 0 auto;
    min-height: calc(100vh - 4.5rem);
  }
  body.quiet-identity.ereader-library:not(.workspace-shell) .paper-app,
  body.bookshelf-shell.quiet-identity.ereader-library:not(.workspace-shell) .paper-app {
    grid-template-columns: 14.5rem minmax(0, 1fr);
  }
  body.bookshelf-shell:not(.workspace-shell) .music-shelf {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 4.5rem;
    align-self: start;
    max-height: calc(100vh - 4.5rem);
    overflow: auto;
    padding: 1.25rem .85rem 1.5rem;
    border-right: 1px solid var(--line);
    background: rgba(250, 246, 238, .72);
  }
  body.bookshelf-shell .chrome-brand { font-size: 1.85rem; }
  body.bookshelf-shell .paper-import { width: calc(100% - 1rem); margin: .5rem .5rem 0; }
}

/* CRES-UX-007 ? Responsive Workspace Layout (Room / Bookshelf / Reading Desk) */
body.workspace-shell {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
}
body.workspace-shell .room-chrome,
body.workspace-shell .app-chrome {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: .55rem 1rem;
  border-radius: 0;
}
body.workspace-shell .chrome-lab-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
  padding: .45rem .85rem;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}
body.workspace-shell .chrome-lab-link:hover,
body.workspace-shell .chrome-lab-link:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
}
body.workspace-shell .workspace-app,
body.workspace-shell .paper-app {
  /* Bootstrap .row owns Bookshelf | Reading Desk. Do not CSS-grid the main ?
     that left the desk empty (second column blank) after the Bootstrap migration. */
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 0;
  height: calc(100vh - 3.75rem);
  height: calc(100dvh - 3.75rem);
  padding: 0;
  overflow: hidden;
}
body.workspace-shell .workspace-app > .row,
body.workspace-shell .paper-app > .row {
  height: 100%;
  min-height: 0;
  margin: 0;
}
/* Bookshelf rail must paint: .paper-rail defaults to display:none for legacy layouts. */
body.workspace-shell .music-shelf.paper-rail,
body.workspace-shell .bookshelf.paper-rail {
  display: flex;
  flex-direction: column;
}
body.workspace-shell .bookshelf-pane {
  min-width: 0;
}
/* CRES-UX-009: below lg, Bootstrap Offcanvas owns the shelf ? no custom drawer transforms. */
@media (max-width: 991.98px) {
  body.workspace-shell .bookshelf-pane {
    width: 0 !important;
    max-width: 0 !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }
  body.workspace-shell .music-shelf.paper-rail,
  body.workspace-shell .bookshelf.paper-rail {
    /* Do not force display:flex here ? Bootstrap Offcanvas controls visibility. */
    display: flex;
    transform: none;
  }
  body.workspace-shell .shelf-menu-toggle.navbar-toggler {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.55rem;
    border-color: var(--line);
  }
}
@media (min-width: 992px) {
  body.workspace-shell .bookshelf-pane {
    width: clamp(13.5rem, 15vw, 18rem) !important;
    max-width: none !important;
    flex: 0 0 auto;
    border-right: 1px solid var(--line);
    background: rgba(250, 246, 238, 0.72);
  }
  body.workspace-shell .music-shelf.paper-rail,
  body.workspace-shell .bookshelf.paper-rail {
    display: flex !important;
    visibility: visible !important;
    transform: none !important;
    height: 100%;
    width: 100%;
    position: relative !important;
  }
  body.workspace-shell .shelf-menu-toggle {
    display: none !important;
  }
}
body.workspace-shell .reading-desk,
body.workspace-shell .paper-stage {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 1rem 1rem 5.5rem;
}
body.workspace-shell .ereader-opening,
body.workspace-shell .continue-reading,
body.workspace-shell .ereader-search,
body.workspace-shell .reading-page {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
}
body.workspace-shell .shelf-topbar #welcome-message {
  max-width: 42rem;
}
/* VSS / future visualization is an optional Lumen asset, never a page column. */
body.workspace-shell .workspace-pane[hidden] {
  display: none !important;
}
body.workspace-shell .collection-shelf,
body.workspace-shell .book-shelf,
body.workspace-shell .book-row,
body.workspace-shell .expression-shelf,
body.workspace-shell .artifact-shelf,
body.workspace-shell .edition-row {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr));
  width: 100%;
}
body.workspace-shell .library-search-form,
body.workspace-shell .shelf-search-form,
body.workspace-shell .sources-explorer-form,
body.workspace-shell .shelf-source-form {
  width: 100%;
  max-width: none;
}
body.workspace-shell .sources-explorer-list,
body.workspace-shell .source-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
  width: 100%;
}
body.workspace-shell .reading-panel,
body.workspace-shell .collection-sources,
body.workspace-shell .musical-works,
body.workspace-shell .shelf-section,
body.workspace-shell .shelf-screen {
  width: 100%;
  max-width: none;
}
body.workspace-shell .works-list {
  width: 100%;
}

@media (max-width: 959px) {
  body.workspace-shell .collection-shelf,
  body.workspace-shell .book-shelf,
  body.workspace-shell .book-row {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
  }
  body.workspace-shell .reading-desk,
  body.workspace-shell .paper-stage {
    padding: 1rem 1rem 5.5rem;
  }
}

@media (max-width: 560px) {
  body.workspace-shell .collection-shelf,
  body.workspace-shell .book-shelf,
  body.workspace-shell .book-row,
  body.workspace-shell .sources-explorer-list,
  body.workspace-shell .source-list {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  }
}

@media (min-width: 960px) {
  /* Neutralize pre-Bootstrap grid that treated shelf + desk as paper-app children. */
  body.workspace-shell.bookshelf-shell .paper-app,
  body.workspace-shell.quiet-identity.ereader-library .paper-app,
  body.workspace-shell.bookshelf-shell.quiet-identity.ereader-library .paper-app,
  body.workspace-shell.workspace-split .paper-app {
    display: block;
    grid-template-columns: none;
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 0;
    height: calc(100vh - 3.75rem);
    height: calc(100dvh - 3.75rem);
  }
  body.workspace-shell .music-shelf,
  body.workspace-shell .bookshelf {
    position: relative;
    top: auto;
    height: 100%;
    max-height: none;
    overflow: auto;
    width: auto;
    min-width: 0;
  }
  body.workspace-shell .reading-desk,
  body.workspace-shell .paper-stage {
    padding: 1.35rem 1.75rem 2rem;
  }
  body.workspace-shell .collection-shelf,
  body.workspace-shell .book-shelf {
    grid-template-columns: repeat(auto-fill, minmax(9.25rem, 1fr));
  }
  body.workspace-shell .book-row {
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  }
}

@media (min-width: 1400px) {
  body.workspace-shell .collection-shelf,
  body.workspace-shell .book-shelf {
    grid-template-columns: repeat(auto-fill, minmax(8.75rem, 1fr));
  }
  body.workspace-shell .book-row {
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  }
  body.workspace-shell .reading-desk,
  body.workspace-shell .paper-stage {
    padding: 1.5rem 2.25rem 2.25rem;
  }
}

@media (min-width: 1800px) {
  body.workspace-shell .collection-shelf,
  body.workspace-shell .book-shelf {
    grid-template-columns: repeat(auto-fill, minmax(8.25rem, 1fr));
  }
}

/* CRES-WORK-LAB-001 ? Musical Work Laboratory (musician desk) */
body.work-lab-shell {
  padding-bottom: 0;
}
body.work-lab-shell .work-lab-app {
  max-width: none;
  margin: 0;
  min-height: calc(100vh - 3.75rem);
  min-height: calc(100dvh - 3.75rem);
  padding: 0;
}
.work-lab-status {
  margin: 0;
  padding: .45rem 1rem;
  font-size: .85rem;
  color: var(--muted, #6a655c);
  border-bottom: 1px solid var(--line, #d9d0c1);
  background: rgba(251, 247, 239, .92);
}
.work-chooser {
  max-width: 42rem;
  margin: 2.5rem auto;
  padding: 1.75rem 2rem 2rem;
  border: 1px solid var(--line, #d9d0c1);
  border-radius: 1rem;
  background: var(--sheet, #fbf7ef);
}
.work-chooser-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.work-chooser-path {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  padding: 1.1rem 1.25rem;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.work-chooser-path input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.work-chooser-note { font-size: .78rem; font-weight: 500; opacity: .75; }
.work-musicxml-drop {
  display: grid;
  place-items: center;
  min-height: 88px;
  border: 2px dashed var(--tape, #cbb896);
  border-radius: .85rem;
  color: var(--accent, #3f5d4a);
  background: rgba(255,255,255,.55);
}
.work-musicxml-drop[data-dragging="true"] {
  border-color: var(--accent, #3f5d4a);
  background: var(--accent-soft, #dce8e0);
}
body.work-lab-open .work-lab-status,
body.explore-open .work-lab-status { position: sticky; top: 3.5rem; z-index: 2; }
.explore-workspace {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 0 1.5rem;
  min-height: calc(100vh - 6.5rem);
  min-height: calc(100dvh - 6.5rem);
}
.explore-workspace-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 .25rem;
}
.explore-actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.explore-workspace-grid {
  display: grid;
  grid-template-columns: minmax(11rem, 14rem) minmax(12rem, 16rem) minmax(0, 1fr) minmax(13rem, 16rem);
  gap: 0;
  flex: 1;
  min-height: 0;
  border-top: 1px solid var(--line, #d9d0c1);
}
.explore-artifacts,
.explore-dimensions,
.explore-inspector {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: 1rem .9rem 1.25rem;
  background: rgba(244, 239, 230, .96);
  min-height: 0;
}
.explore-artifacts { border-right: 1px solid var(--line, #d9d0c1); }
.explore-dimensions { border-right: 1px solid var(--line, #d9d0c1); overflow: auto; }
.explore-score { border-right: 1px solid var(--line, #d9d0c1); }
.explore-artifact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  overflow: auto;
}
.explore-artifact-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  padding: .55rem .65rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  font: inherit;
}
.explore-artifact-item span { font-size: .78rem; opacity: .75; }
.explore-artifact-item[aria-current="true"] {
  border-color: var(--accent, #3f5d4a);
  background: var(--accent-soft, #dce8e0);
}
.explore-add-more { position: relative; overflow: hidden; }
.explore-add-more input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.explore-dimension-list { display: flex; flex-direction: column; gap: .55rem; }
.explore-dimension {
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  padding: .55rem .65rem;
}
.explore-dimension h3 {
  margin: 0 0 .2rem;
  font-size: .95rem;
  font-family: "Cormorant Garamond", Georgia, serif;
}
.explore-dimension p { margin: 0; font-size: .8rem; }
.explore-dimension-status {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .68rem !important;
  font-weight: 700;
  color: var(--accent, #3f5d4a);
}
.explore-dimension-missing .explore-dimension-status { color: #8a6a3d; }
.explore-dimension-disagreement .explore-dimension-status { color: #8a3d3d; }
.explore-dimension-unsupported .explore-dimension-status { color: #666; }
@media (max-width: 1100px) {
  .explore-workspace-grid {
    grid-template-columns: 1fr 1fr;
  }
  .explore-score, .explore-inspector { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .explore-workspace-grid { grid-template-columns: 1fr; }
}

.work-laboratory {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr) minmax(14rem, 17rem);
  min-height: calc(100vh - 6.5rem);
  min-height: calc(100dvh - 6.5rem);
  align-items: stretch;
}
.work-lab-explorer,
.work-lab-inspector {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: 1rem .9rem 1.25rem;
  background: rgba(244, 239, 230, .96);
}
.work-lab-explorer { border-right: 1px solid var(--line, #d9d0c1); }
.work-lab-inspector { border-left: 1px solid var(--line, #d9d0c1); }
.work-panel-label {
  margin: 0;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent, #3f5d4a);
}
.work-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.15;
}
.work-object-tree { flex: 1; overflow: auto; min-height: 0; }
.work-explorer-summary {
  margin: 0;
  padding-top: .75rem;
  border-top: 1px solid var(--line, #d9d0c1);
  font-size: .78rem;
  color: var(--muted, #6a655c);
}
.work-lab-score {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,.55), transparent 28rem),
    linear-gradient(180deg, #f7f2e8 0%, #efe8dc 100%);
}
.work-score-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 1rem;
  border-bottom: 1px solid var(--line, #d9d0c1);
  background: rgba(251, 247, 239, .88);
}
.work-score-label {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted, #6a655c);
}
.work-reproject-label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink, #2a2a28);
}
.work-reproject-label select {
  min-width: 5.5rem;
  border: 1px solid var(--line, #d9d0c1);
  border-radius: .45rem;
  background: #fff;
  padding: .25rem .4rem;
  font: inherit;
}
.work-projection-surface {
  flex: 1;
  overflow: auto;
  padding: 1.75rem 1.5rem 2.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.work-living-score {
  width: max-content;
  max-width: 100%;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line, #d9d0c1);
  border-radius: .35rem;
  background: #fbf7ef;
  box-shadow: 0 18px 40px rgba(42, 42, 40, .06);
}
.work-living-score svg { display: block; max-width: none; height: auto; }
.work-inspector-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
}
.work-inspector-tab {
  border: 1px solid var(--line, #d9d0c1);
  background: transparent;
  color: var(--muted, #6a655c);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  padding: .45rem .5rem;
  border-radius: .45rem;
}
.work-inspector-tab[aria-selected="true"] {
  background: #fff;
  color: var(--ink, #2a2a28);
  border-color: var(--accent, #3f5d4a);
}
.work-lens { flex: 1; overflow: auto; min-height: 0; padding: .35rem 0 0; }
.work-tree-root, .work-tree-children { list-style: none; margin: 0; padding: 0; }
.work-tree-children { padding-left: .75rem; margin-top: .1rem; border-left: 1px solid var(--line, #d9d0c1); }
.work-tree-node {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .88rem;
  padding: .28rem .35rem;
  border-radius: .35rem;
}
.work-tree-node:hover, .work-tree-node:focus-visible { background: rgba(255,255,255,.7); }
.work-tree-node[aria-current="true"] { background: #fff; font-weight: 600; box-shadow: inset 2px 0 0 var(--accent, #3f5d4a); }
.work-lens-question { color: var(--muted, #6a655c); font-size: .86rem; margin: 0 0 .75rem; }
.work-lens-object { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.2rem; font-weight: 600; margin: 0; }
.work-lens-kind { margin: 0 0 .75rem; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted, #6a655c); }
.work-lens-empty { color: var(--muted, #6a655c); margin: 0; line-height: 1.45; }
.work-lens-dl { display: grid; grid-template-columns: minmax(5.5rem, 38%) 1fr; gap: .3rem .55rem; margin: 0; font-size: .86rem; }
.work-lens-dl dt { color: var(--muted, #6a655c); font-weight: 600; }
.work-lens-dl dd { margin: 0; overflow-wrap: anywhere; }
.work-provenance {
  margin: 1rem 0 0;
  padding-top: .75rem;
  border-top: 1px solid var(--line, #d9d0c1);
  color: var(--accent, #3f5d4a);
  font-size: .86rem;
  line-height: 1.4;
}
.work-claim-list { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
@media (max-width: 1100px) {
  .work-laboratory { grid-template-columns: minmax(11rem, 13rem) minmax(0, 1fr) minmax(12rem, 14rem); }
}
@media (max-width: 900px) {
  .work-chooser-paths { grid-template-columns: 1fr; }
  .work-laboratory {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(50vh, 1fr) auto;
  }
  .work-lab-explorer, .work-lab-inspector {
    border: 0;
    border-bottom: 1px solid var(--line, #d9d0c1);
    max-height: 40vh;
  }
}

/* AML Reference ? official specification + MusicXML harness */
.aml-shell .aml-app {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: calc(100vh - 4rem);
}
.aml-header h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: .2rem 0 .5rem;
}
.aml-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}
.aml-mode-tab {
  font: inherit;
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  padding: .45rem .85rem;
}
.aml-mode-tab.is-active {
  border-color: var(--accent, #3f5d4a);
  background: var(--accent-soft, #dce8e0);
}
.aml-source-actions, .aml-translate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  grid-column: 1 / -1;
}
.aml-reference-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 0.9fr) minmax(18rem, 1.2fr) minmax(18rem, 1.2fr);
  grid-template-areas:
    "families cards detail"
    "coverage coverage coverage";
  gap: 1rem;
  flex: 1;
  min-height: 0;
}
.aml-lab-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(20rem, 1.3fr) minmax(16rem, 1fr);
  gap: 1rem;
  flex: 1;
  min-height: 0;
}
.aml-col-families { grid-area: families; }
.aml-col-cards { grid-area: cards; }
.aml-col-detail { grid-area: detail; }
.aml-col-coverage { grid-area: coverage; min-height: 10rem; }
.aml-panel {
  border: 1px solid var(--line, #d9d0c1);
  background: rgba(255, 252, 247, .96);
  padding: 1rem;
  min-height: 16rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-width: 0;
}
.aml-panel h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
}
.aml-panel-lede { margin: 0; font-size: .8rem; opacity: .75; }
.aml-panel-body { flex: 1; overflow: auto; min-height: 0; }
.aml-family-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.aml-family-btn {
  width: 100%;
  font: inherit;
  text-align: left;
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  padding: .55rem .65rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.aml-family-btn span { font-size: .75rem; opacity: .8; }
.aml-family-btn small { font-size: .7rem; opacity: .65; }
.aml-family-btn[aria-current="true"],
.aml-ref-card[aria-current="true"],
.aml-tree-btn[aria-current="true"] {
  border-color: var(--accent, #3f5d4a);
  background: var(--accent-soft, #dce8e0);
}
.aml-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: .65rem;
}
.aml-ref-card {
  font: inherit;
  text-align: left;
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-height: 9rem;
}
.aml-ref-glyph {
  font-size: 1.6rem;
  line-height: 1;
  font-family: "Cormorant Garamond", Georgia, serif;
}
.aml-ref-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
}
.aml-ref-status { font-size: .8rem; }
.aml-ref-question { font-size: .72rem; opacity: .8; }
.aml-status-planned { opacity: .92; }
.aml-express-callout {
  margin: .35rem 0 .75rem;
  padding: .55rem .65rem;
  border: 1px solid var(--line, #d9d0c1);
  background: #f7f3eb;
}
.aml-canonical-dl {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr);
  gap: .45rem .75rem;
  margin: 0;
}
.aml-canonical-dl dt {
  margin: 0;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .7;
}
.aml-canonical-dl dd { margin: 0; }
.aml-canonical-dl code, .aml-concept-card code {
  font-size: .78rem;
  word-break: break-word;
}
.aml-coverage-meter { margin-bottom: .65rem; }
.aml-translation-summary {
  margin: 0 0 .75rem;
  padding: .65rem .75rem;
  border: 1px solid var(--accent, #3f5d4a);
  background: var(--accent-soft, #dce8e0);
  font-weight: 600;
}
.aml-coverage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: .45rem;
}
.aml-coverage-list li {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  font-size: .86rem;
}
.aml-coverage-list small { opacity: .75; font-size: .75rem; }
.aml-evidence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.aml-chip-id, .aml-concept-id, .aml-badge-id {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .72rem;
  letter-spacing: .02em;
  opacity: .8;
}
.aml-concept-card h3, .aml-concept-card h4 {
  font-family: "Cormorant Garamond", Georgia, serif;
  margin: 0 0 .5rem;
}
.aml-concept-card h4 { font-size: 1.05rem; margin-top: .85rem; }
.aml-glyph { font-weight: 500; opacity: .85; }
.aml-meaning, .aml-representation, .aml-evidence-lens, .aml-canonical { margin-top: .35rem; }
.aml-evidence-list li {
  display: flex;
  gap: .45rem;
  align-items: baseline;
  font-size: .9rem;
}
.aml-evidence-list li span { min-width: 1.1rem; }
.aml-source-snippet, .aml-unknown-xml {
  margin: .65rem 0 0;
  padding: .55rem .65rem;
  font-size: .72rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f3eb;
  border: 1px solid var(--line, #d9d0c1);
}
.aml-source-full { max-height: 70vh; }
.aml-tree-root, .aml-tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
}
.aml-tree-children { margin-left: .85rem; border-left: 1px solid var(--line, #d9d0c1); padding-left: .55rem; }
.aml-tree-btn {
  width: 100%;
  font: inherit;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  padding: .35rem .45rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  align-items: baseline;
}
.aml-tree-btn strong { flex: 1 1 auto; }
.aml-tree-btn span { font-size: .75rem; opacity: .75; }
.aml-badge {
  font-size: .68rem;
  padding: .1rem .35rem;
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
}
.aml-badge-unknown {
  border-color: #8a6a2f;
  background: #f4e6c8;
  color: #5c4314;
}
.aml-tree-unknown .aml-tree-btn { background: rgba(244, 230, 200, .35); }
.aml-understanding-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 0.9fr) minmax(18rem, 1.3fr) minmax(16rem, 1.1fr);
  grid-template-areas: "nav graph entity";
  gap: 1rem;
  flex: 1;
  min-height: 0;
}
.aml-col-nav { grid-area: nav; }
.aml-col-graph { grid-area: graph; }
.aml-col-entity { grid-area: entity; }
.aml-graph-board {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: .75rem 0;
}
.aml-graph-node {
  font: inherit;
  text-align: left;
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  border-radius: 999px;
  padding: .55rem .85rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 7rem;
}
.aml-graph-node[aria-current="true"] {
  border-color: var(--accent, #3f5d4a);
  background: var(--accent-soft, #dce8e0);
}
.aml-graph-node span { font-size: .72rem; opacity: .75; }
.aml-edge-list {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-size: .78rem;
  font-family: ui-monospace, Consolas, monospace;
}
.aml-seed-list { margin-top: 1rem; }
.understanding-truth .understanding-stat {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  margin: 0;
}
[data-feature-hidden="true"] { display: none !important; }
.home-intent-nav {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-width: 36rem;
  margin: 0.5rem 0 2rem;
}
.home-intent {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  text-align: left;
  font: inherit;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  padding: 1rem 1.1rem;
}
.import-outcome {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.25rem;
}
.import-verify {
  display: grid;
  gap: .85rem;
  margin: 0 0 1.25rem;
}
.import-verify-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
}
.verify-measure-label {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.15rem;
  min-width: 7rem;
  text-align: center;
}
.import-verify-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 900px) {
  .import-verify-panes { grid-template-columns: 1fr; }
}
.import-verify-pane {
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  padding: .75rem .85rem 1rem;
  min-width: 0;
}
.import-verify-pane h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  margin: 0 0 .65rem;
}
.verify-projection {
  overflow: auto;
  max-height: min(42vh, 28rem);
}
.score-measure-active {
  outline: 2px solid var(--accent, #3f5d4a);
  outline-offset: 4px;
}
.verify-match-status {
  margin: 0;
  font-size: 1.05rem;
}
.verify-match-status[data-tone="ok"] { color: var(--accent, #3f5d4a); }
.verify-match-status[data-tone="warn"] { color: #8a5a2b; }
.verify-mismatch-why {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: .35rem;
}
.import-identity-strip {
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  padding: 1rem 1.1rem;
  margin: 0 0 1.25rem;
}
.import-identity-strip h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  margin: 0 0 .75rem;
}
.import-identity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .75rem 1rem;
}
.import-identity-grid label {
  display: grid;
  gap: .3rem;
  font-size: .85rem;
  color: var(--ink-muted, #5c574e);
}
.import-identity-grid input {
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  padding: .45rem .55rem;
  font: inherit;
  color: inherit;
}
.import-understood,
.import-next-step {
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  padding: 1rem 1.1rem;
}
.import-understood h3,
.import-next-step h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  margin: 0 0 .65rem;
}
.import-understood-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.import-understood-list li {
  display: grid;
  grid-template-columns: 1.25rem 8.5rem minmax(0, 1fr);
  gap: .45rem .65rem;
  align-items: baseline;
  font-size: .95rem;
}
.import-fact-mark { font-weight: 600; }
.import-understood-list .tone-ok .import-fact-mark { color: var(--accent, #3f5d4a); }
.import-understood-list .tone-partial .import-fact-mark { opacity: .85; }
.import-next-step {
  border-color: var(--accent, #3f5d4a);
  background: var(--accent-soft, #dce8e0);
}
.import-next-need_musicxml,
.import-next-need_structure {
  background: #fff8ef;
  border-color: #d9c4a0;
}
.import-next-step .btn { margin-top: .5rem; }
.import-pipeline-details {
  margin: 0 0 1rem;
  padding: .65rem .85rem;
  border: 1px solid var(--line, #d9d0c1);
}
.import-pipeline-details summary { cursor: pointer; font-weight: 600; }

.home-intent-primary {
  border-color: var(--accent, #3f5d4a);
  background: var(--accent-soft, #dce8e0);
}
.home-intent strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
}
.import-hello {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.import-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  min-height: 18rem;
  padding: 2rem 1.5rem;
  border: 2px dashed var(--line, #d9d0c1);
  background: #fff;
  text-align: center;
}
.import-drop-zone[data-dragging="true"] {
  border-color: var(--accent, #3f5d4a);
  background: var(--accent-soft, #dce8e0);
}
.import-drop-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0;
}
.import-drop-formats { margin: 0; opacity: .8; }
.import-choose-btn input { display: none; }
.import-library-link { margin-top: 1rem; opacity: .75; }
.import-journey-stages {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: .75rem;
}
.import-stage {
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  padding: .85rem .9rem;
}
.import-stage h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.2rem;
  margin: 0 0 .5rem;
}
.import-stage-headline { font-weight: 600; margin: 0 0 .35rem; }
.import-stage-list {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .9rem;
}
.import-stage-item { display: flex; gap: .4rem; }
.import-stage-item.tone-ok span { color: var(--accent, #3f5d4a); }
.import-stage-item.tone-partial span { opacity: .85; }
.import-stage-item.tone-wait span { opacity: .55; }
.import-work-identity {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: .25rem .5rem;
  margin: .5rem 0;
  font-size: .9rem;
}
.import-work-identity dt { margin: 0; opacity: .7; }
.import-work-identity dd { margin: 0; }
html:not(.developer-mode) .import-detail-panel { display: none !important; }

/* Crescendo Knowledge Base */
.home-intent span { opacity: .8; font-size: .95rem; }
.home-intent:hover, .home-intent:focus-visible {
  border-color: var(--accent, #3f5d4a);
  background: var(--accent-soft, #dce8e0);
}
.kb-technical {
  margin-top: 1.5rem;
  padding: .75rem .85rem;
  border: 1px solid var(--line, #d9d0c1);
  background: #f7f3eb;
}
.kb-technical summary {
  cursor: pointer;
  font-weight: 600;
}
.kb-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.developer-mode-toggle.is-on { font-weight: 600; }

/* Crescendo Knowledge Base */
.kb-app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.1rem 2.5rem;
}
.kb-header { margin-bottom: 1rem; }
.kb-header h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.85rem, 3vw, 2.4rem);
  margin: .15rem 0 .45rem;
}
.kb-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(14rem, 18rem) minmax(0, 1fr);
  gap: .85rem;
  align-items: start;
}
.kb-article-grid {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.kb-article-card {
  width: 100%;
  font: inherit;
  text-align: left;
  border: 1px solid var(--line, #d9d0c1);
  background: #fff;
  padding: .65rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.kb-article-card[aria-current="true"] {
  border-color: var(--accent, #3f5d4a);
  background: var(--accent-soft, #dce8e0);
}
.kb-article-card strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.1rem;
}
.kb-article-card span:last-child {
  font-size: .86rem;
  opacity: .85;
}
.kb-article section { margin-top: .85rem; }
.kb-article h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.55rem;
  margin: .2rem 0 .35rem;
}
.kb-article h4 {
  font-size: 1rem;
  margin: 0 0 .35rem;
  font-family: "Cormorant Garamond", Georgia, serif;
}
.kb-summary { font-size: 1.02rem; }
.kb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1rem;
}
@media (max-width: 1100px) {
  .kb-layout { grid-template-columns: 1fr; }
  .aml-reference-layout,
  .aml-lab-layout,
  .aml-understanding-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "families"
      "cards"
      "detail"
      "coverage";
  }
  .aml-understanding-layout {
    grid-template-areas:
      "nav"
      "graph"
      "entity";
  }
  .aml-lab-layout { grid-template-areas: none; }
  .aml-panel { min-height: 12rem; }
}

/* CRES-HOME-001 ? My Music as Home */
.my-music-opening #screen-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.85rem, 3vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0.15rem 0 0.35rem;
}
.library-summary-line { opacity: 0.72; margin: 0; }
.home-search-form { max-width: 42rem; }
.home-search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.home-search-field > .bi-search {
  position: absolute;
  left: 1rem;
  opacity: 0.45;
  pointer-events: none;
}
.home-search-input {
  padding-left: 2.75rem;
  border-radius: 0.85rem;
  border-color: var(--line, #d9d0c1);
  background: #fffef9;
  min-height: 3.25rem;
  font-size: 1.05rem;
}
.continue-playing {
  border-color: var(--line, #d9d0c1);
  background: linear-gradient(180deg, #fffef9 0%, #f7f1e6 100%);
}
.my-music-card .badge { font-weight: 500; text-transform: none; }
.my-music-collections .collection-card {
  min-height: 6.5rem;
  transition: transform 160ms ease, border-color 160ms ease;
}
.my-music-collections .collection-card:hover,
.my-music-collections .collection-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--ink, #3a3228);
}
.chrome-add-music {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding-inline: 0.9rem;
}
.room-engine-room { opacity: 0.92; }
.setlist-card h3 { font-family: "Cormorant Garamond", Georgia, serif; }
.reading-desk.score-open-enter #screen-work.is-active,
.reading-desk.score-open-enter [data-screen-panel="work"].is-active {
  animation: score-open-fade 320ms ease;
}
@keyframes score-open-fade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
body:not(.developer-mode) .room-engine-room { display: none; }

/* CRES-MOBILE-SHELL-001 ? music-stand shell
   CRES-VISUAL-001 ? midnight-blue binding ? cream paper ? music inside */
body.stand-shell {
  --crescendo-blue: #1a2f3d;
  --crescendo-blue-deep: #172a3a;
  --crescendo-blue-mid: #1d3040;
  --crescendo-cream: #f7f3eb;
  --crescendo-cream-sheet: #fffef9;
  --crescendo-paper-edge: #efe8dc;
  --crescendo-sage: #4a6354;
  --crescendo-sage-soft: #e4eee7;
  --crescendo-charcoal: #2f2b26;
  --crescendo-ink: #1c1916;
  --stand-ink: var(--crescendo-charcoal);
  --stand-paper: var(--crescendo-cream);
  --stand-line: #ddd4c6;
  --stand-binding: var(--crescendo-blue);
  --stand-binding-ink: var(--crescendo-cream);
  --stand-accent: var(--crescendo-blue-mid);
  --stand-action: var(--crescendo-sage);
  --stand-footer-height: 2rem;
  --stand-bottom-nav-height: 4.25rem;
  --stand-footer-clearance: 1.75rem;
  --stand-chrome-height: 3.55rem;
  --stand-chrome-gap: 1rem;
  /* Reserve sticky chrome: bottom nav (phone) + footer + breathing room */
  padding-bottom: calc(
    var(--stand-bottom-nav-height)
    + var(--stand-footer-height)
    + var(--stand-footer-clearance)
    + env(safe-area-inset-bottom, 0px)
  );
  background:
    radial-gradient(ellipse at 50% 8%, rgba(255, 254, 249, 0.65), transparent 40rem),
    linear-gradient(180deg, #f8f4ec 0%, var(--stand-paper) 38%, #f1ebe1 100%);
  color: var(--stand-ink);
}
body.stand-shell .bookshelf-pane,
body.stand-shell .paper-import-mobile,
body.stand-shell .paper-context {
  display: none !important;
}
body.stand-shell .stand-layout,
body.stand-shell .stand-app > .row {
  display: block !important;
  width: 100%;
  margin: 0;
}
body.stand-shell .stand-desk,
body.stand-shell .reading-desk {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--stand-chrome-gap, 1rem) 1.1rem 2rem;
}
body.stand-shell .stand-chrome {
  background: linear-gradient(180deg, var(--crescendo-blue-deep) 0%, var(--crescendo-blue) 100%);
  border-bottom: 1px solid rgba(247, 243, 235, 0.08);
  box-shadow: 0 2px 10px rgba(23, 42, 58, 0.22);
  z-index: 1030;
  color: var(--stand-binding-ink);
}
body.stand-shell .stand-chrome-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.55rem max(1.25rem, env(safe-area-inset-right, 0px)) 0.55rem max(1.25rem, env(safe-area-inset-left, 0px));
  min-height: 3.55rem;
}
body.stand-shell .stand-chrome-zone {
  display: flex;
  align-items: center;
  min-width: 0;
}
body.stand-shell .stand-chrome-start {
  justify-content: flex-start;
}
body.stand-shell .stand-chrome-end {
  justify-content: flex-end;
  margin-left: auto;
}
body.stand-shell .stand-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--stand-binding-ink);
  text-decoration: none;
}
body.stand-shell .stand-brand:hover,
body.stand-shell .stand-brand:focus-visible {
  color: #fffef9;
}
body.stand-shell .stand-brand-text {
  display: inline-flex;
  flex-direction: column;
  gap: 0.12rem;
  line-height: 1;
}
body.stand-shell .stand-mark {
  display: inline-flex;
  color: var(--crescendo-cream);
}
body.stand-shell .stand-wordmark {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--crescendo-cream);
}
body.stand-shell .stand-studio {
  display: none;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247, 243, 235, 0.62);
}
body.stand-shell .stand-chrome-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
body.stand-shell .stand-add {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--stand-action);
  color: #f7f3eb;
  border: 0;
  padding: 0;
}
body.stand-shell .stand-add:hover,
body.stand-shell .stand-add:focus-visible {
  color: #fff;
  filter: brightness(1.08);
}
body.stand-shell .stand-menu {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(247, 243, 235, 0.28);
  background: transparent;
  color: var(--crescendo-cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
}
body.stand-shell .stand-menu:hover,
body.stand-shell .stand-menu:focus-visible {
  color: #fff;
  background: rgba(247, 243, 235, 0.1);
  border-color: rgba(247, 243, 235, 0.45);
}
body.stand-shell .stand-profile {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 999px;
  border: 1px solid rgba(247, 243, 235, 0.35);
  background: rgba(247, 243, 235, 0.08);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body.stand-shell .stand-avatar {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--crescendo-cream);
}
body.stand-shell .stand-kicker {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stand-accent);
  opacity: 0.92;
  margin: 0 0 0.35rem;
}
body.stand-shell .greeting-line,
body.stand-shell #screen-title,
body.stand-shell .musical-works h2,
body.stand-shell .shelf-section > h3.h5 {
  color: var(--crescendo-ink);
}
body.stand-shell .shelf-lede,
body.stand-shell .library-summary-line,
body.stand-shell .work-composer,
body.stand-shell .work-meta {
  color: var(--crescendo-charcoal);
}
body.stand-shell a:not(.stand-brand):not(.btn):not(.stand-add) {
  color: var(--stand-accent);
}
body.stand-shell a:not(.stand-brand):not(.btn):not(.stand-add):hover {
  color: var(--crescendo-blue-deep);
}
body.stand-shell .stand-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--stand-footer-height) + env(safe-area-inset-bottom, 0px));
  z-index: 1040;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: linear-gradient(180deg, var(--crescendo-blue) 0%, var(--crescendo-blue-deep) 100%);
  border-top: 1px solid rgba(247, 243, 235, 0.08);
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.18);
  padding: 0.35rem 0.4rem;
}
body.stand-shell .stand-bottom-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(247, 243, 235, 0.62);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.45rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
}
body.stand-shell .stand-bottom-link i { font-size: 1.15rem; }
body.stand-shell .stand-bottom-link.is-active {
  color: var(--crescendo-cream);
}
body.stand-shell .stand-bottom-link.is-active i {
  color: var(--crescendo-sage-soft);
}
body.stand-shell .stand-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1045;
  box-sizing: border-box;
  min-height: var(--stand-footer-height);
  height: auto;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 1.15rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  background: var(--crescendo-blue-deep);
  border-top: 1px solid rgba(247, 243, 235, 0.12);
  color: rgba(247, 243, 235, 0.88);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
body.stand-shell .stand-footer-studio,
body.stand-shell .stand-footer-product {
  display: inline-block;
  white-space: nowrap;
  color: rgba(247, 243, 235, 0.88);
}
body.stand-shell .stand-footer-compact {
  display: none;
}
body.stand-shell .stand-footer-product {
  color: #fffef9;
  font-weight: 600;
}
/* Extra breathing room where pagination / dense rows need touch clearance */
body.stand-shell:has(#screen-library:not([hidden])) {
  --stand-footer-clearance: 2.25rem;
}
body.stand-shell .library-explorer-pager {
  margin-bottom: 0.35rem;
}
body.stand-shell .home-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
body.stand-shell .collection-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
}
body.stand-shell .collection-chip {
  appearance: none;
  border: 1px solid var(--stand-line);
  background: var(--crescendo-cream-sheet);
  color: var(--stand-ink);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.86rem;
  font-weight: 600;
}
body.stand-shell .collection-chip[aria-pressed="true"] {
  background: var(--stand-accent);
  border-color: var(--stand-accent);
  color: var(--crescendo-cream);
}
body.stand-shell .collection-chip-more,
body.stand-shell .home-collections-link {
  opacity: 0.7;
  color: var(--stand-accent);
}
body.stand-shell .continue-playing {
  border-radius: 1rem;
  padding: 0.25rem;
  border-color: var(--stand-line);
  background: var(--crescendo-cream-sheet);
}
body.stand-shell .continue-playing .eyebrow {
  color: var(--stand-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}
body.stand-shell .recently-played-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(11rem, 14rem);
  overflow-x: auto;
  gap: 0.85rem;
  padding-bottom: 0.35rem;
}
body.stand-shell .paper-icon,
body.stand-shell .my-music-card .badge.text-bg-success {
  color: var(--stand-accent);
}
body.stand-shell .btn-primary,
body.stand-shell .touch-primary {
  background: var(--stand-action);
  border-color: var(--stand-action);
  color: #f7f3eb;
}
body.stand-shell .btn-primary:hover,
body.stand-shell .touch-primary:hover {
  filter: brightness(1.05);
  background: var(--stand-action);
  border-color: var(--stand-action);
}
body.stand-shell .onboarding-choice input:checked + span,
body.stand-shell .musical-profile-form .onboarding-choice input:checked + span {
  background: var(--stand-accent);
  border-color: var(--stand-accent);
  color: var(--crescendo-cream);
}
body.stand-shell .pref-star.is-preferred,
body.stand-shell .pref-star[aria-pressed="true"] {
  color: var(--stand-action);
}
body.stand-shell :focus-visible {
  outline: 2px solid var(--stand-accent);
  outline-offset: 2px;
}
body.stand-shell.stand-score-view .stand-chrome,
body.stand-shell.stand-score-view .stand-bottom-nav,
body.stand-shell.stand-score-view .stand-footer,
body.stand-shell.stand-score-view .my-music-opening {
  display: none !important;
}
body.stand-shell.stand-score-view {
  padding-bottom: 0;
}
body.stand-shell.stand-score-view .stand-desk {
  max-width: none;
  padding: 0.75rem 1rem 2rem;
}
@media (min-width: 992px) {
  body.stand-shell {
    padding-bottom: calc(
      var(--stand-footer-height)
      + var(--stand-footer-clearance)
      + env(safe-area-inset-bottom, 0px)
    );
  }
  body.stand-shell .stand-bottom-nav {
    display: none;
  }
  body.stand-shell .stand-footer {
    bottom: 0;
  }
  body.stand-shell .stand-footer-studio,
  body.stand-shell .stand-footer-product {
    display: inline-block;
  }
  body.stand-shell .stand-footer-compact {
    display: none;
  }
  body.stand-shell .stand-chrome-inner::after {
    content: none;
  }
  body.stand-shell .stand-desk-top-nav {
    display: flex;
  }
  body.stand-shell .stand-studio {
    display: inline-block;
  }
  /* CRES-SHELL-003: true viewport center ? side zones do not shift nav */
  body.stand-shell .stand-chrome-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
  }
  body.stand-shell .stand-chrome-start {
    justify-self: start;
  }
  body.stand-shell .stand-chrome-center {
    justify-self: center;
    grid-column: 2;
  }
  body.stand-shell .stand-chrome-end {
    justify-self: end;
    margin-left: 0;
    grid-column: 3;
  }
  body.stand-shell .stand-desktop-nav {
    display: inline-flex;
    justify-content: center;
    gap: 0.35rem;
  }
}
body.stand-shell .stand-desktop-nav {
  display: none;
  gap: 0.25rem;
}
body.stand-shell .stand-desk-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(247, 243, 235, 0.62);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
}
body.stand-shell .stand-desk-link.is-active {
  color: var(--crescendo-cream);
  background: rgba(247, 243, 235, 0.12);
}
@media (min-width: 992px) {
  body.stand-shell .stand-desktop-nav {
    display: inline-flex !important;
  }
}

/* CRES-PROFILE-001 ? first-run Musician Profile */
.musician-onboarding {
  border-radius: 1.1rem;
  border-color: var(--stand-line, #ddd4c6);
  background: #fffef9;
}
.musician-onboarding .onboarding-step {
  border: 0;
  margin: 0;
  padding: 0;
}
.musician-onboarding legend {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.onboarding-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.onboarding-choice {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}
.onboarding-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.onboarding-choice span {
  display: inline-flex;
  border: 1px solid var(--stand-line, #ddd4c6);
  background: #fff;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-weight: 600;
  color: var(--stand-ink, #2a2620);
}
.onboarding-choice input:checked + span {
  background: var(--stand-ink, #2a2620);
  border-color: var(--stand-ink, #2a2620);
  color: #f7f3eb;
}
.onboarding-finish .stand-kicker {
  letter-spacing: 0.12em;
}

/* CRES-PROFILE-002 ? Musical Profile as living conversation */
.musical-profile-panel .modal-content {
  background: #fffef9;
}
.profile-instrument-choice {
  position: relative;
  gap: 0;
}
.profile-instrument-choice span {
  padding-right: 1.85rem;
}
.pref-star {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #b7aea0;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.15rem;
  cursor: pointer;
}
.pref-star.is-preferred,
.pref-star[aria-pressed="true"] {
  color: var(--stand-ink, #2a2620);
}
.crescendo-learned {
  border-top: 1px solid var(--stand-line, #ddd4c6);
  padding-top: 1rem;
}

/* CRES-LIBRARY-SEED-001 ? original reading surfaces */
.work-reading-surface,
.artifact-reading-surface {
  border: 1px solid var(--stand-line, #ddd4c6);
  background: var(--crescendo-cream-sheet, #fffef9);
  border-radius: 0.75rem;
  overflow: hidden;
  min-height: 18rem;
}
.original-reader-pdf {
  width: 100%;
  min-height: 70vh;
  border: 0;
  background: #fff;
}
.original-reader-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  background: #fff;
}
.original-reader-score {
  padding: 1rem;
  overflow: auto;
}

/* CRES-ADD-002 ? Add Music sheet */
.add-music-sheet .modal-content {
  background: #fffef9;
}
.add-music-drop {
  display: grid;
  gap: 0.35rem;
  place-items: center;
  min-height: 10rem;
  padding: 1.5rem 1rem;
  border: 1.5px dashed var(--crescendo-blue-mid, #1d3040);
  border-radius: 1rem;
  background: rgba(247, 243, 235, 0.65);
  color: var(--crescendo-charcoal, #2f2b26);
  cursor: pointer;
  text-align: center;
}
.add-music-drop strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--crescendo-blue-deep, #172a3a);
}
.add-music-drop span {
  font-size: 0.92rem;
  opacity: 0.75;
}
.add-music-drop.is-dragover {
  background: var(--crescendo-sage-soft, #e4eee7);
  border-color: var(--crescendo-sage, #4a6354);
}
.add-music-queue {
  display: grid;
  gap: 0.65rem;
}
.add-music-queue-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--stand-line, #ddd4c6);
  border-radius: 0.75rem;
  background: #fff;
}
.add-music-queue-item strong {
  font-size: 0.98rem;
  color: var(--crescendo-ink, #1c1916);
}
.add-music-queue-meta {
  font-size: 0.82rem;
  color: var(--crescendo-blue-mid, #1d3040);
}

/* CRES-LIBRARY-005 ? dense Library Explorer */
body.stand-shell.stand-library-desk .stand-desk,
body.stand-shell.stand-library-desk .reading-desk {
  max-width: none;
  width: 100%;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}
@media (min-width: 992px) {
  body.stand-shell.stand-library-desk .stand-desk,
  body.stand-shell.stand-library-desk .reading-desk {
    padding-left: max(2rem, env(safe-area-inset-left, 0px));
    padding-right: max(2rem, env(safe-area-inset-right, 0px));
  }
}
.library-explorer-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.library-explorer-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--crescendo-ink, #1c1916);
}
.library-explorer-total {
  font-size: 0.95rem;
  color: rgba(47, 43, 38, 0.68);
  white-space: nowrap;
}
.library-explorer-toolbar {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}
.library-explorer-search {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.library-explorer-query {
  border-radius: 0.55rem;
  border-color: var(--stand-line, #ddd4c6);
  background: var(--crescendo-cream-sheet, #fffef9);
  min-height: 2.55rem;
}
.library-explorer-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  border: 1px solid var(--stand-line, #ddd4c6);
  background: var(--crescendo-cream-sheet, #fffef9);
  color: var(--crescendo-charcoal, #2f2b26);
  border-radius: 0.55rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}
.library-explorer-filter-btn:hover {
  border-color: var(--crescendo-blue-mid, #1d3040);
  color: var(--crescendo-blue, #1d3040);
}
.library-explorer-filter-count {
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: var(--crescendo-sage, #4a6354);
  color: #f7f3eb;
  font-size: 0.7rem;
  display: inline-grid;
  place-items: center;
  padding: 0 0.3rem;
}
.library-explorer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}
.library-filter-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--stand-line, #ddd4c6);
  background: rgba(255, 254, 249, 0.95);
  color: var(--crescendo-charcoal, #2f2b26);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.library-filter-chip:hover {
  border-color: var(--crescendo-blue-mid, #1d3040);
}
.library-filter-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
.library-filter-legend {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--crescendo-blue-mid, #1d3040);
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.library-filter-rule {
  border: 0;
  border-top: 1px solid var(--stand-line, #ddd4c6);
  margin: 0.15rem 0;
  opacity: 1;
}
.library-explorer-view-toggle {
  display: inline-flex;
  gap: 0.35rem;
}
.library-view-btn {
  border: 1px solid var(--stand-line, #ddd4c6);
  background: var(--crescendo-cream-sheet, #fffef9);
  color: var(--crescendo-charcoal, #2f2b26);
  border-radius: 0.5rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.library-view-btn.is-active {
  background: var(--crescendo-blue, #1d3040);
  border-color: var(--crescendo-blue, #1d3040);
  color: var(--crescendo-cream, #f7f3eb);
}
.library-pinned-strip {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--stand-line, #ddd4c6);
  border-radius: 0.75rem;
  background: rgba(255, 254, 249, 0.9);
}
.library-pinned-heading {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--crescendo-blue-mid, #1d3040);
  margin: 0 0 0.45rem;
}
.library-pinned-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.library-pinned-chip {
  appearance: none;
  border: 1px solid var(--stand-line, #ddd4c6);
  background: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.86rem;
  font-weight: 600;
}
.library-explorer-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--crescendo-cream-sheet, #fffef9);
}
.library-explorer-table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(47, 43, 38, 0.62);
  font-weight: 700;
  padding: 0.35rem 0.55rem;
  border-bottom: 1px solid var(--stand-line, #ddd4c6);
  white-space: nowrap;
}
.library-explorer-table th.is-sorted {
  color: var(--crescendo-blue, #1d3040);
}
.library-sort-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.library-sort-btn:hover {
  color: var(--crescendo-blue, #1d3040);
}
.library-explorer-row {
  cursor: pointer;
}
.library-explorer-row td {
  padding: 0 0.55rem;
  height: 52px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(221, 212, 198, 0.65);
  font-size: 0.92rem;
  color: var(--crescendo-charcoal, #2f2b26);
}
.library-explorer-row:hover,
.library-explorer-row:focus-visible {
  background: rgba(23, 42, 58, 0.06);
  outline: none;
}
.library-explorer-row.is-selected,
.library-explorer-row:focus-visible {
  background: rgba(23, 42, 58, 0.09);
}
.library-col-title {
  font-weight: 600;
  color: var(--crescendo-ink, #1c1916);
}
.library-col-pin { width: 2.4rem; }
.library-pin-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #b7aea0;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.2rem;
  cursor: pointer;
}
.library-pin-btn.is-pinned { color: var(--crescendo-sage, #4a6354); }
.library-pin-on-card {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
}
.library-group { margin-bottom: 0.65rem; }
.library-group-heading {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--stand-line, #ddd4c6);
  background: transparent;
  padding: 0.55rem 0.15rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--crescendo-ink, #1c1916);
  text-align: left;
}
.library-group-count {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(47, 43, 38, 0.55);
}
.library-explorer-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--stand-line, #ddd4c6);
}
.library-explorer-range {
  justify-self: start;
  font-size: 0.9rem;
  color: rgba(47, 43, 38, 0.75);
  font-weight: 600;
}
.library-explorer-page-size {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  justify-self: center;
  font-size: 0.85rem;
  color: rgba(47, 43, 38, 0.72);
  font-weight: 600;
  white-space: nowrap;
}
.library-explorer-page-size .form-select {
  width: auto;
  min-width: 4.25rem;
}
.library-explorer-pages {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  justify-self: end;
}
.library-page-btn {
  appearance: none;
  min-width: 2rem;
  height: 2rem;
  border: 1px solid var(--stand-line, #ddd4c6);
  background: #fff;
  border-radius: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.library-page-btn[aria-current="page"] {
  background: var(--crescendo-blue, #1d3040);
  border-color: var(--crescendo-blue, #1d3040);
  color: var(--crescendo-cream, #f7f3eb);
}
.library-page-ellipsis { padding: 0 0.2rem; color: rgba(47, 43, 38, 0.45); }
@media (max-width: 991.98px) {
  .library-col-instrument,
  .library-col-collection,
  .library-col-type { display: none; }
  .library-explorer-pager {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .library-explorer-pages,
  .library-explorer-page-size,
  .library-explorer-range { justify-self: start; }
}

/* CRES-LIBRARY-LIVE-001 ? Work view + Present */
.library-claim-bar {
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--stand-line, #ddd4c6);
  border-radius: 0.65rem;
  background: rgba(255, 254, 249, 0.92);
}
.library-claim-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.library-claim-btn {
  appearance: none;
  border: 1px solid var(--crescendo-blue-mid, #1d3040);
  background: #fff;
  color: var(--crescendo-blue, #1d3040);
  border-radius: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.86rem;
  font-weight: 600;
}
.library-auth-gate {
  max-width: 32rem;
  margin: 2rem auto;
}
.work-view-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}
.work-back {
  border: 0;
  background: transparent;
  color: var(--crescendo-blue, #1d3040);
  font-weight: 650;
  padding: 0.25rem 0;
}
.work-view-heading { flex: 1 1 12rem; min-width: 0; }
.work-view-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  margin: 0;
  color: var(--crescendo-ink, #1c1916);
}
.work-view-composer,
.work-view-instrument {
  margin: 0.15rem 0 0;
  color: rgba(47, 43, 38, 0.72);
  font-size: 0.98rem;
}
.work-view-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.work-present-btn,
.work-pin-btn,
.reader-blade-toggle {
  border: 1px solid var(--stand-line, #ddd4c6);
  background: var(--crescendo-cream-sheet, #fffef9);
  color: var(--crescendo-charcoal, #2f2b26);
  border-radius: 0.55rem;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.work-present-btn {
  background: var(--crescendo-blue, #1d3040);
  border-color: var(--crescendo-blue, #1d3040);
  color: var(--crescendo-cream, #f7f3eb);
}
.work-reading-surface {
  min-height: 60vh;
  background: #fffef9;
  border: 1px solid var(--stand-line, #ddd4c6);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow: auto;
}
.work-reading-surface svg { max-width: 100%; height: auto; }
.present-exit {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top, 0px));
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  z-index: 1100;
  background: rgba(23, 42, 58, 0.88);
  color: #f7f3eb;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.45rem 0.8rem;
  font-weight: 600;
}
body.stand-shell.stand-present-mode .stand-chrome,
body.stand-shell.stand-present-mode .stand-footer,
body.stand-shell.stand-present-mode .stand-bottom-nav,
body.stand-shell.stand-present-mode .work-view-chrome,
body.stand-shell.stand-present-mode .reader-blade,
body.stand-shell.stand-present-mode .offcanvas {
  display: none !important;
}
body.stand-shell.stand-present-mode {
  padding-bottom: 0;
  background: #fffef9;
}
body.stand-shell.stand-present-mode .stand-desk {
  max-width: none;
  padding: 0;
}
body.stand-shell.stand-present-mode .work-reading-surface {
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  padding: 1.25rem max(1rem, env(safe-area-inset-right, 0px)) 2rem max(1rem, env(safe-area-inset-left, 0px));
}
body.stand-shell.stand-present-mode .present-exit { display: inline-flex !important; }

/* CRES-AUTH-001 ï¿½ Account vs Musical Profile */
.identity-section-title {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--crescendo-blue-mid, #1d3040);
  font-weight: 700;
  margin: 0 0 0.55rem;
}
.identity-passport-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--crescendo-ink, #1c1916);
  margin: 0;
}
.identity-account-block {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--stand-line, #ddd4c6);
}
.library-auth-gate {
  max-width: 32rem;
  margin: 2rem auto;
}

/* CRES-UX-017 · Public Landing  unauthenticated `/` */
body.public-landing-active .stand-chrome,
body.public-landing-active .stand-app,
body.public-landing-active .stand-bottom-nav,
body.public-landing-active #screen-library-auth {
  display: none !important;
}
body.public-landing-active .stand-footer {
  position: relative;
  z-index: 2;
}
.public-landing {
  min-height: calc(100dvh - 3rem);
  background:
    radial-gradient(ellipse 70% 45% at 80% 8%, rgba(23, 42, 58, 0.1), transparent 50%),
    linear-gradient(165deg, #f7f1e6 0%, #efe6d6 48%, #f4efe6 100%);
  color: var(--crescendo-ink, #1c1916);
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) max(1.25rem, env(safe-area-inset-right, 0px))
    2.5rem max(1.25rem, env(safe-area-inset-left, 0px));
}
.public-landing-inner {
  max-width: 40rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.public-landing-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-top: 0.35rem;
}
.public-landing-mark {
  color: var(--crescendo-blue-mid, #1d3040);
  flex: 0 0 auto;
}
.public-landing-wordmark {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.85rem, 5vw, 2.35rem);
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
  color: var(--crescendo-ink, #1c1916);
}
.public-landing-studio {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crescendo-blue-mid, #1d3040);
  opacity: 0.85;
}
.public-landing-stage {
  display: grid;
  gap: 1.5rem;
}
.public-landing-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 7vw, 2.85rem);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.85rem;
}
.public-landing-lede {
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0 0 1.35rem;
  max-width: 34rem;
  color: #3a342c;
}
.public-landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.public-landing-primary,
.public-landing-secondary {
  min-height: 3rem;
  min-width: 9.5rem;
  padding: 0.65rem 1.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 0.55rem;
}
.public-landing-stand {
  margin: 0;
  border-radius: 0.85rem;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(23, 42, 58, 0.18);
  background: #172a3a;
}
.public-landing-stand-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 12rem;
  aspect-ratio: 16 / 10;
}
.public-landing-journey {
  list-style: none;
  margin: 0;
  padding: 0.85rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.15rem;
  border-top: 1px solid rgba(29, 48, 64, 0.12);
  border-bottom: 1px solid rgba(29, 48, 64, 0.12);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 600;
  color: var(--crescendo-blue-mid, #1d3040);
}
.public-landing-journey li {
  display: flex;
  align-items: center;
}
.public-landing-journey li:not(:last-child)::after {
  content: "→";
  margin: 0 0.45rem;
  opacity: 0.45;
  font-weight: 500;
}
.public-landing-promises {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}
.public-landing-promises li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  background: rgba(251, 246, 236, 0.7);
  border: 1px solid rgba(29, 48, 64, 0.08);
  border-radius: 0.75rem;
}
.public-landing-promises strong {
  font-size: 1.05rem;
  color: var(--crescendo-ink, #1c1916);
}
.public-landing-promises span {
  font-size: 0.98rem;
  line-height: 1.45;
  color: #4a433a;
}
.public-landing-future {
  font-size: 0.82rem !important;
  letter-spacing: 0.02em;
  color: #6a6258 !important;
}
.public-landing-close {
  padding: 1.5rem 0 0.5rem;
}
.public-landing-close-prompt {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
  margin: 0 0 1rem;
}
.public-landing-existing {
  margin: 0.85rem 0 0;
  font-size: 0.98rem;
  color: #4a433a;
}
.public-landing-inline-link {
  padding: 0;
  vertical-align: baseline;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
@media (min-width: 768px) {
  .public-landing-inner {
    max-width: 58rem;
    gap: 2rem;
    padding: 1rem 0 2rem;
  }
  .public-landing-stage {
    grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
    align-items: center;
    gap: 2rem;
  }
  .public-landing-promises {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 992px) {
  .public-landing-inner {
    max-width: 64rem;
  }
  .public-landing-title {
    font-size: 3.1rem;
  }
}
