:root {
  --bg-app: #0d1017;
  --bg-panel: #151a24;
  --bg-card: #1c2230;
  --bg-hover: #242c3d;
  --border: #2a3347;
  --text-main: #eef2f9;
  --text-muted: #8f9bb3;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", "Inter", system-ui, sans-serif; background: var(--bg-app); color: var(--text-main); height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 54px; background: var(--bg-panel); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; gap: 12px; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand-badge { background: linear-gradient(135deg, #3b82f6, #8b5cf6); color: #fff; padding: 4px 9px; border-radius: 6px; font-size: 12px; letter-spacing: 0.4px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.status-pill.connected .status-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
button, .btn { background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border); padding: 7px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s, border-color 0.15s, transform 0.08s; }
button:hover { background: var(--bg-hover); }
button:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.45); color: #fca5a5; }
.btn-danger.active { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-warning { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.45); color: #fcd34d; }
.btn-warning.active { background: var(--warning); border-color: var(--warning); color: #111; }
.btn-sm { padding: 5px 9px; font-size: 12px; }
.workspace { flex: 1; display: grid; grid-template-columns: 280px 1fr 340px; min-height: 0; }
.panel { background: var(--bg-panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.panel:last-child { border-right: none; border-left: 1px solid var(--border); }
.panel-header { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.panel-body { flex: 1; overflow-y: auto; padding: 12px; }
.setlist-toolbar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.setlist-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 11px; margin-bottom: 8px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.setlist-item:hover { background: var(--bg-hover); }
.setlist-item.active { border-color: var(--accent); background: rgba(59, 130, 246, 0.12); }
.setlist-item-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.setlist-item-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 4px; font-weight: 600; flex-shrink: 0; }
.tag-singer { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }
.tag-speaker { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.setlist-item-meta { margin-top: 6px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.item-actions { display: flex; gap: 4px; }
.icon-btn { padding: 3px 6px; font-size: 11px; border-radius: 5px; }
.center-panel { background: var(--bg-app); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: var(--bg-panel); border-bottom: 1px solid var(--border); }
.tab-group { display: flex; gap: 6px; }
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cue-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.cue-card { display: flex; align-items: flex-start; gap: 12px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; cursor: pointer; transition: all 0.12s; }
.cue-card:hover { border-color: #475569; background: var(--bg-card); }
.cue-card.active { border-color: var(--accent); background: rgba(59, 130, 246, 0.16); box-shadow: 0 0 0 1px var(--accent); }
.cue-card.next-up { border-color: rgba(245, 158, 11, 0.5); }
.cue-num { font-size: 12px; font-weight: 700; color: var(--text-muted); background: var(--bg-card); padding: 4px 8px; border-radius: 6px; min-width: 34px; text-align: center; }
.cue-card.active .cue-num { background: var(--accent); color: #fff; }
.cue-text { font-size: 16px; line-height: 1.45; white-space: pre-wrap; flex: 1; }
.transport-bar { padding: 12px 16px; background: var(--bg-panel); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.transport-controls { display: flex; align-items: center; gap: 8px; }
.timer-box { display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border); padding: 5px 10px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.timer-display { font-weight: 700; font-size: 15px; min-width: 52px; }
.editor-view { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.form-row { display: flex; gap: 10px; align-items: center; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
input[type="text"], input[type="number"], select, textarea { width: 100%; min-width: 0; background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; font-family: inherit; font-size: 13px; }
textarea.script-textarea { flex: 1; min-height: 320px; font-size: 15px; line-height: 1.55; resize: vertical; }
.preview-wrapper { padding: 12px; border-bottom: 1px solid var(--border); display: flex; justify-content: center; align-items: center; flex-shrink: 0; }
.preview-stage { width: 100%; max-width: 100%; max-height: 190px; aspect-ratio: 16 / 9; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; position: relative; background-image: linear-gradient(45deg, #1b202c 25%, transparent 25%), linear-gradient(-45deg, #1b202c 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #1b202c 75%), linear-gradient(-45deg, transparent 75%, #1b202c 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.preview-inner { width: 100%; height: 100%; display: flex; flex-direction: column; }
.preview-box { display: inline-block; word-break: break-word; }
.preview-text { white-space: pre-wrap; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="color"] { width: 100%; height: 34px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); cursor: pointer; padding: 2px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-backdrop.open { display: flex; }
.modal-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; width: 480px; max-width: 92vw; padding: 18px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 700; font-size: 16px; }
.link-box { background: var(--bg-card); border: 1px solid var(--border); padding: 10px; border-radius: 8px; font-family: monospace; font-size: 13px; margin-bottom: 8px; word-break: break-all; }
.kbd { background: var(--bg-card); border: 1px solid var(--border); padding: 2px 6px; border-radius: 4px; font-size: 11px; font-family: monospace; }
@media (max-width: 1100px) { .workspace { grid-template-columns: 230px 1fr 290px; } }