/* Profile — sheet-sized desk rail + composer overlay */

:root {
  --letter-short: 8.5in;
  --letter-long: 11in;
  /* Available vertical room between fixed shell chrome + profile toolbar/spacing */
  --desk-vertical-budget: calc(100vh - var(--shell-header-offset) - var(--shell-footer-offset) - 4.5rem);
  /* Never wider than viewport minus safe padding (rotation bleed + rail inset) */
  --desk-safe-x: calc(env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px) + 3rem);
  /* Slightly smaller than full letter on the rail so more desk shows around each sheet */
  --desk-sheet-scale: 0.82;
  /* vh first for hosts / older WebKit where dvh is missing or flaky */
  --sheet-w-raw: min(
    var(--letter-short),
    calc(100vw - var(--desk-safe-x)),
    calc(min(var(--letter-long), var(--desk-vertical-budget)) * 8.5 / 11)
  );
  --sheet-w: calc(var(--sheet-w-raw) * var(--desk-sheet-scale));
  --desk-overlap: clamp(1.4rem, 3.8vw, 2rem);
}

@supports (height: 100dvh) {
  :root {
    --desk-vertical-budget: calc(100dvh - var(--shell-header-offset) - var(--shell-footer-offset) - 4.5rem);
    --sheet-w-raw: min(
      var(--letter-short),
      calc(100vw - var(--desk-safe-x)),
      calc(min(var(--letter-long), var(--desk-vertical-budget)) * 8.5 / 11)
    );
  }
}

body.composer-open {
  overflow: hidden;
}

/* Let desk cards (tilted) extend without clipping; vertical scroll still works */
.profile-page-main.page-main {
  overflow-x: hidden;
  overflow-y: auto;
}

.profile-page-main .subpage-inner {
  overflow-x: hidden;
  overflow-y: visible;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
  align-self: stretch;
}

.profile-toolbar {
  position: relative;
  z-index: 12;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left));
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

