/* palette moved to theme.css */
*{box-sizing:border-box} body{margin:0;background:radial-gradient(circle at top,var(--bg) 0,var(--bg) 34%,var(--bg-deep) 100%);color:var(--light);font-family:Inter,Arial,sans-serif;min-height:100vh}.embers{position:fixed;inset:0;pointer-events:none;opacity:.2;background-image:radial-gradient(circle,var(--primary) 1px,transparent 1px);background-size:80px 80px;mask-image:linear-gradient(to bottom,black,transparent 70%)}
.topbar{max-width:1500px;margin:auto;padding:24px 30px;display:flex;align-items:center;gap:20px;border-bottom:1px solid var(--border)}.brand-logo{width:92px;height:92px;object-fit:contain}.topbar h1{font-family:var(--font-display);margin:0;font-size:30px;letter-spacing:1px}.topbar p{margin:5px 0 0;color:var(--muted)}.topbar .secondary-btn{margin-left:auto}.app-shell{max-width:1500px;margin:0 auto;padding:28px 30px 50px;display:grid;grid-template-columns:1fr 1fr;gap:24px}.forge-card{background:linear-gradient(145deg,rgba(32,32,32,.98),rgba(16,16,16,.98));border:1px solid var(--line-soft);border-radius:16px;box-shadow:0 14px 35px var(--bg-deep),inset 0 1px 0 rgba(255,255,255,.05);overflow:hidden}.card-heading{display:flex;gap:14px;align-items:center;padding:22px 24px;border-bottom:1px solid var(--border);background:linear-gradient(180deg,var(--panel-2),var(--panel-2))}.card-heading h2{font-family:var(--font-display);margin:0;font-size:20px}.card-heading p{margin:4px 0 0;color:var(--muted);font-size:13px}.icon{color:var(--orange);font-size:26px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:22px 24px}.form-grid label{display:flex;flex-direction:column;gap:7px}.form-grid label.full{grid-column:1/-1}label span,.field-title{font-size:13px;font-weight:700;color:var(--text-2)}select,input,textarea{width:100%;border:1px solid var(--line-soft);background:var(--panel-2);color:var(--text);border-radius:8px;padding:12px 13px;font:inherit;outline:none;transition:.2s}select:focus,input:focus,textarea:focus{border-color:var(--orange);box-shadow:0 0 0 3px var(--primary-soft)}select{appearance:auto}small{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.library-bar{margin:0 24px;padding:14px 0;border-top:1px solid var(--line-soft);border-bottom:1px solid var(--line-soft);display:flex;justify-content:space-between;align-items:center}.library-bar span{color:var(--muted);font-size:12px;margin-left:10px}.text-btn{background:none;border:0;color:var(--orange2);cursor:pointer;font-weight:700}.chip-row{display:flex;gap:8px;flex-wrap:wrap;padding:14px 24px 0}.chip{background:var(--primary-soft);border:1px solid var(--line);color:var(--warn);border-radius:999px;padding:7px 10px;font-size:12px}.textarea-block{padding:18px 24px 0}.field-title{display:flex;justify-content:space-between;margin-bottom:8px}.field-title span:last-child{color:var(--muted);font-weight:500}.textarea-block textarea{min-height:210px;resize:vertical;font-family:"Roboto Mono",monospace;font-size:13px;line-height:1.55}.action-row{padding:18px 24px 24px;display:grid;grid-template-columns:1fr 1fr;gap:12px}.forge-btn,.secondary-btn,.copy-btn{border-radius:8px;padding:12px 16px;font-weight:800;cursor:pointer;border:1px solid var(--line-soft);color:#fff;background:linear-gradient(var(--line-soft),var(--panel-2));box-shadow:inset 0 1px rgba(255,255,255,.08)}.forge-btn.primary{border-color:var(--primary-dark);background:linear-gradient(var(--primary-deep),var(--primary-dark));box-shadow:0 0 20px var(--shadow),inset 0 1px rgba(255,255,255,.25)}.forge-btn:hover,.copy-btn:hover,.secondary-btn:hover{transform:translateY(-1px);filter:brightness(1.1)}.output-panel{display:flex;flex-direction:column}.output-box{margin:20px 24px 0;padding:16px;background:linear-gradient(180deg,var(--panel-2),var(--panel));border:1px solid var(--line-soft);border-radius:12px}.output-box textarea{min-height:120px;resize:vertical;line-height:1.55}.output-box.grow textarea{min-height:320px;font-family:"Roboto Mono",monospace;font-size:13px}.copy-btn{margin-top:10px;padding:9px 13px}.quality-box{margin:20px 24px;padding:16px;border:1px solid var(--line-soft);border-radius:12px;background:var(--panel-2)}.quality-box>div:first-child{display:flex;justify-content:space-between}.quality-track{height:8px;background:var(--panel-3);border-radius:99px;margin:12px 0;overflow:hidden}.quality-track span{display:block;height:100%;width:15%;background:linear-gradient(90deg,var(--primary-dark),var(--primary-hi));transition:.3s}.quality-box p{color:var(--muted);font-size:12px;margin:0}.full-width{margin:0 24px 24px}.toast{position:fixed;right:22px;bottom:22px;background:var(--panel-3);border:1px solid var(--line-soft);padding:12px 16px;border-radius:9px;opacity:0;transform:translateY(10px);transition:.2s}.toast.show{opacity:1;transform:none}dialog{border:0;padding:0;background:transparent;color:white;width:min(900px,92vw)}dialog::backdrop{background:rgba(0,0,0,.78)}.dialog-card{background:var(--panel);border:1px solid var(--line-soft);border-radius:16px;padding:22px}.dialog-head{display:flex;justify-content:space-between}.dialog-head h3{font-family:var(--font-display);margin:0}.dialog-head p{color:var(--muted)}.close-btn{border:0;background:none;color:white;font-size:32px;cursor:pointer}.search-input{margin:10px 0 18px}.technique-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;max-height:430px;overflow:auto}.technique-option{display:flex;gap:9px;align-items:center;padding:10px;border:1px solid var(--line-soft);background:var(--panel-2);border-radius:8px;font-size:13px}.technique-option input{width:auto}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}@media(max-width:950px){.app-shell{grid-template-columns:1fr}.topbar{align-items:flex-start}.topbar .secondary-btn{margin-left:0}.form-grid{grid-template-columns:1fr}.form-grid label.full{grid-column:auto}.technique-grid{grid-template-columns:1fr 1fr}}@media(max-width:600px){.topbar{padding:16px;flex-wrap:wrap}.brand-logo{width:70px;height:70px}.app-shell{padding:16px}.action-row{grid-template-columns:1fr}.technique-grid{grid-template-columns:1fr}}


.generator-box{margin-top:18px;padding:18px;border:1px solid var(--line-soft);border-radius:12px;background:linear-gradient(180deg,var(--line-soft),rgba(255,255,255,.02))}.mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}.mode-btn{border:1px solid var(--line-soft);background:var(--panel-2);color:var(--text-2);border-radius:9px;padding:11px;font-weight:700;cursor:pointer}.mode-btn.active{border-color:var(--primary);color:#fff;box-shadow:0 0 0 1px var(--primary-soft2),0 0 18px var(--primary-soft)}.mode-panel{padding:12px 0}.mode-panel p{margin:0 0 12px;color:var(--text-2);font-size:.9rem;line-height:1.5}.hidden{display:none!important}.api-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.api-grid .full{grid-column:1/-1}.generator-box label{display:flex;flex-direction:column;gap:7px;color:var(--text-2);font-size:.85rem;font-weight:600}.generator-box input,.generator-box select{width:100%;background:var(--panel-2);border:1px solid var(--line-soft);color:var(--text);border-radius:8px;padding:11px}.generator-box input:focus,.generator-box select:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-soft)}.generator-box small{display:block;color:var(--muted);line-height:1.45;margin:2px 0 12px}.generation-progress{margin-top:14px;border:1px solid var(--line-soft);border-radius:9px;padding:12px;background:var(--panel-2)}.generation-progress span{display:block;height:5px;border-radius:999px;background:linear-gradient(90deg,var(--primary),var(--primary-hi),var(--primary));background-size:200% 100%;animation:forgeLoad 1.2s linear infinite}.generation-progress p{margin:8px 0 0;text-align:center}.audio-player{width:100%;margin-top:14px}.download-audio{display:block;margin-top:10px;text-align:center;color:var(--primary-hi);font-weight:700;text-decoration:none}.download-audio:hover{text-decoration:underline}@keyframes forgeLoad{to{background-position:-200% 0}}@media(max-width:700px){.api-grid{grid-template-columns:1fr}.api-grid .full{grid-column:auto}}

/* Phase 1 Additions */
.api-section {
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.api-section label {
  margin-bottom: 12px;
}

.api-section .field-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary-hi);
}

.api-section input[type="password"] {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
}

#generationStatus {
  text-align: center;
  padding: 16px;
  color: var(--primary);
  font-style: italic;
}

