/* 定制创作：沉浸式外壳。子应用通过 iframe 隔离，规则只作用于 custom zone。 */
body[data-zone="custom"] .view-root {
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.custom-creation-shell {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  overflow: hidden;
}

.custom-creation-header {
  position: relative;
  z-index: 10;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: #fff;
  transition: color 240ms ease, background-color 240ms ease;
}

.custom-creation-header-spacer { min-width: 0; }

/* 三个定制工具共用同一白色外壳；子应用不再制造第二套深色导航。 */
.custom-creation-shell[data-custom-page="video"] .custom-creation-header {
  color: #262624;
  background: #fff;
}
.custom-creation-shell[data-custom-page="video"] .custom-creation-back {
  color: #73736d;
}
.custom-creation-shell[data-custom-page="video"] .custom-creation-back:hover {
  color: #171716;
}
.custom-creation-shell[data-custom-page="video"] .custom-creation-tab {
  color: #92928d;
}
.custom-creation-shell[data-custom-page="video"] .custom-creation-tab:hover,
.custom-creation-shell[data-custom-page="video"] .custom-creation-tab.is-active {
  color: #171716;
}
.custom-creation-shell[data-custom-page="video"] .custom-creation-tab.is-locked:hover {
  color: #61615c;
}
.custom-creation-shell[data-custom-page="video"] .custom-creation-tab small {
  color: #a0a09a;
}
.custom-creation-shell[data-custom-page="video"] .custom-creation-indicator {
  background: #171716;
}

.custom-creation-back {
  justify-self: start;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 6px;
  color: #737985;
  font-size: 11.5px;
  font-weight: 760;
  transition: color 160ms ease, transform 160ms ease;
}
.custom-creation-back:hover { color: #111318; }
.custom-creation-back:active { transform: translateX(-2px); }

.custom-creation-tabs {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  min-width: 360px;
}
.custom-creation-tab {
  position: relative;
  z-index: 1;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 3px;
  color: #9096a0;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
  transition: color 180ms ease, opacity 180ms ease;
}
.custom-creation-tab:hover,
.custom-creation-tab.is-active { color: #111318; }
.custom-creation-tab.is-locked { opacity: .46; }
.custom-creation-tab.is-locked:hover { color: #59606b; opacity: .72; }
.custom-creation-tab small {
  color: #a3a8b1;
  font-size: 8px;
  font-weight: 700;
}
.custom-creation-tab:focus-visible,
.custom-creation-back:focus-visible,
.custom-publish-trigger:focus-visible {
  outline: 2px solid rgba(37, 99, 235, .42);
  outline-offset: 2px;
}
.custom-creation-indicator {
  position: absolute;
  z-index: 2;
  bottom: 6px;
  left: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: #111318;
  transform-origin: left center;
  pointer-events: none;
  transition:
    width 420ms cubic-bezier(.22, 1, .36, 1),
    transform 420ms cubic-bezier(.22, 1, .36, 1);
}

.custom-creation-stage {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}
.custom-tool-host {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.custom-tool-host.is-active {
  animation: customToolEnter 280ms cubic-bezier(.16, 1, .3, 1) both;
}
.custom-tool-host[hidden] { display: none !important; }

.custom-app-mount,
.custom-app-mount > iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: #fff;
}
.custom-app-loading {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: #6f7681;
  text-align: center;
}
.custom-app-loading b { color: #22262c; font-size: 13px; }
.custom-app-loading em { font-size: 10.5px; font-style: normal; }
.custom-app-loading.is-error { color: #b42318; }
.custom-app-loading.is-error b { color: #7a271a; }

.custom-publish-trigger {
  position: absolute;
  right: 22px;
  bottom: 20px;
  z-index: 12;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 24, 39, .94);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 800;
  transition: transform 170ms ease, box-shadow 170ms ease, background 170ms ease;
}
.custom-publish-trigger:hover {
  background: #111827;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .28);
  transform: translateY(-1px);
}
.custom-publish-trigger:active { transform: translateY(0) scale(.985); }
.custom-publish-trigger[hidden] { display: none !important; }

/* 语音生成只在内容区内部滚动，定制创作页面本身始终保持单屏。 */
.custom-tool-host.is-voice {
  height: 100%;
  padding: 8px 12px 12px;
  overflow: hidden;
}
.custom-tool-host.is-voice .voice-lab-page.is-embedded {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}
.custom-tool-host.is-voice .vl-workbench {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.custom-tool-host.is-voice .vl-workbench > .glass-panel {
  min-height: 0;
  overflow: hidden;
}
.custom-tool-host.is-voice .vl-voice-list,
.custom-tool-host.is-voice .vl-audio-library,
.custom-tool-host.is-voice .vl-side-panel {
  min-height: 0;
}
.custom-tool-host.is-voice .vl-side-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
}
.custom-tool-host.is-voice.vl-view-switching { overflow: hidden; }
.custom-tool-host.is-voice .vl-editor-mode-tabs.is-switching { pointer-events: none; }

/* 真实音色库节点挂载在稳定的统一左栏宿主中。 */
body.workspace-shell-v2 .workspace-context-tool-host.is-voice-library {
  padding: 2px 5px 8px;
  overflow: hidden;
}
body.workspace-shell-v2 .workspace-context-tool-host.is-voice-library > .vl-library {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 4px 1px 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-section-head {
  margin: 0 5px 7px;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-section-head b {
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-section-head em {
  font-size: 10px;
  font-weight: 400;
  line-height: 1.45;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-tabs {
  min-height: 38px;
  flex-basis: 38px;
  gap: 3px;
  padding-bottom: 5px;
  margin-bottom: 6px;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-tabs button {
  height: 31px;
  padding-inline: 3px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 450;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-filters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 5px 0 7px;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-filters label {
  height: 31px;
  gap: 4px;
  padding-inline: 5px;
  border-color: #e2e2de;
  border-radius: 7px;
  background: #f7f7f5;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-filters select {
  font-size: 10.5px;
  font-weight: 430;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-list {
  flex: 1;
  min-height: 0;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-card {
  min-height: 40px;
  gap: 5px;
  padding: 4px 5px 4px 7px;
  border-radius: 6px;
  overflow: visible;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-card.is-mine {
  min-height: 40px;
  padding-right: 5px;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-core {
  gap: 6px;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-core > svg {
  width: 13px;
  height: 13px;
  flex: none;
  opacity: .76;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-core b {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 11.5px;
  font-weight: 420;
  line-height: 1.35;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-source {
  display: none;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: end;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-toggle.icon-btn.tiny {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border: 0;
  border-radius: 6px;
  color: #777b82;
  background: transparent;
  box-shadow: none;
  transform: none;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-toggle.icon-btn.tiny:hover,
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-toggle.icon-btn.tiny[aria-expanded="true"] {
  color: #15171b;
  background: rgba(15, 23, 42, .065);
  box-shadow: none;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-toggle.icon-btn.tiny:focus-visible {
  outline: 2px solid rgba(17, 19, 24, .28);
  outline-offset: 1px;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-popover {
  position: fixed;
  z-index: 1600;
  width: 176px;
  display: grid;
  gap: 2px;
  padding: 5px;
  border: 1px solid rgba(15, 23, 42, .09);
  border-radius: 10px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16), 0 2px 8px rgba(15, 23, 42, .07);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-popover[hidden] {
  display: none;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-popover.is-open {
  animation: vlVoiceMenuIn 130ms cubic-bezier(.2, .8, .2, 1) both;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-item {
  width: 100%;
  min-height: 31px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  color: #34373d;
  background: transparent;
  font: inherit;
  font-size: 11.5px;
  font-weight: 430;
  text-align: left;
  cursor: pointer;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-item svg {
  flex: none;
  color: #727780;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-item:hover,
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-item:focus-visible {
  outline: 0;
  color: #111318;
  background: rgba(15, 23, 42, .06);
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-item.is-active {
  color: #1f4f9a;
  background: rgba(31, 79, 154, .07);
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-item.danger {
  color: #ae2e3b;
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-item.danger:hover,
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-item.danger:focus-visible {
  background: rgba(174, 46, 59, .075);
}
body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-separator {
  height: 1px;
  margin: 3px 6px;
  background: rgba(15, 23, 42, .08);
}
@keyframes vlVoiceMenuIn {
  from { opacity: 0; transform: translateY(-3px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 语音调试台把预览整合成单层主区域，参数稳定收在右栏底部。 */
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console {
  display: flex;
  flex-direction: column;
}
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-slot {
  position: relative;
  min-height: clamp(270px, 42vh, 410px);
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1 1 auto;
  gap: 0;
  margin-bottom: 10px;
  padding: 14px 16px 16px;
  border: 1px solid rgba(15, 23, 42, .07);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 45%, rgba(87, 112, 255, .045), transparent 46%),
    #fbfbfa;
  box-shadow: none;
}
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-title {
  padding-bottom: 10px;
}
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-title b {
  font-weight: 520;
}
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-empty,
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-loading {
  position: relative;
  height: 100%;
  min-height: 210px;
  overflow: hidden;
  padding: 20px 12px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-empty.is-error {
  border: 0;
  background: transparent;
}
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-empty:not(.is-error)::before,
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-loading::before {
  content: "";
  position: absolute;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(85, 104, 220, .11);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 116, 228, .07), transparent 68%);
  animation: vlOutputAmbient 3.2s ease-in-out infinite;
  pointer-events: none;
}
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-empty > *,
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-loading > * {
  position: relative;
  z-index: 1;
}
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-empty:not(.is-error) svg {
  animation: vlOutputIconBreathe 2.8s ease-in-out infinite;
}
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-loading {
  animation: vlOutputWaiting 2.2s ease-in-out infinite;
}
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-slot .vl-player {
  min-height: 100%;
  align-content: center;
  gap: 10px;
  padding: 18px 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-current-voice {
  flex: 0 0 auto;
}
body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-voice-parameters {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 14px;
}
@keyframes vlOutputAmbient {
  0%, 100% { opacity: .45; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes vlOutputIconBreathe {
  0%, 100% { opacity: .62; transform: translateY(1px) scale(.96); }
  50% { opacity: 1; transform: translateY(-2px) scale(1.04); }
}
@keyframes vlOutputWaiting {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(76, 96, 220, .025); }
}
@media (prefers-reduced-motion: reduce) {
  body.workspace-shell-v2 .workspace-context-tool-host .vl-voice-menu-popover.is-open,
  body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-empty::before,
  body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-loading,
  body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-loading::before,
  body.workspace-shell-v2 .custom-tool-host.is-voice .vl-console .vl-output-empty svg {
    animation: none;
  }
}

@media (min-width: 901px) {
  body.workspace-shell-v2 .custom-tool-host.is-voice.is-active {
    animation: none;
    transform: none;
  }
  body.workspace-shell-v2 .custom-tool-host.is-voice .vl-workbench {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .68fr);
    border-color: transparent;
    background: #fff;
  }
  body.workspace-shell-v2 .custom-tool-host.is-voice .vl-editor {
    grid-column: 1;
    background: #fff;
  }
  body.workspace-shell-v2 .custom-tool-host.is-voice .vl-side-panel {
    grid-column: 2;
    background: #fff;
  }
  body.workspace-shell-v2 .custom-tool-host.is-voice .vl-side-panel > .vl-section-head:first-child {
    padding-right: 58px;
  }
}

/* 无限画布把常用视图控制放入主站上下文栏，子应用只保留创作画布。 */
.workspace-context-shell.has-canvas-context-tools {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}
.workspace-context-shell.has-canvas-context-tools > .canvas-context-tools { grid-row: 3; }
.workspace-context-shell.has-canvas-context-tools > .workspace-account-footer { grid-row: 4; }
.canvas-context-tools {
  margin: 0 4px 8px;
  padding: 9px 7px 7px;
  display: grid;
  gap: 8px;
  border-top: 1px solid #ececea;
  color: #777771;
}
.canvas-context-tools > span {
  font-size: 10.5px;
  font-weight: 450;
}
.canvas-context-portal {
  min-height: 154px;
  display: grid;
  place-items: center;
}
.canvas-context-portal .canvas-viewport-controls--portal {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.canvas-context-portal .canvas-viewport-minimap {
  position: relative;
  width: 196px;
  height: 116px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #deded9;
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 4px 14px rgba(18, 18, 16, .055);
  cursor: crosshair;
  touch-action: none;
}
.canvas-context-portal .canvas-viewport-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 0, 0, .035) 1px, transparent 1px);
  background-size: 20px 20px;
}
.canvas-context-portal .canvas-viewport-item,
.canvas-context-portal .canvas-viewport-window {
  position: absolute;
}
.canvas-context-portal .canvas-viewport-item {
  border-radius: 2px;
}
.canvas-context-portal .canvas-viewport-item.is-image { background: rgba(20, 20, 18, .16); }
.canvas-context-portal .canvas-viewport-item.is-text { background: rgba(74, 96, 244, .22); }
.canvas-context-portal .canvas-viewport-item.is-shape {
  border: 1px solid rgba(20, 20, 18, .24);
}
.canvas-context-portal .canvas-viewport-item.is-other { background: rgba(20, 20, 18, .10); }
.canvas-context-portal .canvas-viewport-window {
  border: 1px solid rgba(20, 20, 18, .28);
  background: rgba(255, 255, 255, .22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72);
}
.canvas-context-portal .canvas-viewport-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid #deded9;
  border-radius: 9px;
  background: #f4f4f1;
  box-shadow: 0 3px 10px rgba(18, 18, 16, .04);
}
.canvas-context-portal .canvas-viewport-button {
  min-width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  color: #4f4f4a;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}
.canvas-context-portal .canvas-viewport-button:hover,
.canvas-context-portal .canvas-viewport-button:focus-visible {
  outline: 0;
  color: #171716;
  background: #e7e7e2;
  transform: translateY(-1px);
}
.canvas-context-portal .canvas-viewport-button svg {
  width: 14px;
  height: 14px;
}
.canvas-context-portal .canvas-viewport-zoom {
  min-width: 54px;
  padding: 0 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-align: center;
}
.canvas-context-portal .canvas-viewport-divider {
  width: 1px;
  height: 16px;
  margin: 0 2px;
  background: #d8d8d3;
}

/* 统一发布桥接弹窗。 */
.custom-publish-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.custom-publish-head em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}
.custom-publish-body {
  display: grid;
  gap: 14px;
  max-height: min(68vh, 680px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.custom-publish-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.custom-publish-copy-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.custom-publish-copy-field textarea { resize: vertical; }
.custom-publish-cover {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}
.custom-publish-cover-frame {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px dashed transparent;
  background: #eef1f5;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.custom-publish-cover-frame:hover,
.custom-publish-cover-frame:focus-visible {
  border-color: rgba(15, 23, 42, .28);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, .05);
}
.custom-publish-cover-frame.is-dragover {
  border-color: var(--text);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 23, 42, .08);
}
.custom-publish-cover-frame.is-busy {
  cursor: wait;
  opacity: .72;
}
.custom-publish-cover-frame.is-disabled {
  cursor: not-allowed;
  opacity: .62;
  pointer-events: none;
}
.custom-publish-cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.custom-publish-cover-frame > div {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px;
  color: var(--muted);
  text-align: center;
}
.custom-publish-cover-frame b { color: var(--text); font-size: 11px; }
.custom-publish-cover-frame em { font-size: 9px; font-style: normal; line-height: 1.5; }
.custom-publish-cover > div:last-child { display: grid; justify-items: start; gap: 8px; }
.custom-publish-cover p { color: var(--muted); font-size: 11px; line-height: 1.65; }
.custom-publish-cover-reference-zone {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 1px dashed rgba(15, 23, 42, .2);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.custom-publish-cover-reference-zone span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
}
.custom-publish-cover-reference-zone small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}
.custom-publish-cover-reference-zone:hover,
.custom-publish-cover-reference-zone:focus-visible,
.custom-publish-cover-reference-zone.is-dragover {
  border-color: var(--text);
  background: #f8fafc;
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, .05);
}
.custom-publish-cover-reference-zone.is-busy { cursor: wait; opacity: .72; }
.custom-publish-cover-reference-zone.is-disabled { cursor: not-allowed; opacity: .62; pointer-events: none; }
.custom-publish-cover-reference-list {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.custom-publish-cover-reference-list > em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}
.custom-publish-cover-reference-list.is-disabled {
  opacity: .62;
  pointer-events: none;
}
.custom-publish-cover-ref {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 38px;
}
.custom-publish-cover-ref-preview {
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, .12);
  background: #eef1f5;
  cursor: zoom-in;
}
.custom-publish-cover-ref-preview:hover,
.custom-publish-cover-ref-preview:focus-visible {
  border-color: var(--text);
  outline: none;
}
.custom-publish-cover-ref-preview img { width: 100%; height: 100%; object-fit: cover; }
.custom-publish-cover-ref-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, .16);
  border-radius: 50%;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}
.custom-publish-cover-ref-remove:hover { color: #b42318; border-color: rgba(180, 35, 24, .35); }
.custom-publish-cover-controls {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.custom-publish-cover-controls > label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9.5px;
}
.custom-publish-cover-controls .input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding-block: 0;
  font-size: 10.5px;
}
.custom-publish-cover-palette-control {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}
.custom-publish-cover-palette-control .btn {
  height: 34px;
  padding-inline: 10px;
  white-space: nowrap;
}
.custom-publish-cover-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.custom-publish-status {
  padding: 9px 11px;
  border: 1px solid rgba(15, 23, 42, .07);
  color: var(--muted);
  background: #f8fafc;
  font-size: 10.5px;
  line-height: 1.55;
}

@keyframes customToolEnter {
  from { opacity: 0; transform: translate3d(0, 5px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (max-width: 860px) {
  .custom-creation-header {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding-inline: 12px;
  }
  .custom-creation-header-spacer { display: none; }
  .custom-creation-tabs { min-width: 0; gap: clamp(12px, 3vw, 26px); }
  .custom-creation-back span { display: none; }
  .custom-publish-grid { grid-template-columns: 1fr; }
  .custom-publish-cover-controls { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .custom-creation-shell { grid-template-rows: 44px minmax(0, 1fr); }
  .custom-creation-header { padding-inline: 8px; }
  .custom-creation-tabs { gap: 9px; }
  .custom-creation-tab { font-size: 10.5px; }
  .custom-creation-tab small { display: none; }
  .custom-publish-trigger { right: 12px; bottom: 12px; }
  .custom-tool-host.is-voice { padding: 6px; }
  .custom-publish-cover { grid-template-columns: 112px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .custom-creation-indicator { transition-duration: 1ms; }
  .custom-tool-host { animation-duration: 1ms; transform: none; }
}
