* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: oklch(0.15 0.004 260);
  color: oklch(0.96 0.003 260);
}
#app {
  height: 100vh; width: 100vw; overflow: hidden;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
#app input, #app textarea, #app select {
  user-select: text; -webkit-user-select: text; -webkit-touch-callout: default;
}
button, input, select { font-family: inherit; }
button { -webkit-tap-highlight-color: transparent; }

input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; height: 16px; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { -webkit-appearance: none; height: 4px; background: #545a66; border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #f2f2f4; border: none; margin-top: -6px; cursor: pointer; }
input[type="range"]::-moz-range-track { height: 4px; background: #545a66; border-radius: 2px; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #f2f2f4; border: none; cursor: pointer; }

/* ---------- Show list ---------- */
.its-root { height: 100%; display: flex; flex-direction: column; }
.its-list { height: 100%; display: flex; flex-direction: column; }
.its-list-header { padding: 28px 32px 16px; display: flex; align-items: center; justify-content: space-between; }
.its-title { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.its-subtitle { font-size: 12px; color: oklch(0.62 0.01 260); }
.its-list-body { flex: 1; overflow-y: auto; padding: 8px 32px 32px; display: flex; flex-direction: column; gap: 14px; }

.its-create-form { background: oklch(0.19 0.004 260); border: 1px solid oklch(0.32 0.006 260); border-radius: 14px; padding: 20px; display: flex; gap: 12px; align-items: center; }
.its-input { flex: 1; background: oklch(0.23 0.004 260); border: 1px solid oklch(0.32 0.006 260); border-radius: 8px; padding: 12px 14px; color: oklch(0.96 0.003 260); font-size: 15px; outline: none; }
.its-btn-primary { background: oklch(0.78 0.19 145); color: oklch(0.15 0.05 145); border: none; border-radius: 8px; padding: 12px 20px; font-size: 15px; font-weight: 700; cursor: pointer; }
.its-btn-ghost { background: transparent; color: oklch(0.62 0.01 260); border: 1px solid oklch(0.32 0.006 260); border-radius: 8px; padding: 12px 16px; font-size: 14px; cursor: pointer; }

.its-new-show-btn { background: oklch(0.19 0.004 260); border: 1px dashed oklch(0.38 0.006 260); border-radius: 14px; padding: 22px; color: oklch(0.78 0.19 145); font-size: 15px; font-weight: 700; cursor: pointer; text-align: left; width: 100%; }
.its-empty { color: oklch(0.62 0.01 260); font-size: 14px; padding: 24px 4px; }

.its-show-card { background: oklch(0.19 0.004 260); border: 1px solid oklch(0.32 0.006 260); border-radius: 14px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.its-show-name { font-size: 17px; font-weight: 700; }
.its-show-summary { font-size: 12px; color: oklch(0.62 0.01 260); margin-top: 4px; }
.its-show-actions { display: flex; align-items: center; gap: 16px; }
.its-badge-open { background: oklch(0.78 0.19 145); color: oklch(0.15 0.05 145); border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 700; }
.its-btn-delete { background: transparent; border: none; color: oklch(0.55 0.01 260); font-size: 18px; cursor: pointer; }

/* ---------- Editor ---------- */
.its-editor { height: 100%; display: flex; flex-direction: row; position: relative; }

.its-dim-rail { width: 70px; height: 100%; flex: 0 0 auto; background: oklch(0.12 0.004 260); border-right: 1px solid oklch(0.28 0.006 260); display: flex; flex-direction: column; align-items: center; padding: 18px 0; }
.its-dim-label { font-size: 10px; letter-spacing: 0.1em; color: oklch(0.62 0.01 260); }
.its-dim-slider-wrap { flex: 1; position: relative; width: 100%; }
.its-dim-pct { font-size: 12px; font-weight: 700; color: oklch(0.85 0.005 260); }

.its-main-col { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.its-editor-header { padding: 14px 24px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid oklch(0.28 0.006 260); }
.its-back-btn { background: transparent; border: none; color: oklch(0.62 0.01 260); font-size: 14px; cursor: pointer; }
.its-show-name-input { flex: 1; background: transparent; border: none; color: oklch(0.96 0.003 260); font-size: 19px; font-weight: 700; outline: none; min-width: 0; }
.its-play-toggle { border: none; border-radius: 8px; padding: 10px 18px; font-size: 14px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.its-stopall-btn { background: oklch(0.70 0.19 25); color: white; border: none; border-radius: 8px; padding: 10px 16px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.its-mode-group { display: flex; background: oklch(0.23 0.004 260); border: 1px solid oklch(0.32 0.006 260); border-radius: 8px; padding: 3px; }
.its-mode-btn { background: transparent; color: oklch(0.75 0.01 260); border: none; border-radius: 6px; padding: 7px 12px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.its-mode-btn.active { background: oklch(0.78 0.19 145); color: oklch(0.15 0.05 145); }

.its-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.its-playlist-panel { flex: 0 0 48%; min-height: 220px; overflow-y: auto; padding: 16px 24px; border-bottom: 1px solid oklch(0.28 0.006 260); }
.its-panel-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.its-panel-label { font-size: 13px; font-weight: 700; color: oklch(0.62 0.01 260); letter-spacing: 0.04em; }
.its-panel-actions { display: flex; gap: 8px; }
.its-pill-btn { background: oklch(0.23 0.004 260); border: 1px solid oklch(0.32 0.006 260); color: oklch(0.96 0.003 260); border-radius: 8px; padding: 8px 12px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.its-helper-caption { font-size: 11px; color: oklch(0.5 0.01 260); margin-bottom: 10px; }
.its-empty-small { color: oklch(0.55 0.01 260); font-size: 13px; padding: 16px 4px; }

.its-track-row { padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; background: oklch(0.185 0.004 260); border: 1px solid oklch(0.28 0.006 260); }
.its-track-row.active { background: oklch(0.24 0.03 145); border: 1px solid oklch(0.5 0.15 145); }
.its-track-row.armed { box-shadow: inset 0 0 0 2px oklch(0.65 0.15 230); }
.its-track-line1 { display: flex; align-items: center; gap: 10px; }
.its-track-index { width: 16px; font-size: 11px; color: oklch(0.5 0.01 260); flex: 0 0 auto; }
.its-reorder-col { display: flex; flex-direction: column; gap: 3px; flex: 0 0 auto; }
.its-reorder-btn {
  width: 30px; height: 24px; padding: 0; font-size: 11px; line-height: 1;
  background: oklch(0.23 0.004 260); border: 1px solid oklch(0.32 0.006 260); border-radius: 6px;
  color: oklch(0.85 0.005 260); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.its-reorder-btn:disabled { opacity: 0.25; cursor: default; }
.its-track-name { flex: 1; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; cursor: pointer; }
.its-mode-badge { font-size: 11px; font-weight: 700; padding: 5px 9px; border-radius: 6px; cursor: pointer; background: oklch(0.23 0.004 260); border: 1px solid oklch(0.32 0.006 260); color: oklch(0.85 0.005 260); white-space: nowrap; }
.its-track-volume { width: 90px; }
.its-btn-remove { background: transparent; border: none; color: oklch(0.55 0.01 260); font-size: 15px; cursor: pointer; }
.its-track-line2 { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.its-transport-btn { font-size: 11px; font-weight: 600; padding: 5px 9px; border-radius: 6px; cursor: pointer; background: oklch(0.23 0.004 260); border: 1px solid oklch(0.32 0.006 260); color: oklch(0.85 0.005 260); white-space: nowrap; }
.its-transport-btn.active { background: oklch(0.3 0.03 145); }
.its-time-label { font-size: 11px; color: oklch(0.6 0.01 260); width: 44px; }
.its-time-label.right { width: 48px; text-align: right; }
.its-seek { flex: 1; }

.its-grid-panel { flex: 1; overflow-y: auto; padding: 16px 24px; }
.its-grid-steppers { display: flex; align-items: center; gap: 10px; font-size: 12px; color: oklch(0.62 0.01 260); }
.its-num-input { width: 44px; background: oklch(0.23 0.004 260); border: 1px solid oklch(0.32 0.006 260); border-radius: 6px; padding: 5px; color: oklch(0.96 0.003 260); }
.its-grid { display: grid; gap: 10px; }
.its-pad { border-radius: 10px; padding: 14px 12px; min-height: 76px; min-width: 0; display: flex; flex-direction: column; justify-content: center; cursor: default; transition: box-shadow 120ms, border 120ms; overflow: hidden; }
.its-pad.filled { cursor: pointer; }
.its-pad-label { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.its-pad-subtitle { font-size: 10px; opacity: 0.75; margin-top: 4px; }
.its-pad.show-mode { border-radius: 12px; padding: 18px 14px; min-height: 92px; cursor: pointer; }
.its-pad.show-mode.active { border: 3px solid white; box-shadow: 0 0 0 4px rgba(255,255,255,0.15); }

/* ---------- Drawer ---------- */
.its-drawer-scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.55); display: flex; justify-content: flex-end; z-index: 20; }
.its-drawer { width: 360px; max-width: 90vw; height: 100%; background: oklch(0.17 0.004 260); border-left: 1px solid oklch(0.32 0.006 260); padding: 22px; overflow-y: auto; }
.its-drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.its-drawer-title { font-size: 15px; font-weight: 800; }
.its-drawer-close { background: transparent; border: none; color: oklch(0.62 0.01 260); font-size: 18px; cursor: pointer; }
.its-field-label { font-size: 11px; color: oklch(0.62 0.01 260); margin-bottom: 6px; }
.its-field-input { width: 100%; background: oklch(0.23 0.004 260); border: 1px solid oklch(0.32 0.006 260); border-radius: 8px; padding: 10px 12px; color: oklch(0.96 0.003 260); font-size: 14px; outline: none; margin-bottom: 16px; }
.its-select { width: 100%; background: oklch(0.23 0.004 260); border: 1px solid oklch(0.32 0.006 260); border-radius: 8px; padding: 10px 12px; color: oklch(0.96 0.003 260); font-size: 14px; margin-bottom: 8px; }
.its-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.its-swatch { width: 34px; height: 34px; border-radius: 8px; cursor: pointer; border: 1px solid rgba(0,0,0,0.3); }
.its-swatch.active { border: 3px solid white; }
.its-toggle-row { display: flex; gap: 8px; margin-bottom: 16px; }
.its-toggle-btn { flex: 1; background: oklch(0.23 0.004 260); color: oklch(0.85 0.005 260); border: 1px solid oklch(0.32 0.006 260); border-radius: 8px; padding: 10px; font-size: 13px; font-weight: 700; cursor: pointer; text-align: left; }
.its-toggle-btn.active { background: oklch(0.78 0.19 145); color: oklch(0.15 0.05 145); }
.its-toggle-col { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.its-toggle-col .its-toggle-btn { flex: none; }
.its-range-full { width: 100%; margin-bottom: 16px; }
.its-two-col { display: flex; gap: 12px; margin-bottom: 18px; }
.its-two-col > div { flex: 1; }
.its-num-full { width: 100%; background: oklch(0.23 0.004 260); border: 1px solid oklch(0.32 0.006 260); border-radius: 8px; padding: 8px 10px; color: oklch(0.96 0.003 260); }
.its-clear-btn { width: 100%; background: transparent; border: 1px solid oklch(0.70 0.19 25); color: oklch(0.70 0.19 25); border-radius: 8px; padding: 11px; font-size: 13px; font-weight: 700; cursor: pointer; margin-bottom: 22px; }

/* ---------- Update available badge ---------- */
.its-update-badge {
  position: fixed; bottom: 20px; right: 20px; z-index: 50;
  background: oklch(0.78 0.19 145); color: oklch(0.15 0.05 145);
  border: none; border-radius: 999px; padding: 12px 18px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
