:root {
  --bg: #10131b;
  --panel: #1a1e28;
  --panel-2: #232835;
  --field: #0f121a;
  --line: #2c3342;
  --text: #eef1f7;
  --muted: #8e98ac;
  --mint: #52e1bb;
  --amber: #ffbe55;
  --violet: #a88cff;
  --wave: #7fd6ff;
  --danger: #ff6d82;
  --ruler-h: 30px;
  --wave-h: 80px;
  --tempo-h: 40px;
  --control-h: 28px;
  color: var(--text);
  background: var(--bg);
  color-scheme: dark;
  font-family: ui-rounded, "Hiragino Sans", system-ui, sans-serif;
  font-size: 12px;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}
button,
input,
select {
  height: var(--control-h);
  font: inherit;
}
button {
  padding: 0 10px;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
  white-space: nowrap;
}
button:hover:not(:disabled) {
  border-color: #4a5468;
  background: #2c3342;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
button.icon {
  display: inline-grid;
  min-width: var(--control-h);
  padding: 0 6px;
  font-size: 14px;
  place-items: center;
}
button.active {
  color: var(--bg);
  border-color: var(--mint);
  background: var(--mint);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
.scroller:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 1px;
}
input,
select {
  width: 100%;
  min-width: 0;
  padding: 0 6px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--field);
}
input[type="file"] {
  height: auto;
  padding: 4px;
}
input:disabled,
select:disabled {
  opacity: 0.4;
}
label {
  display: grid;
  color: var(--muted);
  font-size: 11px;
  gap: 3px;
}
label.inline {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.primary {
  color: var(--bg);
  border-color: var(--mint);
  background: var(--mint);
  font-weight: 700;
}
.primary:hover:not(:disabled) {
  border-color: #7aeccf;
  background: #7aeccf;
}
.accent {
  color: var(--bg);
  border-color: var(--amber);
  background: var(--amber);
  font-weight: 700;
}
.accent:hover:not(:disabled) {
  border-color: #ffd083;
  background: #ffd083;
}
.danger {
  color: var(--danger);
}
.hint {
  color: var(--muted);
  font-size: 11px;
}
.left {
  color: var(--mint);
}
.round {
  color: var(--amber);
}
.right {
  color: var(--violet);
}

/* ---- bars ---- */
.bar {
  display: flex;
  flex: none;
  align-items: center;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.bar.top {
  height: 44px;
  background: var(--panel);
}

.brand {
  display: grid;
  width: 28px;
  height: 28px;
  color: var(--bg);
  border-radius: 7px;
  background: linear-gradient(135deg, var(--mint), var(--violet));
  font-weight: 900;
  place-items: center;
}
.group {
  display: flex;
  align-items: center;
  gap: 3px;
}
.group select {
  width: auto;
}
.transport {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 4px 0 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b0e14;
  gap: 3px;
}
.transport button {
  border-color: transparent;
  background: transparent;
}
.transport .play {
  color: var(--mint);
}
.transport #cycle.active {
  color: var(--bg);
  background: var(--mint);
}
.position {
  display: grid;
  min-width: 96px;
  padding: 0 8px;
  border-left: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
#pos-bars {
  color: var(--amber);
  font-size: 15px;
  font-weight: 700;
}
#pos-time {
  color: var(--muted);
  font-size: 10px;
}
.locators {
  display: grid;
  min-width: 70px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.kind.left.active {
  color: var(--bg);
  border-color: var(--mint);
  background: var(--mint);
}
.kind.round.active {
  color: var(--bg);
  border-color: var(--amber);
  background: var(--amber);
}
.kind.right.active {
  color: var(--bg);
  border-color: var(--violet);
  background: var(--violet);
}

.tabs {
  display: flex;
  gap: 2px;
}
.tab {
  font-weight: 700;
}

/* ---- timeline ---- */
main {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}
.spacer {
  flex: 1;
}
.empty {
  display: grid;
  height: 100%;
  color: var(--muted);
  place-content: center;
  gap: 6px;
  text-align: center;
}
.empty b {
  color: var(--text);
  font-size: 18px;
}
.timeline {
  display: flex;
  flex: 1;
  min-width: 0;
}
.empty {
  flex: 1;
}
.headers {
  display: flex;
  flex: none;
  flex-direction: column;
  width: 76px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
.headers > * {
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  gap: 6px;
}
.ruler-head {
  flex: none;
  height: var(--ruler-h);
  background: #151924;
}
.wave-head {
  flex: none;
  height: var(--wave-h);
  color: var(--wave);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.headers b {
  flex: 1;
  font-size: 12px;
}
.headers b i {
  display: grid;
  width: 18px;
  height: 18px;
  color: var(--bg);
  border-radius: 4px;
  background: currentColor;
  font-size: 10px;
  font-style: normal;
  place-items: center;
}
.headers b.left i {
  background: var(--mint);
}
.headers b.round i {
  background: var(--amber);
}
.headers b.right i {
  background: var(--violet);
}
.scroller {
  position: relative;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  outline: none;
  background: var(--bg);
}
.scroller::-webkit-scrollbar {
  height: 10px;
}
.scroller::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg);
  border-radius: 5px;
  background: #3a4254;
}
.scroller[data-tool="draw"] .lanes {
  cursor: crosshair;
}
.scroller[data-tool="erase"] .lanes {
  cursor: not-allowed;
}
.content {
  position: relative;
  min-width: 100%;
  height: 100%;
}
#canvas {
  position: absolute;
  top: 0;
  pointer-events: none;
}
.lanes {
  position: absolute;
  top: calc(var(--ruler-h) + var(--wave-h) + var(--tempo-h));
  bottom: 0;
  left: 0;
  width: 100%;
}
.playhead {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  border-left: 2px solid var(--amber);
  box-shadow: 0 0 6px #ffbe5599;
  pointer-events: none;
}
.band {
  position: absolute;
  z-index: 6;
  border: 1px solid var(--mint);
  background: #52e1bb1f;
  pointer-events: none;
}
.note {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  height: 26px;
  transform: translate(-13px, -50%);
  user-select: none;
}
.note.left {
  color: var(--mint);
}
.note.round {
  color: var(--amber);
}
.note.right {
  color: var(--violet);
}
.note b {
  position: relative;
  display: grid;
  flex: none;
  width: 26px;
  height: 26px;
  color: inherit;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #121620;
  box-shadow: 0 2px 6px #0007;
  font-size: 13px;
  place-items: center;
}
.note.decorated b {
  border-style: double;
  border-width: 4px;
}
.note.selected b {
  color: var(--bg);
  border-color: #fff;
  box-shadow:
    0 0 0 2px #ffffff55,
    0 2px 8px #000a;
}
.note.selected.left b {
  background: var(--mint);
}
.note.selected.round b {
  background: var(--amber);
}
.note.selected.right b {
  background: var(--violet);
}
.note .edge {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
}
.scroller[data-tool="select"] .note b {
  cursor: grab;
}
.scroller[data-tool="select"] .note b:hover {
  filter: brightness(1.3);
}

