:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --panel: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-secondary: #374151;
  --muted: #6b7280;
  --muted-light: #9ca3af;
  --brand: #1d4ed8;
  --brand-hover: #1e40af;
  --brand-soft: #eff6ff;
  --accent: #f59e0b;
  --accent-soft: #fff7ed;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-popover: 0 12px 32px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body,
#evox-online-studio {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
textarea,
select {
  max-width: 100%;
  font: inherit;
}

button,
a.action-link {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

button:hover,
a.action-link:hover {
  background: var(--surface-soft);
  border-color: #d1d5db;
  color: var(--text);
}

button:disabled,
a.action-link.disabled {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.16);
}

button.primary:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
  color: #ffffff;
}

button.primary.soft {
  border-color: #bbf7d0;
  background: var(--brand-soft);
  color: #15803d;
  box-shadow: none;
}

button.primary.soft:hover {
  border-color: var(--brand);
  background: #bbf7d0;
  color: #166534;
}

.ghost-btn {
  min-height: 32px;
  background: transparent;
}

.icon-btn {
  width: 36px;
  min-width: 36px;
  padding: 0;
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
}

.hidden,
[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.main-content {
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.brand-name {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.brand-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
  text-decoration: none;
}

.nav-btn.active,
.nav-btn:hover {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--text);
}

.home-site-link {
  margin-top: 8px;
  border-color: #bbf7d0;
  background: var(--brand-soft);
  color: #15803d;
}

.workspace {
  min-width: 0;
  min-height: 100vh;
  padding: 0;
  background: var(--bg);
}

.mobile-header {
  display: none;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

@media (min-width: 769px) {
  #evox-online-studio[data-active-studio-view="voiceView"] .workspace {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  #evox-online-studio[data-active-studio-view="voiceView"] .desktop-topbar {
    display: none;
  }

  #evox-online-studio[data-active-studio-view="voiceView"] #voiceView.active {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }
}

.layout.app-view.active {
  display: grid;
}

.tts-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 0;
}

#voiceView.active .tts-page {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#voiceView.active .tts-statusbar,
#voiceView.active .tts-toolbar,
#voiceView.active .tts-actionbar {
  flex: 0 0 auto;
}

.tts-statusbar {
  display: grid;
  grid-template-columns: minmax(170px, 0.75fr) minmax(240px, 1fr) minmax(360px, 1.1fr);
  align-items: center;
  gap: 16px;
  min-height: 58px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0 22px;
}

.status-left,
.status-center,
.status-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-left strong {
  color: var(--text);
  font-weight: 900;
}

.status-left span,
.status-center span {
  color: var(--muted);
  font-size: 13px;
}

.status-center {
  justify-content: center;
}

.status-center strong {
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-right {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.pill,
.count,
.status-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #15803d;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.muted,
.status-dot {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--muted);
}

.pill.warn {
  border-color: #fed7aa;
  background: var(--accent-soft);
  color: #c2410c;
}

.pill.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.avatar-btn {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  padding: 0;
  background: #111827;
  color: #ffffff;
}

.tts-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 62px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfe;
  padding: 6px 16px;
  overflow-x: auto;
  white-space: nowrap;
}

.tts-toolbar button {
  flex: 0 0 auto;
  min-height: 50px;
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.15;
}

.tts-toolbar button:hover {
  border-color: var(--border);
  background: var(--surface);
}

.tts-toolbar .toolbar-primary {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--brand);
}

.pause-menu {
  position: relative;
  flex: 0 0 auto;
}

.pause-popover {
  position: fixed;
  top: var(--pause-popover-top, 128px);
  left: var(--pause-popover-left, 270px);
  z-index: 95;
  display: grid;
  grid-template-columns: repeat(5, minmax(58px, 1fr));
  min-width: 360px;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  box-shadow: var(--shadow-popover);
}

.pause-popover button {
  justify-content: center;
  min-height: 34px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.pause-custom-field {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.pause-custom-field span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pause-custom-field input {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
}

.tts-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  flex: 1;
  min-height: 0;
  padding: 16px;
}

#voiceView.active .tts-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.tts-editor,
.tts-right-panel,
.panel,
.simple-page {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.tts-editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100vh - 206px);
  overflow: hidden;
}

#voiceView.active .tts-editor,
#voiceView.active .script-editor-shell,
#voiceView.active .script-editor {
  min-height: 0;
}

.editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 18px 20px 14px;
}

.editor-head div {
  display: grid;
  gap: 4px;
}

.editor-head span,
.side-title span,
.panel-title span,
.page-kicker,
.modal-head span,
.drawer-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.editor-head strong,
.side-title strong {
  color: var(--text);
  font-size: 17px;
}

.editor-head small {
  max-width: 420px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.script-editor-shell {
  position: relative;
  flex: 1;
  min-height: 360px;
  background: linear-gradient(90deg, #f9fafb 0 52px, #ffffff 52px);
}

.script-editor {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  padding: 22px 24px 22px 74px;
  font-size: 16px;
  line-height: 1.8;
}

.script-editor::placeholder {
  color: var(--muted-light);
}

.script-editor:focus {
  box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.16);
}

.paragraph-preview {
  position: absolute;
  top: 22px;
  left: 18px;
  z-index: 0;
  display: grid;
  gap: 14px;
  width: 28px;
  color: var(--muted-light);
  pointer-events: none;
}

.paragraph-preview span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  font-size: 12px;
  box-shadow: inset 0 0 0 1px var(--border);
}

.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding: 10px 20px;
  color: var(--muted);
  font-size: 13px;
}

.tts-right-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: stretch;
  min-width: 0;
  padding: 16px;
}

#voiceView.active .tts-right-panel {
  min-height: 0;
  overflow-y: auto;
}

.side-section {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.side-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.side-title button {
  min-height: 30px;
  padding: 0 10px;
}

.selected-voice {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.selected-voice.muted {
  display: block;
  min-height: auto;
  color: var(--muted);
  text-align: center;
}

.selected-voice .voice-avatar,
.voice-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: #15803d;
  font-weight: 900;
}

.selected-voice strong,
.voice-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-voice span,
.voice-copy span,
.selected-voice p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.selected-voice p {
  margin: 4px 0 0;
}

.clear-voice-btn {
  min-height: 30px;
  padding: 0 9px;
}

.voice-side-actions,
.quick-actions,
.actions,
.drawer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.quick-action-link:hover {
  border-color: #bbf7d0;
  background: var(--brand-soft);
  color: #15803d;
}

.emotion-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emotion-grid button {
  min-height: 30px;
  border-radius: 999px;
  padding: 0 11px;
  color: var(--muted);
}

.emotion-grid button.active {
  border-color: #bbf7d0;
  background: var(--brand-soft);
  color: #15803d;
}

.range-field {
  display: grid;
  gap: 8px;
}

.range-field span,
.field span,
.field-head span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.range-field span strong {
  color: var(--text);
  font-size: 13px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}

.range-field small {
  display: flex;
  justify-content: space-between;
  color: var(--muted-light);
  font-size: 12px;
}

.range-field small em {
  font-style: normal;
}

.current-result.empty p,
.current-result p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.result-card {
  display: grid;
  gap: 10px;
}

.result-card strong {
  color: var(--text);
  font-size: 14px;
}

.result-card audio {
  width: 100%;
  height: 36px;
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tts-actionbar {
  position: sticky;
  bottom: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  padding: 12px 18px;
  backdrop-filter: blur(10px);
  overflow-x: auto;
}

#voiceView.active .tts-actionbar {
  position: relative;
  bottom: auto;
}

.tts-actionbar button,
.tts-actionbar .action-link {
  flex: 0 0 auto;
}

.tts-actionbar .primary {
  min-width: 132px;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.simple-page {
  margin: 18px;
  max-width: 780px;
  padding: 30px;
}

.simple-page h1 {
  margin: 10px 0;
  color: var(--text);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.14;
}

.simple-page p {
  max-width: 620px;
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.75;
}

.dashboard-page {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.dashboard-hero,
.dashboard-card,
.workflow-card,
.lipsync-topbar,
.lipsync-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.dashboard-hero h1,
.lipsync-topbar h1 {
  margin: 6px 0 8px;
  color: var(--text);
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.15;
}

.dashboard-hero p,
.lipsync-topbar p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.dashboard-main,
.dashboard-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.workflow-card {
  display: grid;
  gap: 12px;
  min-height: 190px;
  padding: 18px;
}

.workflow-step {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #15803d;
  font-size: 12px;
  font-weight: 900;
}

.workflow-card h2,
.dashboard-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.workflow-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.workflow-card button {
  align-self: end;
  justify-self: start;
}

.dashboard-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dashboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-card-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.status-metrics article,
.generation-info article,
.asset-info,
.lip-current-result,
.recent-work-item,
.common-voice-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}

.status-metrics article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-metrics span,
.generation-info span,
.asset-info span,
.recent-work-item span,
.common-voice-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.status-metrics strong,
.generation-info strong,
.asset-info strong,
.recent-work-item strong,
.common-voice-item strong {
  color: var(--text);
  font-size: 14px;
}

.recent-work-list,
.common-voice-list {
  display: grid;
  gap: 10px;
}

.recent-work-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.work-type {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #15803d;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
}

.work-copy,
.common-voice-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.work-copy strong,
.common-voice-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-actions,
.common-voice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-empty {
  display: grid;
  gap: 12px;
  place-items: center;
  min-height: 150px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.common-voice-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.common-voice-actions {
  grid-column: 2;
  justify-content: flex-start;
}

.voice-library-page,
.settings-page {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.library-hero,
.library-toolbar-card,
.voice-filter-panel,
.voice-resource-main,
.library-side-card,
.voice-create-panel,
.settings-hero,
.settings-nav,
.settings-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.library-hero,
.settings-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
}

.library-hero h1,
.settings-hero h1 {
  margin: 6px 0 8px;
  color: var(--text);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
}

.library-hero p,
.settings-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.library-toolbar-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
}

.library-tabs,
.library-search-row,
.side-actions,
.settings-actions,
.tag-choice-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.library-tabs {
  overflow-x: auto;
  min-width: 0;
}

.library-tabs button,
.filter-group button,
.tag-choice-row button,
.settings-nav button {
  white-space: nowrap;
}

.library-tabs button,
.filter-group button,
.tag-choice-row button {
  min-height: 32px;
  border-radius: 999px;
  background: var(--surface);
}

.library-tabs button.active,
.filter-group button.active,
.tag-choice-row button.active {
  border-color: #bbf7d0;
  background: var(--brand-soft);
  color: #15803d;
}

.library-search-row input {
  min-width: 0;
  flex: 1;
}

.library-search-row select {
  width: 132px;
}

.voice-filter-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.filter-group strong {
  flex: 0 0 44px;
  color: var(--text-secondary);
  font-size: 13px;
}

.filter-group.wide strong {
  flex-basis: 44px;
}

.voice-library-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.voice-resource-main {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
}

.library-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.library-section-head span,
.library-side-card > span,
.create-panel-copy > span,
.settings-section-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.library-section-head h2,
.create-panel-copy h2,
.settings-section-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.library-section-head strong {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.voice-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.voice-page-grid .voice-card {
  min-height: 230px;
}

.voice-page-grid .voice-card:hover {
  border-color: #bbf7d0;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.voice-page-grid .voice-use-btn {
  border-color: #bbf7d0;
  background: var(--brand-soft);
  color: #15803d;
}

.voice-resource-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.library-side-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.library-side-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.mini-current-voice {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}

.mini-current-voice strong {
  color: var(--text);
}

.mini-current-voice span {
  color: var(--muted);
  font-size: 13px;
}

.asset-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.asset-metrics article {
  display: grid;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px;
}

.asset-metrics strong {
  color: var(--text);
  font-size: 20px;
}

.asset-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.voice-create-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
}

.create-panel-copy p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.voice-create-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.compact-upload {
  min-height: 150px;
}

.record-entry-card {
  align-content: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 18px;
}

.record-guide {
  display: grid;
  gap: 4px;
}

.record-guide strong {
  color: var(--text);
}

.record-guide span {
  color: var(--muted);
}

.voice-detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 85;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 24px));
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
  transform: translateX(104%);
  transition: transform 0.2s ease;
}

