/* ── Design tab — intent-level show design viewer ─────────────────────── */

.design-body {
  display: flex;
  height: 100%;
  min-height: 0;
}

/* No global .hidden rule exists — scope one for this tab's toggles. */
.design-empty.hidden,
.design-layout.hidden,
.design-unplaced.hidden {
  display: none;
}

/* Empty state */
.design-empty {
  margin: auto;
  max-width: 440px;
  text-align: center;
  color: var(--muted);
  padding: 48px 24px;
}
.design-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.design-empty-sub {
  font-size: 13px;
  line-height: 1.6;
}
.design-empty-sub em {
  color: var(--text);
}
.design-empty-example {
  display: block;
  margin: 14px auto 0;
  max-width: 420px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--s1);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-style: italic;
  line-height: 1.55;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.design-empty-example:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--s1));
}
.design-empty-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.design-empty-cta {
  margin-top: 18px;
  padding: 12px 26px;
  font-size: 14px;
  font-weight: 600;
}
.design-empty-rignote {
  margin: 18px auto 0;
  max-width: 420px;
  padding: 10px 14px;
  border: 1px solid rgba(251, 191, 36, .35);
  border-radius: 8px;
  background: rgba(251, 191, 36, .07);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.design-empty-rignote.hidden { display: none; }

/* Layout: outline rail + main preview */
.design-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
}
.design-rail {
  width: 280px;
  flex: none;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 10px;
}
.design-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 14px;
  gap: 12px;
}

