:root {
  --form-control-height: 44px;
  --control-focus: #5f697b;
  scrollbar-color: #c8ccd5 transparent;
}
::-webkit-scrollbar,
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

select,
button[aria-haspopup="listbox"],
.toolbox-selector-trigger,
input[type="search"],
input[type="date"],
input[type="datetime-local"],
:is(dialog, [role="dialog"]) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]) {
  box-sizing: border-box;
  height: var(--form-control-height);
  min-height: var(--form-control-height);
}
.toolbox-selector-trigger {
  padding-block: 5px;
}

/* Keep content aligned with the native panel; scrollbar rails sit outside its inset. */
.toolbox-editor-panel-root,
.viral-results {
  --toolbox-panel-inset: 10px;
}
.toolbox-editor-panel-root .depth-video-clone-editor-content,
.ui-ecommerce-config-panel .ecommerce-config-root > .overflow-y-auto,
.viral-editor-body,
.viral-results-body {
  margin-inline: calc(-1 * var(--toolbox-panel-inset));
  padding-inline: var(--toolbox-panel-inset);
  scrollbar-gutter: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(125,134,153,.42) transparent;
}
.toolbox-editor-panel-root .depth-video-clone-editor-content {
  overflow-y: auto;
}
.depth-video-clone-editor-content > .depth-video-clone-input-shell {
  margin-inline: 0;
}
.ui-ecommerce-config-panel .ecommerce-config-root > .overflow-y-auto,
.ecommerce-preview-tabs ~ .overflow-y-auto {
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: rgba(125,134,153,.42) transparent;
}
.ecommerce-preview-tabs ~ .overflow-y-auto {
  margin-inline: -16px;
  padding-inline: 16px;
}
.toolbox-editor-panel-root .depth-video-clone-editor-content::-webkit-scrollbar,
.ui-ecommerce-config-panel .ecommerce-config-root > .overflow-y-auto::-webkit-scrollbar,
.ecommerce-preview-tabs ~ .overflow-y-auto::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background: transparent;
}
.toolbox-editor-panel-root .depth-video-clone-editor-content::-webkit-scrollbar-track,
.ui-ecommerce-config-panel .ecommerce-config-root > .overflow-y-auto::-webkit-scrollbar-track,
.ecommerce-preview-tabs ~ .overflow-y-auto::-webkit-scrollbar-track {
  background: transparent;
}
.toolbox-editor-panel-root .depth-video-clone-editor-content::-webkit-scrollbar-thumb,
.ui-ecommerce-config-panel .ecommerce-config-root > .overflow-y-auto::-webkit-scrollbar-thumb,
.ecommerce-preview-tabs ~ .overflow-y-auto::-webkit-scrollbar-thumb {
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(125,134,153,.42);
  background-clip: padding-box;
}
@media (max-width: 639px) {
  .toolbox-editor-panel-root,
  .viral-results { --toolbox-panel-inset: 8px; }
  .ecommerce-preview-tabs ~ .overflow-y-auto { margin-inline: -12px; padding-inline: 12px; }
}

.legacy-queue-state-label,
.toolbox-selector-label,
.material-add-caption-text {
  color: #5f697b !important;
  font-size: 12px !important;
  letter-spacing: normal !important;
  line-height: 1.25 !important;
}
[aria-label="编辑区"] .text-muted,
[aria-label="预览区"] .text-muted {
  color: #5f697b !important;
}
[aria-label="编辑区"] .shrink-0.tabular-nums.text-muted {
  font-size: 12px;
}
.script-prompt-reference-char-count {
  font-size: 12px !important;
}
.reference-slot-upload-hitarea:focus-visible {
  outline:1px solid #5f697b;
  outline-offset:-1px;
}

.legacy-image-processing-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.legacy-image-processing-editor {
  flex: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin-bottom: 10px;
}
.legacy-image-processing-editor .script-prompt-reference-toolbar {
  padding: 12px;
}
.legacy-image-processing-scroll[data-has-reference="false"] .script-prompt-toolbar-materials > .script-prompt-material-tray > div > div {
  width: 100%;
  margin: 0;
}
.legacy-image-processing-scroll[data-has-reference="false"] .image-generation-reference-materials-button {
  width: 100% !important;
  height: 88px !important;
  border-style: dashed;
}
.legacy-image-processing-editor .material-add-caption-content {
  position: static !important;
  gap: 8px !important;
}
.legacy-image-processing-editor .material-add-caption-icon,
.legacy-image-processing-editor .material-add-caption-text {
  position: static !important;
  transform: none !important;
}
.legacy-image-processing-editor .script-prompt-reference-editor-shell {
  flex: none;
  height: 144px;
  min-height: 144px !important;
  border-top: 1px solid var(--color-border);
}
.legacy-image-processing-scroll[data-image-feature="image-enhance"] .script-prompt-reference-editor-shell {
  display: none;
}
.legacy-image-processing-scroll [aria-label="操作指引"] p,
.legacy-image-processing-scroll figcaption {
  font-size: 12px;
}
.legacy-image-processing-panel .ai-image-panel-title-row {
  min-height: 32px;
}
.legacy-image-processing-scroll [aria-label="操作指引"] ol {
  margin-top: 6px;
}
.legacy-image-processing-scroll [aria-label="操作指引"] li + li {
  margin-top: 6px;
}
@media (min-width: 1440px) {
  /* Align the dates with tool text, excluding the filter panel and button padding. */
  .account-ledger-date-filters {
    margin-bottom: 24px;
  }
}
@media (max-height: 800px) {
  .legacy-image-processing-editor .script-prompt-reference-toolbar {
    padding: 8px;
  }
  .legacy-image-processing-scroll[data-has-reference="false"] .image-generation-reference-materials-button {
    height: 64px !important;
  }
}