.voice-detail-drawer.open {
  transform: translateX(0);
}

.voice-detail-body {
  display: grid;
  gap: 16px;
  padding: 18px;
  overflow: auto;
}

.voice-detail-profile {
  display: grid;
  gap: 12px;
  justify-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  text-align: center;
}

.voice-detail-avatar {
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: #15803d;
  font-size: 28px;
  font-weight: 900;
}

.voice-detail-tags,
.capability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-detail-tags span,
.capability-list span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.voice-detail-section {
  display: grid;
  gap: 8px;
}

.voice-detail-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.voice-detail-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.voice-detail-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-top: 12px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.settings-nav button {
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}

.settings-nav button.active {
  border-color: #bbf7d0;
  background: var(--brand-soft);
  color: #15803d;
}

.settings-content {
  display: grid;
  min-width: 0;
}

.settings-section {
  display: none;
  gap: 16px;
  min-width: 0;
  padding: 18px;
}

.settings-section.active {
  display: grid;
}

.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-metric-grid,
.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.settings-metric-grid article,
.diagnostic-grid article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 14px;
}

.settings-metric-grid span,
.diagnostic-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-metric-grid strong,
.diagnostic-grid strong {
  color: var(--text);
  font-size: 18px;
}

.settings-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

.settings-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.settings-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.account-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-account-card {
  position: relative;
  padding-left: 72px;
}

.product-account-card[data-icon]::before {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eef5ff;
}

.settings-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.checkline input {
  width: auto;
  margin-top: 3px;
}

.worker-notice {
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: var(--brand-soft);
  color: #15803d;
  padding: 12px 14px;
  line-height: 1.6;
}

.worker-notice.warn {
  border-color: #fed7aa;
  background: var(--accent-soft);
  color: #92400e;
}

.diagnostic-details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}

.diagnostic-details summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 800;
}

.lipsync-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 1px);
  padding-bottom: 76px;
}

.lipsync-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 12px 16px 0;
  padding: 14px 18px;
}

.lipsync-topbar .page-kicker {
  display: none;
}

.lipsync-topbar h1 {
  margin: 0 0 6px;
  font-size: clamp(27px, 2.4vw, 34px);
}

.lipsync-topbar p {
  line-height: 1.55;
}

.lipsync-top-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.lipsync-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  min-height: 0;
  padding: 12px 16px 16px;
}

.lipsync-panel {
  min-width: 0;
  padding: 16px;
}

.material-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.compact-title {
  margin-bottom: 0;
}

.compact-title h2 {
  font-size: 17px;
}

.audio-title {
  margin-top: 4px;
}

.video-input-panel {
  display: grid;
  gap: 14px;
}

.lipsync-section-title {
  margin-bottom: -2px;
}

.video-compose-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 960px);
  gap: 14px;
  align-items: stretch;
  justify-content: start;
}

.lipsync-side-stack {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.video-input-column,
.side-audio-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.upload-dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 155px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 18px;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--brand);
  background: #f0fdf4;
}

.upload-dropzone input {
  display: none;
}

.upload-dropzone strong {
  color: var(--text);
  font-size: 15px;
}

.upload-dropzone span,
.upload-dropzone em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.asset-info {
  display: grid;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 13px;
}

.side-audio-card .lipsync-section-title h2 {
  font-size: 16px;
}

.side-audio-card .lip-source-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.side-audio-card .lip-source-tabs button {
  min-width: 0;
  padding-right: 8px;
  padding-left: 8px;
  font-size: 13px;
}

.side-audio-card .voice-tools {
  grid-template-columns: 1fr auto;
}

.compact-record-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-record-controls .record-timer {
  grid-column: 1 / -1;
}

.asset-info.empty,
.lip-current-result.empty {
  color: var(--muted);
}

.detect-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #15803d;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.detect-status.muted {
  background: var(--surface-soft);
  color: var(--muted);
}

.detect-status.warn {
  background: var(--accent-soft);
  color: #c2410c;
}

.preview-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  width: min(100%, 960px);
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 0;
  max-height: 540px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0f172a;
}

.lip-video-preview {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  background: #111827;
}

.preview-low-note {
  position: absolute;
  right: 14px;
  bottom: 12px;
  max-width: min(420px, calc(100% - 28px));
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  padding: 7px 12px;
  font-size: 11px;
  line-height: 1.45;
}

.preview-low-note.inline {
  position: static;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  background: #eff6ff;
  color: #1d4ed8;
}

.lip-basic-options {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfe;
  padding: 0;
  box-shadow: none;
  overflow: hidden;
}

.lip-basic-options {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1fr);
  align-items: start;
}

.lip-basic-options .panel-title {
  margin-bottom: -2px;
}

.lip-basic-options .panel-title h2 {
  font-size: 15px;
}

.lip-basic-options .panel-title,
.subtitle-settings-panel,
.lip-option-row.split {
  grid-column: auto;
}

.lip-option-row {
  min-height: 54px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  padding: 12px 14px;
  font-size: 14px;
}

.lip-basic-options > .lip-option-row:nth-child(4) {
  border-right: 0;
}

.lip-option-row.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lip-option-row .check-field {
  padding: 0;
}

.lip-option-row em {
  color: var(--muted);
  font-style: normal;
}

.ambient-row {
  display: grid;
  grid-template-columns: auto minmax(0, max-content) minmax(150px, 220px);
  align-items: center;
  gap: 10px;
}

.inline-slider {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-slider.muted {
  opacity: 0.5;
}

.inline-slider input {
  min-width: 110px;
}

.subtitle-settings-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  border: 1px solid #dbeafe;
  border-width: 1px 0 0;
  border-radius: 0;
  background: #f8fbff;
  padding: 12px;
}

.settings-two-col.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subtitle-preview-box {
  display: grid;
  place-items: center;
  min-height: 72px;
  border-radius: 10px;
  background: #111827;
  color: #ffffff;
  font-weight: 900;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

.lip-progress {
  display: grid;
  gap: 10px;
  width: min(420px, calc(100% - 40px));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.lip-progress strong {
  color: var(--text);
  font-size: 18px;
}

.lip-progress span {
  color: var(--muted);
  line-height: 1.5;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.progress-bar span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  animation: progressPulse 1.4s ease-in-out infinite alternate;
}

@keyframes progressPulse {
  from { transform: translateX(-30%); }
  to { transform: translateX(150%); }
}

.lip-current-result {
  display: grid;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.lip-current-result.empty {
  display: none;
}

.side-audio-card #lipSelectedAudio:not(.empty) {
  border-color: #a7c7ff;
  background: #f8fbff;
}

.generation-info {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.generation-info article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.advanced-settings {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px 12px;
}

.advanced-settings summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 800;
}

.advanced-settings .field {
  margin-top: 12px;
}

.lipsync-actionbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 236px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  padding: 12px 18px;
  backdrop-filter: blur(10px);
  overflow-x: auto;
}

.lipsync-actionbar .primary {
  min-width: 160px;
}

.lipsync-actionbar button,
.lipsync-actionbar .action-link {
  flex: 0 0 auto;
  white-space: nowrap;
}

.lipsync-bottom-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lipsync-bottom-status span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 6px 10px;
}

.lipsync-bottom-status strong {
  color: #15803d;
}

.multi-role-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 82;
  display: flex;
  flex-direction: column;
  width: min(1120px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
  transform: translate(-50%, -50%);
  overflow: hidden;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.multi-role-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 16px;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.role-canvas-panel,
.role-list-panel,
.role-strategy-card {
  display: grid;
  gap: 12px;
}

.role-editor-toolbar,
.role-list-head,
.modal-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.role-list-head {
  justify-content: space-between;
}

.role-editor-toolbar button.active {
  border-color: #bbf7d0;
  background: var(--brand-soft);
  color: #15803d;
}

.role-preview-canvas {
  position: relative;
  display: grid;
  min-height: 380px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(229, 231, 235, 0.48) 1px, transparent 1px),
    linear-gradient(rgba(229, 231, 235, 0.48) 1px, transparent 1px),
    #f8fafc;
  background-size: 32px 32px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.role-box {
  position: absolute;
  display: grid;
  place-items: start;
  border: 2px solid #22c55e;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.08);
  color: #ffffff;
  padding: 6px;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.9);
}

.role-list {
  display: grid;
  gap: 10px;
  max-height: 380px;
  overflow: auto;
}

.role-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}

