:root {
  color-scheme: light;
  --ink: #192b24;
  --muted: #50645b;
  --paper: #fffefa;
  --background: #f7f8f3;
  --line: #dee5dc;
  --green: #1d5a47;
  --dark: #102f26;
  --mint: #dbefdf;
  font: 100%/1.55 "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid #3a8068;
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 2;
  top: 0;
  left: 1rem;
  padding: .75rem 1rem;
  transform: translateY(-120%);
  background: var(--paper);
}
.skip-link:focus { transform: translateY(0); }

.shell { width: min(100% - 5rem, 77rem); margin-inline: auto; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { height: 4.75rem; display: flex; align-items: center; gap: 2.75rem; }
.brand {
  display: inline-flex;
  flex: none;
  gap: .7rem;
  align-items: center;
  color: var(--dark);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .045em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .8rem;
  background: var(--dark);
  color: #e2f8e8;
  font-family: Georgia, serif;
  font-size: 1.9rem;
}
.brand small {
  display: block;
  margin-top: .28rem;
  font: 650 .66rem/1.1 system-ui, sans-serif;
  letter-spacing: .13em;
}
.header-inner nav a {
  display: inline-block;
  padding-block: .7rem;
  text-decoration: none;
  font-size: .94rem;
  font-weight: 650;
}
.header-inner nav a:hover { color: var(--green); text-decoration: underline; }
.bag-button {
  display: flex;
  gap: .55rem;
  align-items: center;
  min-height: 2.75rem;
  margin-left: auto;
  padding: .45rem .85rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--paper);
  font-weight: 650;
  font-size: .94rem;
}
.bag-button:hover { background: var(--mint); }
.bag-icon {
  position: relative;
  width: .91rem;
  height: .8rem;
  margin-top: .22rem;
  border: 1.5px solid currentColor;
  border-radius: .1rem .1rem .18rem .18rem;
}
.bag-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -.4rem;
  width: .43rem;
  height: .46rem;
  border: 1.5px solid currentColor;
  border-bottom: none;
  border-radius: .5rem .5rem 0 0;
  transform: translateX(-50%);
}
.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding-inline: .25rem;
  border-radius: 2rem;
  color: var(--dark);
  background: var(--mint);
  font: 700 .8rem/1 system-ui, sans-serif;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  min-height: 18.5rem;
  margin-top: 1.5rem;
  border-radius: 1.45rem;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse at 89% 20%, #365e47 0%, #1a4436 45%, #102f26 83%);
  color: #f6fdf7;
}
.hero-copy {
  z-index: 1;
  align-self: center;
  padding: 2.25rem 0 2.25rem clamp(1.75rem, 5vw, 4.25rem);
}
.hero h1 {
  margin: 0 0 .85rem;
  font: 700 clamp(2.25rem, 4vw, 3.95rem)/1.18 "Songti TC", "Noto Serif TC", Georgia, serif;
  letter-spacing: .045em;
  text-wrap: balance;
}
.hero-copy > p {
  max-width: 28rem;
  margin: 0 0 1.6rem;
  color: #d7e9df;
  font-size: 1.04rem;
}
.search {
  display: flex;
  align-items: center;
  gap: .7rem;
  max-width: 29rem;
  min-height: 3.55rem;
  padding: .3rem .35rem .3rem .95rem;
  border: 1px solid #afcabe;
  border-radius: .7rem;
  background: var(--paper);
  color: var(--ink);
}
.search:focus-within { outline: 3px solid #aadcba; outline-offset: 3px; }
.search-icon {
  position: relative;
  flex: 0 0 .85rem;
  height: .85rem;
  border: 1.7px solid #597567;
  border-radius: 50%;
}
.search-icon::after {
  position: absolute;
  content: "";
  bottom: -.18rem;
  right: -.22rem;
  width: .42rem;
  height: 1.7px;
  background: #597567;
  transform: rotate(45deg);
}
.search input {
  width: 100%;
  min-width: 0;
  padding: .48rem .12rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}
.search input::placeholder { color: #596b61; }
.search button {
  min-height: 2.75rem;
  padding: .4rem 1rem;
  border: 0;
  border-radius: .48rem;
  background: #c8e8ce;
  font-weight: 750;
  white-space: nowrap;
}
.search button:hover { background: #add9b6; }
.hero-art {
  position: relative;
  min-width: 0;
  min-height: 18.5rem;
  isolation: isolate;
}
.hero-art::before {
  position: absolute;
  content: "";
  inset: 13% 7% 8% 5%;
  border: 1px solid #d7f1d92e;
  border-radius: 50%;
  transform: rotate(-23deg);
  box-shadow: 0 0 0 1.2rem #d7f1d90a, 0 0 0 2.4rem #d7f1d90a, 0 0 0 3.6rem #d7f1d90a;
}
.paper-behind, .hero-paper {
  position: absolute;
  inset: 11% auto auto 11%;
  width: min(74%, 25rem);
  min-height: 14.5rem;
  border: 1px solid #cedacb;
  border-radius: .42rem;
}
.paper-behind { background: #d9e8d9; transform: translate(2rem, -.5rem) rotate(13deg); }
.hero-paper {
  display: grid;
  place-items: center;
  align-content: start;
  padding: 1rem 1.2rem .8rem;
  transform: rotate(-8deg);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1.3rem 3rem #071d1866;
}
.hero-paper p {
  margin: .4rem 0 .03rem;
  font: 700 clamp(1.5rem, 2.8vw, 2.05rem)/1.3 "Songti TC", "Noto Serif TC", serif;
  letter-spacing: .13em;
}
.hero-paper span { font: italic 1.05rem/1.4 Georgia, serif; color: #4c6155; }
.hero-paper img { display: block; width: 100%; height: auto; margin-top: .7rem; }

.library { padding-block: 1.9rem 3.75rem; scroll-margin-top: 1.25rem; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.section-header > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .9rem; }
.section-header h2 { margin: 0; font-size: clamp(1.65rem, 2.5vw, 2.1rem); letter-spacing: .025em; }
.section-header p { margin: .28rem 0 0; color: var(--muted); font-size: .94rem; }
.text-button {
  min-height: 2.75rem;
  padding: .4rem .2rem;
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 700;
  font-size: .9rem;
}
.text-button:hover { text-decoration: underline; }
.filters {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: .85rem 1rem;
  margin: .9rem 0 1.15rem;
}
.level-filter, .select-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.level-filter button {
  min-height: 2.75rem;
  padding: .45rem .95rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--paper);
  color: var(--ink);
  font-size: .93rem;
  font-weight: 660;
}
.level-filter button:hover { border-color: #79a090; }
.level-filter button[aria-pressed="true"] {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
}
.select-filters { gap: .55rem; }
.filter-field { display: flex; align-items: center; gap: .35rem; }
.select-label, .tempo-label { color: var(--muted); font-size: .9rem; font-weight: 650; }
select {
  appearance: none;
  min-height: 2.75rem;
  padding: .45rem 2rem .45rem .75rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background-color: var(--paper);
  background-image: linear-gradient(45deg, transparent 50%, #4e695d 50%), linear-gradient(135deg, #4e695d 50%, transparent 50%);
  background-position: right 1rem center, right .7rem center;
  background-repeat: no-repeat;
  background-size: .3rem .3rem;
  color: var(--ink);
  font-size: .93rem;
}
.catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.song-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .95rem;
  background: var(--paper);
  box-shadow: 0 .2rem .8rem #1d493907;
  transition: border-color .16s, box-shadow .16s;
}
.song-card:hover { border-color: #b4c9bb; box-shadow: 0 .35rem 1rem #1d493912; }
.card-art {
  position: relative;
  display: grid;
  place-items: end center;
  overflow: hidden;
  min-height: 9.4rem;
  aspect-ratio: 2.6;
  background: var(--art, #d8e9e1);
}
.card-art[data-theme="mint"] { --art: #d8e9e1; }
.card-art[data-theme="peach"] { --art: #f2e2da; }
.card-art[data-theme="blue"] { --art: #e0e7f0; }
.card-art[data-theme="sand"] { --art: #ede9d7; }
.card-paper {
  display: grid;
  place-items: center;
  width: 82%;
  height: 85%;
  padding: .65rem .8rem;
  background: var(--paper);
  border-radius: .2rem;
  transform: rotate(-4deg);
  box-shadow: .1rem .35rem .95rem #23372c28;
}
.card-paper img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.genre {
  position: absolute;
  top: .8rem;
  left: .8rem;
  min-width: 2.65rem;
  padding: .19rem .5rem;
  border: 1px solid #ffffff99;
  border-radius: 1rem;
  background: #fffefaeb;
  color: #31463b;
  text-align: center;
  font-weight: 650;
  font-size: .8rem;
}
.card-copy { display: flex; flex-direction: column; gap: .8rem; padding: 1.12rem; }
.card-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; }
.card-title-row h3 { margin: 0; font-size: 1.25rem; }
.card-title-row p { margin: .14rem 0 0; color: var(--muted); font: italic .95rem/1.45 Georgia, serif; }
.card-price { flex: none; margin-top: .16rem; text-align: right; white-space: nowrap; }
.card-price strong { font-size: 1.02rem; font-weight: 760; }
.card-price small { margin-left: .2rem; color: var(--muted); font-size: .8rem; }
.card-copy .availability { margin: 0; color: var(--muted); font-size: .91rem; }
.card-copy .work-credit { margin: 0; color: var(--ink); font-size: .9rem; }
.work-credit a { color: var(--green); text-underline-offset: .15em; }
.work-source { margin: .85rem 0; color: var(--muted); font-size: .88rem; }
.work-source summary { cursor: pointer; color: var(--green); font-weight: 650; }
.work-source p { margin: .55rem 0 .3rem; }
.work-source a { color: var(--green); }
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding-top: .7rem;
  border-top: 1px solid var(--line);
}
.card-bottom span { color: var(--muted); font-size: .89rem; }
.button {
  min-height: 2.75rem;
  padding: .45rem .9rem;
  border: 1px solid transparent;
  border-radius: .58rem;
  font-weight: 700;
  font-size: .94rem;
}
.primary { border-color: var(--green); background: var(--green); color: #fff; }
.primary:hover { background: #133e32; }
.primary:disabled { border-color: #d9e7dc; background: #e8f1e9; color: #37644e; }
.secondary { border-color: #c6d7cb; background: #f8fcf8; color: var(--green); }
.secondary:hover { background: var(--mint); }
.empty-state { padding: 2.5rem 1rem; border: 1px dashed #bdcec0; border-radius: .9rem; text-align: center; }
.empty-state h3 { margin: 0; font-size: 1.2rem; }
.empty-state p { margin: .45rem 0 1rem; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); background: var(--paper); }
.site-footer .shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem; padding-block: 1.35rem; }
.site-footer span { font-weight: 750; letter-spacing: .1em; }
.site-footer p { margin: 0; color: var(--muted); font-size: .89rem; }

dialog {
  max-height: 92dvh;
  padding: 0;
  border: 1px solid #d2e0d6;
  border-radius: 1rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1.35rem 4rem #0e251a44;
}
dialog::backdrop { background: #142e24a6; backdrop-filter: blur(4px); }
.song-dialog { width: min(100% - 2rem, 76rem); }
.cart-dialog { width: min(100% - 2rem, 30rem); }
.dialog-top {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: .85rem;
  padding: 1.2rem 1.35rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.dialog-top h2 { margin: 0; font-size: 1.45rem; }
.dialog-top p { margin: .2rem 0 0; color: var(--muted); font-size: .94rem; }
.close-button {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #f8faf7;
  font: 400 1.65rem/1 system-ui, sans-serif;
}
.close-button:hover { background: var(--mint); }
.product {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(16rem, 1fr);
  gap: 1.4rem;
  padding: 1.3rem;
}
.preview-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; margin-bottom: .6rem; }
.preview-heading h3, .comparison h3 { margin: 0; font-size: 1.14rem; }
.preview-heading span { color: var(--muted); font-size: .84rem; }
.score-frame {
  max-height: min(62dvh, 34rem);
  overflow: auto;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: #f0f4ef;
}
.score-paper {
  width: 100%;
  padding: 1rem .5rem .55rem;
  border: 1px solid #e1e7e0;
  border-radius: .3rem;
  background: #fff;
  box-shadow: 0 .2rem .6rem #1d493919;
}
.sheet-title { text-align: center; font: 600 1.6rem/1.3 "Songti TC", "Noto Serif TC", serif; }
.sheet-subtitle { margin: .2rem 0 .5rem; text-align: center; font-size: .82rem; color: var(--muted); text-wrap: balance; }
.score-paper picture, .score-paper img { display: block; width: 100%; height: auto; }
.score-frame.is-zoomed .score-paper { width: max(145%, 43rem); }
.follow-transport {
  margin-bottom: .65rem;
  padding: .65rem .8rem .45rem;
  border: 1px solid #cddcd1;
  border-radius: .7rem;
  background: #f0f6f1;
}
.transport-top, .transport-timeline { display: flex; align-items: center; gap: .6rem; }
.transport-top { flex-wrap: wrap; }
.transport-top .play-button { min-width: 7.3rem; }
.transport-top .tempo-label { margin-left: auto; }
.transport-top select { min-height: 2.5rem; }
.play-position { color: var(--dark); font-size: .85rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.transport-timeline { color: var(--muted); gap: .65rem; margin-top: .3rem; font: 500 .78rem/1.4 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.transport-timeline input { flex: 1; width: 100%; min-width: 2rem; height: 1.55rem; margin: 0; accent-color: var(--green); cursor: pointer; }
.practice-controls { margin-top: .35rem; padding-top: .4rem; border-top: 1px solid #cddcd1; }
.practice-controls h4 { margin: 0 0 .4rem; font-size: 1rem; }
.practice-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .55rem; }
.practice-range { display: grid; grid-template-columns: auto 3.25rem auto 3.25rem; align-items: center; gap: .35rem; }
.practice-range label { color: var(--muted); font-size: .85rem; font-weight: 650; }
.practice-range input, #practice-url {
  min-height: 2.75rem;
  width: 100%;
  min-width: 0;
  padding: .3rem;
  border: 1px solid #a4b7ab;
  border-radius: .5rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}
.practice-range input { text-align: center; font-variant-numeric: tabular-nums; }
.practice-hand { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .85rem; font-weight: 650; }
.practice-hand[hidden] { display: none; }
.practice-hand select { min-height: 2.75rem; width: auto; font-size: 1rem; }
#practice-toggle { padding-inline: .65rem; }
#practice-toggle[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: white; }
#practice-status { display: block; color: var(--ink); font-size: .85rem; overflow-wrap: anywhere; }
#practice-status:not(:empty), #practice-url { margin-top: .35rem; }
.follow-sheet { position: relative; }
.score-overlay, .measure-targets { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bar-shade { fill: #6ac498; opacity: .15; }
.sounding-notes { fill: #25a973; fill-opacity: .51; }
.measure-targets button { position: absolute; pointer-events: auto; padding: 0; border: 0; background: transparent; border-radius: .12rem; }
@media (hover: hover) { .measure-targets button:hover { background: #307d5a10; } }
.measure-targets button:focus-visible { outline-offset: -2px; }
.follow-hint { color: var(--muted); font-size: .83rem; }
@media (max-width: 30rem) {
  .follow-transport { padding-inline: .55rem; }
  .transport-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .3rem; }
  .play-position { font-size: .77rem; line-height: 1.35; }
  .transport-top .play-button { min-width: 6rem; padding-inline: .55rem; }
  .transport-top .tempo-label { position: absolute; clip-path: inset(50%); }
  .transport-top select { margin-left: auto; padding-inline: .45rem 1.5rem; }
}
@media print {
  .score-overlay, .measure-targets { display: none; }
}
.preview-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-top: .7rem; }
.play-button span { margin-right: .18rem; font-size: .75em; }
.preview-tools .text-button[aria-pressed="true"] { color: var(--dark); text-decoration: underline; }
.print-tools { display: flex; align-items: center; gap: .8rem; margin-left: auto; }
.print-tools a { display: inline-flex; align-items: center; text-decoration: none; }
.comparison { display: flex; flex-direction: column; gap: .7rem; }
.version-list { display: grid; gap: .5rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.version {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: .7rem;
  padding: .75rem;
  border: 1px solid #d8e2d9;
  border-radius: .63rem;
  cursor: pointer;
}
.version:hover { border-color: #92b49f; }
.version:has(input:checked) { border-color: #75a28a; background: #eef6ee; }
.version:has(input:focus-visible) { outline: 3px solid #3a8068; outline-offset: 2px; }
.version input { margin: .19rem 0 0; width: 1rem; height: 1rem; accent-color: var(--green); }
.version-title { display: block; font-weight: 750; font-size: .95rem; }
.version-description { display: block; margin-top: .18rem; color: var(--muted); font-size: .87rem; }
.version-price { white-space: nowrap; font-weight: 750; font-size: .95rem; }
.purchase {
  display: grid;
  gap: .55rem;
  padding: .88rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: #f7faf6;
}
.purchase-detail { display: flex; gap: .55rem; justify-content: space-between; align-items: start; }
.purchase-detail h4 { margin: 0; font-size: .93rem; }
.purchase-detail p { margin: .18rem 0 0; color: var(--muted); font-size: .84rem; }
.purchase-detail strong { flex: none; font-size: 1.2rem; }
.cart-message { font-size: .85rem; color: var(--green); margin: 0; }
.cart-message:empty { display: none; }
.cart-body { padding: 1.15rem 1.35rem 1.35rem; }
.cart-body > p { margin: 0 0 1rem; color: var(--muted); }
.cart-items { padding: 0; margin: 0; list-style: none; }
.cart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-row p { margin: .15rem 0 0; color: var(--muted); font-size: .85rem; }
.cart-total { display: flex; justify-content: space-between; gap: 1rem; padding-top: .9rem; }
.editor-tools {
  margin-top: .85rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.editor-tools summary {
  padding: .75rem 0;
  width: fit-content;
  color: var(--green);
  font-size: .94rem;
  font-weight: 700;
  cursor: pointer;
}
.editor-body { display: grid; gap: .6rem; padding-bottom: .5rem; }
.editor-download {
  display: block;
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: #f7faf6;
  text-decoration: none;
}
.editor-download:hover strong { text-decoration: underline; }
.editor-download strong, .editor-body > label { font-weight: 700; font-size: .93rem; }
.editor-download span, .editor-body small, .local-source {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  overflow-wrap: anywhere;
}
.editor-body input { width: 100%; min-width: 0; }
.editor-body input::file-selector-button { margin-right: .5rem; padding: .45rem; cursor: pointer; }
.editor-body p { margin: 0; overflow-wrap: anywhere; }
.editor-body p:empty { display: none; }
.editor-body button { justify-self: start; }

@media (max-width: 58rem) {
  .shell { width: min(100% - 3rem, 77rem); }
  .hero { min-height: 19.5rem; }
  .hero-copy { padding-left: 1.75rem; }
  .hero-art { min-height: 19.5rem; }
  .hero-paper, .paper-behind { min-height: 13rem; }
  .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 44rem) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { height: 4rem; }
  .header-inner nav { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); margin-top: 1rem; }
  .hero-copy { padding: 1.6rem 1.2rem .9rem; }
  .hero h1 { font-size: clamp(2rem, 8vw, 2.7rem); text-wrap: wrap; }
  .hero-copy > p { font-size: .97rem; margin-bottom: 1rem; }
  .hero-art { min-height: 10.5rem; }
  .paper-behind, .hero-paper { inset: 13% auto auto 16%; width: 64%; min-height: 0; }
  .hero-paper { padding: .45rem .8rem 0; transform: rotate(-6deg); }
  .hero-paper p { margin-top: .25rem; font-size: 1.35rem; }
  .hero-paper span { font-size: .9rem; }
  .hero-paper img { margin-top: .25rem; }
  .library { padding-block: 1.8rem 2.7rem; }
  .section-header > div { flex-direction: column; align-items: start; }
  .song-dialog { width: calc(100% - .75rem); max-width: calc(100% - .75rem); }
  .product { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; padding: .8rem .6rem; }
  .score-frame { padding: 0; background: white; max-height: clamp(10rem, 100dvh - 22rem, 49dvh); }
  .score-paper { padding: .7rem .18rem .4rem; border: 0; box-shadow: none; }
  .dialog-top { padding: .85rem 1rem; }
  .dialog-top h2 { font-size: 1.3rem; }
  .print-tools { margin-left: 0; }
}

@media (max-width: 34rem) {
  .catalog { grid-template-columns: minmax(0, 1fr); gap: .95rem; }
  .select-filters { gap: .38rem; }
  .level-filter button { padding-inline: .75rem; }
  .card-art { max-height: 10rem; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; } }

@media print {
  @page { size: A4 portrait; margin: 15mm; }
  html, body { background: white; }
  body:has(.song-dialog[open]) { overflow: visible; }
  body:has(.song-dialog[open]) > :not(.song-dialog) { display: none !important; }
  .song-dialog[open] {
    position: static;
    display: block;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }
  .song-dialog::backdrop, .dialog-top, .comparison, .score-preview > :not(.score-frame) { display: none; }
  .product { display: block; padding: 0; }
  .score-frame, .score-frame.is-zoomed .score-paper, .score-paper {
    width: 100%;
    max-height: none;
    overflow: visible;
    border: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: white;
    break-inside: avoid;
  }
  .sheet-subtitle { margin-bottom: 5mm; }
}

.language-switch {
  flex-shrink: 0;
  min-height: 2.65rem;
  padding: .3rem .65rem;
  border-radius: .55rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--green);
  font: inherit;
  font-size: .86rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.language-switch:hover { background: var(--mint); }
.header-inner > .language-switch { margin-left: auto; }
.header-inner .bag-button { margin-left: 0; }
.dialog-actions, .share-tools { display: flex; align-items: center; gap: .6rem; }
.dialog-actions { flex-shrink: 0; }
.share-tools { flex-wrap: wrap; }
.share-tools > span { color: var(--muted); font-size: .84rem; }
.share-tools input { min-width: 0; width: 100%; padding: .45rem; }
.featured-work { display: inline-block; margin-top: .85rem; color: #d6f0db; text-underline-offset: .2em; font-size: .91rem; font-weight: 650; }
.featured-work:hover { color: white; }
:lang(en) .hero h1 { letter-spacing: -.025em; }
@media (max-width: 44rem) {
  .header-inner { gap: .55rem; }
  .dialog-top { gap: .4rem; }
  .dialog-actions { gap: .32rem; }
  .dialog-actions .language-switch { min-height: 2.5rem; padding-inline: .4rem; font-size: .78rem; }
}
@media (max-width: 26rem) {
  .header-inner .bag-label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
}