/* ---- popups ---- */
.toolbox {
  position: fixed;
  z-index: 20;
  display: grid;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px #0009;
  gap: 2px;
}
.toolbox button {
  text-align: left;
  border-color: transparent;
  background: transparent;
}
dialog {
  padding: 0;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 20px 60px #000c;
}
dialog::backdrop {
  background: #05070bb0;
}
dialog.panel {
  width: min(760px, calc(100vw - 32px));
}
dialog.small {
  width: 360px;
  padding: 16px;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2,
dialog.small h2 {
  margin: 0;
  font-size: 15px;
}
.dialog-body {
  max-height: calc(100vh - 120px);
  margin: 0;
  padding: 14px;
  overflow-y: auto;
}
.dialog-body.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.dialog-body section {
  display: grid;
  align-content: start;
  gap: 8px;
}
.dialog-body h3 {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.tempo-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr auto;
  align-items: end;
  gap: 4px;
}
.tempo-row button:disabled {
  visibility: hidden;
}
.list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 4px;
}
.list li,
.list button {
  display: block;
  width: 100%;
  height: auto;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--field);
  text-align: left;
}
.import {
  display: grid;
  height: var(--control-h);
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
  font-size: 12px;
  place-items: center;
}
.import input {
  display: none;
}
.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
}
.keys dt {
  font-weight: 700;
  white-space: nowrap;
}
.keys dd {
  margin: 0;
  color: var(--muted);
}

#clear-cycle {
  min-width: 22px;
  height: 22px;
  color: var(--muted);
  font-size: 11px;
}
.busy main {
  opacity: 0.6;
  pointer-events: none;
}

