/* HomeStar XL configurator.
   The visual language is borrowed from the rack, not from the web: dark
   brushed-slate panels, tally lights that mean what they mean in a gallery,
   and monospaced digits everywhere a number could be misread. */

:root {
  --bg: #10131a;
  --panel: #171b24;
  --panel-2: #1e2430;
  --panel-3: #252c3a;
  --line: #2b3342;
  --line-soft: #222835;
  --ink: #dbe3f0;
  --dim: #8792a6;
  --dimmer: #5f6b80;
  --tally: #ff3b30;
  --amber: #ffb020;
  --cyan: #34c9e8;
  --green: #2fd07a;
  --focus: #4c7fff;

  --mono: ui-monospace, "SF Mono", "DejaVu Sans Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r: 4px;
  --r-lg: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
}

body.dragging-h { cursor: ew-resize; user-select: none; }

#app { min-height: 100%; display: flex; flex-direction: column; }

.booting, .fatal {
  margin: auto;
  padding: 60px;
  color: var(--dim);
  text-align: center;
}
.fatal h1 { color: var(--ink); font-size: 20px; }

.mono, .timecode { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ header */

.header {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 52px;
  padding: 0 16px;
  background: linear-gradient(180deg, #1a202b, #141821);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}
.brand-xl { color: var(--amber); }

.nav { display: flex; gap: 2px; }
.navbtn {
  background: transparent;
  border: 0;
  color: var(--dim);
  font: 600 12px/1 var(--ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 9px 14px;
  border-radius: var(--r);
  cursor: pointer;
}
.navbtn:hover { color: var(--ink); background: var(--panel-2); }
.navbtn.active { color: #0d1119; background: var(--amber); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.chips { display: flex; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 11px/1 var(--ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip .dot, .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--dimmer);
  flex: none;
}
.chip-ok .dot, .dot-good { background: var(--green); box-shadow: 0 0 8px rgba(47, 208, 122, 0.6); }
.chip-bad .dot, .dot-bad { background: var(--tally); box-shadow: 0 0 8px rgba(255, 59, 48, 0.6); }
.chip-live .dot { background: var(--tally); box-shadow: 0 0 10px rgba(255, 59, 48, 0.8); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.savechip {
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dimmer);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 5px 8px;
}
.savechip.dirty { color: var(--amber); border-color: rgba(255, 176, 32, 0.4); }
.savechip.saving { color: var(--cyan); border-color: rgba(52, 201, 232, 0.4); }

/* ------------------------------------------------------------------ layout */

.layout { flex: 1; display: flex; min-height: 0; }

.rail {
  width: 250px;
  flex: none;
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow-y: auto;
  padding-bottom: 24px;
}

.rail-head, .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--line-soft);
}
.rail-head h3, .panel-head h3 {
  margin: 0;
  font: 700 11px/1 var(--ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.railitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.railitem:hover { background: var(--panel-2); }
.railitem.selected { background: var(--panel-3); box-shadow: inset 3px 0 0 var(--amber); }
.railitem.off { opacity: 0.5; }
.railitem-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.railitem-number { font-size: 11px; color: var(--amber); letter-spacing: 0.05em; }
.railitem-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.railitem-sub { font-size: 11px; color: var(--dimmer); }
.railitem .btn-icon { opacity: 0; }
.railitem:hover .btn-icon { opacity: 1; }

.tally {
  width: 9px; height: 9px; border-radius: 50%;
  flex: none;
  background: #333a48;
  border: 1px solid #454e60;
}
.tally.live { background: var(--tally); border-color: #ff6b63; box-shadow: 0 0 10px rgba(255, 59, 48, 0.7); }
.tally.fault { background: var(--amber); border-color: #ffc75a; box-shadow: 0 0 10px rgba(255, 176, 32, 0.6); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; }

/* ----------------------------------------------------------------- preview */

.stage-wrap { padding: 16px 16px 0; }

.preview-stage {
  position: relative;
  background: #05070b;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.preview-canvas { display: block; width: 100%; height: auto; }

.preview-tally {
  position: absolute;
  top: 8px; left: 8px;
  display: flex; align-items: center; gap: 6px;
  background: rgba(5, 7, 11, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 4px 8px;
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.14em;
  color: var(--dim);
}
.tally-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

.transport {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 900px;
  margin: 10px auto 0;
}
.transport-clock { display: flex; gap: 6px; align-items: baseline; font-size: 12px; }
.transport-clock .dim { color: var(--dimmer); }

.scrub {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--panel-3);
  outline: none;
}
.scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--amber);
  border: 0;
  cursor: pointer;
}
.scrub::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--amber); cursor: pointer; }

.live-compare { position: relative; }
.live-frame { width: 160px; display: block; border: 1px solid var(--line); border-radius: var(--r); }
.live-label {
  position: absolute; top: 3px; left: 3px; z-index: 2;
  font: 700 9px/1 var(--mono); letter-spacing: 0.12em;
  background: rgba(5, 7, 11, 0.8); color: var(--tally);
  padding: 3px 5px; border-radius: 2px;
}

/* ----------------------------------------------------------------- rundown */

.rundown {
  margin: 18px 16px 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 10px 12px 14px;
}
.rundown-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px;
}
.rundown-title {
  font: 700 11px/1 var(--ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.rundown-total { font-size: 12px; color: var(--amber); }

.rundown-ruler { position: relative; height: 13px; }
.rundown-ruler .tick { position: absolute; top: 0; width: 1px; height: 5px; background: var(--line); }
.tick-label {
  position: absolute; top: 6px; left: 0;
  font: 9px/1 var(--mono);
  color: var(--dimmer);
  transform: translateX(-50%);
}

.rundown-body { position: relative; }
.rundown-track {
  position: relative;
  height: 58px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
  cursor: crosshair;
}
.rundown-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--dimmer); font-size: 12px;
}

.rundown-block {
  position: absolute;
  top: 0; bottom: 0;
  background: linear-gradient(180deg, #2a3446, #212938);
  border-right: 1px solid var(--bg);
  overflow: hidden;
  cursor: pointer;
}
.rundown-block:hover { background: linear-gradient(180deg, #33405a, #263043); }
.rundown-block.selected {
  background: linear-gradient(180deg, #3d4d6b, #2b3648);
  box-shadow: inset 0 2px 0 var(--amber);
}

/* The wedge shows how much of the block the incoming transition consumes. */
.rundown-wedge {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(52, 201, 232, 0.20) 0 5px,
    rgba(52, 201, 232, 0.05) 5px 10px
  );
  border-right: 1px solid rgba(52, 201, 232, 0.45);
  pointer-events: none;
}

.rundown-block-inner {
  position: relative;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
}
.rundown-block-name {
  font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rundown-block-time { font-size: 11px; color: var(--dim); }

.rundown-handle {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 7px;
  cursor: ew-resize;
  background: linear-gradient(90deg, transparent, rgba(255, 176, 32, 0.25));
}
.rundown-handle:hover { background: var(--amber); }

.rundown-playhead {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--tally);
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.8);
  pointer-events: none;
}

/* --------------------------------------------------------------- workspace */

.workspace { margin: 16px; flex: 1; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font: 600 12px/1 var(--ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 14px;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--amber); border-bottom-color: var(--amber); }

.workspace-body { padding-top: 14px; }

.slides-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 16px;
  align-items: start;
}

.slide-list, .slide-editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.slide-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.slide-row:hover { background: var(--panel-2); }
.slide-row.selected { background: var(--panel-3); box-shadow: inset 3px 0 0 var(--amber); }
.slide-row.off { opacity: 0.45; }
.slide-index { font-size: 11px; color: var(--dimmer); }
.slide-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slide-row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slide-row-sub { font-size: 11px; color: var(--dimmer); }
.slide-row-actions { display: flex; gap: 1px; opacity: 0; }
.slide-row:hover .slide-row-actions, .slide-row.selected .slide-row-actions { opacity: 1; }

.editor-scroll { padding: 14px; max-height: calc(100vh - 220px); overflow-y: auto; }
.editor-scroll.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0 24px;
  align-items: start;
}

.section { margin-bottom: 22px; }
.section-title {
  margin: 0 0 10px;
  font: 700 10px/1 var(--ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.section-body { display: flex; flex-direction: column; gap: 12px; }

/* ------------------------------------------------------------------ fields */

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 12px;
  color: var(--dim);
  font-weight: 600;
}
.field-bool { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }

.help { margin: 0; font-size: 11px; color: var(--dimmer); line-height: 1.45; }
.help.top { margin-bottom: 14px; }
.empty { color: var(--dimmer); padding: 24px; text-align: center; }

.input {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  padding: 7px 9px;
  font: 13px/1.3 var(--ui);
  width: 100%;
  min-width: 0;
}
.input.mono { font-family: var(--mono); font-size: 12px; }
.input.compact { width: auto; padding: 5px 7px; font-size: 12px; }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 2px rgba(76, 127, 255, 0.18); }
.input[readonly] { color: var(--dim); }
select.input { cursor: pointer; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--dim); cursor: pointer; }
.check input { accent-color: var(--amber); width: 15px; height: 15px; }

.color-field { display: flex; gap: 7px; align-items: center; }
.swatch {
  width: 32px; height: 30px; padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel-2);
  cursor: pointer;
  flex: none;
}
.color-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }

