/* Sheet Music Next visual layer. Keep DOM, data, APIs and reader behavior from the production catalog. */
:root {
  --next-ink: #152320;
  --next-muted: #5f716c;
  --next-soft: #eef8f6;
  --next-mint: #dff5ef;
  --next-sky: #e8f4ff;
  --next-cream: #fff7df;
  --next-paper: rgba(255, 255, 255, 0.86);
  --next-paper-strong: rgba(255, 255, 255, 0.96);
  --next-line: rgba(72, 111, 103, 0.18);
  --next-line-strong: rgba(50, 113, 104, 0.26);
  --next-green: #1f9d86;
  --next-green-dark: #147965;
  --next-blue: #2f83d7;
  --next-yellow: #e9b84a;
  --next-shadow: 0 16px 46px rgba(40, 92, 85, 0.10), 0 1px 2px rgba(24, 44, 40, 0.05);
  --next-shadow-soft: 0 10px 32px rgba(52, 99, 91, 0.08);
}

body {
  color: var(--next-ink);
  background:
    linear-gradient(180deg, rgba(240, 250, 247, 0.96) 0%, rgba(246, 251, 249, 0.92) 34%, rgba(250, 249, 242, 0.96) 100%),
    repeating-linear-gradient(90deg, rgba(31, 157, 134, 0.035) 0 1px, transparent 1px 48px);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 42%),
    repeating-linear-gradient(0deg, rgba(25, 95, 84, 0.035) 0 1px, transparent 1px 28px);
}

main {
  width: min(1280px, 100%);
  padding-top: 20px;
}

.route-view {
  min-height: calc(100dvh - 40px);
}

.home-shell {
  min-height: auto;
  grid-template-rows: auto auto auto;
  gap: 16px;
}

.home-topbar,
.page-topbar {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--next-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 34px rgba(48, 91, 84, 0.08);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.home-topbar {
  padding: 8px 10px;
}

.home-topbar .home-topbar-actions,
.page-topbar .page-actions {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  min-width: 0;
}

.home-topbar .account-menu,
.page-topbar .account-menu,
.home-topbar .anonymous-register-link,
.page-topbar .anonymous-register-link {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  min-width: 0;
}

.home-topbar .account-menu:not([hidden]),
.page-topbar .account-menu:not([hidden]) {
  display: block;
}

.home-topbar .account-toggle,
.page-topbar .account-toggle {
  width: auto;
  max-width: 138px;
  min-height: 34px;
  justify-content: flex-start;
  border-color: rgba(31, 157, 134, 0.18);
  color: var(--next-ink);
  background: rgba(255, 255, 255, 0.74);
}

.home-topbar .account-name,
.page-topbar .account-name {
  color: var(--next-ink);
  font-weight: 720;
}

.page-topbar {
  margin-bottom: 18px;
  padding: 7px;
}

.page-topbar::before {
  display: none;
}

.home-topbar-actions,
.page-actions {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
}

.home-topbar-actions > button,
.page-actions > button,
.route-link {
  width: auto;
  min-width: 54px;
  min-height: 34px;
  border-radius: 999px;
  color: #27433d;
  font-size: 13px;
  font-weight: 650;
}

.route-link:hover {
  color: var(--next-green-dark);
  background: rgba(31, 157, 134, 0.10);
}

.route-link.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #28aa92, #1c8d78);
  box-shadow: 0 8px 18px rgba(31, 157, 134, 0.22);
}

.home-panel {
  width: min(820px, 100%);
  padding: clamp(46px, 8dvh, 82px) 0 clamp(34px, 6dvh, 62px);
  gap: 20px;
}

.home-greeting {
  position: relative;
  max-width: min(100%, 20em);
  margin: 0 auto;
  color: var(--next-ink);
  font-size: clamp(26px, 4.1vw, 46px);
  font-weight: 720;
  line-height: 1.16;
}

.home-greeting::after {
  content: "";
  display: block;
  width: 92px;
  height: 7px;
  margin: 14px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--next-yellow), var(--next-green));
  opacity: 0.78;
}

.home-search {
  width: min(760px, 100%);
}

.home-search-box,
.search-box {
  border-color: var(--next-line-strong);
  background: var(--next-paper-strong);
  box-shadow: var(--next-shadow-soft);
}

.home-search-box {
  padding: 9px;
}

input[type="search"],
.home-search-box input[type="search"] {
  color: var(--next-ink);
  background: transparent;
}

