/* Workspace styles for /suggest-routine-sequence/ and /calibrate-routine-sync/ */

.re-workspace {
  margin: 20px 0 28px;
}

.re-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.re-tabs {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  gap: 4px;
}

.re-tab-btn {
  padding: 7px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.re-tab-btn.is-active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.re-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
}

.re-btn:hover,
.re-btn:focus {
  background: #f8fafc;
  border-color: #94a3b8;
}

.re-btn--primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.re-btn--primary:hover,
.re-btn--primary:focus {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.re-btn--teal {
  background: #0d9488;
  border-color: #0d9488;
  color: #ffffff;
}

.re-btn--teal:hover,
.re-btn--teal:focus {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

.re-btn--danger {
  color: #dc2626;
  border-color: #fecaca;
}

.re-btn--danger:hover,
.re-btn--danger:focus {
  background: #fef2f2;
  border-color: #f87171;
}

.re-btn--sm {
  padding: 3px 8px;
  font-size: 0.76rem;
}

.re-section-card {
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.re-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.re-section-fields {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1 1 320px;
}

.re-mini-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.re-mini-field label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
  margin: 0;
}

.re-input {
  padding: 6px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 0.86rem;
  background: #ffffff;
  color: #1e293b;
  box-sizing: border-box;
}

.re-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.re-bars-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.re-bar-row {
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
}

.re-bar-row--phrase-end {
  border-bottom: 3px solid #93c5fd;
  margin-bottom: 4px;
}

.re-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.re-bar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e3a8a;
  font-variant-numeric: tabular-nums;
}

.re-bar-controls {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: #475569;
}

.re-move-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(160px, 1fr);
  gap: 8px;
  align-items: start;
}

@media (max-width: 640px) {
  .re-move-grid {
    grid-template-columns: 1fr;
  }
}

.re-splits-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.re-split-row {
  display: grid;
  grid-template-columns: 74px minmax(150px, 1.2fr) minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
}

@media (max-width: 680px) {
  .re-split-row {
    grid-template-columns: 1fr;
  }
}

.re-link-hint {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.73rem;
  color: #059669;
  font-weight: 600;
}

.re-warn-hint {
  margin-top: 6px;
  padding: 5px 8px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 600;
}

.re-yaml-editor {
  width: 100%;
  min-height: 320px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 8px;
  box-sizing: border-box;
  resize: vertical;
}

.re-preview-box {
  margin: 22px 0;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

.re-preview-box__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

/* Calibrator (/calibrate-routine-sync/) specific styles */

.rc-player-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
  margin: 16px 0 20px;
}

@media (max-width: 820px) {
  .rc-player-grid {
    grid-template-columns: 1fr;
  }
}

.rc-video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: 8px;
  overflow: hidden;
}

.rc-video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.rc-recorder-card {
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.rc-next-prompt {
  height: 22px;
  line-height: 22px;
  font-size: 0.85rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-tap-btn {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  margin: 8px 0;
  background: #2563eb;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: transform 0.06s ease, background-color 0.15s ease;
}

.rc-tap-btn:hover,
.rc-tap-btn:focus {
  background: #1d4ed8;
}

.rc-tap-btn:active {
  transform: scale(0.985);
}

.rc-fit-box {
  height: 54px;
  overflow-y: auto;
  box-sizing: border-box;
  margin-top: 10px;
  padding: 8px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #1e3a8a;
}

.rc-taps-list {
  height: 112px;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  margin-top: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

.rc-taps-empty {
  padding: 14px 10px;
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
}

.rc-tap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.rc-tap-label {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-karaoke-preview-box {
  --karaoke-max-height: 36vh;
  margin: 14px 0 20px;
}

.rc-karaoke-preview-box .routine-viz {
  margin: 6px 0 0;
}

.rc-tap-row:last-child {
  border-bottom: 0;
}

.rc-sections-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
}