.binding-field { display: flex; flex-direction: column; gap: 4px; }
.binding-preview {
  display: flex; gap: 6px; align-items: baseline;
  font: 11px/1.4 var(--mono);
  color: var(--green);
  min-height: 16px;
  padding-left: 2px;
}
.binding-arrow { color: var(--dimmer); }
.binding-result { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.binding-result.binding-error { color: var(--tally); }

.list-field { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 8px 10px 10px;
}
.list-item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.list-index { font-size: 10px; color: var(--dimmer); letter-spacing: 0.08em; }
.list-item-actions { display: flex; gap: 1px; }
.list-item-fields { display: flex; flex-direction: column; gap: 9px; }
.add-row { align-self: flex-start; }

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  font: 600 12px/1 var(--ui);
  padding: 8px 12px;
  cursor: pointer;
}
.btn:hover:not(:disabled) { background: #2f3849; border-color: #3a4457; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--amber); border-color: var(--amber); color: #16110a; }
.btn-primary:hover:not(:disabled) { background: #ffc14d; border-color: #ffc14d; }
.btn-danger { background: var(--tally); border-color: var(--tally); color: #fff; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--dim); }
.btn-quiet:hover:not(:disabled) { background: var(--panel-3); color: var(--ink); }
.btn-quiet.danger:hover:not(:disabled) { color: var(--tally); }
.btn-icon { padding: 6px; }
.btn.wide { width: 100%; justify-content: center; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- settings */

.settings, .system { padding: 18px; }
.settings-grid, .system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0 28px;
  align-items: start;
  max-width: 1400px;
}

.status-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); margin-bottom: 12px; }
.test-result { font-size: 12px; color: var(--dim); }
.test-result.ok { color: var(--green); }
.test-result.bad { color: var(--tally); }

/* ------------------------------------------------------------------ system */

.airlist { display: flex; flex-direction: column; gap: 1px; }
.airrow {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.airrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.airrow-name { font-weight: 600; }
.airrow-sub { font-size: 11px; color: var(--dimmer); }
.airrow-error { color: var(--amber); display: flex; }

.kv { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.kv-label { color: var(--dim); }
.kv-value { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.urlrow { display: flex; align-items: center; gap: 7px; }
.urlrow-label { font-size: 11px; color: var(--dim); width: 140px; flex: none; }

.logbox {
  margin: 0;
  background: #0b0e14;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px;
  height: 320px;
  overflow: auto;
  font: 11px/1.55 var(--mono);
  color: #9fb0c8;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ------------------------------------------------------------------- login */

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card h1 { margin: 0; font-size: 16px; }
.login-sub { margin: 0; color: var(--dim); font-size: 12px; }
.login-error { margin: 0; color: var(--tally); font-size: 12px; min-height: 16px; }

/* ------------------------------------------------------- modal and toasts */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6, 8, 12, 0.72);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  max-width: 400px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal p { margin: 0 0 18px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--dim);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 12px;
  max-width: 360px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slidein 0.18s ease-out;
}
.toast-ok { border-left-color: var(--green); }
.toast-error { border-left-color: var(--tally); }
.toast.leaving { opacity: 0; transition: opacity 0.3s; }
@keyframes slidein { from { transform: translateX(12px); opacity: 0; } }

.cover-preview {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel-2);
}

/* ------------------------------------------------------- entity browser */

.dock {
  width: 300px;
  flex: none;
  border-left: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dock-tabs { display: flex; border-bottom: 1px solid var(--line-soft); flex: none; }
.dock-tab {
  flex: 1;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font: 600 11px/1 var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 6px;
  cursor: pointer;
}
.dock-tab:hover { color: var(--ink); background: var(--panel-2); }
.dock-tab.active { color: var(--amber); border-bottom-color: var(--amber); }

.dock-pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }

.filt-group { border-bottom: 1px solid var(--line-soft); }
.filt-group-head {
  padding: 6px 12px;
  font: 700 10px/1 var(--ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dimmer);
  background: var(--panel-2);
  position: sticky;
  top: 0;
}
.filt-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  cursor: grab;
  border-bottom: 1px solid var(--line-soft);
}
.filt-row:last-child { border-bottom: 0; }
.filt-row:hover { background: var(--panel-2); }
.filt-row:active { cursor: grabbing; }
.filt-sig { font-size: 11px; color: var(--amber); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filt-desc { font-size: 11px; color: var(--dimmer); line-height: 1.35; }

.dock-filters { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.dock-search { flex: 1; }
.dock-domain { max-width: 118px; flex: none; }

.dock-list { flex: 1; overflow-y: auto; min-height: 0; }

.dock-foot {
  padding: 7px 12px;
  border-top: 1px solid var(--line-soft);
  font: 11px/1 var(--mono);
  color: var(--dimmer);
}
.dock-hint { padding: 0 12px 12px; }

.ent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 4px;
  border-bottom: 1px solid var(--line-soft);
  cursor: grab;
}
.ent-row:hover { background: var(--panel-2); }
.ent-row:active { cursor: grabbing; }
.ent-group { border-bottom: 1px solid var(--line-soft); }
.ent-group .ent-row { border-bottom: 0; }

.ent-twisty { padding: 3px; color: var(--dimmer); }
.ent-twisty.open svg { transform: rotate(180deg); }
.ent-twisty-spacer { width: 22px; flex: none; }

.ent-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ent-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-id { font-size: 11px; color: var(--dimmer); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-state { font-size: 11px; color: var(--cyan); flex: none; max-width: 96px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ent-attrs { padding: 0 10px 8px 26px; background: var(--panel-2); }
.ent-attr {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 3px 6px;
  border-radius: var(--r);
  cursor: grab;
}
.ent-attr:hover { background: var(--panel-3); }
.ent-attr-key { font-size: 11px; color: var(--amber); flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-attr-value { font-size: 11px; color: var(--dimmer); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }

/* While a row is in flight, show which fields will take it. */
body.entity-drag .main input[type="text"].input,
body.entity-drag .main input[type="search"].input,
body.entity-drag .main textarea.input {
  border-color: #3d5aa8;
  background: #1b2334;
}
.drop-hot { border-color: var(--focus) !important; box-shadow: 0 0 0 2px rgba(76, 127, 255, 0.28); }

.btn-icon.active { color: var(--amber); }

/* ----------------------------------------------------------------- narrow */

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .rail { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); max-height: 190px; }
  .dock { width: 100%; border-left: 0; border-top: 1px solid var(--line); max-height: 320px; }
  .slides-layout { grid-template-columns: 1fr; }
  .editor-scroll { max-height: none; }
  .header { gap: 12px; }
  .chips { display: none; }
}

/* ------------------------------------------------------------------ music */

.music-list { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.music-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 6px; background: var(--panel-2, rgba(255, 255, 255, 0.03));
}
.music-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-size { color: var(--dimmer); font-size: 12px; }
.help.inline { margin: 0; }