input[type="search"]::placeholder {
  color: rgba(70, 91, 86, 0.62);
}

.search-submit,
.home-search-box .search-submit,
.upload-submit {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(180deg, #28aa92, #198571);
  box-shadow: 0 10px 20px rgba(31, 157, 134, 0.22);
}

.search-submit:hover,
.home-search-box .search-submit:hover,
.upload-submit:hover {
  background: linear-gradient(180deg, #31b79f, #167b68);
}

.home-footnote-block {
  width: min(1120px, 100%);
  margin: 0 auto 6px;
  border: 1px solid var(--next-line);
  border-radius: 20px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.92), rgba(239, 249, 246, 0.76)),
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(40, 95, 87, 0.05) 24px 25px);
  box-shadow: var(--next-shadow);
}

.home-footnote-kicker,
.catalog-eyebrow {
  color: var(--next-green-dark);
  letter-spacing: 0.08em;
}

.home-footnote-title {
  color: var(--next-ink);
}

.home-app-copy {
  margin-top: 22px;
}

.home-product-tags {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.home-product-tag {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(31, 157, 134, 0.18);
  border-radius: 999px;
  background: rgba(232, 247, 243, 0.78);
  color: var(--next-green-dark);
  font-size: 11px;
  font-weight: 680;
  line-height: 1.2;
  white-space: nowrap;
}

.home-app-link {
  border-color: rgba(31, 157, 134, 0.20);
  color: var(--next-green-dark);
  background: rgba(232, 247, 243, 0.82);
}

.home-app-link-featured {
  border-color: rgba(31, 157, 134, 0.30);
  color: #123f36;
  background: linear-gradient(180deg, rgba(241, 250, 247, 0.96), rgba(221, 243, 237, 0.94));
  box-shadow: 0 8px 18px rgba(35, 105, 92, 0.10);
}

.home-app-link:hover {
  background: rgba(219, 242, 236, 0.96);
}

.home-footnote-visuals {
  --home-promo-icon-size: 82px;
  display: grid;
  grid-template-columns: repeat(5, var(--home-promo-icon-size));
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(31, 157, 134, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.52);
}

.home-footnote-icon-link {
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.home-footnote-icon-link:hover {
  transform: translateY(-2px);
}

.home-footnote-icon-link:focus-visible {
  outline: 3px solid rgba(31, 157, 134, 0.28);
  outline-offset: 3px;
}

.home-footnote-visuals .home-footnote-visual,
.home-qingchang-app-badge,
.home-theory-site-badge,
.home-guitar-tools-badge,
.home-dueagain-badge {
  flex: 0 0 var(--home-promo-icon-size);
  width: var(--home-promo-icon-size);
  height: var(--home-promo-icon-size);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(31, 157, 134, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 24px rgba(39, 99, 88, 0.12);
}

.home-qingchang-app-badge,
.home-theory-site-badge,
.home-guitar-tools-badge,
.home-dueagain-badge {
  border-radius: 20px;
}

.home-footnote-visual img,
.home-qingchang-app-icon,
.home-theory-site-icon,
.home-guitar-tools-icon,
.home-dueagain-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-app-screens {
  --app-shot-width: 80px;
  --app-shot-height: 174px;
  --app-shot-offset: 88px;
  position: relative;
  width: 228px;
  height: var(--app-shot-height);
  justify-self: center;
}

.home-app-shot {
  margin: 0;
  position: absolute;
  bottom: 0;
  width: var(--app-shot-width);
  height: var(--app-shot-height);
  overflow: hidden;
  border: 1px solid rgba(31, 157, 134, 0.16);
  border-radius: 12px;
  background: var(--next-paper-strong);
  box-shadow: 0 8px 16px rgba(38, 91, 83, 0.12);
}

.home-app-shot:nth-child(1) {
  left: calc(50% - var(--app-shot-offset));
  z-index: 1;
  transform: rotate(-4deg);
}

.home-app-shot:nth-child(2) {
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
}

.home-app-shot:nth-child(3) {
  right: calc(50% - var(--app-shot-offset));
  z-index: 2;
  transform: rotate(4deg);
}

.home-app-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.catalog-hero-compact,
.page-hero {
  border: 1px solid var(--next-line);
  border-radius: 20px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.92), rgba(234, 248, 244, 0.78)),
    repeating-linear-gradient(0deg, transparent 0 26px, rgba(31, 157, 134, 0.045) 26px 27px);
  box-shadow: var(--next-shadow-soft);
}

.catalog-hero h2 {
  color: var(--next-ink);
  font-weight: 760;
}

.catalog-hero p,
.view-heading p,
.section-detail,
.home-footnote,
.upload-steps span,
.upload-message {
  color: var(--next-muted);
}

.catalog-stat {
  border-color: rgba(47, 131, 215, 0.14);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.catalog-stat strong {
  color: var(--next-green-dark);
}

.catalog-toolbar,
.toolbar {
  border: 1px solid var(--next-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--next-shadow-soft);
}

.toolbar-controls,
.sort-controls {
  gap: 8px;
}

.segmented,
.author-quick-row,
.artist-letter-index {
  border: 1px solid var(--next-line);
  background: rgba(255, 255, 255, 0.72);
}

.segmented button,
.author-quick-chip,
.artist-letter-index button {
  color: #35534d;
}

.segmented button.active,
.author-quick-chip:hover,
.artist-letter-index button.active {
  color: var(--next-green-dark);
  border-color: rgba(31, 157, 134, 0.18);
  background: rgba(31, 157, 134, 0.12);
}

.sort-select,
.my-filter-mode,
.my-filter-value,
.upload-form input,
.upload-form select,
.custom-tag-dropdown-button {
  border-color: var(--next-line);
  color: var(--next-ink);
  background: rgba(255, 255, 255, 0.88);
}

.score-section {
  border: 1px solid var(--next-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 28px rgba(40, 92, 85, 0.07);
  overflow: visible;
}

.score-section > h2 {
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(232, 248, 244, 0.92), rgba(255, 250, 235, 0.70));
}

.score-section:not(.collapsed) .table-wrap {
  display: block;
}

.section-toggle {
  border-color: transparent;
}

.section-title,
.my-section-title {
  color: var(--next-ink);
}

.section-count,
.page-count {
  color: var(--next-green-dark);
  background: rgba(31, 157, 134, 0.10);
  border-color: rgba(31, 157, 134, 0.16);
}

.table-wrap {
  border-color: rgba(72, 111, 103, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

table {
  color: var(--next-ink);
}

th {
  color: #42605a;
  background: rgba(239, 248, 245, 0.88);
}

td {
  border-color: rgba(72, 111, 103, 0.12);
}

tr.score-row:hover td {
  background: rgba(238, 248, 245, 0.74);
}

.view-score,
.favorite-score,
.playlist-score,
.learn,
.edit-score,
.delete-score,
.delete-upload {
  border-radius: 999px;
}

.view-score {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(180deg, #28aa92, #198571);
}

.favorite-score {
  color: var(--next-blue);
  border-color: rgba(47, 131, 215, 0.20);
  background: rgba(232, 244, 255, 0.88);
}

.playlist-score {
  color: var(--next-green-dark);
  border-color: rgba(31, 157, 134, 0.20);
  background: rgba(229, 247, 242, 0.92);
}

.learn {
  color: #8a651a;
  border-color: rgba(233, 184, 74, 0.24);
  background: rgba(255, 247, 223, 0.94);
}

.favorite-score.active,
.playlist-score.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #2f83d7, #246eb8);
}

.my-grid {
  gap: 14px;
}

.my-section {
  background: rgba(255, 255, 255, 0.82);
}

.my-section-kicker {
  color: var(--next-green-dark);
}

.my-filter-bar {
  border-top-color: rgba(72, 111, 103, 0.12);
  background: rgba(246, 251, 249, 0.70);
}

.upload-layout {
  gap: 16px;
}

.upload-steps {
  border-color: var(--next-line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(235, 248, 244, 0.82)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(47, 131, 215, 0.04) 23px 24px);
  box-shadow: var(--next-shadow-soft);
}

.upload-steps strong {
  color: var(--next-ink);
}

.upload-card {
  border-color: var(--next-line);
  border-radius: 18px;
  background: var(--next-paper-strong);
  box-shadow: var(--next-shadow);
}

.upload-form label {
  color: #47645e;
  font-weight: 620;
}

.upload-form input:focus,
.upload-form select:focus,
.custom-tag-dropdown-button[aria-expanded="true"],
input[type="search"]:focus {
  border-color: rgba(31, 157, 134, 0.46);
  box-shadow: 0 0 0 4px rgba(31, 157, 134, 0.10);
  outline: none;
}

.empty {
  border: 1px dashed rgba(31, 157, 134, 0.24);
  border-radius: 16px;
  color: var(--next-muted);
  background: rgba(255, 255, 255, 0.72);
}

#all-scores-view .catalog-page {
  gap: 11px;
  padding-bottom: 24px;
}

#all-scores-view .catalog-hero-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 20px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(241, 251, 247, 0.84) 66%, rgba(255, 251, 235, 0.42));
  box-shadow: 0 8px 24px rgba(36, 82, 76, 0.055);
}

#all-scores-view .catalog-hero-copy {
  display: grid;
  gap: 5px;
}

#all-scores-view .catalog-eyebrow {
  width: fit-content;
  margin: 0;
  padding: 3px 8px;
  border: 1px solid rgba(31, 157, 134, 0.16);
  border-radius: 999px;
  background: rgba(231, 248, 243, 0.82);
  color: var(--next-green-dark);
  font-size: 10.5px;
}