.role-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.role-item-head strong {
  color: var(--text);
}

.role-item .field {
  gap: 5px;
}

.role-status {
  width: fit-content;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #c2410c;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.role-status.ready {
  background: var(--brand-soft);
  color: #15803d;
}

.role-empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.role-strategy-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: #fbfcfe;
  padding: 12px 16px;
}

.drawer-job-section {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.drawer-job-section h3 {
  margin: 8px 16px 0;
  color: var(--text);
  font-size: 14px;
}

.panel {
  padding: 18px;
}

.layout {
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  align-items: start;
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title h2,
.modal-head h2,
.drawer-head h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 18px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

textarea,
input[type="text"],
input[type="number"],
input[type="file"],
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 3px;
  overflow-x: auto;
}

.segmented button {
  min-height: 28px;
  border-color: transparent;
  background: transparent;
  padding: 0 10px;
  white-space: nowrap;
}

.segmented button.active {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.file-action-row,
.voice-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.record-ref-panel,
.lip-audio-panel {
  display: grid;
  gap: 10px;
}

.record-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.record-timer {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  padding: 0 10px;
  font-family: Consolas, monospace;
  font-size: 13px;
}

.record-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.record-preview,
.result-preview {
  width: 100%;
  height: 38px;
}

.hidden-audio {
  display: none;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.check-field input {
  width: 16px;
  height: 16px;
}

.status-json {
  min-height: 360px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  padding: 14px;
  overflow: auto;
  line-height: 1.5;
}

.role-mapping-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: #f0fdf4;
  padding: 14px 20px;
}

.role-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.role-panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.role-mapping-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.role-row {
  display: grid;
  grid-template-columns: minmax(80px, 0.8fr) minmax(120px, 1.2fr);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: var(--surface);
  padding: 7px;
}

.role-name {
  overflow: hidden;
  color: var(--text-secondary);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: min(960px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
  transform: translate(-50%, -50%);
  overflow: hidden;
}

.tts-tool-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 82;
  display: flex;
  flex-direction: column;
  width: min(920px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
  transform: translate(-50%, -50%);
  overflow: hidden;
}

.tts-tool-body {
  display: grid;
  gap: 14px;
  min-height: 260px;
  padding: 16px;
  overflow: auto;
}

.tts-tool-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: #fbfcfe;
  padding: 12px 16px;
}

.tool-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-tabs.compact {
  max-height: 96px;
  overflow: auto;
}

.tool-tabs button,
.tool-chip-actions button {
  min-height: 32px;
  border-radius: 999px;
}

.tool-tabs button.active,
.tool-chip-actions button.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--brand);
}

.tool-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 14px;
  align-items: stretch;
}

.tool-grid.split {
  grid-template-columns: 1fr 1fr;
}

.tool-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.tool-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-panel-title strong {
  color: var(--text);
}

.tool-panel-title span,
.tool-hint,
.tool-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.tool-form-grid {
  display: grid;
  gap: 12px;
}

.tool-form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-field {
  display: grid;
  gap: 6px;
}

.tool-field span,
.tool-radio-group legend {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.tool-field em,
.tool-radio-group em {
  color: var(--danger);
  font-style: normal;
}

.tool-field input,
.tool-field textarea,
.tool-field select,
.tool-result-text,
.inline-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

.tool-field textarea,
.tool-result-text {
  min-height: 240px;
  resize: vertical;
  line-height: 1.7;
}

.tool-radio-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}

.tool-radio-group > div,
.tool-chip-actions,
.tool-check-row,
.tool-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-radio-group label,
.tool-check-row label,
.tool-check-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 0 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.rewrite-modes {
  max-height: 86px;
  overflow: auto;
}

.example-list,
.role-detect-list,
.example-mini-list {
  display: grid;
  gap: 10px;
}

.example-card,
.role-detect-row,
.rule-row,
.tool-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px;
}

.example-card p,
.tool-notice span,
.role-detect-row em {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  font-style: normal;
}

.example-card {
  padding: 14px;
}

.example-card button,
.rule-row button {
  align-self: start;
}

.rule-row span {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.role-detect-row {
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 220px) auto;
}

.role-detect-row select {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 9px;
}

.rule-row.risk {
  border-color: #fed7aa;
  background: #fff7ed;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.example-mini-list span {
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 13px;
}

.number-detect-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.modal-backdrop,
.drawer-backdrop,
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, 0.28);
}

.modal-head,
.drawer-head,
.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
}

.voice-library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.voice-library-filterbar,
.my-voice-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-library-filterbar button,
.my-voice-tabs button {
  min-height: 32px;
  border-radius: 999px;
}

.voice-library-filterbar button.active,
.voice-library-filterbar button.is-active,
.my-voice-tabs button.active {
  border-color: #bbf7d0;
  background: var(--brand-soft);
  color: #15803d;
}

.voice-market-actions {
  display: grid;
  grid-template-columns: minmax(180px, 300px) auto;
  gap: 10px;
}

.voice-library-panel,
.upload-ref-panel,
.record-ref-panel {
  padding: 16px;
  overflow: auto;
}

.voice-market-grid,
.favorite-voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  min-height: 260px;
}

.voice-card {
  display: grid;
  gap: 12px;
  align-content: space-between;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 13px;
  box-shadow: var(--shadow-card);
}

.voice-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.voice-main {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.voice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.voice-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 7px;
  font-size: 12px;
}

.voice-desc {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.voice-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-actions button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 13px;
}

.voice-use-btn,
.voice-favorite-btn.favorited {
  border-color: #bbf7d0;
  background: var(--brand-soft);
  color: #15803d;
}

.voice-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.jobs-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
  transform: translateX(102%);
  transition: transform 0.2s ease;
}

.jobs-drawer.open {
  transform: translateX(0);
}

