/* ═══════════════════════════════════════════════════════════════════
   CONSOLE · IMMERSIVE STUDIO
   Built on the console's own tokens, so it follows light and dark.
   ═══════════════════════════════════════════════════════════════════ */

.imx-kpis { margin-bottom: 16px; }
.imx-worlds { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.imx-w {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s;
}
.imx-w:hover { transform: translateY(-2px); border-color: var(--line-3); box-shadow: var(--sh-2); }
.imx-w-img { position: relative; aspect-ratio: 2 / 1; background: linear-gradient(135deg, #0B1224, #1A1438); overflow: hidden; cursor: pointer; }
.imx-w-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imx-w-img .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.35); }
.imx-w-img .ph .ic { width: 38px; height: 38px; }
.imx-w-tags { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.imx-w-b { padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.imx-w-t { font: 620 15px/1.25 var(--f-d); letter-spacing: -.02em; color: var(--ink-1); }
.imx-w-s { font-size: 12px; color: var(--ink-4); }
.imx-w-stats { display: flex; gap: 14px; margin-top: 6px; font: 500 11.5px var(--f-m); color: var(--ink-3); }
.imx-w-f { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: center; }
.imx-w-f .grow { flex: 1; }
.imx-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font: 600 10px var(--f-m); letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 100px; color: #fff; background: rgba(4,8,18,.62); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.imx-chip.ok { background: rgba(43,211,155,.85); color: #03261A; border-color: transparent; }
.imx-chip.warn { background: rgba(246,182,66,.9); color: #2A1C00; border-color: transparent; }
.imx-chip.brand { background: linear-gradient(135deg, #7A3BFF, #4C7DFF); border-color: transparent; }
.imx-new {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 250px; border-radius: 18px; border: 1.5px dashed var(--line-3); color: var(--ink-3);
  background: transparent; cursor: pointer; font: inherit; padding: 20px;
  transition: border-color .2s, color .2s, background .2s;
}
.imx-new:hover { border-color: var(--brand-line); color: var(--ink-1); background: var(--brand-soft); }
.imx-new .ic { width: 30px; height: 30px; }
.imx-new b { font: 620 15px var(--f-d); color: var(--ink-1); }

/* ── the studio ── */
.imx-studio {
  position: fixed; inset: 0; z-index: 60;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
  opacity: 0; transform: translateY(10px);
  transition: opacity .25s var(--ease), transform .35s var(--ease-out);
}
.imx-studio.on { opacity: 1; transform: none; }
.imx-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.imx-bar-t { min-width: 0; flex: 1; }
.imx-bar-k { font: 600 10.5px var(--f-m); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); }
.imx-bar-n { font: 640 17px var(--f-d); letter-spacing: -.02em; color: var(--ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imx-save { font-size: 12px; color: var(--ink-4); white-space: nowrap; }
.imx-save.dirty { color: var(--warn); }
.imx-body { display: grid; grid-template-columns: minmax(0, 1fr) 440px; min-height: 0; }
.imx-left { min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.imx-right { min-height: 0; overflow: auto; border-left: 1px solid var(--line); background: var(--panel); }

.imx-prev {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 64vh;
  border-radius: 16px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 1px var(--line-2);
}
.imx-prev .cim-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.imx-prev.placing .cim-canvas { cursor: crosshair; }
.imx-prev-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: rgba(255,255,255,.6); text-align: center; padding: 20px; }
.imx-prev-empty .ic { width: 40px; height: 40px; opacity: .6; }
.imx-prev-empty b { color: #fff; font: 600 15px var(--f-d); }
.imx-prev-empty span { font-size: 12.5px; max-width: 42ch; }
.imx-hots { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.imx-hot {
  position: absolute; left: 0; top: 0; pointer-events: auto;
  width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 700 11px var(--f-m); color: #fff; cursor: grab;
  background: rgba(8, 20, 24, .7); box-shadow: inset 0 0 0 2px #fff, 0 4px 14px rgba(0,0,0,.5);
  transform: translate3d(var(--x), var(--y), 0);
  border: 0; padding: 0;
}
.imx-hot[data-type="scene"] { background: rgba(45,212,191,.85); color: #04211E; }
.imx-hot[data-type="tour"] { background: rgba(245,177,46,.9); color: #231500; }
.imx-hot[data-type="seek"] { background: rgba(92,164,255,.9); }
.imx-hot[data-type="link"] { background: rgba(124,92,255,.9); }
.imx-hot.sel { box-shadow: inset 0 0 0 2px #fff, 0 0 0 4px var(--brand), 0 4px 14px rgba(0,0,0,.5); }
.imx-hot.off { opacity: .35; }
.imx-hot[hidden] { display: none; }
.imx-hot:active { cursor: grabbing; }
.imx-hot-l { position: absolute; left: 34px; top: 50%; transform: translateY(-50%); white-space: nowrap; font: 600 11.5px var(--f-b); padding: 4px 8px; border-radius: 8px; background: rgba(4,8,18,.78); color: #fff; pointer-events: none; }
.imx-cross { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; z-index: 2; pointer-events: none; opacity: .75; }
.imx-cross::before, .imx-cross::after { content: ''; position: absolute; background: #fff; box-shadow: 0 0 3px rgba(0,0,0,.8); }
.imx-cross::before { left: 8px; top: 0; width: 2px; height: 18px; }
.imx-cross::after { top: 8px; left: 0; height: 2px; width: 18px; }
.imx-ptools { position: absolute; left: 10px; right: 10px; top: 10px; z-index: 3; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.imx-ptools > * { pointer-events: auto; }
.imx-ptools .btn { background: rgba(8,12,22,.72); color: #fff; border-color: rgba(255,255,255,.16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.imx-ptools .btn.on { background: var(--brand); border-color: transparent; }
.imx-readout { margin-left: auto; align-self: center; font: 500 11px var(--f-m); color: #fff; padding: 6px 10px; border-radius: 10px; background: rgba(8,12,22,.72); white-space: nowrap; }
.imx-vbar { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 3; display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 12px; background: rgba(8,12,22,.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; }
.imx-vbar[hidden] { display: none; }
.imx-vbar input[type=range] { flex: 1; accent-color: var(--brand); }
.imx-vbar .t { font: 500 11px var(--f-m); min-width: 90px; text-align: center; }
.imx-vbar .icon-btn { color: #fff; }

.imx-scenes { display: grid; grid-auto-flow: column; grid-auto-columns: 176px; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.imx-sc {
  position: relative; border-radius: 14px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line);
  cursor: pointer; text-align: left; padding: 0; font: inherit; color: var(--ink-2);
}
.imx-sc.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-line); }
.imx-sc-img { aspect-ratio: 2 / 1; background: #0B1020; position: relative; }
.imx-sc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imx-sc-img .n { position: absolute; top: 6px; left: 6px; font: 600 10px var(--f-m); padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; }
.imx-sc-img .st { position: absolute; top: 6px; right: 6px; font: 600 9.5px var(--f-m); padding: 2px 6px; border-radius: 6px; background: var(--brand); color: #fff; }
.imx-sc-b { padding: 8px 10px; }
.imx-sc-t { font: 600 12.5px var(--f-d); color: var(--ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imx-sc-s { font: 500 10.5px var(--f-m); color: var(--ink-4); margin-top: 2px; }
.imx-sc-bar { height: 3px; background: var(--line); }
.imx-sc-bar i { display: block; height: 100%; background: var(--grad); }
.imx-sc-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 130px; border: 1.5px dashed var(--line-3); background: transparent; color: var(--ink-3); }
.imx-sc-add:hover { border-color: var(--brand-line); color: var(--ink-1); }
.imx-sc-add .ic { width: 22px; height: 22px; }

.imx-tabs { position: sticky; top: 0; z-index: 2; background: var(--panel); padding: 12px 16px 0; border-bottom: 1px solid var(--line); }
.imx-tabs .tabs { margin: 0; }
.imx-pane { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.imx-sec { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--panel-2); }
.imx-sec-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.imx-sec-h b { font: 620 13.5px var(--f-d); color: var(--ink-1); }
.imx-sec-h span { font-size: 11.5px; color: var(--ink-4); }
.imx-sec-h .grow { flex: 1; }
.imx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.imx-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.imx-grid .full { grid-column: 1 / -1; }
.imx-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.imx-f label { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.imx-f .hint { font-size: 11px; color: var(--ink-4); line-height: 1.45; }
.imx-f .inp { width: 100%; }
.imx-f textarea.inp { min-height: 76px; resize: vertical; }

.imx-drop {
  border: 1.5px dashed var(--line-3); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer;
  color: var(--ink-3); font-size: 12.5px; transition: border-color .2s, background .2s;
}
.imx-drop:hover, .imx-drop.over { border-color: var(--brand-line); background: var(--brand-soft); color: var(--ink-1); }
.imx-drop .ic { width: 24px; height: 24px; display: block; margin: 0 auto 6px; }
.imx-drop b { color: var(--ink-1); font-weight: 600; }
.imx-file { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.imx-file .ic { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.imx-file .grow { min-width: 0; }
.imx-file-n { font-size: 12.5px; font-weight: 600; color: var(--ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imx-file-s { font: 500 10.5px var(--f-m); color: var(--ink-4); margin-top: 2px; }
.imx-prog { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; margin-top: 6px; }
.imx-prog i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .3s; }
.imx-prog.bad i { background: var(--bad); }
.imx-warn { font-size: 11.5px; line-height: 1.5; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 8px 10px; }
.imx-warn.bad { color: var(--bad); background: var(--bad-soft); }
.imx-warn.ok { color: var(--ok); background: var(--ok-soft); }

.imx-hl { display: flex; flex-direction: column; gap: 8px; }
.imx-h {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden;
}
.imx-h.on { border-color: var(--brand-line); box-shadow: 0 0 0 1px var(--brand-line); }
.imx-h-hd { display: flex; align-items: center; gap: 8px; padding: 9px 10px; cursor: pointer; }
.imx-h-n { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 10.5px var(--f-m); background: var(--panel-3); color: var(--ink-1); flex: none; }
.imx-h-t { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imx-h-b { padding: 4px 10px 12px; display: none; }
.imx-h.on .imx-h-b { display: block; }

.imx-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.imx-mode {
  text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel);
  cursor: pointer; font: inherit; color: var(--ink-2); transition: border-color .2s, box-shadow .2s;
}
.imx-mode b { display: block; font: 620 14px var(--f-d); color: var(--ink-1); margin-bottom: 4px; }
.imx-mode span { font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.imx-mode.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-line); }
.imx-banner-prev {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center;
  padding: 14px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, rgba(10,14,28,.96), rgba(8,12,24,.98)) padding-box,
    linear-gradient(115deg, #5EEAD4, #7C5CFF 32%, #FF7AC6 52%, #F5B12E 72%, #5EEAD4) border-box;
  border: 1.5px solid transparent;
}
.imx-banner-prev .i { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, #7C5CFF, #2DD4BF); display: flex; align-items: center; justify-content: center; }
.imx-banner-prev .i .ic { width: 24px; height: 24px; color: #fff; }
.imx-banner-prev .t { font: 800 17px var(--f-d); text-transform: uppercase; letter-spacing: -.01em; }
.imx-banner-prev .s { font-size: 12px; color: rgba(226,233,250,.74); margin-top: 3px; }

@media (max-width: 1150px) {
  .imx-body { grid-template-columns: 1fr; overflow: auto; }
  .imx-left, .imx-right { overflow: visible; }
  .imx-right { border-left: 0; border-top: 1px solid var(--line); }
  .imx-modes { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .imx-grid, .imx-grid.three { grid-template-columns: 1fr; }
  .imx-bar { flex-wrap: wrap; }
  .imx-save { order: 3; width: 100%; }
}

/* [hidden] must beat the display rules above. */
.imx-studio [hidden] { display: none !important; }
