/* Run-of-show sidebar: collections containing slides. */
.slide-list { display: block; margin: 14px 0 10px; }
.coll-settings { display: grid; gap: 2px; padding: 10px 12px; margin: 14px 0 4px; border: 1px solid var(--line); border-radius: 11px; background: #231810; }
.coll-settings .gap-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; font-size: 11px; color: var(--muted); animation: sectionIn 0.25s var(--ease); }
.coll-settings .gap-row .f-unit { width: 74px; }
.coll-settings .gap-row .f-num { min-height: 26px; }
.coll-settings .gap-row small { flex-basis: 100%; margin: 0; }

.collection { --c: var(--gold); position: relative; border-radius: 12px; transition: box-shadow 0.2s, background 0.2s; }
.collection + .collection { margin-top: 2px; }
.collection-head { display: flex; align-items: center; gap: 4px; min-height: 36px; padding: 3px 3px 3px 0; border-radius: 9px; cursor: pointer; user-select: none; transition: background 0.18s; }
.collection-head:hover { background: #ffffff0b; }
.collection-head button { min-height: 26px; height: 26px; min-width: 24px; padding: 0 5px; border: 0; background: transparent; color: var(--muted); border-radius: 7px; box-shadow: none; font-size: 14px; flex: none; }
.collection-head button:hover { background: #644127; color: var(--cream); box-shadow: none; }
.c-grip { cursor: grab; touch-action: none; width: 22px; padding: 0 !important; opacity: 0.55; }
.collection-head:hover .c-grip { opacity: 1; }
.c-grip:active { cursor: grabbing; }
.c-toggle svg { transition: transform 0.25s var(--ease); }
.collection.collapsed .c-toggle svg { transform: rotate(-90deg); }
.c-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 24%, transparent); margin: 0 3px; transition: transform 0.2s var(--ease); }
.collection-head:hover .c-dot { transform: scale(1.2); }
.c-title { flex: 1; min-width: 0; margin: 0; font: 700 11px/1.3 Arial, Helvetica, sans-serif; letter-spacing: 0.9px; text-transform: uppercase; color: var(--cream); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection.has-selected .c-title { color: var(--gold); }
.c-rename { margin: 0; min-height: 26px; padding: 3px 7px; font: 700 11px Arial, sans-serif; letter-spacing: 0.9px; text-transform: uppercase; border-color: var(--gold); box-shadow: 0 0 0 3px #efb64f26; }
.c-count { flex: none; font-size: 10px; line-height: 16px; min-width: 20px; text-align: center; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; padding: 0 6px; }
.c-live { flex: none; color: #ff6a4d; font-size: 9px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.collection-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.3s var(--ease); }
.collection.collapsed .collection-body, .sorting-groups .collection-body { grid-template-rows: 0fr; }
.collection-body-inner { min-height: 0; overflow: hidden; display: grid; gap: 10px; align-content: start; margin-left: 10px; padding: 4px 0 6px 12px; border-left: 2px solid color-mix(in srgb, var(--c) 50%, transparent); transition: padding 0.3s var(--ease); }
.collection.collapsed .collection-body-inner, .sorting-groups .collection-body-inner { padding-top: 0; padding-bottom: 0; }
.sorting-items .collection:not(.collapsed) .collection-body-inner { overflow: visible; }
.collection-empty { display: grid; place-items: center; min-height: 46px; border: 1.5px dashed #6b4d33; border-radius: 9px; color: #9c8564; font-size: 11px; transition: border-color 0.2s, background 0.2s; }
.collection-body-inner:has(.slide-item) > .collection-empty { display: none; }
.sorting-items .collection-empty { border-color: var(--gold); background: #efb64f12; color: var(--gold); }

.collection-gap { display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 0 4px; transition: opacity 0.2s; }
.gap-line { flex: 1; height: 0; border-top: 1px dashed #6b4d33; }
.gap-chip { flex: none; font-size: 9px; font-weight: 700; letter-spacing: 1.2px; color: var(--gold); border: 1px solid #6b4d33; border-radius: 12px; padding: 3px 9px; background: #2a1d14; cursor: help; }
.sorting-groups .collection-gap { opacity: 0; }

/* drag states */
.is-sorting { cursor: grabbing; }
.is-sorting * { cursor: grabbing !important; }
.slide-item.dragging, .collection.dragging { opacity: 1; scale: 1.02; background: #3a2818; border-color: var(--gold); box-shadow: 0 16px 40px #000c, 0 0 0 1px var(--gold); transition: scale 0.18s var(--ease), box-shadow 0.18s; z-index: 20; }
.collection.dragging { border-radius: 12px; }
.slide-item { transition: border-color 0.2s, background 0.2s; }
.slide-item:hover:not(.selected) { background: #ffffff08; }
.slide-name small { display: block; }
.slide-select { cursor: pointer; }
.drag-handle { display: grid; place-items: center; width: 22px; height: 26px; margin: -4px -4px -4px 0; border-radius: 6px; cursor: grab; touch-action: none; color: var(--muted); font-size: 0; opacity: 0.55; transition: opacity 0.18s, background 0.18s; }
.slide-item:hover .drag-handle { opacity: 1; }
.drag-handle:hover { background: #644127; }
.thumbnail.type-tpl { padding: 0; background: #10243f; display: block; }
.thumbnail.type-tpl:after { display: none; }
.thumb-tpl { position: absolute; inset: 0; }
.slide-item.selected .thumbnail { box-shadow: 0 0 0 1px var(--gold); }

@media (max-width: 560px) {
  .slide-list { display: block; overflow: visible; margin: 14px 0; }
  .slide-item { flex: none; }
  .add-slide { max-width: none; }
}

/* ---- resizable sidebar ---------------------------------------------------------------- */
@media (min-width: 1100px) {
  #preview-workspace { --side-w: 235px; --px: 22px; --gap: 18px; position: relative; grid-template-columns: var(--side-w) minmax(300px, 1fr) 296px; }
  .side-resizer { position: absolute; z-index: 30; top: 20px; bottom: 20px; left: calc(var(--px) + var(--side-w) + var(--gap) / 2 - 7px); width: 14px; cursor: col-resize; touch-action: none; outline: none; }
  .side-resizer:before { content: ""; position: absolute; left: 6px; top: 50%; width: 2px; height: 36px; margin-top: -18px; border-radius: 2px; background: #8d6a43; opacity: 0.55; transition: height 0.2s var(--ease), opacity 0.2s, background 0.2s, margin 0.2s var(--ease); }
  .side-resizer:hover:before, .side-resizer:focus-visible:before, .side-resizer.active:before { height: 72px; margin-top: -36px; opacity: 1; background: var(--gold); }
  .side-resizer.active:before { box-shadow: 0 0 12px #efb64f88; }
  .side-resizer:focus-visible { box-shadow: 0 0 0 2px #efb64f55; border-radius: 7px; }
}
@media (min-width: 1600px) {
  #preview-workspace { --side-w: 270px; --px: 30px; --gap: 25px; grid-template-columns: var(--side-w) minmax(400px, 1fr) 330px; }
}
@media (max-width: 1099px) { .side-resizer { display: none; } }
body.side-resizing, body.side-resizing * { cursor: col-resize !important; user-select: none; }
body.side-resizing iframe { pointer-events: none; }
body.side-resizing #preview-workspace { transition: none; }
body[data-tab="data"] .side-resizer, body[data-tab="templates"] .side-resizer { display: none; }

/* ---- pinned Hold screen collection ------------------------------------------------------ */
.collection.pinned { --c: #ff6a4d; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.collection.pinned .collection-head { position: sticky; top: -20px; z-index: 6; background: linear-gradient(#2a1c12, #2a1c12ee); border-radius: 9px; padding-left: 6px; }
.collection.pinned .c-title { color: #ff9a82; letter-spacing: 1.3px; }
.collection.pinned .collection-body-inner { border-left-style: dashed; border-left-color: color-mix(in srgb, var(--c) 55%, transparent); }
.c-pin { flex: none; width: 22px; text-align: center; color: #ff6a4d; font-size: 14px; }
.collection.pinned .slide-number { color: #ff9a82; }
.hold-designation { color: #ff9a82; font-size: 9px; font-weight: 700; letter-spacing: 0.8px; padding: 2px 6px; border: 1px solid #ff6a4d66; border-radius: 9px; background: #ff6a4d14; }

.c-add { opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s; font-size: 15px !important; }
.collection-head:hover .c-add, .c-add:focus-visible, .collection.pinned .c-add { opacity: 1; }

/* ---- Name Only toggle -------------------------------------------------------------------- */
.check-row { display: grid !important; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; margin: 4px 0; border: 1px solid var(--line); border-radius: 10px; background: #231810; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.check-row:hover { background: #2a1d14; }
.check-row:has(input:checked) { border-color: var(--gold); background: #33231a; }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { width: 34px; height: 20px; margin-top: 1px; border-radius: 12px; background: #4a3626; position: relative; transition: background 0.2s var(--ease); }
.check-box:after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #d9c9b0; transition: transform 0.25s var(--ease), background 0.2s; }
.check-row input:checked + .check-box { background: var(--gold); }
.check-row input:checked + .check-box:after { transform: translateX(14px); background: #2b1b0e; }
.check-row input:focus-visible + .check-box { box-shadow: 0 0 0 3px #efb64f44; }
.check-row strong { font-size: 13px; }
.check-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