.drawer-actions {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.jobs {
  display: grid;
  gap: 10px;
  padding: 16px;
  overflow: auto;
}

.job {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 13px;
  box-shadow: var(--shadow-card);
}

.job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.job-title {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-meta,
.job-log,
.job-details {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.job-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.job-status.pending,
.job-status.claimed,
.job-status.running {
  background: var(--accent-soft);
  color: #c2410c;
}

.job-status.succeeded {
  background: var(--brand-soft);
  color: #15803d;
}

.job-status.failed {
  background: #fef2f2;
  color: #b91c1c;
}

.job-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.job-actions a,
.job-actions button,
.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0 9px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.job-actions a:hover,
.job-actions button:hover {
  background: var(--surface-soft);
}

.job-details {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.job-details summary {
  cursor: pointer;
  font-weight: 800;
}

.result-preview {
  display: none;
}

.result-preview.active {
  display: block;
}

.video-preview {
  width: 100%;
  height: auto;
  max-height: 280px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #111827;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  width: min(320px, 88vw);
  border-right: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
  transform: translateX(-102%);
  transition: transform 0.2s ease;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-head strong,
.mobile-drawer-head span {
  display: block;
}

.mobile-drawer-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-nav-drawer nav {
  padding: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 82px;
  z-index: 120;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 12px 14px;
  box-shadow: var(--shadow-popover);
  font-size: 14px;
}

.toast.error {
  border-color: #fecaca;
}

.toast.warn {
  border-color: #fed7aa;
}

.upgrade-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 18px;
}

.upgrade-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
}

.upgrade-modal {
  position: relative;
  display: grid;
  width: min(460px, 100%);
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow-popover);
}

.upgrade-modal > span {
  width: fit-content;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #15803d;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.upgrade-modal h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.3;
}

.upgrade-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.upgrade-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.upgrade-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.upgrade-actions a,
.upgrade-actions button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 13px;
  font-weight: 800;
  text-decoration: none;
}

.upgrade-primary {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.upgrade-secondary {
  border: 1px solid #bbf7d0;
  background: var(--brand-soft);
  color: #15803d;
}

@media (max-width: 1120px) {
  .tts-statusbar {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 12px 18px;
  }

  .status-center {
    justify-content: flex-start;
  }

  .status-right {
    justify-content: flex-start;
  }

  .tts-main {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .dashboard-grid,
  .lipsync-workspace,
  .voice-library-workspace,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-side,
  .voice-resource-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-nav {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .settings-metric-grid,
  .diagnostic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lip-basic-options,
  .multi-role-body {
    grid-template-columns: 1fr;
  }

  .lip-option-row {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .lip-basic-options > .lip-option-row:nth-child(4) {
    border-bottom: 0;
  }

  .ambient-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ambient-row .inline-slider {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
    min-width: 0;
  }

  .desktop-sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 35;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    padding: 8px 12px;
    backdrop-filter: blur(10px);
  }

  .mobile-header > div {
    display: grid;
    gap: 2px;
    min-width: 0;
    flex: 1;
  }

  .mobile-header strong,
  .mobile-header span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-header strong {
    font-size: 14px;
  }

  .mobile-header span {
    color: var(--muted);
    font-size: 12px;
  }

  .status-dot {
    max-width: 106px;
  }

  .tts-page {
    display: block;
    min-height: auto;
  }

  .dashboard-page,
  .voice-library-page,
  .settings-page {
    padding: 12px;
  }

  .dashboard-hero,
  .library-hero,
  .settings-hero {
    display: grid;
    padding: 18px;
  }

  .dashboard-hero h1,
  .lipsync-topbar h1,
  .library-hero h1,
  .settings-hero h1 {
    font-size: 28px;
  }

  .dashboard-grid,
  .workflow-grid,
  .dashboard-side,
  .voice-library-workspace,
  .voice-resource-side,
  .settings-layout,
  .settings-two-col,
  .settings-metric-grid,
  .diagnostic-grid,
  .voice-create-panel,
  .lipsync-workspace {
    grid-template-columns: 1fr;
  }

  .library-toolbar-card {
    grid-template-columns: 1fr;
  }

  .library-search-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .library-tabs,
  .filter-group,
  .settings-nav {
    overflow-x: auto;
  }

  .voice-filter-panel {
    padding: 12px;
  }

  .voice-resource-main,
  .library-side-card,
  .voice-create-panel,
  .settings-section {
    padding: 14px;
  }

  .voice-page-grid {
    grid-template-columns: 1fr;
  }

  .asset-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-nav {
    position: static;
    display: flex;
  }

  .settings-nav button {
    flex: 0 0 auto;
  }

  .voice-detail-drawer {
    top: auto;
    width: 100%;
    max-height: 88vh;
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    transform: translateY(104%);
  }

  .voice-detail-drawer.open {
    transform: translateY(0);
  }

  .workflow-card {
    min-height: auto;
  }

  .recent-work-item,
  .common-voice-item {
    grid-template-columns: 1fr;
  }

  .common-voice-actions {
    grid-column: auto;
  }

  .work-actions {
    justify-content: flex-start;
  }

  .tts-statusbar {
    display: none;
  }

  .tts-toolbar {
    min-height: 60px;
    padding: 6px 10px;
  }

  .tts-main {
    display: block;
    padding: 12px;
  }

  .tts-editor {
    width: 100%;
    min-width: 0;
    min-height: 430px;
  }

  .editor-head {
    display: grid;
    padding: 14px;
  }

  .editor-head small {
    max-width: none;
    text-align: left;
  }

  .script-editor-shell {
    min-height: 300px;
  }

  .script-editor {
    min-height: 310px;
    padding: 18px 16px 18px 58px;
    font-size: 15px;
  }

  .editor-foot {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 14px;
  }

  .tts-right-panel {
    width: 100%;
    position: static;
    margin-top: 12px;
  }

  .role-mapping-grid,
  .grid-2,
  .layout,
  .voice-market-grid,
  .favorite-voice-grid,
  .file-action-row,
  .voice-tools,
  .voice-market-actions {
    grid-template-columns: 1fr;
  }

  .role-row {
    grid-template-columns: 1fr;
  }

  .tts-actionbar {
    min-height: 62px;
    padding: 10px 12px;
  }

  .tts-actionbar .primary {
    min-width: 118px;
  }

  .lipsync-page {
    display: block;
    min-height: auto;
    padding-bottom: 82px;
  }

  .lipsync-topbar {
    display: grid;
    margin: 12px;
    padding: 18px;
  }

  .lipsync-top-actions {
    justify-content: flex-start;
  }

  .lipsync-workspace {
    display: grid;
    gap: 12px;
    padding: 0 12px 12px;
  }

  .lipsync-panel {
    padding: 14px;
  }

  .video-compose-grid {
    grid-template-columns: 1fr;
  }

  .preview-stage {
    height: min(360px, 52vh);
    min-height: 300px;
  }

  .lipsync-actionbar {
    right: 0;
    left: 0;
    min-height: 62px;
    padding: 10px 12px;
  }

  .lipsync-actionbar .primary {
    min-width: 150px;
  }

  .lip-basic-options {
    grid-template-columns: 1fr;
  }

  .lip-option-row.split,
  .lipsync-bottom-status {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .lipsync-bottom-status {
    width: 100%;
    margin-left: 0;
  }

  .settings-two-col.compact,
  .multi-role-body {
    grid-template-columns: 1fr;
  }

  .multi-role-modal {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
  }

  .role-preview-canvas {
    min-height: 300px;
  }

  .simple-page,
  .layout,
  .status-panel {
    margin: 12px;
    padding: 18px;
  }

  .layout {
    display: block;
  }

  .layout.app-view.active {
    display: block;
  }

  .layout .jobs-panel {
    margin-top: 12px;
  }

  .field-head,
  .voice-library-toolbar {
    display: grid;
    align-items: stretch;
  }

  .segmented,
  .voice-library-filterbar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .voice-modal {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 88vh;
    border-radius: 14px 14px 0 0;
    transform: none;
  }

  .tts-tool-modal {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 88vh;
    border-radius: 14px 14px 0 0;
    transform: none;
  }

  .tool-grid,
  .tool-grid.split,
  .tool-form-grid.two,
  .role-detect-row,
  .example-card,
  .rule-row,
  .tool-notice,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .tts-tool-footer {
    justify-content: stretch;
  }

  .tts-tool-footer button {
    flex: 1 1 auto;
  }

  .jobs-drawer {
    width: min(380px, 100vw);
  }

  .toast {
    right: 12px;
    bottom: 76px;
  }
}

/* Copywriter workspace inside /studio */
.copywriter-workbench {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 18px;
}

.copywriter-topbar,
.copywriter-nav-panel,
.copywriter-form-panel,
.copywriter-result-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.copywriter-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
}

.copywriter-topbar h1 {
  margin: 6px 0 8px;
  color: var(--text);
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.15;
}

.copywriter-topbar p,
.copywriter-panel-title p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.copywriter-top-actions,
.copy-generate-row,
.copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.copywriter-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) minmax(360px, .9fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.copywriter-nav-panel,
.copywriter-form-panel,
.copywriter-result-panel {
  min-width: 0;
  padding: 16px;
}

.copywriter-nav-panel,
.copywriter-result-panel {
  position: sticky;
  top: 18px;
}

.copywriter-panel-title {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}

.copywriter-panel-title > span {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.copywriter-panel-title strong {
  color: var(--text);
  font-size: 19px;
}

.copy-category-list,
.copy-template-list,
.copy-fields,
.copy-result-sections {
  display: grid;
  gap: 10px;
}

.copy-category-list button,
.copy-template-list button {
  justify-content: flex-start;
  width: 100%;
  height: auto;
  min-height: 40px;
  text-align: left;
}

.copy-category-list button.active,
.copy-template-list button.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.copy-template-list button {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.copy-template-list strong {
  color: inherit;
}

.copy-template-list span,
.copy-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.copy-empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.copy-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.copy-field,
.copy-check-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 800;
}

.copy-field-wide {
  grid-column: 1 / -1;
}

.copy-field em,
.copy-check-field em {
  color: var(--danger);
  font-style: normal;
  margin-left: 3px;
}

.copy-field input,
.copy-field textarea,
.copy-field select,
.copy-final-text,
.copy-refine-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  padding: 11px 12px;
  outline: none;
}

.copy-field textarea,
.copy-final-text,
.copy-refine-input {
  resize: vertical;
  line-height: 1.75;
}

.copy-field input:focus,
.copy-field textarea:focus,
.copy-field select:focus,
.copy-final-text:focus,
.copy-refine-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.copy-check-field {
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}

.copy-check-field input {
  width: 18px;
  height: 18px;
  accent-color: #1d4ed8;
}

.copy-status,
.copy-error {
  margin: 12px 0 0;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.copy-status {
  color: #1d4ed8;
  background: #eff6ff;
}

.copy-error {
  color: #991b1b;
  background: #fef2f2;
}

.copy-final-text {
  min-height: 230px;
  font-size: 15px;
}

.copy-result-sections {
  margin-top: 14px;
}

.copy-result-sections section {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}

.copy-result-sections h3 {
  margin: 0 0 9px;
  color: var(--text);
  font-size: 14px;
}

.copy-chip-list,
.copy-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.copy-chip-list span,
.copy-list span,
.copy-chip-list em,
.copy-list em {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-secondary);
  padding: 7px 10px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.copy-list {
  display: grid;
}

.copy-list span {
  border-radius: 8px;
  line-height: 1.55;
}

.copy-result-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.copy-result-meta div {
  display: grid;
  gap: 4px;
}

.copy-result-meta span {
  color: var(--muted);
  font-size: 12px;
}

.copy-result-meta strong {
  color: var(--text);
}

.copy-refine-input {
  margin-top: 14px;
}

.copy-actions button.primary.soft {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: none;
}

@media (max-width: 1280px) {
  .copywriter-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .copywriter-result-panel {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .copywriter-topbar {
    display: grid;
    padding: 18px;
  }

  .copywriter-layout,
  .copy-fields,
  .copy-result-meta {
    grid-template-columns: 1fr;
  }

  .copywriter-nav-panel {
    position: static;
  }

  .copy-category-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .copy-category-list button {
    flex: 0 0 auto;
    width: auto;
  }
}

@media (max-width: 520px) {
  .copywriter-workbench {
    padding: 12px;
  }

  .copywriter-nav-panel,
  .copywriter-form-panel,
  .copywriter-result-panel {
    padding: 14px;
  }

  .copywriter-top-actions,
  .copy-generate-row,
  .copy-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .copywriter-top-actions button,
  .copy-generate-row button,
  .copy-actions button {
    width: 100%;
  }
}

/* EVox Studio creation hall refresh */
.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
}

button.primary {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.16);
}

button.primary:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

button.primary.soft,
.quick-action-link:hover,
.nav-btn.active,
.nav-btn:hover,
.voice-library-filterbar button.active,
.voice-library-filterbar button.is-active,
.my-voice-tabs button.active,
.copy-category-list button.active,
.copy-template-list button.active,
.library-tabs button.active,
.filter-group button.active,
.tag-choice-row button.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.pill,
.count,
.status-dot,
.voice-avatar,
.selected-voice .voice-avatar,
.work-type {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.voice-use-btn,
.voice-favorite-btn.favorited,
.voice-page-grid .voice-use-btn,
.copy-actions button.primary.soft {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.job-status.succeeded {
  background: #dcfce7;
  color: #15803d;
}

.brand-mark {
  background: var(--brand);
}

.sidebar {
  gap: 14px;
  padding: 18px 14px 20px;
}

.grouped-nav {
  gap: 14px;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group > span {
  color: #94a3b8;
  padding: 0 12px 2px;
  font-size: 12px;
  font-weight: 900;
}

.home-site-link {
  margin-top: 0;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.mobile-new-btn {
  min-height: 34px;
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.dashboard-page {
  gap: 18px;
  padding: 22px;
}

.dashboard-hero {
  align-items: stretch;
  border-radius: 14px;
  background:
    radial-gradient(circle at 84% 12%, rgba(29, 78, 216, .1), transparent 28%),
    #ffffff;
  padding: 26px;
}

.dashboard-hero h1 {
  font-size: clamp(30px, 3vw, 44px);
}

.home-summary-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(108px, 1fr));
  gap: 10px;
  min-width: min(420px, 100%);
}

.home-summary-strip article,
.home-task-summary article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
}

.home-summary-strip article span,
.home-task-summary article span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-summary-strip article strong,
.home-task-summary article strong {
  color: var(--text);
  font-size: 17px;
}

.home-summary-strip button {
  grid-column: 1 / -1;
}

.home-core-actions {
  display: grid;
  grid-template-columns: 1.12fr repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-action-card,
.home-tool-section,
.home-template-section,
.guided-hero,
.guided-steps article {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.home-action-card {
  display: grid;
  gap: 12px;
  min-height: 218px;
  padding: 20px;
}

.home-action-card.featured {
  border-color: rgba(29, 78, 216, .22);
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
}

.home-action-card > span,
.guided-steps article > span {
  display: inline-grid;
  width: 34px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.home-action-card h2,
.home-section-head h2,
.guided-hero h1,
.guided-steps h2 {
  margin: 0;
  color: var(--text);
}

.home-action-card p,
.guided-hero p,
.guided-steps p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.home-action-card button {
  align-self: end;
  justify-self: start;
}

.home-tool-section,
.home-template-section {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.home-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.home-section-head span {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.home-section-head h2 {
  font-size: 20px;
}

.home-tool-grid,
.template-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.template-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-tool-grid button,
.template-grid button {
  justify-content: flex-start;
  min-height: 44px;
  background: #f8fafc;
  color: #334155;
  white-space: normal;
  line-height: 1.35;
}

.home-tool-grid button:hover,
.template-grid button:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.home-work-grid {
  grid-template-columns: minmax(0, 1fr);
}

.home-task-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-task-list {
  display: grid;
  gap: 10px;
}

.home-task-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px;
}

.home-task-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-task-item small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.home-task-item button {
  grid-row: 1 / span 2;
  grid-column: 3;
  min-height: 30px;
}

.guided-page {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.guided-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.guided-hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.15;
}

.guided-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.guided-steps article {
  display: grid;
  gap: 12px;
  min-height: 230px;
  padding: 20px;
}

.guided-steps button {
  align-self: end;
  justify-self: start;
}

.resource-entry-page {
  max-width: 860px;
}

.settings-page .worker-notice,
.settings-page .diagnostic-details {
  max-width: 100%;
}

@media (max-width: 1180px) {
  .home-core-actions,
  .home-tool-grid,
  .template-grid,
  .guided-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-work-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-shell {
    display: block;
  }

  .mobile-nav-drawer .grouped-nav {
    gap: 12px;
  }

  .dashboard-page,
  .guided-page {
    padding: 12px;
  }

  .dashboard-hero,
  .guided-hero {
    display: grid;
    padding: 18px;
  }

  .home-summary-strip,
  .home-core-actions,
  .home-tool-grid,
  .template-grid,
  .guided-steps,
  .home-task-summary {
    grid-template-columns: 1fr;
  }

  .home-action-card {
    min-height: auto;
  }

  .home-section-head {
    display: grid;
  }

  .home-tool-grid button,
  .template-grid button {
    min-height: 42px;
  }

  .home-task-item {
    grid-template-columns: 1fr;
  }

  .home-task-item small,
  .home-task-item button {
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
  }
}

/* 2026-06-08 simplified creation hall refresh */
.brand-home-link {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  text-align: left;
}

.brand-home-link:hover,
.brand-home-link.active {
  background: #f2f6ff;
}

.mobile-drawer-head .brand-home-link {
  width: auto;
  margin: 0;
  padding: 0;
}

.mobile-drawer-head .brand-home-link:hover,
.mobile-drawer-head .brand-home-link.active {
  background: transparent;
}

.download-site-link {
  margin-top: 10px;
  color: #1d4ed8;
  background: #edf4ff;
  border-color: rgba(29, 78, 216, .14);
  font-weight: 900;
}

.download-site-link:hover {
  color: #173cae;
  background: #e4efff;
}

.studio-home-view .dashboard-hero {
  align-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.studio-home-view .dashboard-hero h1 {
  font-size: clamp(34px, 4vw, 54px);
  letter-spacing: 0;
}

.studio-home-view .dashboard-hero p {
  color: #64748b;
}

.simplified-core-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.simplified-core-actions .home-action-card {
  min-height: 254px;
  border-radius: 8px;
  background: #ffffff;
}

.simplified-core-actions .home-action-card h2 {
  font-size: 26px;
  letter-spacing: 0;
}

.simplified-core-actions .home-action-card p {
  max-width: 360px;
}

.home-action-card button,
.home-summary-strip button,
.dashboard-card-head button,
.dashboard-empty button {
  border-radius: 8px;
}

.home-tool-section,
.home-template-section {
  display: none !important;
}

.more-tools-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  border: 1px solid #dfe7f5;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2f48;
  font-weight: 900;
  cursor: pointer;
}

.more-tools-row span {
  color: #7a879b;
  font-size: 13px;
  font-weight: 700;
}

.more-tools-row:hover {
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, .26);
  background: #f8fbff;
}

.home-recent-only {
  border-radius: 8px;
  min-height: 280px;
}

.home-recent-only .recent-work-list {
  min-height: 170px;
}

@media (max-width: 1180px) {
  .simplified-core-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .studio-home-view .dashboard-hero {
    gap: 18px;
  }

  .more-tools-row {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    text-align: center;
  }

  .mobile-drawer-head .brand-home-link {
    display: flex;
  }
}

/* 2026-06-09 icon and dashboard detail polish */
[data-icon="arrow-right"] { --icon-url: url("/icons/arrow-right.svg"); }
[data-icon="audio-lines"] { --icon-url: url("/icons/audio-lines.svg"); }
[data-icon="bell"] { --icon-url: url("/icons/bell.svg"); }
[data-icon="book-open"] { --icon-url: url("/icons/book-open.svg"); }
[data-icon="boxes"] { --icon-url: url("/icons/boxes.svg"); }
[data-icon="copy"] { --icon-url: url("/icons/copy.svg"); }
[data-icon="captions"] { --icon-url: url("/icons/captions.svg"); }
[data-icon="chevron-right"] { --icon-url: url("/icons/chevron-right.svg"); }
[data-icon="circle-help"] { --icon-url: url("/icons/circle-help.svg"); }
[data-icon="coins"] { --icon-url: url("/icons/coins.svg"); }
[data-icon="database"] { --icon-url: url("/icons/database.svg"); }
[data-icon="download"] { --icon-url: url("/icons/download.svg"); }
[data-icon="file-text"] { --icon-url: url("/icons/file-text.svg"); }
[data-icon="file-input"] { --icon-url: url("/icons/file-input.svg"); }
[data-icon="file-audio"] { --icon-url: url("/icons/file-audio.svg"); }
[data-icon="file-pen-line"] { --icon-url: url("/icons/file-pen-line.svg"); }
[data-icon="file-plus"] { --icon-url: url("/icons/file-plus.svg"); }
[data-icon="file-video"] { --icon-url: url("/icons/file-video.svg"); }
[data-icon="film"] { --icon-url: url("/icons/film.svg"); }
[data-icon="folder"] { --icon-url: url("/icons/folder.svg"); }
[data-icon="globe"] { --icon-url: url("/icons/globe.svg"); }
[data-icon="headphones"] { --icon-url: url("/icons/headphones.svg"); }
[data-icon="home"] { --icon-url: url("/icons/home.svg"); }
[data-icon="image"] { --icon-url: url("/icons/image.svg"); }
[data-icon="layers"] { --icon-url: url("/icons/layers.svg"); }
[data-icon="layout-dashboard"] { --icon-url: url("/icons/layout-dashboard.svg"); }
[data-icon="list"] { --icon-url: url("/icons/list.svg"); }
[data-icon="list-todo"] { --icon-url: url("/icons/list-todo.svg"); }
[data-icon="mic"] { --icon-url: url("/icons/mic.svg"); }
[data-icon="monitor-down"] { --icon-url: url("/icons/monitor-down.svg"); }
[data-icon="pause"] { --icon-url: url("/icons/pause.svg"); }
[data-icon="pen-line"] { --icon-url: url("/icons/pen-line.svg"); }
[data-icon="play"] { --icon-url: url("/icons/play.svg"); }
[data-icon="power"] { --icon-url: url("/icons/power.svg"); }
[data-icon="receipt-text"] { --icon-url: url("/icons/receipt-text.svg"); }
[data-icon="redo"] { --icon-url: url("/icons/rotate-ccw.svg"); }
[data-icon="rotate-ccw"] { --icon-url: url("/icons/rotate-ccw.svg"); }
[data-icon="save"] { --icon-url: url("/icons/save.svg"); }
[data-icon="settings"] { --icon-url: url("/icons/settings.svg"); }
[data-icon="shield-check"] { --icon-url: url("/icons/shield-check.svg"); }
[data-icon="sparkles"] { --icon-url: url("/icons/sparkles.svg"); }
[data-icon="sliders-horizontal"] { --icon-url: url("/icons/sliders-horizontal.svg"); }
[data-icon="square-play"] { --icon-url: url("/icons/square-play.svg"); }
[data-icon="text-cursor-input"] { --icon-url: url("/icons/text-cursor-input.svg"); }
[data-icon="trash-2"] { --icon-url: url("/icons/trash-2.svg"); }
[data-icon="user"] { --icon-url: url("/icons/user.svg"); }
[data-icon="users"] { --icon-url: url("/icons/users.svg"); }
[data-icon="wand-sparkles"] { --icon-url: url("/icons/wand-sparkles.svg"); }
[data-icon="windows"] { --icon-url: url("/icons/windows.svg"); }

.nav-btn[data-icon] {
  gap: 12px;
}

.nav-btn[data-icon]::before,
.topbar-icon-btn[data-icon]::before,
.home-summary-strip article[data-icon]::before,
.action-icon[data-icon]::before,
.tool-card-icon[data-icon]::before,
.more-tools-row[data-icon]::before,
.tts-toolbar button[data-icon]::before,
.tts-actionbar button[data-icon]::before,
.tts-actionbar .action-link[data-icon]::before,
.quick-entry-grid [data-icon]::before,
.dashboard-card-head button[data-icon]::after,
.home-action-card button[data-icon="arrow-right"]::after {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

.nav-btn[data-icon]::before {
  width: 19px;
  height: 19px;
  color: #334155;
}

.nav-btn.active::before,
.nav-btn:hover::before,
.download-site-link::before {
  color: #1d4ed8;
}

.tts-toolbar button[data-icon],
.tts-actionbar button[data-icon],
.tts-actionbar .action-link[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.tts-toolbar button[data-icon] {
  flex-direction: column;
  min-width: 58px;
  color: #475569;
  text-align: center;
}

.tts-toolbar button[data-icon]:hover,
.tts-toolbar button[data-icon]:focus-visible {
  color: #1d4ed8;
}

.tts-toolbar button[data-icon]::before,
.tts-actionbar button[data-icon]::before,
.tts-actionbar .action-link[data-icon]::before {
  width: 16px;
  height: 16px;
  color: currentColor;
}

.tts-toolbar button[data-icon]::before {
  width: 18px;
  height: 18px;
}

.tts-toolbar .toolbar-primary[data-icon]::before {
  color: #1d4ed8;
}

.tts-actionbar .primary[data-icon]::before {
  color: #ffffff;
}

#redoTextBtn[data-icon="redo"]::before {
  transform: scaleX(-1);
}

.download-site-link {
  margin-top: auto;
  min-height: 48px;
  border-top: 1px solid #e5eaf3;
  border-radius: 0;
  background: #ffffff;
}

.download-site-link:hover {
  border-color: #dbeafe;
  border-radius: 8px;
}

.brand-home-link {
  border-radius: 12px;
  text-decoration: none;
}

.brand-home-link:focus-visible,
.download-site-link:focus-visible,
.quick-entry-grid [data-icon]:focus-visible {
  outline: 3px solid rgba(29, 78, 216, .22);
  outline-offset: 3px;
}

.desktop-topbar {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, .94);
  padding: 0 28px;
}

.desktop-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #0f172a;
  padding: 0;
  text-decoration: none;
}

.topbar-icon-btn:hover {
  background: #f2f6ff;
  color: #1d4ed8;
}

.topbar-icon-btn[data-icon]::before {
  width: 21px;
  height: 21px;
}

.user-chip {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #111827;
  padding: 0 8px;
  font-weight: 800;
}

.user-chip:hover {
  background: #f2f6ff;
}

.user-chip-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #1d4ed8;
  font-weight: 900;
}

.user-chip-chevron {
  color: #64748b;
}

.studio-home-view .dashboard-page {
  padding: 28px 32px 30px;
}

.studio-home-view .dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(620px, .95fr);
  gap: 28px;
  padding: 34px 32px;
}

.home-summary-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.home-summary-strip article {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 108px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .05);
}

.home-summary-strip article[data-icon]::before {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #1d4ed8;
}

.home-summary-strip article > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.home-summary-strip article a,
.home-summary-strip article button {
  justify-content: start;
  width: fit-content;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: #1d4ed8;
  padding: 0;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.home-summary-strip article a:hover,
.home-summary-strip article button:hover {
  background: transparent;
  color: #173cae;
}

.home-core-actions {
  align-items: stretch;
}

.simplified-core-actions .home-action-card {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 22px;
  align-content: center;
  min-height: 154px;
  padding: 26px 28px;
}

.simplified-core-actions .home-action-card > *:not(.action-icon) {
  grid-column: 2;
}

.action-icon {
  grid-row: 1 / span 3;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eef5ff;
}

.action-icon.teal {
  color: #0faaa6;
  background: #e8fbf8;
}

.action-icon.violet {
  color: #6d47f5;
  background: #f1edff;
}

.action-icon[data-icon]::before {
  width: 31px;
  height: 31px;
}

.home-action-card button[data-icon="arrow-right"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.home-action-card button[data-icon="arrow-right"]::after {
  width: 15px;
  height: 15px;
}

.more-tools-row[data-icon]::before {
  width: 22px;
  height: 22px;
  color: #1d4ed8;
}

.reference-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.home-tasks-card,
.quick-entry-card {
  border-radius: 8px;
}

.dashboard-card-head button[data-icon] {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dashboard-card-head button[data-icon]::after {
  width: 14px;
  height: 14px;
}

.quick-entry-card {
  padding: 20px 24px;
}

.quick-entry-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid #e5eaf3;
  padding-top: 14px;
}

.quick-entry-grid [data-icon] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 12px;
  align-items: center;
  min-height: 62px;
  border: 0;
  border-right: 1px solid #e5eaf3;
  border-radius: 0;
  background: transparent;
  color: #111827;
  padding: 0 18px;
  text-align: left;
  text-decoration: none;
}

.quick-entry-grid [data-icon]:last-child {
  border-right: 0;
}

.quick-entry-grid [data-icon]::before {
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  color: #344054;
}

.quick-entry-grid [data-icon]:hover {
  color: #1d4ed8;
  background: #f8fbff;
}

.quick-entry-grid [data-icon]:hover::before {
  color: #1d4ed8;
}

.quick-entry-grid strong {
  font-size: 14px;
}

.quick-entry-grid span {
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .studio-home-view .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .home-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-work-grid,
  .quick-entry-grid {
    grid-template-columns: 1fr;
  }

  .quick-entry-grid [data-icon] {
    border-right: 0;
    border-bottom: 1px solid #e5eaf3;
    padding: 12px 0;
  }

  .quick-entry-grid [data-icon]:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 768px) {
  .desktop-topbar {
    display: none;
  }

  .studio-home-view .dashboard-page {
    padding: 12px;
  }

  .studio-home-view .dashboard-hero,
  .home-summary-strip {
    grid-template-columns: 1fr;
  }

  .simplified-core-actions .home-action-card {
    grid-template-columns: 1fr;
  }

  .simplified-core-actions .home-action-card > *:not(.action-icon) {
    grid-column: auto;
  }

  .action-icon {
    grid-row: auto;
  }

  .account-product-grid {
    grid-template-columns: 1fr;
  }
}

/* 2026-06-12 personal center and works library refresh */
[data-icon="search"] { --icon-url: url("/icons/search.svg"); }

.works-page,
.account-page {
  display: grid;
  gap: 22px;
  padding: 34px 44px 38px;
}

.works-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #dfe7f5;
  padding-bottom: 26px;
}

.works-header h1 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: 0;
}

.works-header p {
  margin: 0;
  color: #738199;
  font-size: 15px;
  line-height: 1.7;
}

.works-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: #738199;
  font-size: 14px;
}

.works-summary strong {
  color: #1d4ed8;
}

.works-tabs {
  display: flex;
  align-items: center;
  gap: 34px;
  min-width: 0;
  overflow-x: auto;
  border-bottom: 1px solid #e2e8f0;
}

.works-tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  padding: 0;
  font-size: 15px;
  font-weight: 900;
}

.works-tabs button span {
  display: inline-flex;
  min-width: 24px;
  justify-content: center;
  border-radius: 999px;
  background: #eef4ff;
  color: #64748b;
  padding: 2px 7px;
  font-size: 12px;
}

.works-tabs button.active span {
  background: #dbeafe;
  color: #1d4ed8;
}

.works-tabs button:hover,
.works-tabs button.active {
  background: transparent;
  color: #1d4ed8;
}

.works-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: #1d4ed8;
}

.works-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(150px, 190px) minmax(150px, 190px) minmax(150px, 190px);
  align-items: center;
  gap: 16px;
}