#all-scores-view .catalog-hero h2 {
  font-size: clamp(30px, 3vw, 38px);
}

#all-scores-view .catalog-hero p {
  max-width: 36em;
  margin: 0;
  font-size: 14px;
}

#all-scores-view .catalog-stats {
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
  max-width: 360px;
  padding: 0;
  border: 0;
  background: transparent;
}

#all-scores-view .catalog-stat {
  min-height: 34px;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  border-color: rgba(31, 157, 134, 0.14);
  border-radius: 999px;
  background: rgba(245, 252, 249, 0.78);
  box-shadow: none;
}

#all-scores-view .catalog-stat strong {
  font-size: 18px;
  line-height: 1;
}

#all-scores-view .catalog-stat span {
  font-size: 12px;
}

#all-scores-view .catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 18px rgba(39, 99, 88, 0.045);
}

#all-scores-view .catalog-toolbar .search-box {
  order: 1;
  flex: 1 1 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  width: auto;
  min-width: 0;
  border-radius: 14px;
  box-shadow: none;
}

#all-scores-view .catalog-toolbar input[type="search"] {
  width: 100%;
}

#all-scores-view .toolbar-controls {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  gap: 8px;
  min-width: 0;
}

#all-scores-view .catalog-view-toggle,
#all-scores-view .sort-controls {
  min-height: 36px;
  padding: 3px;
  border: 1px solid rgba(31, 157, 134, 0.10);
  border-radius: 999px;
  background: rgba(246, 251, 249, 0.76);
}

