.studio-card {--card-ink:#163ac8;--card-bg:#fffbed;--card-accent:#ef633b;background:var(--card-bg);color:var(--card-ink);padding:clamp(12px,1.6vw,22px);border:1.5px solid var(--card-ink);box-shadow:4px 5px 0 #1b201f28;container-type:inline-size}
    .studio-card[data-theme="cherry"] {--card-ink:#ac172f;--card-accent:#f391ad;--card-bg:#fff3f0}
    .studio-card[data-theme="pine"] {--card-ink:#174f39;--card-accent:#b8d668;--card-bg:#f6f6df}
    .studio-card[data-theme="mono"] {--card-ink:#191a1a;--card-accent:#b6b6b3;--card-bg:#fffdfa}
    .studio-card-top,.studio-card-foot {display:flex;align-items:center;justify-content:space-between;gap:6px;font:700 clamp(8px,2.5cqw,11px)/1.2 "Courier New",monospace;letter-spacing:.06em}
    .studio-card-head {display:flex;align-items:center;justify-content:space-between;gap:6px;margin:10px 0 8px}
    .studio-card-head strong {font:900 clamp(37px,12cqw,70px)/.82 "Arial Black",Arial,sans-serif;letter-spacing:-.09em;white-space:nowrap}
    .studio-card-record {width:clamp(25px,9.5cqw,48px);height:clamp(25px,9.5cqw,48px);border-radius:50%;border:1.5px solid var(--card-ink);background:repeating-radial-gradient(circle,var(--card-ink) 0 1.5px,var(--card-bg) 1.5px 2.2px,var(--card-ink) 2.2px 3.8px);display:grid;place-items:center;flex:none}
    .studio-card-record::after {content:"";width:35%;height:35%;background:var(--card-accent);border:1px solid var(--card-ink);border-radius:50%}
    .studio-card-name {margin:0 0 11px;line-height:1.22;font-size:clamp(.72rem,3.4cqw,1.05rem);font-weight:700;overflow-wrap:anywhere}
    .studio-grid {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1px;padding:1px;background:var(--card-ink)}
    .studio-cell {background:var(--card-bg);display:flex;align-items:center;justify-content:center;text-align:center;padding:4px 2px;min-height:clamp(42px,14.6cqw,70px);font:700 clamp(8px,2.55cqw,13px)/1.13 Arial,sans-serif;overflow-wrap:anywhere}
    .studio-cell.free {background:var(--card-ink);color:var(--card-bg);flex-direction:column;gap:2px;font-size:clamp(.7rem,3.2cqw,1.05rem);letter-spacing:.08em}
    .studio-cell.free b {color:var(--card-accent);font-size:1.15em;line-height:.9}
    .studio-card-foot {margin-top:11px;font-size:clamp(7px,2.15cqw,10px)}

.studio-page {
  --s-paper: #f8f5ec;
  --s-surface: #fffdf7;
  --s-ink: #212b26;
  --s-green: #1e3d34;
  --s-green-deep: #102d24;
  --s-clay: #b3442e;
  --s-muted: #555e54;
  --s-line: #cfcec0;
  --s-input: #8a9082;
  --s-wash: #eeece0;
  --s-leaf: #e8ede0;
  --paper: var(--s-paper);
  --ink: var(--s-ink);
  --blue: var(--s-green);
  --line: var(--s-line);
  --muted: var(--s-muted);
  --studio-serif: Georgia, "Times New Roman", serif;
  color: var(--s-ink);
  background: var(--s-paper);
  font: 16px/1.5 var(--sans, Arial, sans-serif);
}
.studio-page :focus-visible { outline: 3px solid var(--s-clay); outline-offset: 3px; }
.studio-shell { width: min(1168px, calc(100% - clamp(36px, 8vw, 112px))); margin-inline: auto; }
.studio-nav { min-height: 74px; display: flex; align-items: center; gap: clamp(12px, 3vw, 34px); border-bottom: 1px solid var(--s-line); }
.studio-nav .brand { color: var(--s-green); }
.studio-toplinks { margin-left: auto; display: flex; align-items: center; gap: clamp(12px, 2.4vw, 30px); }
.studio-page .studio-home { color: var(--s-green); font: 650 .94rem/1.15 var(--sans, Arial, sans-serif); text-decoration: none; }
.studio-nav a.studio-home { display: inline-flex; align-items: center; white-space: pre; min-height: 44px; }
.studio-nav a.studio-home:hover { text-decoration: underline; text-underline-offset: .24em; }
.studio-page .library-nav { background: var(--s-green); color: white; border: 1px solid var(--s-green); border-radius: 5px; min-height: 43px; padding: .55rem 1rem; cursor: pointer; }
.studio-page .library-nav:hover { background: var(--s-green-deep); }
#studio-content { scroll-margin-top: 12px; }
.studio-page main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.studio-page main > * { min-width: 0; }
.studio-intro { grid-column: 1; grid-row: 1; margin: clamp(28px, 4vw, 54px) 0 clamp(24px, 3vw, 40px); }
.studio-intro h1 { margin: 0; color: var(--s-green); font: 400 clamp(2.75rem, 5.3vw, 4.8rem)/.99 var(--studio-serif); letter-spacing: -.055em; }
.studio-intro p { max-width: 51ch; margin: .75rem 0 0; color: var(--s-muted); }
.studio-page:not(.quick-active) #quick-game { grid-column: 2; grid-row: 1; justify-self: end; padding-left: 1.35rem; }
.studio-page:not(.quick-active) #quick-entry { margin: 0; }
.studio-page.quick-active #quick-game { grid-column: 1/-1; }
.studio-columns, .library-panel { grid-column: 1/-1; }
.studio-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(34px, 6vw, 92px); align-items: start; }
.studio-form, .studio-visual { min-width: 0; }
.studio-section { border: 0; border-top: 1px solid var(--s-line); margin: 0 0 27px; padding: 18px 0 0; min-width: 0; }
.studio-section h2, .studio-preview-head h2 { margin: 0 0 1rem; color: var(--s-green); font: 400 clamp(1.8rem, 2.5vw, 2.35rem)/1.1 var(--studio-serif); letter-spacing: -.035em; }
.studio-field { display: block; margin: 0 0 5px; color: var(--s-ink); font-weight: 680; font-size: .95rem; }
.studio-area, .studio-select, .studio-text {
  display: block; width: 100%; min-height: 46px; padding: .62rem .8rem;
  border: 1px solid var(--s-input); border-radius: 4px;
  color: var(--s-ink); background: var(--s-surface); font: inherit;
}
.studio-page input::placeholder, .studio-page textarea::placeholder { color: #646b61; }
.studio-title-field { margin-bottom: 1.3rem; }
.studio-area { min-height: 124px; height: 160px; line-height: 1.55; resize: vertical; unicode-bidi: plaintext; }
#studio-song-list { max-height: 14rem; overflow-y: auto; margin: .6rem 0 .25rem; padding: 0 .85rem 0 2.4rem; border: 1px solid var(--s-line); border-radius: 4px; background: var(--s-surface); }
#studio-song-list li { padding: .5rem .25rem; border-bottom: 1px solid var(--s-line); overflow-wrap: anywhere; }
#studio-song-list li:last-child { border: 0; }
#studio-song-list:empty, #studio-song-list:has(+ details[open]) { display: none; }
#studio-bulk-edit summary { width: fit-content; padding: .55rem 0; cursor: pointer; color: var(--s-green); font-weight: 650; }
#studio-song-list .song-credit, .quick-songs .song-credit { color: var(--s-muted); font-size: .9em; }
#studio-song-list .song-credit::before, .quick-songs .song-credit::before { content: '· '; }
.studio-cell { flex-direction: column; gap: 2px; }
.studio-cell .song-credit, .quick-paper-grid .song-credit { font-size: .84em; line-height: 1.1; font-weight: 450; }
.quick-paper-grid > span:has(.song-credit) { display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.studio-field-row, .studio-track-meta, .studio-preview-head, .studio-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.studio-field-row { flex-wrap: wrap; margin-bottom: .4rem; }
.studio-field-row .studio-field { margin: 0; }
.studio-page .studio-load select { max-width: min(200px, 65vw); background: var(--s-paper); color: var(--s-green); border: 1px solid var(--s-line); border-radius: 4px; padding: .35rem .45rem; min-height: 36px; font: 600 .83rem/1.3 var(--sans, Arial, sans-serif); }
.studio-track-meta { margin-top: .5rem; flex-wrap: wrap; }
.studio-track-meta small,.studio-actions p,.studio-caption,.studio-dialog p { font-size: .87rem; color: var(--s-muted); line-height: 1.5; }
.studio-track-meta .count { color: var(--s-green); font-weight: 700; }
.studio-swatches { padding: 0; border: 0; margin: 0; }
.studio-palette { display: flex; flex-wrap: wrap; gap: .45rem; }
.studio-theme { position: relative; display: inline-flex; cursor: pointer; }
.studio-theme input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.studio-theme span { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .46rem .64rem; min-height: 42px; background: var(--s-surface); border: 1px solid var(--s-line); border-radius: 4px; font-size: .9rem; }
.studio-theme i { width: .86rem; height: .86rem; background: var(--chip); border-radius: 50%; border: 1px solid #0002; }
.studio-theme input:checked + span { border-color: var(--s-green); box-shadow: inset 0 0 0 1px var(--s-green); background: var(--s-leaf); }
.studio-theme input:focus-visible + span { outline: 3px solid var(--s-clay); outline-offset: 3px; }
.studio-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin: 1.1rem 0 0; }
.studio-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.studio-actions p { flex-basis: 100%; margin: 0; }
.studio-actions #availability:empty, .studio-feedback:empty { display: none; }
.studio-btn, .studio-shuffle { font: 650 .94rem/1.25 var(--sans, Arial, sans-serif); cursor: pointer; color: var(--s-green); }
.studio-btn { min-height: 45px; padding: .65rem 1rem; border-radius: 4px; border: 1px solid var(--s-input); background: transparent; }
.studio-btn:hover, .studio-shuffle:hover { background: var(--s-leaf); }
.studio-btn.primary { color: white; background: var(--s-green); border-color: var(--s-green); }
.studio-btn.primary:hover { background: var(--s-green-deep); }
.studio-page button:disabled { cursor: default; opacity: .6; }
.studio-feedback { margin: .55rem 0; font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.studio-feedback a, .studio-follow a { color: var(--s-green); text-underline-offset: .2em; }
.studio-preview-head { padding: 18px 0 0; margin-bottom: 1rem; border-top: 1px solid var(--s-line); }
.studio-preview-head h2 { margin: 0; }
.studio-shuffle { padding: .28rem .55rem; min-height: 40px; border: 0; background: transparent; text-decoration: underline; text-underline-offset: .21em; }
.studio-stage { border: 1px solid #d8d7c9; padding: clamp(17px, 2.4vw, 36px); background: #ecebdf; }
.studio-card { box-shadow: 1px 3px 7px #2430241f; }
.studio-caption { margin: .65rem 0 0; }
.studio-follow { padding: .55rem 0 0; border: 0; margin-top: 0; }
.studio-follow a { display: inline-flex; align-items: center; min-height: 44px; font-size: .93rem; }
.studio-dialog { border: 1px solid var(--s-input); border-radius: 6px; background: var(--s-paper); color: var(--s-ink); width: min(458px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 1.4rem; }
.studio-dialog::backdrop { background: #152b24aa; }
.studio-dialog-head h2 { font: 400 2rem/1.1 var(--studio-serif); color: var(--s-green); margin: 0; }
.studio-dialog-close { width: 40px; height: 40px; color: var(--s-green); background: transparent; border: 1px solid var(--s-line); border-radius: 4px; cursor: pointer; font-size: 1.25rem; }
.studio-dialog form > .studio-btn { display: block; width: 100%; margin-top: 1rem; }
.studio-dialog .trap { display: none; }
.studio-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (min-width: 900px) and (min-height: 800px) { .studio-page .studio-visual { position: sticky; top: 18px; } }
@media (max-width: 800px) {
  .studio-columns { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 24px; }
}
@media (max-width: 690px) {
  .studio-page main { grid-template-columns: minmax(0, 1fr); }
  .studio-columns { grid-template-columns: minmax(0,1fr); gap: 30px; }
  .studio-intro { margin: 30px 0 0; }
  .studio-page:not(.quick-active) #quick-game { grid-column: 1; grid-row: 2; justify-self: start; margin-block: .6rem 1.2rem; padding: 0; }
  .studio-visual { max-width: 500px; width: 100%; }
  .studio-card { padding: clamp(11px, 3vw, 22px); }
}
@media (max-width: 530px) {
  .studio-page .studio-nav { min-height: 66px; gap: 14px; }
  .studio-page .studio-toplinks { gap: 14px; }
  .studio-nav-extra { display: none; }
  .studio-page .studio-home, .studio-page .studio-toplinks a { font-size: .88rem; }
  .studio-page .library-nav { padding: .5rem .67rem; }
  .studio-page .studio-sources .transfer-panel { padding-inline: .75rem; }
}
@media (max-width: 365px) {
  .studio-shell { width: calc(100% - 24px); }
  .studio-page .studio-nav, .studio-page .studio-toplinks { gap: 9px; }
  .studio-options { gap: .55rem; }
}
@media (prefers-reduced-motion: reduce) { html:has(.studio-page) { scroll-behavior: auto; } }

.studio-playlist-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1rem; }
.studio-playlist-head h2 { margin: 0; }
.studio-save { min-height: 40px; padding: .2rem .55rem; border: 0; background: transparent; color: var(--s-green); text-decoration: underline; text-underline-offset: .21em; font: 650 .92rem/1.25 var(--sans, Arial, sans-serif); cursor: pointer; }
.studio-save:hover { background: var(--s-leaf); }
.studio-page main > .library-panel:first-child { grid-row: 1; margin-top: 1.25rem; }
.studio-page main:has(> .library-panel:first-child) .studio-intro,
.studio-page:not(.quick-active) main:has(> .library-panel:first-child) #quick-game { grid-row: 2; }
@media (max-width: 690px) {
  .studio-page:not(.quick-active) main:has(> .library-panel:first-child) #quick-game { grid-row: 3; }
}

.playlist-link {
  margin: .9rem 0 1.15rem;
  padding: 1rem;
  border: 1px solid #c0c8bb;
  border-radius: 5px;
  background: #edf0e5;
  color: #212b26;
}
.playlist-link [data-playlist-url], .playlist-link textarea {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: .6rem .7rem;
  border: 1px solid #899689;
  border-radius: 4px;
  color: #212b26;
  background: #fffdf5;
  font: inherit;
}
.playlist-link label { display: block; margin-bottom: .4rem; font-size: .95rem; font-weight: 650; }
.playlist-link-row { display: flex; gap: .45rem; }
.playlist-link [data-playlist-submit], .playlist-link [data-playlist-add-text], .playlist-link [data-spotify-choose], .playlist-link [data-spotify-saved] {
  flex: none;
  min-height: 44px;
  padding: .5rem .85rem;
  border: 1px solid #1e3d34;
  border-radius: 4px;
  background: #1e3d34;
  color: #fffdf5;
  font: 650 .9rem/1.25 var(--sans, Arial, sans-serif);
  cursor: pointer;
}
.playlist-link button:disabled { opacity: .65; cursor: progress; }
.playlist-link .playlist-link-help, .playlist-link [data-playlist-status] {
  margin: .4rem 0 0;
  color: #45534a;
  font-size: .84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.playlist-link [data-playlist-status]:empty, .playlist-link [data-playlist-widget]:empty { display: none; }
.playlist-link [data-playlist-undo], .playlist-link [data-playlist-paste], .playlist-link [data-spotify-songs] {
  min-height: 40px; padding: .25em 0; border: 0; background: none; color: #1e3d34;
  text-decoration: underline; text-underline-offset: .2em; font: 650 .9rem/1.3 var(--sans, Arial, sans-serif);
}
.playlist-link textarea { display: block; min-height: 7rem; margin: .25rem 0 .5rem; resize: vertical; }
.playlist-link [data-playlist-titles] { margin-top: .7rem; }
.playlist-link [data-spotify-songs] { margin-inline-end: 1rem; cursor: pointer; }
.spotify-import-tools:not([hidden]), .spotify-import-tools > div:not([hidden]) {
  display: grid; gap: .45rem; align-items: start; justify-items: start; min-width: 0;
}
.spotify-import-tools { margin-bottom: 1rem; }
.spotify-import-tools > div { width: 100%; }
.spotify-import-tools label { margin: .25rem 0 0; }
.spotify-import-tools a { color: #1e3d34; text-underline-offset: .2em; }
.spotify-import-tools input[type=file], .spotify-import-tools select {
  box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; min-height: 44px;
  padding: .45rem .55rem; border: 1px solid #899689; border-radius: 4px;
  background: #fffdf5; color: #212b26; font: inherit;
}
.spotify-import-tools input::file-selector-button {
  margin-inline-end: .55rem; padding: .22rem .55rem; border: 1px solid #899689; border-radius: 3px;
  background: #edf0e7; color: #1e3d34; font: inherit; cursor: pointer;
}
@media (max-width: 430px) {
  .playlist-link { padding: .75rem; }
  .playlist-link-row { flex-wrap: wrap; }
  .playlist-link [data-playlist-url] { flex: 1 1 8rem; }
  .playlist-link [data-playlist-submit] { padding-inline: .65rem; }
}