/* ---- inspector (Unity-style) ---- */
.inspector {
  display: flex;
  flex: none;
  flex-direction: column;
  width: 300px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
}
.insp-tab {
  position: sticky;
  z-index: 1;
  top: 0;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: #151924;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.insp-empty {
  padding: 16px 12px;
}
.insp-title {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.insp-title b {
  display: block;
  font-size: 13px;
}
.insp-title small {
  display: block;
}
.insp-icon {
  display: grid;
  flex: none;
  width: 30px;
  height: 30px;
  color: var(--bg);
  border-radius: 7px;
  background: currentColor;
  font-size: 15px;
  place-items: center;
}
.insp-icon.left {
  background: var(--mint);
}
.insp-icon.round {
  background: var(--amber);
}
.insp-icon.right {
  background: var(--violet);
}
.insp-icon.song {
  color: var(--bg);
  background: linear-gradient(135deg, var(--mint), var(--violet));
}
.inspector details {
  border-bottom: 1px solid var(--line);
}
.inspector summary {
  padding: 7px 10px;
  cursor: pointer;
  background: #1e2330;
  font-weight: 700;
  list-style: none;
  user-select: none;
}
.inspector summary::before {
  content: "▸";
  display: inline-block;
  width: 14px;
  color: var(--muted);
  transition: transform 0.12s;
}
.inspector details[open] summary::before {
  transform: rotate(90deg);
}
.props {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  padding: 8px 10px;
  gap: 6px 8px;
}
.props > label {
  color: var(--muted);
  font-size: 11px;
}
.props > span {
  font-variant-numeric: tabular-nums;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  padding: 0 10px 10px;
  gap: 4px;
}
.actions select {
  width: auto;
}

.status-bar {
  display: flex;
  flex: none;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-size: 11px;
  white-space: nowrap;
  gap: 16px;
}
#status {
  flex: none;
  max-width: 40%;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
}
#hint {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