#all-scores-view .catalog-view-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
}

body.admin-user #all-scores-view .catalog-view-toggle {
  grid-template-columns: repeat(3, minmax(78px, 1fr));
}

#all-scores-view .sort-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  justify-self: auto;
  width: auto;
}

#all-scores-view .catalog-view-toggle button,
#all-scores-view .sort-select {
  min-height: 34px;
}

#all-scores-view .view-heading {
  display: grid;
  gap: 3px;
  margin: 3px 0 -1px;
  padding: 0 2px;
}

#all-scores-view .view-heading h2 {
  color: #2b4741;
  font-size: 15px;
  font-weight: 740;
}

#all-scores-view .view-heading p {
  max-width: 42em;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

#all-scores-view .admin-tag-row,
#all-scores-view .author-quick-row,
#all-scores-view .artist-quick-row {
  gap: 7px;
  margin: 8px 0 4px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 157, 134, 0.10);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: none;
}

#all-scores-view .admin-tag-row-label,
#all-scores-view .author-quick-row-label,
#all-scores-view .artist-quick-row-label {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(231, 248, 243, 0.84);
  color: var(--next-green-dark);
}

#all-scores-view .admin-tag-chip,
#all-scores-view .author-quick-chip,
#all-scores-view .artist-quick-chip {
  min-height: 30px;
  padding: 5px 11px;
  border-color: rgba(31, 157, 134, 0.12);
  background: rgba(250, 253, 251, 0.88);
}

#all-scores-view .view-pane {
  gap: 10px;
}

#all-scores-view .score-section {
  position: relative;
  border: 1px solid rgba(31, 157, 134, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: 0 8px 24px rgba(40, 92, 85, 0.055);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#all-scores-view .score-section > h2 {
  background: linear-gradient(90deg, rgba(231, 248, 243, 0.82), rgba(255, 255, 255, 0.94) 42%, rgba(255, 251, 235, 0.52));
}

