/* Text polish for the Workstation and The Forge (round 2: bigger, bolder, lit).
   Same look and colours as before; the type is larger, heavier, and has a soft
   light behind it: a bright edge on the silver panels, a glow on the dark screens.
   Loaded after the panel styles so it only changes text, never layout. */

/* --ws-tx: when the desktop board is scaled down to fit a smaller window (View Config /
   Auto Fit), text is scaled back up by the same amount (capped) so it stays readable.
   It is 1 at full size and on phones. Set by workstation-front-top.js. */

/* Crisp, even type everywhere on the two pages. */
.wsf, .fxf, .ws-transport, .ws-band-title, #sampkai-progress-dock {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  font-kerning: normal;
}

/* Bold it out: every label, button and readout is heavy. */
:is(.wsf, .fxf, .ws-transport) :is(span, small, output, button, label, strong, b, h2, select, summary) { font-weight: 800 !important; }

/* ---------- Workstation panel classes ---------- */
.wsf .ws-label { font-size: calc(13.5px * var(--ws-tx, 1)) !important; font-weight: 900 !important; letter-spacing: 0.08em !important; color: #0c1513 !important; text-shadow: none !important; }
.wsf .ws-note { font-size: calc(13px * var(--ws-tx, 1)) !important; color: #13302a !important; text-shadow: none !important; }
.wsf .ws-row { font-size: calc(13.5px * var(--ws-tx, 1)) !important; color: #0c1513 !important; text-shadow: none !important; }
.wsf .ws-row output { font-size: calc(14px * var(--ws-tx, 1)) !important; color: #e0fff3 !important; text-shadow: 0 0 8px rgba(127, 227, 200, 0.75) !important; }
.wsf .ws-key, .wsf .ws-dark { font-size: calc(13.5px * var(--ws-tx, 1)) !important; letter-spacing: 0.03em; }
.wsf .ws-key { color: #15201d !important; text-shadow: none !important; }
.wsf .ws-key[aria-pressed="true"] { color: #1a1003 !important; }
.wsf .ws-dark { text-shadow: 0 0 8px rgba(191, 243, 225, 0.55); }
.wsf .ws-section-title { font-size: calc(15px * var(--ws-tx, 1)) !important; }
.wsf .ws-fold { font-size: calc(13.5px * var(--ws-tx, 1)) !important; }

/* Section titles on the silver body ("2 · PERFORM", "3 · MIX DESK"): dark and embossed. */
.ws-band-title { font-size: calc(16px * var(--ws-tx, 1)) !important; font-weight: 900 !important; letter-spacing: 0.14em !important; color: #121c1a !important; text-shadow: none !important; }

/* Workstation transport bar. */
.ws-transport { font-size: calc(13.5px * var(--ws-tx, 1)); }
.ws-transport__key { font-size: calc(13.5px * var(--ws-tx, 1)) !important; }
.ws-transport small, .ws-transport__readout { font-size: calc(13.5px * var(--ws-tx, 1)) !important; }

/* ---------- Small inline sizes, both pages ---------- */
:is(.wsf, .fxf) :is([style*="font-size: 8px"], [style*="00 8px"]) { font-size: calc(11.5px * var(--ws-tx, 1)) !important; }
:is(.wsf, .fxf) :is([style*="font-size: 9px"], [style*="00 9px"]) { font-size: calc(12px * var(--ws-tx, 1)) !important; }
:is(.wsf, .fxf) :is([style*="font-size: 10px"], [style*="00 10px"]) { font-size: calc(13px * var(--ws-tx, 1)) !important; }
:is(.wsf, .fxf) :is([style*="font-size: 10.5px"], [style*="00 10.5px"]) { font-size: calc(13.5px * var(--ws-tx, 1)) !important; }
:is(.wsf, .fxf) :is([style*="font-size: 11px"], [style*="00 11px"]) { font-size: calc(13.5px * var(--ws-tx, 1)) !important; }
:is(.wsf, .fxf) :is([style*="font-size: 12px"], [style*="00 12px"]) { font-size: calc(14px * var(--ws-tx, 1)) !important; }
.fxf { font-size: calc(14px * var(--ws-tx, 1)) !important; }

/* ---------- Faint text on the silver panels: darker, with a bright edge ---------- */
:is(.wsf, .fxf) :is([style*="color: #55645f"], [style*="color: rgb(85, 100, 95)"]) { color: #1d2925 !important; }
:is(.wsf, .fxf) :is([style*="color: #4b5a55"], [style*="color: rgb(75, 90, 85)"]) { color: #1a2622 !important; }
:is(.wsf, .fxf) :is([style*="color: #33504a"], [style*="color: rgb(51, 80, 74)"]) { color: #12302a !important; }
:is(.wsf, .fxf) :is([style*="color: #3f6b60"], [style*="color: rgb(63, 107, 96)"]) { color: #10443a !important; }
:is(.wsf, .fxf) :is([style*="color: #3f5a54"], [style*="color: rgb(63, 90, 84)"]) { color: #13312a !important; }
:is(.wsf, .fxf) :is([style*="color: #3b4a46"], [style*="color: rgb(59, 74, 70)"]) { color: #172320 !important; }
:is(.wsf, .fxf) :is([style*="color: #6c7873"], [style*="color: rgb(108, 120, 115)"]) { color: #3a4641 !important; }
:is(.wsf, .fxf) :is([style*="color: #24312e"], [style*="color: rgb(36, 49, 46)"]) { color: #0f1816 !important; }
:is(.wsf, .fxf) :is([style*="color: #1a2624"], [style*="color: rgb(26, 38, 36)"], [style*="color: #2c3a37"], [style*="color: rgb(44, 58, 55)"], [style*="color: #1c2826"], [style*="color: rgb(28, 40, 38)"]) { text-shadow: none !important; }
:is(.wsf, .fxf) :is([style*="color: #55645f"], [style*="color: rgb(85, 100, 95)"], [style*="color: #4b5a55"], [style*="color: rgb(75, 90, 85)"], [style*="color: #33504a"], [style*="color: rgb(51, 80, 74)"], [style*="color: #3f6b60"], [style*="color: rgb(63, 107, 96)"], [style*="color: #24312e"], [style*="color: rgb(36, 49, 46)"]) { text-shadow: none !important; }

/* ---------- Text on the dark screens: brighter, with a glow behind it ---------- */
:is(.wsf, .fxf) :is([style*="color: #8a9d99"], [style*="color: rgb(138, 157, 153)"]) { color: #c9dad5 !important; }
:is(.wsf, .fxf) :is([style*="color: #9fb3ac"], [style*="color: rgb(159, 179, 172)"]) { color: #d3e1dc !important; }
:is(.wsf, .fxf) :is([style*="color: #b2c0b8"], [style*="color: rgb(178, 192, 184)"]) { color: #e3ebe7 !important; }
:is(.wsf, .fxf) :is([style*="color: #c9b89c"], [style*="color: rgb(201, 184, 156)"]) { color: #f0dfc0 !important; }
:is(.wsf, .fxf) :is([style*="color: #c9d4cf"], [style*="color: rgb(201, 212, 207)"]) { color: #ebf3ef !important; }
.wsf .ws-screen :is(span, strong, output, b, small),
.fxf :is(.fxf-lcd, .fxf-bpm, .fxf-heat, .fxf-scope, .fxf-map-scroll, .fxf-sendmenu, [data-r="toast"], [data-r="arrChips"], .fxf-title, .fxf-footer) :is(span, strong, b),
.fxf :is(.fxf-bpm, [data-r="toast"], .fxf-footer > span) {
  text-shadow: 0 0 7px color-mix(in srgb, currentColor 55%, transparent), 0 1px 1px rgba(0, 0, 0, 0.8) !important;
}

/* ---------- The Forge ---------- */
.fxf h2 { font-size: calc(16px * var(--ws-tx, 1)) !important; }
.fxf [data-r="takeLabel"] { font-size: calc(13.5px * var(--ws-tx, 1)) !important; }
.fxf [data-r="mapRows"] > div > span { font-size: calc(13px * var(--ws-tx, 1)) !important; }
.fxf [data-r="status"], .fxf-footer span { font-size: calc(13.5px * var(--ws-tx, 1)) !important; }
.fxf [data-r="toast"] { font-size: calc(14px * var(--ws-tx, 1)) !important; }
.fxf [data-r="where"] { font-size: calc(14px * var(--ws-tx, 1)) !important; }
.fxf .fxf-title strong { font-size: calc(22px * var(--ws-tx, 1)) !important; }
.fxf .fxf-title span { font-size: calc(12.5px * var(--ws-tx, 1)) !important; }

/* ---------- Narrow columns: big, but still on one line ---------- */
/* Pad Flex: buttons stay on one line; its wave screen labels wrap instead of overlapping. */
.wsf.wsf-padflex .ws-key { font-size: calc(12.5px * var(--ws-tx, 1)) !important; letter-spacing: 0 !important; white-space: nowrap; padding: 0 6px !important; }
.wsf.wsf-padflex .wsf-flex-head { font-size: calc(11.5px * var(--ws-tx, 1)) !important; }
.wsf.wsf-padflex .wsf-flex-head > span { font-size: calc(11.5px * var(--ws-tx, 1)) !important; white-space: nowrap; }
.wsf.wsf-padflex .wsf-flex-marks > span { font-size: calc(11.5px * var(--ws-tx, 1)) !important; white-space: normal; line-height: 1.2; overflow-wrap: anywhere; display: flex; align-items: center; justify-content: center; }
.wsf.wsf-padflex .wsf-flex-marks { gap: 4px !important; }
.wsf.wsf-padflex .wsf-flex-marks > span { padding: 4px 2px !important; letter-spacing: 0 !important; }

/* ---------- Phones: a step smaller than desktop so rows and buttons keep to one line ---------- */
html.ws-phone .wsf .ws-key, html.ws-phone .wsf .ws-dark, html.ws-phone .wsf .ws-row { font-size: calc(12.5px * var(--ws-tx, 1)) !important; letter-spacing: 0.02em !important; }
html.ws-phone .wsf .ws-note { font-size: calc(12px * var(--ws-tx, 1)) !important; }
html.ws-phone .wsf .ws-label { font-size: calc(12.5px * var(--ws-tx, 1)) !important; letter-spacing: 0.05em !important; }
html.ws-phone .ws-band-title { font-size: calc(14px * var(--ws-tx, 1)) !important; }
html.ws-phone .fxf [data-r="where"] { font-size: calc(13px * var(--ws-tx, 1)) !important; }
html.ws-phone .wsf.wsf-mix-pad .ws-key { font-size: calc(12px * var(--ws-tx, 1)) !important; letter-spacing: 0 !important; white-space: nowrap; }
html.ws-phone .fxf .fx-pad [data-p="tag"] { font-size: calc(9.5px * var(--ws-tx, 1)) !important; }
html.ws-phone .fxf .fx-pad [data-p="sub"] { font-size: calc(9.5px * var(--ws-tx, 1)) !important; }
html.ws-phone .fxf .fx-pad [data-p="title"] { font-size: calc(12px * var(--ws-tx, 1)) !important; }
html.ws-phone .fxf .fx-pad [data-p="name"], html.ws-phone .wsf .wsf-pad .wsf-pad-name { font-size: calc(10.5px * var(--ws-tx, 1)) !important; }
/* Narrow phones: Forge pass pads give the whole bottom line to the sound name. */
@media (max-width: 559px) {
  html.ws-phone .fxf .fx-pad [data-p="num"] { display: none !important; }
  html.ws-phone .fxf .fx-pad [data-p="name"] { width: 100%; }
}

/* Phones, tuned: buttons and readouts keep to one line. */
html.ws-phone .wsf .ws-key, html.ws-phone .wsf .ws-dark, html.ws-phone .wsf .ws-row { font-size: calc(12px * var(--ws-tx, 1)) !important; letter-spacing: 0 !important; }
html.ws-phone .fxf [data-r="where"] { font-size: calc(12px * var(--ws-tx, 1)) !important; }
html.ws-phone .wsf .wsf-pad .wsf-pad-name { font-size: calc(10px * var(--ws-tx, 1)) !important; }
html.ws-phone .fxf .fx-pad [data-p="title"] { font-size: calc(11.5px * var(--ws-tx, 1)) !important; line-height: 1.1; }
html.ws-phone .wsf .ws-row { font-size: calc(11.5px * var(--ws-tx, 1)) !important; }
html.ws-phone .wsf .ws-row output { font-size: calc(12px * var(--ws-tx, 1)) !important; min-width: 0 !important; }
/* Forge on phones: the pad panel is screen-sized, so its controls stay compact and the pads keep the room. */
html.ws-phone .fxf .fxf-padhead button { font-size: calc(12px * var(--ws-tx, 1)) !important; min-height: 32px !important; }
html.ws-phone .fxf .fxf-arrangement > button { flex: 1 1 0; min-height: 34px !important; padding: 0 6px !important; font-size: calc(11px * var(--ws-tx, 1)) !important; letter-spacing: 0 !important; white-space: nowrap; }
html.ws-phone .fxf .fxf-arrangement [data-r="arrChips"] > span { font-size: calc(10.5px * var(--ws-tx, 1)) !important; }
html.ws-phone .fxf .fxf-banks > button { font-size: calc(14px * var(--ws-tx, 1)) !important; }
/* Narrow phones, SONG PADS: the pad colour already shows LIVE / NEXT, so the small tag row
   gives its space to the section name (two lines) and its banks. */
@media (max-width: 559px) {
  html.ws-phone .fxf .fx-pad .fxf-song > span:first-child { display: none !important; }
  html.ws-phone .fxf .fx-pad[aria-pressed] { justify-content: space-between !important; }
  html.ws-phone .fxf .fxf-lcd { gap: 8px !important; }
  html.ws-phone .fxf .fxf-lcd :is([style*="font-size: 9px"]) { font-size: calc(10px * var(--ws-tx, 1)) !important; }
  html.ws-phone .fxf [data-r="where"] { font-size: calc(11.5px * var(--ws-tx, 1)) !important; }
}

/* Small value boxes (RECORD GRID 1/16, POLY, OFF…) and other leftovers. */
.wsf .wsf-out-button { font-size: calc(13px * var(--ws-tx, 1)) !important; min-width: 58px !important; padding: 4px 8px !important; color: #e0fff3 !important; text-shadow: 0 0 8px rgba(127, 227, 200, 0.75) !important; }
.wsf .anvil-forge-rail-visual__label { font-size: calc(12px * var(--ws-tx, 1)) !important; font-weight: 800 !important; }
/* Pad names shorten with "…" before they can run into the pad number. */
.wsf .wsf-pad > span:last-child, .fxf .fx-pad .fxf-pass > span:last-child { gap: 6px; min-width: 0; }
.wsf .wsf-pad .wsf-pad-name, .fxf .fx-pad [data-p="name"] { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wsf .wsf-pad > span:last-child > span:last-child, .fxf .fx-pad [data-p="num"] { flex: none; }


/* ---------- Round 3: readable on every background ---------- */
/* Dark text never carries a white edge (it blurs). Text on the mid-grey plates is just bigger and black. */
.wsf .ws-plate :is(.ws-row, .ws-row > span, .ws-label, .ws-note) { text-shadow: none !important; }
.wsf .ws-plate .ws-row, .wsf .ws-plate .ws-row > span { font-size: calc(14.5px * var(--ws-tx, 1)) !important; color: #000 !important; }
.wsf .ws-plate .ws-label { font-size: calc(14px * var(--ws-tx, 1)) !important; color: #000 !important; }
.wsf .ws-plate .ws-note { font-size: calc(13.5px * var(--ws-tx, 1)) !important; color: #06231d !important; }

/* Text sitting on dark backgrounds: light and bigger. */
.wsf.wsf-note { font-size: calc(14px * var(--ws-tx, 1)) !important; color: #e8f0ec !important; font-weight: 800 !important; }
.wsf .ws-screen { color: #e6efea; }
.wsf .ws-screen :is([style*="color: #4f7d70"], [style*="color: rgb(79, 125, 112)"], [style*="color: #33504a"], [style*="color: rgb(51, 80, 74)"], [style*="color: #3f6b60"], [style*="color: rgb(63, 107, 96)"], [style*="color: #55645f"], [style*="color: rgb(85, 100, 95)"]) { color: #a8e6d2 !important; }
.wsf .ws-screen :is([style*="color: #ff7b6b"], [style*="color: rgb(255, 123, 107)"]) { color: #ff9a8c !important; }
.wsf .ws-screen strong[style*="VIEW"], .wsf-top .ws-screen strong { font-size: calc(13.5px * var(--ws-tx, 1)) !important; }
.wsf.wsf-disk :is(span, small, b, i, div) { letter-spacing: 0.04em; }
.wsf.wsf-disk .ws-screen, .wsf.wsf-disk .ws-screen * { font-size: max(calc(13px * var(--ws-tx, 1)), 1em); }
#sampkai-progress-dock .progress-label { font-size: 13px !important; }
#sampkai-progress-dock .progress-detail { font-size: 12px !important; color: #d6dedb !important; }
#sampkai-progress-dock button { font-size: 12.5px !important; }
/* Hints, step numbers and small captions on the plates: black. */
.wsf .ws-plate .ws-note, .wsf .ws-note { color: #000 !important; }
.wsf .ws-plate :is([style*="color: #33504a"], [style*="color: rgb(51, 80, 74)"], [style*="color: #12302a"]) { color: #000 !important; }
.wsf.wsf-padflex .ws-plate [style*="font-size: 9px"] { color: #000 !important; }
.wsf.wsf-disk i { font-size: 9.5px !important; }
.wsf.wsf-padflex .wsf-flex-head > span, .wsf.wsf-padflex .wsf-flex-marks > span { font-size: calc(12px * var(--ws-tx, 1)) !important; }

/* ---------- The rest of the Workstation (built outside the front panels) ---------- */
/* Step sequencer grid */
.anvil-pad-matrix__pad { font-size: calc(14px * var(--ws-tx, 1)) !important; font-weight: 800 !important; }
.anvil-pad-matrix__key { font-size: calc(12px * var(--ws-tx, 1)) !important; min-width: 22px !important; height: 20px !important; }
.anvil-pad-matrix__corner { font-size: calc(13px * var(--ws-tx, 1)) !important; }
.anvil-pad-matrix__tick { font-size: calc(13px * var(--ws-tx, 1)) !important; }
.anvil-pad-matrix__tick[data-beat="true"] { font-size: calc(17px * var(--ws-tx, 1)) !important; }
.anvil-pad-matrix__title strong, .anvil-pad-matrix__title span { font-size: calc(13.5px * var(--ws-tx, 1)) !important; }
.anvil-pad-matrix__bars button { font-size: calc(13px * var(--ws-tx, 1)) !important; }
/* Auto Chop timing strip (dark): light, bigger */
.anvil-disk-chop-controls__row, .anvil-disk-chop-controls__row :is(span, button), .anvil-disk-source-bpm { font-size: calc(12.5px * var(--ws-tx, 1)) !important; font-weight: 800 !important; }
.anvil-disk-chop-controls__row > span, .anvil-disk-source-bpm { color: #e8e2f2 !important; }
/* MIDI panel, art captions, Quick Start bar */
.anvil-midi-panel__connection, .anvil-midi-panel__summary { font-size: calc(12.5px * var(--ws-tx, 1)) !important; font-weight: 800 !important; }
.anvil-midi-panel__top a { font-size: calc(12.5px * var(--ws-tx, 1)) !important; }
.anvil-studio-board-shell figcaption { font-size: calc(12.5px * var(--ws-tx, 1)) !important; font-weight: 800 !important; }
.anvil-studio-board-shell--workstation .ws-quick-start strong { font-size: calc(14px * var(--ws-tx, 1)) !important; }
/* Phones: plate rows and value boxes a step smaller so label + value share one line. */
html.ws-phone .wsf .ws-plate .ws-row, html.ws-phone .wsf .ws-plate .ws-row > span { font-size: 12.5px !important; letter-spacing: 0 !important; }
html.ws-phone .wsf .ws-plate .ws-label { font-size: 12.5px !important; }
html.ws-phone .wsf .ws-plate .ws-note { font-size: 12px !important; }
html.ws-phone .wsf .wsf-out-button { min-width: 44px !important; padding: 4px 6px !important; font-size: 12px !important; }
/* Pad Flex marker readouts: always three lines tall, so no pad changes the column height. */
.wsf.wsf-padflex .wsf-flex-marks > span { min-height: calc(3.6em + 8px); box-sizing: border-box; }
.wsf.wsf-padflex .wsf-flex-marks > span { height: calc(3.6em + 8px); overflow: hidden; overflow-wrap: normal !important; word-break: keep-all; }