.workbench-queue-stats{display:flex;flex-wrap:wrap;gap:6px;flex-shrink:0;margin-top:6px}
.workbench-queue-badge{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;border:0;border-radius:4px;padding:4px 7px;font-size:12px;font-weight:600;line-height:1.4;font-variant-numeric:tabular-nums;white-space:nowrap}
.workbench-queue-badge[data-state="queued"]{color:#991b1b;background:#fee2e2}
.workbench-queue-badge[data-state="processing"]{color:#166534;background:#dcfce7}

/* Keep keyboard markers inside controls; editors and selects retain their own styling. */
:root :is(button:not([aria-haspopup="listbox"]),input:is([type="checkbox"],[type="radio"],[type="range"],[type="file"],[type="color"],[type="button"],[type="submit"],[type="reset"],[type="image"]),a,summary,[tabindex]:not(input,textarea,select,[contenteditable],[role="textbox"],[aria-haspopup="listbox"])):focus-visible { outline:1px solid var(--control-focus); outline-offset:-1px; --tw-ring-shadow:0 0 #0000; --tw-ring-offset-shadow:0 0 #0000; }
:root :is(button,a,select,summary,[tabindex]):focus:not(:focus-visible) { outline:none; }
:root :is(select,button[aria-haspopup="listbox"]):focus-visible { outline:none; }

/* The card module has a legacy purple focus shadow beneath the shared neutral outline. */
#redeem-recharge-card-code:focus { box-shadow:none; border-color:#dfe3eb; }

/* Keep commerce copy scrollable above its action and shared upload guidance. */
.ecommerce-extra-instruction-editor {
  flex: 1 1 40px !important;
  height: auto;
  min-height: 40px;
}
.ecommerce-extra-instruction-panel {
  border-color: #dfe3e8 !important;
  border-radius: 10px !important;
  background: #f5f5f6 !important;
  box-shadow: inset 0 2px 6px rgba(15, 23, 42, 0.055), 0 1px 2px rgba(15, 23, 42, 0.02) !important;
}
.ecommerce-extra-instruction-panel [data-mention-editor] {
  background: transparent !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  padding: 14px 16px !important;
}
.ecommerce-extra-instruction-panel [data-mention-placeholder] {
  top: 14px !important;
  right: 16px !important;
  left: 16px !important;
  color: #657186 !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  opacity: 1 !important;
}
.ui-ecommerce-config-panel [aria-label="操作指引"] {
  padding: 8px 12px !important;
}
.ui-ecommerce-config-panel [aria-label="操作指引"] ol {
  margin-top: 6px !important;
}
.ui-ecommerce-config-panel [aria-label="操作指引"] li + li {
  margin-top: 4px !important;
}
.ui-ecommerce-config-panel [aria-label="操作指引"] p {
  line-height: 1.25 !important;
}
.ui-ecommerce-config-panel .video-generation-script-helper-button:disabled {
  color: #0471fe !important;
  opacity: 1 !important;
}
.ui-ecommerce-product-images,
[data-commerce-color-card] {
  height: calc(var(--commerce-product-add-size) + 26px) !important;
  max-height: 130px;
  min-height: 0 !important;
}
.commerce-upload-card-label {
  overflow: hidden;
  font-size: 9px !important;
  line-height: 18px !important;
  padding-block: 0 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.commerce-product-guide {
  top: calc(var(--commerce-product-add-size) + 34px) !important;
  left: 0 !important;
  width: calc(100% + var(--commerce-product-add-size) + 0.5rem) !important;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
}
.ui-ecommerce-product-images:has(.product-image-add-trigger:hover) .commerce-product-guide,
.ui-ecommerce-product-images:has(.product-image-add-trigger:focus-visible) .commerce-product-guide {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* Match the shared 22px line-icon scale while preserving the toggle hit area. */
.workspace-sidebar-drawer-icon {
  width: 22px !important;
  height: 22px !important;
}
/* Shared legacy controls follow the same focus owner as the main frontend. */
.frontend-select-trigger:focus-visible{outline:none!important}