#generationStatus.hidden {
  display: none;
}

.section-editor {
  background: var(--panel-2);
  border: 1px solid var(--primary-soft);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.section-editor h4 {
  color: var(--primary);
  margin: 0 0 8px 0;
  font-size: 14px;
}

.section-editor textarea {
  width: 100%;
  min-height: 80px;
  margin-bottom: 8px;
}

.section-editor .section-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-actions button {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  font-size: 12px;
}


/* Phase 2 Additions */
.reference-section, .perspective-section, .batch-section, .quality-analysis, .rhyme-analysis, .syllable-counter {
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.reference-section textarea {
  width: 100%;
  min-height: 100px;
  margin-bottom: 8px;
}

.toggle-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.perspective-btn {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft2);
  color: var(--primary-hi);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.perspective-btn:hover {
  background: var(--line);
}

.perspective-btn.active {
  background: var(--line-strong);
  border-color: var(--primary);
}

.batch-results {
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 8px;
  margin-top: 12px;
}

.batch-results.hidden {
  display: none;
}

.batch-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.batch-nav span {
  color: var(--primary-hi);
  font-size: 14px;
  font-weight: 600;
}

.score-item {
  margin-bottom: 12px;
}

.score-item span:first-child {
  display: block;
  color: var(--primary-hi);
  font-size: 14px;
  margin-bottom: 4px;
}

.score-item span:last-child {
  display: block;
  color: var(--text-2);
  font-size: 12px;
  margin-top: 4px;
}

.score-bar {
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.score-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

#rhymePattern, #syllableResults {
  background: var(--panel-2);
  border: 1px solid var(--primary-soft);
  padding: 12px;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}


/* Phase 3 Additions */
.conflict-detector, .presets-section, .history-section, .critique-section, .export-section {
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.conflict-detector .field-title, 
.presets-section .field-title, 
.history-section .field-title, 
.critique-section .field-title {
  margin-bottom: 12px;
  color: var(--primary-hi);
}

.preset-btn {
  padding: 8px 12px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft2);
  color: var(--primary-hi);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.preset-btn:hover {
  background: var(--line);
  border-color: var(--primary);
}

#presetName {
  padding: 8px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 4px;
  font-family: inherit;
}

#presetName::placeholder {
  color: var(--muted);
}

dialog {
  backdrop-filter: blur(5px);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  max-width: 90vw;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

/* Fill the space INSIDE the margins. width:100% plus the 24px side margins
   pushed the Download Song Package button off a phone screen. (A button does
   not stretch with width:auto, so the fill-available keywords are needed.) */
.full-width {
  display: block;
  width: 100%;
  width: -webkit-fill-available;
  width: -moz-available;
  width: stretch;
}


/* Phase 4 Additions */
.social-post-section {
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.platform-btn {
  padding: 10px 16px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft2);
  color: var(--primary-hi);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.platform-btn:hover {
  background: var(--line);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.platform-btn:active {
  transform: translateY(0);
}

#socialPostOutput.hidden {
  display: none !important;
}

#socialPostText {
  font-family: 'Courier New', monospace;
  line-height: 1.5;
}


/* Phase 5 Additions */
.video-prompt-section {
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.video-style-btn {
  padding: 10px 14px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft2);
  color: var(--primary-hi);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.video-style-btn:hover {
  background: var(--line);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.video-style-btn:active {
  transform: translateY(0);
}

.generator-btn,
.format-btn {
  padding: 8px 12px;
  background: var(--primary-soft);
  border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
}

.generator-btn:hover,
.format-btn:hover {
  background: var(--primary-soft);
  border-color: var(--line-strong);
}

.format-btn { line-height: 1.35; text-align: center; }

.generator-btn.active,
.format-btn.active {
  background: var(--primary-soft2);
  border-color: var(--primary);
  color: var(--primary-hi);
}

#videoPromptOutput.hidden {
  display: none !important;
}

#videoPromptText {
  font-family: 'Courier New', monospace;
  line-height: 1.7;
  word-wrap: break-word;
}


/* Phase 6 Additions */
.hook-generator-section {
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 10px;
  margin-top: 8px;
}

.hook-card {
  transition: all 0.2s ease;
}

.hook-card:hover {
  border-color: var(--primary);
  background: var(--line);
  transform: translateX(2px);
}

.hook-card input[type="radio"] {
  accent-color: var(--primary);
}


.prompt-fix-row{display:flex;align-items:center;gap:10px;margin-top:10px;flex-wrap:wrap}
.prompt-fix-row .forge-btn,.prompt-fix-row .secondary-btn{padding:9px 14px}
#fixPromptStatus{color:var(--text-3);font-size:12px}
.handoff-box{margin:20px 24px;padding:18px;border:1px solid var(--line-soft);border-radius:12px;background:linear-gradient(180deg,var(--line-soft),rgba(255,255,255,.02))}
.handoff-note{margin:6px 0 14px;color:var(--text-2);font-size:.85rem;line-height:1.5}
.app-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px}
.app-btn{display:block;text-align:center;text-decoration:none;border:1px solid var(--line-soft);background:var(--panel-2);color:var(--text-2);border-radius:9px;padding:11px 8px;font-weight:700;cursor:pointer;font-size:13px}
.app-btn:hover{filter:brightness(1.15)}
.app-btn.active{border-color:var(--primary);color:#fff;box-shadow:0 0 0 1px var(--primary-soft2),0 0 18px var(--primary-soft)}
#handoffPanel{margin-top:16px}
#handoffStyle{width:100%;background:var(--panel-2);border:1px solid var(--line-soft);color:var(--text);border-radius:8px;padding:11px;font-family:"Roboto Mono",monospace;font-size:12px;line-height:1.5;resize:vertical}
.handoff-actions{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.handoff-actions .copy-btn{margin-top:0}
@media(max-width:600px){.handoff-actions{flex-direction:column}.handoff-actions button{width:100%}}

.lens-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
.lens-grid label{display:flex;flex-direction:column;gap:7px}
.songs-box{margin:20px 24px;padding:18px;border:1px solid var(--line-soft);border-radius:12px;background:var(--panel-2)}
.songs-actions{margin:10px 0 14px}
.song-list{display:flex;flex-direction:column;gap:8px;max-height:320px;overflow:auto}
.song-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--line-soft);border-radius:9px;background:#161616}
.song-meta{display:flex;flex-direction:column;gap:3px;min-width:0}
.song-meta strong{font-size:14px}
.song-meta span{color:var(--text-3);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.song-meta em{color:var(--muted);font-size:11px;font-style:normal}
.song-buttons{display:flex;gap:8px;flex-shrink:0}
.song-buttons .copy-btn,.song-buttons .secondary-btn{margin-top:0;padding:8px 12px;font-size:12px}
.song-empty{color:#8a8a8a;font-size:13px;margin:0}
@media(max-width:600px){.lens-grid{grid-template-columns:1fr}.song-row{flex-direction:column;align-items:stretch}.song-buttons{justify-content:flex-end}}

.songs-actions{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 14px}
.album-panel{margin-top:16px;padding:16px;border:1px solid var(--line-soft);border-radius:12px;background:linear-gradient(180deg,var(--line-soft),rgba(255,255,255,.02))}
.album-panel > .field-title span:first-child{font-family:var(--font-display);font-size:16px;color:var(--primary-hi)}
.album-block{margin-top:14px}
.album-block textarea{width:100%;background:var(--panel-2);border:1px solid var(--line-soft);color:var(--text);border-radius:8px;padding:11px;font-size:13px;line-height:1.55;resize:vertical}
#albumCover{font-family:"Roboto Mono",monospace;font-size:12px}
.album-panel .full-width{margin:10px 0 0;width:100%}
#downloadAlbumBtn{margin-top:14px;width:100%}

.app-shell{grid-template-columns:1fr}
/* Six stages, not five: Release used to wrap onto a second row on its own,
   which read as an afterthought rather than the end of the run. */
.stage-bar{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;margin-bottom:20px}
.stage-tab{display:flex;align-items:center;justify-content:center;gap:8px;padding:13px 10px;border:1px solid #3d3d3d;background:#141414;color:var(--text-3);border-radius:10px;cursor:pointer;font-weight:700;font-size:13px;transition:.15s}
.stage-tab:hover{color:var(--text-2);border-color:#5a5a5a}
.stage-tab.active{color:#fff;border-color:var(--primary);background:linear-gradient(180deg,var(--primary-soft),var(--line-soft));box-shadow:0 0 18px var(--primary-soft)}
.stage-num{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:#2a2a2a;color:var(--text-2);font-size:12px;flex-shrink:0}
.stage-tab.active .stage-num{background:var(--primary);color:#120a04}
.stage-host{display:block}
.stage-panel .card-heading .icon{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:var(--primary-soft);color:var(--primary-hi);font-family:var(--font-display);font-size:17px}
.stage-body{padding-bottom:8px}
/* Songcraft suggestions: advice the writer can take in one click, or ignore. */
.craft-suggest:empty{display:none}
.craft-suggest{background:var(--panel-2);border:1px solid var(--line-soft);border-left:3px solid var(--primary);border-radius:8px;padding:12px 14px;margin:10px 0 16px}
.craft-suggest-head{font-weight:600;font-size:12px;color:var(--primary-hi);margin-bottom:8px}
.craft-suggest-row{display:flex;align-items:center;gap:10px;justify-content:space-between;font-size:11px;color:var(--text-2);padding:5px 0;line-height:1.5}
.craft-suggest-row+.craft-suggest-row{border-top:1px solid var(--line-soft)}
.craft-suggest-row button{flex-shrink:0;font-size:11px;padding:5px 12px}
/* The step footer: what you just finished, how far along you are, where next. */
.stage-foot{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:18px 24px 4px;padding-top:16px;border-top:1px solid var(--line-soft)}
.stage-foot .stage-count{color:var(--text-3);font-size:12px;font-weight:600;letter-spacing:.02em;margin-inline:auto}
.stage-foot .stage-next{margin-left:auto}
.stage-foot .stage-back+.stage-count{margin-left:0}
.stage-foot .stage-done{color:var(--primary-hi);font-size:12px;font-weight:600;margin-left:auto}
@media(max-width:640px){
  .stage-foot{margin-inline:16px;gap:10px}
  .stage-foot .stage-count{order:3;width:100%;text-align:center;margin:2px 0 0}
  .stage-foot .stage-next,.stage-foot .stage-back{flex:1}
}
/* Same row, mounted right under the heading instead of at the end of the
   panel, so Next/Back are reachable without scrolling a long stage. Border
   flips to the bottom since it is now introducing the content below it, not
   closing off the content above it. */
.stage-foot-top{margin:2px 24px 18px;padding-top:0;padding-bottom:16px;border-top:none;border-bottom:1px solid var(--line-soft)}
@media(max-width:640px){ .stage-foot-top{margin-inline:16px} }
.stage-body > *{margin-left:24px;margin-right:24px}
.stage-body > .form-grid,.stage-body > .textarea-block,.stage-body > .action-row,.stage-body > .chip-row{margin-left:0;margin-right:0}
.stage-body > .output-box,.stage-body > .quality-box,.stage-body > .songs-box,.stage-body > .handoff-box{margin-left:24px;margin-right:24px}
/* Keep the stage names visible - shrink them rather than hide them. Names only disappear on a genuinely tiny phone screen, where the numbers still read in order. */
@media(max-width:1100px){.stage-tab{font-size:12px;padding:12px 6px;gap:6px}}
@media(max-width:820px){.stage-bar{gap:5px}.stage-tab{font-size:11px;padding:11px 4px;gap:5px;flex-direction:column}.stage-num{width:19px;height:19px;font-size:11px}}
@media(max-width:480px){.stage-name{display:none}.stage-tab{flex-direction:row;padding:12px 4px}}


/* Wide screens: fill the monitor with two columns of panels rather than one
   stretched strip. Narrow screens keep the single-column stack. */
.topbar{max-width:1500px}
.app-shell{max-width:1500px}
@media(min-width:1200px){
  .stage-body{display:grid;grid-template-columns:1fr 1fr;gap:0 22px;align-items:start}
  .stage-body > *{margin-left:24px;margin-right:0}
  .stage-body > *:nth-child(even){margin-left:0;margin-right:24px}
  .stage-body > .form-grid,
  .stage-body > .textarea-block,
  .stage-body > .output-box.grow,
  .stage-body > .album-panel{grid-column:1 / -1;margin-left:24px;margin-right:24px}
  .stage-body > .form-grid{grid-template-columns:repeat(3,1fr)}
  .stage-body > .form-grid label.full{grid-column:span 3}
}

/* Fix dropdown option readability: dark list background, light text */
select option,
select optgroup {
  background-color: #1a1a1a;
  color: #ffffff;
}

/* Sound Like - restored from MFCS_SOUNDLIKE (2026-08-11), lost in the branch split */
.soundlike-box{margin:0 0 4px;padding:16px;border:1px solid var(--line-soft);border-radius:12px;background:var(--panel-2)}
.soundlike-note{margin:6px 0 12px;color:var(--muted);font-size:12px;line-height:1.5}
.soundlike-row{display:flex;gap:8px;flex-wrap:wrap}
.soundlike-row input{flex:1;min-width:200px;background:var(--panel-2);border:1px solid var(--line-soft);color:var(--text);border-radius:8px;padding:11px 13px}
.soundlike-row input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-soft)}
.soundlike-row .forge-btn{padding:11px 18px;white-space:nowrap}
.soundlike-actions{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
#soundLikeText{width:100%;margin-top:10px;background:var(--bg-deep);border:1px solid var(--line-soft);color:var(--text);border-radius:8px;padding:11px;font-size:13px;line-height:1.5}
@media(max-width:700px){.soundlike-row{flex-direction:column}.soundlike-row .forge-btn{width:100%}}


/* Instrumental / Voice-Over builder - restored from MFCS_READY_FIXED (2026-08-22) */
.instrumental-section, .beat-section{margin:0 24px 20px;padding:16px;border:1px solid var(--line-soft);border-radius:12px;background:var(--panel-2)}
.instrumental-section .field-title span:first-child, .beat-section .field-title span:first-child{font-family:var(--font-display);font-size:15px;color:var(--primary-hi)}
.instrumental-section .section-note, .beat-section .section-note{color:var(--muted);font-size:12px;margin:0 0 12px}
.instrumental-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.instrumental-grid label{display:flex;flex-direction:column;gap:6px}
.instrumental-check{display:flex;align-items:center;gap:9px;margin:12px 0;font-size:13px;color:var(--text-2)}
.instrumental-check input{width:auto;flex:0 0 auto}
.instrumental-section textarea, .beat-section textarea{margin-top:12px;min-height:170px;font-family:"Roboto Mono",monospace;font-size:12px;line-height:1.55}
.instrumental-section .forge-btn, .beat-section .forge-btn{width:100%}
.instrumental-grid{grid-template-columns:1fr}
.beat-section select{width:100%}
.beat-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}
.beat-grid label{display:flex;flex-direction:column;gap:6px}
#beatTagNameRow{display:flex;flex-direction:column;gap:6px;margin:0 0 12px}
.beat-app-row{display:flex;flex-wrap:wrap;gap:8px}
.beat-app-row .beat-app-btn{font-size:11px;padding:6px 12px}
.chord-chip-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.chord-chip{font-size:11px;padding:5px 10px;background:var(--panel);border:1px solid var(--line-soft);border-radius:6px;color:var(--text);cursor:pointer;font-family:"Roboto Mono",monospace}
.chord-chip:hover{border-color:var(--primary-hi);color:var(--primary-hi)}

/* Song length leads the Session stage, set before anything else. */
.stage-body > label.length-first{display:block;background:var(--panel-2);border:1px solid var(--line-soft);border-left:3px solid var(--primary);border-radius:8px;padding:12px 14px;margin:0 24px 16px}
.stage-body > label.length-first > span{display:block;font-weight:600;font-size:13px;margin-bottom:6px;color:var(--text)}
.stage-body > label.length-first select{width:100%}
/* small{} is nowrap with an ellipsis site-wide, which cut the Duration advice
   off after a few words. This note has to be read in full. */
label.length-first small{white-space:normal;overflow:visible;text-overflow:clip;line-height:1.5}

/* Keep the length controls visible at narrow widths and high browser zoom. */
html,body{max-width:100%;overflow-x:hidden}
.stage-body,.form-grid,.form-grid label,.length-first{min-width:0;max-width:100%;box-sizing:border-box}
#length,#forceShortBtn{display:block;max-width:100%;box-sizing:border-box}
#forceShortBtn{min-height:38px;color:#fff;white-space:normal;text-align:center;text-indent:0;overflow:visible}
@media(max-width:1000px){
  .stage-body > *,.stage-body > .output-box,.stage-body > .quality-box,.stage-body > .songs-box,.stage-body > .handoff-box{max-width:calc(100vw - 32px);box-sizing:border-box}
}

/* Full Album — One Go */
.album-batch-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}
.album-batch-grid label,.album-batch-label{display:flex;flex-direction:column;gap:6px;color:var(--text-2);font-size:12px;font-weight:600}
.album-batch-grid input,.album-batch-grid select{width:100%;box-sizing:border-box;background:var(--panel-2);border:1px solid var(--line-soft);color:var(--text);border-radius:8px;padding:10px}
.album-batch-wide{grid-column:1/-1}
#batchAlbumInput{width:100%;box-sizing:border-box;margin-top:6px;font-family:inherit;line-height:1.45}
.full-album-track{border:1px solid var(--line-soft);border-radius:8px;margin-top:10px;background:var(--panel-2)}
.full-album-track summary{cursor:pointer;padding:12px;color:var(--primary-hi);font-weight:700}
.full-album-track summary span{display:block;color:var(--text-3);font-size:11px;font-weight:400;margin-top:3px}
.full-album-track .album-block{margin:0 12px 12px}
.full-album-track textarea,#fullAlbumOutput textarea{width:100%;box-sizing:border-box}
@media(max-width:680px){.album-batch-grid{grid-template-columns:1fr}.album-batch-wide{grid-column:auto}}

/* Affiliate links on the Release page */
.mf-partner a{color:var(--primary-hi);font-weight:700;text-decoration:underline}
.mf-aff{color:var(--muted);font-size:11px}