#all-scores-view .score-section.collapsed {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 16px 30px rgba(40, 92, 85, 0.105),
    0 3px 8px rgba(22, 52, 48, 0.045);
}

#all-scores-view .score-section.collapsed:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 157, 134, 0.20);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 20px 34px rgba(40, 92, 85, 0.13),
    0 4px 10px rgba(22, 52, 48, 0.055);
}

#all-scores-view .score-section.collapsed .section-toggle {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 252, 249, 0.90));
}

#all-scores-view .score-section:not(.collapsed) {
  box-shadow: 0 3px 14px rgba(40, 92, 85, 0.045);
}

#all-scores-view .score-section:not(.collapsed) .table-wrap {
  border-top-color: rgba(31, 157, 134, 0.10);
  background: rgba(250, 253, 251, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

#all-scores-view .section-toggle {
  min-height: 62px;
  padding: 13px 16px;
}

@media (min-width: 701px) {
  #home-view .home-footnote-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 470px;
    gap: 16px;
    align-items: center;
    padding: 20px 22px;
  }

  .catalog-page,
  #search-view,
  #my-view,
  #upload-view,
  #edit-view {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 900px) {
  .catalog-hero-compact,
  #all-scores-view .catalog-hero-compact {
    grid-template-columns: 1fr;
  }

  .catalog-stats,
  #all-scores-view .catalog-stats {
    width: 100%;
  }

  #all-scores-view .catalog-toolbar {
    flex-wrap: wrap;
  }

  #all-scores-view .catalog-toolbar .search-box {
    flex-basis: 100%;
    order: 1;
  }

  #all-scores-view .toolbar-controls {
    order: 2;
    width: 100%;
    justify-content: space-between;
  }

  #all-scores-view .catalog-view-toggle,
  #all-scores-view .sort-controls {
    width: 100%;
  }

  #home-view .home-footnote-block {
    grid-template-columns: minmax(0, 1fr) 296px;
  }

  .home-footnote-visuals {
    --home-promo-icon-size: 52px;
    gap: 6px;
    padding: 6px;
    border-radius: 19px;
  }
}

@media (max-width: 700px) {
  main {
    padding: 8px 8px 18px;
  }

  .home-shell {
    gap: 10px;
  }

  .home-topbar,
  .page-topbar,
  .catalog-hero-compact,
  .page-hero,
  .catalog-toolbar,
  .toolbar,
  .home-footnote-block,
  .upload-card,
  .upload-steps,
  .score-section {
    border-radius: 14px;
  }

  .home-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    margin: 0;
    padding: 6px 7px;
    min-height: 0;
  }

  .page-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    margin: 0;
    padding: 6px 7px;
  }

  .home-topbar-actions,
  .page-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  #home-view .home-topbar .home-topbar-actions > .route-link,
  #search-view .page-topbar .page-actions > .route-link,
  #all-scores-view .page-topbar .page-actions > .route-link,
  #my-view .page-topbar .page-actions > .route-link,
  #upload-view .page-topbar .page-actions > .route-link,
  #edit-view .page-topbar .page-actions > .route-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    min-height: 40px;
    padding: 0 6px;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
  }

  .home-topbar .account-menu:not([hidden]),
  .page-topbar .account-menu:not([hidden]) {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    max-width: 100%;
    justify-self: end;
  }

  .home-topbar .account-toggle,
  .page-topbar .account-toggle {
    max-width: 92px;
    min-height: 40px;
    justify-content: flex-start;
  }

  .home-panel {
    width: min(820px, 100%);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-top: 26px;
    padding-bottom: 24px;
    align-content: center;
    gap: 16px;
    transform: none;
  }

  #home-view .home-search {
    width: min(100%, 640px);
    padding: 0;
  }

  .home-greeting {
    font-size: clamp(25px, 8.5vw, 34px);
  }

  .home-search-box {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 16px;
  }

  .home-search-box .search-submit {
    width: 100%;
    min-height: 44px;
  }

  #all-scores-view .catalog-page {
    gap: 10px;
    padding-bottom: 16px;
  }

  #all-scores-view .catalog-hero-compact {
    gap: 10px;
    padding: 14px;
  }

  #all-scores-view .catalog-eyebrow {
    font-size: 10px;
  }

  #all-scores-view .catalog-hero h2 {
    font-size: 28px;
  }

  #all-scores-view .catalog-stats {
    justify-content: flex-start;
    gap: 6px;
    padding: 0;
  }

  #all-scores-view .catalog-stat {
    min-height: 30px;
    padding: 4px 8px;
  }

  #all-scores-view .catalog-stat strong {
    font-size: 16px;
  }

  #all-scores-view .catalog-toolbar {
    gap: 7px;
    padding: 8px;
    border-radius: 15px;
  }

  #all-scores-view .catalog-toolbar .search-box {
    grid-template-columns: minmax(0, 1fr) 72px;
    border-radius: 14px;
  }

  #all-scores-view .catalog-toolbar input[type="search"] {
    min-width: 0;
    font-size: 13px;
  }

  #all-scores-view .catalog-toolbar .search-submit {
    width: 72px;
    padding-left: 0;
    padding-right: 0;
  }

  #all-scores-view .toolbar-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  #all-scores-view .catalog-view-toggle,
  #all-scores-view .sort-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 14px;
    width: 100%;
  }

  body.admin-user #all-scores-view .catalog-view-toggle {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #all-scores-view .catalog-view-toggle button,
  #all-scores-view .sort-controls select {
    min-width: 0;
    min-height: 38px;
    font-size: 12px;
  }

  #all-scores-view .admin-tag-row,
  #all-scores-view .author-quick-row,
  #all-scores-view .artist-quick-row {
    max-height: none;
    margin: 7px 0 3px;
    padding: 8px;
    border-radius: 14px;
  }

  #all-scores-view .section-toggle {
    min-height: 58px;
    padding: 11px 12px;
  }

  .home-footnote-block {
    width: min(100%, 640px);
    margin: 10px auto max(8px, env(safe-area-inset-bottom));
    padding: 15px;
    align-self: auto;
    transform: none;
  }

  #home-view .home-footnote-block {
    grid-template-columns: minmax(0, 1fr) 296px;
  }

  .home-footnote-visuals {
    --home-promo-icon-size: 52px;
    gap: 6px;
    padding: 6px;
    border-radius: 19px;
  }

  .home-product-tags {
    margin-top: 8px;
    gap: 5px;
  }

  .home-product-tag {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 10px;
  }

  .home-app-screens {
    --app-shot-width: 64px;
    --app-shot-height: 140px;
    --app-shot-offset: 58px;
    width: 132px;
  }

  .home-app-shot {
    border-radius: 9px;
  }

  .catalog-stat {
    padding: 9px 10px;
  }
}