/* segmented buttons for short choices */
.seg {
  display: inline-flex;
}
.seg button {
  min-width: 0;
  padding: 0 8px;
  border-radius: 0;
}
.seg button + button {
  margin-left: -1px;
}
.seg button:first-child {
  border-radius: 5px 0 0 5px;
}
.seg button:last-child {
  border-radius: 0 5px 5px 0;
}
.seg button.active {
  position: relative;
  z-index: 1;
}
.seg.wide {
  display: flex;
}
.seg.wide button {
  flex: 1;
}
.seg button.left.active {
  color: var(--bg);
  border-color: var(--mint);
  background: var(--mint);
}
.seg button.round.active {
  color: var(--bg);
  border-color: var(--amber);
  background: var(--amber);
}
.seg button.right.active {
  color: var(--bg);
  border-color: var(--violet);
  background: var(--violet);
}
.tab.empty-chart:not(.active) {
  color: var(--muted);
  border-style: dashed;
}
/* Tap notes are circles; hold notes are one rectangle spanning their length. */
.note.hold {
  box-sizing: border-box;
  overflow: hidden;
  transform: translate(0, -50%);
  border: 2px solid currentColor;
  border-radius: 6px;
  background: color-mix(in srgb, currentColor 22%, #121620);
  box-shadow: 0 2px 6px #0007;
}
.note.hold b {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.note.hold.decorated {
  border-style: double;
  border-width: 4px;
}
.note.hold.decorated b {
  border: none;
}
.note.hold.selected {
  border-color: #fff;
  background: color-mix(in srgb, currentColor 70%, #121620);
  box-shadow:
    0 0 0 2px #ffffff55,
    0 2px 8px #000a;
}
.note.hold.selected b {
  color: var(--bg);
  background: transparent;
  box-shadow: none;
}
.note.hold .edge {
  right: 0;
  width: 10px;
}
.note.hold .edge::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 3px;
  bottom: 6px;
  border-right: 2px solid currentColor;
  opacity: 0.6;
}
/* E / N / H picker next to the song list */
.difficulty-pick .hint {
  margin: 0 2px 0 6px;
  white-space: nowrap;
}
#difficulties button {
  min-width: 30px;
  font-weight: 800;
}
#difficulties .diff-easy.active {
  color: var(--bg);
  border-color: var(--mint);
  background: var(--mint);
}
#difficulties .diff-normal.active {
  color: var(--bg);
  border-color: var(--amber);
  background: var(--amber);
}
#difficulties .diff-hard.active {
  color: var(--bg);
  border-color: var(--danger);
  background: var(--danger);
}
#difficulties .empty-chart:not(.active) {
  color: var(--muted);
  border-style: dashed;
}
/* second header row: editing tools */
.bar.tools {
  height: 38px;
  background: #151923;
}
.sep {
  flex: none;
  width: 1px;
  height: 22px;
  background: var(--line);
}
button.tool {
  display: inline-grid;
  width: 34px;
  padding: 0;
  place-items: center;
}
.ico {
  display: block;
  width: 17px;
  height: 17px;
  background: currentColor;
  mask: var(--src) center / contain no-repeat;
  -webkit-mask: var(--src) center / contain no-repeat;
}
.zoom input {
  width: 120px;
  height: auto;
  padding: 0;
  accent-color: var(--mint);
}
/* Narrow windows wrap the header instead of clipping controls. */
.bar.top {
  flex-wrap: wrap;
  height: auto;
  min-height: 44px;
  padding-top: 4px;
  padding-bottom: 4px;
  row-gap: 4px;
}
.seg.wide button {
  padding: 0 4px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
}
/* tempo track under the waveform */
.tempo-head {
  flex: none;
  height: var(--tempo-h);
  color: var(--amber);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.tempo-row {
  position: absolute;
  top: calc(var(--ruler-h) + var(--wave-h));
  left: 0;
  width: 100%;
  height: var(--tempo-h);
}
.scroller[data-tool="draw"] .tempo-row {
  cursor: crosshair;
}
.tempo-point {
  position: absolute;
  z-index: 3;
  top: 3px;
  padding: 1px 6px 1px 8px;
  cursor: grab;
  color: var(--bg);
  border-radius: 0 4px 4px 0;
  background: var(--amber);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.tempo-point::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 34px;
  background: var(--amber);
}
.tempo-point.selected {
  outline: 2px solid #fff;
}
.insp-icon.tempo {
  background: var(--amber);
}
.meter {
  display: flex;
  align-items: center;
  gap: 6px;
}
.meter input {
  width: 52px;
}
.meter .seg button {
  padding: 0 7px;
}
/* Header dropdowns grow to fit their longest option so nothing is clipped. */
.bar select {
  width: auto;
  min-width: 90px;
  max-width: none;
  field-sizing: content;
  padding-right: 24px;
}
.props select {
  field-sizing: content;
  min-width: 100%;
}
.danger-zone summary {
  color: var(--danger);
}
.danger-zone > .hint {
  margin: 8px 10px 0;
}
.danger-fill {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
  font-weight: 700;
}
.danger-fill:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: var(--panel-2);
}
#delete-dialog label {
  margin-top: 10px;
}
.dialog-actions {
  justify-content: flex-end;
  margin-top: 14px;
  padding: 0;
}
/* custom dropdown: trigger + popup that lists every option without scrolling */
button.dropdown {
  position: relative;
  padding: 0 24px 0 8px;
  text-align: left;
  border-color: var(--line);
  background: var(--field);
  white-space: nowrap;
}
button.dropdown::after {
  content: "▾";
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 10px;
}
.props button.dropdown {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-menu {
  position: fixed;
  z-index: 50;
  display: grid;
  max-height: none;
  padding: 4px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px #000b;
}
.dropdown-menu button {
  height: 26px;
  padding: 0 10px;
  text-align: left;
  border-color: transparent;
  background: transparent;
  white-space: nowrap;
}
.dropdown-menu button:hover,
.dropdown-menu button:focus-visible {
  background: #2c3342;
  outline: none;
}
.dropdown-menu button.active {
  color: var(--bg);
  background: var(--mint);
}
.insp-note {
  margin: 8px 10px 0;
}
.insp-list {
  margin: 8px 10px 0;
}
.insp-list:empty {
  display: none;
}
.sound-rows li {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sound-rows li > div {
  display: grid;
  flex: 1;
  min-width: 0;
}
.sound-rows li b,
.sound-rows li small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* .list button stretches list buttons to full width; the row's edit / delete stay icon-sized. */
.sound-rows li button {
  flex: none;
  width: var(--control-h);
  height: var(--control-h);
  padding: 0;
  text-align: center;
}
.dialog-props {
  margin: 10px 0;
  padding: 0;
}
.dialog-props small {
  display: block;
  margin-top: 2px;
}
#sd-clear-hold {
  width: auto;
  height: auto;
}
/* Fixed widths so the header layout never shifts with song names or values.
   Long text is cut with an ellipsis; the full text is in the open menu. */
.bar button.dropdown {
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown[data-for="song-select"] {
  width: 260px;
}
.dropdown[data-for="snap"] {
  width: 176px;
}
.dropdown[data-for="tool-sound"] {
  width: 160px;
}
.position {
  width: 112px;
  min-width: 0;
}
.locators {
  width: 92px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.status-bar #status {
  flex: none;
  width: 340px;
  max-width: none;
  white-space: nowrap;
}
#difficulties {
  width: 96px;
  min-height: var(--control-h);
}
/* sign-in, account menu and read-only view */
.account {
  position: relative;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.account-button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  background: var(--panel-2);
  font-weight: 800;
  place-items: center;
}
.account-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.account-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px #000b;
  gap: 2px;
}
.account-menu b {
  padding: 6px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu a,
.account-menu button {
  height: auto;
  padding: 7px 8px;
  color: var(--text);
  border: none;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-size: 12px;
}
.account-menu a:hover,
.account-menu button:hover {
  background: #2c3342;
}
.account-menu hr {
  width: 100%;
  margin: 2px 0;
  border: none;
  border-top: 1px solid var(--line);
}
.signed-out .bar.top > :not(.brand),
.signed-out .bar.tools,
.signed-out #inspector,
.signed-out .empty > :not(.signin) {
  display: none !important;
}
.signin {
  display: grid;
  max-width: 420px;
  justify-items: center;
  gap: 12px;
}
.signin-button {
  display: inline-grid;
  height: 36px;
  padding: 0 18px;
  border-radius: 6px;
  text-decoration: none;
  place-items: center;
}
.read-only-note {
  width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 8px;
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 5px;
  font-size: 11px;
  white-space: nowrap;
}
.read-only .bar.tools {
  opacity: 0.45;
  pointer-events: none;
}
/* Someone else's song: every editing control is greyed out and inert. */
.read-only #inspector input,
.read-only #inspector button,
.read-only #inspector .seg,
.read-only #inspector .dropdown,
.read-only #save,
.read-only #publish,
.read-only #unpublish {
  opacity: 0.35;
  filter: grayscale(1);
  cursor: not-allowed;
}
/* Profile chip: one line, pinned to the right end of the header's first row
   even when narrow windows wrap the rest of the header. */
