/* The Forge page, redesigned (forge-front.js). Desktop matches the mockup exactly. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;700;800;900&display=swap');
.fxf .fx-btn { transition: filter .15s ease, box-shadow .15s ease; }
.fxf .fx-btn:hover { filter: brightness(1.12); }
.fxf .fx-btn:focus-visible, .fxf .fx-pad:focus-visible { outline: 2px solid #ffd9a0; outline-offset: 2px; }
.fxf .fx-pad { transition: background .08s ease, box-shadow .12s ease, transform .06s ease; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.fxf .fx-pad:active { transform: translateY(1px); }
.fxf h2 { font-family: inherit; }
@keyframes fx-breathe { 0%, 100% { box-shadow: inset 0 -2px 0 var(--sec), inset 0 0 0 var(--sec-soft), 0 0 3px var(--sec-soft); } 50% { box-shadow: inset 0 -3px 0 var(--sec), inset 0 0 16px var(--sec-soft), 0 0 18px var(--sec), 0 0 4px var(--sec); } }
@media (prefers-reduced-motion: reduce) { .fxf [style*="fx-breathe"] { animation: none !important; } }
@media (max-width: 760px) { .fxf .fx-sections { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

/* On the Forge tab the new page replaces the older Forge panels (they stay in the page, hidden). */
html.fxf-on body.heritage-ui.anvil-forge-view #root .anvil-studio-board-shell--workstation > :not(.fxf) { display: none !important; }
html.fxf-on body.anvil-forge-view .anvil-studio-board-shell--workstation { padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
html.fxf-on body.heritage-ui.anvil-forge-view #root .anvil-studio-board-shell--workstation > .fxf.fxf { display: flex !important; }

/* ---------- Phones (html.ws-phone): each part sized to the screen and stacked ---------- */
html.ws-phone .fxf { padding: 8px 4px 0 !important; gap: 10px !important; border-radius: 0 !important; }
html.ws-phone .fxf-title { padding: 10px 12px !important; }
html.ws-phone .fxf-title strong { font-size: 16px !important; }
html.ws-phone .fxf-title span { font-size: 9px !important; }
html.ws-phone .fxf-body { padding: 10px 8px !important; border-width: 4px !important; border-radius: 14px !important; gap: 12px !important; }
/* Transport: pinned under the session bar while you play (upright), compact rows. */
html.ws-phone .fxf-transport { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 6px !important; padding: 6px !important; z-index: 30; }
/* Pinned on every phone, the iPhone Duo / fold included, except a short phone on its side. */
html.ws-phone .fxf-transport { position: sticky; top: var(--fxf-dock, 0px); }
@media (orientation: landscape) and (max-height: 520px) { html.ws-phone .fxf-transport { position: relative; top: auto; } }
html.ws-phone .fxf-transport-label { display: none !important; }
html.ws-phone .fxf-keys { grid-column: 1 / -1; display: grid !important; grid-template-columns: 40px 1.3fr 1fr 1.3fr; gap: 4px !important; padding: 4px !important; }
html.ws-phone .fxf-keys > button { min-width: 0 !important; width: auto !important; height: 38px !important; font-size: 11px !important; letter-spacing: 0.04em !important; padding: 0 4px !important; }
html.ws-phone .fxf-lcd { grid-column: 1; min-width: 0; gap: 10px !important; padding: 4px 10px !important; }
html.ws-phone .fxf-lcd > div:last-child { min-width: 0 !important; overflow: hidden; }
html.ws-phone .fxf-lcd [data-r="where"] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
html.ws-phone .fxf-bpm { grid-column: 2; align-self: stretch; display: grid; place-items: center; font-size: 11px; }
html.ws-phone .fxf-modes { grid-column: 1 / -1; margin-left: 0 !important; display: grid !important; grid-template-columns: 1fr 1fr; }
/* Forge Heat: a wide bar right above the pads, burning left to right. */
html.ws-phone .fxf-stage { flex-direction: column !important; flex-wrap: nowrap !important; gap: 8px !important; }
html.ws-phone .fxf-heat { flex: none !important; height: 76px; min-height: 0 !important; border-width: 5px !important; }
html.ws-phone .fxf-grate { top: 26px !important; padding: 0 10px 6px !important; flex-direction: row !important; gap: 2px !important; }
html.ws-phone .fxf-grate > div { flex: 1; flex-direction: column; justify-content: center; gap: 1px !important; }
html.ws-phone .fxf-grate > div > span { width: 100% !important; height: 2px !important; }
html.ws-phone .fxf-heat svg { height: 22px !important; }
html.ws-phone .fxf-heat > span { top: 5px !important; left: 6px !important; font-size: 9px !important; }
/* Pads: the pad panel fills the screen under the pinned bars and the heat bar. */
html.ws-phone .fxf-padpanel { flex: none !important; height: var(--fxf-padroom, auto); padding: 8px !important; gap: 8px !important; }
html.ws-phone .fxf-padhead { gap: 6px !important; }
html.ws-phone .fxf-padhead > [data-r="sources"] { flex-wrap: nowrap !important; overflow-x: auto; }
html.ws-phone .fxf-padhead > [data-r="sources"] > button { flex: 0 0 auto; }
html.ws-phone .fxf-padhead > [data-r="padHeader"] { font-size: 9px !important; }
html.ws-phone .fxf-pads { flex: 1 1 0 !important; min-height: 0 !important; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 6px !important; padding: 6px !important; }
html.ws-phone .fxf .fx-pad { min-height: 0 !important; padding: 6px !important; overflow: hidden; }
html.ws-phone .fxf .fx-pad svg { min-height: 0 !important; }
html.ws-phone .fxf-banks { gap: 4px !important; padding: 6px !important; }
html.ws-phone .fxf-banks > button { height: 38px !important; font-size: 14px !important; }
html.ws-phone .fxf-arrangement { padding: 6px !important; gap: 6px !important; }
html.ws-phone .fxf-arrangement > div { min-width: 0 !important; flex-basis: 100% !important; order: 3; }
/* Scope: full width, shorter. */
html.ws-phone .fxf-scope { flex: none !important; min-height: 0 !important; height: 240px; border-width: 5px !important; }
html.ws-phone .fxf-scope svg { min-height: 0 !important; }
html.ws-phone .fxf-scope [data-r="spectrum"] { height: 60px !important; }
/* Pattern map scrolls sideways with the bank letters kept in view. */
html.ws-phone .fxf-map, html.ws-phone .fxf-send { padding: 10px 8px !important; }
html.ws-phone .fxf-map-scroll { padding: 6px !important; }
html.ws-phone .fxf-map [data-r="mapRows"] > div > span:first-child { position: sticky; left: -6px; z-index: 1; }
html.ws-phone .fxf-send [data-r="sendChips"] > button { width: 38px !important; height: 38px !important; }
html.ws-phone .fxf .fx-sections { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; padding: 8px !important; }
html.ws-phone .fxf .fx-sections > div { padding: 10px 8px !important; }
html.ws-phone .fxf .fx-sections button { font-size: 10px !important; letter-spacing: 0 !important; }
html.ws-phone .fxf-footer { padding: 8px 10px !important; }
html.ws-phone .fxf-footer > span:last-child { display: none; }
/* Narrow phones: pad names on two lines, song pad titles smaller. */
@media (max-width: 559px) {
  html.ws-phone .fxf .fx-pad [data-p="name"] { white-space: normal !important; overflow-wrap: break-word; display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 9px; line-height: 1.15; }
  html.ws-phone .fxf .fx-pad [data-p="title"] { font-size: 11px !important; letter-spacing: 0 !important; line-height: 1.15; }
  html.ws-phone .fxf .fx-pad [data-p="sub"] { font-size: 8px !important; }
  html.ws-phone .fxf .fx-pad [data-p="tag"] { font-size: 8px !important; padding: 1px 3px !important; }
  html.ws-phone .fxf-keys > button { font-size: 10px !important; }
}
/* Short phones turned sideways: pads keep key, dot and name; waveforms hide. */
@media (max-height: 519px) {
  html.ws-phone .fxf .fx-pad svg { display: none !important; }
  html.ws-phone .fxf .fx-pad { justify-content: space-between !important; }
  html.ws-phone .fxf-heat { height: 52px; }
  html.ws-phone .fxf-padhead > [data-r="padHeader"] { display: none; }
  html.ws-phone .fxf-padhead button { min-height: 30px !important; }
  html.ws-phone .fxf-banks > button { height: 30px !important; }
  html.ws-phone .fxf-arrangement > button { min-height: 32px !important; }
  html.ws-phone .fxf-pads { padding: 4px !important; gap: 4px !important; }
  html.ws-phone .fxf .fx-pad { padding: 4px 6px !important; }
}
/* Send the performance (transport). */
html.ws-phone .fxf-out { grid-column: 1 / -1; display: grid !important; grid-template-columns: 1fr 1fr; padding: 4px !important; gap: 4px !important; }
html.ws-phone .fxf-out > button { min-height: 38px !important; padding: 0 4px !important; font-size: 10px !important; }
html.ws-phone .fxf-sendmenu { width: auto !important; left: 0 !important; right: 0 !important; }
/* Keep the MIDI connection strip on the Forge page. It lives in the old board, which the
   Forge front hides, so show that board only for the strip and keep everything else hidden. */
html.fxf-on body.heritage-ui.anvil-forge-view #root .anvil-studio-board-shell--workstation > .anvil-forge-path:has(.anvil-midi-panel) { display: block !important; order: -1 !important; width: 100% !important; margin: 0 0 12px !important; padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
html.fxf-on body.heritage-ui.anvil-forge-view #root#root#root .anvil-studio-board-shell--workstation > .anvil-forge-path:has(.anvil-midi-panel) > :not(:has(> .anvil-midi-panel)) { display: none !important; }
html.fxf-on body.heritage-ui.anvil-forge-view #root .anvil-studio-board-shell--workstation > .anvil-forge-path > div:has(> .anvil-midi-panel) { display: block !important; }

/* BUILD THIS SONG: a glowing bar at the top of the Forge that takes you down to the song pads
   and the arrangement recorder (Nov 2026). */
.fxf-buildbar {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  width: 100%; min-height: 48px; padding: 8px 16px; cursor: pointer;
  border: 1px solid #f5c77a; border-radius: 10px;
  background: linear-gradient(90deg, #3a2410, #6b3f12 50%, #3a2410);
  color: #ffe2ae; font: 800 14px/1.2 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 0.14em;
  box-shadow: 0 0 0 1px rgba(245, 199, 122, 0.25), 0 0 18px rgba(240, 166, 64, 0.45), inset 0 1px 0 rgba(255, 230, 180, 0.35);
  animation: fxf-buildbar-glow 1.6s ease-in-out infinite;
}
.fxf-buildbar small { font-size: 10px; letter-spacing: 0.08em; color: #f3c48a; opacity: 0.9; }
.fxf-buildbar__dot { width: 10px; height: 10px; border-radius: 50%; background: #ffb547; box-shadow: 0 0 10px #ffb547; animation: fxf-buildbar-blink 0.8s steps(2, jump-none) infinite; }
.fxf-buildbar__arrow { font-size: 14px; animation: fxf-buildbar-bob 1.2s ease-in-out infinite; }
.fxf-buildbar:hover, .fxf-buildbar:focus-visible { border-color: #ffe2ae; outline: none; }
@keyframes fxf-buildbar-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(245, 199, 122, 0.25), 0 0 10px rgba(240, 166, 64, 0.30), inset 0 1px 0 rgba(255, 230, 180, 0.35); }
  50% { box-shadow: 0 0 0 1px rgba(255, 210, 140, 0.55), 0 0 26px rgba(255, 170, 60, 0.75), inset 0 1px 0 rgba(255, 230, 180, 0.5); }
}
@keyframes fxf-buildbar-blink { 0% { opacity: 1; } 100% { opacity: 0.25; } }
@keyframes fxf-buildbar-bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) {
  .fxf-buildbar, .fxf-buildbar__dot, .fxf-buildbar__arrow { animation: none; }
}
html.ws-phone .fxf-buildbar { min-height: 42px; font-size: 12px; gap: 8px; }
html.ws-phone .fxf-buildbar small { font-size: 9px; }

/* Transport fold on phones (Nov 2026): ▾ / ▴ at the end of PLAY / STOP / REC hides or shows
   the position readout, SEND TAKE / TO SHEET and LOOP PASS / PLAY SONG. Desktop: always open. */
.fxf-more { display: none !important; }
html.ws-phone .fxf-more { display: grid !important; place-items: center; height: 38px !important; border-radius: 7px; border: 1px solid #8fd3bd; background: linear-gradient(180deg, #2f4f4a, #1c3330); color: #bff3e1; font: 800 15px ui-monospace, Menlo, monospace; cursor: pointer; padding: 0 !important; }
html.ws-phone .fxf-keys { grid-template-columns: 40px 1.3fr 1fr 1.3fr 40px !important; }
html.ws-phone .fxf-transport.is-folded > :not(.fxf-keys) { display: none !important; }

/* Move settings pop-up (Nov 2026): ⚙ SET on FILL / FILTER / DROP / RISER. */
.fx-pad [data-p="tag"] { cursor: pointer; }
.fxf-movepop { position: fixed; z-index: 10000; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 20px)); max-height: calc(100vh - 24px); overflow: auto; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; border: 1px solid #8fd3bd; background: linear-gradient(180deg, #1b2a2b, #0d1415); box-shadow: 0 18px 50px rgba(0,0,0,.65); color: #e8efeb; font: 800 11px/1.25 'JetBrains Mono', ui-monospace, Menlo, monospace; letter-spacing: .04em; }
.fxf-movepop * { box-sizing: border-box; }
.fxf-mp-head { display: flex; align-items: baseline; gap: 10px; }
.fxf-mp-head b { font-size: 16px; color: #ffcf86; letter-spacing: .08em; }
.fxf-mp-head span { color: #9fc7bb; font-size: 10px; flex: 1; }
.fxf-mp-x { width: 32px; height: 32px; border-radius: 7px; border: 1px solid #3b4a48; background: #121a1b; color: #c9dad5; cursor: pointer; }
.fxf-mp-row { display: flex; flex-direction: column; gap: 5px; }
.fxf-mp-row > span { color: #9fc7bb; font-size: 10px; letter-spacing: .12em; display: flex; justify-content: space-between; }
.fxf-mp-row output { color: #ffcf86; letter-spacing: 0; }
.fxf-mp-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 4px; }
.fxf-movepop button { min-height: 36px; border-radius: 7px; border: 1px solid #3b4a48; background: linear-gradient(180deg, #24302f, #161e1f); color: #e8efeb; font: inherit; cursor: pointer; touch-action: manipulation; }
.fxf-movepop button[aria-pressed="true"] { border-color: #ffe2b4; background: linear-gradient(180deg, #ffd699, #e9a85c); color: #2a1c08; }
.fxf-movepop input[type=range] { width: 100%; min-height: 28px; accent-color: #f0a640; margin: 0; }
.fxf-movepop select { width: 100%; min-height: 36px; border-radius: 7px; border: 1px solid #3b4a48; background: #0b1213; color: #e8efeb; font: inherit; padding: 0 8px; }
.fxf-mp-foot { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 6px; }
.fxf-mp-foot [data-try] { border-color: #f5ddb2 !important; background: linear-gradient(180deg, #f2c27d, #d99a4e) !important; color: #2a1c08 !important; }
.fxf-movepop small { color: #8fa9a1; font-size: 10px; font-weight: 600; letter-spacing: 0; line-height: 1.4; }
.fxf-mp-seg button { font-size: 10px; letter-spacing: 0.02em; padding: 0 4px; }

/* Section editor (Nov 20 2026): ✎ on a song pad renames the block or moves it. */
.fxf-secpop { width: min(520px, calc(100vw - 20px)); border-width: 2px; }
.fxf-secpop .fxf-mp-head b { font-size: 17px; }
.fxf-secpop .fxf-sec-names { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.fxf-secpop .fxf-sec-names button { min-height: 32px; }
.fxf-secpop .fxf-sec-custom { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin: 0; }
.fxf-secpop .fxf-sec-custom input { min-height: 38px; padding: 0 10px; border-radius: 7px; border: 1px solid #8fd3bd; background: #0b1213; color: #ffe2ae; font: 800 13px 'JetBrains Mono', ui-monospace, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
.fxf-secpop .fxf-sec-custom button { padding: 0 16px; border-color: #f5ddb2; background: linear-gradient(180deg, #f2c27d, #d99a4e); color: #2a1c08; }
.fxf-secpop [data-standard] { margin-top: 2px; color: #9fc7bb; }
.fxf-secpop button:disabled { opacity: .45; cursor: default; }
.fxf-secpop .fxf-sec-nudge { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fxf-secpop .fxf-sec-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; }
.fxf-secpop .fxf-sec-blocks button { display: flex; align-items: center; gap: 6px; padding: 0 8px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fxf-secpop .fxf-sec-blocks button span { color: #8fa9a1; font-size: 10px; }
.fxf-secpop .fxf-sec-foot { grid-template-columns: 1fr; }
