/* LabAnvil's face, for the brand in the hall (src/brand.js): Archivo, SIL Open Font License */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 900; font-stretch: 100% 125%; font-display: swap; src: url("../fonts/archivo-latin.woff2") format("woff2"); }

:root {
  --bg: #07080c; --glass: rgba(15, 18, 26, 0.78); --line: rgba(255, 255, 255, 0.09); --line2: rgba(255, 255, 255, 0.16);
  --text: #dfe4ee; --dim: #8a93a8; --accent: #ffa41c; --accent2: #ff5a4e; --cell: 22px; --head: 210px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.45 "Segoe UI", system-ui, sans-serif; overflow: hidden; user-select: none; }
canvas { display: block; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }
button, select, input, textarea { font: inherit; color: var(--text); background: rgba(255, 255, 255, 0.055); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; outline: none; transition: background 0.15s, border-color 0.15s, transform 0.08s; }
select option { background: #151923; }
button { cursor: pointer; white-space: nowrap; }
button:hover { background: rgba(255, 255, 255, 0.11); border-color: var(--line2); }
button:active { transform: scale(0.96); }
button.primary { background: var(--accent); border-color: var(--accent); color: #17120a; font-weight: 600; }
button.primary:hover { background: #ffb84a; }
button.round { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 13px; }
button.toggle.on { background: rgba(255, 164, 28, 0.18); border-color: var(--accent); color: var(--accent); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input[type=range] { padding: 0; height: 4px; accent-color: var(--accent); border: 0; background: transparent; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: rgba(255, 164, 28, 0.16); color: var(--accent); }
.lbl { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

#top { position: fixed; left: 14px; top: 12px; right: 388px; display: flex; gap: 10px; align-items: center; padding: 8px 14px; z-index: 3; transition: right 0.25s; }
body.noside #top { right: 58px; }   /* clear of the round #sideShow button (right 14px, 34px wide) */
.brand { font-weight: 600; letter-spacing: 0.04em; margin-right: 4px; white-space: nowrap; }
#seek { flex: 1; min-width: 50px; } #vol { width: 78px; }
#time { color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 86px; text-align: right; }

#views { position: fixed; left: 14px; bottom: 14px; display: flex; gap: 6px; align-items: center; padding: 7px 12px; z-index: 3; transition: bottom 0.25s; }
#ens { max-width: 230px; }

#side { position: fixed; right: 14px; top: 12px; bottom: 14px; width: 360px; display: flex; flex-direction: column; z-index: 3; transition: transform 0.25s, bottom 0.25s; overflow: hidden; }
body.noside #side { transform: translateX(390px); }
#sideShow { position: fixed; right: 14px; top: 12px; width: 34px; height: 34px; padding: 0; border-radius: 50%; z-index: 3; }
.tabs { display: flex; gap: 4px; padding: 8px 8px 0; }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--dim); border-radius: 8px 8px 0 0; padding: 7px 0; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs #sideHide { flex: 0 0 30px; }
.tab { padding: 12px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.tab[hidden] { display: none; }
.tab h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); margin: 8px 0 0; font-weight: 600; }
#q { width: 100%; padding: 8px 12px; border-radius: 10px; }
#chips { display: flex; flex-wrap: wrap; gap: 5px; }
#chips button { font-size: 11.5px; padding: 3px 9px; border-radius: 99px; }
.list { overflow-y: auto; min-height: 0; }
#results { flex: 1 1 200px; } #parts { flex: 0 1 190px; }
.item { display: flex; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 7px; cursor: pointer; }
.item:hover { background: rgba(255, 255, 255, 0.07); }
.item small { color: var(--dim); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.item.off { opacity: 0.55; }
.row { display: flex; gap: 8px; align-items: center; } .row label { flex: 0 0 108px; color: var(--dim); } .row input[type=range] { flex: 1; } .row span { flex: 0 0 58px; text-align: right; font-variant-numeric: tabular-nums; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; } .checks label { cursor: pointer; }
.note { color: var(--dim); margin: 0; font-size: 12px; }
#scoreText { width: 100%; flex: 1 1 180px; min-height: 150px; font: 11.5px/1.45 ui-monospace, Consolas, monospace; white-space: pre; resize: none; user-select: text; }
#warn { color: #ff8a70; white-space: pre-wrap; font-size: 12px; }
.help { color: var(--dim); font-size: 12px; } .help p { margin: 4px 0; } code { background: rgba(255, 255, 255, 0.08); padding: 0 4px; border-radius: 4px; color: var(--text); }

/* selected instrument and its keyboard */
/* #tester and #seq sit above the bottom bar, whose height (--views-h, set in main.js; 47px for one row) grows when it wraps */
/* centred on the hall, between the window's left edge and the side panel (or the whole width when the panel is hidden) */
#tester { position: fixed; left: calc(50vw - 187px); bottom: calc(var(--views-h, 47px) + 19px); transform: translateX(-50%); width: min(760px, calc(100vw - 420px)); padding: 12px 14px; z-index: 4; transition: bottom 0.25s, left 0.25s; }
body.noside #tester { left: 50%; }
#tester[hidden] { display: none; }
#tester .t-head { display: flex; gap: 10px; align-items: center; }
#tester h3 { margin: 0; font-size: 17px; font-weight: 600; }
#tester .meta { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tester .t-head .grow { flex: 1; min-width: 0; }
#tester .about { color: var(--dim); font-size: 12px; margin: 8px 0 0; max-height: 3em; overflow: hidden; }
#tester .about a { color: var(--accent); }
.kbd { position: relative; height: 96px; margin-top: 10px; display: flex; border-radius: 8px; overflow: hidden; touch-action: none; }
.kbd .w { flex: 1; background: linear-gradient(#f4f1ea, #d9d4c8); border-right: 1px solid #9a968b; position: relative; cursor: pointer; }
.kbd .b { position: absolute; top: 0; width: 3.6%; height: 60%; background: linear-gradient(#2b2d33, #0c0d10); border-radius: 0 0 4px 4px; transform: translateX(-50%); z-index: 2; cursor: pointer; box-shadow: 0 2px 4px #0008; }
.kbd .w.on { background: var(--key, var(--accent)); } .kbd .b.on { background: var(--key, var(--accent)); }
.kbd .off { opacity: 0.28; pointer-events: none; }
.kbd span { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 10px; color: #6b675e; pointer-events: none; }
.kbd .b span { color: #9aa; bottom: 3px; }
.pads { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-top: 10px; height: 96px; touch-action: none; }
.pads div { border-radius: 10px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line2); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; color: var(--dim); cursor: pointer; transition: transform 0.06s, background 0.1s; }
.pads div.on { background: var(--key, var(--accent)); color: #111; transform: scale(0.95); }
.hint { color: var(--dim); font-size: 11.5px; margin-top: 7px; display: flex; gap: 12px; align-items: center; }
.hint kbd { background: rgba(255, 255, 255, 0.09); border-radius: 4px; padding: 0 5px; font: inherit; }

/* sequencer: see src/sequencer.css */

#status { position: fixed; right: 392px; bottom: 16px; color: var(--dim); font-size: 11.5px; white-space: nowrap; text-shadow: 0 0 4px #000; pointer-events: none; z-index: 2; transition: right 0.25s; }
body.noside #status { right: 18px; } body.seq #status { display: none; }
#tip { position: fixed; pointer-events: none; background: rgba(0, 0, 0, 0.8); border: 1px solid var(--line2); border-radius: 6px; padding: 2px 8px; display: none; white-space: nowrap; z-index: 5; }
#labels div { position: fixed; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap; font-size: 12px; text-shadow: 0 0 6px #000, 0 0 2px #000; z-index: 1; }
#loading { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 10; transition: opacity 0.6s; }
#loading h1 { font-weight: 400; letter-spacing: 0.22em; text-transform: uppercase; font-size: 20px; margin: 0; }
#bar { width: 300px; height: 3px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; } #bar div { height: 100%; width: 0; background: var(--accent); transition: width 0.15s; }
#loading p { color: var(--dim); margin: 0; min-height: 1.4em; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 4px; } ::-webkit-scrollbar-corner { background: transparent; }

#tester .t-count { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; opacity: .9; white-space: nowrap; margin-right: 4px; }
#tester .t-count button { width: 26px; height: 26px; padding: 0; line-height: 1; }
#tester .t-count button:disabled { opacity: .3; cursor: default; }
#tester .t-count .t-n { width: 46px; height: 26px; box-sizing: border-box; text-align: center; font: 600 14px inherit; font-family: inherit; color: inherit;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); border-radius: 7px; padding: 0 4px; -moz-appearance: textfield; }
#tester .t-count .t-n::-webkit-outer-spin-button, #tester .t-count .t-n::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#tester .t-count .t-n:focus { outline: none; border-color: #ffa41c; }

#toast { position: fixed; left: 50%; top: 84px; transform: translate(-50%, -8px); z-index: 30; max-width: min(720px, 90vw); padding: 10px 18px; border-radius: 12px;
  background: rgba(14, 16, 22, .9); border: 1px solid rgba(255, 164, 28, .55); color: #fff; font-size: 14px; backdrop-filter: blur(12px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { border-color: rgba(255, 90, 78, .8); }

/* wraps before it reaches the side panel (whose left edge is 374px from the right), like #top's right: 388px */
#views { flex-wrap: wrap; max-width: calc(100vw - 402px); row-gap: 6px; transition: bottom 0.25s, max-width 0.25s; }
body.noside #views { max-width: calc(100vw - 28px); }
#views .grp { display: flex; gap: 6px; align-items: center; }   /* a label wraps with its menu */
#views select { max-width: 176px; }

.credits { display: flex; flex-direction: column; gap: 7px; font-size: 12px; margin-bottom: 10px; }
.credits .credit { line-height: 1.35; }
.credits .credit span { opacity: .7; }
.credits a { color: #ffa41c; }

/* the piece menu (src/picker.js) */
.picker { position: relative; flex: 0 1 300px; min-width: 150px; }
.picker[hidden] { display: none; }
.pk-btn { width: 100%; display: flex; align-items: baseline; gap: 8px; text-align: left; padding: 6px 10px 6px 12px; border-radius: 9px; }
.picker.open .pk-btn { border-color: var(--accent); background: rgba(255, 164, 28, 0.08); }
.pk-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
.pk-sub { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 0; min-width: 0; }
.pk-caret { flex: 0 0 auto; align-self: center; color: var(--dim); transition: transform 0.15s; }
.picker.open .pk-caret { transform: rotate(180deg); color: var(--accent); }
.pk-menu { position: absolute; top: calc(100% + 8px); left: 0; width: 380px; max-width: calc(100vw - 40px); max-height: min(560px, calc(100vh - 90px)); display: flex; flex-direction: column; padding: 0; z-index: 20; background: rgba(13, 15, 22, 0.96); overflow: hidden; animation: pk-in 0.14s ease-out; }
@keyframes pk-in { from { opacity: 0; transform: translateY(-4px); } }
.pk-menu[hidden] { display: none; }
.pk-top { padding: 10px 10px 6px; border-bottom: 1px solid var(--line); }
.pk-q { width: 100%; padding: 7px 11px; border-radius: 8px; }
.pk-list { overflow-y: auto; padding: 4px 6px 8px; outline: none; }
.pk-group { color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600; padding: 12px 10px 4px; }
.pk-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; cursor: pointer; position: relative; outline: none; }
.pk-item:hover, .pk-item:focus { background: rgba(255, 255, 255, 0.07); }
.pk-item.cur { background: rgba(255, 164, 28, 0.12); }
.pk-item.cur::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 2px; background: var(--accent); }
.pk-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pk-txt b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-item.cur .pk-txt b { color: var(--accent); }
.pk-txt small { color: var(--dim); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-del { flex: 0 0 auto; width: 24px; height: 24px; padding: 0; border-radius: 6px; font-size: 11px; color: var(--dim); opacity: 0; }
.pk-item:hover .pk-del, .pk-item:focus .pk-del { opacity: 1; }
.pk-del:hover { color: #ff8a70; border-color: rgba(255, 90, 78, 0.6); }
.pk-open .pk-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: rgba(255, 164, 28, 0.14); color: var(--accent); font-weight: 700; flex: 0 0 auto; }
.pk-nudge { display: flex; gap: 10px; margin: 8px 4px 2px; padding: 10px 12px; border-radius: 10px; background: linear-gradient(135deg, rgba(255, 164, 28, 0.13), rgba(255, 90, 78, 0.07)); border: 1px solid rgba(255, 164, 28, 0.3); font-size: 12px; color: var(--dim); line-height: 1.4; }
.pk-nudge svg { flex: 0 0 auto; color: var(--accent); margin-top: 1px; }
.pk-nudge b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.pk-acts { display: flex; gap: 12px; margin-top: 7px; align-items: center; }
.pk-acts a { color: var(--accent); text-decoration: none; font-weight: 600; }
.pk-acts a.pk-signin { background: var(--accent); color: #17120a; padding: 3px 12px; border-radius: 7px; }
.pk-acts a:hover { text-decoration: underline; }
.pk-none { color: var(--dim); padding: 20px; text-align: center; }
