/* SPDX-License-Identifier: GPL-3.0-only
 * Crafty Synth editor: after Serum 2 and Shrub, in the FM-1's themes (the colours are set from app.js, the same as
 * src/app/cr_app.c's). Big type: values 20 px, labels 15 px. */
:root { --bg: #14171b; --panel: #22272d; --bar: #2e343c; --ink: #e8ecef; --soft: #8c96a1; --acc: #3fa9f5; --acc2: #7edec8;
  --track: #3a4048; --hil: #183a56; --line: #343a42; }
* { box-sizing: border-box; min-width: 0; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 600 17px/1.3 "Barlow Semi Condensed", system-ui, sans-serif; }
button, select, input[type=text] { font: inherit; font-size: 16px; color: var(--ink); background: var(--bar); border: 1px solid var(--line);
  border-radius: 5px; padding: 7px 11px; }
button { cursor: pointer; letter-spacing: .3px; }
button:hover, select:hover { border-color: var(--acc); }
button.go { background: var(--acc); color: var(--bg); border-color: var(--acc); }
button:focus-visible, select:focus-visible, canvas:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
select option { background: var(--panel); color: var(--ink); }
.top { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 10px 16px;
  background: var(--bar); border-bottom: 1px solid var(--line); }
.logo { font-size: 26px; font-weight: 700; letter-spacing: 1px; }
.logo span { color: var(--acc); margin-left: 4px; }
.presetbox { display: flex; align-items: stretch; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; flex: 1 1 280px; max-width: 460px; }
.presetbox select { flex: 1; border: 0; background: transparent; font-size: 21px; color: var(--ink); }
.presetbox .arrow { border: 0; background: transparent; color: var(--acc); font-size: 15px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.theme { color: var(--soft); font-size: 14px; }
.status { color: var(--soft); font-size: 15px; }
.device { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 16px 0; padding: 10px; border: 1px solid var(--acc); border-radius: 8px; background: var(--panel); }
[hidden] { display: none !important; }
.rack { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; padding: 12px 16px 0; max-width: 1500px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 12px; }
.panel.wide { margin: 10px 16px 0; max-width: 1468px; }
@media (min-width: 1516px) { .panel.wide { margin-left: auto; margin-right: auto; } }
.osc { grid-column: span 4; } .voice { grid-column: span 4; } .filter { grid-column: span 4; }
.env { grid-column: span 4; } .lfo { grid-column: span 4; } .matrix { grid-column: span 4; }
.fx { grid-column: span 4; } .arp { grid-column: span 4; }
@media (max-width: 1100px) { .osc, .voice, .filter, .env, .lfo, .matrix, .fx, .arp { grid-column: span 6; } }
@media (max-width: 700px) { .rack > * { grid-column: 1 / -1 !important; } }
h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h2 small { font-size: 14px; font-weight: 500; color: var(--soft); letter-spacing: 0; }
.badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 4px; background: var(--acc); color: var(--panel); font-size: 18px; }
.badge.b { background: var(--acc2); }
.head select { margin-left: auto; font-size: 16px; padding: 5px 8px; }
.tabs { margin-left: auto; display: flex; gap: 4px; }
.tabs button { padding: 4px 9px; font-size: 14px; }
.tabs button.on { background: var(--acc); color: var(--panel); border-color: var(--acc); }
canvas.view { width: 100%; height: 160px; display: block; background: var(--bg); border-radius: 6px; border: 1px solid var(--line); }
.osc canvas.view { height: 190px; }
.knobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 10px; }
.knob { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 4px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); user-select: none; touch-action: none; }
.knob.hit { background: var(--hil); }
.knob label { font-size: 15px; color: var(--soft); white-space: nowrap; }
.knob canvas { width: 56px; height: 56px; cursor: ns-resize; }
.knob .val { font-size: 20px; font-weight: 700; white-space: nowrap; }
.pick { grid-column: span 2; align-content: center; display: grid; gap: 3px; padding: 6px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.pick label { font-size: 15px; color: var(--soft); }
.pick select { font-size: 17px; width: 100%; }
.mtx { width: 100%; border-collapse: collapse; }
.mtx td { padding: 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
.mtx td:first-child { color: var(--acc); width: 78px; }
.mtx select { width: 100%; font-size: 15px; padding: 4px 6px; }
.mtx .dep { width: 120px; }
.mtx input[type=range] { width: 100%; accent-color: var(--acc); }
.mtx .dv { width: 42px; text-align: right; font-size: 18px; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.steps button { min-width: 58px; height: 54px; font-size: 21px; background: var(--acc); color: var(--panel); border: 0; }
.steps button.rest { background: var(--bar); color: var(--soft); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ubanks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 12px; }
.ubank { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--bg); }
.ubank .frames { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 8px 0; }
.ubank .frames canvas { width: 100%; height: 56px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.ubank .frames input { width: 100%; accent-color: var(--acc); }
.ubank .frames span { font-size: 13px; color: var(--soft); }
.ubank input[type=file] { color: var(--soft); max-width: 100%; }
.kb { position: relative; height: 150px; user-select: none; touch-action: none; }
.kb .k { position: absolute; top: 0; border: 1px solid var(--line); border-radius: 0 0 5px 5px; }
.kb .w { background: #e9edf0; height: 150px; }
.kb .b { background: #15181c; height: 92px; z-index: 1; }
.kb .k.down { background: var(--acc); }
.small { font-size: 14px; color: var(--soft); margin: 20px 16px 40px; font-weight: 500; }
a { color: var(--acc); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.meter { width: 70px; height: 12px; border-radius: 3px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.meter div { height: 100%; width: 0; background: var(--acc); }

/* inside the AU / VST3 plugin: the host plays the sound and the plugin is always "connected" */
body.plugin #audio, body.plugin #connect, body.plugin .meter, body.plugin a[href*="flasher"] { display: none; }
/* the plugin's window: 0.7's layout at one width, zoomed to the window (app.js applyScale) */
body.plugin { margin: 0; overflow-x: hidden; }
body.plugin .rack { max-width: none; }
body.plugin .osc, body.plugin .voice, body.plugin .filter, body.plugin .env, body.plugin .lfo, body.plugin .matrix,
body.plugin .fx, body.plugin .arp { grid-column: span 4 !important; }   /* 0.7's three columns at every window size */
body.plugin .panel.wide { margin-left: 16px; margin-right: 16px; max-width: none; }
/* the plugin's resize handle (app.js resizeHandle): stays in the window's corner whatever the zoom */
.resizer { position: fixed; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; z-index: 100;
  background: linear-gradient(135deg, transparent 0 45%, var(--soft) 45% 52%, transparent 52% 62%, var(--soft) 62% 69%,
  transparent 69% 79%, var(--soft) 79% 86%, transparent 86%); }
.resizer:hover { background-color: rgba(63, 169, 245, 0.25); }
.subhead { font-weight: 700; font-size: 15px; letter-spacing: 0.06em; color: var(--ink); margin: 14px 2px 8px; }
.theme input[type=range] { width: 90px; vertical-align: middle; accent-color: var(--acc); }