.works-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid #dfe7f5;
  border-radius: 8px;
  background: #ffffff;
  padding: 0 14px;
}

.works-search span[data-icon]::before,
.works-view-toggle [data-icon]::before,
.account-menu-list [data-icon]::before,
.account-edit-btn[data-icon]::before,
.windows-mark[data-icon]::before,
.account-download-btn[data-icon]::before,
.work-action-icon[data-icon]::before,
.account-setting-icon[data-icon]::before,
.work-row-file[data-icon]::before,
.work-detail-placeholder [data-icon]::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

.works-search span[data-icon]::before {
  width: 18px;
  height: 18px;
  color: #64748b;
}

.works-search input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 0;
  outline: 0;
  color: #0f172a;
  font-size: 14px;
}

.works-toolbar select {
  min-height: 44px;
  border: 1px solid #dfe7f5;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
}

.works-view-toggle {
  justify-self: end;
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #dfe7f5;
  border-radius: 8px;
  background: #ffffff;
}

.works-view-toggle button {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  color: #64748b;
  padding: 0;
}

.works-view-toggle button.active,
.works-view-toggle button:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.works-view-toggle [data-icon]::before {
  width: 19px;
  height: 19px;
}

.works-manager-host {
  min-width: 0;
}

.works-manager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 22px;
  align-items: start;
}

