/*
 * 元镜数字平台 · Precision Production Console
 * 全站视觉层：克制、专业、清晰。业务结构与交互逻辑保留在原样式中。
 */

:root {
  --ink: #172033;
  --ink-strong: #101828;
  --muted: #667085;
  --muted-soft: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --canvas: #f4f6fa;
  --primary: #5548df;
  --primary-dark: #4338ca;
  --primary-soft: #f0efff;
  --accent: #4f46e5;
  --highlight: #14805e;
  --danger: #d1435b;
  --warning: #a65f00;
  --radius: 12px;
  --radius-control: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .025), 0 6px 18px rgba(16, 24, 40, .04);
  --shadow-float: 0 16px 48px rgba(16, 24, 40, .14);
  --type-page-title: 26px;
  --type-section-title: 16px;
  --type-body: 14px;
  --type-control: 13px;
  --type-support: 12px;
  --type-caption: 11px;
  --type-micro: 10px;
  font-family: Inter, "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html { font-size: 14px; color-scheme: light; }
body { min-width: 320px; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.55; }
h1, h2, h3, h4, strong { color: var(--ink-strong); }
h1 { margin-bottom: 4px; font-size: var(--type-page-title); line-height: 34px; font-weight: 680; letter-spacing: -.035em; }
h2 { font-size: 16px; line-height: 24px; font-weight: 650; letter-spacing: -.015em; }
h3 { font-size: 14px; line-height: 22px; font-weight: 650; }
p { color: var(--muted); }
a { color: var(--primary); }
button, input, textarea, select { letter-spacing: 0; }
button:focus-visible,
a:focus-visible,
summary:focus-visible { outline: 2px solid rgba(85, 72, 223, .58); outline-offset: 2px; }
.eyebrow { color: #526071; font-size: 10px; line-height: 16px; font-weight: 750; letter-spacing: .13em; }

/* Core controls */
.button {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--radius-control);
  font-size: 13px;
  line-height: 20px;
  font-weight: 650;
  letter-spacing: 0;
  box-shadow: none;
  transition: color .15s, background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.button:hover { transform: translateY(-1px); }
.button-primary,
html[data-theme="light"] .button-primary {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(85, 72, 223, .18);
}
.button-primary:hover,
html[data-theme="light"] .button-primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(85, 72, 223, .22);
}
.button-secondary,
html[data-theme="light"] .button-secondary {
  color: #344054;
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: none;
}
.button-secondary:hover,
html[data-theme="light"] .button-secondary:hover {
  color: var(--ink-strong);
  border-color: #b7bdc8;
  background: #f9fafb;
}
.button-danger,
html[data-theme="light"] .button-danger {
  color: #c4324b;
  border-color: #efb6c1;
  background: #fff5f7;
  box-shadow: none;
}
.button-danger:hover,
html[data-theme="light"] .button-danger:hover {
  color: #a91f39;
  border-color: #e891a1;
  background: #ffe9ed;
  box-shadow: 0 4px 12px rgba(196, 50, 75, .1);
}
.button-small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.text-button { color: var(--primary); }

label { gap: 6px; color: #344054; font-size: 12px; line-height: 18px; font-weight: 620; }
label small { color: var(--muted); line-height: 18px; font-weight: 450; }
input,
textarea,
select,
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: #fff;
  box-shadow: none;
  font-size: 13px;
}
textarea { min-height: 132px; line-height: 1.65; }
input::placeholder,
textarea::placeholder,
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #98a2b3; }
input:hover,
textarea:hover,
select:hover { border-color: #b8c0cc; }
input:focus,
textarea:focus,
select:focus,
html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] select:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(85, 72, 223, .1);
}
input:disabled,
textarea:disabled,
select:disabled { color: #98a2b3; border-color: var(--line); background: #f2f4f7; }

/* Native selection controls must not inherit text-field dimensions or focus frames. */
input[type="checkbox"],
input[type="radio"],
html[data-theme="light"] input[type="checkbox"],
html[data-theme="light"] input[type="radio"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 16px;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--primary);
}
input[type="checkbox"]:hover,
input[type="radio"]:hover,
input[type="checkbox"]:focus,
input[type="radio"]:focus,
html[data-theme="light"] input[type="checkbox"]:focus,
html[data-theme="light"] input[type="radio"]:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}
input[type="checkbox"]:focus,
input[type="radio"]:focus { outline: none; }
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid rgba(85, 72, 223, .58);
  outline-offset: 2px;
}

.panel,
.metric-card,
.detail-status,
.asset-card,
.voice-asset-card,
.copy-card,
.audio-work-card,
.dashboard-panel,
.dashboard-metrics > a,
html[data-theme="light"] .panel,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .detail-status,
html[data-theme="light"] .asset-card,
html[data-theme="light"] .voice-asset-card,
html[data-theme="light"] .copy-card,
html[data-theme="light"] .audio-work-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel { padding: 16px; }
.panel-heading { margin-bottom: 14px; }
.panel-heading h2 { font-size: 16px; line-height: 24px; }
.panel-heading p { color: var(--muted); font-size: 12px; line-height: 18px; }

.ui-tabs,
html[data-theme="light"] .ui-tabs {
  min-height: 42px;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f9fb;
}
.ui-tab {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}
.ui-tab:hover { color: var(--ink); background: rgba(255, 255, 255, .7); }
.ui-tab.is-active,
html[data-theme="light"] .ui-tab.is-active {
  color: var(--ink-strong);
  border-color: var(--line);
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .07);
}

