.asm-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 20px;
  align-items: stretch;
}
.asm-controls-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.asm-preview-col {
  position: relative;
}
.asm-step-card, .asm-preview-sticky {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.asm-preview-sticky {
  position: sticky;
  top: 76px;
}
.asm-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.asm-step-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.asm-step-title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}
.asm-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.asm-tab {
  flex: 1 1 auto;
  min-height: 36px;
  padding: 6px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.asm-tab.is-active {
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.asm-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 18px 14px;
  border: 2px dashed #c7d2fe;
  border-radius: 12px;
  background: var(--primary-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.asm-dropzone:hover, .asm-dropzone.is-dragover {
  border-color: var(--primary);
  background: #e0e7ff;
}
.asm-dropzone-sm { padding: 16px 14px; }
.asm-drop-icon { font-size: 24px; line-height: 1; }
.asm-drop-hint { font-size: 13px; color: var(--muted); }
.asm-file-pill {
  font-size: 12px;
  font-weight: 700;
  background: var(--card);
  color: var(--primary);
  border: 1px solid #c7d2fe;
  padding: 3px 10px;
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asm-tpl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.asm-tpl-btn {
  padding: 4px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.asm-tpl-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.asm-tpl-btn.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.asm-tpl-btn img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; }
.asm-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.asm-field { display: flex; flex-direction: column; gap: 4px; }
.asm-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.asm-toggles-row, .asm-fx-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.asm-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
}
.asm-check-pill input { accent-color: var(--primary); width: 15px; height: 15px; }
.asm-inline-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.asm-select-sm {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
}
.asm-sfx-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.asm-sfx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}
.asm-sfx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.asm-sfx-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.asm-sfx-item.is-selected {
  background: #e0e7ff;
  border-color: var(--primary);
  color: #312e81;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(67, 56, 202, 0.18);
}
.asm-sfx-dur {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
  color: var(--muted);
  flex-shrink: 0;
}
.asm-sfx-item.is-selected .asm-sfx-dur { color: #312e81; font-weight: 700; }
.asm-mic-box, .asm-vextract-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.asm-mic-controls, .asm-vextract-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.asm-mic-timer { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.asm-mic-status, .asm-vextract-info { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.asm-vextract-info { margin: 0 0 10px; }
.asm-trim-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.asm-trim-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.asm-active-audio-label { font-size: 13px; color: var(--muted); }
.asm-active-audio-label strong { color: var(--ink); }
.asm-dur-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.asm-chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.asm-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.asm-wave-canvas {
  width: 100%;
  height: 68px;
  background: #f5f0e8;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: block;
}
.asm-sliders-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.asm-video-trim-row { margin-top: 12px; }
.asm-range-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.asm-range-head strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.asm-range { width: 100%; accent-color: var(--primary); cursor: pointer; }
.asm-phone-preview {
  background: #efe7dc;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}
.asm-phone-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}
.asm-phone-dot { width: 8px; height: 8px; border-radius: 999px; background: #fb923c; flex-shrink: 0; }
.asm-spec-pill {
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.asm-result-head .asm-spec-pill { background: var(--primary-soft); color: var(--primary); }
.asm-chat-canvas-wrap {
  padding: 18px;
  display: flex;
  justify-content: center;
  background-image: radial-gradient(rgba(28, 25, 54, 0.08) 1px, transparent 1px);
  background-size: 14px 14px;
}
.asm-live-bubble {
  position: relative;
  width: 244px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  padding: 8px;
  border-radius: 20px 20px 6px 20px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  overflow: hidden;
}
.asm-preview-canvas, .asm-preview-video, .asm-overlay-canvas {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
  display: block;
}
.asm-overlay-canvas {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  pointer-events: none;
}
.asm-live-sound-pill {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  border: 2px solid #ffffff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm);
}
.asm-live-bubble.is-playing .asm-live-sound-pill { background: var(--accent); }
.asm-live-bubble.is-playing .asm-eq-bars i {
  animation: asmBounceBar 0.5s ease-in-out infinite alternate;
}
.asm-preview-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.asm-bg-swatches { display: inline-flex; align-items: center; gap: 6px; }
.asm-swatch {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
}
.asm-swatch.is-active { border-color: var(--primary); transform: scale(1.1); }
.asm-export-panel { display: flex; flex-direction: column; gap: 10px; }
.asm-export-main-btn { width: 100%; font-size: 16px; min-height: 48px; padding: 12px 16px; }
.asm-secondary-exports { display: flex; flex-direction: column; gap: 8px; }
.asm-secondary-exports .asm-btn {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
  padding: 10px 14px;
}
.asm-spec-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.asm-spec-foot span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
}
.asm-progress-box {
  background: var(--primary-soft);
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 12px;
}
.asm-progress-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.asm-progress-track { height: 8px; background: #dbeafe; border-radius: 999px; overflow: hidden; }
.asm-progress-bar { height: 100%; background: var(--primary); border-radius: 999px; transition: width 0.2s ease; }
.asm-error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}
.asm-result-box {
  background: var(--bg);
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.asm-result-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.asm-result-video, .asm-result-img {
  width: 200px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  margin: 0 auto;
  background: #1c1936;
}
.asm-result-audio { width: 100%; }
.asm-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.asm-result-actions .asm-btn { flex: 1 1 auto; min-height: 44px; }
.asm-import-guide {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.asm-import-guide ol { margin: 6px 0 0; padding-left: 18px; }
.asm-import-guide li { margin-bottom: 4px; color: var(--muted); }
@media (max-width: 900px) {
  .asm-studio-grid { grid-template-columns: 1fr; }
  .asm-preview-sticky { position: static; }
}
@media (max-width: 768px) {
  .asm-step-card, .asm-preview-sticky { padding: 14px; }
  .asm-step-head { margin-bottom: 10px; }
  .asm-tab-bar { margin-bottom: 10px; }
  .asm-dropzone { padding: 14px 12px; gap: 4px; }
  .asm-drop-icon { font-size: 22px; }
  .asm-sfx-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .asm-style-grid, .asm-sliders-grid { grid-template-columns: 1fr; }
  .asm-tpl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