.works-list-panel,
.work-detail-panel,
.account-settings-card {
  border: 1px solid #dfe7f5;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .06);
}

.works-list-panel {
  min-width: 0;
  overflow: hidden;
}

.works-bulkbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  border-bottom: 1px solid #eef2f7;
  padding: 0 18px;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}

.works-bulkbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.works-bulkbar input,
.work-row-check input {
  width: 18px;
  height: 18px;
  accent-color: #1d4ed8;
}

.works-bulkbar strong {
  color: #0f172a;
}

.works-bulkbar button {
  margin-left: auto;
  min-height: 34px;
}

button.danger,
.work-row-delete {
  border-color: #fecaca;
  background: #fff7f7;
  color: #dc2626;
}

button.danger:hover,
.work-row-delete:hover {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #b91c1c;
}

.works-table-head,
.works-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.55fr) 106px minmax(136px, .9fr) 128px 92px minmax(150px, .85fr);
  align-items: center;
  column-gap: 16px;
}

.works-table-head {
  min-width: 880px;
  border-bottom: 1px solid #eef2f7;
  padding: 14px 18px 14px 68px;
  color: #7b8798;
  font-size: 13px;
  font-weight: 900;
}

.works-table-body {
  min-width: 0;
}

.works-row {
  position: relative;
  min-width: 880px;
  border-bottom: 1px solid #eef2f7;
  padding: 14px 18px;
  color: #334155;
  cursor: pointer;
}

.works-row:last-child {
  border-bottom: 0;
}

.works-row:hover {
  background: #f8fbff;
}

.works-row.is-active,
.works-row.is-selected {
  background: #f7fbff;
  box-shadow: inset 0 0 0 2px rgba(29, 78, 216, .18);
}

.work-row-check {
  position: absolute;
  left: 18px;
  top: 50%;
  display: grid;
  transform: translateY(-50%);
}

.work-row-check span {
  display: none;
}

.work-row-info {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding-left: 50px;
}

.work-row-info strong {
  display: block;
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-row-info span:not(.work-row-thumb):not(.work-row-wave):not(.work-row-video-bg) {
  display: block;
  margin-top: 6px;
  color: #7b8798;
  font-size: 13px;
  font-weight: 800;
}

.work-row-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 64px;
  overflow: hidden;
  border: 1px solid #dfe7f5;
  border-radius: 8px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f8fffb 48%, #dff7ff 100%);
}

