/* Studio view. All selectors .studio-prefixed to avoid collisions. */
.studio { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  background: var(--bg, #101014); color: var(--fg, #e8e8ea); }
.studio-top { display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08); }
.studio-name { flex: 0 1 260px; background: transparent; border: 1px solid transparent;
  color: inherit; font-size: 15px; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
.studio-name:focus { border-color: rgba(255,255,255,.2); outline: none; }
.studio-pattern { font-size: 13px; letter-spacing: 2px; opacity: .8; padding: 2px 8px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 6px; }
.studio-err { color: #ff7b72; font-size: 12px; }
.studio-modes { margin-left: auto; display: flex; gap: 2px; }
.studio-modes button { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.15);
  padding: 3px 12px; font-size: 12px; cursor: pointer; text-transform: capitalize; }
.studio-modes button.on { background: rgba(255,255,255,.14); }
.studio-btn { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px; padding: 5px 14px; cursor: pointer; }
.studio-btn:disabled { opacity: .4; cursor: default; }
.studio-pri { background: #0077a8; border-color: #0077a8; color: #fff; }
.studio-banner { padding: 6px 14px; background: rgba(255,200,0,.12); font-size: 13px; }
.studio-banner-err { background: rgba(255,80,80,.15); }
.studio-body { flex: 1; display: flex; min-height: 0; }
.studio-palette { width: 168px; overflow-y: auto; border-right: 1px solid rgba(255,255,255,.08); padding: 10px; }
.studio-canvas { flex: 1; overflow: auto; padding: 26px; }
.studio-side { width: 340px; display: flex; flex-direction: column;
  border-left: 1px solid rgba(255,255,255,.08); min-height: 0; }
.studio-tabs { display: flex; }
.studio-tabs button { flex: 1; padding: 8px; background: transparent; color: inherit;
  border: none; border-bottom: 2px solid transparent; cursor: pointer; }
.studio-tabs button.on { border-bottom-color: #0077a8; }
.studio-chat, .studio-inspector { flex: 1; overflow-y: auto; padding: 10px; min-height: 0;
  display: flex; flex-direction: column; }
.studio-timeline { border-top: 1px solid rgba(255,255,255,.08); padding: 8px 14px;
  overflow-x: auto; white-space: nowrap; }
/* Palette tiles — click to add, drag to place */
.studio-tile { border: 1px solid rgba(255,255,255,.15); border-radius: 8px; padding: 8px;
  margin-bottom: 8px; cursor: pointer; font-size: 12px; transition: border-color .12s, transform .06s; }
.studio-tile:hover { border-color: #0077a8; }
.studio-tile:active { transform: scale(.97); }
.studio-tile b { display: inline-block; width: 18px; }
/* Canvas track */
.studio-track { display: flex; align-items: center; min-height: 200px; }
.studio-col { display: flex; flex-direction: column; gap: 8px; }
.studio-col-group { border: 1px dashed rgba(255,255,255,.25); border-radius: 10px; padding: 8px; }
.studio-card { width: 150px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px;
  padding: 8px 10px; background: rgba(255,255,255,.04); cursor: grab; position: relative; }
.studio-card.sel { border-color: #0077a8; box-shadow: 0 0 0 1px #0077a8; }
.studio-card .x { position: absolute; top: 2px; right: 6px; cursor: pointer; opacity: .5; }
.studio-card .x:hover { opacity: 1; }
.studio-card-code { font-weight: 700; margin-right: 6px; }
.studio-card-name { font-size: 12px; opacity: .85; }
.studio-card-status { position: absolute; top: -8px; left: -8px; width: 18px; height: 18px;
  border-radius: 50%; font-size: 11px; line-height: 18px; text-align: center; }
.studio-card.st-running .studio-card-status { background: #b8860b; }
.studio-card.st-ok .studio-card-status { background: #1a7f37; }
.studio-card.st-fail .studio-card-status { background: #b12a2a; }
.studio-card.st-halt .studio-card-status { background: #666; }
.studio-drop { width: 26px; align-self: stretch; margin: 0 2px; border-radius: 6px;
  transition: width .12s, background .12s; }
.studio-drop.over { background: rgba(0,160,220,.25); outline: 1px dashed #0077a8; }
/* While a drag is in progress, every drop zone fattens and lights up. */
.studio-canvas.dragging .studio-drop { width: 46px; background: rgba(0,160,220,.10);
  outline: 1px dashed rgba(0,160,220,.55); }
.studio-canvas.dragging .studio-card { outline: 1px dashed rgba(0,160,220,.35); }
.studio-card.lane-over { outline: 2px dashed #0077a8; }
.studio-connector { width: 34px; height: 2px; background: rgba(255,255,255,.25); flex: none; }
/* Chat */
.studio-msg { margin-bottom: 10px; font-size: 13px; line-height: 1.45; }
.studio-msg.user { text-align: right; opacity: .9; }
.studio-msg .bubble { display: inline-block; padding: 6px 10px; border-radius: 10px;
  background: rgba(255,255,255,.06); text-align: left; max-width: 95%; }
.studio-msg.user .bubble { background: rgba(0,119,168,.25); }
.studio-proposal { border: 1px solid #0077a8; border-radius: 8px; padding: 8px; margin: 8px 0; font-size: 12px; }
.studio-chat-input { display: flex; gap: 6px; margin-top: auto; padding-top: 8px; }
.studio-chat-input textarea { flex: 1; resize: none; background: rgba(255,255,255,.05);
  color: inherit; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; padding: 6px; }
/* Inspector */
.studio-field { margin-bottom: 10px; font-size: 12px; }
.studio-field label { display: block; opacity: .7; margin-bottom: 3px; }
.studio-field input, .studio-field textarea, .studio-field select { width: 100%;
  background: rgba(255,255,255,.05); color: inherit; border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px; padding: 5px 7px; font-size: 12px; }
/* History timeline */
.studio-runchip { display: inline-block; padding: 4px 10px; margin-right: 6px; border-radius: 14px;
  font-size: 11px; cursor: pointer; border: 1px solid rgba(255,255,255,.2); }
.studio-runchip.sel { border-color: #0077a8; box-shadow: 0 0 0 1px #0077a8; }
.studio-runchip.r-success { background: rgba(26,127,55,.25); }
.studio-runchip.r-failed { background: rgba(177,42,42,.3); }
.studio-runchip.r-running { background: rgba(184,134,11,.3); }