.profile-welcome {
  margin: 0 0 0 0.35rem;
  font-size: clamp(1.18rem, 2.85vw, 1.38rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.logo-desk-tag {
  display: inline-block;
  margin-left: 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250, 248, 240, 0.72);
  vertical-align: middle;
}

.logo-desk-tag::before {
  content: "·";
  margin-right: 0.45rem;
  color: rgba(250, 248, 240, 0.45);
}

.profile-welcome span {
  color: var(--accent, #c4a574);
}

/* Display name from session — keep original capitalization. */
.profile-welcome .js-profile-name {
  text-transform: none;
}

.profile-toolbar-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.header-compose-toggle {
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 224, 0.2),
    0 0 0 1px rgba(58, 44, 24, 0.7);
}

.header-compose-toggle .header-compose-btn {
  min-height: 2.2rem;
  min-width: clamp(6.25rem, 11vw, 7.75rem);
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  font-weight: 900;
}

.header-compose-toggle .profile-new-song {
  color: #1f1710;
  text-shadow: 0 1px 0 rgba(255, 246, 226, 0.5);
  background: linear-gradient(180deg, #dbc79e 0%, #c8ad7a 52%, #b59462 100%);
  border-color: rgba(106, 74, 34, 0.62);
}

.header-compose-toggle .profile-new-song:hover {
  filter: brightness(1.06);
}

.header-compose-toggle .profile-new-album {
  color: rgba(250, 248, 240, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  background: linear-gradient(180deg, rgba(34, 35, 48, 0.98) 0%, rgba(18, 20, 32, 0.98) 100%);
  border-color: rgba(165, 140, 100, 0.55);
}

.header-compose-toggle .profile-new-album:hover {
  filter: brightness(1.1);
  border-color: rgba(185, 164, 128, 0.82);
}

.profile-new-song {
  padding: 0.5rem 1.15rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--void, #050506);
  background: var(--accent, #c4a574);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 2.5rem;
}

.profile-new-song:hover {
  filter: brightness(1.06);
}

.profile-new-album {
  padding: 0.5rem 1.15rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream, #f6f3ea);
  background: rgba(196, 165, 116, 0.18);
  border: 1px solid rgba(196, 165, 116, 0.45);
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 2.5rem;
}

.profile-new-album:hover {
  filter: brightness(1.08);
  border-color: rgba(196, 165, 116, 0.65);
}

.profile-signout {
  padding: 0.45rem 1rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream, #f6f3ea);
  background: rgba(250, 248, 240, 0.06);
  border: 1px solid var(--line, rgba(250, 248, 240, 0.12));
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.profile-signout:hover {
  border-color: rgba(196, 165, 116, 0.4);
  color: var(--accent, #c4a574);
}

.profile-desk-section {
  width: 100%;
  max-width: none;
  /* Flex min-width:auto would otherwise follow the sum of desk cards and block horizontal scroll on the rail */
  min-width: 0;
  overflow-x: hidden;
  margin: 0;
  padding: 0.75rem max(1.75rem, env(safe-area-inset-right)) max(3rem, calc(1.75rem + env(safe-area-inset-bottom)))
    max(1.75rem, env(safe-area-inset-left));
  box-sizing: border-box;
}

.profile-desk-heading {
  margin: 0 0 0.75rem max(0.35rem, env(safe-area-inset-left));
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(250, 248, 240, 0.42);
}

.profile-desk-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
  align-items: start;
  gap: 1.6rem;
  overflow-x: hidden;
  overflow-y: visible;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.75rem max(0.35rem, env(safe-area-inset-right)) 2rem max(0.35rem, env(safe-area-inset-left));
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.desk-card {
  position: relative;
  width: 100%;
  max-width: none;
  aspect-ratio: 8.5 / 11;
  margin-right: 0;
  padding: 0;
  background: #fbf9f4;
  color: #2c2824;
  border: 1px solid rgba(45, 40, 35, 0.15);
  border-radius: 2px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    3px 5px 0 rgba(230, 225, 215, 0.75),
    8px 16px 28px rgba(0, 0, 0, 0.35);
  transform: none;
  cursor: pointer;
  touch-action: pan-y;
}

.desk-card:focus-visible {
  outline: 3px solid rgba(196, 165, 116, 0.85);
  outline-offset: 4px;
}

.desk-card:last-child {
  margin-right: 0;
}

/* Album desk: tab strip (album name) + one track at a time, same layout as single-song cards */
.desk-card--album {
  aspect-ratio: 8.5 / 11;
}

.desk-card-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 1.5rem 0.85rem 0.85rem 1.65rem;
  overflow: hidden;
  box-sizing: border-box;
}

.desk-card--album .desk-card-inner--album {
  padding: 1.05rem 0.85rem 0.85rem 1.65rem;
  gap: 0.5rem;
}

.desk-album-tab-bar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0 0 0.42rem;
  margin-top: -0.08rem;
  margin-bottom: 0.06rem;
  border-bottom: 1px solid rgba(45, 40, 35, 0.12);
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.92) 0%, rgba(251, 249, 244, 0.55) 100%);
  border-radius: 4px 4px 0 0;
  cursor: default;
}

.desk-album-tab-bar:focus-visible {
  outline: 2px solid rgba(196, 165, 116, 0.8);
  outline-offset: 2px;
}

.desk-album-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: 0;
  color: rgba(58, 50, 40, 0.62);
  background: linear-gradient(165deg, #fdfbf6 0%, #f5eedf 42%, #ebe2d2 100%);
  border: 1px solid rgba(196, 165, 116, 0.28);
  border-radius: 50%;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 1px 4px rgba(70, 58, 42, 0.06);
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
}

.desk-album-nav__svg {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.desk-album-nav:hover:not(:disabled) {
  color: rgba(42, 36, 28, 0.88);
  background: linear-gradient(165deg, #fffefb 0%, #f2e8d4 48%, #e8dcc4 100%);
  border-color: rgba(196, 165, 116, 0.48);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 2px 10px rgba(196, 165, 116, 0.14);
}

.desk-album-nav:active:not(:disabled) {
  transform: scale(0.94);
}

.desk-album-nav:disabled {
  opacity: 0.34;
  cursor: default;
  color: rgba(37, 34, 32, 0.45);
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(45, 40, 35, 0.08);
  box-shadow: none;
}

.desk-album-tab-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.1rem;
  min-width: 0;
}

.desk-album-tab-badge {
  display: inline-block;
  margin-top: 0.08rem;
  margin-bottom: 0.22rem;
  padding: 0.08rem 0.36rem;
  font-family: var(--font-roboto);
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3d3528;
  background: rgba(196, 165, 116, 0.45);
  border-radius: 3px;
}

.desk-album-tab-title {
  font-family: var(--font-roboto);
  font-size: clamp(1.02rem, 4.2vw, 1.58rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0.012em;
  text-transform: uppercase;
  color: #5a5652;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.desk-album-tab-artist {
  font-family: var(--font-roboto);
  font-size: clamp(0.58rem, 1.25vw, 0.68rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent, #c4a574);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.desk-album-tab-counter {
  font-family: var(--font-roboto);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a7268;
  margin-top: 0.04rem;
}

.desk-album-track-panels {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.desk-album-track-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.desk-album-track-panel[hidden] {
  display: none !important;
}

.desk-album-track-panel .desk-card-head {
  flex-shrink: 0;
  margin-bottom: 0.45rem;
}

.desk-album-track-panel .desk-lyrics-scroll {
  flex: 1 1 auto;
  min-height: 0;
}

.desk-album-empty {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(90, 82, 72, 0.78);
  font-style: italic;
}

.desk-card-genre-chip {
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

.desk-card-genre-chip:hover {
  text-decoration: none;
  color: color-mix(in oklab, currentColor 78%, #fff 22%);
}

.desk-card-genre-chip--fallback {
  color: color-mix(in oklab, var(--accent, #c4a574) 88%, #2c2824 12%) !important;
}

.desk-card-cover-wrap {
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 0 0.65rem;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(45, 40, 35, 0.12);
  background: #e8e4dc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desk-card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.desk-card-cover-wrap--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #3a3530 0%, #1c1a18 55%, #2a2622 100%);
}

.desk-card-cover-initials {
  font-size: clamp(1.75rem, 6.5vmin, 2.35rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(250, 248, 240, 0.88);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}


.desk-card-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1rem;
  height: 100%;
  border-right: 1px solid rgba(200, 80, 70, 0.18);
  background: linear-gradient(90deg, rgba(255, 252, 248, 0.6) 0%, transparent 100%);
  pointer-events: none;
}

.desk-card-head {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}

.desk-card-title {
  margin: 0;
  font-family: var(--font-roboto);
  font-size: clamp(1.2rem, 2.65vw, 1.45rem);
  font-weight: 700;
  font-style: normal;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #0f0f0f;
}

.desk-card-artist {
  margin: 0.22rem 0 0;
  font-family: var(--font-roboto);
  font-size: clamp(0.82rem, 1.75vw, 0.92rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent, #c4a574);
}

.desk-card-date {
  margin: 0.2rem 0 0;
  font-family: var(--font-roboto);
  font-size: clamp(0.58rem, 1.25vw, 0.64rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a7268;
}

/* Scroll shell + inner (matches song sheet: .detail-lyrics-scroll / -inner). */
.desk-card-inner > .desk-lyrics-scroll {
  flex: 1 1 auto;
  min-height: 0;
}

.desk-lyrics-scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  border-radius: 3px;
  border: 1px solid rgba(45, 40, 35, 0.1);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.desk-lyrics-scroll-inner {
  position: relative;
  /* Tighter than the public song sheet so desk previews use more line width; slips still clear the text. */
  padding-left: clamp(1rem, 3.8vw, 1.45rem);
  padding-right: clamp(1.65rem, 5.5vw, 2.15rem);
}

.desk-card-lyrics {
  margin: 0;
  padding: clamp(0.5rem, 1.8vw, 0.75rem) 0 clamp(0.55rem, 2vw, 0.85rem);
  overflow: visible;
  font-family: var(--font-roboto);
}

/* Margin slips — same structure/classes as song page (`song.css` .song-stickies). */
.desk-lyrics-scroll-inner .song-stickies {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.desk-lyrics-scroll-inner .song-sticky {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  width: clamp(2.75rem, 18vw, 5rem);
  max-width: 38%;
  padding: 0.45rem 0.5rem;
  font-size: 0.62rem;
  line-height: 1.35;
  color: #2c2824;
  background: linear-gradient(145deg, #fffef6 0%, #f5ebc8 100%);
  border: 1px solid rgba(80, 70, 50, 0.25);
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  transform-origin: center center;
}

.desk-lyrics-scroll-inner .song-sticky--left {
  left: 0.15rem;
  right: auto;
  transform: translateY(-50%) rotate(-2.5deg);
}

.desk-lyrics-scroll-inner .song-sticky--right {
  right: 0.15rem;
  left: auto;
  transform: translateY(-50%) rotate(2.5deg);
}

.desk-lyrics-scroll-inner .song-sticky--amber {
  background: linear-gradient(148deg, #fff8e8 0%, #ffe6a8 100%);
  border-color: rgba(140, 110, 40, 0.35);
}

.desk-lyrics-scroll-inner .song-sticky--mint {
  background: linear-gradient(148deg, #f4fff8 0%, #c8eedc 100%);
  border-color: rgba(60, 120, 90, 0.32);
}

.desk-lyrics-scroll-inner .song-sticky--rose {
  background: linear-gradient(148deg, #fff8f8 0%, #ffd6de 100%);
  border-color: rgba(140, 80, 90, 0.3);
}

.desk-lyrics-scroll-inner .song-sticky--sky {
  background: linear-gradient(148deg, #f6faff 0%, #c8e2ff 100%);
  border-color: rgba(70, 110, 160, 0.32);
}

.desk-lyrics-scroll-inner .song-sticky--legacy {
  width: auto;
  max-width: 38%;
  transform: none;
}

.desk-card-stanza {
  margin: 0 0 1.05em;
  font-size: clamp(0.62rem, 1.35vw, 0.7rem);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: #2a2a2a;
  text-align: left;
}

.desk-card-stanza:last-child {
  margin-bottom: 0;
}

/* Same highlight treatment as composer lyrics (`.composer-lyrics-ed .lyric-hl--*`). */
.desk-card-lyrics .lyric-hl--amber {
  background: rgba(255, 214, 120, 0.45);
  border-radius: 2px;
}

.desk-card-lyrics .lyric-hl--mint {
  background: rgba(150, 230, 190, 0.4);
  border-radius: 2px;
}

.desk-card-lyrics .lyric-hl--rose {
  background: rgba(255, 180, 190, 0.42);
  border-radius: 2px;
}

.desk-card-lyrics .lyric-hl--sky {
  background: rgba(160, 210, 255, 0.38);
  border-radius: 2px;
}

.desk-card-tags {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 0.5rem;
  font-family: var(--font-roboto);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9490;
}

.desk-card-tags--chips {
  margin-top: auto;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(45, 40, 35, 0.1);
  font-size: 0.62rem;
  line-height: 1.45;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(44, 40, 36, 0.55);
}

.profile-empty {
  margin: 0 0 1rem max(0.35rem, env(safe-area-inset-left));
  padding: 1.25rem 1.25rem;
  max-width: 28rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted, rgba(250, 248, 240, 0.5));
  border: 1px dashed var(--line, rgba(250, 248, 240, 0.15));
  border-radius: 6px;
}

/* —— Composer overlay —— */
.profile-composer {
  position: fixed;
  inset: 0;
  z-index: 9500;
  /* One grid cell so scrim + panel stack the same in every browser (avoids two implicit rows). */
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  padding: 0;
  isolation: isolate;
}

.profile-composer[hidden] {
  display: none !important;
}

.profile-composer-scrim,
.profile-composer-panel {
  grid-row: 1;
  grid-column: 1;
}

.profile-composer-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 3, 5, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.profile-composer-panel {
  position: relative;
  z-index: 1;
  align-self: end;
  justify-self: end;
  width: min(52rem, 100%);
  max-height: min(92vh, 100%);
  margin-left: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(18, 18, 22, 0.97);
  border: 1px solid var(--line, rgba(250, 248, 240, 0.12));
  border-right: none;
  border-radius: 12px 0 0 0;
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.45);
}

@supports (height: 100dvh) {
  .profile-composer-panel {
    max-height: min(92dvh, 100%);
  }
}

.profile-composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem max(1rem, env(safe-area-inset-right)) 0.65rem max(1rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line, rgba(250, 248, 240, 0.1));
  flex-shrink: 0;
}

.profile-composer-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent, #c4a574);
}

.profile-composer-dismiss {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream, #f6f3ea);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.profile-composer-dismiss:hover {
  background: rgba(255, 255, 255, 0.1);
}

.profile-composer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.85rem max(1rem, env(safe-area-inset-right)) 1rem max(1rem, env(safe-area-inset-left));
  -webkit-overflow-scrolling: touch;
}

.profile-composer-lede {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(250, 248, 240, 0.52);
}

/* Meta left, tall lyrics editor on the right (wide viewports) */
.composer-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  align-items: start;
}

.composer-workspace-main {
  min-width: 0;
}

.composer-workspace-lyrics {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.composer-workspace-footer {
  min-width: 0;
}

.composer-workspace--simple {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  width: 100%;
  max-width: min(40rem, 100%);
  box-sizing: border-box;
}

@media (min-width: 840px) {
  .composer-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 1.4fr);
    grid-template-rows: auto auto;
    align-items: start;
  }

  .composer-workspace-main {
    grid-column: 1;
    grid-row: 1;
  }

  .composer-workspace-footer {
    grid-column: 1;
    grid-row: 2;
  }

  .composer-workspace-lyrics {
    grid-column: 2;
    grid-row: 1 / -1;
    position: sticky;
    top: 0;
    align-self: start;
    width: 100%;
    max-height: min(78vh, 40rem);
    max-height: min(78dvh, 40rem);
  }
}

.composer-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.composer-field {
  margin-bottom: 0.5rem;
}

.composer-field--row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}

.composer-field-grow {
  flex: 1 1 12rem;
  min-width: 0;
}

.composer-title-search-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.composer-title-search-row .profile-input {
  flex: 1 1 auto;
  min-width: 0;
}

.composer-title-search-row .profile-fetch-lyrics {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  padding: 0 0.85rem;
}

.profile-label--inline {
  margin-top: 0.25rem;
}

.profile-fetch-lyrics {
  flex: 0 0 auto;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.02rem;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--void, #050506);
  background: var(--accent, #c4a574);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}

.profile-fetch-lyrics:hover {
  filter: brightness(1.06);
}

.profile-fetch-lyrics:disabled {
  opacity: 0.55;
  cursor: wait;
}

.profile-lyrics-status {
  margin: 0 0 0.5rem;
  font-size: 0.74rem;
  line-height: 1.4;
  color: rgba(196, 165, 116, 0.9);
  min-height: 1.35em;
}

.profile-lyrics-picks {
  margin: 0 0 0.65rem;
}

.profile-lyrics-picks-title {
  margin: 0 0 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(250, 248, 240, 0.55);
}

.profile-lyrics-picks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-lyrics-pick-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--cream, #f6f3ea);
  background: rgba(196, 165, 116, 0.12);
  border: 1px solid rgba(196, 165, 116, 0.35);
  border-radius: 4px;
  cursor: pointer;
  touch-action: manipulation;
}

.composer-hl-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.composer-hl-tools .profile-slip-btn {
  margin-left: auto;
}

.composer-hl-title {
  margin: 0 0 0.32rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 248, 240, 0.7);
}

.composer-hl-btn {
  width: 2.15rem;
  height: 1.55rem;
  padding: 0;
  font: inherit;
  border: 1px solid rgba(250, 248, 240, 0.15);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--cream, #f6f3ea);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.composer-hl-btn--amber {
  background: rgba(255, 205, 64, 0.52);
  border-color: rgba(255, 230, 150, 0.75);
}

.composer-hl-btn--mint {
  background: rgba(96, 245, 176, 0.5);
  border-color: rgba(176, 255, 221, 0.72);
}

.composer-hl-btn--rose {
  background: rgba(255, 128, 168, 0.5);
  border-color: rgba(255, 186, 214, 0.74);
}

.composer-hl-btn--sky {
  background: rgba(106, 184, 255, 0.52);
  border-color: rgba(176, 220, 255, 0.75);
}

.composer-hl-btn--clear {
  width: auto;
  height: auto;
  padding: 0.35rem 0.55rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-style: dashed;
  opacity: 0.85;
}

.composer-lyrics-stage {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 12rem;
  border-radius: 6px;
  border: 1px solid var(--line, rgba(250, 248, 240, 0.15));
  background: rgba(5, 5, 7, 0.65);
  overflow: hidden;
  min-width: 0;
}

.composer-lyrics-scroll {
  flex: 1 1 auto;
  min-height: 10rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 840px) {
  .composer-lyrics-scroll {
    min-height: 0;
  }
}

@media (max-width: 839px) {
  .composer-lyrics-scroll {
    max-height: min(52vh, 24rem);
    max-height: min(52dvh, 24rem);
  }
}

.composer-lyrics-scroll-inner {
  position: relative;
  min-height: 100%;
  padding-left: clamp(1.85rem, 6.5vw, 2.45rem);
  padding-right: clamp(1.75rem, 6vw, 2.35rem);
}

.composer-lyrics-ed {
  position: relative;
  z-index: 1;
  min-height: min(8rem, 40vh);
  padding: 0.75rem 0.2rem;
  font-family: var(--font-roboto);
  font-size: clamp(0.78rem, 2.1vw, 0.84rem);
  line-height: 1.5;
  color: var(--cream, #f6f3ea);
  white-space: pre-wrap;
  outline: none;
}

.composer-lyrics-ed:empty::before {
  content: attr(data-placeholder);
  color: rgba(250, 248, 240, 0.35);
  pointer-events: none;
}

.composer-lyrics-ed .lyric-hl--amber {
  background: rgba(255, 214, 120, 0.45);
  border-radius: 2px;
}

.composer-lyrics-ed .lyric-hl--mint {
  background: rgba(150, 230, 190, 0.4);
  border-radius: 2px;
}

.composer-lyrics-ed .lyric-hl--rose {
  background: rgba(255, 180, 190, 0.42);
  border-radius: 2px;
}

.composer-lyrics-ed .lyric-hl--sky {
  background: rgba(160, 210, 255, 0.38);
  border-radius: 2px;
}

.composer-sticky-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.composer-slip {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  width: clamp(2.85rem, 20vw, 5.5rem);
  max-width: 42%;
  padding: 0.35rem 0.35rem 0.45rem;
  font-size: 0.65rem;
  line-height: 1.35;
  color: #2c2824;
  background: linear-gradient(145deg, #fffef6 0%, #f5ebc8 100%);
  border: 1px solid rgba(80, 70, 50, 0.28);
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  outline: none;
  transform-origin: center center;
}

.composer-slip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  flex-shrink: 0;
  margin-bottom: 0.15rem;
}

.composer-slip-drag {
  position: relative;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 4px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.1em;
  color: rgba(45, 40, 35, 0.5);
  background: rgba(255, 255, 255, 0.5);
  cursor: grab;
  touch-action: none;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
}

.composer-slip-drag:active {
  cursor: grabbing;
}

.composer-slip-drag:focus-visible {
  outline: 2px solid rgba(196, 165, 116, 0.85);
  outline-offset: 1px;
}

.composer-slip-remove {
  position: relative;
  top: auto;
  right: auto;
  flex: 0 0 auto;
  margin-left: auto;
  z-index: 3;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(45, 40, 35, 0.55);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.composer-slip-remove:hover {
  color: #8a2f2f;
  background: rgba(255, 220, 220, 0.85);
}

.composer-slip-remove:focus-visible {
  outline: 2px solid rgba(196, 165, 116, 0.85);
  outline-offset: 1px;
}

.composer-slip-body {
  min-height: 2.25em;
  max-height: 8em;
  overflow-y: auto;
  outline: none;
  word-break: break-word;
}

.composer-slip-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  justify-content: center;
  margin-top: 0.3rem;
  padding-top: 0.28rem;
  border-top: 1px solid rgba(80, 70, 50, 0.12);
}

.composer-slip-swatch {
  width: 0.58rem;
  height: 0.58rem;
  padding: 0;
  border: 1px solid rgba(40, 35, 30, 0.35);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.composer-slip-swatch:focus-visible {
  outline: 2px solid rgba(196, 165, 116, 0.85);
  outline-offset: 1px;
}

.composer-slip-swatch--amber {
  background: rgba(255, 214, 120, 0.9);
}

.composer-slip-swatch--mint {
  background: rgba(150, 230, 190, 0.85);
}

.composer-slip-swatch--rose {
  background: rgba(255, 180, 190, 0.88);
}

.composer-slip-swatch--sky {
  background: rgba(160, 210, 255, 0.88);
}

.composer-slip--amber {
  background: linear-gradient(145deg, #fff8e8 0%, #f0dfa0 100%);
  border-color: rgba(130, 100, 40, 0.38);
}

.composer-slip--mint {
  background: linear-gradient(145deg, #f6fffa 0%, #c5ebd8 100%);
  border-color: rgba(60, 120, 90, 0.32);
}

.composer-slip--rose {
  background: linear-gradient(145deg, #fff8f8 0%, #ffd0d8 100%);
  border-color: rgba(130, 75, 85, 0.3);
}

.composer-slip--sky {
  background: linear-gradient(145deg, #f5f9ff 0%, #c4dcfa 100%);
  border-color: rgba(70, 110, 160, 0.32);
}

.composer-slip--legacy .composer-slip-remove {
  display: none;
}

.composer-slip--left {
  left: 0.2rem;
  right: auto;
  transform: translateY(-50%) rotate(-2.5deg);
}

.composer-slip--right {
  right: 0.2rem;
  left: auto;
  transform: translateY(-50%) rotate(2.5deg);
}

.composer-slip--legacy {
  padding: 0.4rem 0.45rem;
  width: auto;
  max-width: 42%;
  transform: none;
}

.composer-slip-actions {
  margin: 0.5rem 0 1rem;
}

.profile-slip-btn {
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream, #f6f3ea);
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(196, 165, 116, 0.45);
  border-radius: 4px;
  cursor: pointer;
}

.profile-slip-btn--ghost {
  border-style: solid;
  border-color: rgba(250, 248, 240, 0.12);
  background: rgba(255, 80, 80, 0.08);
  color: rgba(255, 200, 200, 0.95);
}

.profile-slip-btn--ghost:hover {
  border-color: rgba(255, 160, 160, 0.35);
  background: rgba(255, 80, 80, 0.14);
}

/* Block-style "Add annotation slip" — sits on its own row below the
   highlighter swatches and reads as an obvious action button rather
   than a small dashed chip wedged into the toolbar. */
.profile-slip-btn--block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0 0.85rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.72rem;
  border-style: solid;
  border-color: rgba(196, 165, 116, 0.55);
  background: rgba(196, 165, 116, 0.16);
  color: var(--cream, #f6f3ea);
  border-radius: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.profile-slip-btn--block:hover,
.profile-slip-btn--block:focus-visible {
  background: rgba(196, 165, 116, 0.28);
  border-color: rgba(196, 165, 116, 0.85);
  color: var(--accent, #c4a574);
  outline: none;
}

.composer-genres {
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
}

.composer-genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.composer-genre-tag {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: rgba(250, 248, 240, 0.85);
  cursor: pointer;
}

.composer-genre-tag input {
  accent-color: var(--accent, #c4a574);
}

.composer-publish-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(250, 248, 240, 0.45);
}

.profile-composer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.75rem max(1rem, env(safe-area-inset-right)) max(0.85rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  border-top: 1px solid var(--line, rgba(250, 248, 240, 0.1));
  flex-shrink: 0;
}

.profile-composer-delete {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: auto;
  padding: 0.5rem 0.85rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 200, 200, 0.95);
  background: rgba(120, 40, 40, 0.35);
  border: 1px solid rgba(200, 90, 90, 0.45);
  border-radius: 4px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.profile-composer-delete svg {
  flex-shrink: 0;
}

.profile-composer-delete:hover {
  background: rgba(140, 45, 45, 0.5);
  border-color: rgba(220, 120, 120, 0.55);
  color: #fff;
}

.profile-composer-delete:focus-visible {
  outline: 2px solid rgba(196, 165, 116, 0.85);
  outline-offset: 2px;
}

.profile-composer-delete[hidden] {
  display: none;
}

.profile-composer-cancel {
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream, #f6f3ea);
  background: transparent;
  border: 1px solid var(--line, rgba(250, 248, 240, 0.2));
  border-radius: 4px;
  cursor: pointer;
}

.profile-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 248, 240, 0.45);
}

.profile-input,
.profile-textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 1rem;
  color: var(--cream, #f6f3ea);
  background: rgba(5, 5, 7, 0.85);
  border: 1px solid var(--line, rgba(250, 248, 240, 0.12));
  border-radius: 4px;
  box-sizing: border-box;
}

.profile-textarea {
  min-height: 4rem;
  resize: vertical;
}

.profile-input:focus,
.profile-textarea:focus {
  outline: 2px solid rgba(196, 165, 116, 0.45);
  outline-offset: 1px;
}

.profile-add-btn {
  padding: 0.6rem 1.25rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--void, #050506);
  background: var(--accent, #c4a574);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  touch-action: manipulation;
  min-height: 2.75rem;
}

.profile-add-btn:hover {
  filter: brightness(1.06);
}

.profile-composer--album {
  z-index: 9600;
}

.profile-composer--album .profile-composer-panel {
  width: min(58rem, 100%);
}

.album-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  align-items: start;
  margin-top: 0.75rem;
}

.album-track-sidebar {
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(250, 248, 240, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.album-track-list {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
  max-height: min(14rem, 38vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.album-track-item {
  margin: 0 0 0.35rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.76rem;
  line-height: 1.3;
  color: rgba(250, 248, 240, 0.88);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(250, 248, 240, 0.1);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  touch-action: manipulation;
}

.album-track-item:hover {
  border-color: rgba(196, 165, 116, 0.35);
}

.album-track-item.is-active {
  border-color: rgba(196, 165, 116, 0.65);
  background: rgba(196, 165, 116, 0.12);
}

.album-track-item-index {
  display: block;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250, 248, 240, 0.4);
  margin-bottom: 0.15rem;
}

.album-track-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.album-audio-file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.65rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream, #f6f3ea);
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(250, 248, 240, 0.2);
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
}

.album-audio-file-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.album-track-editor {
  min-width: 0;
}

.album-lyrics-column {
  max-height: min(52vh, 24rem);
}

@media (min-width: 900px) {
  .album-workspace {
    grid-template-columns: minmax(10.5rem, 13rem) minmax(0, 1fr);
  }

  .album-track-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
  }
}

@media (max-width: 839px) {
  .composer-field--row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .composer-field--row .composer-field-grow {
    flex: 1 1 auto;
  }
}

@media (max-width: 700px) {
  /* Nudge the "Hi, name" greeting and Sign-out button down a touch on mobile
     so they don't crowd the header underline. */
  .profile-toolbar {
    padding-top: 1.6rem;
  }

  .header-compose-toggle {
    width: 100%;
    max-width: min(22rem, 100%);
    order: 3;
  }

  .header-compose-toggle .header-compose-btn {
    min-width: 0;
    width: 50%;
  }

  .profile-composer-panel {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    justify-self: stretch;
    align-self: end;
    border-radius: 12px 12px 0 0;
    border-left: 1px solid var(--line, rgba(250, 248, 240, 0.12));
    border-right: 1px solid var(--line, rgba(250, 248, 240, 0.12));
    border-bottom: none;
  }

  .profile-composer--album .profile-composer-panel {
    width: 100%;
  }

  .desk-card {
    transform: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  .desk-card {
    transform: none !important;
  }

  .desk-album-nav {
    transition: none;
  }

  .desk-album-nav:active:not(:disabled) {
    transform: none;
  }
}