.work-row-thumb[data-kind="video"] {
  background:
    radial-gradient(circle at 76% 20%, rgba(255,255,255,.74) 0 11%, transparent 12%),
    linear-gradient(155deg, #dbeafe 0%, #eef7ff 42%, #93c5fd 43%, #1e3a8a 100%);
}

.work-row-thumb[data-kind="voice"] {
  background: linear-gradient(135deg, #f2f5ff 0%, #fbfaff 48%, #edfdf7 100%);
}

.work-row-wave {
  position: absolute;
  inset: 18px 0;
  background: repeating-linear-gradient(90deg, rgba(96, 165, 250, .62) 0 2px, transparent 2px 10px);
  mask-image: linear-gradient(0deg, transparent 0 10%, #000 45% 55%, transparent 90% 100%);
}

.work-row-video-bg {
  position: absolute;
  inset: 0;
}

.work-row-poster,
.work-detail-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-row-poster {
  z-index: 0;
}

.work-row-play {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, .52);
  color: #ffffff;
  padding: 0;
}

.work-row-play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid currentColor;
}

.work-row-play.is-playing::before {
  width: 12px;
  height: 14px;
  margin-left: 0;
  border: 0;
  background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65% 100%);
}

.work-row-file {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .82);
  color: #1d4ed8;
}

.work-row-file[data-icon]::before,
.work-detail-placeholder [data-icon]::before {
  width: 22px;
  height: 22px;
}

.work-kind-pill,
.work-status-pill {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  min-height: 26px;
  border-radius: 7px;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.work-kind-pill {
  background: #dbeafe;
  color: #1d4ed8;
}

.work-kind-pill[data-kind="audio"],
.work-kind-pill[data-kind="voice"] {
  background: #dcfce7;
  color: #16a34a;
}

.work-kind-pill[data-kind="video"] {
  background: #dbeafe;
  color: #2563eb;
}

.work-status-pill.success {
  background: #dcfce7;
  color: #16a34a;
}

.work-status-pill.running {
  background: #e0f2fe;
  color: #0369a1;
}

.work-status-pill.failed {
  background: #fee2e2;
  color: #dc2626;
}

.work-status-pill.draft {
  background: #ffedd5;
  color: #f97316;
}

.work-project,
.works-row time {
  overflow: hidden;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-row-actions,
.work-detail-panel footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.work-row-actions a,
.work-row-actions button,
.work-detail-panel footer a,
.work-detail-panel footer button {
  min-height: 32px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.work-row-actions .download,
.work-detail-panel footer .download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe7f5;
  background: #ffffff;
  color: #334155;
  padding: 0 12px;
}

.work-preview-slot {
  grid-column: 1 / -1;
  padding-left: 50px;
}

.work-detail-panel {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 18px;
  padding: 22px;
}

.work-detail-panel.empty {
  place-items: center;
  min-height: 360px;
  color: #64748b;
  text-align: center;
}

.work-detail-panel.empty strong {
  color: #0f172a;
  font-size: 18px;
}

.work-detail-panel header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 12px;
  align-items: start;
}

.work-detail-panel h2 {
  overflow: hidden;
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-detail-panel header span {
  color: #7b8798;
  font-size: 13px;
  font-weight: 800;
}

.work-detail-panel header button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border: 0;
  color: #64748b;
  padding: 0;
  font-size: 24px;
}

.work-detail-media {
  overflow: hidden;
  border: 1px solid #dfe7f5;
  border-radius: 10px;
  background: #f8fafc;
}

.work-detail-player {
  display: block;
  width: 100%;
}

video.work-detail-player {
  aspect-ratio: 16 / 9;
  background: #0f172a;
  object-fit: contain;
}

audio.work-detail-player {
  height: 44px;
}

.work-detail-audio {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 174px;
  padding: 0 18px 18px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f8fffb 52%, #dff7ff 100%);
}

.work-detail-preview-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 210px;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 20%, rgba(255, 255, 255, .74) 0 11%, transparent 12%),
    linear-gradient(155deg, #dbeafe 0%, #eef7ff 42%, #93c5fd 43%, #1e3a8a 100%);
}

.work-detail-preview-shell[data-kind="video"] {
  aspect-ratio: 16 / 9;
}

.work-detail-preview-shell[data-kind="audio"] {
  min-height: 174px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f8fffb 52%, #dff7ff 100%);
}

.work-detail-preview-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.work-detail-preview-shell .work-row-wave {
  inset: 50% 0 auto;
  height: 58px;
  transform: translateY(-50%);
}

.work-detail-play {
  position: relative;
  z-index: 2;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, .62);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .18);
  color: #ffffff;
  font-weight: 900;
  padding: 0 20px;
}

.work-detail-preview-shell .work-preview-slot {
  position: absolute;
  inset: 0;
  grid-column: auto;
  min-width: 0;
  padding: 0;
}

.work-detail-preview-shell .work-preview-media {
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.work-detail-preview-shell audio.work-preview-media {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  width: calc(100% - 36px);
  height: 44px;
  background: #ffffff;
}

.work-detail-preview-shell video.work-preview-media {
  object-fit: contain;
}

.work-detail-preview-shell.is-playing {
  background: #0f172a;
}

.work-detail-preview-shell[data-kind="audio"].is-playing {
  background: linear-gradient(135deg, #ecfdf5 0%, #f8fffb 52%, #dff7ff 100%);
}

.work-detail-preview-shell.is-playing .work-detail-preview-visual,
.work-detail-preview-shell.is-playing .work-detail-play {
  display: none;
}

.work-detail-placeholder {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 210px;
  color: #64748b;
}

.work-detail-placeholder [data-icon] {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #eff6ff;
  color: #1d4ed8;
}

.work-detail-tabs {
  display: flex;
  gap: 30px;
  border-bottom: 1px solid #e2e8f0;
}

.work-detail-tabs button {
  position: relative;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  padding: 0;
  font-weight: 900;
}

.work-detail-tabs button.active {
  color: #1d4ed8;
}

.work-detail-tabs button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: #1d4ed8;
}

.work-detail-list {
  display: grid;
  gap: 13px;
  margin: 0;
}

.work-detail-list div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.work-detail-list dt {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 900;
}

.work-detail-list dd {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin: 0;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.work-detail-list dd > span:not(.work-kind-pill):not(.work-status-pill) {
  border-radius: 7px;
  background: #f1f5f9;
  color: #475569;
  padding: 5px 9px;
}

.work-detail-list dd button {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
}

.works-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 22px;
}

.works-card-grid.is-list {
  grid-template-columns: 1fr;
}

.work-card {
  overflow: hidden;
  border: 1px solid #dfe7f5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .045);
}

.work-card:hover {
  border-color: rgba(29, 78, 216, .28);
  box-shadow: 0 18px 36px rgba(15, 23, 42, .08);
}

.work-thumb {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 172px;
  overflow: hidden;
  background: linear-gradient(135deg, #eaf4ff, #f7fbff);
}

.work-card[data-kind="video"] .work-thumb {
  background:
    radial-gradient(circle at 72% 24%, rgba(255,255,255,.72) 0 8%, transparent 9%),
    linear-gradient(155deg, #dbeafe 0%, #eef7ff 42%, #93c5fd 43%, #1e3a8a 100%);
}

.work-card[data-kind="audio"] .work-thumb {
  background: linear-gradient(135deg, #ecfdf5 0%, #f8fffb 52%, #dff7ff 100%);
}

.work-card[data-kind="voice"] .work-thumb {
  background: linear-gradient(135deg, #f2f5ff 0%, #fbfaff 48%, #edfdf7 100%);
}

.work-card[data-status="failed"] .work-thumb {
  background: linear-gradient(135deg, #fff1f2, #ffffff);
}

.work-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 6px;
  background: #1d4ed8;
  color: #ffffff;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 900;
}

.work-card[data-kind="audio"] .work-badge,
.work-card[data-kind="voice"] .work-badge {
  background: #16a34a;
}

.work-card[data-kind="video"] .work-badge {
  background: #2563eb;
}

.work-card[data-status="failed"] .work-badge {
  background: #ef4444;
}

.work-play {
  display: grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, .46);
  color: #ffffff;
  padding: 0;
}

.work-play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 15px solid currentColor;
}

.work-play:hover {
  background: rgba(29, 78, 216, .82);
  color: #ffffff;
}

.work-play.is-playing {
  background: rgba(29, 78, 216, .92);
}

.work-play.is-playing::before {
  width: 15px;
  height: 18px;
  margin-left: 0;
  border: 0;
  background:
    linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65% 100%);
}

.work-duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 6px;
  background: rgba(15, 23, 42, .62);
  color: #ffffff;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 900;
}

.work-waveform {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 52px;
  background:
    repeating-linear-gradient(90deg, rgba(96, 165, 250, .58) 0 2px, transparent 2px 12px);
  mask-image: linear-gradient(0deg, transparent 0 12%, #000 45% 55%, transparent 88% 100%);
  opacity: .9;
}

.work-file-mark {
  display: grid;
  place-items: center;
  width: 74px;
  height: 88px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: rgba(255, 255, 255, .76);
  color: #1d4ed8;
}

.work-file-mark[data-icon]::before {
  content: "";
  width: 36px;
  height: 36px;
  background: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

.work-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  padding: 14px 16px 16px;
}

.work-card h2 {
  overflow: hidden;
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-card time,
.work-card small {
  color: #738199;
  font-size: 13px;
}

.work-more {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  color: #64748b;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.work-actions-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.work-actions-row .download,
.work-actions-row button {
  min-height: 32px;
}

.work-preview-slot {
  grid-column: 1 / -1;
  min-width: 0;
}

.work-preview-media {
  display: none;
  width: 100%;
  max-height: 220px;
  margin-top: 8px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #0f172a;
}

.work-preview-media.active {
  display: block;
}

audio.work-preview-media {
  height: 42px;
  background: #f8fafc;
}

video.work-preview-media {
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.works-card-grid.is-list .work-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.works-card-grid.is-list .work-thumb {
  min-height: 142px;
}

.works-empty {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 260px;
  grid-column: 1 / -1;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #64748b;
  padding: 28px;
  text-align: center;
}

.works-empty strong {
  color: #0f172a;
  font-size: 18px;
}

.works-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #738199;
  font-size: 14px;
}

.works-pagination > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.works-pagination button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}

.works-pagination button.active {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
}

.works-pagination select {
  min-height: 36px;
  border: 1px solid #dfe7f5;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  padding: 0 12px;
  font-weight: 800;
}

.account-page {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
}

.account-profile-card,
.account-info-card {
  border: 1px solid #dfe7f5;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

.account-profile-card {
  display: grid;
  gap: 22px;
  padding: 28px;
}

.account-profile-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.account-avatar-lg {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 28%, #ffe6b0 0 17%, transparent 18%),
    linear-gradient(180deg, #ffcf6f 0 34%, #22b8d1 35% 100%);
  color: #0f172a;
  font-size: 24px;
  font-weight: 900;
}

.account-profile-head h1 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 19px;
  letter-spacing: 0;
}

.account-profile-head span {
  color: #7b8798;
  font-size: 14px;
}

.account-edit-btn {
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  border: 0;
  color: #475569;
  padding: 0;
}

.account-edit-btn[data-icon]::before {
  width: 18px;
  height: 18px;
}

.account-member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(135deg, #3976ff 0%, #8cb5ff 100%);
  color: #ffffff;
  padding: 22px 24px;
}

.account-member-card div {
  display: grid;
  gap: 8px;
}

.account-member-card strong {
  font-size: 18px;
}

.account-member-card span {
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  font-weight: 800;
}

.account-member-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .86);
  color: #1d4ed8;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.account-menu-list {
  display: grid;
}

.account-menu-list > *,
.account-download-btn {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  border: 0;
  border-bottom: 1px solid #e5eaf3;
  border-radius: 0;
  background: #ffffff;
  color: #334155;
  padding: 0;
  font-size: 15px;
  font-weight: 900;
  text-align: left;
  text-decoration: none;
}

.account-menu-list > *:last-child {
  border-bottom: 0;
}

.account-menu-list > *::after,
.account-download-btn::after {
  grid-column: 4;
  justify-self: end;
  content: "›";
  color: #94a3b8;
  font-size: 24px;
  font-weight: 500;
}

.account-menu-list > *:hover {
  background: #f8fbff;
  color: #1d4ed8;
}

.account-menu-list [data-icon]::before {
  width: 20px;
  height: 20px;
  color: #475569;
}

.account-menu-list strong {
  justify-self: end;
  color: #334155;
}

.account-side-panel {
  display: grid;
  gap: 18px;
}

.account-info-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.account-info-card > div {
  display: grid;
  gap: 7px;
  min-height: 86px;
  border-right: 1px solid #e5eaf3;
  border-bottom: 1px solid #e5eaf3;
  padding: 20px;
}

.account-info-card > div:nth-child(2n) {
  border-right: 0;
}

.account-info-card > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.account-info-card span {
  color: #7b8798;
  font-size: 13px;
  font-weight: 800;
}

.account-info-card strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-license-card {
  display: grid;
  grid-template-columns: 1fr;
  padding: 24px;
}

.account-license-card > div {
  border: 0;
  padding: 0;
}

.account-license-head {
  display: grid !important;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.windows-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1d4ed8;
}

.windows-mark[data-icon]::before {
  width: 34px;
  height: 34px;
}

.account-license-head h2 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 20px;
}

.account-license-head p {
  margin: 0;
  color: #7b8798;
  line-height: 1.6;
}

.account-license-row {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 42px !important;
  border-top: 1px solid #eef2f7 !important;
}

.account-license-row strong {
  font-size: 15px;
}

.account-download-btn {
  justify-content: center;
  grid-template-columns: 20px auto;
  min-height: 48px;
  border: 1px solid #dfe7f5;
  border-radius: 8px;
  margin-top: 4px;
  padding: 0 14px;
}

.account-download-btn::after {
  content: none;
}

.account-download-btn[data-icon]::before {
  width: 18px;
  height: 18px;
}

.account-settings-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.account-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #eef2f7;
  padding: 22px 28px;
}