.bar.top {
  position: relative;
  padding-right: 200px;
}
.account {
  position: absolute;
  top: 8px;
  right: 8px;
  padding-left: 0;
  border-left: none;
}
.account-button {
  display: flex;
  align-items: center;
  width: auto;
  max-width: 184px;
  height: 30px;
  padding: 0 10px 0 3px;
  gap: 6px;
  border-radius: 15px;
  white-space: nowrap;
}
.account-button img,
.account-button #account-initial:not(:empty) {
  display: grid;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2c3342;
  object-fit: cover;
  place-items: center;
}
.account-label {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 600;
}
.header-actions {
  margin-left: auto;
}
.volume {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.volume input {
  width: 80px;
  height: auto;
  padding: 0;
  accent-color: var(--mint);
}
.bar.tools .read-only-note {
  margin-left: auto;
}
/* Volume: "音量 80%" above, slider below. */
.volume {
  display: grid;
  gap: 1px;
  justify-items: start;
  line-height: 1.1;
}
#volume-value {
  display: inline-block;
  min-width: 3.2em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.volume input {
  width: 90px;
  height: 14px;
}
/* Some browsers (Arc without a toolbar, installed web apps) turn the top of
   the page into the window's drag area; the header must stay clickable. */
header,
header *,
.bar.tools,
.bar.tools * {
  -webkit-app-region: no-drag;
  app-region: no-drag;
}
/* Zoom sits beside the volume in the transport; the account chip only needs
   its own width reserved, so the first header row fits on one line. */
.bar.top {
  padding-right: 180px;
}
/* Difficulty: "難易度" above, E / N / H below, like volume and zoom. */
.difficulty-pick {
  display: grid;
  gap: 1px;
  justify-items: start;
  line-height: 1.1;
}
.difficulty-pick .hint {
  margin: 0;
  font-size: 10px;
}
#difficulties button {
  height: 20px;
  min-width: 28px;
  font-size: 11px;
}
.zoom-area {
  padding-left: 0;
  border-left: none;
}

/* Track mute / solo like a DAW mixer, on a second line under the name. */
.headers > [data-track] {
  flex-wrap: wrap;
  align-content: center;
  white-space: nowrap;
  row-gap: 4px;
}
.headers .ms {
  display: flex;
  flex-basis: 100%;
  gap: 2px;
}
.headers .ms button {
  width: 20px;
  height: 18px;
  padding: 0;
  color: var(--muted);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
}
.headers [data-mute].on {
  color: var(--bg);
  border-color: var(--danger);
  background: var(--danger);
}
.headers [data-solo].on {
  color: var(--bg);
  border-color: var(--amber);
  background: var(--amber);
}
.headers .silent {
  opacity: 0.45;
}
/* Labels are grid boxes, so the mark is inline text of a block label instead of a child. */
.props > label.required {
  display: block;
}
.props > label.required::after {
  content: " *";
  color: var(--danger);
}
/* Validation messages stay inside the popup; the status bar is hidden behind it. */
.dialog-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 12px;
}
