.studio-page { font-size: 15px; min-width: 0; background: radial-gradient(ellipse 900px 460px at 85% 0%, #202130 0%, transparent 80%), var(--ink); }
.studio-shell { width: min(1320px, 100%); margin-inline: auto; padding-inline: clamp(16px, 4vw, 55px); }
.studio-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 68px; gap: 12px; }
.back-link { color: var(--cream-dim); font-size: .85rem; white-space: nowrap; }
.back-link:hover, .text-button:hover, .studio-footer a:hover { color: var(--gold-2); }
.studio-intro { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding-block: 37px 26px; }
.studio-kicker { color: var(--gold-2); font-size: .68rem; font-weight: 700; letter-spacing: .19em; text-transform: uppercase; }
.studio-intro h1 { margin-block: 7px 9px; font-size: clamp(2.05rem, 4.8vw, 4.1rem); line-height: 1.05; }
.studio-intro em { color: var(--gold-2); font-weight: inherit; }
.intro-copy { max-width: 58ch; color: var(--cream-dim); }
.intro-note { flex: none; color: var(--muted); font-size: .75rem; border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; }
.workbench { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.control-column { display: grid; gap: 16px; min-width: 0; }
.studio-panel { min-width: 0; padding: clamp(13px, 2vw, 22px); border-radius: 17px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-heading > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.panel-heading h2 { font-size: clamp(1.13rem, 2vw, 1.48rem); }
.step { color: var(--gold-2); font-size: .68rem; font-weight: 700; letter-spacing: .1em; padding: 4px 6px; background: #d8ab5419; border: 1px solid #d8ab5432; border-radius: 6px; }
.panel-meta, .section-help, .tray-footer, .export-note { color: var(--muted); font-size: .75rem; }
.panel-meta { flex: none; }
.section-help { margin-block: 8px 11px; }
.drop-area { border: 1px dashed #ad8c50; border-radius: 10px; background: #d8ab5408; }
.drop-area.dragging { background: #d8ab5422; border-color: var(--gold-2); }
.upload-button { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; width: 100%; border: 0; background: transparent; text-align: left; color: var(--cream); border-radius: inherit; font: inherit; cursor: pointer; }
.upload-button:hover { background: #d8ab5412; }
.upload-button strong, .upload-button small { display: block; }
.upload-button small { color: var(--cream-dim); font-size: .7rem; }
.upload-plus { color: var(--gold-2); font-size: 1.4rem; }
.cover-tray { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cover-tray:has(li) { margin-top: 12px; }
.cover-item { min-width: 0; background: #0d1018; border: 1px solid var(--line); border-radius: 8px; padding: 5px; }
.cover-art { position: relative; background: #1b1d2a; display: grid; place-items: center; height: 66px; border-radius: 4px; }
.cover-art img { width: 100%; height: 66px; object-fit: contain; }
.cover-position { position: absolute; top: 3px; left: 3px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; color: #141013; background: #eed59e; font-size: .62rem; font-weight: 700; }
.cover-name { display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size: .68rem; margin-block: 3px; }
.cover-actions { display: flex; justify-content: space-between; gap: 1px; }
.cover-actions button { color: var(--cream); background: #242938; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font: inherit; font-size: .77rem; padding: 0; min-width: 0; min-height: 24px; flex: 1; }
.cover-actions button:hover:not(:disabled) { color: var(--gold-2); border-color: var(--gold); }
.cover-actions button:disabled { opacity: .33; cursor: default; }
.tray-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 17px; margin-top: 8px; }
.text-button { border: 0; background: transparent; padding: 2px 0; color: var(--cream-dim); font: inherit; text-decoration: underline; cursor: pointer; }
.layout-panel fieldset { padding: 0; border: 0; margin-top: 12px; min-inline-size: 0; }
.layout-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.layout-card { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); background: #0d1018; border-radius: 8px; padding: 6px 6px 7px; min-width: 0; cursor: pointer; }
.layout-card:hover { border-color: #d8ab5485; }
.layout-card:has(:checked) { border-color: var(--gold); background: #28251e; box-shadow: inset 0 0 0 1px #d8ab5470; }
.layout-card:has(:disabled) { cursor: default; opacity: .48; }
.layout-card:has(:focus-visible), .studio-page button:focus-visible, .studio-page a:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.layout-card canvas { display: block; width: 100%; height: auto; aspect-ratio: 1.45; object-fit: contain; background: radial-gradient(ellipse at 52% 30%, #f7f2e8, #ddd1bd); border-radius: 4px; }
.layout-title { display: block; font-size: .76rem; font-weight: 650; line-height: 1.25; margin-top: 7px; }
.layout-meta { color: var(--muted); font-size: .65rem; }
.preview-panel { position: sticky; top: 14px; }
.preview-stage { --tile: 16px; position: relative; display: grid; place-items: center; height: clamp(300px, 39vw, 540px); margin-top: 13px; padding: 44px 16px 12px; border: 1px solid #bcb4a8; border-radius: 10px; color: #30303b; background: repeating-conic-gradient(#e1dbd1 0% 25%, #f4f0e8 0% 50%) 0 0 / var(--tile) var(--tile); }
.preview-stage canvas { width: 100%; height: 100%; object-fit: contain; min-width: 0; min-height: 0; }
.preview-caption { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 53px; padding-block: 7px; }
.preview-caption strong, #scene-note { display: block; }
#scene-note, #dimensions { color: var(--muted); font-size: .75rem; }
#dimensions { flex: none; font-variant-numeric: tabular-nums; }
.download-button { display: flex; justify-content: center; width: 100%; gap: 9px; cursor: pointer; }
.download-button:disabled { opacity: .55; cursor: default; }
.export-note { margin-top: 7px; text-align: center; }
.notice { color: #ffd1aa; background: #30231c; padding: 6px 9px; border-radius: 6px; margin-top: 7px; font-size: .78rem; }
.studio-footer { display: flex; gap: 16px; padding-block: 25px; color: var(--muted); font-size: .75rem; }
.studio-page [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 850px) {
  .intro-note { display: none; }
  .workbench { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .preview-stage { height: clamp(290px, 64vw, 480px); }
}
@media (max-width: 460px) {
  .studio-intro { padding-block: 26px 19px; }
  .layout-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cover-tray { grid-template-columns: repeat(auto-fit, minmax(55px, 1fr)); }
}


.format-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.format-filters button, .preview-surfaces button { border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--cream-dim); padding: 6px 11px; font: inherit; font-size: .73rem; cursor: pointer; }
.format-filters button:hover { border-color: var(--gold); }
.format-filters button[aria-pressed="true"] { background: #e4c484; border-color: #e4c484; color: #221b15; font-weight: 700; }
.cover-item[draggable="true"] { cursor: grab; }
.cover-item.cover-dragging { opacity: .42; }
.preview-surfaces { position: absolute; top: 10px; left: 10px; display: flex; gap: 2px; padding: 2px; border: 1px solid #c0b6a6; border-radius: 999px; background: #f9f3e7; }
.preview-surfaces button { color: #4b4238; border-color: transparent; padding: 3px 9px; }
.preview-surfaces button[aria-pressed="true"] { background: #292734; color: #fff7e8; }
.preview-stage[data-surface="white"] { background: #fff; }
.preview-stage[data-surface="dark"] { background: #272631; color: #fff5e4; }
.export-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 8px; }
.export-actions .btn { padding-inline: 8px; font-size: .83rem; }
.preview-link { display: none; }
@media (max-width: 850px) {
    .preview-link { display: inline-block; margin-top: 10px; font-size: .78rem; }
}
@media (max-width: 460px) {
    .layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tray-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 12px; }
.cover-shelf { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.cover-shelf summary { color: var(--cream); cursor: pointer; font-weight: 650; }
.cover-shelf summary .panel-meta { float: right; padding-top: 3px; font-weight: 400; }
.cover-shelf summary::marker { color: var(--gold-2); }
.cover-shelf summary:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.shelf-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; list-style: none; padding: 0; max-height: 275px; overflow-y: auto; }
.shelf-item { min-width: 0; padding: 5px; border-radius: 8px; border: 1px solid var(--line); background: #0d1018; }
.shelf-item img { width: 100%; height: 66px; object-fit: contain; background: #1b1d2a; border-radius: 4px; }
.shelf-item .cover-actions button { padding-inline: 3px; font-size: .69rem; min-height: 29px; }
.shelf-item .cover-actions button:first-child { flex: 3; }

.spine-actions { margin-top: 4px; }
#spine-prompt { padding: 0 0 14px; }
#spine-prompt p { margin: 0 0 6px; }
.spine-options, #spine-editor:not([hidden]) { display:flex; flex-wrap:wrap; gap:8px 16px; align-items:center; }
#spine-editor { margin-top:12px; }
#spine-editor label { display:grid; gap:4px; font-size:.85rem; }
#spine-editor input { max-width:100%; }
.spine-actions button:first-child { flex: 4; }

#member-library { margin-block: 1rem; padding: 1rem; }
#member-library button, #member-entry { cursor:pointer; color:var(--cream); background:#242a39; border:1px solid var(--gold); border-radius:6px; padding:.45em .8em; margin:.2em; }
#member-library .member-item { display:flex; flex-wrap:wrap; align-items:center; gap:.4em; }
#member-library .member-item span { overflow-wrap:anywhere; }
