/* XDJ-RX3 screen (1280x800, positioned like the unit) plus the viewer's panels around it. */

:root {
  --blue: #0a7fe6;
  --orange: #ff5a1a;
  --red: #e8141e;
  --green: #22e022;
  --cond: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #111; color: #fff; overflow: hidden; }
body { font: 13px var(--sans); -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

#app {
  display: grid; height: 100vh; height: 100dvh;
  grid-template: "screen" 1fr "kb" auto "status" auto / 1fr;
}
/* under the screen: the on-screen keyboard; ` swaps in the FX bar and mixer, shift+` leaves the screen alone */
#app .bar { display: none; }
#app.mixer-view { grid-template: "screen" 1fr "fx" auto "mixer" auto "status" auto / 1fr; }
#app.mixer-view .bar { display: flex; }
#app.mixer-view .mixer { display: grid; }
#app.mixer-view .vkb, #app.compact .vkb { display: none; }
#app.compact { grid-template: "screen" 1fr "status" auto / 1fr; }

/* ---------- the on-screen keyboard ---------- */

.vkb {
  grid-area: kb; display: flex; flex-direction: column; gap: 5px; align-items: stretch;
  width: 100%; max-width: 1060px; margin: 0 auto; padding: 10px 16px 6px; box-sizing: border-box;
  --d1: #3d9bff; --d2: #c070ff; --g: #8a8a8a;
}
.vkb-row { display: flex; gap: 5px; }
.vk {
  position: relative; flex: 1 1 0; min-width: 0; height: 40px; box-sizing: border-box; padding: 4px 6px 0;
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  background: #1b1b1b; border: 1px solid #2c2c2c; border-radius: 7px; cursor: pointer;
  box-shadow: inset 0 3px 0 -1px var(--tone, transparent), 0 1px 0 #000;
  transition: background .08s, transform .08s;
}
.vk b { font: 600 12px/1 var(--sans); color: #d8d8d8; }
.vk small {
  font: 600 9.5px/1.1 var(--cond); letter-spacing: .3px; color: #9a9a9a; padding-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vk i { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--tone, #888); opacity: .9; }
.vk.d1 { --tone: var(--d1); }
.vk.d2 { --tone: var(--d2); }
.vk.g { --tone: var(--g); }
.vk.off, .vk.mod { cursor: default; background: #121212; border-color: #1e1e1e; }
.vk.off b, .vk.mod b { color: #444; font-weight: 400; }
.vk.mod { cursor: pointer; }
.vk.lit { background: color-mix(in srgb, var(--lit) 22%, #1b1b1b); border-color: var(--lit); }
.vk.lit small { color: #fff; }
.vk:hover:not(.off) { background: #242424; }
.vk.lit:hover { background: color-mix(in srgb, var(--lit) 30%, #1b1b1b); }
.vk.down { transform: translateY(1px); background: #333; border-color: #666; }
.vk.mod.down { background: #333; }
.vk.mod.down b { color: #ddd; }
.vkb-legend { display: flex; gap: 16px; align-items: center; font: 600 10px var(--cond); letter-spacing: .5px; color: #777; padding: 2px 2px 0; }
.vkb-legend span::before { content: ""; display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.vkb-legend .d1::before { background: var(--d1); }
.vkb-legend .d2::before { background: var(--d2); }
.vkb-legend .g::before { background: var(--g); }
.vkb-legend .hint { margin-left: auto; color: #555; }
.vkb-legend .hint::before { display: none; }

/* ---------- the screen ---------- */

#screen-wrap { grid-area: screen; position: relative; overflow: hidden; background: #000; min-height: 200px; }
#screen {
  position: absolute; left: 0; top: 0; width: 1280px; height: 800px; transform-origin: 0 0;
  background: #000; overflow: hidden; font-family: var(--sans);
}
/* a thin frame round the screen, as the unit's bezel; drawn over it so the 1280x800 layout doesn't move */
#screen::after {
  content: ""; position: absolute; inset: 0; z-index: 20; pointer-events: none;
  border: calc(2px / var(--s, 1)) solid #000;
}
#screen section, #screen .scr-head, #screen .mini { display: none; }
#screen.view-source .v-source, #screen.view-browse .v-browse, #screen.view-playing .v-playing { display: block; }
#screen.view-source .scr-head, #screen.view-browse .scr-head,
#screen.view-source .mini, #screen.view-browse .mini { display: block; }

.scr-head { position: absolute; left: 0; top: 0; width: 1280px; height: 50px; background: #1a1a1a; }
.head-src {
  position: absolute; left: 0; top: 0; width: 100px; height: 50px; background: #0b0b0b; border-top: 3px solid #1b3b80;
  display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 19px;
}
.view-source .head-src { display: none; }
.head-title { position: absolute; left: 116px; top: 0; line-height: 52px; font: 500 27px var(--cond); white-space: nowrap; }
.view-source .head-title { left: 18px; font-family: var(--sans); font-size: 24px; text-shadow: 0 0 1px #000; }
.head-right, .top-right { position: absolute; right: 14px; top: 0; height: 50px; display: flex; align-items: center; gap: 8px; }
.head-clock { font-size: 14px; letter-spacing: .5px; }
.dim { color: #555; }
.timer-ico, .rec-dot { width: 15px; height: 15px; border-radius: 50%; display: inline-block; }
.timer-ico { border: 2px solid #ccc; position: relative; }
.timer-ico::after { content: ""; position: absolute; left: 5px; top: 1px; width: 2px; height: 6px; background: #ccc; }
.rec-dot { background: #181818; border: 1px solid #2a2a2a; margin-left: 12px; }
.info-btn { background: none; border: 0; display: flex; align-items: center; gap: 10px; font-size: 19px; padding: 0 0 0 16px; }
.info-btn span { background: #444; color: #ddd; font-size: 11px; width: 22px; height: 24px; line-height: 24px; text-align: center; }
.usb-ico { width: 12px; height: 18px; background: #fff; border-radius: 2px; position: relative; display: inline-block; }
.usb-ico::before { content: ""; position: absolute; left: 3px; top: 2px; width: 6px; height: 4px; background: #000; }
/* UPLOAD: an arrow up into a tray */
.up-ico { width: 16px; height: 18px; position: relative; display: inline-block; border: 2px solid #fff; border-top: 0; box-sizing: border-box; border-radius: 0 0 2px 2px; }
.up-ico::before { content: ""; position: absolute; left: 4px; top: -4px; width: 0; height: 0; border: 4px solid transparent; border-bottom: 5px solid #fff; border-top: 0; }
.up-ico::after { content: ""; position: absolute; left: 6px; top: 1px; width: 2px; height: 9px; background: #fff; }

.col-head {
  position: absolute; top: 50px; height: 50px; line-height: 52px; padding-left: 9px; font-size: 16px; color: #bbb;
  background: #2e2e2e; letter-spacing: .3px;
}

/* SOURCE */
.v-source .col-head.l { left: 0; width: 735px; padding-left: 18px; }
.v-source .col-head.r { left: 736px; width: 544px; padding-left: 18px; background: #303030; }
.devices { position: absolute; left: 0; top: 100px; width: 735px; margin: 0; padding: 0; list-style: none; }
.devices li {
  height: 92px; background: #222; border-bottom: 2px solid #111; display: flex; align-items: center;
  font: 500 27px var(--cond);
}
.devices li .dev-ico {
  width: 90px; height: 90px; background: #13306a; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; font: 19px var(--sans);
}
.devices li .dev-name { padding-left: 18px; flex: 1; }
.devices li .dev-sub { padding-right: 28px; font: 15px var(--sans); color: #9ab; }
.devices li.sel { background: var(--blue); }
.devices li.sel .dev-sub { color: #fff; }
.devices li.sel::after { content: "\203A"; font: 56px var(--sans); padding-right: 32px; margin-top: -8px; }
.devices li.empty { background: #222; }
.device-info { position: absolute; left: 736px; top: 101px; width: 544px; height: 601px; margin: 0; background: #222; padding: 0 20px; }
.device-info div { display: flex; justify-content: space-between; align-items: baseline; height: 51px; padding-top: 14px; border-bottom: 1px solid #444; }
.device-info dt { font-size: 16px; color: #ccc; }
.device-info dd { margin: 0; font-size: 25px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-info dd small { font-size: 18px; color: #999; margin-left: 4px; }
.settings-btn {
  position: absolute; left: 756px; top: 532px; width: 504px; height: 60px; background: #262626; border: 1px solid #444;
  color: #555; font-size: 23px; letter-spacing: 1.5px;
}

/* BROWSE */
.cats { position: absolute; left: 0; top: 50px; width: 101px; height: 650px; background: #000; }
.cats button {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 101px; height: 70px;
  margin-bottom: 2px; padding: 0 0 6px; border: 0; background: #262626; color: #fff; font-size: 14px; letter-spacing: .5px;
}
.cats button.sel { background: #474747; }
.cats button svg { width: 34px; height: 34px; margin-bottom: 4px; fill: none; stroke: #fff; stroke-width: 2; }
.v-browse .col-head.l { left: 108px; width: 626px; }
.v-browse .col-head.r { left: 735px; width: 545px; background: #353535; }
.list { position: absolute; top: 100px; height: 600px; margin: 0; padding: 0; list-style: none; overflow: hidden; }
.list.l { touch-action: none; } /* swiped to scroll (screen.js) */
.list.l li * { pointer-events: none; } /* touches land on the <li>, which stays put while the list scrolls */
.list.l { left: 108px; width: 626px; }
.list.r { left: 735px; width: 545px; border-left: 1px solid #555; }
.list li {
  height: 50px; line-height: 52px; padding: 0 12px 0 48px; font: 500 26px var(--cond); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; position: relative;
}
.list.l li:nth-child(odd) { background: #282828; }
.list.r li:nth-child(odd) { background: #474747; }
.list li.sel { background: var(--blue) !important; }
.list li.loaded { color: var(--green); }
.list li.loaded::before { /* the loaded-track arrow, drawn: the glyph can come out as an emoji on iOS */
  content: ""; position: absolute; left: 20px; top: 18px; border: solid transparent; border-width: 8px 0 8px 12px; border-left-color: currentColor;
}
.list li.tagged::after { content: ""; position: absolute; right: 12px; top: 20px; width: 10px; height: 10px; background: #f0c000; border-radius: 50%; }
.list li .ico { position: absolute; left: 10px; top: 13px; width: 26px; height: 26px; }
.list li .meta { float: right; font: 16px var(--sans); color: #aaa; margin-left: 12px; }
.list li.sel .meta { color: #fff; }
.list.r li.kv { padding-left: 16px; font: 18px var(--sans); display: flex; justify-content: space-between; color: #ccc; }
.list.r li.kv b { font: 500 24px var(--cond); color: #fff; }
.list li.action { color: #8cf; }
.search { position: absolute; left: 108px; top: 50px; width: 626px; height: 50px; background: #2e2e2e; }
.search input {
  width: 100%; height: 50px; border: 0; background: #0b0b0b; color: #fff; font: 500 26px var(--cond); padding: 0 16px;
  outline: 2px solid var(--blue); outline-offset: -2px;
}

/* mini decks along the bottom of SOURCE / BROWSE */
.mini { position: absolute; left: 0; top: 700px; width: 1280px; height: 100px; }
.mini-deck { position: absolute; top: 10px; width: 620px; height: 82px; border-top: 2px solid #1b3b80; }
.mini-deck[data-deck="0"] { left: 10px; }
.mini-deck.active { border-top-color: var(--blue); }
.mini-deck[data-deck="1"] { left: 650px; }
.mini-deck .lbl {
  position: absolute; left: 1px; top: 2px; width: 95px; height: 28px; background: #1e1e1e; text-align: center; line-height: 29px;
  font-size: 13px; letter-spacing: .5px;
}
.mini-deck .lbl.waves::before { content: "(("; color: var(--orange); margin-right: 3px; letter-spacing: -2px; }
.mini-deck .lbl.waves::after { content: "))"; color: var(--orange); margin-left: 3px; letter-spacing: -2px; }
.mini-deck .rem { position: absolute; left: 12px; top: 33px; font-size: 12px; }
.mini-deck .t { position: absolute; left: 10px; top: 44px; font-size: 28px; letter-spacing: .5px; }
.mini-deck canvas { position: absolute; left: 97px; top: 12px; }
.mini-deck .nl { position: absolute; left: 230px; top: 26px; font: 500 26px var(--cond); color: var(--red); }
.bpmbox { position: absolute; border: 1px solid #ddd; }
.bpmbox .k { position: absolute; left: 4px; top: 3px; font-size: 11px; }
.bpmbox .m { position: absolute; right: 0; top: 0; background: var(--orange); color: #000; font-size: 12px; padding: 1px 4px; }
.bpmbox .v { position: absolute; right: 6px; bottom: 0; color: var(--orange); font-size: 36px; letter-spacing: .5px; }
.bpmbox .v small { font-size: 21px; }
.bpmbox.slave .v { color: #fff; }
.mini-deck .bpmbox { left: 510px; top: 13px; width: 98px; height: 58px; }

/* PLAYING */
.v-playing .top-left {
  position: absolute; left: 8px; top: 8px; width: 632px; height: 34px; background: #1c1c1c; display: flex; align-items: center;
  gap: 8px; padding-left: 12px; font-size: 13px;
}
.v-playing .rec-time { margin-left: 12px; font-size: 14px; }
.v-playing .top-left i { flex: 1; height: 3px; background: #333; margin: 0 10px 0 6px; }
.v-playing .top-right { top: 0; height: 50px; }

.deck-info { position: absolute; left: 10px; width: 170px; border: 1px solid #555; background: #1b1b1b; }
.deck-info[data-deck="0"] { top: 57px; height: 207px; }
.deck-info[data-deck="1"] { top: 279px; height: 202px; border-color: #1b1b1b; border-top: 2px solid #1b3b80; }
.deck-info.active { border: 1px solid #ccc; }
.deck-info > div { height: 44px; border-bottom: 1px solid #000; display: flex; align-items: center; padding-left: 10px; gap: 8px; }
.deck-info .dh { height: 30px; background: #242424; font-size: 14px; color: #ccc; }
.deck-info .src { font-size: 22px; }
.deck-info .key { font-size: 18px; }
.deck-info .key i { font: italic 12px serif; border: 1px solid #ccc; padding: 0 3px; }
.deck-info .bars { font-size: 14px; color: #fff; }
.deck-info .bars b { color: var(--orange); font-weight: normal; letter-spacing: 1px; margin-right: 6px; }

canvas.zoom { position: absolute; left: 190px; background: #000; }
canvas.zoom[data-deck="0"] { top: 55px; }
canvas.zoom[data-deck="1"] { top: 280px; }
.playhead { position: absolute; left: 410px; top: 47px; width: 2px; height: 444px; background: #fff; pointer-events: none; }

.fx-panel { position: absolute; left: 1090px; top: 57px; width: 180px; height: 305px; background: #1e1e1e; }
.fx-panel .t { height: 30px; line-height: 31px; text-align: center; background: #2c2c2c; color: #ccc; font-size: 14px; letter-spacing: .5px; }
.fx-panel .name {
  margin: 10px 10px 0; height: 41px; background: #000; text-align: center; line-height: 42px; font-size: 22px;
  letter-spacing: .5px;
}
.fx-panel.on .name { color: #000; background: #ddd; }
.fx-panel .chl { text-align: center; color: #aaa; font-size: 12px; margin: 13px 0 4px; letter-spacing: .5px; }
.fx-panel .ch { margin: 0 10px; height: 35px; background: var(--blue); text-align: center; line-height: 36px; font-size: 22px; }
.fx-panel .vals { margin: 13px 10px 0; height: 137px; background: #000; position: relative; }
.fx-panel .vals div { position: absolute; right: 26px; font-size: 25px; }
.fx-panel .vals small { font-size: 11px; color: #ccc; margin-left: 2px; position: absolute; left: 100%; bottom: 3px; white-space: nowrap; }
.fx-panel .vals .q { left: 0; right: 0; bottom: 0; height: 28px; line-height: 28px; text-align: center; font-size: 12px; color: #ccc;
  border-top: 1px solid #333; }
.fx-panel .vals .big { font-size: 46px; right: 40px; }
.fx-panel .vals .big small { font-size: 20px; bottom: 7px; }
.fx-panel.status .vals div { font-size: 18px; }

.zoom-grid { position: absolute; left: 1120px; top: 383px; display: flex; gap: 6px; align-items: center; }
.zoom-grid button { background: none; border: 0; color: #aaa; font-size: 15px; padding: 4px 8px; }
.zoom-grid button.on { border: 2px solid var(--blue); color: var(--blue); }
.tabs { position: absolute; left: 1090px; top: 432px; width: 180px; height: 50px; border: 2px solid #555; display: flex; }
.tabs button { flex: 1; border: 0; background: #1c1c1c; color: #aaa; font-size: 18px; padding: 0; }
.tabs button.on { background: #6c6c6c; color: #ddd; }

.band {
  position: absolute; left: 10px; top: 492px; width: 1260px; height: 83px;
  background: repeating-conic-gradient(#202020 0 25%, #1a1a1a 0 50%) 0 0 / 8px 8px;
}
.bank-label, .xpad-label { position: absolute; top: 6px; font-size: 12px; color: #bbb; letter-spacing: .5px; }
.bank-label { left: 266px; }
.xpad-label { left: 965px; }
.bank { position: absolute; left: 10px; top: 23px; display: flex; gap: 10px; }
.bank button { width: 130px; height: 40px; background: #000; border: 0; font-size: 15px; color: #ccc; }
.bank button.trash { width: 44px; background: none; color: #666; font-size: 13px; }
.bank button.armed { outline: 2px solid var(--orange); }
.xpad { position: absolute; left: 648px; top: 20px; width: 610px; height: 46px; display: flex; border: 1px solid #555; }
.xpad button { flex: 1; border: 0; border-right: 1px solid #555; background: #0c0c0c; font-size: 20px; padding: 0; }
.xpad button:last-child { border-right: 0; }
.xpad button.sel { background: #5a5a5a; }
.xpad.touch { background: linear-gradient(90deg, #102a50, #0c0c0c 45%, #0c0c0c 55%, #4a1a10); touch-action: none; cursor: ew-resize; }
.xpad.touch span { position: absolute; top: 11px; font-size: 16px; color: #aaa; pointer-events: none; }
.xpad.touch .lo { left: 14px; }
.xpad.touch .hi { right: 14px; }
.xpad.touch .mid { left: 50%; margin-left: -30px; width: 60px; text-align: center; color: #666; }
.xpad.touch i { position: absolute; top: 0; width: 4px; height: 44px; background: #fff; margin-left: -2px; pointer-events: none; }

.deck-panel { position: absolute; top: 580px; width: 620px; height: 210px; border: 1px solid #333; }
.deck-panel[data-deck="0"] { left: 10px; }
.deck-panel[data-deck="1"] { left: 650px; border-color: #000; border-top: 2px solid #1b3b80; }
.deck-panel.active { border: 1px solid #8ab; }
.deck-panel .dk {
  position: absolute; left: 0; top: 0; width: 95px; height: 52px; background: #1e1e1e; text-align: center; font-size: 13px;
  line-height: 15px; padding-top: 6px;
}
.deck-panel .dk b { display: block; font-size: 25px; font-weight: normal; line-height: 26px; }
.deck-panel .title {
  position: absolute; left: 95px; top: 0; right: 0; height: 52px; background: #2a2a2a; padding-left: 16px;
  line-height: 54px; font: 500 28px var(--cond); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.deck-panel .title::before { content: "\266A"; font-size: 24px; margin-right: 8px; }
.deck-panel .title.none::before { content: none; }
.deck-panel .trk { position: absolute; left: 0; top: 64px; width: 95px; text-align: center; font-size: 13px; }
.deck-panel .trk b { display: block; font-size: 26px; font-weight: normal; margin: 4px 0 8px; }
.deck-panel .trk .q { color: var(--orange); margin-top: 10px; cursor: pointer; }
.deck-panel .trk .q.off { color: #555; }
.deck-panel .trk .qv { font-size: 26px; color: var(--orange); border-bottom: 2px solid var(--orange); width: 40px; margin: 0 auto; }
.deck-panel .trk .q.off + .qv { color: #555; border-color: transparent; }
.deck-panel .hc { position: absolute; left: 96px; width: 80px; height: 21px; font-size: 12px; text-align: center; line-height: 21px; }
.deck-panel .hc.a { top: 68px; border: 1px solid var(--orange); color: var(--orange); }
.deck-panel .hc.b { top: 102px; border: 1px solid #ccc; }
.deck-panel .tl { position: absolute; left: 196px; top: 72px; font-size: 12px; }
.deck-panel .tl .dim { color: #666; }
.deck-panel .time { position: absolute; left: 190px; top: 82px; font-size: 50px; letter-spacing: 0; white-space: nowrap; }
.deck-panel .time small { font-size: 24px; }
.deck-panel .tempo-l { position: absolute; left: 386px; top: 72px; font-size: 12px; }
.deck-panel .mt { position: absolute; left: 386px; top: 87px; font-size: 12px; font-weight: bold; color: #e8301e; }
.deck-panel .mt.off { display: none; }
.deck-panel .range { position: absolute; left: 450px; top: 64px; width: 50px; height: 21px; background: var(--orange); color: #fff;
  text-align: center; font-size: 14px; line-height: 21px; }
.deck-panel .range.wide { background: #3a3a3a; }
.deck-panel .tempo { position: absolute; left: 380px; top: 100px; width: 120px; text-align: right; font-size: 30px; }
.deck-panel .tempo small { font-size: 18px; }
.deck-panel .bpmbox { left: 510px; top: 64px; width: 99px; height: 61px; }
.deck-panel canvas { position: absolute; left: 96px; top: 135px; }
.deck-panel .nl { position: absolute; left: 285px; top: 140px; font: 500 28px var(--cond); color: var(--red); }
.deck-panel .busy { position: absolute; left: 285px; top: 140px; font: 500 24px var(--cond); color: #aaa; }

.drop {
  position: absolute; inset: 40px; border: 4px dashed var(--blue); display: flex; align-items: center; justify-content: center;
  font: 500 40px var(--cond); background: rgba(0, 0, 0, .8); z-index: 10;
}
.toast {
  position: absolute; left: 50%; top: 340px; transform: translateX(-50%); background: rgba(30, 30, 30, .95); border: 1px solid #666;
  padding: 18px 32px; font: 500 26px var(--cond); z-index: 11; white-space: nowrap;
}
.menu {
  position: absolute; left: 340px; top: 120px; width: 600px; background: #1c1c1c; border: 1px solid #666; z-index: 12;
  padding-bottom: 12px;
}
.menu h2 { margin: 0 0 8px; height: 50px; line-height: 52px; padding-left: 18px; background: #2e2e2e; font: 500 26px var(--cond); }
.menu .row { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 18px; font-size: 18px; }
.menu .row div { display: flex; gap: 6px; }
.menu .row button { min-width: 64px; height: 38px; background: #000; border: 1px solid #555; font-size: 16px; }
.menu .row button.sel { background: var(--blue); border-color: var(--blue); }
/* the ? keyboard overlay */
.menu.help { left: 240px; top: 40px; width: 800px; max-height: 720px; overflow-y: auto; }
.menu.help .row.keys { display: grid; grid-template-columns: 1fr 170px 170px; gap: 12px; height: 36px; font-size: 16px; }
.menu.help kbd.wide { grid-column: 2 / 4; }
.menu.help .row.keys.head { color: #888; font-size: 13px; height: 24px; }
.menu.help kbd { font: 15px Menlo, monospace; color: #fff; background: #000; border: 1px solid #555; border-radius: 6px;
  padding: 4px 8px; text-align: center; white-space: nowrap; }
/* Tab to a control, then the arrows turn it */
.bar button:focus-visible, .bar input:focus-visible, .bar .rxs-btn:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px; }
.menu .close { position: absolute; right: 12px; top: 8px; background: none; border: 0; font-size: 26px; color: #aaa; }

/* ---------- the mixer view (`) ---------- */

.bar button, .bar .rxs-btn {
  background: linear-gradient(#f4f4f4, #dcdcdc); color: #111; border: 1px solid #888; border-radius: 4px; height: 24px;
  font-size: 12px; padding: 0 6px;
}
.bar button:active { background: linear-gradient(#cfcfcf, #e8e8e8); }
.bar { display: flex; }
#app.mixer-view .mixer { display: grid; }
#app.mixer-view .vkb, #app.compact .vkb { display: none; }
#app.compact { grid-template: "screen" 1fr "status" auto / 1fr; }

/* ---------- the on-screen keyboard ---------- */

.vkb {
  grid-area: kb; display: flex; flex-direction: column; gap: 5px; align-items: stretch;
  width: 100%; max-width: 1060px; margin: 0 auto; padding: 10px 16px 6px; box-sizing: border-box;
  --d1: #3d9bff; --d2: #c070ff; --g: #8a8a8a;
}
.vkb-row { display: flex; gap: 5px; }
.vk {
  position: relative; flex: 1 1 0; min-width: 0; height: 40px; box-sizing: border-box; padding: 4px 6px 0;
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  background: #1b1b1b; border: 1px solid #2c2c2c; border-radius: 7px; cursor: pointer;
  box-shadow: inset 0 3px 0 -1px var(--tone, transparent), 0 1px 0 #000;
  transition: background .08s, transform .08s;
}
.vk b { font: 600 12px/1 var(--sans); color: #d8d8d8; }
.vk small {
  font: 600 9.5px/1.1 var(--cond); letter-spacing: .3px; color: #9a9a9a; padding-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vk i { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--tone, #888); opacity: .9; }
.vk.d1 { --tone: var(--d1); }
.vk.d2 { --tone: var(--d2); }
.vk.g { --tone: var(--g); }
.vk.off, .vk.mod { cursor: default; background: #121212; border-color: #1e1e1e; }
.vk.off b, .vk.mod b { color: #444; font-weight: 400; }
.vk.mod { cursor: pointer; }
.vk.lit { background: color-mix(in srgb, var(--lit) 22%, #1b1b1b); border-color: var(--lit); }
.vk.lit small { color: #fff; }
.vk:hover:not(.off) { background: #242424; }
.vk.lit:hover { background: color-mix(in srgb, var(--lit) 30%, #1b1b1b); }
.vk.down { transform: translateY(1px); background: #333; border-color: #666; }
.vk.mod.down { background: #333; }
.vk.mod.down b { color: #ddd; }
.vkb-legend { display: flex; gap: 16px; align-items: center; font: 600 10px var(--cond); letter-spacing: .5px; color: #777; padding: 2px 2px 0; }
.vkb-legend span::before { content: ""; display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.vkb-legend .d1::before { background: var(--d1); }
.vkb-legend .d2::before { background: var(--d2); }
.vkb-legend .g::before { background: var(--g); }
.vkb-legend .hint { margin-left: auto; color: #555; }
.vkb-legend .hint::before { display: none; }

/* ---------- the screen ---------- */

#screen-wrap { grid-area: screen; position: relative; overflow: hidden; background: #000; min-height: 200px; }
#screen {
  position: absolute; left: 0; top: 0; width: 1280px; height: 800px; transform-origin: 0 0;
  background: #000; overflow: hidden; font-family: var(--sans);
}
/* a thin frame round the screen, as the unit's bezel; drawn over it so the 1280x800 layout doesn't move */
#screen::after {
  content: ""; position: absolute; inset: 0; z-index: 20; pointer-events: none;
  border: calc(2px / var(--s, 1)) solid #000;
}
#screen section, #screen .scr-head, #screen .mini { display: none; }
#screen.view-source .v-source, #screen.view-browse .v-browse, #screen.view-playing .v-playing { display: block; }
#screen.view-source .scr-head, #screen.view-browse .scr-head,
#screen.view-source .mini, #screen.view-browse .mini { display: block; }

.scr-head { position: absolute; left: 0; top: 0; width: 1280px; height: 50px; background: #1a1a1a; }
.head-src {
  position: absolute; left: 0; top: 0; width: 100px; height: 50px; background: #0b0b0b; border-top: 3px solid #1b3b80;
  display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 19px;
}
.view-source .head-src { display: none; }
.head-title { position: absolute; left: 116px; top: 0; line-height: 52px; font: 500 27px var(--cond); white-space: nowrap; }
.view-source .head-title { left: 18px; font-family: var(--sans); font-size: 24px; text-shadow: 0 0 1px #000; }
.head-right, .top-right { position: absolute; right: 14px; top: 0; height: 50px; display: flex; align-items: center; gap: 8px; }
.head-clock { font-size: 14px; letter-spacing: .5px; }
.dim { color: #555; }
.timer-ico, .rec-dot { width: 15px; height: 15px; border-radius: 50%; display: inline-block; }
.timer-ico { border: 2px solid #ccc; position: relative; }
.timer-ico::after { content: ""; position: absolute; left: 5px; top: 1px; width: 2px; height: 6px; background: #ccc; }
.rec-dot { background: #181818; border: 1px solid #2a2a2a; margin-left: 12px; }
.info-btn { background: none; border: 0; display: flex; align-items: center; gap: 10px; font-size: 19px; padding: 0 0 0 16px; }
.info-btn span { background: #444; color: #ddd; font-size: 11px; width: 22px; height: 24px; line-height: 24px; text-align: center; }
.usb-ico { width: 12px; height: 18px; background: #fff; border-radius: 2px; position: relative; display: inline-block; }
.usb-ico::before { content: ""; position: absolute; left: 3px; top: 2px; width: 6px; height: 4px; background: #000; }
/* UPLOAD: an arrow up into a tray */
.up-ico { width: 16px; height: 18px; position: relative; display: inline-block; border: 2px solid #fff; border-top: 0; box-sizing: border-box; border-radius: 0 0 2px 2px; }
.up-ico::before { content: ""; position: absolute; left: 4px; top: -4px; width: 0; height: 0; border: 4px solid transparent; border-bottom: 5px solid #fff; border-top: 0; }
.up-ico::after { content: ""; position: absolute; left: 6px; top: 1px; width: 2px; height: 9px; background: #fff; }

.col-head {
  position: absolute; top: 50px; height: 50px; line-height: 52px; padding-left: 9px; font-size: 16px; color: #bbb;
  background: #2e2e2e; letter-spacing: .3px;
}

/* SOURCE */
.v-source .col-head.l { left: 0; width: 735px; padding-left: 18px; }
.v-source .col-head.r { left: 736px; width: 544px; padding-left: 18px; background: #303030; }
.devices { position: absolute; left: 0; top: 100px; width: 735px; margin: 0; padding: 0; list-style: none; }
.devices li {
  height: 92px; background: #222; border-bottom: 2px solid #111; display: flex; align-items: center;
  font: 500 27px var(--cond);
}
.devices li .dev-ico {
  width: 90px; height: 90px; background: #13306a; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; font: 19px var(--sans);
}
.devices li .dev-name { padding-left: 18px; flex: 1; }
.devices li .dev-sub { padding-right: 28px; font: 15px var(--sans); color: #9ab; }
.devices li.sel { background: var(--blue); }
.devices li.sel .dev-sub { color: #fff; }
.devices li.sel::after { content: "\203A"; font: 56px var(--sans); padding-right: 32px; margin-top: -8px; }
.devices li.empty { background: #222; }
.device-info { position: absolute; left: 736px; top: 101px; width: 544px; height: 601px; margin: 0; background: #222; padding: 0 20px; }
.device-info div { display: flex; justify-content: space-between; align-items: baseline; height: 51px; padding-top: 14px; border-bottom: 1px solid #444; }
.device-info dt { font-size: 16px; color: #ccc; }
.device-info dd { margin: 0; font-size: 25px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-info dd small { font-size: 18px; color: #999; margin-left: 4px; }
.settings-btn {
  position: absolute; left: 756px; top: 532px; width: 504px; height: 60px; background: #262626; border: 1px solid #444;
  color: #555; font-size: 23px; letter-spacing: 1.5px;
}

/* BROWSE */
.cats { position: absolute; left: 0; top: 50px; width: 101px; height: 650px; background: #000; }
.cats button {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 101px; height: 70px;
  margin-bottom: 2px; padding: 0 0 6px; border: 0; background: #262626; color: #fff; font-size: 14px; letter-spacing: .5px;
}
.cats button.sel { background: #474747; }
.cats button svg { width: 34px; height: 34px; margin-bottom: 4px; fill: none; stroke: #fff; stroke-width: 2; }
.v-browse .col-head.l { left: 108px; width: 626px; }
.v-browse .col-head.r { left: 735px; width: 545px; background: #353535; }
.list { position: absolute; top: 100px; height: 600px; margin: 0; padding: 0; list-style: none; overflow: hidden; }
.list.l { touch-action: none; } /* swiped to scroll (screen.js) */
.list.l li * { pointer-events: none; } /* touches land on the <li>, which stays put while the list scrolls */
.list.l { left: 108px; width: 626px; }
.list.r { left: 735px; width: 545px; border-left: 1px solid #555; }
.list li {
  height: 50px; line-height: 52px; padding: 0 12px 0 48px; font: 500 26px var(--cond); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; position: relative;
}
.list.l li:nth-child(odd) { background: #282828; }
.list.r li:nth-child(odd) { background: #474747; }
.list li.sel { background: var(--blue) !important; }
.list li.loaded { color: var(--green); }
.list li.loaded::before { /* the loaded-track arrow, drawn: the glyph can come out as an emoji on iOS */
  content: ""; position: absolute; left: 20px; top: 18px; border: solid transparent; border-width: 8px 0 8px 12px; border-left-color: currentColor;
}
.list li.tagged::after { content: ""; position: absolute; right: 12px; top: 20px; width: 10px; height: 10px; background: #f0c000; border-radius: 50%; }
.list li .ico { position: absolute; left: 10px; top: 13px; width: 26px; height: 26px; }
.list li .meta { float: right; font: 16px var(--sans); color: #aaa; margin-left: 12px; }
.list li.sel .meta { color: #fff; }
.list.r li.kv { padding-left: 16px; font: 18px var(--sans); display: flex; justify-content: space-between; color: #ccc; }
.list.r li.kv b { font: 500 24px var(--cond); color: #fff; }
.list li.action { color: #8cf; }
.search { position: absolute; left: 108px; top: 50px; width: 626px; height: 50px; background: #2e2e2e; }
.search input {
  width: 100%; height: 50px; border: 0; background: #0b0b0b; color: #fff; font: 500 26px var(--cond); padding: 0 16px;
  outline: 2px solid var(--blue); outline-offset: -2px;
}

/* mini decks along the bottom of SOURCE / BROWSE */
.mini { position: absolute; left: 0; top: 700px; width: 1280px; height: 100px; }
.mini-deck { position: absolute; top: 10px; width: 620px; height: 82px; border-top: 2px solid #1b3b80; }
.mini-deck[data-deck="0"] { left: 10px; }
.mini-deck.active { border-top-color: var(--blue); }
.mini-deck[data-deck="1"] { left: 650px; }
.mini-deck .lbl {
  position: absolute; left: 1px; top: 2px; width: 95px; height: 28px; background: #1e1e1e; text-align: center; line-height: 29px;
  font-size: 13px; letter-spacing: .5px;
}
.mini-deck .lbl.waves::before { content: "(("; color: var(--orange); margin-right: 3px; letter-spacing: -2px; }
.mini-deck .lbl.waves::after { content: "))"; color: var(--orange); margin-left: 3px; letter-spacing: -2px; }
.mini-deck .rem { position: absolute; left: 12px; top: 33px; font-size: 12px; }
.mini-deck .t { position: absolute; left: 10px; top: 44px; font-size: 28px; letter-spacing: .5px; }
.mini-deck canvas { position: absolute; left: 97px; top: 12px; }
.mini-deck .nl { position: absolute; left: 230px; top: 26px; font: 500 26px var(--cond); color: var(--red); }
.bpmbox { position: absolute; border: 1px solid #ddd; }
.bpmbox .k { position: absolute; left: 4px; top: 3px; font-size: 11px; }
.bpmbox .m { position: absolute; right: 0; top: 0; background: var(--orange); color: #000; font-size: 12px; padding: 1px 4px; }
.bpmbox .v { position: absolute; right: 6px; bottom: 0; color: var(--orange); font-size: 36px; letter-spacing: .5px; }
.bpmbox .v small { font-size: 21px; }
.bpmbox.slave .v { color: #fff; }
.mini-deck .bpmbox { left: 510px; top: 13px; width: 98px; height: 58px; }

/* PLAYING */
.v-playing .top-left {
  position: absolute; left: 8px; top: 8px; width: 632px; height: 34px; background: #1c1c1c; display: flex; align-items: center;
  gap: 8px; padding-left: 12px; font-size: 13px;
}
.v-playing .rec-time { margin-left: 12px; font-size: 14px; }
.v-playing .top-left i { flex: 1; height: 3px; background: #333; margin: 0 10px 0 6px; }
.v-playing .top-right { top: 0; height: 50px; }

.deck-info { position: absolute; left: 10px; width: 170px; border: 1px solid #555; background: #1b1b1b; }
.deck-info[data-deck="0"] { top: 57px; height: 207px; }
.deck-info[data-deck="1"] { top: 279px; height: 202px; border-color: #1b1b1b; border-top: 2px solid #1b3b80; }
.deck-info.active { border: 1px solid #ccc; }
.deck-info > div { height: 44px; border-bottom: 1px solid #000; display: flex; align-items: center; padding-left: 10px; gap: 8px; }
.deck-info .dh { height: 30px; background: #242424; font-size: 14px; color: #ccc; }
.deck-info .src { font-size: 22px; }
.deck-info .key { font-size: 18px; }
.deck-info .key i { font: italic 12px serif; border: 1px solid #ccc; padding: 0 3px; }
.deck-info .bars { font-size: 14px; color: #fff; }
.deck-info .bars b { color: var(--orange); font-weight: normal; letter-spacing: 1px; margin-right: 6px; }

canvas.zoom { position: absolute; left: 190px; background: #000; }
canvas.zoom[data-deck="0"] { top: 55px; }
canvas.zoom[data-deck="1"] { top: 280px; }
.playhead { position: absolute; left: 410px; top: 47px; width: 2px; height: 444px; background: #fff; pointer-events: none; }

.fx-panel { position: absolute; left: 1090px; top: 57px; width: 180px; height: 305px; background: #1e1e1e; }
.fx-panel .t { height: 30px; line-height: 31px; text-align: center; background: #2c2c2c; color: #ccc; font-size: 14px; letter-spacing: .5px; }
.fx-panel .name {
  margin: 10px 10px 0; height: 41px; background: #000; text-align: center; line-height: 42px; font-size: 22px;
  letter-spacing: .5px;
}
.fx-panel.on .name { color: #000; background: #ddd; }
.fx-panel .chl { text-align: center; color: #aaa; font-size: 12px; margin: 13px 0 4px; letter-spacing: .5px; }
.fx-panel .ch { margin: 0 10px; height: 35px; background: var(--blue); text-align: center; line-height: 36px; font-size: 22px; }
.fx-panel .vals { margin: 13px 10px 0; height: 137px; background: #000; position: relative; }
.fx-panel .vals div { position: absolute; right: 26px; font-size: 25px; }
.fx-panel .vals small { font-size: 11px; color: #ccc; margin-left: 2px; position: absolute; left: 100%; bottom: 3px; white-space: nowrap; }
.fx-panel .vals .q { left: 0; right: 0; bottom: 0; height: 28px; line-height: 28px; text-align: center; font-size: 12px; color: #ccc;
  border-top: 1px solid #333; }
.fx-panel .vals .big { font-size: 46px; right: 40px; }
.fx-panel .vals .big small { font-size: 20px; bottom: 7px; }
.fx-panel.status .vals div { font-size: 18px; }

.zoom-grid { position: absolute; left: 1120px; top: 383px; display: flex; gap: 6px; align-items: center; }
.zoom-grid button { background: none; border: 0; color: #aaa; font-size: 15px; padding: 4px 8px; }
.zoom-grid button.on { border: 2px solid var(--blue); color: var(--blue); }
.tabs { position: absolute; left: 1090px; top: 432px; width: 180px; height: 50px; border: 2px solid #555; display: flex; }
.tabs button { flex: 1; border: 0; background: #1c1c1c; color: #aaa; font-size: 18px; padding: 0; }
.tabs button.on { background: #6c6c6c; color: #ddd; }

.band {
  position: absolute; left: 10px; top: 492px; width: 1260px; height: 83px;
  background: repeating-conic-gradient(#202020 0 25%, #1a1a1a 0 50%) 0 0 / 8px 8px;
}
.bank-label, .xpad-label { position: absolute; top: 6px; font-size: 12px; color: #bbb; letter-spacing: .5px; }
.bank-label { left: 266px; }
.xpad-label { left: 965px; }
.bank { position: absolute; left: 10px; top: 23px; display: flex; gap: 10px; }
.bank button { width: 130px; height: 40px; background: #000; border: 0; font-size: 15px; color: #ccc; }
.bank button.trash { width: 44px; background: none; color: #666; font-size: 13px; }
.bank button.armed { outline: 2px solid var(--orange); }
.xpad { position: absolute; left: 648px; top: 20px; width: 610px; height: 46px; display: flex; border: 1px solid #555; }
.xpad button { flex: 1; border: 0; border-right: 1px solid #555; background: #0c0c0c; font-size: 20px; padding: 0; }
.xpad button:last-child { border-right: 0; }
.xpad button.sel { background: #5a5a5a; }
.xpad.touch { background: linear-gradient(90deg, #102a50, #0c0c0c 45%, #0c0c0c 55%, #4a1a10); touch-action: none; cursor: ew-resize; }
.xpad.touch span { position: absolute; top: 11px; font-size: 16px; color: #aaa; pointer-events: none; }
.xpad.touch .lo { left: 14px; }
.xpad.touch .hi { right: 14px; }
.xpad.touch .mid { left: 50%; margin-left: -30px; width: 60px; text-align: center; color: #666; }
.xpad.touch i { position: absolute; top: 0; width: 4px; height: 44px; background: #fff; margin-left: -2px; pointer-events: none; }

.deck-panel { position: absolute; top: 580px; width: 620px; height: 210px; border: 1px solid #333; }
.deck-panel[data-deck="0"] { left: 10px; }
.deck-panel[data-deck="1"] { left: 650px; border-color: #000; border-top: 2px solid #1b3b80; }
.deck-panel.active { border: 1px solid #8ab; }
.deck-panel .dk {
  position: absolute; left: 0; top: 0; width: 95px; height: 52px; background: #1e1e1e; text-align: center; font-size: 13px;
  line-height: 15px; padding-top: 6px;
}
.deck-panel .dk b { display: block; font-size: 25px; font-weight: normal; line-height: 26px; }
.deck-panel .title {
  position: absolute; left: 95px; top: 0; right: 0; height: 52px; background: #2a2a2a; padding-left: 16px;
  line-height: 54px; font: 500 28px var(--cond); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.deck-panel .title::before { content: "\266A"; font-size: 24px; margin-right: 8px; }
.deck-panel .title.none::before { content: none; }
.deck-panel .trk { position: absolute; left: 0; top: 64px; width: 95px; text-align: center; font-size: 13px; }
.deck-panel .trk b { display: block; font-size: 26px; font-weight: normal; margin: 4px 0 8px; }
.deck-panel .trk .q { color: var(--orange); margin-top: 10px; cursor: pointer; }
.deck-panel .trk .q.off { color: #555; }
.deck-panel .trk .qv { font-size: 26px; color: var(--orange); border-bottom: 2px solid var(--orange); width: 40px; margin: 0 auto; }
.deck-panel .trk .q.off + .qv { color: #555; border-color: transparent; }
.deck-panel .hc { position: absolute; left: 96px; width: 80px; height: 21px; font-size: 12px; text-align: center; line-height: 21px; }
.deck-panel .hc.a { top: 68px; border: 1px solid var(--orange); color: var(--orange); }
.deck-panel .hc.b { top: 102px; border: 1px solid #ccc; }
.deck-panel .tl { position: absolute; left: 196px; top: 72px; font-size: 12px; }
.deck-panel .tl .dim { color: #666; }
.deck-panel .time { position: absolute; left: 190px; top: 82px; font-size: 50px; letter-spacing: 0; white-space: nowrap; }
.deck-panel .time small { font-size: 24px; }
.deck-panel .tempo-l { position: absolute; left: 386px; top: 72px; font-size: 12px; }
.deck-panel .mt { position: absolute; left: 386px; top: 87px; font-size: 12px; font-weight: bold; color: #e8301e; }
.deck-panel .mt.off { display: none; }
.deck-panel .range { position: absolute; left: 450px; top: 64px; width: 50px; height: 21px; background: var(--orange); color: #fff;
  text-align: center; font-size: 14px; line-height: 21px; }
.deck-panel .range.wide { background: #3a3a3a; }
.deck-panel .tempo { position: absolute; left: 380px; top: 100px; width: 120px; text-align: right; font-size: 30px; }
.deck-panel .tempo small { font-size: 18px; }
.deck-panel .bpmbox { left: 510px; top: 64px; width: 99px; height: 61px; }
.deck-panel canvas { position: absolute; left: 96px; top: 135px; }
.deck-panel .nl { position: absolute; left: 285px; top: 140px; font: 500 28px var(--cond); color: var(--red); }
.deck-panel .busy { position: absolute; left: 285px; top: 140px; font: 500 24px var(--cond); color: #aaa; }

.drop {
  position: absolute; inset: 40px; border: 4px dashed var(--blue); display: flex; align-items: center; justify-content: center;
  font: 500 40px var(--cond); background: rgba(0, 0, 0, .8); z-index: 10;
}
.toast {
  position: absolute; left: 50%; top: 340px; transform: translateX(-50%); background: rgba(30, 30, 30, .95); border: 1px solid #666;
  padding: 18px 32px; font: 500 26px var(--cond); z-index: 11; white-space: nowrap;
}
.menu {
  position: absolute; left: 340px; top: 120px; width: 600px; background: #1c1c1c; border: 1px solid #666; z-index: 12;
  padding-bottom: 12px;
}
.menu h2 { margin: 0 0 8px; height: 50px; line-height: 52px; padding-left: 18px; background: #2e2e2e; font: 500 26px var(--cond); }
.menu .row { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 18px; font-size: 18px; }
.menu .row div { display: flex; gap: 6px; }
.menu .row button { min-width: 64px; height: 38px; background: #000; border: 1px solid #555; font-size: 16px; }
.menu .row button.sel { background: var(--blue); border-color: var(--blue); }
/* the ? keyboard overlay */
.menu.help { left: 240px; top: 40px; width: 800px; max-height: 720px; overflow-y: auto; }
.menu.help .row.keys { display: grid; grid-template-columns: 1fr 170px 170px; gap: 12px; height: 36px; font-size: 16px; }
.menu.help kbd.wide { grid-column: 2 / 4; }
.menu.help .row.keys.head { color: #888; font-size: 13px; height: 24px; }
.menu.help kbd { font: 15px Menlo, monospace; color: #fff; background: #000; border: 1px solid #555; border-radius: 6px;
  padding: 4px 8px; text-align: center; white-space: nowrap; }
/* Tab to a control, then the arrows turn it */
.bar button:focus-visible, .bar input:focus-visible, .bar .rxs-btn:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px; }
.menu .close { position: absolute; right: 12px; top: 8px; background: none; border: 0; font-size: 26px; color: #aaa; }

/* ---------- the mixer view (`) ---------- */

.panel {
  grid-area: panel; display: flex; flex-direction: column; gap: 2px; padding: 6px; background: #111; width: 132px;
  overflow-y: auto;
}
.panel button, .bar button, .bar .rxs-btn {
  background: linear-gradient(#f4f4f4, #dcdcdc); color: #111; border: 1px solid #888; border-radius: 4px; height: 24px;
  font-size: 12px; padding: 0 6px;
}
.panel button:active, .bar button:active, .panel button.down { background: linear-gradient(#cfcfcf, #e8e8e8); }
.panel .gap { color: #888; font-weight: bold; font-size: 11px; text-align: center; min-height: 10px; margin-top: 6px; }
.panel button[data-key="play"].lit { background: linear-gradient(#8ef08e, #4cc94c); }
.panel button[data-key="cue"].lit { background: linear-gradient(#ffcf7a, #f0a020); }

.bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; padding: 4px 8px; background: #1a1a1a; }
.fxbar { grid-area: fx; }
.mixer {
  grid-area: mixer; background: #151515; border-top: 1px solid #222; display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 4px 18px; align-items: center;
}
.mixer .strip[data-deck="1"] { justify-content: flex-end; }
.mixer .center { justify-content: center; }
.bar > label:not(.knob) { color: #888; font-weight: bold; font-size: 11px; margin-left: 8px; }
.bar rx-select { width: 118px; }
.bar .rxs-btn { padding: 0 6px 0 8px; }
.bar rx-select.open .rxs-btn { background: linear-gradient(#cfcfcf, #e8e8e8); }
.knob { display: flex; flex-direction: column; color: #aaa; font-size: 9px; letter-spacing: .3px; }
.knob input { width: 104px; margin: 0; accent-color: #bbb; }
.knob.wide input { width: 180px; }
.knob.tall { align-items: center; }
.fx-on.lit { background: linear-gradient(#ff9a7a, #e8441e); color: #fff; }
.fx-bands { display: flex; }
.fx-bands button { min-width: 38px; }
.fx-bands button.lit { background: linear-gradient(#9fd0ff, #4a9fe8); }
.strip, .center { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.strip .dname { color: #888; font-weight: bold; font-size: 11px; width: 44px; }
.strip button { height: 22px; font-size: 11px; }
.mixer .knob input { width: 84px; }
.mixer .knob.wide input { width: 180px; }
.strip button.lit { background: linear-gradient(#9fd0ff, #4a9fe8); }
.meter { width: 90px; height: 8px; background: #000; border: 1px solid #333; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2c2 70%, #ec2 85%, #e22); }
.statusbar { grid-area: status; padding: 2px 8px 4px; color: #bbb; font: 11px Menlo, monospace; white-space: nowrap; overflow: hidden; }

@media (max-width: 900px) {
  #app, #app.mixer-view { grid-template: "screen" auto "kb" auto "fx" auto "mixer" auto "status" auto / 1fr; overflow-y: auto; height: auto; }
  html, body { overflow: auto; }
  #screen-wrap { height: 62.5vw; }
  .vkb { padding: 8px 8px 4px; gap: 4px; }
  .vkb-row { gap: 4px; }
  .vk { padding: 3px 4px 0; }
  .vk small { font-size: 8.5px; }
  .vkb-legend .hint { display: none; }
}

/* ---------- <rx-select>: the effect pickers (js/ui/dropdown.js), a list in the screen's own style ---------- */

rx-select { display: inline-flex; vertical-align: middle; }
.rxs-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; }
.rxs-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rxs-btn .tri { flex: none; font-size: 10px; transition: transform .12s; }
rx-select.open .rxs-btn .tri { transform: rotate(180deg); }
.rxs-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.rxs-list {
  position: fixed; z-index: 100; margin: 2px 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain;
  background: #0c0c0c; border: 1px solid #555; box-shadow: 0 6px 18px rgba(0, 0, 0, .6);
  font: 500 15px var(--cond); letter-spacing: .5px; color: #ddd;
}
.rxs-list li { height: 28px; line-height: 28px; padding: 0 28px 0 10px; border-bottom: 1px solid #1e1e1e; white-space: nowrap; cursor: pointer; position: relative; }
.rxs-list li:last-child { border-bottom: 0; }
.rxs-list li.hi { background: #333; color: #fff; }
.rxs-list li.sel { background: var(--blue); color: #fff; } /* as the screen's lists */
.rxs-list li.sel::after { content: ""; position: absolute; right: 10px; top: 50%; width: 4px; height: 8px; margin-top: -6px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.rxs-list.big { font-size: 20px; }
.rxs-list.big li { height: 44px; line-height: 44px; padding-left: 14px; }

/* arrows drawn with borders, not glyphs: iOS can turn the arrow characters into emoji */
.tri { display: inline-block; width: 0; height: 0; border: 0 solid transparent; vertical-align: middle; }
.tri.l { border-width: .4em .6em .4em 0; border-right-color: currentColor; }
.tri.r { border-width: .4em 0 .4em .6em; border-left-color: currentColor; }
.tri.u { border-width: 0 .4em .6em; border-bottom-color: currentColor; }
.tri.d { border-width: .6em .4em 0; border-top-color: currentColor; }
.pause { display: inline-block; width: .55em; height: .8em; border: solid currentColor; border-width: 0 .2em; margin-left: .35em; vertical-align: middle; }

/* ---------- phone (portrait): the RX3 screen on top, a panel in the screen's own style below ---------- */

.phone, #ph-nav { display: none; }

@media (max-width: 600px) and (orientation: portrait) {
  html, body { overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
  #app {
    grid-template: "nav" auto "screen" auto "phone" 1fr / minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    container: app / size; /* so the short-phone rules below see the height inside the safe areas */
  }
  #app, #app * { touch-action: manipulation; }
  #app .ph-xpad, #app #ph-level, #app #ph-pitch, #app .ph-fader, #app .ph-cue-pad, #app .list.l { touch-action: none; }
  #app .bar, #app.mixer-view .bar, #app .statusbar, #app .vkb { display: none; }
  #screen-wrap { height: auto; aspect-ratio: 16 / 10; min-height: 0; }
  #search-input { -webkit-user-select: text; user-select: text; }
  /* the focused deck, picked by tapping it on the screen: drawn thick enough to see at phone scale */
  #screen .mini-deck.active, #screen .deck-info.active, #screen .deck-panel.active { box-shadow: inset 0 0 0 5px var(--blue); }

  .phone { grid-area: phone; display: flex; flex-direction: column; gap: clamp(6px, 1.2dvh, 10px); min-height: 0; padding: 8px; }
  .phone small, #ph-nav small { display: block; font-size: 11px; color: #aaa; letter-spacing: .5px; }
  .ph-row { display: flex; gap: 6px; }
  .ph-btn {
    height: clamp(40px, 5.6dvh, 48px); padding: 0 12px; border: 1px solid #3a3a3a; border-radius: 0; background: #1c1c1c;
    color: #ddd; font-size: 15px; letter-spacing: .5px;
  }
  .ph-btn:active { background: #6c6c6c; }

  /* a section's head: grey label left, the effect picker (a black name box, as in the screen's FX panel) right */
  .ph-head { display: flex; align-items: center; justify-content: space-between; height: 32px; padding-left: 10px; background: #2e2e2e; }
  .ph-head span { font-size: 13px; color: #bbb; letter-spacing: .5px; }
  .ph-select { align-self: stretch; min-width: 0; }
  .ph-select .rxs-btn {
    height: 100%; padding: 0 12px; gap: 12px; border: 0; border-radius: 0; background: #000; color: #fff;
    font: 500 19px var(--cond); letter-spacing: .5px;
  }
  .ph-select .tri { color: #aaa; }
  /* the COLOR FX pad's head: every Color FX by name (FILTER has its own pad), the picked one in blue */
  .ph-colors { padding: 0; gap: 1px; }
  .ph-colors button {
    flex: 1; align-self: stretch; min-width: 0; padding: 0; border: 0; border-radius: 0; background: #000; color: #aaa;
    font: 500 16px var(--cond); letter-spacing: .3px; white-space: nowrap;
  }
  .ph-colors button.lit { background: var(--blue); color: #fff; }
  .ph-select.open .rxs-btn { background: var(--blue); }
  .ph-select.open .tri { color: #fff; }

  #ph-nav { grid-area: nav; display: flex; padding: 8px 8px 0; }
  .ph-nav .ph-btn { flex: 0 0 auto; padding: 0 9px; }
  @media (max-width: 375px) { .ph-nav .ph-btn { padding: 0 6px; font-size: 13px; } #ph-nav { gap: 4px; } }
  @media (max-width: 340px) { .ph-nav .ph-btn { padding: 0 4px; font-size: 12px; } .ph-bpm b { font-size: 20px; } }
  /* DECK n and BPM on a line, the number under them: sized to fit below the labels, so they never overlap */
  .ph-bpm {
    flex: 1; min-width: 0; display: grid; grid-template: auto 1fr / 1fr auto; padding: 3px 5px 2px;
    border: 1px solid #ddd;
  }
  #ph-nav .ph-bpm small { line-height: 12px; white-space: nowrap; }
  .ph-bpm b {
    grid-column: 1 / -1; align-self: end; justify-self: end; color: var(--orange);
    font: normal 24px/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: .5px; white-space: nowrap;
  }

  /* X-PADs: the screen's touch strip; a white marker at the finger, blue where a deck is parked */
  .ph-pad { display: flex; flex-direction: column; }
  .ph-xpad {
    position: relative; height: clamp(44px, 6.5dvh, 56px); border: 1px solid #555;
    background: linear-gradient(90deg, transparent calc(50% - 1px), #333 0 calc(50% + 1px), transparent 0), #0c0c0c;
  }
  .ph-xpad.filter {
    background: linear-gradient(90deg, transparent calc(50% - 1px), #333 0 calc(50% + 1px), transparent 0),
      linear-gradient(90deg, #102a50, #0c0c0c 45%, #0c0c0c 55%, #4a1a10);
  }
  .ph-xpad span { position: absolute; top: 50%; transform: translateY(-50%); font-size: 14px; color: #aaa; pointer-events: none; }
  .ph-xpad .lo { left: 12px; }
  .ph-xpad .hi { right: 12px; }
  .ph-xpad i { display: none; position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: #fff; pointer-events: none; }
  .ph-xpad.held i { display: block; }
  .ph-xpad.color b {
    position: absolute; bottom: 0; height: 4px; left: var(--c0, 50%); right: var(--c1, 50%); background: var(--blue);
    pointer-events: none;
  }
  .ph-xpad.parked i { background: var(--blue); box-shadow: 0 0 0 1px #000; }

  .ph-fx { align-items: stretch; }
  .ph-col { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .ph-beat { display: flex; gap: 6px; }
  .ph-beat .ph-btn { flex: 0 0 48px; padding: 0; }
  .ph-bands { display: flex; gap: 6px; }
  .ph-bands .ph-btn { flex: 1; padding: 0; height: 36px; font: 500 16px var(--cond); }
  .ph-bands .ph-btn.lit { color: var(--blue); border-color: var(--blue); }
  .ph-val { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #000; }
  .ph-val b { font: 500 24px var(--cond); color: #fff; font-weight: 500; letter-spacing: .5px; }
  .ph-level { flex: 0 0 92px; display: flex; flex-direction: column; gap: 4px; text-align: center; }
  #ph-level { position: relative; border: 1px solid #3a3a3a; cursor: ns-resize; }
  #ph-level b { font-size: 32px; }
  #ph-level i { position: absolute; left: 0; bottom: 0; height: 4px; width: var(--lv, 50%); background: var(--blue); }
  /* PITCH (DRUM only) stacks under LEVEL/DEPTH, both shrunk to fit the row */
  .ph-level:not(.pitch) .ph-pitch { display: none; }
  .ph-level.pitch #ph-level b, #ph-pitch b { font-size: 22px; }
  #ph-pitch { position: relative; border: 1px solid #3a3a3a; cursor: ns-resize; }
  #ph-pitch i { position: absolute; bottom: 0; height: 4px; width: 4px; margin-left: -2px; left: var(--pv, 50%); background: var(--blue); }
  .ph-on {
    flex: 0 0 84px; border: 1px solid #555; border-radius: 0; background: #000; color: #aaa; font: 500 20px var(--cond);
    letter-spacing: .5px;
  }
  .ph-on.lit { background: #ddd; color: #000; border-color: #ddd; } /* as the screen's FX panel when on */

  /* PADS / VOL: grows into the free space between BEAT FX and FILTER; the switch is a column at its left */
  .ph-swap { flex: 1 1 auto; min-height: 88px; max-height: 180px; }
  .ph-tabs { flex: 0 0 52px; display: flex; flex-direction: column; gap: 1px; background: #2e2e2e; }
  .ph-tabs button {
    flex: 1; padding: 0; border: 0; border-radius: 0; background: #000; color: #aaa; font: 500 16px var(--cond);
    letter-spacing: .3px;
  }
  .ph-tabs button.lit { background: var(--blue); color: #fff; }
  .ph-cues { flex: 1; min-width: 0; display: grid; grid-template: repeat(2, 1fr) / repeat(4, 1fr) .8fr; gap: 6px; }
  /* LOOP 1/2X and 2X: a column after the pads, usable while a loop is on */
  .ph-loop { grid-area: 1 / 5 / 3 / 6; display: flex; flex-direction: column; gap: inherit; min-width: 0; }
  .ph-loop .ph-btn { flex: 1; height: auto; padding: 0; font: 500 16px var(--cond); }
  .ph-loop .ph-btn:disabled { opacity: .4; }
  /* a pad with a hot cue is lit in its colour, as the unit's pads; held, it fills */
  .ph-cue-pad {
    position: relative; min-width: 0; padding: 0; border: 1px solid #3a3a3a; border-radius: 0; background: #0c0c0c;
    color: #555; overflow: hidden;
  }
  .ph-cue-pad b { position: absolute; left: 7px; top: 3px; font: 500 20px var(--cond); }
  .ph-cue-pad small {
    position: absolute; left: 5px; right: 5px; bottom: 3px; font-size: 10px; color: inherit; text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .ph-cue-pad.fn { color: #888; } /* loop and Pad FX pads: always labelled */
  .ph-cue-pad.set { border: 2px solid var(--cue); color: var(--cue); background: color-mix(in srgb, var(--cue) 18%, #0c0c0c); }
  .ph-cue-pad.down { background: #555; }
  .ph-cue-pad.set.down { background: var(--cue); color: #000; }
  .ph-cue-pad:disabled { opacity: .4; }
  /* the fader bank, as a DJM's: channels split by thin lines, each a big number over a 0-10 scale, a slot and a cap */
  .ph-vol { flex: 1; min-width: 0; display: flex; background: #1c1c1c; border: 1px solid #333; }
  .ph-fader {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 4px 0 5px;
    cursor: ns-resize;
  }
  .ph-fader + .ph-fader { border-left: 1px solid #5c5c5c; }
  #app .ph-fader small { flex: none; font: 700 19px/20px var(--sans); color: #eee; letter-spacing: 0; }
  .ph-track {
    --cap: 20px; --x: calc(50% + 10px); /* the cap's height, and where the slot runs */
    position: relative; flex: 1; width: 100%; margin-top: 3px; container-type: size;
  }
  .ph-track::before { /* the slot */
    content: ""; position: absolute; left: var(--x); width: 7px; margin-left: -3.5px;
    top: calc(var(--cap) / 2 - 5px); bottom: calc(var(--cap) / 2 - 5px); background: #0b0b0b;
    background-image: repeating-linear-gradient(#141414 0 1px, transparent 1px 3px); box-shadow: inset 0 0 0 1px #000;
  }
  /* the scale: a tick per step, its number left of it, a dot at each half step; k = 0..10 from the bottom */
  .ph-track span, .ph-track b {
    position: absolute; right: calc(100% - var(--x) + 8px); bottom: calc(var(--cap) / 2 + var(--k) / 10 * (100% - var(--cap)));
    transform: translateY(50%); background: #d8d8d8; pointer-events: none;
  }
  .ph-track span { width: 14px; height: 1px; }
  .ph-track b { width: 2px; height: 2px; border-radius: 50%; }
  .ph-track em {
    position: absolute; right: calc(100% + 4px); top: 50%; transform: translateY(-50%); font: 600 9px/1 var(--sans);
    font-style: normal; color: #ddd;
  }
  /* the cap: dark, bevelled, a white line across */
  .ph-track i {
    position: absolute; z-index: 1; left: var(--x); width: 48px; height: var(--cap); margin-left: -24px;
    bottom: calc(var(--v, 1) * (100% - var(--cap))); border-radius: 2px; pointer-events: none;
    background: linear-gradient(#3a3a3a, #262626 30%, #1a1a1a 70%, #2c2c2c); border: 1px solid #0a0a0a;
    box-shadow: 0 3px 5px rgba(0, 0, 0, .8), inset 0 1px #555, inset 0 -1px #111;
  }
  .ph-track i::after {
    content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 1px;
    background: #f4f4f4; box-shadow: 0 0 2px rgba(255, 255, 255, .5);
  }
  /* a short strip: fewer marks, so they stay apart */
  @container (max-height: 96px) { /* even numbers */
    .ph-track b, .ph-track .odd em { display: none; }
  }
  @container (max-height: 60px) { /* 0, 5 and 10 */
    .ph-track .odd:not(.major) { display: none; }
    .ph-track span:not(.major) em { display: none; }
    .ph-track .major em { display: block; }
  }

  .ph-transport { align-items: flex-end; }
  .ph-pad:has(.filter) { margin-top: auto; } /* FILTER sits on NUDGE; both stay at the bottom, under the thumbs */
  .ph-cue, .ph-play { flex: 0 0 96px; height: clamp(52px, 8dvh, 64px); font: 500 22px var(--cond); }
  .ph-cue.lit { color: var(--orange); border-color: var(--orange); }
  .ph-nav .ph-btn.lit { color: var(--blue); border-color: var(--blue); }
  .ph-play.lit { color: var(--green); border-color: var(--green); }
  .ph-nudge { flex: 1; text-align: center; }
  .ph-nudge div { display: flex; gap: 6px; margin-top: 4px; }
  .ph-nudge .ph-btn { flex: 1; }
}

/* short phones, Safari with its bars showing, or a home-screen app once the notch and home bar are taken out:
   everything a little tighter, so PADS / VOL fits with the rest. Measured inside the safe areas (#app's content box),
   since the full-size panel needs ~840px there */
@media (max-width: 600px) and (orientation: portrait) {
@container app (max-height: 840px) {
  .phone { gap: 5px; padding: 6px 8px; }
  #ph-nav { padding-top: 6px; }
  .ph-head { height: 24px; }
  .ph-btn { height: 36px; }
  .ph-xpad { height: 34px; }
  .ph-bands .ph-btn { height: 30px; }
  .ph-cue, .ph-play { height: 44px; }
  .ph-nudge div { margin-top: 2px; }
  .ph-swap { min-height: 76px; }
  .ph-cues { gap: 5px; }
  .ph-cue-pad b { top: 1px; font-size: 18px; }
  #app .ph-fader small { font-size: 15px; line-height: 15px; }
  .ph-track { --cap: 16px; margin-top: 1px; }
}
}
