.is-studio {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.is-studio.is-dragover {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.is-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}
.is-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.is-pill-green {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}
.is-upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.is-hint { font-size: 12px; color: #475569; }
.is-main-grid {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 20px;
  align-items: start;
}
.is-vbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.is-vbadges { display: flex; flex-wrap: wrap; gap: 6px; }
.is-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
}
.is-badge-ok { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.is-badge-alpha { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.is-loupe-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.is-loupe-btn.is-active { background: #2563eb; border-color: #2563eb; color: #ffffff; }
.is-viewport {
  position: relative;
  min-height: 320px;
  max-height: 520px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: ew-resize;
}
.is-viewport.has-alpha {
  background-image:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.is-canvas-stack {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  max-height: 520px;
  align-items: center;
  justify-content: center;
}
.is-canvas-before {
  display: block;
  max-height: 500px;
  max-width: 100%;
  width: auto;
  height: auto;
}
.is-canvas-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.is-corner {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  z-index: 5;
}
.is-corner-left { left: 12px; background: rgba(15, 23, 42, 0.78); color: #ffffff; }
.is-corner-right { right: 12px; background: rgba(37, 99, 235, 0.9); color: #ffffff; }
.is-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 10;
}
.is-handle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 2px solid #2563eb;
  background: #ffffff;
  color: #2563eb;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  pointer-events: auto;
}
.is-busy {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.is-busy-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.is-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  animation: is-spin 0.7s linear infinite;
}
@keyframes is-spin { to { transform: rotate(360deg); } }
.is-loupe-overlay {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 15;
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  pointer-events: none;
}
.is-loupe-box { text-align: center; font-size: 11px; }
.is-loupe-box canvas {
  width: 116px;
  height: 116px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #0f172a;
  image-rendering: pixelated;
  margin-bottom: 4px;
}
.is-samples-bar {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.is-samples-label { font-size: 12px; font-weight: 600; color: #475569; }
.is-sample-btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.is-sample-btn:hover, .is-sample-btn.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}
.is-queue {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.is-qitem {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 12px;
  cursor: pointer;
}
.is-qitem.is-active { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; font-weight: 600; }

.is-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}
.is-ctrl-title { margin: 0 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #475569; }
.is-preset-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.is-preset-btn {
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
}
.is-preset-btn strong { display: block; font-size: 13px; color: #0f172a; }
.is-preset-btn span { display: block; font-size: 12px; color: #475569; margin-top: 1px; }
.is-preset-btn.is-active { border-color: #2563eb; background: #eff6ff; }
.is-preset-btn.is-active strong { color: #1d4ed8; }

.is-tier-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.is-tier-btn {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.is-tier-btn.is-active { background: #2563eb; border-color: #2563eb; color: #ffffff; }

.is-finetune { border-top: 1px solid #e2e8f0; padding-top: 12px; }
.is-finetune summary { font-size: 13px; font-weight: 600; cursor: pointer; color: #0f172a; }
.is-sliders { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.is-slider-row label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 4px; }
.is-slider-row input[type="range"] { width: 100%; accent-color: #2563eb; }
.is-check-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.is-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #334155; cursor: pointer; }
.is-export-box { border-top: 1px solid #e2e8f0; padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.is-select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 13px;
  color: #0f172a;
}
.is-status-msg { font-size: 12px; color: #047857; min-height: 18px; }
.is-status-msg.is-err { color: #b91c1c; }

@media (max-width: 900px) {
  .is-main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .is-studio { padding: 14px; }
  .is-loupe-overlay { display: none !important; }
  .is-export-box .btn { width: 100%; }
}