/* The Studio dashboard layout: fixed sidebar, working column, bottom bar.
 *
 * The stage panels themselves are untouched - workflow-ui.js still builds and
 * fills them, and showStage() still switches them. Only the chrome around them
 * changes, so no feature had to be rewritten to get this layout.
 */

body.mf-shell-on { padding-bottom: 78px; }           /* room for the player bar */
body.mf-shell-on .stage-bar { display: none !important; }   /* replaced by the sidebar */
body.mf-shell-on .embers { display: none; }

/* --- sidebar ---------------------------------------------------------- */
#mf-side {
  position: fixed; top: 0; left: 0; bottom: 0; width: 248px;
  background: var(--sidebar);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column;
  z-index: 500; overflow-y: auto;
}
#mf-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 22px;
}
#mf-brand img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }
#mf-brand .n1 {
  color: var(--text); font-weight: 700; font-size: 14px;
  letter-spacing: .06em; line-height: 1.1;
}
#mf-brand .n2 {
  color: var(--primary-hi); font-weight: 600; font-size: 10px;
  letter-spacing: .28em; margin-top: 3px;
}

#mf-nav { padding: 0 12px; display: flex; flex-direction: column; gap: 3px; }
.mf-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: none; border: 0; width: 100%; text-align: left;
  color: var(--text-3); font-family: var(--font); font-size: 14px;
  font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.mf-nav-item:hover { background: var(--panel-2); color: var(--text-2); }
.mf-nav-item.active { background: var(--primary-soft); color: var(--text); font-weight: 600; }
.mf-nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.mf-nav-item.active svg { stroke: var(--primary-hi); }
.mf-nav-sep {
  margin: 14px 14px 8px; font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}

#mf-creed {
  margin: auto 14px 14px; padding: 16px 14px;
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text-2); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; line-height: 1.9; text-align: center;
}
#mf-ver { padding: 0 18px 18px; color: var(--muted); font-size: 11px; text-align: center; }

/* --- working column --------------------------------------------------- */
#mf-main { margin-left: 248px; min-height: 100vh; }
#mf-top {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 26px 30px 18px;
}
#mf-greet h1 {
  margin: 0; color: var(--text); font-size: 27px; font-weight: 700;
  letter-spacing: -.015em;
}
#mf-greet p { margin: 5px 0 0; color: var(--text-3); font-size: 14px; }
#mf-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.mf-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 15px;
}
.mf-chip .lbl { color: var(--text-3); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.mf-chip .val { color: var(--text); font-size: 17px; font-weight: 700; line-height: 1.1; }
.mf-chip .plan {
  background: var(--primary-soft); color: var(--primary-hi);
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: var(--radius-pill); white-space: nowrap;
}

/* The app's own body keeps its existing grid, just without the old top bar. */
body.mf-shell-on .topbar { display: none !important; }
body.mf-shell-on .app-shell { max-width: none; padding: 0 30px 40px; }

/* --- bottom bar -------------------------------------------------------- */
#mf-player {
  position: fixed; left: 248px; right: 0; bottom: 0; height: 72px;
  background: var(--bg-deep); border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 16px; padding: 0 22px; z-index: 480;
}
#mf-player .art {
  width: 44px; height: 44px; border-radius: 7px; background: var(--panel-2);
  border: 1px solid var(--line-soft); flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 17px;
}
#mf-player .meta { min-width: 0; }
#mf-player .t {
  color: var(--text); font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px;
}
#mf-player .b { color: var(--text-3); font-size: 11px; }
#mf-player .acts { margin-left: auto; display: flex; gap: 8px; }

/* --- narrow screens ---------------------------------------------------- */
@media (max-width: 1000px) {
  #mf-side {
    position: static; width: auto; flex-direction: row; flex-wrap: wrap;
    align-items: center; border-right: 0; border-bottom: 1px solid var(--line-soft);
  }
  #mf-brand { padding: 14px 16px; }
  #mf-nav { flex-direction: row; flex-wrap: wrap; padding: 0 12px 12px; }
  .mf-nav-item { width: auto; padding: 9px 12px; font-size: 13px; }
  .mf-nav-sep, #mf-creed, #mf-ver { display: none; }
  #mf-main { margin-left: 0; }
  #mf-player { left: 0; }
  body.mf-shell-on .app-shell { padding: 0 16px 40px; }
  #mf-top { padding: 18px 16px 14px; }
}

/* --- Plans, as a step in the flow -------------------------------------- */
#mf-plans-host { padding: 0 30px 40px; }

/* A walled step is shown as walled from the sidebar, rather than looking
   identical to the others right up until it refuses. */
.mf-nav-item.locked { color: var(--muted); }
.mf-nav-item.locked::after {
  content: "";
  width: 11px; height: 11px; margin-left: auto; flex: 0 0 11px;
  border: 1.6px solid currentColor; border-radius: 2px;
  border-bottom-width: 5px;
}
.mf-nav-item.locked.active { color: var(--text); }

.mf-plan-stop {
  background: var(--primary-soft); border: 1px solid var(--primary);
  border-radius: var(--radius); padding: 13px 16px; margin-bottom: 18px;
  color: var(--text-2); font-size: 13px; line-height: 1.6;
}
.mf-plan-stop strong { color: var(--text); }