/* Outline rail */
.design-meta-desc {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 4px;
}
.design-meta-style {
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 8px;
}
.design-act {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 12px 2px 4px;
}
.design-scene {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 6px 4px;
  margin-top: 6px;
}
.design-scene-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.design-scene-mood {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.design-kind {
  flex: none;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1.5px 6px;
  border-radius: 8px;
  background: var(--s2);
  color: var(--muted);
}
.design-kind-dance   { background: rgba(99, 102, 241, 0.22); color: #a5b4fc; }
.design-kind-song    { background: rgba(99, 102, 241, 0.22); color: #a5b4fc; }
.design-kind-mc      { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
.design-kind-scene   { background: rgba(74, 222, 128, 0.15); color: #86efac; }
.design-kind-preshow { background: var(--s2); color: var(--muted); }

.design-moment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px 5px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text);
}
.design-moment:hover {
  background: var(--s2);
}
.design-moment.on {
  background: var(--s3);
  box-shadow: inset 2px 0 0 var(--accent);
}
.design-moment-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.design-moment-time {
  flex: none;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Stage preview — actor's view, downstage/audience at the top */
.design-stage-wrap {
  flex: none;
}
.design-stage-caption {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0 2px 4px;
}
.design-unplaced {
  text-transform: none;
  letter-spacing: normal;
}
.design-stage {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 5 / 3;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.design-stage-zones,
.design-stage-dots {
  position: absolute;
  inset: 0;
}
.design-zone {
  position: absolute;
  border: 1px dashed var(--border);
  border-radius: 4px;
  transition: background 0.3s ease;
}
.design-zone-name {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 9px;
  color: var(--muted);
  opacity: 0.7;
  pointer-events: none;
  white-space: nowrap;
}
.design-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #17171f;
  border: 1px solid var(--border);
  transition: background 0.3s ease;
  cursor: pointer;
}
.design-dot:hover {
  transform: translate(-50%, -50%) scale(1.5);
  border-color: var(--accent);
  z-index: 10;
}
.design-dot.off {
  background: #17171f;
  opacity: 0.55;
}

.design-legend {
  display: flex;
  gap: 18px;
  max-width: 720px;
  padding: 6px 2px 0;
  font-size: 11px;
  color: var(--muted);
}
.design-legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--border);
  vertical-align: -1px;
  margin-right: 4px;
}
.design-legend-dim {
  background: #17171f;
  opacity: 0.55;
}

/* Dot tooltip (appended to <body>) */
.design-tip {
  position: fixed;
  z-index: 4000;
  pointer-events: none;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  max-width: 260px;
}
.design-tip.hidden {
  display: none;
}
.design-tip-name {
  font-weight: 600;
}
.design-tip-sub {
  color: var(--muted);
  font-size: 11px;
  margin-top: 1px;
}
.design-tip-fx {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.design-tip-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* Quick looks (AI chips) */
.design-quick {
  max-width: 720px;
}
.design-quick-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.design-quick-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.design-quick-note {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.design-quick-note.err {
  color: #f87171;
}
.design-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.design-quick-empty {
  font-size: 12px;
  color: var(--muted);
}
.design-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--s1);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.design-chip:hover:not(:disabled) {
  background: var(--s2);
  border-color: var(--accent);
}
.design-chip:disabled {
  opacity: 0.45;
  cursor: default;
}
.design-chip.on {
  background: rgba(99, 102, 241, 0.22);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.design-chip.on::after {
  content: "✓";
  font-size: 10px;
  color: var(--accent);
  margin-left: 2px;
}
.design-chip-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex: none;
}

/* Moment info card */
.design-moment-card {
  max-width: 720px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.design-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.design-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.design-card-pos {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.design-card-trigger {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.design-card-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--s2);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 8px 10px;
  margin-top: 10px;
}
.design-card-elements {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.design-card-el {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text);
}
.design-swatch {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.design-el-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.design-el-count.zero {
  color: #f87171;
}
.design-card-blackout {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Element editor rows */
.design-el-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
}
.design-el-row:hover {
  background: var(--s2);
}
.design-el-row.sel {
  background: var(--s2);
  box-shadow: inset 2px 0 0 var(--accent);
}
.design-el-color {
  flex: none;
  width: 26px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}
.design-el-color::-webkit-color-swatch-wrapper {
  padding: 2px;
}
.design-el-color::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
}
.design-el-text {
  min-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.design-el-slider {
  flex: 1;
  min-width: 70px;
  max-width: 160px;
  accent-color: var(--accent);
}
.design-el-pct {
  flex: none;
  width: 38px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.design-el-btn {
  flex: none;
  width: 24px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--s1);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}
.design-el-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.design-el-btn.arming {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.design-el-del:hover {
  border-color: #f87171;
  color: #f87171;
}
.design-el-add {
  align-self: flex-start;
  margin-top: 4px;
  padding: 4px 10px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.design-el-add:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* Stage + right-side selection controls */
.design-stage-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
  max-width: 900px;
}
.design-stage-wrap {
  flex: 1;
  min-width: 0;
}
.design-stage-controls {
  flex: none;
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 8px 8px;
}
.design-group-sel {
  width: 100%;
  max-width: 134px;
  font-size: 11px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--s1);
  color: var(--text);
}
.design-sel-hint {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
  min-height: 32px;
}
.design-wheel {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  cursor: crosshair;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle closest-side, #ffffff 0%, rgba(255, 255, 255, 0) 72%),
    conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  touch-action: none;
}
.design-wheel-knob {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%);
  pointer-events: none;
  left: 50%;
  top: 50%;
}
/* Submaster-style vertical fader */
.design-fader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.design-fader {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 30px;
  height: 170px;
  background: transparent;
  cursor: pointer;
}
.design-fader::-webkit-slider-runnable-track {
  width: 8px;
  border-radius: 4px;
  background: linear-gradient(to top, var(--accent), var(--s3) 85%);
  border: 1px solid var(--border);
}
.design-fader::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 16px;
  margin-left: -12px;
  border-radius: 3px;
  background: linear-gradient(#3a3a5e, #23233c);
  border: 1px solid var(--border);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.25), 0 2px 5px rgba(0, 0, 0, 0.5);
}
.design-fader::-moz-range-thumb {
  width: 30px;
  height: 16px;
  border-radius: 3px;
  background: #2c2c48;
  border: 1px solid var(--border);
}
.design-fader-pct {
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.design-fader-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Live selection on the stage */
.design-sel-overlay {
  position: absolute;
  border: 1.5px dashed #f1f1fb;
  border-radius: 4px;
  background: rgba(241, 241, 251, 0.06);
  pointer-events: none;
  z-index: 4;
}
.design-dot.sel {
  box-shadow: 0 0 0 2.5px rgba(241, 241, 251, 0.85);
}

/* Stage area picking */
.design-stage.picking {
  cursor: crosshair;
  border-color: var(--accent);
}
.design-marquee {
  position: absolute;
  border: 1.5px dashed var(--accent);
  background: rgba(99, 102, 241, 0.12);
  pointer-events: none;
  z-index: 5;
}
.design-area-overlay {
  position: absolute;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.08);
  pointer-events: none;
}

/* Toolbar note */
.design-preview-note {
  color: var(--muted);
  font-size: 11.5px;
}

/* Compile progress (toolbar) */
.design-compile-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.design-compile-status.hidden {
  display: none;
}
.design-compile-bar {
  width: 110px;
  height: 6px;
  border-radius: 3px;
  background: var(--s2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.design-compile-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}
.design-compile-text {
  font-size: 11px;
  color: var(--muted);
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.design-compile-status.err .design-compile-text {
  color: #f87171;
}