.status,
.ui-badge { font-weight: 650; letter-spacing: 0; }
.status { min-height: 24px; align-items: center; padding: 3px 8px; }
.ui-badge { min-height: 20px; padding: 2px 7px; border-radius: 6px; }
.status-completed { color: #08745a; border-color: #b7e3d3; background: #eefaf6; }
.status-processing { color: #3531a8; border-color: #d7d5fb; background: #f2f1ff; }
.status-failed { color: #b4233c; border-color: #f1c6cd; background: #fff1f3; }
.status-queued,
.status-submitted { color: #8a4b05; border-color: #efd7ad; background: #fff7e9; }
.status-neutral { color: #475467; border-color: #e0e3e8; background: #f5f6f8; }

/* App shell */
.app-shell { grid-template-columns: 206px minmax(0, 1fr); min-height: 100vh; }
.app-frame {
  min-width: 0;
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  overflow: hidden;
}
.sidebar,
html[data-theme="light"] .sidebar {
  z-index: 30;
  width: auto;
  height: 100vh;
  padding: 14px 12px 12px;
  color: var(--ink);
  border-right: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}
.sidebar::after { display: none; }
.sidebar-brand {
  min-height: 46px;
  gap: 10px;
  padding: 1px 6px 18px;
  color: var(--ink-strong);
}
.sidebar-brand strong { color: var(--ink-strong); font-size: 14px; font-weight: 680; }
.sidebar-brand > small,
html[data-theme="light"] .sidebar-brand > small { left: 50px; bottom: 8px; color: #98a2b3; font-size: 8px; }
.brand-mark.small,
html[data-theme="light"] .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 5px 12px rgba(85, 72, 223, .18);
}
.nav-list { gap: 3px; }
.nav-list > a,
html[data-theme="light"] .nav-list > a {
  position: relative;
  min-height: 38px;
  gap: 10px;
  padding: 8px 10px;
  color: #526071;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 520;
}
.nav-list > a span,
html[data-theme="light"] .nav-list > a span { color: #7a8699; }
.nav-list > a:hover,
html[data-theme="light"] .nav-list > a:hover {
  color: var(--ink-strong);
  border-color: transparent;
  background: #f5f6f8;
}
.nav-list > a.active,
html[data-theme="light"] .nav-list > a.active {
  color: #3730a3;
  border-color: #dddafa;
  background: var(--primary-soft);
  box-shadow: inset 2px 0 0 var(--primary);
}
.nav-list > a.active span,
html[data-theme="light"] .nav-list > a.active span { color: var(--primary); }
.nav-divider,
html[data-theme="light"] .nav-divider {
  padding: 17px 10px 6px;
  color: #98a2b3;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
}
.sidebar-bottom { gap: 9px; }
.sidebar-create-link,
html[data-theme="light"] .sidebar-create-link {
  min-height: 40px;
  padding: 7px 9px;
  color: #3730a3;
  border-color: #dddafa;
  border-radius: 9px;
  background: #f6f5ff;
  font-weight: 620;
}
.sidebar-create-link > span,
html[data-theme="light"] .sidebar-create-link > span {
  color: #fff;
  background: var(--primary);
  box-shadow: none;
}
.sidebar-tools > button,
.sidebar-more > summary { color: #667085; }
.sidebar-tools > button:hover,
.sidebar-more > summary:hover,
.sidebar-more[open] > summary,
html[data-theme="light"] .sidebar-tools > button:hover,
html[data-theme="light"] .sidebar-more > summary:hover,
html[data-theme="light"] .sidebar-more[open] > summary {
  color: var(--ink);
  border-color: var(--line);
  background: #f5f6f8;
}

.topbar,
html[data-theme="light"] .topbar {
  min-height: 58px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: none;
  backdrop-filter: blur(14px);
}
.topbar-context { color: #344054; font-size: 13px; font-weight: 600; }
.topbar-back-link {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-right: 7px;
  border-radius: 8px;
  color: #344054;
}
.topbar-back-link:hover { background: #f2f4f7; }
.topbar-context:has(.topbar-back-link) { display: flex; align-items: center; }
.topbar-credit,
html[data-theme="light"] .topbar-credit {
  min-height: 32px;
  padding: 4px 10px;
  color: #101828;
  border-color: #d0d5dd;
  background: #fff;
}
.topbar-credit > span,
html[data-theme="light"] .topbar-credit > span { color: #101828; }
.topbar-credit strong,
.topbar-credit small { color: #101828; font-weight: 800; }
.topbar-popover > summary:hover,
.topbar-popover[open] > summary { border-color: var(--line); background: #f7f8fa; }
.topbar-avatar,
html[data-theme="light"] .topbar-avatar {
  border: 0;
  color: #fff;
  background: var(--primary);
}
.topbar-dropdown,
.sidebar-more-panel,
html[data-theme="light"] .topbar-dropdown,
html[data-theme="light"] .sidebar-more-panel {
  border-color: var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-float);
}

.main-content,
html[data-theme="light"] .main-content {
  min-height: 0;
  overflow: auto;
  padding: 24px 28px 30px;
  background: var(--canvas);
}
.main-content.library-main,
html[data-theme="light"] .main-content.library-main {
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.library-main > .page-header,
.library-main > .ui-tabs,
.library-main > .billing-summary-grid { flex: 0 0 auto; }
.library-main > .voice-tab-panels,
.library-main > .works-tab-panels {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.library-main .voice-tab-panels > [role="tabpanel"],
.library-main .works-tab-panels > [role="tabpanel"] {
  height: 100%;
  min-height: 0;
}
.library-main .works-tab-panels > [role="tabpanel"] {
  overflow: auto;
  padding-right: 3px;
}
.library-main .voice-library {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.library-main .voice-library > .asset-model-options,
.library-main .voice-library > .voice-filter-toolbar { flex: 0 0 auto; }
.voice-upload-recommended {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  color: #475467;
  border: 1px solid #d9d5ff;
  border-radius: 9px;
  background: #f7f6ff;
  font-size: 10px;
  line-height: 17px;
}
.voice-upload-recommended > .ui-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--primary);
}
.voice-upload-recommended strong {
  margin-right: 6px;
  color: #5145cd;
  font-size: 10px;
}
.voice-library-results-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 3px 18px 0;
}
.library-main > .avatar-group-section,
.library-main > .avatar-material-library {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  align-content: start;
  padding: 0 3px 18px 0;
}
.library-main > .billing-history-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.library-main .billing-history-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.billing-history-table thead th {
  position: sticky;
  z-index: 2;
  top: 0;
  box-shadow: inset 0 -1px 0 var(--line);
}
.page-header {
  align-items: center;
  gap: 18px;
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}
.page-header h1 { margin: 1px 0 3px; font-size: 26px; line-height: 34px; }
.page-header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 19px; }

/* Dashboard */
.main-content.workbench-main {
  height: calc(100vh - 58px);
  min-height: 600px;
  overflow: auto;
  padding: 22px 28px 26px;
  background: var(--canvas);
}
.dashboard-overview { width: min(100%, 1240px); }
.dashboard-welcome { min-height: 72px; margin-bottom: 14px; }
.dashboard-welcome h1 { margin: 1px 0 2px; font-size: 27px; line-height: 35px; font-weight: 680; }
.dashboard-welcome p { font-size: 13px; line-height: 20px; }
.dashboard-welcome-actions { gap: 8px; }
.dashboard-metrics {
  gap: 0;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.dashboard-metrics > a {
  min-height: 78px;
  padding: 12px 15px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
.dashboard-metrics > a:last-child { border-right: 0; }
.dashboard-metrics > a:hover { transform: none; border-color: var(--line); background: #fafaff; }
.dashboard-metrics > a > span {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-soft);
}
.dashboard-metrics strong { font-size: 21px; line-height: 26px; }
.dashboard-metrics small { font-size: 12px; }
.dashboard-grid { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 14px; }
.dashboard-panel { min-height: 282px; padding: 16px; }
.dashboard-panel-heading h2 { font-size: 15px; line-height: 22px; }
.dashboard-recent-list > a { min-height: 54px; padding: 6px 2px; }
.dashboard-recent-list > a:hover { background: #fafaff; }
.dashboard-recent-cover { color: var(--primary); background: var(--primary-soft); }
.dashboard-checklist li > span { color: #667085; background: #f2f4f7; }
.dashboard-checklist li.is-ready > span { color: #08745a; background: #eaf8f2; }
.dashboard-primary-link {
  min-height: 42px;
  border-radius: 8px;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(85, 72, 223, .16);
}

/* Asset libraries */
.voice-page-header,
.avatar-page-header,
.works-page-header { align-items: center; }
.voice-tab-panels { margin-top: 6px; }
.works-tab-panels { margin-top: 14px; }
.voice-filter-toolbar {
  min-height: 40px;
  margin: 2px 0 12px;
  padding: 0 2px;
}
.voice-filter-dropdown > summary {
  min-height: 36px;
  padding: 6px 9px;
  color: #344054;
  border-radius: 7px;
  font-size: 12px;
}
.voice-filter-dropdown > summary:hover { border-color: var(--line); background: #f7f8fa; }
.voice-filter-dropdown[open] > summary,
.voice-filter-dropdown.has-value > summary,
html[data-theme="light"] .voice-filter-dropdown[open] > summary,
html[data-theme="light"] .voice-filter-dropdown.has-value > summary {
  color: #3730a3;
  border-color: #dddafa;
  background: var(--primary-soft);
}
.voice-filter-dropdown-menu,
html[data-theme="light"] .voice-filter-dropdown-menu {
  min-width: 190px;
  padding: 6px;
  border-color: var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-float);
}
.voice-filter-option { min-height: 36px; border-radius: 7px; color: #667085; font-size: 12px; }
.voice-filter-option:hover { color: var(--ink); background: #f5f6f8; }
.voice-filter-option.is-active { color: #3730a3; background: var(--primary-soft); }
.voice-filter-search { width: min(300px, 34vw); }
.voice-filter-search input,
html[data-theme="light"] .voice-filter-search input {
  min-height: 36px;
  padding: 7px 34px 7px 11px;
  border-color: var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}
.voice-filter-reset,
html[data-theme="light"] .voice-filter-reset {
  min-height: 36px;
  color: #475467;
  border-color: var(--line-strong);
  background: #fff;
}
.voice-card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 264px)); justify-content: start; gap: 12px; }
.voice-asset-card,
html[data-theme="light"] .voice-asset-card {
  min-height: 0;
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow);
}
.voice-asset-card:hover,
html[data-theme="light"] .voice-asset-card:hover {
  transform: none;
  border-color: #cbc7f4;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .07);
}
.voice-card-trigger { min-height: 90px; padding: 13px; }
.voice-card-play-icon,
html[data-theme="light"] .voice-card-play-icon {
  color: var(--primary);
  border-color: #d9d6f8;
  background: var(--primary-soft);
}
.voice-card-heading strong { font-size: 14px; line-height: 20px; }
.voice-card-content > small { color: var(--muted); font-size: 11px; line-height: 16px; }
.voice-waveform i,
html[data-theme="light"] .voice-waveform i { background: #98a2b3; }
.voice-card-footer,
html[data-theme="light"] .voice-card-footer {
  min-height: 42px;
  padding: 7px 10px;
  border-color: var(--line);
  background: #fafbfc;
}
.voice-card-play-hint { font-size: 10px; }
.voice-clone-button,
html[data-theme="light"] .voice-clone-button {
  color: #4338ca;
  border-color: #d7d4fa;
  background: #f2f1ff;
}
.voice-clone-button:hover:not(:disabled),
html[data-theme="light"] .voice-clone-button:hover:not(:disabled) {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}
.voice-card-manage-button { color: #667085; }

.avatar-group-grid,
.avatar-material-library .material-grid {
  grid-template-columns: repeat(auto-fill, minmax(176px, 202px));
  gap: 14px;
}
.avatar-group-card,
.material-card,
html[data-theme="light"] .avatar-group-card,
html[data-theme="light"] .material-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.avatar-group-card:hover,
.material-card:hover,
html[data-theme="light"] .avatar-group-card:hover,
html[data-theme="light"] .material-card:hover {
  transform: none;
  border-color: #cbc7f4;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .08);
}
.avatar-group-cover { border-radius: 11px; background: #eef1f6; }
.avatar-card-overlay { background: rgba(10, 16, 28, .08); }
.avatar-card-hover-actions .avatar-card-primary-action { background: var(--primary); }
.avatar-card-hover-actions.is-stacked {
  flex-direction: column;
  gap: 7px;
}
.avatar-card-hover-actions .avatar-card-delete-action,
html[data-theme="light"] .avatar-card-hover-actions .avatar-card-delete-action {
  color: #fff;
  border-color: rgba(255, 255, 255, .58);
  background: rgba(185, 42, 68, .86);
  box-shadow: 0 5px 14px rgba(35, 9, 15, .2);
}
.avatar-card-hover-actions .avatar-card-delete-action:hover,
html[data-theme="light"] .avatar-card-hover-actions .avatar-card-delete-action:hover {
  color: #fff;
  border-color: #fff;
  background: #a91f39;
}
.avatar-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.avatar-card-footer h2 { flex: 1 1 auto; min-width: 0; }
.avatar-card-footer .avatar-cover-status {
  position: static;
  flex: 0 0 auto;
  padding: 3px 7px;
  font-size: 10px;
  line-height: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .14);
}
.avatar-material-card .avatar-material-overlay {
  transition: background .18s ease;
}
.avatar-material-card:hover .avatar-material-overlay,
.avatar-material-card:focus-within .avatar-material-overlay {
  background: linear-gradient(180deg, rgba(5, 8, 14, .27), rgba(5, 8, 14, .38) 54%, rgba(5, 8, 14, .9) 100%);
}
.avatar-material-actions {
  top: 50%;
  right: auto;
  left: 50%;
  justify-content: center;
  gap: 8px;
  width: max-content;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 8px));
  transition: opacity .16s ease, transform .16s ease;
}
.avatar-material-card:hover .avatar-material-actions,
.avatar-material-card:focus-within .avatar-material-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}
.avatar-material-actions a,
.avatar-material-actions button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 50%;
  background: rgba(16, 24, 40, .72);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .24);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
.avatar-material-actions a:hover,
.avatar-material-actions button:hover {
  color: #fff;
  border-color: #fff;
  background: rgba(16, 24, 40, .92);
  transform: scale(1.06);
}
.avatar-material-actions a:focus-visible,
.avatar-material-actions button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.is-media-fallback { object-fit: cover !important; object-position: center !important; }

.copy-list-section:not(.is-empty) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.copy-card { min-height: 208px; padding: 15px; }
.copy-card-head h2 { font-size: 15px; line-height: 22px; }
.copy-card-head small { font-size: 11px; line-height: 16px; }
.copy-card > p,
html[data-theme="light"] .copy-card > p {
  min-height: 80px;
  color: #475467;
  font-size: 13px;
  line-height: 21px;
}
.copy-card details { border-color: var(--line); }

.ui-empty { color: var(--muted); }
.ui-empty-minimal { transform: none; }
.ui-empty-mark {
  color: #7c75d9;
  background: transparent;
  box-shadow: none;
}
.asset-dialog,
html[data-theme="light"] .asset-dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(16, 24, 40, .22);
}
.asset-dialog::backdrop { background: rgba(16, 24, 40, .52); backdrop-filter: blur(2px); }
.dialog-header { padding: 16px 18px 13px; border-color: var(--line); background: #fff; }
.dialog-header h2 { font-size: 18px; line-height: 26px; }
.dialog-actions { padding-top: 12px; border-top: 1px solid var(--line); }
.platform-confirm-dialog {
  width: min(92vw, 440px);
  overflow: hidden;
}
.platform-confirm-heading {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 34px;
  align-items: start;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
}
.platform-confirm-heading > div { min-width: 0; }
.platform-confirm-heading h2 {
  margin: 3px 0 0;
  font-size: 18px;
  line-height: 26px;
}
.platform-confirm-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #7a6ee6;
  border-radius: 12px;
  background: #f0edff;
}
.platform-confirm-symbol.is-danger {
  color: #c4324b;
  background: #fff0f3;
}
.platform-confirm-body { padding: 18px 20px 6px; }
.platform-confirm-body p {
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 22px;
}
.platform-confirm-body small {
  display: block;
  margin-top: 8px;
  color: #98a2b3;
  font-size: 11px;
  line-height: 18px;
}
.platform-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 20px 20px;
}
.platform-confirm-actions .button { min-width: 92px; }
.platform-confirm-actions .platform-confirm-submit.button-danger {
  color: #fff;
  border-color: #c4324b;
  background: #c4324b;
  box-shadow: 0 5px 14px rgba(196, 50, 75, .18);
}
.platform-confirm-actions .platform-confirm-submit.button-danger:hover {
  color: #fff;
  border-color: #a91f39;
  background: #a91f39;
}
.media-playback-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(92vw, 900px);
  height: min(86dvh, 740px);
  max-height: 86dvh;
  overflow: hidden;
}
html.media-dialog-open,
html.media-dialog-open body { overflow: hidden; }
.media-playback-dialog .dialog-header {
  position: relative;
  min-height: 88px;
}
.media-playback-stage {
  position: relative;
  display: flex;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #000;
}
.media-playback-stage video {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  flex: 0 0 auto;
  background: #000;
  object-fit: contain;
}
@media (max-width: 640px) {
  .media-playback-dialog[open] {
    width: calc(100vw - 16px);
    height: min(88dvh, 660px);
    max-height: 88dvh;
  }
  .media-playback-dialog .dialog-header { min-height: 82px; }
}

/* Works */
.video-work-grid {
  grid-template-columns: repeat(auto-fill, minmax(176px, 202px));
  justify-content: start;
  gap: 14px;
}
.video-work-card {
  border-color: #202737;
  border-radius: 12px;
  background: #101522;
  box-shadow: 0 7px 18px rgba(16, 24, 40, .12);
}
.video-work-card.is-portrait .video-work-card-preview,
.video-work-card.is-landscape .video-work-card-preview {
  aspect-ratio: 3 / 4;
}
.video-work-card:hover,
.video-work-card:focus-within { transform: none; box-shadow: 0 12px 26px rgba(16, 24, 40, .18); }
.video-work-card-actions a,
.video-work-card-actions button { width: 36px; height: 36px; background: rgba(16, 24, 40, .72); }
.audio-work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.audio-work-card {
  min-height: 150px;
  padding: 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.audio-work-card:hover { transform: none; border-color: #cbc7f4; box-shadow: 0 8px 20px rgba(16, 24, 40, .08); }
.audio-work-card-icon {
  color: var(--primary);
  background: var(--primary-soft);
}
.audio-work-card-copy strong { font-size: 14px; line-height: 20px; }
.audio-work-card-copy small { font-size: 11px; line-height: 16px; }
.audio-work-card-copy p { color: #667085; font-size: 12px; line-height: 19px; }
.audio-work-card-action { color: var(--primary); font-size: 11px; }

/* Detail pages */
.detail-status { min-height: 84px; margin-bottom: 12px; padding: 14px 16px; }
.status-orb { width: 42px; height: 42px; }
.detail-status h2 { margin: 5px 0 2px; font-size: 18px; line-height: 26px; }
.detail-status p { font-size: 12px; line-height: 18px; }
.video-detail-ready-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; }
.video-work-player-panel video { height: min(350px, calc(100vh - 352px)); min-height: 240px; border-radius: 10px; }
.video-detail-inspector { gap: 12px; }
.script-preview,
html[data-theme="light"] .script-preview {
  color: #475467;
  border-color: var(--line);
  background: #f8f9fb;
}
.audio-work-player-art {
  color: #6962c9;
  border-color: #dfdcfa;
  background: #f3f2ff;
}

/* Administration */
table { font-size: 12px; }
th {
  padding: 9px 10px;
  color: #667085;
  border-color: var(--line);
  background: #f8f9fb;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .04em;
}
td { padding: 10px; border-color: #edf0f3; }
tbody tr:hover,
html[data-theme="light"] tbody tr:hover { background: #fafaff; }
.search-form input { min-height: 40px; }
.inline-form input { min-height: 34px; }
.authorization-review-summary,
html[data-theme="light"] .authorization-review-summary { border-color: var(--line); background: #f8f9fb; }
.authorization-review-code,
html[data-theme="light"] .authorization-review-code { color: #4338ca; border-color: #d7d4fa; background: #f2f1ff; }
.settings-tabs-form { gap: 12px; padding-bottom: 64px; }
.settings-tab-panel { min-height: 260px; }
.settings-tab-panel .form-grid,
.settings-tab-panel .form-stack { max-width: 980px; }
.settings-note,
html[data-theme="light"] .settings-note {
  padding: 10px 12px;
  color: #667085;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9fb;
  font-size: 12px;
  line-height: 18px;
}
.toggle {
  min-height: 40px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}
.toggle input { width: 18px; height: 18px; min-height: 0; flex-basis: 18px; }
.settings-actions,
html[data-theme="light"] .settings-actions {
  min-height: 58px;
  padding: 8px 12px;
  border-color: var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -6px 16px rgba(16, 24, 40, .05);
}

/* Guided creation */
.main-content.creation-main,
html[data-theme="light"] .main-content.creation-main {
  height: calc(100vh - 58px);
  min-height: 600px;
  overflow: hidden;
  padding: 0;
  color: var(--ink);
  background: #f7f8fb;
}
.creation-main > .creation-wizard-header { display: none; }
.creation-wizard {
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) 74px;
  color: var(--ink);
  background: #f7f8fb;
}
.wizard-stage { min-height: 0; overflow: auto; padding: 24px 28px; }
.wizard-panel { width: min(1120px, 100%); min-height: 100%; color: var(--ink); }
.wizard-panel-heading { margin: 0 auto 20px; }
.wizard-panel-heading h2 {
  margin: 0 0 4px;
  color: var(--ink-strong);
  font-size: 24px;
  line-height: 32px;
  font-weight: 680;
}
.wizard-panel-heading p { color: var(--muted); font-size: 13px; line-height: 20px; }
.wizard-title-field,
html[data-theme="light"] .wizard-title-field {
  max-width: 650px;
  margin: 58px auto 0;
  color: var(--ink);
  background: transparent;
}
.wizard-title-field > span { margin-bottom: 10px; color: #344054; font-size: 13px; font-weight: 650; }
.wizard-title-field input {
  height: 58px;
  padding: 0 72px 0 16px;
  color: var(--ink);
  border: 1px solid #aba5ee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(85, 72, 223, .06);
  font-size: 15px;
  font-weight: 560;
}
.wizard-title-field small { top: 48px; right: 14px; color: var(--muted); font-size: 11px; }
.wizard-title-field small b { color: #344054; }
.wizard-title-field em { margin-top: 10px; color: var(--muted); font-size: 12px; }
.wizard-avatar-grid { grid-template-columns: repeat(4, minmax(132px, 164px)); gap: 13px; width: min(760px, 100%); }
.wizard-avatar-card,
html[data-theme="light"] .wizard-avatar-card {
  padding: 6px;
  color: var(--ink);
  border-radius: 11px;
  background: transparent;
}
.wizard-avatar-card:hover { border-color: #cbc7f4; background: #f4f3ff; }
.wizard-avatar-card.is-selected { border-color: var(--primary); background: #f7f6ff; box-shadow: 0 0 0 2px rgba(85, 72, 223, .1); }
.wizard-avatar-media { border-radius: 9px; background: #eef1f6; }
.wizard-avatar-card > strong { margin-top: 7px; color: var(--ink); font-size: 12px; line-height: 18px; }
.wizard-audio-tabs {
  margin-bottom: 14px;
  border-color: var(--line);
  background: #eef0f4;
}
.wizard-audio-tabs button { min-height: 34px; padding: 6px 14px; color: #667085; font-size: 12px; }
.wizard-audio-tabs button.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .09); }
.wizard-audio-grid { grid-template-columns: repeat(2, minmax(280px, 380px)); gap: 12px; width: min(800px, 100%); }
.wizard-audio-card,
html[data-theme="light"] .wizard-audio-card {
  min-height: 76px;
  padding: 12px 42px 12px 12px;
  color: var(--ink);
  border-color: var(--line);
  border-radius: 10px;
  background: #fff;
}
.wizard-audio-card:hover { border-color: #cbc7f4; background: #fafaff; }
.wizard-audio-card.is-selected { border-color: var(--primary); background: #f8f7ff; box-shadow: 0 0 0 2px rgba(85, 72, 223, .09); }
.wizard-audio-play,
.wizard-audio-card:nth-child(n) .wizard-audio-play {
  width: 42px;
  height: 42px;
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: none;
}
.wizard-audio-card strong { color: var(--ink); font-size: 13px; line-height: 19px; }
.wizard-audio-card small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 17px; }
.wizard-inline-empty { min-height: 180px; color: var(--muted); font-size: 13px; }

/* Creation step 1: title and grouped avatar library */
.wizard-stage:has([data-wizard-step="1"].is-active),
.wizard-stage:has([data-wizard-step="2"].is-active) { overflow: hidden; }
.wizard-panel[data-wizard-step="1"],
.wizard-panel[data-wizard-step="2"] {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.wizard-panel[data-wizard-step="1"] .wizard-panel-heading,
.wizard-panel[data-wizard-step="2"] .wizard-panel-heading { flex: 0 0 auto; margin-bottom: 12px; }
.wizard-first-step-layout {
  width: min(980px, 100%);
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 auto;
}
.wizard-first-step-layout .wizard-title-field,
html[data-theme="light"] .wizard-first-step-layout .wizard-title-field {
  width: min(820px, 100%);
  max-width: none;
  flex: 0 0 auto;
  margin: 0 auto;
  background: transparent;
}
.wizard-first-step-layout .wizard-title-field > span { margin-bottom: 7px; font-size: 12px; }
.wizard-first-step-layout .wizard-title-field input { height: 48px; font-size: 14px; }
.wizard-first-step-layout .wizard-title-field small { top: 40px; }
.wizard-first-step-layout .wizard-title-field em { margin-top: 7px; font-size: 11px; }
.wizard-avatar-browser {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.wizard-section-heading {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}
.wizard-section-heading div { min-width: 0; }
.wizard-section-heading strong { display: block; color: var(--ink); font-size: 13px; line-height: 19px; }
.wizard-section-heading small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 16px; }
.wizard-section-heading > span {
  max-width: 42%;
  overflow: hidden;
  padding: 5px 9px;
  color: #4338ca;
  border: 1px solid #dddafa;
  border-radius: 7px;
  background: #f7f6ff;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wizard-avatar-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding: 1px 3px 12px;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.wizard-avatar-scroll::-webkit-scrollbar,
.wizard-audio-results::-webkit-scrollbar { display: none; width: 0; height: 0; }
.wizard-avatar-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  align-content: start;
  gap: 12px;
}
.wizard-avatar-library-card {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.wizard-avatar-library-card:hover { transform: translateY(-1px); border-color: #cbc7f4; box-shadow: 0 8px 20px rgba(16,24,40,.08); }
.wizard-avatar-library-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  color: #667085;
  background: #eef1f6;
}
.wizard-avatar-library-cover > img { width: 100%; height: 100%; object-fit: cover; }
.wizard-avatar-library-cover > i {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  color: #fff;
  border-radius: 6px;
  background: rgba(16,24,40,.72);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}
.wizard-avatar-library-meta { display: block; padding: 9px 10px 10px; }
.wizard-avatar-library-meta strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wizard-avatar-library-meta small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 15px;
}
.wizard-avatar-material-panel {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.wizard-avatar-material-panel > header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 9px;
}
.wizard-avatar-material-panel > header > button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 9px;
  color: #475467;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 10px;
  font-weight: 650;
}
.wizard-avatar-material-panel > header strong,
.wizard-avatar-material-panel > header small { display: block; }
.wizard-avatar-material-panel > header strong { font-size: 12px; line-height: 18px; }
.wizard-avatar-material-panel > header small { color: var(--muted); font-size: 9px; line-height: 14px; }
.wizard-avatar-material-panel .wizard-avatar-grid {
  grid-template-columns: repeat(auto-fill, minmax(132px, 158px));
  justify-content: start;
  width: 100%;
  margin: 0;
}
.wizard-avatar-material-panel .wizard-avatar-media { aspect-ratio: 3 / 4; }
.wizard-avatar-card > small { display: block; margin: 0 3px 3px; color: var(--muted); font-size: 9px; text-align: center; }
.wizard-avatar-video-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: #667085; }

/* Creation step 1: persistent master-detail avatar picker */
.wizard-panel[data-wizard-step="1"] .wizard-panel-heading { margin-bottom: 28px; }
.wizard-panel[data-wizard-step="1"] .wizard-first-step-layout { width: min(1120px, 100%); gap: 22px; }
.wizard-panel[data-wizard-step="1"] .wizard-title-field,
html[data-theme="light"] .wizard-panel[data-wizard-step="1"] .wizard-title-field {
  width: 100%;
  display: block;
}
.wizard-panel[data-wizard-step="1"] .wizard-title-field input { width: 100%; }
.wizard-panel[data-wizard-step="1"] .wizard-title-field small { top: 17px; }
.wizard-panel[data-wizard-step="1"] .wizard-title-field em {
  margin: 7px 0 0;
  font-size: 11px;
}
.wizard-panel[data-wizard-step="1"] .wizard-avatar-browser {
  min-height: 0;
  padding-top: 0;
  border-top: 0;
}
.wizard-panel[data-wizard-step="1"] .wizard-section-heading { display: none; }
.wizard-avatar-picker {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(230px, 28%) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(16, 24, 40, .045);
}
.wizard-avatar-master,
.wizard-avatar-detail {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 24px;
}
.wizard-avatar-master { border-right: 1px solid var(--line); }
.wizard-avatar-master > header,
.wizard-avatar-detail > header { flex: 0 0 auto; margin-bottom: 22px; }
.wizard-avatar-master > header strong,
.wizard-avatar-detail > header strong {
  display: block;
  color: var(--ink-strong);
  font-size: 15px;
  line-height: 22px;
  font-weight: 720;
}
.wizard-avatar-master > header small,
.wizard-avatar-detail > header small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}
.wizard-avatar-master > .wizard-avatar-scroll { padding: 1px 1px 12px; }
.wizard-avatar-library-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.wizard-avatar-library-card {
  position: relative;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 10px;
  overflow: visible;
  border-radius: 10px;
  box-shadow: none;
}
.wizard-avatar-library-card:hover {
  transform: none;
  border-color: #cbc7f4;
  background: #fbfaff;
  box-shadow: none;
}
.wizard-avatar-library-card:focus-visible {
  outline: 3px solid rgba(101, 88, 232, .18);
  outline-offset: 2px;
}
.wizard-avatar-library-card.is-active {
  border-color: var(--primary);
  background: #fbfaff;
  box-shadow: 0 0 0 1px rgba(101, 88, 232, .08);
}
.wizard-avatar-library-cover {
  width: 66px;
  height: 70px;
  aspect-ratio: auto;
  border-radius: 8px;
}
.wizard-avatar-library-meta { min-width: 0; padding: 0; }
.wizard-avatar-library-meta strong { font-size: 13px; line-height: 20px; }
.wizard-avatar-library-meta small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 17px;
}
.wizard-avatar-detail { padding-bottom: 0; }
.wizard-avatar-detail > header { margin-bottom: 16px; }
.wizard-avatar-detail > .wizard-avatar-material-panel { min-height: 0; flex: 1 1 auto; }
.wizard-avatar-detail .wizard-avatar-scroll { padding: 1px 1px 16px; }
.wizard-avatar-detail .wizard-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 150px));
  align-content: start;
  justify-content: start;
  gap: 12px;
  width: 100%;
  margin: 0;
}
.wizard-avatar-detail .wizard-avatar-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  text-align: left;
  box-shadow: none;
}
.wizard-avatar-card-select {
  display: block;
  width: 100%;
  padding: 0;
  color: inherit;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
}
.wizard-avatar-detail .wizard-avatar-card:hover {
  transform: none;
  border-color: #bcb5f4;
  background: #fcfbff;
}
.wizard-avatar-detail .wizard-avatar-card-copy:focus-visible,
.wizard-avatar-detail .wizard-avatar-preview:focus-visible {
  outline: 3px solid rgba(101, 88, 232, .18);
  outline-offset: 2px;
}
.wizard-avatar-detail .wizard-avatar-card.is-selected {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(101, 88, 232, .08);
}
.wizard-avatar-detail .wizard-avatar-media {
  position: relative;
  aspect-ratio: 3 / 4;
  isolation: isolate;
  border-radius: 9px;
  background: #e9edf4;
}
.wizard-avatar-detail .wizard-avatar-media-backdrop,
.wizard-avatar-detail .wizard-avatar-media-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.wizard-avatar-detail .wizard-avatar-media-backdrop {
  z-index: 0;
  object-fit: cover;
  filter: blur(18px);
  opacity: .38;
  transform: scale(1.08);
}
.wizard-avatar-detail .wizard-avatar-media-poster {
  z-index: 1;
  object-fit: contain;
}
.wizard-avatar-detail .wizard-avatar-media i {
  z-index: 4;
  top: 8px;
  right: 8px;
  bottom: auto;
  width: 28px;
  height: 28px;
}
.wizard-avatar-preview {
  position: absolute;
  z-index: 5;
  top: calc((100% - 44px) / 2);
  left: 50%;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  background: rgba(20, 24, 36, .68);
  box-shadow: 0 5px 14px rgba(16, 24, 40, .2);
  transform: translate(-50%, -50%);
  transition: transform .16s, background .16s;
  backdrop-filter: blur(7px);
}
.wizard-avatar-preview:hover {
  background: var(--primary);
  transform: translate(-50%, -50%) scale(1.06);
}
.wizard-avatar-card-copy {
  display: block;
  width: 100%;
  padding: 10px 3px 2px;
  color: var(--ink-strong);
  background: #fff;
  text-align: left;
}
.wizard-avatar-card-copy > strong { display: block; }
.wizard-avatar-card-copy > strong {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 12px;
  line-height: 18px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wizard-avatar-detail-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  min-height: 74px;
  margin: 0 -24px;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
}
.wizard-avatar-detail-footer > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wizard-avatar-detail-footer > span strong { color: var(--primary); }
.wizard-avatar-detail-footer > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 170px;
  min-height: 42px;
  padding: 8px 18px;
  color: #fff;
  border-radius: 9px;
  background: var(--primary);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 7px 16px rgba(101, 88, 232, .2);
}
.wizard-avatar-detail-footer > button:hover:not(:disabled) { background: var(--primary-dark); }
.wizard-avatar-detail-footer > button:disabled {
  color: #98a2b3;
  background: #eef0f4;
  box-shadow: none;
  cursor: not-allowed;
}

/* Creation step 2: voice-asset style selection cards */
.wizard-panel[data-wizard-step="2"] .wizard-audio-tabs {
  width: min(900px, 100%);
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0 auto 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f2f4f7;
}
.wizard-panel[data-wizard-step="2"] .wizard-audio-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 12px;
  color: #667085;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}
.wizard-panel[data-wizard-step="2"] .wizard-audio-tabs button.is-active {
  color: #101828;
  border-color: #e4e7ec;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16,24,40,.08);
}
.wizard-audio-results {
  width: min(900px, 100%);
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  margin: 0 auto;
  padding: 0 3px 12px;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.wizard-audio-results .wizard-audio-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 264px));
  align-content: start;
  justify-content: start;
  gap: 12px;
  width: 100%;
  margin: 0;
}
.wizard-audio-results .wizard-audio-card,
html[data-theme="light"] .wizard-audio-results .wizard-audio-card {
  min-height: 132px;
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow);
}
.wizard-audio-results .wizard-audio-card:hover { transform: translateY(-1px); border-color: #cbc7f4; background: #fff; }
.wizard-audio-results .wizard-audio-card.is-selected { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(85,72,223,.1); }
.wizard-audio-card-main {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px 10px;
}
.wizard-audio-copy { min-width: 0; flex: 1 1 auto; }
.wizard-audio-copy > strong,
.wizard-audio-copy > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wizard-audio-copy .voice-waveform { width: 108px; margin-top: 7px; }
.wizard-audio-copy .voice-waveform i { background: #aab4c4; }
.wizard-audio-card.is-playing .wizard-audio-play {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(85, 72, 223, .2);
}
.wizard-audio-card.is-playing .voice-waveform i {
  background: var(--primary);
  animation: voice-wave 760ms ease-in-out infinite alternate;
}
.wizard-audio-card.is-playing .voice-waveform i:nth-child(2n) { animation-delay: -220ms; }
.wizard-audio-card.is-playing .voice-waveform i:nth-child(3n) { animation-delay: -420ms; }
.wizard-audio-script-preview {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: #667085;
  font-size: 10px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wizard-audio-card-footer {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
}
.wizard-audio-card-footer em {
  padding: 3px 7px;
  color: #067647;
  border: 1px solid #abefc6;
  border-radius: 999px;
  background: #ecfdf3;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}
.wizard-audio-card-footer b {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #667085;
  font-size: 10px;
  font-weight: 650;
}
.wizard-audio-card.is-selected .wizard-audio-card-footer b { color: var(--primary); }
.wizard-script-layout {
  grid-template-columns: minmax(0, 1.6fr) minmax(440px, .95fr);
  align-items: stretch;
  gap: 18px;
  width: min(1280px, 100%);
}
.wizard-script-editor,
.wizard-audio-preview,
html[data-theme="light"] .wizard-script-editor,
html[data-theme="light"] .wizard-audio-preview {
  color: var(--ink);
  border-color: var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.wizard-panel[data-wizard-step="3"] .wizard-panel-heading { margin-bottom: 8px; }
.wizard-panel[data-wizard-step="3"] .wizard-panel-heading h2 {
  margin-bottom: 2px;
  font-size: 21px;
  line-height: 28px;
}
.wizard-panel[data-wizard-step="3"] .wizard-panel-heading p { font-size: 11px; line-height: 17px; }
.wizard-script-editor {
  display: flex;
  flex-direction: column;
  padding: 16px;
}
.wizard-script-editor label > span,
.wizard-script-editor > label { color: #344054; font-size: 12px; }
.wizard-rich-script-field {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}
.wizard-rich-script-field > span {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}
.wizard-script-rich {
  width: 100%;
  min-height: 270px;
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  line-height: 26px;
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.wizard-script-rich:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(85, 72, 223, .1);
}
.wizard-script-rich:empty::before {
  color: #98a2b3;
  content: attr(data-placeholder);
  pointer-events: none;
}
.wizard-pause-token {
  display: inline-flex;
  align-items: center;
  margin: 0 3px;
  padding: 1px 7px;
  color: #5145cd;
  border: 1px solid #c9c5f5;
  border-radius: 6px;
  background: #f0efff;
  font-size: 11px;
  line-height: 20px;
  font-weight: 750;
  vertical-align: 1px;
  white-space: nowrap;
  user-select: all;
}
.wizard-script-editor textarea {
  min-height: 210px;
  max-height: 230px;
  color: var(--ink);
  border-color: var(--line-strong);
  background: #fff;
  font-size: 13px;
  line-height: 21px;
}
.wizard-script-tools button {
  color: #475467;
  border-color: var(--line-strong);
  background: #fff;
  font-size: 11px;
}
.wizard-script-ai-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.wizard-script-ai-actions button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  font-weight: 700;
}
.wizard-script-ai-actions button.is-primary {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 5px 12px rgba(85, 72, 223, .16);
}
.wizard-script-ai-actions button.is-primary:hover { color: #fff; border-color: #493bcf; background: #493bcf; }
.wizard-script-ai-actions button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
.wizard-script-tools span,
.wizard-script-help { color: var(--muted); font-size: 11px; line-height: 18px; }
.wizard-script-help code { color: #4338ca; }
.wizard-script-ai-result {
  margin: 9px 0 0;
  min-height: 166px;
  padding: 12px;
  border: 1px solid #d8d4ff;
  border-radius: 10px;
  background: #f8f7ff;
}
.wizard-script-ai-result > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wizard-script-ai-result > header > div {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5145cd;
}
.wizard-script-ai-result > header strong { color: var(--ink-strong); font-size: 12px; }
.wizard-script-ai-result > header button {
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  background: transparent;
}
.wizard-script-ai-result > header button:hover { color: var(--ink); background: rgba(85, 72, 223, .08); }
.wizard-script-ai-result > p {
  margin: 8px 0 10px;
  color: #475467;
  font-size: 11px;
  line-height: 18px;
}
.wizard-script-ai-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.wizard-script-ai-placeholder {
  display: grid;
  min-height: 82px;
  grid-column: 1 / -1;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #8b83d8;
  border: 1px dashed #d8d4f5;
  border-radius: 8px;
  background: rgba(255,255,255,.62);
  text-align: center;
}
.wizard-script-ai-placeholder > span { color: #667085; font-size: 11px; font-weight: 700; }
.wizard-script-ai-placeholder > small { color: #98a2b3; font-size: 9px; }
.wizard-script-ai-detail {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e5e3f7;
  border-radius: 8px;
  background: #fff;
}
.wizard-script-ai-detail.is-high { border-color: #f7b5b5; background: #fff8f8; }
.wizard-script-ai-detail.is-medium { border-color: #f1d5a6; background: #fffaf2; }
.wizard-script-ai-detail.is-low { border-color: #bcdcd0; background: #f7fcfa; }
.wizard-script-ai-detail > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wizard-script-ai-detail strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wizard-script-ai-detail em {
  flex: 0 0 auto;
  padding: 2px 6px;
  color: #5145cd;
  border-radius: 999px;
  background: #efedff;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}
.wizard-script-ai-detail p,
.wizard-script-ai-detail small {
  display: block;
  margin: 5px 0 0;
  color: #667085;
  font-size: 10px;
  line-height: 16px;
}
.wizard-script-ai-detail small { color: #475467; }
.wizard-script-ai-result > small {
  display: block;
  margin-top: 9px;
  color: #7b8494;
  font-size: 9px;
  line-height: 15px;
}
.wizard-friendly-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.wizard-compact-control-grid {
  display: grid;
  gap: 8px;
}
.wizard-compact-control-grid.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wizard-compact-control-grid.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wizard-compact-select,
.wizard-compact-text {
  min-width: 0;
  color: #344054;
  font-size: 10px;
  font-weight: 700;
}
.wizard-compact-select > span,
.wizard-compact-text > span {
  display: block;
  margin-bottom: 5px;
  line-height: 15px;
}
.wizard-compact-text > span small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
}
.wizard-compact-select select,
.wizard-compact-text input {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  font-size: 10px;
}
.wizard-compact-text { display: block; margin-top: 8px; }
.wizard-friendly-choice {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbfc;
}
.wizard-friendly-choice > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.wizard-friendly-choice > span b { color: var(--ink-strong); font-size: 11px; line-height: 17px; }
.wizard-friendly-choice > span small { color: #6758e8; font-size: 10px; font-weight: 750; }
.wizard-choice-options {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 5px;
}
.wizard-choice-options button {
  min-width: 0;
  min-height: 30px;
  padding: 5px 6px;
  color: #667085;
  border: 1px solid #e1e5ec;
  border-radius: 7px;
  background: #fff;
  font-size: 10px;
  font-weight: 700;
}
.wizard-choice-options button:hover { color: #5145cd; border-color: #c9c5f5; }
.wizard-choice-options button.is-selected {
  color: #5145cd;
  border-color: #bcb5f7;
  background: #efedff;
  box-shadow: inset 0 0 0 1px rgba(81,69,205,.05);
}
.wizard-friendly-range,
.wizard-friendly-select,
.wizard-friendly-text {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbfc;
}
.wizard-friendly-range > span,
.wizard-friendly-select > span,
.wizard-friendly-text > span {
  display: block;
  margin-bottom: 10px;
}
.wizard-friendly-range > span b,
.wizard-friendly-select > span b,
.wizard-friendly-text > span b {
  display: block;
  color: var(--ink-strong);
  font-size: 12px;
  line-height: 18px;
}
.wizard-friendly-range > span small,
.wizard-friendly-select > span small,
.wizard-friendly-text > span small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}
.wizard-friendly-range > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
}
.wizard-friendly-range input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}
.wizard-friendly-range output {
  display: grid;
  min-height: 28px;
  place-items: center;
  padding: 4px 6px;
  color: #5145cd;
  border-radius: 6px;
  background: #efedff;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.wizard-friendly-select select,
.wizard-friendly-text input {
  width: 100%;
  min-height: 36px;
  font-size: 11px;
}
.wizard-friendly-text { grid-column: 1 / -1; }
.wizard-voice-feature {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbfc;
}
.wizard-voice-feature-compact { padding: 8px 9px; }
.wizard-voice-feature-compact > header { margin-bottom: 6px; }
.wizard-voice-feature > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.wizard-voice-feature > header > span { min-width: 0; }
.wizard-voice-feature > header b,
.wizard-voice-feature > header small { display: block; }
.wizard-voice-feature > header b { color: var(--ink-strong); font-size: 11px; line-height: 17px; }
.wizard-voice-feature > header small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 14px; }
.wizard-voice-feature > header em {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: #5145cd;
  border-radius: 999px;
  background: #efedff;
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
}
.wizard-voice-feature > header > button {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  color: #5145cd;
  border: 1px solid #d8d3fb;
  border-radius: 7px;
  background: #fff;
  font-size: 9px;
  font-weight: 750;
}
.wizard-voice-feature > header > button:disabled { cursor: not-allowed; opacity: .5; }
.wizard-scene-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.wizard-scene-options button,
.wizard-inline-options button {
  min-width: 0;
  min-height: 29px;
  padding: 5px 7px;
  color: #667085;
  border: 1px solid #e1e5ec;
  border-radius: 7px;
  background: #fff;
  font-size: 9px;
  font-weight: 700;
}
.wizard-scene-options button:hover,
.wizard-inline-options button:hover { color: #5145cd; border-color: #c9c5f5; }
.wizard-scene-options button.is-selected,
.wizard-inline-options button.is-selected {
  color: #5145cd;
  border-color: #bcb5f7;
  background: #efedff;
}
.wizard-voice-feature .wizard-friendly-text {
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
}
.wizard-voice-feature .wizard-friendly-text > span { margin-bottom: 6px; }
.wizard-voice-feature .wizard-friendly-text input {
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 7px;
  background: #fff;
}
.wizard-output-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.wizard-output-options button {
  min-width: 0;
  padding: 7px 5px;
  color: #667085;
  border: 1px solid #e1e5ec;
  border-radius: 7px;
  background: #fff;
  text-align: left;
}
.wizard-output-options button b,
.wizard-output-options button small { display: block; }
.wizard-output-options button b { color: var(--ink); font-size: 9px; line-height: 14px; }
.wizard-output-options button small { margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 12px; }
.wizard-output-options button.is-selected { border-color: #bcb5f7; background: #efedff; }
.wizard-output-options button.is-selected b { color: #5145cd; }
.wizard-inline-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.wizard-pronunciation-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px;
  gap: 5px;
}
.wizard-pronunciation-compact {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}
.wizard-pronunciation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.wizard-pronunciation-heading > span b,
.wizard-pronunciation-heading > span small { display: block; }
.wizard-pronunciation-heading > span b { color: var(--ink-strong); font-size: 10px; line-height: 15px; }
.wizard-pronunciation-heading > span small { color: var(--muted); font-size: 8px; line-height: 13px; }
.wizard-pronunciation-heading > button {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  color: #5145cd;
  border: 1px solid #d8d3fb;
  border-radius: 7px;
  background: #fff;
  font-size: 8px;
  font-weight: 750;
}
.wizard-pronunciation-form input {
  min-width: 0;
  min-height: 31px;
  padding: 6px 8px;
  border: 1px solid #e1e5ec;
  border-radius: 7px;
  background: #fff;
  font-size: 9px;
}
.wizard-pronunciation-form > button {
  display: grid;
  min-height: 31px;
  place-items: center;
  color: #fff;
  border-radius: 7px;
  background: var(--primary);
}
.wizard-pronunciation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.wizard-pronunciation-list.is-empty {
  min-height: 28px;
  align-items: center;
  padding: 5px 8px;
  color: var(--muted);
  border: 1px dashed #dfe3ea;
  border-radius: 7px;
  font-size: 8px;
}
.wizard-pronunciation-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  padding: 4px 5px 4px 7px;
  color: #5145cd;
  border: 1px solid #d8d3fb;
  border-radius: 999px;
  background: #f3f1ff;
  font-size: 8px;
  font-weight: 700;
}
.wizard-pronunciation-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wizard-pronunciation-chip button {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #7468db;
  border-radius: 50%;
  background: #e5e1ff;
  line-height: 1;
}
.wizard-audio-preview {
  align-items: stretch;
  justify-content: flex-start;
  gap: 7px;
  padding: 12px;
  text-align: left;
}
.wizard-audio-preview .wizard-model-options {
  margin: 0;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.wizard-audio-preview .wizard-model-options > header { margin-bottom: 7px; }
.wizard-audio-generation-card { min-width: 0; }
.wizard-audio-generation-card > .button { width: 100%; }
.wizard-selected-voice-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.wizard-selected-voice-row > div { min-width: 0; }
.wizard-selected-voice-row small,
.wizard-selected-voice-row strong { display: block; }
.wizard-selected-voice-row small { color: var(--muted); font-size: 10px; }
.wizard-selected-voice-row strong {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wizard-selected-voice-icon {
  width: 34px;
  height: 34px;
  color: var(--primary);
  border-radius: 14px;
  background: var(--primary-soft);
}
.wizard-audio-preview .wizard-price-line {
  margin: 8px 0 7px;
  padding-top: 7px;
  color: var(--muted);
  font-size: 10px;
}
.wizard-price-line strong { color: var(--ink); }
.wizard-generated-audio-shell {
  display: grid;
  min-height: 42px;
  margin-top: 6px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: #fafbfc;
}
.wizard-generated-audio-shell audio { width: calc(100% - 16px); margin: 0; }
.wizard-generation-state {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
  color: #98a2b3;
  font-size: 10px;
  text-align: center;
  margin: 0;
}
.wizard-generation-state span { animation: none; }
.wizard-generation-state.is-loading { color: var(--primary); }
.wizard-generation-state.is-loading span { animation: voice-clone-spin 1.2s linear infinite; }
.wizard-generation-state.is-error { color: #b42318; }
.wizard-generation-state p { margin: 0; }

.wizard-footer {
  position: relative;
  min-height: 74px;
  margin: 0;
  padding: 11px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
}
html[data-theme="light"] .wizard-footer { background: #fff; }
.wizard-footer-center { min-width: 300px; }
.wizard-progress { gap: 8px; }
.wizard-progress > span { min-width: 28px; min-height: 32px; }
.wizard-progress > span:not(:last-child)::after { width: 20px; margin-left: 8px; background: #dfe3ea; }
.wizard-progress b {
  min-width: 28px;
  height: 28px;
  color: #596477;
  border: 1px solid #dfe3ea;
  border-radius: 50%;
  background: #fff;
  font-size: 12px;
  line-height: 26px;
  font-weight: 650;
}
.wizard-progress > span.is-active b {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 4px 10px rgba(85, 72, 223, .18);
  transform: none;
}
.wizard-progress > span.is-complete b { color: #4338ca; border-color: #d5d2f7; background: #f2f1ff; }
.wizard-progress > span.is-complete::after { background: #bdb8ef; }
.wizard-footer-center p { color: var(--muted); font-size: 11px; }
.wizard-nav-action,
html[data-theme="light"] .wizard-nav-action {
  min-width: 104px;
  min-height: 40px;
  color: #344054;
  border-color: var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  font-size: 13px;
}
.wizard-nav-action:hover { color: var(--primary); border-color: #bbb6ec; background: #fafaff; }
.wizard-footer-right .button { min-width: 126px; }

/* Confirm creation: selected "Precision Production Console" layout */
.wizard-stage:has([data-wizard-step="4"].is-active) { padding: 0; overflow: hidden; background: #f7f8fb; }
.wizard-panel[data-wizard-step="4"] { width: 100%; height: 100%; }
.wizard-confirm-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.45fr) minmax(340px, .9fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "overview overview"
    "stage summary";
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 20px 24px 18px;
  gap: 14px 16px;
  background: #f7f8fb;
}
.wizard-confirm-checklist {
  grid-area: overview;
  min-width: 0;
  overflow: visible;
  padding: 0;
  background: transparent;
}
.wizard-confirm-checklist header { margin: 0 0 12px; }
.wizard-confirm-checklist header h2 { margin: 0 0 2px; font-size: 23px; line-height: 31px; }
.wizard-confirm-checklist header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 18px; }
.wizard-confirm-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow);
}
.wizard-confirm-item {
  position: relative;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  min-height: 82px;
  gap: 9px;
  padding: 14px 14px;
  border: 0;
  border-right: 1px solid var(--line);
}
.wizard-confirm-item:last-child { border-right: 0; }
.wizard-confirm-item > span {
  width: 26px;
  height: 26px;
  color: #08745a;
  background: #eaf8f2;
}
.wizard-confirm-item > div { gap: 4px; }
.wizard-confirm-item strong { color: var(--ink); font-size: 13px; line-height: 19px; }
.wizard-confirm-item small { color: var(--muted); font-size: 11px; line-height: 17px; }
.wizard-confirm-item button { color: var(--primary); font-size: 11px; font-weight: 620; }
.wizard-confirm-avatar-row i { width: 28px; height: 28px; border-radius: 7px; }
.wizard-confirm-stage {
  grid-area: stage;
  min-width: 0;
  min-height: 0;
  padding: 14px;
  border: 1px solid #222a3a;
  border-radius: 12px;
  background: #151a28;
}
.wizard-confirm-media {
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: none;
  border-color: #343c4e;
  border-radius: 10px;
  background-color: #0e1421;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 12px 34px rgba(4, 8, 18, .28);
}
.wizard-confirm-media-bar { min-height: 44px; background: rgba(10, 15, 25, .78); }
.wizard-confirm-summary {
  grid-area: summary;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.wizard-confirm-summary section,
.wizard-confirm-metrics,
.wizard-output-row,
.wizard-balance-note { margin: 0; }
.wizard-confirm-summary section,
.wizard-confirm-metrics > div {
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}
.wizard-confirm-summary h3 { margin: 0 0 10px; font-size: 14px; line-height: 21px; }
.wizard-confirm-audio > div > span {
  color: var(--primary);
  background: var(--primary-soft);
}
.wizard-confirm-audio-preview { background: #f6f7fa; }
.wizard-confirm-audio-preview > span:first-child { color: var(--primary); background: var(--primary-soft); }
.wizard-confirm-script { margin-top: 0; }
.wizard-confirm-script p { color: #475467; font-size: 12px; line-height: 20px; }
.wizard-confirm-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.wizard-confirm-metrics > div { border-right: 1px solid var(--line); }
.wizard-confirm-metrics > div:last-child { border-right: 0; }
.wizard-output-row {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.wizard-output-row label { color: #344054; font-size: 11px; }
.wizard-output-row select { min-height: 38px; margin-top: 4px; padding: 7px 9px; font-size: 12px; }
.wizard-balance-note { padding: 12px 16px; color: var(--muted); font-size: 11px; text-align: right; }
.wizard-generating-panel { color: var(--ink); }
.wizard-progress-ring { background: conic-gradient(var(--primary) calc(var(--progress) * 1%), #e1dffa 0); }
.wizard-progress-ring::before { background: #fff; }

/* Authentication */
.guest-body { color: var(--ink); background: #fff; }
.guest-shell {
  height: 100vh;
  min-height: 620px;
  grid-template-columns: minmax(440px, 1.05fr) minmax(420px, .95fr);
  overflow: hidden;
  background: #fff;
}
.guest-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(38px, 5vw, 74px);
  color: #fff;
  border-right: 1px solid #28314a;
  background: #171b2d;
}
.guest-brand > * { position: relative; z-index: 1; }
.guest-brand .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 20px rgba(85, 72, 223, .28);
}
.guest-brand .eyebrow { color: #b8b4ee; }
.guest-brand h1,
html[data-theme="light"] .guest-brand h1 { margin: 12px 0 15px; color: #fff; font-size: clamp(40px, 4vw, 58px); line-height: 1.2; }
.guest-brand p { color: #b9c0d2; font-size: 14px; line-height: 23px; }
.guest-feature-list span {
  color: #d6d9e4;
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .035);
  font-size: 12px;
}
.guest-card-wrap,
html[data-theme="light"] .guest-card-wrap {
  overflow: auto;
  padding: 24px clamp(38px, 6vw, 78px);
  background: #f7f8fb;
}
.auth-card,
html[data-theme="light"] .auth-card {
  width: min(100%, 420px);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(16, 24, 40, .08);
}
.auth-card h2 { margin: 6px 0 3px; font-size: 25px; line-height: 33px; }
.auth-card .muted { margin-bottom: 16px; font-size: 13px; line-height: 20px; }
.auth-switch { color: var(--muted); font-size: 12px; }

/* Dialogs, toast and secondary surfaces */
.ui-toast,
html[data-theme="light"] .ui-toast {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 12px 34px rgba(16, 24, 40, .14);
}
.alert,
html[data-theme="light"] .alert { color: #344054; border-radius: 9px; background: #fff; }
.alert-info { border-color: #c8ddf2; background: #f2f8fd; }
.alert-success { border-color: #b7e3d3; background: #eefaf6; }
.alert-warning { border-color: #ecd4aa; background: #fff8ec; }
.alert-error { border-color: #f1c6cd; background: #fff1f3; }
.configured-mark { color: #08745a; }
.secret-clear-pill { color: #b4233c; border-color: #f1c6cd; background: #fff1f3; }
.upload-progress,
.voice-extract-progress {
  border-color: #d3d1f3;
  background: #f5f4ff;
}
.upload-progress-track i,
.voice-extract-progress > i span { background: var(--primary); }

/* Dark theme keeps the same hierarchy without the old neon treatment. */
html[data-theme="dark"] {
  --ink: #f4f6fb;
  --ink-strong: #ffffff;
  --muted: #a7b0c0;
  --muted-soft: #7c8799;
  --line: #2b3445;
  --line-strong: #3b465a;
  --surface: #151b27;
  --surface-soft: #111722;
  --canvas: #0d121b;
  --primary: #8176f3;
  --primary-dark: #7065e8;
  --primary-soft: rgba(129, 118, 243, .14);
  color-scheme: dark;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .main-content,
html[data-theme="dark"] .main-content.creation-main,
html[data-theme="dark"] .creation-wizard,
html[data-theme="dark"] .wizard-confirm-layout { color: var(--ink); background: var(--canvas); }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar { color: var(--ink); border-color: var(--line); background: #111722; }
html[data-theme="dark"] .sidebar-brand,
html[data-theme="dark"] .sidebar-brand strong,
html[data-theme="dark"] .topbar-context { color: var(--ink); }
html[data-theme="dark"] .topbar-credit {
  color: #101828;
  border-color: #d0d5dd;
  background: #fff;
}
html[data-theme="dark"] .topbar-credit strong,
html[data-theme="dark"] .topbar-credit small,
html[data-theme="dark"] .topbar-credit > span { color: #101828; }
html[data-theme="dark"] .sidebar-create-link {
  color: #e7e4ff;
  border-color: #3e386b;
  background: #211d3b;
}
html[data-theme="dark"] .nav-list > a { color: #a7b0c0; }
html[data-theme="dark"] .nav-list > a:hover { color: #fff; background: #1a2230; }
html[data-theme="dark"] .nav-list > a.active { color: #ddd9ff; border-color: #45406d; background: rgba(129, 118, 243, .14); }
html[data-theme="dark"] .panel,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .detail-status,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .dashboard-metrics,
html[data-theme="dark"] .dashboard-metrics > a,
html[data-theme="dark"] .voice-asset-card,
html[data-theme="dark"] .copy-card,
html[data-theme="dark"] .audio-work-card,
html[data-theme="dark"] .wizard-title-field input,
html[data-theme="dark"] .wizard-audio-card,
html[data-theme="dark"] .wizard-script-editor,
html[data-theme="dark"] .wizard-audio-preview,
html[data-theme="dark"] .wizard-footer,
html[data-theme="dark"] .wizard-confirm-overview,
html[data-theme="dark"] .wizard-confirm-summary,
html[data-theme="dark"] .wizard-confirm-summary section,
html[data-theme="dark"] .wizard-confirm-metrics > div,
html[data-theme="dark"] .settings-actions,
html[data-theme="dark"] .ui-tabs {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] strong,
html[data-theme="dark"] .wizard-panel-heading h2,
html[data-theme="dark"] .wizard-title-field > span,
html[data-theme="dark"] .wizard-audio-card strong,
html[data-theme="dark"] .wizard-audio-preview > strong,
html[data-theme="dark"] .wizard-confirm-item strong { color: var(--ink-strong); }
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #101620;
}
html[data-theme="dark"] .button-secondary,
html[data-theme="dark"] .wizard-nav-action,
html[data-theme="dark"] .voice-filter-reset { color: var(--ink); border-color: var(--line-strong); background: #171e2a; }
html[data-theme="dark"] .ui-tab.is-active { color: #fff; border-color: #3c4658; background: #202838; }
html[data-theme="dark"] .voice-filter-dropdown-menu,
html[data-theme="dark"] .topbar-dropdown,
html[data-theme="dark"] .sidebar-more-panel { color: var(--ink); border-color: var(--line); background: #171e2a; }
html[data-theme="dark"] .wizard-confirm-stage { background: #090d14; }
html[data-theme="dark"] .settings-note,
html[data-theme="dark"] .script-preview,
html[data-theme="dark"] .toggle { color: var(--muted); border-color: var(--line); background: #111722; }
html[data-theme="dark"] .wizard-script-rich,
html[data-theme="dark"] .wizard-friendly-range,
html[data-theme="dark"] .wizard-friendly-choice,
html[data-theme="dark"] .wizard-friendly-select,
html[data-theme="dark"] .wizard-friendly-text,
html[data-theme="dark"] .wizard-voice-feature {
  color: var(--ink);
  border-color: var(--line);
  background: #111722;
}
html[data-theme="dark"] .wizard-pause-token { color: #c5c0ff; border-color: #5149a5; background: #28234d; }
html[data-theme="dark"] .wizard-friendly-range output { color: #c5c0ff; background: #28234d; }
html[data-theme="dark"] .wizard-script-ai-result { border-color: #3f386e; background: #18162b; }
html[data-theme="dark"] .wizard-script-ai-placeholder,
html[data-theme="dark"] .wizard-generated-audio-shell { border-color: var(--line); background: #101620; }
html[data-theme="dark"] .wizard-script-ai-result > p,
html[data-theme="dark"] .wizard-script-ai-detail p,
html[data-theme="dark"] .wizard-script-ai-detail small { color: var(--muted); }
html[data-theme="dark"] .wizard-script-ai-detail,
html[data-theme="dark"] .wizard-script-ai-detail.is-high,
html[data-theme="dark"] .wizard-script-ai-detail.is-medium,
html[data-theme="dark"] .wizard-script-ai-detail.is-low { border-color: var(--line); background: #111722; }
html[data-theme="dark"] .wizard-script-ai-detail em { color: #c5c0ff; background: #28234d; }
html[data-theme="dark"] .wizard-choice-options button { color: var(--muted); border-color: var(--line); background: #171e2a; }
html[data-theme="dark"] .wizard-choice-options button.is-selected { color: #c5c0ff; border-color: #5149a5; background: #28234d; }
html[data-theme="dark"] .wizard-compact-select,
html[data-theme="dark"] .wizard-compact-text { color: var(--ink); }
html[data-theme="dark"] .wizard-compact-select select,
html[data-theme="dark"] .wizard-compact-text input,
html[data-theme="dark"] .wizard-pronunciation-heading > button {
  color: var(--ink);
  border-color: var(--line);
  background: #171e2a;
}
html[data-theme="dark"] .wizard-voice-feature > header > button,
html[data-theme="dark"] .wizard-scene-options button,
html[data-theme="dark"] .wizard-inline-options button,
html[data-theme="dark"] .wizard-output-options button,
html[data-theme="dark"] .wizard-pronunciation-form input,
html[data-theme="dark"] .wizard-voice-feature .wizard-friendly-text input {
  color: var(--muted);
  border-color: var(--line);
  background: #171e2a;
}
html[data-theme="dark"] .wizard-voice-feature > header > button,
html[data-theme="dark"] .wizard-output-options button.is-selected b { color: #c5c0ff; }
html[data-theme="dark"] .wizard-output-options button b { color: var(--ink); }
html[data-theme="dark"] .wizard-scene-options button.is-selected,
html[data-theme="dark"] .wizard-inline-options button.is-selected,
html[data-theme="dark"] .wizard-output-options button.is-selected {
  color: #c5c0ff;
  border-color: #5149a5;
  background: #28234d;
}
html[data-theme="dark"] .wizard-voice-feature > header em,
html[data-theme="dark"] .wizard-pronunciation-chip {
  color: #c5c0ff;
  border-color: #5149a5;
  background: #28234d;
}
html[data-theme="dark"] .wizard-pronunciation-list.is-empty { border-color: var(--line-strong); }
html[data-theme="dark"] .wizard-pronunciation-chip button { color: #d3ceff; background: #3a346c; }
html[data-theme="dark"] .voice-upload-recommended {
  color: var(--muted);
  border-color: #3f386e;
  background: #18162b;
}
html[data-theme="dark"] .voice-upload-recommended strong { color: #c5c0ff; }
html[data-theme="dark"] .wizard-avatar-picker,
html[data-theme="dark"] .wizard-avatar-detail .wizard-avatar-card { color: var(--ink); border-color: var(--line); background: var(--surface); }
html[data-theme="dark"] .wizard-avatar-master { border-color: var(--line); }
html[data-theme="dark"] .wizard-avatar-library-card { color: var(--ink); border-color: var(--line); background: #171e2a; }
html[data-theme="dark"] .wizard-avatar-library-card:hover,
html[data-theme="dark"] .wizard-avatar-library-card.is-active,
html[data-theme="dark"] .wizard-avatar-detail .wizard-avatar-card:hover,
html[data-theme="dark"] .wizard-avatar-detail .wizard-avatar-card.is-selected { color: var(--ink); border-color: #655bd0; background: #1d1b35; }
html[data-theme="dark"] .wizard-avatar-detail-footer { border-color: var(--line); }
html[data-theme="dark"] .wizard-avatar-detail-footer > button:disabled { color: #667085; background: #202734; }

@media (max-width: 1180px) {
  .voice-card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 264px)); justify-content: start; }
  .copy-list-section:not(.is-empty) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard-confirm-layout { grid-template-columns: minmax(360px, 1.3fr) minmax(300px, .9fr); padding-inline: 18px; }
  .wizard-confirm-item { grid-template-columns: 26px minmax(0, 1fr); }
  .wizard-confirm-item button { position: absolute; top: 12px; right: 12px; }
}

@media (max-width: 1500px) and (min-width: 901px) {
  .wizard-confirm-item {
    grid-template-columns: 26px minmax(0, 1fr);
    padding-right: 48px;
  }
  .wizard-confirm-item button {
    position: absolute;
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: 100%;
    max-width: 100vw;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: start;
    overflow-x: hidden;
  }
  .sidebar,
  html[data-theme="light"] .sidebar,
  html[data-theme="dark"] .sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    height: auto;
    overflow: hidden;
    padding: 9px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-brand { padding-bottom: 8px; }
  .sidebar-brand > small { display: none; }
  .nav-list {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-list > a { flex: 0 0 auto; white-space: nowrap; }
  .nav-divider { display: none; }
  .sidebar-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
  .app-frame,
  .topbar,
  .main-content {
    width: 100%;
    min-width: 0;
    max-width: 100vw;
  }
  .app-frame {
    height: auto;
    min-height: calc(100vh - 58px);
    display: block;
    overflow-x: hidden;
    overflow-y: visible;
  }
  .topbar { top: 0; padding: 0 14px; }
  .main-content,
  .main-content.workbench-main { height: auto; min-height: calc(100vh - 58px); padding: 18px 14px 24px; overflow: visible; }
  .main-content.creation-main { height: auto; min-height: calc(100vh - 58px); overflow: visible; }
  .main-content.library-main {
    height: auto;
    min-height: calc(100vh - 58px);
    display: block;
    overflow: visible;
  }
  .library-main > .voice-tab-panels,
  .library-main > .works-tab-panels,
  .library-main .voice-library,
  .library-main .voice-tab-panels > [role="tabpanel"],
  .library-main .works-tab-panels > [role="tabpanel"],
  .library-main > .avatar-group-section,
  .library-main > .avatar-material-library,
  .library-main > .billing-history-panel,
  .library-main .billing-history-scroll,
  .voice-library-results-scroll {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .creation-wizard { min-height: 760px; }
  .wizard-avatar-picker { grid-template-columns: minmax(220px, 28%) minmax(0, 1fr); }
  .wizard-avatar-master,
  .wizard-avatar-detail { padding: 18px; }
  .wizard-avatar-detail-footer { margin-inline: -18px; padding-inline: 18px; }
  .wizard-stage:has([data-wizard-step="1"].is-active),
  .wizard-stage:has([data-wizard-step="2"].is-active) { overflow: visible; }
  .wizard-panel[data-wizard-step="1"],
  .wizard-panel[data-wizard-step="2"] { height: auto; }
  .wizard-avatar-browser,
  .wizard-avatar-material-panel { overflow: visible; }
  .wizard-avatar-scroll,
  .wizard-audio-results { overflow: visible; }
  .wizard-confirm-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(480px, auto) auto;
    grid-template-areas: "overview" "stage" "summary";
    height: auto;
  }
  .wizard-confirm-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard-confirm-item:nth-child(2) { border-right: 0; }
  .wizard-confirm-item:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .wizard-confirm-summary { overflow: visible; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-metrics > a:nth-child(2) { border-right: 0; }
  .dashboard-metrics > a:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .video-detail-ready-grid { grid-template-columns: 1fr; }
  .guest-shell { height: auto; min-height: 100vh; grid-template-columns: 1fr; overflow: visible; }
  .guest-brand { min-height: 340px; border-right: 0; border-bottom: 1px solid #28314a; }
}

@media (max-width: 760px) {
  .wizard-panel[data-wizard-step="1"] .wizard-title-field,
  html[data-theme="light"] .wizard-panel[data-wizard-step="1"] .wizard-title-field {
    display: block;
  }
  .wizard-panel[data-wizard-step="1"] .wizard-title-field > span { margin-bottom: 7px; }
  .wizard-panel[data-wizard-step="1"] .wizard-title-field em { margin-top: 7px; }
  .wizard-panel[data-wizard-step="1"] .wizard-title-field small { top: 17px; }
  .wizard-avatar-picker { grid-template-columns: 1fr; overflow: visible; }
  .wizard-avatar-master { min-height: 240px; border-right: 0; border-bottom: 1px solid var(--line); }
  .wizard-avatar-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard-avatar-detail { min-height: 480px; }
}

@media (max-width: 620px) {
  .topbar-context,
  .topbar-label { display: none; }
  .topbar { justify-content: flex-end; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-header .button { width: 100%; }
  .dashboard-welcome { align-items: flex-start; flex-direction: column; }
  .dashboard-welcome-actions { width: 100%; }
  .dashboard-welcome-actions .button { flex: 1; }
  .dashboard-metrics,
  .voice-card-grid,
  .copy-list-section:not(.is-empty),
  .audio-work-grid { grid-template-columns: 1fr; }
  .dashboard-metrics > a { border-right: 0; border-bottom: 1px solid var(--line); }
  .dashboard-metrics > a:last-child { border-bottom: 0; }
  .voice-filter-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .voice-filter-actions { width: 100%; }
  .voice-filter-search { flex: 1; width: auto; }
  .wizard-stage { padding: 18px 14px; }
  .wizard-avatar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard-audio-grid,
  .wizard-script-layout { grid-template-columns: 1fr; }
  .wizard-friendly-controls { grid-template-columns: 1fr; }
  .wizard-friendly-text { grid-column: auto; }
  .wizard-script-tools { align-items: stretch; flex-direction: column; }
  .wizard-script-ai-actions { width: 100%; }
  .wizard-script-ai-actions button { flex: 1; }
  .wizard-script-tools > span { width: 100%; margin-left: 0; }
  .wizard-script-ai-details { grid-template-columns: 1fr; }
  .wizard-compact-control-grid.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wizard-scene-options,
  .wizard-output-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard-pronunciation-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; }
  .wizard-avatar-library-grid,
  .wizard-avatar-master .wizard-avatar-library-grid { grid-template-columns: 1fr; }
  .wizard-avatar-material-panel .wizard-avatar-grid,
  .wizard-audio-results .wizard-audio-grid { grid-template-columns: 1fr; }
  .wizard-avatar-detail .wizard-avatar-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 150px)); }
  .wizard-avatar-detail .wizard-avatar-media { aspect-ratio: 3 / 4; }
  .wizard-avatar-detail-footer { align-items: stretch; flex-direction: column; gap: 9px; }
  .wizard-avatar-detail-footer > button { width: 100%; }
  .wizard-panel[data-wizard-step="2"] .wizard-audio-tabs button { padding-inline: 6px; font-size: 10px; }
  .wizard-panel[data-wizard-step="2"] .wizard-audio-tabs button .ui-icon { display: none; }
  .wizard-section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .wizard-section-heading > span { max-width: 100%; }
  .wizard-footer { grid-template-columns: 1fr auto 1fr; padding-inline: 10px; }
  .wizard-footer-center { min-width: 0; }
  .wizard-progress > span:not(:last-child)::after { width: 5px; margin-left: 2px; }
  .wizard-confirm-layout { padding: 14px; }
  .wizard-confirm-overview { grid-template-columns: 1fr; }
  .wizard-confirm-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .wizard-confirm-item:last-child { border-bottom: 0; }
  .guest-brand { min-height: 300px; padding: 28px 22px; }
  .guest-brand h1 { font-size: 36px; }
  .guest-card-wrap { padding: 20px 14px; }
}

@media (max-width: 420px) {
  .wizard-compact-control-grid.is-three,
  .wizard-compact-control-grid.is-two,
  .wizard-scene-options,
  .wizard-output-options,
  .wizard-inline-options { grid-template-columns: 1fr; }
  .wizard-pronunciation-form { grid-template-columns: 1fr 34px; }
  .wizard-pronunciation-form input:first-child { grid-column: 1 / -1; }
}

/* Video work quick preview */
.video-work-preview-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(calc(100vw - 32px), 1100px);
  height: min(84dvh, 700px);
  max-height: 84dvh;
  overflow: hidden;
}
.video-work-preview-dialog .dialog-header {
  position: relative;
  min-height: 82px;
}
.video-work-preview-layout {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, .8fr);
  overflow: hidden;
  background: #fff;
}
.video-work-preview-media {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #111725;
}
.video-work-preview-media video {
  display: block;
  width: 100%;
  max-width: 720px;
  max-height: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: #05070c;
  box-shadow: 0 16px 36px rgba(3, 7, 18, .24);
  object-fit: contain;
}
.video-work-preview-sidebar {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr);
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: #f8f9fc;
}
.video-work-preview-section {
  min-width: 0;
  padding: 18px;
  background: #fff;
}
.video-work-preview-section + .video-work-preview-section { border-top: 1px solid var(--line); }
.video-work-preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.video-work-preview-heading > div { min-width: 0; }
.video-work-preview-heading small {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}
.video-work-preview-heading h3 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-work-preview-heading > span:not(.status) {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 20px;
}
.video-work-preview-details {
  display: grid;
  gap: 0;
  margin: 0;
}
.video-work-preview-details > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #eef0f4;
  font-size: 12px;
  line-height: 18px;
}
.video-work-preview-details > div:last-child { border-bottom: 0; }
.video-work-preview-details dt { color: var(--muted); }
.video-work-preview-details dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 650;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-work-preview-script-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fbfcfe;
}
.video-work-preview-script {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px;
  color: #475467;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
html[data-theme="dark"] .video-work-preview-layout,
html[data-theme="dark"] .video-work-preview-section { background: #151b25; }
html[data-theme="dark"] .video-work-preview-sidebar,
html[data-theme="dark"] .video-work-preview-script-section { background: #111722; }
html[data-theme="dark"] .video-work-preview-script {
  color: var(--muted);
  border-color: var(--line);
  background: #0f151f;
}
html[data-theme="dark"] .video-work-preview-details > div { border-color: var(--line); }

@media (max-width: 900px) {
  .video-work-preview-dialog[open] {
    width: calc(100vw - 20px);
    height: min(92dvh, 860px);
    max-height: 92dvh;
  }
  .video-work-preview-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    overflow: auto;
  }
  .video-work-preview-media { padding: 12px; }
  .video-work-preview-media video { width: min(100%, 680px); max-height: none; }
  .video-work-preview-sidebar {
    grid-template-rows: auto minmax(240px, auto);
    overflow: visible;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

/* Audio work cards and quick preview */
.audio-work-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 264px));
  align-items: start;
  justify-content: start;
  gap: 12px;
}
.audio-work-card,
html[data-theme="light"] .audio-work-card {
  min-width: 0;
  min-height: 0;
  display: block;
  overflow: hidden;
  padding: 0;
  border-radius: 11px;
  background: #fff;
}
.audio-work-card-main {
  width: 100%;
  min-height: 102px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--ink);
  border: 0;
  background: transparent;
  text-align: left;
}
.audio-work-card-main:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }
.audio-work-card-main:disabled { cursor: default; }
.audio-work-card-icon {
  width: 38px;
  height: 38px;
  grid-row: auto;
  display: grid;
  place-items: center;
  border: 1px solid #d9d6f8;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
}
.audio-work-card-icon > span { display: grid; place-items: center; }
.audio-work-card-icon > span[hidden] { display: none; }
.audio-work-card-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.audio-work-card-copy strong,
.audio-work-card-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-work-card-copy strong { color: var(--ink); font-size: 13px; line-height: 19px; }
.audio-work-card-copy small { color: var(--muted); font-size: 10px; line-height: 16px; }
.audio-work-card-copy > span {
  display: -webkit-box;
  min-height: 32px;
  overflow: hidden;
  color: #667085;
  font-size: 11px;
  line-height: 16px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.audio-work-card-footer {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
}
.audio-work-card-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}
.audio-work-card-actions form { display: contents; }
.audio-work-card-control {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 6px;
  color: #667085;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.audio-work-card-control:hover { color: var(--ink); border-color: var(--line); background: #fff; }
.audio-work-card-control.is-danger:hover { color: #c4324b; border-color: #f1c4cc; background: #fff5f6; }
.audio-work-card-control:disabled { cursor: default; opacity: .55; }
.audio-work-card > audio { display: none; }
.audio-work-card.is-playing { border-color: #cbc7f4; box-shadow: 0 8px 20px rgba(103, 88, 232, .1); }
.audio-work-card.is-playing .audio-work-card-icon { color: #fff; border-color: var(--primary); background: var(--primary); }
.audio-work-card.is-unavailable { opacity: .72; }

.audio-work-preview-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(calc(100vw - 32px), 980px);
  height: min(80dvh, 640px);
  max-height: 80dvh;
  overflow: hidden;
}
.audio-work-preview-dialog .dialog-header {
  position: relative;
  min-height: 82px;
}
.audio-work-preview-layout {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(0, 1.25fr);
  overflow: hidden;
  background: #fff;
}
.audio-work-preview-summary {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #fff;
}
.audio-work-preview-art {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e3e0fa;
  border-radius: 12px;
  background: #f7f6ff;
}
.audio-work-preview-art > span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--primary);
  border-radius: 14px;
  background: #ebe8ff;
}
.audio-work-preview-art > div { min-width: 0; }
.audio-work-preview-art small,
.audio-work-preview-art p {
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}
.audio-work-preview-art h3 {
  margin: 1px 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  line-height: 23px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-work-preview-art p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-work-preview-summary audio { width: 100%; min-height: 42px; }
.audio-work-preview-details {
  display: grid;
  gap: 0;
  margin: 0;
}
.audio-work-preview-details > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #eef0f4;
  font-size: 12px;
  line-height: 18px;
}
.audio-work-preview-details > div:last-child { border-bottom: 0; }
.audio-work-preview-details dt { color: var(--muted); }
.audio-work-preview-details dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 650;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-work-preview-script-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: #fbfcfe;
}
.audio-work-preview-script-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.audio-work-preview-script-heading small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}
.audio-work-preview-script-heading h3 { margin: 1px 0 0; color: var(--ink); font-size: 17px; line-height: 25px; }
.audio-work-preview-script-heading > span { color: var(--muted); font-size: 11px; line-height: 20px; }
.audio-work-preview-script {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding: 16px;
  color: #475467;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
html[data-theme="dark"] .audio-work-card,
html[data-theme="dark"] .audio-work-preview-summary,
html[data-theme="dark"] .audio-work-preview-layout { background: #151b25; }
html[data-theme="dark"] .audio-work-card-footer,
html[data-theme="dark"] .audio-work-preview-script-panel { background: #111722; }
html[data-theme="dark"] .audio-work-preview-art { border-color: var(--line); background: #111722; }
html[data-theme="dark"] .audio-work-preview-art > span { background: #20283a; }
html[data-theme="dark"] .audio-work-preview-script { color: var(--muted); border-color: var(--line); background: #0f151f; }
html[data-theme="dark"] .audio-work-preview-details > div { border-color: var(--line); }

@media (max-width: 760px) {
  .audio-work-preview-dialog[open] {
    width: calc(100vw - 20px);
    height: min(92dvh, 820px);
    max-height: 92dvh;
  }
  .audio-work-preview-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(320px, 1fr);
    overflow: auto;
  }
  .audio-work-preview-summary { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .audio-work-grid { grid-template-columns: 1fr; }
}

/* 用户管理 */
.admin-users-header { align-items: flex-end; }
.admin-users-summary { display: flex; gap: 10px; }
.admin-users-summary span {
  min-width: 104px;
  padding: 10px 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 11px;
}
.admin-users-summary strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 18px; line-height: 22px; }
.admin-users-panel { padding: 0; overflow: hidden; }
.admin-users-toolbar { margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.admin-users-toolbar .search-form { width: min(430px, 100%); }
.admin-users-toolbar .search-form input { min-width: 240px; }
.admin-users-table-wrap { border: 0; border-radius: 0; }
.admin-users-table { min-width: 1080px; }
.admin-users-table th { padding: 12px 16px; color: var(--muted); background: var(--surface-soft); font-size: 11px; font-weight: 650; letter-spacing: .02em; }
.admin-users-table td { padding: 15px 16px; vertical-align: middle; }
.admin-users-table td > small,
.admin-users-table time + small,
.admin-work-count + small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.admin-user-identity { display: flex; align-items: center; gap: 11px; min-width: 210px; }
.admin-user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #4f46e5;
  border: 1px solid #dcd9ff;
  border-radius: 9px;
  background: #f3f1ff;
  font-size: 13px;
  font-weight: 750;
}
.admin-user-identity strong { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; }
.admin-user-identity strong em { padding: 1px 5px; color: var(--primary); border-radius: 4px; background: var(--primary-soft); font-size: 9px; font-style: normal; font-weight: 650; }
.admin-user-identity small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.admin-role-badge { display: inline-flex; padding: 4px 8px; color: #475467; border-radius: 6px; background: #f2f4f7; font-size: 11px; font-weight: 650; }
.admin-role-badge.is-admin { color: #4f46e5; background: #eeecff; }
.admin-credit-balance { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.admin-credit-unit { margin-left: 4px; color: var(--muted); font-size: 10px; }
.admin-work-count { color: var(--ink); font-size: 12px; }
.admin-users-operation-heading { min-width: 280px; }
.admin-user-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; white-space: nowrap; }
.admin-user-actions .button-primary { margin-left: 5px; }
.admin-users-empty { padding: 42px 20px; color: var(--muted); text-align: center; }
.admin-user-dialog[open] { width: min(620px, calc(100vw - 28px)); padding-bottom: 0; }
.admin-user-dialog-form { display: grid; gap: 18px; padding: 20px 22px 22px; }
.admin-user-dialog-form label { display: grid; gap: 7px; color: #344054; font-size: 12px; font-weight: 650; }
.admin-user-dialog-form textarea { resize: vertical; }
.admin-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.admin-dialog-target { margin: 0; padding: 12px 14px; color: var(--muted); border-radius: 8px; background: var(--surface-soft); font-size: 12px; }
.admin-dialog-target strong { color: var(--ink); }
.admin-password-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-password-mode label { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 2px 8px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; }
.admin-password-mode input { grid-row: 1 / span 2; margin-top: 1px; }
.admin-password-mode small { grid-column: 2; color: var(--muted); font-size: 10px; font-weight: 400; line-height: 16px; }
.admin-recharge-target { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-recharge-target > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.admin-recharge-target small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; }
.admin-recharge-target strong { color: var(--ink); font-size: 14px; }
.form-hint { margin: -6px 0 0; color: var(--warning); font-size: 11px; }

/* 安全防护设置 */
.security-readiness-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.security-readiness-badge.is-ready { color: #067647; border-color: #abefc6; background: #ecfdf3; }
.security-readiness-badge.is-pending { color: #b54708; border-color: #fedf89; background: #fffaeb; }
.security-protection-toggle {
  margin: 4px 0 22px;
  padding: 12px 14px;
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  background: var(--primary-soft);
}
.security-protection-toggle > span { display: grid; gap: 2px; }
.security-protection-toggle strong { color: var(--ink); font-size: 12px; }
.security-protection-toggle small { color: var(--muted); font-size: 10px; line-height: 16px; }
.security-config-section + .security-config-section { margin-top: 22px; }
.security-encryption-toggle {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}
.security-encryption-toggle > span { display: grid; gap: 2px; }
.security-encryption-toggle strong { color: var(--ink); font-size: 12px; }
.security-encryption-toggle small { color: var(--muted); font-size: 10px; line-height: 16px; }
.captcha-encryption-key { max-width: 560px !important; }
.security-public-grid { max-width: none !important; }
.security-settings-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.security-settings-note > .ui-icon { flex: 0 0 auto; margin-top: 1px; color: var(--primary); }
.security-settings-note > span { flex: 1 1 auto; }
.security-settings-note > a { flex: 0 0 auto; color: var(--primary); font-weight: 650; white-space: nowrap; }

/* 灵豆计费设置 */
.billing-panel-heading { align-items: center; }
.billing-rule-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; color: #067647; border: 1px solid #abefc6; border-radius: 7px; background: #ecfdf3; font-size: 11px; font-weight: 650; }
.billing-setting-section + .billing-setting-section { margin-top: 24px; }
.billing-setting-section-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.billing-setting-section-title span { color: var(--ink); font-size: 13px; font-weight: 700; }
.billing-setting-section-title small { color: var(--muted); font-size: 10px; }
.billing-base-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.billing-service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.billing-setting-card,
.billing-service-card {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 14px;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.billing-service-card { padding-top: 22px; }
.billing-setting-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--primary); border-radius: 9px; background: var(--primary-soft); }
.billing-setting-copy { min-width: 0; }
.billing-setting-copy strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 12px; line-height: 17px; }
.billing-setting-copy small { display: block; color: var(--muted); font-size: 10px; font-weight: 400; line-height: 15px; }
.billing-setting-input { display: grid; justify-items: end; gap: 3px; }
.billing-setting-input input { width: 118px; height: 36px; padding: 7px 9px; color: var(--ink); text-align: right; font-size: 13px; font-weight: 700; }
.billing-setting-input em { color: var(--muted); font-size: 9px; font-style: normal; font-weight: 500; }
.billing-service-order { position: absolute; top: 7px; right: 9px; color: #c5cad3; font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.billing-service-card.is-avatar .billing-setting-icon { color: #175cd3; background: #eff8ff; }
.billing-service-card.is-audio .billing-setting-icon { color: #067647; background: #ecfdf3; }
.billing-service-card.is-video .billing-setting-icon { color: #b54708; background: #fffaeb; }
.billing-registration-toggle { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.billing-registration-toggle > span { display: grid; gap: 2px; }
.billing-registration-toggle strong { color: var(--ink); font-size: 12px; }
.billing-registration-toggle small { color: var(--muted); font-size: 10px; }

/* 我的作品：费用统计 */
.billing-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.billing-summary-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.billing-summary-card > span { width: 38px; height: 38px; display: grid; flex: 0 0 auto; place-items: center; color: #475467; border-radius: 9px; background: var(--surface-soft); }
.billing-summary-card.is-balance > span { color: var(--primary); background: var(--primary-soft); }
.billing-summary-card.is-refund > span { color: #067647; background: #ecfdf3; }
.billing-summary-card small { display: block; color: var(--muted); font-size: 10px; }
.billing-summary-card strong { display: inline-block; margin-top: 2px; color: var(--ink); font-size: 20px; line-height: 24px; font-variant-numeric: tabular-nums; }
.billing-summary-card em { margin-left: 4px; color: var(--muted); font-size: 9px; font-style: normal; }
.billing-history-panel { padding: 0; overflow: hidden; }
.billing-history-panel .panel-heading { margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.billing-history-table { min-width: 860px; }
.billing-history-table th { padding: 11px 16px; background: var(--surface-soft); }
.billing-history-table td { padding: 13px 16px; vertical-align: middle; }
.billing-history-table td small { display: block; max-width: 360px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.billing-history-subject { display: block; max-width: 360px; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.billing-history-table time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.billing-amount { font-size: 13px; font-variant-numeric: tabular-nums; }
.billing-amount.is-positive { color: #067647; }
.billing-amount.is-negative { color: var(--ink); }
.billing-history-empty { display: grid; justify-items: center; gap: 5px; padding: 54px 20px; color: var(--muted); text-align: center; }
.billing-history-empty strong { color: var(--ink); font-size: 13px; }
.billing-history-empty small { font-size: 11px; }

/* 顶部余额与收费标准 */
.topbar-credit { cursor: pointer; }
.topbar-credit:hover { border-color: #98a2b3; background: #fff; }
.pricing-dialog[open] { width: min(620px, calc(100vw - 28px)); padding-bottom: 0; }
.pricing-dialog-content { display: grid; gap: 16px; padding: 20px 22px 22px; }
.pricing-balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px;
  color: #101828;
  border: 1px solid #d0d5dd;
  border-radius: 11px;
  background: #fff;
}
.pricing-balance-card small { display: block; margin-bottom: 3px; color: #101828; font-size: 10px; font-weight: 700; }
.pricing-balance-card strong { display: inline-flex; align-items: baseline; gap: 6px; color: #101828; font-size: 25px; font-weight: 800; line-height: 30px; }
.pricing-balance-card strong em { color: #101828; font-size: 11px; font-style: normal; font-weight: 750; }
.pricing-balance-card > span { padding: 6px 9px; color: #101828; border: 1px solid #d0d5dd; border-radius: 7px; background: #fff; font-size: 11px; font-weight: 750; }
.pricing-standard-heading { display: flex; align-items: center; justify-content: space-between; }
.pricing-standard-heading strong { color: var(--ink); font-size: 13px; }
.pricing-standard-heading span { padding: 4px 7px; color: #067647; border-radius: 6px; background: #ecfdf3; font-size: 10px; font-weight: 650; }
.pricing-standard-list { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.pricing-standard-list article { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 62px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.pricing-standard-list article:last-child { border-bottom: 0; }
.pricing-standard-list article > span { width: 34px; height: 34px; display: grid; place-items: center; color: var(--primary); border-radius: 8px; background: var(--primary-soft); }
.pricing-standard-list article div { min-width: 0; }
.pricing-standard-list article div strong { display: block; color: var(--ink); font-size: 12px; }
.pricing-standard-list article div small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pricing-standard-list article b { color: var(--ink); font-size: 12px; font-weight: 720; white-space: nowrap; }
.pricing-rule-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; color: var(--muted); border-radius: 8px; background: var(--surface-soft); }
.pricing-rule-note svg { flex: 0 0 auto; margin-top: 1px; color: var(--primary); }
.pricing-rule-note p { margin: 0; font-size: 10px; line-height: 17px; }
.pricing-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
html[data-theme="dark"] .pricing-standard-heading span { color: #6ce9a6; background: #073b2b; }
html[data-theme="dark"] .pricing-rule-note { background: #111722; }
html[data-theme="dark"] .pricing-balance-card,
html[data-theme="dark"] .pricing-balance-card > span { color: #101828; border-color: #d0d5dd; background: #fff; }
html[data-theme="dark"] .pricing-balance-card small,
html[data-theme="dark"] .pricing-balance-card strong,
html[data-theme="dark"] .pricing-balance-card strong em { color: #101828; }

@media (max-width: 520px) {
  .pricing-balance-card { align-items: flex-start; flex-direction: column; }
  .pricing-standard-list article { grid-template-columns: 34px minmax(0, 1fr); }
  .pricing-standard-list article > b { grid-column: 2; }
  .pricing-dialog-actions { flex-direction: column-reverse; }
  .pricing-dialog-actions .button { width: 100%; }
}

html[data-theme="dark"] .admin-user-avatar,
html[data-theme="dark"] .admin-role-badge.is-admin,
html[data-theme="dark"] .billing-setting-icon,
html[data-theme="dark"] .billing-summary-card.is-balance > span { background: #252044; }
html[data-theme="dark"] .admin-role-badge,
html[data-theme="dark"] .admin-dialog-target,
html[data-theme="dark"] .admin-recharge-target > div,
html[data-theme="dark"] .billing-summary-card > span { background: #111722; }
html[data-theme="dark"] .billing-rule-badge { color: #6ce9a6; border-color: #085d3a; background: #073b2b; }

@media (max-width: 1080px) {
  .billing-base-grid { grid-template-columns: 1fr; }
  .billing-summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .admin-users-header { align-items: flex-start; }
  .admin-users-summary { width: 100%; }
  .admin-users-summary span { flex: 1; }
  .admin-users-toolbar { align-items: stretch; }
  .admin-users-toolbar .search-form { width: 100%; }
  .admin-users-toolbar .search-form input { min-width: 0; }
  .admin-password-mode,
  .admin-recharge-target,
  .billing-service-grid { grid-template-columns: 1fr; }
  .billing-summary-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .billing-setting-card,
  .billing-service-card { grid-template-columns: 34px minmax(0, 1fr); }
  .billing-setting-input { grid-column: 1 / -1; justify-items: stretch; }
  .billing-setting-input input { width: 100%; text-align: left; }
  .billing-setting-input em { text-align: right; }
  .billing-summary-grid { grid-template-columns: 1fr; }
}

/* Login page ------------------------------------------------------------ */
.login-body,
html[data-theme="light"] .login-body {
  min-width: 320px;
  color: #1f2937;
  background-color: #eef3ff;
  background-image: url("/assets/login-background.png");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
}
.login-shell {
  height: 100dvh;
  min-height: 640px;
  grid-template-columns: minmax(660px, 58%) minmax(500px, 42%);
  overflow: hidden;
  background: transparent;
  transform-origin: top left;
}
.login-body.is-login-scaled { height: 100dvh; overflow: hidden; }
.login-body.is-login-scaled .login-shell { min-height: 0; }
.login-brand,
html[data-theme="light"] .login-brand {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  padding: 44px 48px 28px;
  color: #1f2937;
  border-right: 0;
  background: transparent;
}
.login-brand-lockup {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  min-height: 48px;
  padding: 0;
  color: #1f2937;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.login-brand-lockup .brand-mark,
html[data-theme="light"] .login-brand-lockup .brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #8190ff, #5b4de8 72%);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .32), 0 0 30px rgba(91, 77, 232, .28), inset 0 0 0 1px rgba(255, 255, 255, .28);
  font-size: 15px;
}
.login-brand-lockup > span:last-child {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0;
}
.login-brand-lockup strong,
html[data-theme="light"] .login-brand-lockup strong {
  color: #111827;
  font-size: 17px;
  line-height: 22px;
  font-weight: 780;
  letter-spacing: -.02em;
}
.login-brand-lockup small {
  color: #667085;
  font-size: 9px;
  line-height: 13px;
  font-weight: 750;
  letter-spacing: .13em;
}
.login-brand-tech {
  position: absolute;
  z-index: 2;
  top: 138px;
  left: 48px;
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 12px;
  color: rgba(80, 103, 151, .48);
  font-size: 7px;
  line-height: 11px;
  font-weight: 720;
  letter-spacing: .08em;
  list-style: disc;
}
.login-character-stage {
  position: absolute;
  z-index: -1;
  bottom: -146px;
  left: 59%;
  display: grid;
  width: min(68%, 551px);
  height: auto;
  aspect-ratio: 9 / 16;
  place-items: end center;
  overflow: hidden;
  pointer-events: none;
  transform: translate3d(-50%, 0, 0);
  backface-visibility: hidden;
  contain: paint;
  filter: none;
}
.login-character-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  backface-visibility: hidden;
  transition: opacity .28s ease;
}
.login-character-stage.is-ready .login-character-canvas { opacity: 1; }
.login-character-stage.has-error { display: none; }
.login-character-stage video {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  clip-path: inset(50%);
  pointer-events: none;
}
.login-hero-copy {
  position: absolute;
  z-index: 2;
  bottom: 90px;
  left: 84px;
  display: block;
  width: min(28vw, 292px);
  padding: 24px 17px 18px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 18px;
  background: rgba(255, 255, 255, .52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: blur(24px) saturate(1.12);
}
.login-brand .login-hero-copy h1,
html[data-theme="light"] .login-brand .login-hero-copy h1 {
  margin: 0 6px 8px;
  color: #111827;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 720;
  letter-spacing: -.035em;
}
.login-brand .login-hero-copy p {
  max-width: none;
  margin: 0 6px 14px;
  color: #4f5d73;
  font-size: 11px;
  line-height: 1.65;
}
.login-capability-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.login-capability-list span {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 9px;
  min-height: 76px;
  padding: 10px 4px 9px;
  color: #44578f;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 10px;
  background: rgba(255, 255, 255, .46);
}
.login-capability-list b {
  color: #32415f;
  font-size: 10px;
  line-height: 14px;
  font-weight: 700;
}
.login-capability-list span:first-child::after {
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 36px;
  content: "";
  border-bottom: 2px solid #6b5fe8;
  transform: translateX(-50%);
}
.login-copyright {
  position: absolute;
  z-index: 2;
  right: auto;
  bottom: 12px;
  left: 74%;
  display: block;
  margin: 0;
  color: rgba(70, 82, 105, .62);
  font-size: 8px;
  line-height: 12px;
  transform: translateX(-50%);
  white-space: nowrap;
}
.login-card-wrap,
html[data-theme="light"] .login-card-wrap {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: start;
  overflow: auto;
  padding: 36px clamp(48px, 6vw, 100px);
  background: transparent;
}
.login-auth-stack {
  display: grid;
  justify-items: start;
  width: min(100%, 430px);
  transform: translateY(-28px);
}
.login-auth-intro {
  width: 352px;
  margin-bottom: 40px;
  color: #3b4b6a;
  text-align: center;
}
.login-auth-intro strong {
  display: block;
  color: #34435f;
  font-size: 18px;
  line-height: 28px;
  font-weight: 560;
  letter-spacing: .2em;
}
.login-auth-intro p {
  margin: 12px 0 0;
  color: #77829a;
  font-size: 10px;
  line-height: 17px;
  white-space: nowrap;
}
.login-auth-intro::after {
  display: block;
  width: 42px;
  margin: 12px auto 0;
  content: "";
  border-bottom: 2px solid rgba(105, 91, 232, .58);
}
.login-card,
html[data-theme="light"] .login-card {
  position: relative;
  width: min(100%, 352px);
  margin: 0;
  padding: 16px 24px;
  overflow: hidden;
  color: #1f2937;
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 22px;
  background: rgba(251, 252, 255, .5);
  box-shadow: none;
  backdrop-filter: blur(30px) saturate(1.26);
}
.login-card::before {
  position: absolute;
  top: -90px;
  left: -70px;
  width: 220px;
  height: 180px;
  content: none;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .74), transparent 67%);
}
.login-security-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  width: 100%;
  margin-top: 44px;
}
.login-security-list > span {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  color: #60708d;
}
.login-security-list > span > .ui-icon {
  width: 26px;
  height: 26px;
  padding: 5px;
  color: #6a5de1;
  border: 1px solid rgba(105, 91, 224, .16);
  border-radius: 50%;
  background: rgba(255, 255, 255, .36);
}
.login-security-list b,
.login-security-list small { display: block; white-space: nowrap; }
.login-security-list b { font-size: 9px; line-height: 13px; font-weight: 650; }
.login-security-list small { margin-top: 1px; color: #8a93a6; font-size: 7px; line-height: 11px; font-weight: 500; }
.auth-mode-switch {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 13px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 10px;
  background: rgba(224, 230, 246, .38);
  box-shadow: inset 0 1px 3px rgba(86, 99, 140, .06);
}
.auth-mode-switch a {
  display: grid;
  min-height: 34px;
  place-items: center;
  color: #667085;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  transition: color .18s, background .18s, box-shadow .18s;
}
.auth-mode-switch a:hover { color: #5146d9; background: rgba(255, 255, 255, .42); }
.auth-mode-switch a.is-active {
  color: #493cc9;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 5px 16px rgba(73, 60, 201, .12), inset 0 0 0 1px rgba(255, 255, 255, .7);
}
[data-auth-panel][hidden] { display: none; }
[data-auth-panel] { animation: auth-panel-in .18s ease-out; }
@keyframes auth-panel-in {
  from { opacity: .55; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
.login-card-heading { position: relative; z-index: 1; margin-bottom: 12px; }
.auth-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  color: #5b4de8;
  font-size: 9px;
  line-height: 14px;
  font-weight: 780;
  letter-spacing: .11em;
}
.login-card .login-card-heading h2,
html[data-theme="light"] .login-card .login-card-heading h2 {
  margin: 0 0 4px;
  color: #111827;
  font-size: 21px;
  line-height: 29px;
  font-weight: 720;
  letter-spacing: -.025em;
}
.login-card .login-card-heading .muted {
  margin: 0;
  color: #667085;
  font-size: 9px;
  line-height: 15px;
}
.login-card .login-form { position: relative; z-index: 1; gap: 8px; }
.login-card .register-form { gap: 8px; }
.login-field { display: block; }
.login-field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.login-input-shell {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 39px;
  padding: 0 11px;
  color: #687487;
  border: 1px solid rgba(144, 155, 180, .7);
  border-radius: 8px;
  background: rgba(255, 255, 255, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
  transition: color .15s, border-color .15s, box-shadow .15s, background .15s;
}
.login-input-shell:hover { border-color: #8277eb; background: rgba(255, 255, 255, .76); }
.login-input-shell:focus-within {
  color: #5146d9;
  border-color: #6b5fe8;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 0 0 4px rgba(107, 95, 232, .14), 0 6px 18px rgba(82, 70, 190, .07);
}
.login-card .login-input-shell input,
html[data-theme="light"] .login-card .login-input-shell input {
  min-width: 0;
  min-height: 37px;
  padding: 0 8px;
  color: #1f2937;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  font-size: 11px;
}
.login-card .login-input-shell input::placeholder,
html[data-theme="light"] .login-card .login-input-shell input::placeholder { color: #687487; }
.login-card .login-input-shell input:-webkit-autofill,
.login-card .login-input-shell input:-webkit-autofill:hover,
.login-card .login-input-shell input:-webkit-autofill:focus,
html[data-theme="light"] .login-card .login-input-shell input:-webkit-autofill {
  -webkit-text-fill-color: #1f2937;
  caret-color: #1f2937;
  box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 9999s ease-out;
}
.login-password-toggle {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  margin-right: -7px;
  padding: 0;
  color: #687487;
  border: 0;
  border-radius: 7px;
  background: transparent;
}
.login-password-toggle:hover { color: #4034c2; background: #eeeafe; }
.login-password-toggle:focus-visible {
  outline: 2px solid #6b5fe8;
  outline-offset: 1px;
}
.login-card .login-submit,
html[data-theme="light"] .login-card .login-submit {
  min-height: 38px;
  margin-top: 2px;
  color: #fff;
  border-color: #5b4de8;
  border-radius: 8px;
  background: linear-gradient(135deg, #7466f1, #5142d7);
  box-shadow: 0 12px 26px rgba(91, 77, 232, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.login-card .login-submit:hover,
html[data-theme="light"] .login-card .login-submit:hover {
  border-color: #493bcf;
  background: #493bcf;
  box-shadow: 0 12px 30px rgba(91, 77, 232, .3);
}
.aliyun-captcha-control > button {
  display: grid;
  width: 100%;
  min-height: 45px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 9px;
  color: #344054;
  border: 1px solid rgba(144, 155, 180, .7);
  border-radius: 8px;
  background: rgba(255, 255, 255, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
  text-align: left;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.aliyun-captcha-control > button:hover:not(:disabled) {
  border-color: #7569e9;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 0 0 3px rgba(91, 77, 232, .1);
}
.aliyun-captcha-control > button:focus-visible {
  outline: 3px solid rgba(91, 77, 232, .2);
  outline-offset: 2px;
}
.aliyun-captcha-control > button:disabled { cursor: wait; opacity: .72; }
.aliyun-captcha-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #5b4de8;
  border-radius: 7px;
  background: rgba(91, 77, 232, .1);
}
.aliyun-captcha-copy { min-width: 0; }
.aliyun-captcha-copy strong,
.aliyun-captcha-copy small { display: block; }
.aliyun-captcha-copy strong { color: #344054; font-size: 11px; line-height: 16px; }
.aliyun-captcha-copy small {
  margin-top: 1px;
  overflow: hidden;
  color: #667085;
  font-size: 9px;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aliyun-captcha-action {
  color: #5146d9;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.aliyun-captcha-control[data-state="success"] > button {
  border-color: rgba(18, 183, 106, .55);
  background: rgba(236, 253, 243, .72);
}
.aliyun-captcha-control[data-state="success"] .aliyun-captcha-icon { color: #067647; background: #d1fadf; }
.aliyun-captcha-control[data-state="success"] .aliyun-captcha-action { color: #067647; }
.aliyun-captcha-control[data-state="error"] > button,
.aliyun-captcha-control.has-error > button {
  border-color: rgba(240, 68, 56, .45);
  background: rgba(254, 243, 242, .72);
}
.aliyun-captcha-control[data-state="error"] .aliyun-captcha-icon,
.aliyun-captcha-control.has-error .aliyun-captcha-icon { color: #b42318; background: #fee4e2; }
.aliyun-captcha-control[data-state="error"] .aliyun-captcha-action,
.aliyun-captcha-control.has-error .aliyun-captcha-action { color: #b42318; }

#aliyunCaptcha-btn-refresh.platform-captcha-refresh-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  padding: 6px !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
  opacity: .92 !important;
  transition: opacity .16s ease, transform .16s ease !important;
}
#aliyunCaptcha-btn-refresh.platform-captcha-refresh-icon:hover {
  color: #fff !important;
  background: transparent !important;
  opacity: 1 !important;
  transform: rotate(24deg) !important;
}
#aliyunCaptcha-btn-refresh.platform-captcha-refresh-icon:focus-visible {
  outline: 2px solid #fff !important;
  outline-offset: 2px !important;
}
#aliyunCaptcha-btn-refresh.platform-captcha-refresh-icon > svg {
  display: block !important;
  width: 21px !important;
  height: 21px !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .82)) !important;
}
.login-card .auth-switch {
  margin: 22px 0 0;
  color: #596579;
  font-size: 12px;
  text-align: center;
}
.login-card .auth-switch a { color: #5146d9; font-weight: 650; }
.auth-card-trust {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  margin-top: 17px;
  color: #526075;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 10px;
  background: rgba(255, 255, 255, .34);
  font-size: 10px;
}
.auth-card-trust .ui-icon { color: #5b4de8; }
.auth-card-legal {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  color: #7b8494;
  font-size: 9px;
  line-height: 15px;
  text-align: center;
}
.auth-card-legal a { color: #5b4de8; font-weight: 650; }
.login-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 19px;
  color: #687487;
  font-size: 9px;
}
.login-form-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.login-form-options input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #5b4de8;
}
.login-form-options button {
  padding: 2px 0;
  color: #58657c;
  border: 0;
  background: transparent;
  font-size: 9px;
}
.login-form-options button:hover { color: #5146d9; }
.login-form-options button:focus-visible {
  outline: 2px solid #6b5fe8;
  outline-offset: 2px;
}
.register-agreement {
  margin: 2px 0 0;
  color: #7b8494;
  font-size: 8px;
  line-height: 13px;
  text-align: center;
}
.register-agreement a { color: #5b4de8; font-weight: 650; }
.login-body .ui-toast,
html[data-theme="light"] .login-body .ui-toast {
  color: #1f2937;
  border-color: #d5dce7;
  background: rgba(255, 255, 255, .94);
}

/* Near-square desktop screens use a balanced stacked composition. */
.login-body.is-login-square {
  height: 100dvh;
  overflow: hidden;
}
.login-body.is-login-square .login-shell {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  grid-template-columns: 1fr;
  grid-template-rows: 42% 58%;
  overflow: hidden;
  transform: none;
}
.login-body.is-login-square .login-brand {
  min-height: 0;
  overflow: hidden;
  padding: 34px 42px 20px;
  border-bottom: 1px solid rgba(170, 180, 195, .38);
}
.login-body.is-login-square .login-brand-tech,
.login-body.is-login-square .login-hero-copy,
.login-body.is-login-square .login-copyright { display: none; }
.login-body.is-login-square .login-character-stage {
  z-index: 1;
  bottom: -185px;
  left: 50%;
  width: min(34vw, 340px);
  opacity: 1;
  transform: translateX(-50%);
}
.login-body.is-login-square .login-card-wrap,
html[data-theme="light"] .login-body.is-login-square .login-card-wrap {
  min-height: 0;
  align-content: center;
  justify-items: center;
  padding: 18px 28px 24px;
  background: transparent;
}
.login-body.is-login-square .login-auth-stack {
  justify-items: center;
  transform: none;
}
.login-body.is-login-square .login-auth-intro { margin-bottom: 18px; }
.login-body.is-login-square .login-security-list { gap: 14px; margin-top: 20px; }

@media (max-width: 1180px) and (min-width: 961px) {
  .login-character-stage { left: 50%; }
  .login-brand-tech,
  .login-hero-copy,
  .login-copyright { display: none; }
  .login-security-list { gap: 10px; }
}

@media (max-height: 700px) and (min-width: 961px) {
  .login-card-wrap { padding-top: 22px; padding-bottom: 22px; }
  .login-card,
  html[data-theme="light"] .login-card { padding: 20px 27px; }
  .auth-mode-switch { margin-bottom: 16px; }
  .login-card-heading { margin-bottom: 16px; }
  .auth-card-trust { margin-top: 12px; }
  .auth-card-legal { margin-top: 8px; }
}

@media (max-width: 960px) {
  .login-shell {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .login-brand {
    min-height: 310px;
    overflow: hidden;
    padding: 30px clamp(24px, 7vw, 62px) 22px;
    border-bottom: 1px solid rgba(170, 180, 195, .5);
  }
  .login-brand-tech,
  .login-hero-copy,
  .login-copyright { display: none; }
  .login-brand-lockup {
    min-height: 48px;
    padding: 5px 13px 5px 6px;
  }
  .login-character-stage {
    z-index: 1;
    right: auto;
    bottom: max(-165px, -17.2vw, -23dvh);
    left: 50%;
    width: min(38vw, 46dvh, 300px);
    height: auto;
    opacity: 1;
    transform: translateX(-50%);
  }
  .login-card-wrap,
  html[data-theme="light"] .login-card-wrap {
    min-height: 520px;
    justify-items: center;
    padding: 48px 24px 64px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .38));
  }
  .login-auth-stack {
    justify-items: center;
    transform: none;
  }
  .login-auth-intro { margin-bottom: 22px; }
  .login-security-list { max-width: 430px; gap: 12px; margin-top: 24px; }
}

@media (max-width: 560px) {
  .login-brand {
    min-height: 248px;
    padding: 24px 20px 18px;
  }
  .login-brand-lockup .brand-mark { width: 34px; height: 34px; }
  .login-brand-lockup strong { font-size: 14px; line-height: 18px; }
  .login-brand-lockup small { font-size: 7px; }
  .login-character-stage {
    right: auto;
    bottom: max(-150px, -37.5vw, -25dvh);
    left: 50%;
    width: min(60vw, 34dvh, 240px);
    height: auto;
    opacity: 1;
  }
  .login-brand .login-hero-copy h1 { margin: 12px 0 9px; font-size: 30px; }
  .login-brand .login-hero-copy p { margin-bottom: 16px; font-size: 14px; }
  .login-hero-copy > small { font-size: 10px; }
  .login-copyright { display: none; }
  .login-card-wrap,
  html[data-theme="light"] .login-card-wrap { min-height: 500px; padding: 34px 14px 48px; }
  .login-auth-intro { display: none; }
  .login-card,
  html[data-theme="light"] .login-card {
    padding: 20px 18px;
    border-radius: 20px;
  }
  .auth-mode-switch { margin-bottom: 18px; }
  .login-card .login-card-heading h2,
  html[data-theme="light"] .login-card .login-card-heading h2 { font-size: 22px; }
  .auth-card-trust { font-size: 9px; }
  .login-security-list {
    grid-template-columns: 1fr;
    width: min(100%, 260px);
    margin-top: 20px;
  }
}

/* Platform logo: keep the supplied transparent artwork unframed. */
.brand-mark.brand-logo,
html[data-theme="light"] .brand-mark.brand-logo,
.login-brand-lockup .brand-mark.brand-logo,
html[data-theme="light"] .login-brand-lockup .brand-mark.brand-logo {
  overflow: visible;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.brand-mark.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
}
