* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
#app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
body {
  font-family: sans-serif;
  font-size: 14px;
  padding: 8px;
  background: #f5f5f5;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panels {
  display: flex;
  flex-wrap: wrap;
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  margin-bottom: 6px;
  overflow: visible;
  flex-shrink: 0;
}
.panel {
  flex: 1;
}
.panel + .panel {
  border-left: 1px solid #e0e0e0;
}
.panel-head {
  padding: 6px 12px;
  cursor: pointer;
  font-weight: bold;
  background: #f8f8f8;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.panel-head:hover {
  background: #f0f0f0;
}
.panel-body {
  flex-basis: 100%;
  padding: 12px 14px;
  border-top: 1px solid #e0e0e0;
}
.panel-body.closed {
  display: none;
}
.sum {
  font-weight: normal;
  color: #555;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.tab {
  padding: 4px 14px;
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
  border-radius: 3px;
  font-size: 14px;
}
.tab.active {
  background: #333;
  color: white;
  border-color: #333;
}
input[type=text],
input[type=url],
input[type=file] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
  margin-bottom: 8px;
}
.tower-wrap {
  position: relative;
}
#dropdown {
  position: absolute;
  width: 100%;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
  border-radius: 0 0 3px 3px;
}
.opt {
  padding: 6px 8px;
  cursor: pointer;
}
.opt:hover {
  background: #f0f0f0;
}
.clip-item {
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 3px;
  margin-bottom: 2px;
}
.clip-item:hover {
  background: #f0f0f0;
}
.label {
  font-weight: bold;
  margin-bottom: 6px;
}
.bell {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}
.clip-audio {
  width: 100%;
  display: block;
  margin-bottom: 4px;
  height: 36px;
}
#annot-area {
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  padding: 10px 12px 6px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
#annot-area:empty {
  display: none;
}
.clip-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.clip-title {
  font-weight: bold;
}
.bells-label {
  font-size: 12px;
  color: #666;
}
.strike-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.strike-btn {
  padding: 5px 10px;
  background: #4a7fc1;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 0;
}
.strike-btn:active {
  background: #2a5fa1;
}
.strike-wrap {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.heatmap-pane {
  position: relative;
  width: 50%;
  flex-shrink: 0;
  cursor: crosshair;
}
.time-col {
  position: relative;
  width: 28px;
  flex-shrink: 0;
  background: #080810;
  cursor: pointer;
}
.time-tick {
  position: absolute;
  left: 0;
  right: 0;
  font-size: 8px;
  color: rgba(100,130,200,0.6);
  text-align: center;
  transform: translateY(-50%);
  pointer-events: none;
  border-top: 1px solid rgba(100,130,200,0.2);
}
/* Onset / bootstrap page */
.onset-wrap {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.drag-line {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,100,100,0.9);
  transform: translateY(-50%);
  z-index: 4;
  pointer-events: none;
}
.first-strike-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,220,50,0.8);
  transform: translateY(-50%);
  z-index: 3;
  pointer-events: none;
}
.mark-btn {
  padding: 2px 8px;
  font-size: 12px;
  background: #443820;
  color: #ffd832;
  border-radius: 3px;
  white-space: nowrap;
}
.onset-markers {
  position: relative;
  width: 36px;
  flex-shrink: 0;
  background: #0a0a14;
  cursor: crosshair;
}
.gap-marker {
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px;
  font-size: 9px;
  cursor: ns-resize;
  border-top: 2px solid;
  box-sizing: border-box;
}
.gap-marker.back-gap {
  border-color: rgba(120,180,255,0.8);
  color: rgba(120,180,255,0.9);
}
.gap-marker.hand-gap {
  border-color: rgba(255,200,50,0.9);
  color: rgba(255,200,50,0.9);
}
.gap-del {
  cursor: pointer;
  opacity: 0.5;
  font-size: 10px;
  line-height: 1;
}
.gap-del:hover {
  opacity: 1;
}
.onset-pills {
  position: relative;
  width: 28px;
  flex-shrink: 0;
  background: #080810;
}
.onset-pill {
  position: absolute;
  left: 1px;
  right: 1px;
  height: 10px;
  border-radius: 3px;
  font-size: 8px;
  color: #000;
  text-align: center;
  line-height: 10px;
  transform: translateY(-50%);
}
.onset-pill.onset-unknown {
  background: #444 !important;
  color: #888;
}
.onset-pill.strike-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  text-align: left;
  color: #000;
}
.row-label {
  position: absolute;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  z-index: 1;
  pointer-events: all;
}
.row-label-text {
  font-size: 9px;
  color: #557;
  background: #0a0a14;
  padding: 1px 2px;
  white-space: nowrap;
  text-align: center;
  width: 100%;
  cursor: default;
}
.row-actions {
  display: none;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: #1a1a2e;
  padding: 3px;
  border-radius: 3px;
}
.row-label:hover .row-actions {
  display: flex;
}
.row-action {
  font-size: 10px;
  padding: 2px 6px;
  margin: 0;
  background: #334;
  color: #aac;
  border-radius: 2px;
  white-space: nowrap;
}
.row-action:hover {
  background: #446;
  color: #ccf;
}
.save-bootstrap {
  flex-shrink: 0;
  margin: 6px 0;
  padding: 4px 12px;
}
.audio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.params-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #0a0a16;
  flex-shrink: 0;
}
.param-label {
  font-size: 10px;
  color: #667;
  margin-left: 6px;
}
.param-input {
  width: 38px;
  padding: 1px 3px;
  font-size: 11px;
  text-align: center;
}
.search-btn {
  padding: 2px 8px;
  font-size: 12px;
  background: #1a2535;
  color: #6ab0f0;
  border-radius: 3px;
  flex-shrink: 0;
}
.fit-btn {
  padding: 2px 8px;
  font-size: 12px;
  background: #253520;
  color: #90e060;
  border-radius: 3px;
  flex-shrink: 0;
}
.bell-area {
  display: flex;
  flex-direction: column;
}
.bell-header-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: row;
  background: #0e0e1a;
}
.bell-pane {
  display: flex;
  flex-direction: row;
}
.bell-col {
  display: flex;
  flex-direction: column;
  border-left: 1px solid #222;
}
.bell-col-head {
  font-size: 9px;
  color: #aaa;
  text-align: center;
  padding: 2px 1px;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}
.bell-cv {
  display: block;
  width: 100%;
}
.time-display {
  font-size: 12px;
  font-family: monospace;
  color: #999;
  white-space: nowrap;
  margin-left: auto;
}
.rate-btn {
  padding: 2px 4px;
  font-size: 12px;
  background: #334;
  color: #ccc;
  border: 1px solid #556;
  border-radius: 3px;
}
.heatmap {
  display: block;
  width: 100%;
}
#cursor-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 0 4px rgba(255,255,255,0.6);
  pointer-events: none;
  z-index: 2;
  transform: translateY(-50%);
}
#strike-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.strike-pill {
  position: absolute;
  pointer-events: all;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: sans-serif;
  white-space: nowrap;
  user-select: none;
  transform: translateY(-50%);
}
.pill-del {
  cursor: pointer;
  color: #aaa;
  font-size: 10px;
  line-height: 1;
}
.pill-del:hover {
  color: #c00;
}
button:not(.tab) {
  padding: 4px 16px;
  background: #333;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  margin-top: 4px;
  font-size: 13px;
  flex-shrink: 0;
}