.account-settings-head h2 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 20px;
}

.account-settings-head p {
  margin: 0;
  color: #7b8798;
  line-height: 1.6;
}

.account-setting-list {
  display: grid;
}

.account-setting-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  border-bottom: 1px solid #eef2f7;
  padding: 0 28px;
}

.account-setting-row:last-child {
  border-bottom: 0;
}

.account-setting-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
}

.account-setting-icon[data-icon]::before {
  width: 18px;
  height: 18px;
}

.account-setting-row:nth-child(3) .account-setting-icon {
  background: #dcfce7;
  color: #16a34a;
}

.account-setting-row:nth-child(4) .account-setting-icon {
  background: #ffedd5;
  color: #f97316;
}

.account-setting-row strong {
  display: block;
  margin-bottom: 5px;
  color: #0f172a;
  font-size: 15px;
}

.account-setting-row span {
  color: #7b8798;
  font-size: 14px;
  font-weight: 800;
}

.account-setting-panel {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
  gap: 12px;
  width: 100%;
  border-top: 1px solid #eef2f7;
  padding: 16px 0 18px;
}

.account-setting-panel[hidden] {
  display: none;
}

.account-setting-panel.compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.account-setting-panel p {
  margin: 0;
  color: #64748b;
  line-height: 1.65;
}

.account-setting-panel a {
  align-self: center;
  color: #1d4ed8;
  font-weight: 900;
  text-decoration: none;
}

.account-setting-panel label {
  display: grid;
  gap: 7px;
}

.account-setting-panel label span {
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}

.account-setting-panel input[type="email"],
.account-setting-panel input[type="text"],
.account-setting-panel input[type="password"] {
  min-height: 42px;
  border: 1px solid #dfe7f5;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  padding: 0 12px;
  outline: 0;
}

.account-setting-panel input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.account-setting-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.account-setting-actions button {
  min-height: 42px;
  white-space: nowrap;
}

.account-toggle-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 10px !important;
}

.account-toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: #1d4ed8;
}

@media (max-width: 1320px) {
  .works-manager {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 350px);
  }

  .works-toolbar {
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 1080px) {
  .works-page,
  .account-page {
    padding: 22px;
  }

  .works-header {
    align-items: start;
    flex-direction: column;
  }

  .works-summary {
    justify-content: flex-start;
  }

  .works-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .works-manager {
    grid-template-columns: 1fr;
  }

  .works-list-panel {
    overflow-x: auto;
  }

  .work-detail-panel {
    position: static;
  }

  .account-page {
    grid-template-columns: 1fr;
    max-width: 760px;
  }
}

@media (max-width: 768px) {
  .works-page,
  .account-page {
    gap: 16px;
    padding: 14px;
  }

  .works-header {
    padding-bottom: 18px;
  }

  .works-header h1 {
    font-size: 30px;
  }

  .works-tabs {
    gap: 24px;
  }

  .works-toolbar {
    grid-template-columns: 1fr;
  }

  .works-bulkbar,
  .account-settings-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .work-detail-panel {
    padding: 18px;
  }

  .account-setting-row {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 16px 18px;
  }

  .account-setting-row > button {
    grid-column: 2;
    justify-self: start;
  }

  .account-setting-panel,
  .account-setting-panel.compact {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .works-pagination {
    display: grid;
    justify-items: start;
  }

  .account-profile-card {
    padding: 20px;
  }

  .account-profile-head {
    grid-template-columns: 58px minmax(0, 1fr) auto;
  }

  .account-avatar-lg {
    width: 58px;
    height: 58px;
  }

  .account-member-card {
    display: grid;
  }

  .account-info-card {
    grid-template-columns: 1fr;
  }

  .account-info-card > div,
  .account-info-card > div:nth-child(2n),
  .account-info-card > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid #e5eaf3;
  }

  .account-info-card > div:last-child {
    border-bottom: 0;
  }
}

/* 2026-06-12 tools hub */
.tools-page {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.tools-hero,
.toolbox-filterbar,
.studio-tool-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.tools-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.tools-hero h1 {
  margin: 6px 0 8px;
  color: var(--text);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.15;
}

.tools-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.tools-hero-note {
  display: grid;
  gap: 6px;
  width: min(280px, 100%);
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
  padding: 16px;
}

.tools-hero-note strong {
  color: #0f172a;
  font-size: 18px;
}

.tools-hero-note span {
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.toolbox-filterbar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 14px;
}

.toolbox-filterbar button {
  flex: 0 0 auto;
  min-height: 34px;
  border-radius: 999px;
  background: var(--surface);
  color: #475569;
  white-space: nowrap;
}

.toolbox-filterbar button.active,
.toolbox-filterbar button:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.studio-tool-card {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 18px;
  min-height: 314px;
  padding: 20px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.studio-tool-card:hover {
  border-color: rgba(29, 78, 216, .24);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}

.tool-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.tool-card-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
}

.tool-card-icon.green {
  background: #ecfdf5;
  color: #059669;
}

.tool-card-icon.amber {
  background: #fff7ed;
  color: #d97706;
}

.tool-card-icon[data-icon]::before {
  width: 24px;
  height: 24px;
  background: currentColor;
}

.tool-status,
.tool-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.tool-status {
  min-height: 28px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  padding: 0 10px;
}

.tool-status.available {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.tool-status.coming {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.tool-card-copy {
  display: grid;
  gap: 10px;
}

.tool-card-copy h2 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  line-height: 1.25;
}

.tool-card-copy p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

.tool-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-tag {
  min-height: 26px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  padding: 0 9px;
}

.tool-tag.free {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.tool-tag.credits {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.tool-tag.chrome {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.tool-tag.local,
.tool-tag.text,
.tool-tag.audio,
.tool-tag.dubbing,
.tool-tag.ai {
  border-color: #dbeafe;
  background: #f8fbff;
  color: #334155;
}

.tool-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tool-card-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.tool-card-button:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.tool-card-button.primary {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
}

.tool-card-button.primary:hover {
  border-color: #1e40af;
  background: #1e40af;
  color: #ffffff;
}

button.tool-card-button:disabled {
  border-color: #e5e7eb;
  background: #f8fafc;
  color: #94a3b8;
  opacity: 1;
}

@media (max-width: 1120px) {
  .tools-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .tools-page {
    padding: 12px;
  }

  .tools-hero,
  .studio-tool-card {
    padding: 18px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }
}
