/* Escenas + Fuentes bands (studio-sources.js). Colors come from the studio theme tokens. */
.studio-reference .ks-band-head{display:flex;align-items:center;gap:8px;min-width:0;flex:0 0 auto}
.studio-reference .ks-band-title{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--st-text)}
.studio-reference .ks-band-title .icon,.studio-reference .ks-band-title .icon svg{width:16px;height:16px}
.studio-reference .ks-count{font-size:11px;color:var(--st-muted);border:1px solid var(--st-line);border-radius:999px;padding:0 7px;line-height:18px}
.studio-reference .ks-spacer{flex:1}
.studio-reference .ks-pending{font-size:11px;color:var(--st-muted);white-space:nowrap}
.studio-reference .ks-band-head .btn{min-height:30px;padding:5px 10px;font-size:12px;gap:6px}
.studio-reference .ks-band-head .btn .icon,.studio-reference .ks-band-head .btn .icon svg{width:14px;height:14px}

.studio-reference #studio-scene-strip.ks-scenes{display:flex;flex-direction:column;gap:8px;padding:8px 0;border-top:1px solid var(--st-line);min-height:0}
.studio-reference .ks-scene-row{display:flex;gap:8px;overflow-x:auto;overflow-y:hidden;padding:2px 2px 4px;scrollbar-width:thin;align-items:stretch}
.studio-reference .ks-scene{position:relative;flex:0 0 128px;border:1px solid var(--st-line);border-radius:9px;background:var(--st-surface)}
.studio-reference .ks-scene.ks-live{border:2px solid #e24b4a}
.studio-reference .ks-scene.ks-stage{border:2px solid var(--st-primary)}
.studio-reference .ks-scene-main{display:flex;flex-direction:column;gap:5px;width:100%;padding:5px;border:0;background:none;color:var(--st-text);border-radius:8px;text-align:left;cursor:pointer}
.studio-reference .ks-scene-main:hover{background:var(--st-hover)}
.studio-reference .ks-scene-thumb{display:block;height:50px;border-radius:5px;background:var(--st-bg);overflow:hidden}
.studio-reference .ks-scene-thumb svg{width:100%;height:100%;display:block}
.studio-reference .ks-scene-thumb svg rect{fill:var(--st-line)}
.studio-reference .ks-scene-name{display:flex;align-items:center;justify-content:space-between;gap:4px;min-width:0;font-size:11.5px;font-weight:600}
.studio-reference .ks-scene-name>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.studio-reference .ks-scene-name kbd{font:500 10px/1 inherit;color:var(--st-muted);border:1px solid var(--st-line);border-radius:4px;padding:2px 4px;flex:0 0 auto}
.studio-reference .ks-tag{position:absolute;top:9px;left:9px;font-size:9.5px;font-weight:700;border-radius:4px;padding:2px 6px;pointer-events:none}
.studio-reference .ks-tag-live{background:#e24b4a;color:#fff}
.studio-reference .ks-tag-stage{background:var(--st-soft);color:var(--st-focus)}
.studio-reference .ks-scene-more{position:absolute;top:8px;right:8px;width:22px;height:22px;min-height:0;padding:0;border-radius:6px;border:1px solid var(--st-line);background:var(--st-surface);color:var(--st-text);font-size:13px;line-height:1;opacity:.85}
.studio-reference .ks-scene-more:hover,.studio-reference .ks-scene-more[aria-expanded=true]{opacity:1;background:var(--st-hover)}
.studio-reference .ks-scene-add{flex:0 0 110px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:1px dashed var(--st-line);border-radius:9px;background:none;color:var(--st-muted);font-size:11.5px;cursor:pointer}
.studio-reference .ks-scene-add:hover{color:var(--st-text);background:var(--st-hover)}
.studio-reference .ks-scene-add .icon,.studio-reference .ks-scene-add .icon svg{width:18px;height:18px}
.studio-reference .ks-empty{margin:0;align-self:center;font-size:12px;color:var(--st-muted);max-width:420px}
.ks-menu{position:fixed;z-index:1000;min-width:180px;padding:4px;border-radius:9px;border:1px solid var(--st-line,#394459);background:var(--st-raised,#222a39);box-shadow:var(--st-shadow,0 8px 30px #0003);display:flex;flex-direction:column}
.ks-menu button{all:unset;box-sizing:border-box;padding:8px 10px;border-radius:6px;font-size:12.5px;color:var(--st-text,#f2f4fa);cursor:pointer}
.ks-menu button:hover:not([disabled]),.ks-menu button:focus-visible{background:var(--st-hover,#2b3548)}
.ks-menu button[disabled]{opacity:.4;cursor:default}
.ks-menu .ks-danger{color:var(--st-danger,#ffb4bf)}

.studio-reference .ks-sources-head{margin-top:6px;margin-bottom:6px}
.studio-reference .studio-source-strip.ks-sources{gap:8px!important}
.studio-reference .ks-sources .studio-add-source{display:none!important}
.studio-reference .ks-sources .studio-overlay-source[hidden],.studio-reference .ks-sources .tile[hidden]{display:none!important}
.studio-reference .ks-group-label{flex:0 0 58px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:var(--st-muted);font-size:10.5px;border-left:1px solid var(--st-line);padding-left:8px;margin-left:2px}
.studio-reference .ks-group-label:first-child{border-left:0;padding-left:0;margin-left:0}
.studio-reference .ks-group-label .icon,.studio-reference .ks-group-label .icon svg{width:16px;height:16px}
.studio-reference .ks-group-label b{font-size:11px;color:var(--st-text)}
.studio-reference .ks-sources>.tile[data-on-air=true]{border:2px solid var(--st-primary)!important}
.studio-reference .ks-hand{position:absolute;top:4px;right:28px;width:20px;height:20px;border-radius:50%;background:#f5b642;color:#20160a;display:flex;align-items:center;justify-content:center;z-index:8}
.studio-reference .ks-hand .icon,.studio-reference .ks-hand .icon svg{width:12px;height:12px}
.studio-reference .ks-media-card{flex:0 0 140px!important;display:flex!important;flex-direction:column;padding:0!important;overflow:hidden;cursor:default;border:1px solid var(--st-line)}
.studio-reference .ks-media-card.ks-on{border:2px solid var(--st-primary)}
.studio-reference .ks-media-thumb{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;background:var(--st-bg);color:var(--st-muted)}
.studio-reference .ks-media-thumb img{width:100%;height:100%;object-fit:contain}
.studio-reference .ks-media-thumb .icon,.studio-reference .ks-media-thumb .icon svg{width:22px;height:22px}
.studio-reference .ks-pill{position:absolute;top:4px;left:4px;font-size:9.5px;font-weight:700;border-radius:4px;padding:2px 5px}
.studio-reference .ks-pill-live{background:#e24b4a;color:#fff}
.studio-reference .ks-pill-stage{background:var(--st-soft);color:var(--st-focus)}
.studio-reference .ks-clip-time{position:absolute;bottom:3px;right:6px;font-size:10px;color:var(--st-muted);font-variant-numeric:tabular-nums}
.studio-reference .ks-media-foot{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:4px 6px;background:var(--st-raised)}
.studio-reference .ks-media-foot>span{font-size:10.5px;color:var(--st-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.studio-reference .ks-act{flex:0 0 auto;min-height:0;font-size:10px;font-weight:600;padding:3px 7px;border-radius:5px;border:1px solid var(--st-line);background:var(--st-surface);color:var(--st-text);cursor:pointer}
.studio-reference .ks-act:hover{background:var(--st-hover)}
.studio-reference .ks-act-primary{background:var(--st-soft);color:var(--st-focus);border-color:transparent}
.studio-reference #studio-scene-strip.ks-scenes{align-items:stretch;text-align:left;height:auto!important;grid-template-columns:none}
.studio-reference #studio-scene-strip.ks-scenes>.ks-band-head{justify-content:flex-start;width:100%}
.studio-reference .ks-scene-row{min-height:0;height:auto}
.studio-reference .ks-sources .studio-source-toggle{inset:auto 4px 24px auto!important;opacity:1!important;width:auto;padding:2px 7px;font-size:10px;font-weight:600;border-radius:5px;background:var(--st-raised);color:var(--st-text);border:1px solid var(--st-line)}
.studio-reference .ks-sources .studio-source-toggle.ks-add{background:var(--st-soft);color:var(--st-focus);border-color:transparent}
.studio-reference .ks-sources .studio-source-status{top:4px;left:4px}
.studio-reference .ks-sources .ks-media-card{align-items:stretch!important;justify-content:flex-start!important;gap:0!important;padding:0!important;text-align:left}
.studio-reference .ks-media-card>.ks-media-foot{width:100%;min-width:0}
.studio-reference .ks-scene-thumb svg rect.ks-thumb-cam{fill:var(--st-primary);opacity:.6}
.studio-reference .ks-scene-thumb svg rect.ks-thumb-media{fill:var(--st-line)}
/* Two labelled rows exactly as in the approved mockup: "Personas · n" over the cameras,
   "Medios · n" over the media. Tiles stay direct children of #stage-grid (drawMedia owns them),
   so the rows are built with grid placement instead of wrapper elements. */
.studio-reference .studio-source-strip.ks-sources{display:grid!important;grid-template-rows:auto 104px auto 104px;grid-auto-flow:column;grid-auto-columns:150px;column-gap:10px!important;row-gap:6px;height:auto!important;min-height:0!important;flex:0 0 auto!important;overflow-x:auto;overflow-y:hidden;align-items:stretch;padding-bottom:4px}
.studio-reference .ks-sources>.ks-group-label{grid-column:1/span 3;flex:none;flex-direction:row;justify-content:flex-start;align-items:center;gap:6px;border:0;padding:0;margin:0;font-size:11.5px;color:var(--st-muted)}
.studio-reference .ks-sources>.ks-lbl-people{grid-row:1}
.studio-reference .ks-sources>.ks-lbl-media{grid-row:3}
.studio-reference .ks-sources>.ks-row-people{grid-row:2}
.studio-reference .ks-sources>.ks-row-media{grid-row:4}
.studio-reference .ks-sources>.tile,.studio-reference .ks-sources>.studio-source-extra{width:150px!important;height:104px!important;min-height:0!important;flex:none!important;border-radius:10px!important}
.studio-reference .ks-sources>.tile{display:block!important;position:relative;background:var(--st-bg)!important;border:1px solid var(--st-line)!important;overflow:hidden;padding:0!important}
.studio-reference .ks-sources>.tile[data-on-air=true]{border:2px solid var(--st-primary)!important}
.studio-reference .ks-sources>.tile>video{position:absolute;inset:0 0 30px 0;width:100%;height:calc(100% - 30px);object-fit:cover}
.studio-reference .ks-sources>.tile>.avatar{position:absolute;left:50%;top:37px;transform:translate(-50%,-50%);width:36px;height:36px;font-size:13px}
.studio-reference .ks-sources>.tile>.tile-label{position:absolute;left:0;right:0;bottom:0;height:30px;width:auto;display:flex;align-items:center;padding:0 64px 0 8px!important;background:var(--st-raised)!important;color:var(--st-text)!important;font-size:11px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:0}
.studio-reference .ks-sources>.tile>.studio-source-toggle{inset:auto 6px 5px auto!important;height:20px;display:flex;align-items:center}
.studio-reference .ks-sources>.tile>.studio-source-status{top:6px;left:6px;font-size:10px;padding:2px 6px;border-radius:4px}
.studio-reference .ks-sources>.tile[data-on-air=true]>.studio-source-status{background:var(--st-soft);color:var(--st-focus)}
.studio-reference .ks-sources>.tile[data-on-air=false]>.studio-source-status{background:var(--st-surface);color:var(--st-muted);border:1px solid var(--st-line)}
.studio-reference .ks-sources>.tile>.studio-source-menu{top:6px!important;right:6px!important}
.studio-reference .ks-sources .ks-media-foot{height:30px;padding:0 6px 0 8px}
.studio-reference .ks-sources .ks-media-foot>span{font-size:11px}
.studio-reference .ks-sources .ks-act{font-size:10.5px;padding:3px 8px}