.mf-plan-row { display: flex; gap: 14px; flex-wrap: wrap; }
.mf-plan-card {
  flex: 1; min-width: 210px; position: relative; text-align: center;
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 22px;
}
.mf-plan-card.featured { border-color: var(--primary); }
.mf-plan-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: var(--on-primary);
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: var(--radius-pill); white-space: nowrap;
}
.mf-plan-name  { color: var(--text-2); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.mf-plan-price { color: var(--text); font-size: 34px; font-weight: 700; line-height: 1; }
.mf-plan-per   { color: var(--text-3); font-size: 12px; margin: 4px 0 14px; }
.mf-plan-blurb { color: var(--text-2); font-size: 12px; line-height: 1.5; min-height: 52px; }
.mf-plan-card .forge-btn { width: 100%; margin-top: 14px; }

@media (max-width: 1000px) { #mf-plans-host { padding: 0 16px 40px; } }
.mf-plan-songs {
  color: var(--primary-hi); font-size: 12px; font-weight: 700; margin-bottom: 8px;
}
.mf-plan-blurb { min-height: 38px; }
.mf-plan-trial {
  margin-top: 14px; padding: 11px 14px; text-align: center;
  background: var(--panel-2); border: 1px dashed var(--line);
  border-radius: var(--radius); color: var(--text-3); font-size: 12px;
}

/* --- the transport ----------------------------------------------------- */
#mf-player .meta { flex: 0 0 auto; }
.mfp-transport { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.mfp-btn {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.mfp-btn svg { width: 17px; height: 17px; fill: currentColor; }
.mfp-btn:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.mfp-btn:disabled { color: var(--muted); opacity: .45; cursor: default; }
.mfp-btn.play {
  width: 38px; height: 38px; background: var(--primary); color: var(--on-primary);
}
.mfp-btn.play svg { width: 19px; height: 19px; }
.mfp-btn.play:hover:not(:disabled) { background: var(--primary-hi); color: var(--on-primary); }
.mfp-btn.play:disabled { background: var(--panel-2); color: var(--muted); }

/* --- the scrubber ------------------------------------------------------- */
.mfp-seek { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 120px; }
.mfp-time {
  color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums;
  min-width: 34px; text-align: center; white-space: nowrap;
}
#mfp-bar {
  flex: 1; height: 4px; -webkit-appearance: none; appearance: none;
  background: var(--panel-2); border-radius: 2px; cursor: pointer; outline: none;
}
#mfp-bar::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary-hi); border: 0; cursor: pointer;
}
#mfp-bar::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary-hi); border: 0; cursor: pointer;
}
#mfp-bar:focus-visible { outline: 2px solid var(--primary-hi); outline-offset: 3px; }

/* --- which take ---------------------------------------------------------- */
.mfp-right { margin-left: auto; display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.mfp-take {
  color: var(--text-3); font-size: 11px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#mfp-open, .mfp-right .forge-btn { font-size: 11px; text-decoration: none; }

/* The record turns while it plays - the one moving thing on the page, so it
   reads at a glance from across the room. */
#mfp-art.spin { animation: mfp-turn 4s linear infinite; }
@keyframes mfp-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #mfp-art.spin { animation: none; } }

@media (max-width: 1000px) {
  #mf-player { gap: 10px; padding: 0 12px; }
  #mf-player .meta { max-width: 130px; }
  .mfp-take { display: none; }
}

/* --- My Music: bands and songs ------------------------------------------ */
#mf-library-host { padding: 0 30px 40px; }
.mf-lib { display: flex; flex-direction: column; gap: 18px; max-width: 980px; }
.mf-lib-intro { color: var(--text-3); font-size: 13px; line-height: 1.6; margin: 0; }
.mf-lib-card {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 20px;
}
.mf-lib-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.mf-lib-head h3 { margin: 0; font-size: 17px; color: var(--primary-hi); }
.mf-lib-head span { color: var(--text-3); font-size: 12px; }
.mf-lib-form {
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px;
}
.mf-lib-formtitle { font-weight: 700; color: var(--text); margin-bottom: 12px; font-size: 14px; }
.mf-lib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mf-lib-grid label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mf-lib-grid label.wide { grid-column: 1 / -1; }
.mf-lib-grid label > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.mf-lib-grid textarea { min-height: 160px; resize: vertical; line-height: 1.5; font-size: 13px; }
.mf-lib-grid textarea.short { min-height: 66px; }
.mf-lib-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.mf-lib-msg { font-size: 12px; color: var(--primary-hi); }
.mf-lib-msg.bad { color: var(--danger); }
.mf-lib-filterrow { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mf-lib-filterrow span { color: var(--text-3); font-size: 12px; }
.mf-lib-filterrow select { width: auto; min-width: 200px; padding: 8px 10px; font-size: 13px; }
.mf-lib-list { display: flex; flex-direction: column; gap: 8px; }
.mf-lib-scroll { max-height: 520px; overflow: auto; }
.mf-lib-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--panel-2);
}
.mf-lib-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mf-lib-main strong { font-size: 14px; color: var(--text); }
.mf-lib-main span { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-lib-main em { color: var(--muted); font-size: 11px; font-style: normal; }
.mf-lib-btns { display: flex; gap: 8px; flex-shrink: 0; }
.mf-lib-btns .secondary-btn { padding: 7px 11px; font-size: 12px; }
.mf-lib-empty { color: var(--text-3); font-size: 13px; margin: 0; }
@media (max-width: 1000px) { #mf-library-host { padding: 0 16px 40px; } }
@media (max-width: 700px) {
  .mf-lib-grid { grid-template-columns: 1fr; }
  .mf-lib-row { flex-direction: column; align-items: stretch; }
  .mf-lib-btns { justify-content: flex-end; }
}

/* A grid item defaults to min-width:auto, so one wide child (Release page)
   stretched the whole column past a phone screen and cut off its right edge. */
.app-shell > * { min-width: 0; }

/* Phones: the player bar had more fixed-width parts than a phone is wide, so
   the Track Vault button sat off-screen. The scrubber goes; Track Vault stays. */
@media (max-width: 600px) {
  #mf-player { gap: 6px; }
  #mf-player .meta { max-width: 72px; }
  .mfp-seek { display: none; }
}
