/* The editor's page (index.html). */
:root {
  --bg: #15171c; --panel: #1c1f26; --line: #2c313b; --ink: #d9dde5; --dim: #8a93a3;
  --note: #5aa9f5; --held: #ffcf5c; --bad: #ff6b6b; --ok: #6fd08c;
  /* the roll, drawn by page.js */
  --roll-bg: #15171c; --roll-row: #191c22; --roll-black: #14161a; --roll-line: #252a33; --roll-beat: #2c313b; --roll-bar: #454c5a;
  --roll-ink: #d9dde5; --roll-dim: #8a93a3; --roll-note: #5aa9f5; --roll-chosen: #ffcf5c; --roll-bad: #ff6b6b; --roll-ok: #6fd08c; --roll-lane: #b48cf2;
  --roll-key-black: #22262e; --roll-key-white: #2b303a; --roll-on-note: #0c0e12;
  --roll-font: 11px -apple-system, system-ui, sans-serif;
  /* a singer's color, by its place in the score */
  --singer-1: #5aa9f5; --singer-2: #f5a15a; --singer-3: #6fd08c; --singer-4: #f27fb2; --singer-5: #b48cf2; --singer-6: #4fd1c5; --singer-7: #c9d36a; --singer-8: #9aa7ff;
  font: 13px/1.35 -apple-system, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); overflow: hidden; }