@media (max-width: 640px) {
  #home-view .home-footnote-block {
    grid-template-columns: 1fr;
  }

  .home-footnote-visuals {
    --home-promo-icon-size: 50px;
    width: fit-content;
    justify-content: start;
    order: -1;
    gap: 5px;
    padding: 6px;
  }

  .home-app-screens {
    width: min(100%, 246px);
    justify-self: center;
    --app-shot-width: 83px;
    --app-shot-height: 180px;
    --app-shot-offset: 98px;
  }

  .home-app-shot {
    border-radius: 12px;
  }
}

@media (max-width: 380px) {
  #home-view .home-topbar .home-topbar-actions > .route-link,
  #search-view .page-topbar .page-actions > .route-link,
  #all-scores-view .page-topbar .page-actions > .route-link,
  #my-view .page-topbar .page-actions > .route-link,
  #upload-view .page-topbar .page-actions > .route-link,
  #edit-view .page-topbar .page-actions > .route-link {
    min-height: 38px;
    padding: 0 4px;
    font-size: 12px;
  }

  .page-topbar {
    margin-bottom: 10px;
    padding: 5px;
  }

  .home-panel {
    padding-top: 22px;
  }

  .home-greeting {
    font-size: clamp(24px, 8vw, 30px);
  }

  .home-footnote-visuals {
    --home-promo-icon-size: 46px;
    gap: 4px;
    padding: 5px;
  }

  #all-scores-view .catalog-hero-compact {
    padding: 13px 11px;
  }

  #all-scores-view .catalog-hero h2,
  .page-hero h2 {
    font-size: 25px;
  }

  #all-scores-view .catalog-stat {
    min-height: 30px;
    padding: 4px 7px;
  }

  #all-scores-view .catalog-stat strong {
    font-size: 16px;
  }

  #all-scores-view .catalog-stat span {
    font-size: 11px;
  }

  #all-scores-view .catalog-toolbar .search-box {
    grid-template-columns: minmax(0, 1fr);
  }

  #all-scores-view .catalog-toolbar .search-submit {
    width: 100%;
  }
}