body { display: grid; grid-template: auto auto 1fr auto / 1fr auto; }
header { grid-column: 1 / 3; display: flex; gap: 6px; align-items: center; padding: 6px 8px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header .gap { width: 10px; }
button, select, input, textarea { font: inherit; color: var(--ink); background: #252a33; border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; }
button { cursor: pointer; }
button:hover { background: #2e3440; }
button[aria-pressed="true"] { background: #3b4860; border-color: #5a6f96; }
button:disabled { color: #5d6573; cursor: default; }
#title { width: 18em; }
#examples { width: 9.5em; }
header label { color: var(--dim); }
header .pull { min-width: 62px; }
#tempo .pull { min-width: 84px; }

/* a number pulled with the mouse (pull.js) */
.pull { position: relative; display: inline-flex; align-items: center; justify-content: flex-end; height: 23px; min-width: 76px; padding: 0 7px; background: #20242c; border: 1px solid var(--line); border-radius: 4px; cursor: ew-resize; user-select: none; -webkit-user-select: none; touch-action: none; overflow: hidden; font-variant-numeric: tabular-nums; vertical-align: middle; }
.pull:hover { background: #262b35; border-color: #3d4554; }
.pull:focus { outline: none; border-color: var(--note); }
.pull.pulling { border-color: var(--held); background: #2a2a26; }
.pull .pull-bar { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: rgba(90, 169, 245, 0.2); pointer-events: none; }
.pull.pulling .pull-bar { background: rgba(255, 207, 92, 0.24); }
.pull .pull-v { position: relative; pointer-events: none; white-space: nowrap; }
.pull.off { opacity: 0.4; cursor: default; }
.pull.typing { overflow: visible; }
.pull .pull-in { position: absolute; left: -1px; top: -1px; width: calc(100% + 2px); height: calc(100% + 2px); border: 1px solid var(--held); border-radius: 4px; text-align: right; padding: 0 6px; background: #0f1114; z-index: 1; cursor: text; outline: none; }
.pull .pull-in.bad { border-color: var(--bad); }

/* a tab a singer, and the mixer's */
#tabs { grid-column: 1 / 3; display: flex; align-items: flex-end; gap: 2px; padding: 5px 8px 0; background: #171a20; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 6px 0 10px; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; background: transparent; color: var(--dim); max-width: 230px; cursor: pointer; user-select: none; -webkit-user-select: none; flex: none; }
.tab:hover { background: #1e222a; color: var(--ink); }
.tab[aria-selected="true"] { background: var(--bg); color: var(--ink); border-color: var(--line); margin-bottom: -1px; height: 28px; }
.tab .tab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .flag { font-size: 10px; font-weight: 700; color: var(--bad); }
.tab .flag.solo { color: var(--held); }
.tab .x { border: none; background: none; color: var(--dim); padding: 0 3px; border-radius: 3px; visibility: hidden; line-height: 1; }
.tab:hover .x, .tab[aria-selected="true"] .x { visibility: visible; }
.tab .x:hover { background: #3a2a2e; color: var(--bad); }
.tab input { width: 11em; height: 21px; padding: 0 4px; }
.tab.plain { padding: 0 10px; }
.tab.mixer { padding: 0 12px 0 9px; gap: 8px; margin-right: 10px; color: var(--ink); font-weight: 600; background: #232833; border-color: #3a4150; }
.tab.mixer:hover { background: #2b3140; }
.tab.mixer[aria-selected="true"] { background: var(--bg); border-color: var(--line); }
.tab.mixer .lv { display: inline-flex; gap: 2px; height: 15px; }
.tab.mixer .lv i { position: relative; width: 5px; height: 100%; background: #0f1114; border: 1px solid #5d6573; border-radius: 2px; overflow: hidden; }
.tab.mixer .lv b { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--ok); }
.tab.mixer .lv b.over { background: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

/* the mixer */
#mixer { grid-column: 1 / 3; grid-row: 3; overflow: auto; padding: 14px 18px 24px; }
#mixer[hidden], #roll[hidden] { display: none; }
#mixer h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); margin: 22px 0 2px; }
.mx-hint { color: var(--dim); margin-bottom: 10px; }
.mx-strips { display: grid; gap: 5px; max-width: 980px; }
.mx-strip { display: grid; grid-template-columns: minmax(120px, 220px) 26px 26px 112px 72px minmax(120px, 1fr); gap: 6px; align-items: center; padding: 5px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.mx-strip.master { margin-top: 8px; border-color: #46506199; }
.mx-strip.quiet .mx-name, .mx-strip.quiet .meter { opacity: 0.45; }
.mx-name { display: flex; align-items: center; gap: 7px; border: none; background: none; padding: 2px 0; text-align: left; overflow: hidden; white-space: nowrap; font-weight: 600; }
button.mx-name:hover { background: none; text-decoration: underline; }
.mx-label { overflow: hidden; text-overflow: ellipsis; }
.mx-m, .mx-s { padding: 2px 0; font-weight: 700; font-size: 11px; color: var(--dim); }
.mx-m[aria-pressed="true"] { background: #5c2f33; border-color: var(--bad); color: #ffd6d6; }
.mx-s[aria-pressed="true"] { background: #5a4a1c; border-color: var(--held); color: #fff0c2; }
.mx-gap { grid-column: span 2; }
.mx-gap.narrow { grid-column: span 1; }
.mx-strip .pull { min-width: 0; width: 100%; }
.meter { position: relative; height: 9px; background: #0f1114; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.meter::after { content: ""; position: absolute; top: 0; bottom: 0; left: 90.909%; width: 1px; background: #5d6573; }
.meter-bar { height: 100%; width: 0; background: linear-gradient(90deg, #3f8f5f, #6fd08c 78%, #ffcf5c 91%, #ff6b6b 100%); background-size: 100vw 100%; }
.meter.over { border-color: var(--bad); }
.meter-pair { display: grid; gap: 2px; }
.meter-pair .meter { height: 6px; }
.mx-chain { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.fx { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px 8px; min-width: 188px; }
.fx.off .fx-body { opacity: 0.4; }
.fx-head { display: flex; gap: 3px; align-items: center; margin-bottom: 6px; }
.fx-on { flex: 1; text-align: left; font-weight: 600; text-transform: capitalize; }
.fx-on[aria-pressed="true"] { background: #2b4a39; border-color: #4f8f6a; }
.fx-btn { padding: 2px 5px; color: var(--dim); font-size: 10px; }
.fx-body { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; }
.fx-body label { color: var(--dim); }
.fx-body .pull { min-width: 96px; }
.fx-add { align-self: center; }
#roll { grid-column: 1; grid-row: 3; position: relative; min-width: 0; min-height: 0; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#lyric { position: absolute; display: none; height: 24px; padding: 1px 4px; border-color: var(--held); background: #0f1114; z-index: 2; }
aside { grid-column: 2; grid-row: 3; width: 320px; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line); padding: 8px 10px; }
aside[hidden] { display: none; }
#route-row[hidden] { display: none; }
#route-row { margin-bottom: 5px; }
aside h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); margin: 14px 0 6px; }
aside h2:first-child { margin-top: 2px; }
.rows { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 5px 7px; align-items: center; }
.rows .pull { min-width: 0; width: 100%; }
.rows .wide { grid-column: 2 / 5; }
.rows label { color: var(--dim); }
.rows input, .rows select { width: 100%; min-width: 0; }
.rows input[type="checkbox"] { width: auto; justify-self: start; }
textarea { width: 100%; resize: vertical; font: 12px/1.4 ui-monospace, Menlo, monospace; white-space: pre; tab-size: 2; }
#text { height: 16em; }
#words { height: 7em; white-space: pre-wrap; }
.said { color: var(--dim); min-height: 1.3em; margin: 4px 0; white-space: pre-wrap; }
.said.bad { color: var(--bad); }
footer { grid-column: 1 / 3; padding: 4px 10px; background: var(--panel); border-top: 1px solid var(--line); color: var(--dim); white-space: pre-wrap; max-height: 7.5em; overflow-y: auto; }
footer.bad { color: var(--bad); }
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; max-width: 34em; }
dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
dialog button { display: block; width: 100%; text-align: left; margin: 4px 0; }
kbd { font: 11px ui-monospace, Menlo, monospace; background: #252a33; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }
#keys { color: var(--dim); line-height: 1.9; }
