:root {
  color-scheme: dark;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #090b11;
  color: #e8f0fa;
  --bg: #090b11;
  --sidebar: #0e1118;
  --panel: #131621;
  --panel-2: #181c29;
  --input: #0e1118;
  --line: #2b3852;
  --text: #e8f0fa;
  --muted: #94a6c2;
  --blue: #3d8cff;
  --cyan: #1ad1e5;
  --green: #40db85;
  --violet: #8c61ff;
  --danger: #ff8c8c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 1px solid var(--blue);
  border-radius: 12px;
  background: var(--blue);
  color: var(--text);
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.06);
}

button:focus-visible {
  outline: 2px solid rgba(61, 140, 255, 0.55);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secondary {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--text);
}

.danger-text {
  color: #ff9aa2;
}

.small {
  padding: 7px 14px;
  font-size: 13px;
}

.wide {
  width: 100%;
}

input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--input);
  color: var(--text);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(61, 140, 255, 0.15);
}

select {
  appearance: none;
  max-width: 100%;
  min-width: 0;
  padding: 0 44px 0 18px;
  background-image: linear-gradient(45deg, transparent 50%, #94a6c2 50%),
    linear-gradient(135deg, #94a6c2 50%, transparent 50%);
  background-position: calc(100% - 22px) 21px, calc(100% - 16px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

textarea {
  width: 100%;
  height: 172px;
  resize: vertical;
  padding: 22px;
  line-height: 1.65;
}

.hidden {
  display: none !important;
}

.desktop-client-required {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 18% 12%, rgba(124, 92, 255, 0.2), transparent 28%),
    linear-gradient(135deg, #07111f 0%, #0a1221 54%, #101726 100%);
  color: #edf5ff;
}

.desktop-client-required-card {
  width: min(680px, 100%);
  padding: 34px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.desktop-client-required-kicker {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.14);
  color: #9cc9ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.desktop-client-required h1 {
  margin: 18px 0 12px;
  font-size: 30px;
  line-height: 1.2;
}

.desktop-client-required p {
  margin: 0 0 12px;
  color: #a8b8d8;
  line-height: 1.7;
}

.desktop-client-required-meta {
  color: #dbeafe !important;
}

.desktop-client-required-error {
  color: #fecaca !important;
}

.desktop-client-required-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.desktop-client-required-actions a,
.desktop-client-required-actions button {
  min-height: 42px;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

.desktop-client-required-actions .primary-action {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: #7c5cff;
  color: white;
  text-decoration: none;
}

.desktop-client-required-actions .secondary-action {
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: transparent;
  color: #dbeafe;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 30% 10%, rgba(61, 140, 255, 0.16), transparent 35%),
    radial-gradient(circle at 70% 90%, rgba(140, 97, 255, 0.14), transparent 38%),
    var(--bg);
}

.auth-card {
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(19, 22, 33, 0.92);
  padding: 32px;
}

.brand-mark,
.logo,
.avatar {
  background: var(--blue);
  box-shadow: 0 12px 34px rgba(61, 140, 255, 0.25);
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 900;
  margin-bottom: 20px;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.auth-card p {
  color: var(--muted);
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.auth-grid input {
  padding: 12px 14px;
}

.auth-code-row,
.legacy-login-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.legacy-login {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.legacy-login summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.legacy-login input {
  width: 100%;
  margin-top: 10px;
}

.legacy-login-actions {
  margin-top: 10px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 24px;
  border-radius: 0 28px 28px 0;
  background: var(--sidebar);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.logo,
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--violet);
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.brand span,
.workspace-card span,
.workspace-card small,
.hero-row p,
.panel p,
.script-meta,
.subtitle-current {
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 30px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 11px 16px;
}

.nav-item.active {
  background: #171c29;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  position: relative;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 8px;
  width: 3px;
  height: 24px;
  border-radius: 2px;
  background: var(--blue);
}

.muted-nav {
  cursor: default;
}

.workspace-card {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 40px;
  display: grid;
  gap: 6px;
  padding: 18px 20px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.workspace-card small {
  width: max-content;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
}

.main {
  min-width: 0;
  padding: 0 32px 56px;
}

.topbar {
  position: relative;
  height: 76px;
  display: block;
  width: calc(100% + 64px);
  margin: 0 -32px;
}

.topbar h1 {
  position: absolute;
  left: 32px;
  top: 26px;
  font-size: 22px;
  line-height: 27px;
  margin: 0;
}

.top-search {
  position: absolute;
  left: 360px;
  top: 18px;
  width: 420px;
  height: 42px;
  padding: 0 16px;
}

.top-actions {
  position: absolute;
  left: 894px;
  right: 12px;
  top: 18px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.top-utility-icons {
  position: absolute;
  left: 1000px;
  top: 18px;
  width: 156px;
  height: 28px;
  display: none;
  align-items: center;
  justify-content: space-between;
}

.top-utility-icons button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a6c2;
  font-size: 15px;
  font-weight: 800;
}

.app-shell[data-current-view="create"] .top-actions,
.app-shell[data-current-view="tasks"] .top-actions,
.app-shell[data-current-view="monitor"] .top-actions,
.app-shell[data-current-view="admin"] .top-actions,
.app-shell[data-current-view="materials"] .top-actions,
.app-shell[data-current-view="library"] .top-actions,
.app-shell[data-current-view="cover"] .top-actions,
.app-shell[data-current-view="settings"] .top-actions {
  display: none;
}

.app-shell[data-current-view="create"] .top-utility-icons,
.app-shell[data-current-view="tasks"] .top-utility-icons,
.app-shell[data-current-view="monitor"] .top-utility-icons,
.app-shell[data-current-view="admin"] .top-utility-icons,
.app-shell[data-current-view="materials"] .top-utility-icons,
.app-shell[data-current-view="library"] .top-utility-icons,
.app-shell[data-current-view="cover"] .top-utility-icons,
.app-shell[data-current-view="settings"] .top-utility-icons {
  display: flex;
}

.view {
  max-width: 1184px;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 24px 0 28px;
}

.hero-row h2 {
  margin: 0 0 4px;
  font-size: 32px;
  letter-spacing: 0;
}

.pill,
.pill-row span,
.badge,
.tag-row span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  white-space: nowrap;
}

.pill {
  padding: 5px 16px;
  font-size: 12px;
}

.create-grid {
  display: grid;
  grid-template-columns: 408px 680px;
  gap: 32px;
  max-width: 100%;
}

.left-column,
.right-column {
  min-width: 0;
  display: grid;
  gap: 24px;
  align-content: start;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  padding: 20px 21px;
}

.panel h3 {
  margin: 0;
  font-size: 20px;
}

.panel-title {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel-title > div {
  min-width: 0;
}

.panel-title p {
  margin: 6px 0 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.panel-title.compact {
  align-items: start;
  margin-bottom: 14px;
}

.badge {
  height: 24px;
  padding: 0 10px;
  font-size: 11px;
}

.badge.ok {
  background: var(--green);
  color: #03140a;
  border-color: var(--green);
}

.badge.recommend {
  background: var(--violet);
  border-color: var(--violet);
}

.selected-template-card {
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 16px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--input);
  overflow: hidden;
}

.template-thumb {
  position: relative;
  height: 92px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(61, 140, 255, 0.2), rgba(26, 209, 229, 0.05)),
    #0a1730;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: #bfe0ff;
  font-weight: 700;
}

.template-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(61, 140, 255, 0.25), transparent 30%),
    linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.08), transparent 45%);
}

.template-thumb.has-image::before {
  background: linear-gradient(180deg, transparent, rgba(5, 8, 16, 0.55));
}

.template-thumb.has-image {
  background-color: #07101f;
  background-size: contain;
}

.template-thumb span,
.template-thumb small {
  position: relative;
}

.template-thumb small {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.66);
}

.template-info {
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 6px;
  overflow: hidden;
}

.template-info strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.template-info p {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.template-info small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.tag-row {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 8px;
  overflow: hidden;
}

.tag-row span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 10px;
  font-size: 11px;
}

.hint-line {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 14px 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #141a29;
  color: var(--muted);
  font-size: 12px;
}

.hint-line i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.template-upload-status {
  display: block;
  margin: 10px 0 0;
}

.voice-panel {
  min-width: 0;
  min-height: 300px;
  height: auto;
}

.voice-panel.selection-flash {
  border-color: rgba(61, 140, 255, 0.72);
  box-shadow:
    0 0 0 2px rgba(61, 140, 255, 0.18),
    0 28px 70px rgba(61, 140, 255, 0.12);
}

.voice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px;
  gap: 12px;
  margin: 20px 0;
  max-width: 100%;
}

.voice-row select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.small-note {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  margin: 8px 0 12px;
  font-size: 12px;
  line-height: 1.5;
}

.range-label {
  min-width: 0;
  max-width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.range-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="range"] {
  padding: 0;
  height: 5px;
  border: 0;
  accent-color: var(--blue);
}

.note-panel {
  height: 128px;
}

.note-panel h3 {
  font-size: 18px;
}

.pill-row {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}

.pill-row span {
  padding: 5px 10px;
  font-size: 11px;
}

.note-panel p {
  margin: 0;
  font-size: 13px;
}

.script-panel {
  height: 418px;
}

.source-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--input);
  margin-bottom: 16px;
}

.source-actions button {
  height: 36px;
  padding: 0 16px;
}

.source-actions .secondary {
  width: 178px;
}

.script-meta {
  display: flex;
  justify-content: space-between;
  margin: 14px 0 12px;
  font-size: 13px;
}

.audio-preview {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #141a29;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
}

.audio-preview button {
  height: 26px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 14px;
}

.subtitle-panel {
  min-height: 292px;
  height: auto;
  padding-bottom: 16px;
}

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

.subtitle-card {
  min-width: 0;
  height: 104px;
  display: grid;
  grid-template-rows: 70px 18px;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
}

.subtitle-card.active {
  border-color: var(--blue);
  background: #141a29;
  color: var(--text);
}

.subtitle-preview {
  position: relative;
  height: 70px;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(61, 140, 255, 0.2), transparent 34%),
    linear-gradient(180deg, #182032 0%, #0b101b 60%, #070a10 100%);
}

.subtitle-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), transparent 38%, rgba(0, 0, 0, 0.58)),
    radial-gradient(circle at 50% 88%, rgba(0, 0, 0, 0.5), transparent 48%);
  pointer-events: none;
}

.subtitle-preview-thumb {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.03);
}

.subtitle-preview-fallback {
  position: absolute;
  left: 50%;
  bottom: 17px;
  z-index: 1;
  width: 32px;
  height: 40px;
  transform: translateX(-50%);
  border-radius: 18px 18px 9px 9px;
  background:
    radial-gradient(circle at 50% 25%, #e0b495 0 9px, transparent 10px),
    linear-gradient(180deg, transparent 0 18px, #263b61 19px);
}

.subtitle-card-caption {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.subtitle-sample {
  display: inline-flex;
  align-items: center;
  height: 12px;
  padding: 0 8px;
  border-radius: 999px;
  background: #000;
  font-size: 8px;
  color: #fff;
}

.subtitle-card .subtitle-card-caption .subtitle-sample {
  min-height: 18px;
  max-width: 164px;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
  white-space: nowrap;
}

.subtitle-card[data-style="yellow"] .subtitle-sample,
.material-subtitle-card[data-style="yellow"] .subtitle-sample,
.subtitle-template-preview[data-style="yellow"] .subtitle-sample {
  background: #ffc22e;
  color: #0d0a05;
  font-weight: 800;
}

.subtitle-card[data-style="outline"] .subtitle-sample,
.material-subtitle-card[data-style="outline"] .subtitle-sample,
.subtitle-template-preview[data-style="outline"] .subtitle-sample {
  color: #ffc22e;
  font-weight: 800;
  background: #050505;
  box-shadow: 0 0 0 1px #fff, 0 0 0 3px #050505;
}

.subtitle-card[data-style="blue"] .subtitle-sample,
.material-subtitle-card[data-style="blue"] .subtitle-sample,
.subtitle-template-preview[data-style="blue"] .subtitle-sample {
  background: #051729;
  border: 1px solid var(--cyan);
  color: var(--cyan);
}

.subtitle-card[data-style="minimal"] .subtitle-sample,
.material-subtitle-card[data-style="minimal"] .subtitle-sample,
.subtitle-template-preview[data-style="minimal"] .subtitle-sample {
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
}

.subtitle-card[data-style="bilingual"] .subtitle-sample,
.material-subtitle-card[data-style="bilingual"] .subtitle-sample,
.subtitle-template-preview[data-style="bilingual"] .subtitle-sample {
  height: 18px;
  border-radius: 6px;
  line-height: 1.1;
}

.subtitle-card[data-style="yellow"] .subtitle-card-caption .subtitle-sample {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: #ffc22e;
  color: #161006;
  text-shadow: none;
}

.subtitle-card[data-style="outline"] .subtitle-card-caption .subtitle-sample {
  background: transparent;
  color: #fff;
  font-size: 12px;
  text-shadow:
    0 2px 0 #000,
    2px 0 0 #000,
    -2px 0 0 #000,
    0 -2px 0 #000,
    2px 2px 0 #000,
    -2px 2px 0 #000;
  box-shadow: none;
}

.subtitle-card[data-style="blue"] .subtitle-card-caption .subtitle-sample {
  border: 1px solid rgba(26, 209, 229, 0.78);
  background: rgba(5, 23, 41, 0.86);
  color: #65ecff;
  text-shadow: 0 0 12px rgba(26, 209, 229, 0.58);
}

.subtitle-card[data-style="minimal"] .subtitle-card-caption .subtitle-sample {
  min-height: 17px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.62);
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  font-weight: 700;
  text-shadow: none;
}

.subtitle-card[data-style="bilingual"] .subtitle-card-caption .subtitle-sample {
  min-height: 28px;
  height: auto;
  flex-direction: column;
  gap: 1px;
  white-space: normal;
}

.subtitle-card .subtitle-card-caption .subtitle-sample small {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
}

.subtitle-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.subtitle-current {
  margin: 5px 0 0;
  font-size: 11px;
}

.output-panel {
  height: 96px;
}

.output-panel h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.spec-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

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

.bottom-bar {
  position: sticky;
  bottom: 12px;
  height: 56px;
  display: grid;
  grid-template-columns: 390px 1fr 110px 118px;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  padding: 9px 16px 9px 21px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(19, 22, 33, 0.96);
  backdrop-filter: blur(12px);
}

.bottom-bar strong {
  font-size: 14px;
}

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

.error {
  min-height: 20px;
  margin: 7px 0 0;
  color: var(--danger);
}

.task-center-view {
  position: relative;
  min-height: calc(100vh - 76px);
  padding-bottom: 76px;
}

.task-center-head {
  position: relative;
  height: 134px;
}

.task-center-head h2 {
  position: absolute;
  left: 0;
  top: 32px;
  margin: 0;
  font-size: 30px;
  line-height: 38px;
  letter-spacing: 0;
}

.task-center-head p {
  position: absolute;
  left: 0;
  top: 74px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}

.task-filter-tabs {
  position: absolute;
  right: 0;
  top: 40px;
  width: 408px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #11141f;
}

.task-filter-tabs button {
  height: 36px;
  min-width: 0;
  flex: 1;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.task-filter-tabs button.active {
  background: var(--violet);
  color: var(--text);
}

.tasks-panel {
  width: 1120px;
  height: 760px;
  min-height: 760px;
}

.task-table-panel {
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}

.task-table-head,
.job {
  display: grid;
  grid-template-columns: 232px 104px 132px 152px 200px 134px;
  column-gap: 24px;
  align-items: center;
  padding: 0 14px 0 23px;
}

.task-table-head {
  height: 63px;
  border-bottom: 1px solid rgba(43, 56, 82, 0.9);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.jobs {
  display: block;
  height: 640px;
  overflow: hidden;
}

.job {
  height: 64px;
  border-bottom: 1px solid rgba(43, 56, 82, 0.9);
  background: rgba(14, 17, 27, 0.28);
}

.jobs .job:nth-child(even) {
  background: rgba(18, 22, 33, 0.64);
}

.task-name-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.task-thumb {
  width: 54px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(61, 140, 255, 0.38), rgba(26, 209, 229, 0.08)),
    #0c1730;
  background-position: center;
  background-size: cover;
  color: #d7e8ff;
  font-size: 11px;
  font-weight: 900;
}

.task-thumb.has-image span {
  display: none;
}

.thumb-done {
  background:
    linear-gradient(135deg, rgba(38, 197, 160, 0.32), rgba(61, 140, 255, 0.12)),
    #0c1e20;
}

.thumb-failed {
  background:
    linear-gradient(135deg, rgba(242, 71, 82, 0.34), rgba(140, 97, 255, 0.08)),
    #241116;
}

.thumb-queued {
  background:
    linear-gradient(135deg, rgba(255, 194, 46, 0.26), rgba(61, 140, 255, 0.08)),
    #221b0d;
}

.thumb-paused {
  background:
    linear-gradient(135deg, rgba(144, 162, 190, 0.24), rgba(61, 140, 255, 0.08)),
    #171d26;
}

.task-name-copy,
.task-asset-cell,
.task-time-cell,
.task-progress-cell {
  min-width: 0;
}

.job-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  font-size: 14px;
}

.job-meta {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-detail-link {
  width: fit-content;
  height: 22px;
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.task-detail-link:hover {
  color: var(--text);
}

.status-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 74px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--violet);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.status-badge.done {
  background: #193f42;
  color: #8ff5ff;
}

.status-badge.queued {
  background: #2d2a18;
  color: #ffc94a;
}

.status-badge.failed {
  background: #3a151b;
  color: #ff8c8c;
}

.status-badge.paused {
  background: #202b39;
  color: #a8c7ff;
}

.status-badge.cancelled {
  background: var(--panel-2);
  color: var(--muted);
}

.task-asset-cell {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: 20px 18px;
  column-gap: 10px;
  align-items: center;
}

.task-asset-cell span {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(61, 140, 255, 0.18);
  color: #b9d8ff;
  font-size: 10px;
  font-weight: 900;
}

.task-asset-cell strong,
.task-asset-cell small,
.task-time-cell span,
.task-time-cell small,
.task-progress-cell small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-asset-cell strong {
  font-size: 13px;
}

.task-asset-cell small,
.task-time-cell small,
.task-progress-cell small {
  color: var(--muted);
  font-size: 11px;
}

.task-time-cell {
  display: grid;
  gap: 4px;
}

.task-time-cell span {
  font-size: 12px;
}

.progress {
  width: 104px;
  height: 6px;
  border-radius: 999px;
  background: #202a40;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--violet);
}

.job.done .progress > span {
  background: var(--cyan);
}

.job.failed .progress > span {
  background: #f24752;
}

.task-progress-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.task-progress-line strong {
  color: var(--muted);
  font-size: 12px;
}

.job-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.task-action {
  height: 32px;
  min-width: 56px;
  padding: 0 12px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.task-action.wide {
  min-width: 56px;
}

.job-actions.done-actions {
  gap: 6px;
}

.job-actions.done-actions .task-action {
  min-width: 40px;
  padding: 0 8px;
}

.task-action.danger {
  border-color: rgba(242, 71, 82, 0.35);
  color: var(--danger);
}

.task-action.danger:hover {
  background: rgba(242, 71, 82, 0.08);
}

.task-icon-action {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
}

.task-icon-action.danger:hover {
  color: var(--danger);
  background: rgba(242, 71, 82, 0.08);
}

.task-table-foot {
  height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  color: var(--muted);
  font-size: 12px;
}

.task-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-pagination button,
.task-pagination span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-pagination button.active {
  background: var(--violet);
  color: var(--text);
}

.task-create-fab {
  position: fixed;
  right: 36px;
  bottom: 52px;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--violet);
  box-shadow: 0 12px 28px rgba(140, 97, 255, 0.34);
  font-size: 30px;
  line-height: 1;
}

.task-status-bar {
  position: fixed;
  left: 256px;
  right: 0;
  bottom: 0;
  height: 28px;
  display: grid;
  grid-template-columns: 300px 180px 1fr auto;
  align-items: center;
  gap: 90px;
  padding: 0 32px;
  background: #06080e;
  color: var(--muted);
  font-size: 12px;
  z-index: 20;
}

.task-status-bar span:nth-child(3) {
  color: var(--cyan);
}

.task-status-bar strong {
  color: #73f3ff;
  font-size: 11px;
  letter-spacing: 0;
}

.task-empty {
  height: 640px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.empty-surface {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--input);
  color: var(--muted);
}

.monitor-page {
  padding-bottom: 44px;
}

.monitor-hero,
.monitor-panel-head,
.monitor-worker-main,
.monitor-worker-meta,
.monitor-active-progress,
.monitor-event {
  display: flex;
  align-items: center;
}

.monitor-hero {
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 18px;
}

.monitor-hero h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.monitor-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.monitor-live-pill {
  min-width: 152px;
  height: 42px;
  display: grid;
  grid-template-columns: 10px auto;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  column-gap: 9px;
  padding: 7px 12px;
  border: 1px solid rgba(78, 224, 255, 0.32);
  border-radius: 8px;
  background: rgba(78, 224, 255, 0.08);
}

.monitor-live-pill span {
  grid-row: 1 / 3;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(78, 224, 255, 0.7);
}

.monitor-live-pill strong {
  font-size: 12px;
  line-height: 1;
}

.monitor-live-pill em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
}

.monitor-summary,
.monitor-stage-grid {
  display: grid;
  gap: 12px;
}

.monitor-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.monitor-summary-card,
.monitor-stage,
.monitor-worker,
.monitor-active-job,
.monitor-event {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.monitor-summary-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 14px;
}

.monitor-summary-card span,
.monitor-summary-card small,
.monitor-worker small,
.monitor-worker-job,
.monitor-active-job span,
.monitor-event time,
.monitor-event p,
.monitor-panel-head span {
  color: var(--muted);
}

.monitor-summary-card strong {
  font-size: 28px;
}

.monitor-stage-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.monitor-stage {
  position: relative;
  min-height: 112px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 24px;
  gap: 10px;
  padding: 14px;
  overflow: hidden;
}

.monitor-stage::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #3b4558;
}

.monitor-stage.active::before {
  background: var(--cyan);
}

.monitor-stage.ok::before {
  background: #35d08f;
}

.monitor-stage.error::before {
  background: var(--danger);
}

.monitor-stage-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--input);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.monitor-stage strong,
.monitor-stage p {
  min-width: 0;
  margin: 0;
}

.monitor-stage p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.monitor-stage > span {
  grid-column: 2;
  width: max-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--input);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.monitor-stage.active > span {
  color: var(--cyan);
}

.monitor-stage.ok > span {
  color: #8af3bd;
}

.monitor-stage.error > span {
  color: #ff9aa2;
}

.monitor-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.monitor-panel {
  min-width: 0;
  padding: 16px;
  border-radius: 8px;
}

.monitor-panel-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.monitor-panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.monitor-worker-grid,
.monitor-active-jobs,
.monitor-event-list {
  display: grid;
  gap: 10px;
}

.monitor-worker,
.monitor-active-job {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--input);
}

.monitor-worker-main {
  min-width: 0;
  gap: 10px;
}

.monitor-worker-main > span {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--danger);
}

.monitor-worker.online .monitor-worker-main > span {
  background: #35d08f;
}

.monitor-worker-main div,
.monitor-active-job div,
.monitor-event div {
  min-width: 0;
}

.monitor-worker-main strong,
.monitor-worker-main small,
.monitor-active-job strong,
.monitor-active-job span,
.monitor-event strong,
.monitor-event p {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-worker-meta {
  justify-content: space-between;
  font-size: 12px;
}

.monitor-worker-job {
  padding: 8px 10px;
  border-radius: 8px;
  background: #0c111b;
  font-size: 12px;
}

.monitor-active-job {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.monitor-active-progress {
  gap: 8px;
}

.monitor-active-progress em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.monitor-events-panel {
  margin-bottom: 24px;
}

.monitor-event {
  min-width: 0;
  grid-template-columns: 86px minmax(0, 1fr) 96px;
  gap: 12px;
  padding: 10px 12px;
  background: var(--input);
}

.monitor-event span {
  color: var(--cyan);
  font-size: 12px;
  text-align: right;
}

.monitor-event p {
  margin: 4px 0 0;
  font-size: 12px;
}

.monitor-empty,
.monitor-empty-line {
  min-height: 108px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.admin-page {
  padding-bottom: 44px;
}

.admin-hero,
.admin-panel-head,
.admin-user-row,
.admin-worker-row,
.admin-job-row,
.admin-job-progress {
  display: flex;
  align-items: center;
}

.admin-hero {
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 18px;
}

.admin-hero h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.admin-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-summary-card,
.admin-user-row,
.admin-worker-row,
.admin-job-row,
.admin-activation-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
}

.admin-summary-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 14px;
}

.admin-summary-card span,
.admin-summary-card small,
.admin-user-row span,
.admin-user-row small,
.admin-worker-row span,
.admin-worker-row small,
.admin-job-main span,
.admin-job-stage small,
.admin-job-progress em,
.admin-panel-head span {
  color: var(--muted);
}

.admin-summary-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 24px;
}

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

.admin-panel {
  min-width: 0;
  padding: 16px;
  border-radius: 8px;
}

.admin-panel-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.admin-panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.admin-list,
.admin-job-list {
  display: grid;
  gap: 10px;
}

.admin-user-row,
.admin-worker-row {
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
}

.admin-user-row div,
.admin-worker-row div,
.admin-job-main,
.admin-job-stage {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-user-row strong,
.admin-user-row span,
.admin-worker-row strong,
.admin-worker-row span,
.admin-job-main strong,
.admin-job-main span,
.admin-job-stage strong,
.admin-job-stage small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-row em,
.admin-worker-row em {
  min-width: 58px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #202a40;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.admin-user-row em.admin-role,
.admin-worker-row.online em {
  background: rgba(78, 224, 255, 0.12);
  color: var(--cyan);
}

.admin-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.admin-user-state {
  min-width: 54px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.admin-user-state.enabled {
  background: rgba(77, 231, 168, 0.12);
  color: var(--green);
}

.admin-user-state.disabled {
  background: rgba(242, 71, 82, 0.1);
  color: #ff9aa2;
}

.admin-worker-row.offline em {
  background: rgba(242, 71, 82, 0.1);
  color: #ff9aa2;
}

.admin-job-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) 96px minmax(110px, 0.8fr) 150px minmax(190px, 0.9fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
}

.admin-job-progress {
  min-width: 0;
  gap: 8px;
}

.admin-job-progress em {
  min-width: 34px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.admin-empty,
.admin-empty-line {
  min-height: 108px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.admin-audit-list {
  max-height: 360px;
  overflow: auto;
}

.admin-audit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
}

.admin-audit-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-audit-row strong,
.admin-audit-row span,
.admin-audit-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-audit-row span,
.admin-audit-row small {
  color: var(--muted);
}

.admin-ops-panel {
  margin-bottom: 16px;
}

.admin-ops-list {
  gap: 8px;
}

.admin-ops-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.admin-ops-summary span,
.admin-ops-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 14, 24, 0.72);
}

.admin-ops-summary span {
  padding: 10px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-ops-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 84px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.admin-ops-row strong,
.admin-ops-row span,
.admin-ops-row em {
  min-width: 0;
}

.admin-ops-row span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-ops-row em {
  justify-self: end;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(53, 208, 143, 0.12);
  color: #35d08f;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.admin-ops-row.warning em {
  background: rgba(245, 158, 11, 0.14);
  color: #f5b14b;
}

.admin-ops-row.error em {
  background: rgba(255, 93, 124, 0.14);
  color: var(--danger);
}

.admin-activation-panel {
  margin-bottom: 16px;
}

.admin-activation-result {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(77, 231, 168, 0.35);
  border-radius: 8px;
  background: rgba(77, 231, 168, 0.08);
}

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

.admin-activation-result strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--green);
  font-size: 16px;
  letter-spacing: 0;
}

.admin-activation-list {
  gap: 8px;
}

.admin-activation-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 76px minmax(130px, 0.8fr) minmax(160px, 1fr) minmax(90px, 0.45fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
}

.admin-activation-row.disabled {
  opacity: 0.7;
}

.admin-activation-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-activation-main strong,
.admin-activation-main span,
.admin-activation-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-activation-main span,
.admin-activation-row small,
.admin-static-note {
  color: var(--muted);
}

.admin-activation-row em {
  justify-self: start;
  min-width: 58px;
  padding: 4px 8px;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.admin-activation-row em.enabled {
  background: rgba(77, 231, 168, 0.12);
  color: var(--green);
}

.admin-activation-row em.exhausted {
  background: rgba(245, 158, 11, 0.14);
  color: #f5b14b;
}

.admin-activation-row em.disabled {
  background: rgba(242, 71, 82, 0.1);
  color: #ff9aa2;
}

.admin-activation-claims {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.admin-activation-claims span {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 11px;
}

.admin-static-note {
  font-size: 12px;
  font-weight: 700;
}

.task-detail-modal {
  display: grid;
  gap: 20px;
}

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

.task-detail-grid div {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
}

.task-detail-grid span {
  color: var(--muted);
  font-size: 12px;
}

.task-detail-grid strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.task-detail-error {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(242, 71, 82, 0.35);
  border-radius: 12px;
  background: rgba(242, 71, 82, 0.08);
  color: var(--danger);
}

.task-diagnostics {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(11, 16, 26, 0.72);
}

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

.task-diagnostics-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-diagnostics-head strong {
  color: #ffd0d0;
  font-size: 13px;
}

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

.task-diagnostics-grid div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.task-diagnostics-grid span {
  color: var(--muted);
  font-size: 11px;
}

.task-diagnostics-grid strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-diagnostics-suggestions {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #ffd6a3;
  font-size: 12px;
  line-height: 1.45;
}

.task-detail-modal h4 {
  margin: 0;
}

.task-detail-events {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-detail-events li {
  display: grid;
  grid-template-columns: 150px 96px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
}

.task-detail-events span,
.task-detail-events p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.video-preview-card {
  width: min(960px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 48px));
}

.task-video-preview {
  display: grid;
  gap: 16px;
}

.task-video-preview video {
  width: 100%;
  max-height: 560px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #000;
}

.task-video-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.task-video-preview-meta strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-publish-modal {
  display: grid;
  gap: 18px;
  color: var(--text);
}

.task-publish-modal div {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}

.task-publish-modal span,
.task-publish-modal p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.task-publish-modal strong {
  font-size: 18px;
}

.task-publish-modal .task-action {
  justify-self: start;
}

.library-toolbar {
  display: grid;
  gap: 22px;
  margin: 0 0 26px;
}

.filter-tabs,
.filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-tabs button,
.filter-chip {
  height: 28px;
  min-width: 100px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.filter-tabs button.active {
  background: var(--blue);
  border-color: var(--blue);
}

.filter-row input,
.library-search {
  height: 42px;
  padding: 0 16px;
}

.filter-row input {
  width: 360px;
}

.library-search {
  width: 400px;
}

.script-tabs {
  margin-top: -2px;
}

.library-page {
  padding-bottom: 42px;
}

.library-hero {
  min-height: 92px;
  margin: 24px 0 0;
  align-items: flex-start;
}

.library-hero h2 {
  margin-bottom: 6px;
  line-height: 39px;
}

.library-hero p {
  font-size: 15px;
}

.library-hero button {
  width: 132px;
  height: 42px;
  margin-top: 4px;
  padding: 0 15px;
}

.library-controls {
  gap: 22px;
  margin: 0 0 28px;
}

.library-controls .filter-tabs button {
  width: 120px;
  min-width: 120px;
  justify-content: flex-start;
  padding-left: 14px;
  text-align: left;
}

.cover-page {
  max-width: 1240px;
  padding-bottom: 48px;
}

.cover-hero {
  min-height: 104px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 22px 0 18px;
}

.cover-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  border: 1px solid rgba(64, 219, 133, 0.34);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(64, 219, 133, 0.08);
  color: #8af0b5;
  font-size: 12px;
  font-weight: 800;
}

.cover-hero h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0;
}

.cover-hero p,
.cover-section-head p,
.cover-current-desc,
.cover-preview-foot span,
.cover-tip span {
  color: var(--muted);
}

.cover-hero p {
  margin: 8px 0 0;
}

.cover-hero-meta {
  display: grid;
  gap: 8px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--panel);
  text-align: right;
}

.cover-hero-meta span {
  color: var(--muted);
  font-size: 13px;
}

.cover-workbench {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 302px;
  gap: 18px;
  align-items: stretch;
}

.cover-template-panel,
.cover-preview-panel,
.cover-control-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(24, 28, 41, 0.98), rgba(15, 18, 27, 0.98));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.cover-template-panel,
.cover-control-panel {
  padding: 18px;
}

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

.cover-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.cover-section-head p {
  margin: 4px 0 0;
  font-size: 12px;
}

.cover-template-list {
  display: grid;
  gap: 10px;
  max-height: 680px;
  padding-right: 4px;
  overflow: auto;
}

.cover-template-item {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 10px;
  border: 1px solid rgba(43, 56, 82, 0.82);
  border-radius: 14px;
  padding: 12px;
  background: rgba(14, 17, 24, 0.74);
  color: var(--text);
  text-align: left;
}

.cover-template-item.active {
  border-color: rgba(61, 140, 255, 0.72);
  background: rgba(61, 140, 255, 0.12);
}

.cover-template-item span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(61, 140, 255, 0.14);
  color: #9ec7ff;
  font-size: 12px;
  font-weight: 900;
}

.cover-template-item strong,
.cover-template-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cover-template-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.cover-preview-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  padding: 18px;
}

.cover-preview-stage {
  min-height: 680px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(43, 56, 82, 0.7);
  border-radius: 18px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    #0a0d14;
  background-size: 22px 22px;
  overflow: hidden;
}

#cover-canvas {
  width: min(100%, 382px);
  max-height: 660px;
  display: block;
  border-radius: 16px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  background: #111;
}

.cover-preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.cover-preview-foot div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.cover-preview-foot strong,
.cover-preview-foot span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cover-render-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: #9ec7ff;
  font-size: 13px;
}

.cover-render-status.error {
  color: var(--danger);
}

.cover-control-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

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

.cover-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.cover-field input,
.cover-field textarea {
  width: 100%;
  min-width: 0;
  border-radius: 14px;
  padding: 12px 13px;
  line-height: 1.45;
}

.cover-field textarea {
  height: 98px;
  min-height: 98px;
  resize: vertical;
}

.cover-tip {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(64, 219, 133, 0.22);
  border-radius: 16px;
  padding: 14px;
  background: rgba(64, 219, 133, 0.07);
  line-height: 1.55;
}

.cover-tip strong {
  color: #8af0b5;
}

.settings-page {
  padding-bottom: 44px;
}

.settings-hero {
  min-height: 92px;
  margin: 24px 0 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 22px;
}

.settings-card {
  min-height: 236px;
}

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

.settings-card-head p {
  max-width: 560px;
  margin: 8px 0 0;
  line-height: 1.55;
}

.settings-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--input);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-badge[data-state="client"] {
  border-color: rgba(64, 219, 133, 0.4);
  background: rgba(64, 219, 133, 0.1);
  color: #8af0b5;
}

.settings-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--input);
}

.settings-version-row span,
.settings-info-list span {
  color: var(--muted);
}

.settings-version-row strong {
  font-size: 18px;
}

.settings-status {
  min-height: 46px;
  margin-top: 16px;
  border: 1px solid rgba(61, 140, 255, 0.24);
  border-radius: 14px;
  padding: 13px 15px;
  background: rgba(61, 140, 255, 0.08);
  color: #cfe3ff;
  line-height: 1.55;
}

.settings-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.settings-info-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.settings-info-list span {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  background: var(--input);
  line-height: 1.45;
}

.account-info-list strong {
  color: var(--text);
}

.profile-bind-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 18px;
}

.profile-bind-grid input {
  min-width: 0;
}

.muted-settings-card {
  background: linear-gradient(180deg, rgba(24, 28, 41, 0.94), rgba(19, 22, 33, 0.94));
}

.materials-page {
  padding-bottom: 44px;
}

.materials-hero {
  min-height: 98px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 28px;
}

.materials-hero h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 34px;
  line-height: 41px;
  letter-spacing: 0;
}

.materials-hero p {
  width: min(680px, 100%);
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.25;
}

.materials-upload {
  width: 120px;
  height: 42px;
  margin-top: 8px;
  border-radius: 9px;
  padding: 0;
  font-size: 13px;
}

.materials-tabs {
  height: 50px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-top: 20px;
}

.materials-tabs button {
  position: relative;
  height: 42px;
  min-width: 92px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 18px;
  font-size: 14px;
  font-weight: 500;
}

.materials-tabs button.active {
  color: var(--text);
}

.materials-tabs button.active::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: 0;
  width: 64px;
  height: 2px;
  border-radius: 1px;
  background: var(--text);
}

.materials-filter-bar {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 20px;
  border-radius: 12px;
  background: var(--panel);
  padding: 0 14px 0 24px;
}

.materials-filter-group,
.materials-sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.materials-filter-group strong,
.materials-sort-group strong {
  color: var(--text);
  font-size: 13px;
}

.materials-filter-group em {
  margin-left: 46px;
  color: var(--muted);
  font-style: normal;
}

.materials-filter-divider {
  width: 1px;
  height: 30px;
  background: var(--line);
}

.materials-sort-group {
  margin-left: auto;
}

.materials-view-toggle {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-color: var(--line);
  border-radius: 6px;
  background: var(--input);
  color: var(--muted);
  padding: 0;
  font-size: 16px;
}

.materials-view-toggle.active {
  background: var(--panel-2);
  color: var(--text);
}

.asset-grid.materials-grid {
  display: grid;
  grid-template-columns: repeat(4, 184px);
  gap: 28px;
  align-items: start;
  margin-top: 32px;
}

.asset-grid.materials-grid-video-template {
  grid-template-columns: repeat(4, 256px);
  gap: 36px 24px;
  margin-top: 40px;
}

.asset-grid.materials-grid-voice {
  grid-template-columns: repeat(4, 256px);
  gap: 36px 24px;
  margin-top: 40px;
}

.asset-grid.materials-grid-subtitle {
  grid-template-columns: repeat(4, 256px);
  gap: 36px 24px;
  margin-top: 40px;
}

.asset-card.material-card {
  position: relative;
  width: 184px;
  height: 238px;
  min-height: 0;
  border: 1px solid rgba(43, 56, 82, 0.42);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(19, 22, 33, 0.58), rgba(9, 11, 17, 0.14) 58%, rgba(9, 11, 17, 0.02)),
    rgba(9, 11, 17, 0.38);
  padding: 0;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.24),
    0 1px 0 rgba(232, 240, 250, 0.05) inset;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.asset-card.material-video-template {
  width: 256px;
  height: 304px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.24),
    0 1px 0 rgba(232, 240, 250, 0.05) inset;
}

.asset-card.material-video-template:hover,
.asset-card.material-video-template:focus-within {
  transform: translateY(-2px);
  border-color: rgba(61, 140, 255, 0.42);
  background: #151927;
  box-shadow:
    0 30px 58px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(61, 140, 255, 0.08) inset,
    0 1px 0 rgba(232, 240, 250, 0.08) inset;
}

.asset-card.material-subtitle-card {
  width: 256px;
  height: 304px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.24),
    0 1px 0 rgba(232, 240, 250, 0.05) inset;
}

.asset-card.material-subtitle-card:hover,
.asset-card.material-subtitle-card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(61, 140, 255, 0.42);
  background: #151927;
  box-shadow:
    0 30px 58px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(61, 140, 255, 0.08) inset,
    0 1px 0 rgba(232, 240, 250, 0.08) inset;
}

.asset-card.material-card:hover,
.asset-card.material-card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(61, 140, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(24, 28, 41, 0.72), rgba(9, 11, 17, 0.2) 62%, rgba(9, 11, 17, 0.04)),
    rgba(9, 11, 17, 0.52);
  box-shadow:
    0 28px 56px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(61, 140, 255, 0.08) inset,
    0 1px 0 rgba(232, 240, 250, 0.08) inset;
}

.material-thumb {
  position: relative;
  width: 184px;
  height: 100px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0a0f1a;
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(232, 240, 250, 0.07);
  box-shadow:
    0 16px 28px rgba(0, 0, 0, 0.32),
    0 1px 0 rgba(232, 240, 250, 0.08) inset,
    0 -22px 42px rgba(0, 0, 0, 0.2) inset;
  overflow: hidden;
}

.material-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(232, 240, 250, 0.08), transparent 34%, rgba(0, 0, 0, 0.2)),
    radial-gradient(circle at 50% 0, rgba(61, 140, 255, 0.15), transparent 58%);
  pointer-events: none;
}

.material-card:hover .material-thumb,
.material-card:focus-within .material-thumb {
  box-shadow:
    0 22px 34px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(61, 140, 255, 0.1) inset,
    0 1px 0 rgba(232, 240, 250, 0.11) inset,
    0 -22px 42px rgba(0, 0, 0, 0.24) inset;
}

.material-thumb-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.03);
}

.material-thumb.has-image {
  background: #0a0f1a;
}

.material-thumb.video-template {
  background:
    radial-gradient(circle at 48% 40%, rgba(26, 209, 229, 0.12), transparent 36%),
    linear-gradient(135deg, rgba(61, 140, 255, 0.12), rgba(26, 209, 229, 0.08)),
    #052129;
}

.material-video-template .material-thumb {
  width: 224px;
  height: 126px;
  margin: 15px auto 0;
  border-color: var(--line);
  border-radius: 14px;
  box-shadow:
    0 18px 30px rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(232, 240, 250, 0.08) inset,
    0 -28px 42px rgba(0, 0, 0, 0.22) inset;
}

.material-video-template .material-thumb::after {
  background:
    linear-gradient(180deg, rgba(232, 240, 250, 0.06), transparent 34%, rgba(0, 0, 0, 0.22)),
    radial-gradient(circle at 52% 0, rgba(26, 209, 229, 0.16), transparent 60%);
}

.material-video-template.is-processing .material-thumb {
  background:
    radial-gradient(circle at 62% 55%, rgba(140, 97, 255, 0.2), transparent 40%),
    #1a1430;
}

.material-thumb.voice {
  background:
    linear-gradient(135deg, rgba(140, 97, 255, 0.2), rgba(61, 140, 255, 0.08)),
    #161025;
}

.material-thumb.subtitle {
  background:
    linear-gradient(135deg, rgba(232, 240, 250, 0.12), rgba(61, 140, 255, 0.06)),
    #111722;
}

.material-subtitle-card .material-thumb.subtitle {
  width: 224px;
  height: 126px;
  margin: 15px auto 0;
  display: block;
  padding: 0;
  border-radius: 14px;
  border-color: var(--line);
  box-shadow:
    0 18px 30px rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(232, 240, 250, 0.08) inset,
    0 -28px 42px rgba(0, 0, 0, 0.22) inset;
}

.material-subtitle-scene {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 20%, rgba(61, 140, 255, 0.2), transparent 34%),
    linear-gradient(180deg, #182032 0%, #0b101b 60%, #070a10 100%);
}

.material-subtitle-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(232, 240, 250, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(232, 240, 250, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.42;
}

.material-subtitle-scene.has-video-thumb {
  background: #070a10;
}

.material-subtitle-scene.has-video-thumb::before {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), transparent 38%, rgba(0, 0, 0, 0.56)),
    radial-gradient(circle at 50% 86%, rgba(0, 0, 0, 0.58), transparent 48%);
  background-size: auto;
  opacity: 1;
}

.material-subtitle-video-thumb {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.03);
}

.material-subtitle-person {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 2;
  width: 50px;
  height: 62px;
  transform: translateX(-50%);
  border-radius: 26px 26px 14px 14px;
  background:
    radial-gradient(circle at 50% 25%, #e0b495 0 13px, transparent 14px),
    linear-gradient(180deg, transparent 0 27px, #263b61 28px);
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.35));
}

.material-subtitle-caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.material-subtitle-caption .subtitle-sample {
  min-height: 24px;
  max-width: 192px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 11px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
  white-space: nowrap;
}

.material-subtitle-card[data-style="yellow"] .material-subtitle-caption .subtitle-sample {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: #ffc22e;
  color: #161006;
  text-shadow: none;
}

.material-subtitle-card[data-style="outline"] .material-subtitle-caption .subtitle-sample {
  background: transparent;
  color: #fff;
  font-size: 15px;
  letter-spacing: 0;
  text-shadow:
    0 2px 0 #000,
    2px 0 0 #000,
    -2px 0 0 #000,
    0 -2px 0 #000,
    2px 2px 0 #000,
    -2px 2px 0 #000;
  box-shadow: none;
}

.material-subtitle-card[data-style="blue"] .material-subtitle-caption .subtitle-sample {
  border: 1px solid rgba(26, 209, 229, 0.78);
  background: rgba(5, 23, 41, 0.86);
  color: #65ecff;
  text-shadow: 0 0 12px rgba(26, 209, 229, 0.58);
}

.material-subtitle-card[data-style="minimal"] .material-subtitle-caption .subtitle-sample {
  min-height: 22px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.62);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 700;
  text-shadow: none;
}

.material-subtitle-card[data-style="bilingual"] .material-subtitle-caption .subtitle-sample {
  min-height: 36px;
  flex-direction: column;
  gap: 2px;
  border-radius: 8px;
  white-space: normal;
}

.material-subtitle-caption .subtitle-sample small {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.subtitle-template-preview {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 260px;
  gap: 18px;
}

.subtitle-preview-frame {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 22%, rgba(72, 129, 255, 0.22), transparent 34%),
    linear-gradient(180deg, #101827, #080b10);
}

.subtitle-preview-person {
  position: absolute;
  left: 50%;
  bottom: 56px;
  width: 118px;
  height: 158px;
  transform: translateX(-50%);
  border-radius: 58px 58px 26px 26px;
  background:
    radial-gradient(circle at 50% 28%, #e8c1a6 0 30px, transparent 31px),
    linear-gradient(180deg, transparent 0 58px, #223454 59px);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.32);
}

.subtitle-preview-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  display: grid;
  place-items: center;
}

.subtitle-preview-caption .subtitle-sample {
  height: auto;
  min-height: 28px;
  padding: 4px 16px;
  font-size: 15px;
}

.material-thumb.video {
  background:
    linear-gradient(135deg, rgba(64, 219, 133, 0.15), rgba(61, 140, 255, 0.08)),
    #10231a;
}

.material-state {
  position: absolute;
  z-index: 3;
  left: 8px;
  top: 8px;
  height: 24px;
  min-width: 50px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #144d52;
  color: var(--text);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
}

.material-state.processing {
  min-width: 76px;
  background: rgba(24, 28, 41, 0.86);
}

.material-video-template .material-state {
  left: 9px;
  top: 9px;
  background: var(--green);
}

.material-video-template .material-state.processing {
  background: var(--violet);
}

.material-aspect {
  position: absolute;
  z-index: 3;
  right: 12px;
  top: 9px;
  height: 24px;
  min-width: 46px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #050609;
  color: var(--text);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
}

.material-template-art,
.material-processing-art {
  width: 140px;
  height: 70px;
  position: relative;
  z-index: 2;
}

.material-video-template .material-template-art,
.material-video-template .material-processing-art {
  width: 168px;
  height: 86px;
}

.material-video-template .material-template-art i:nth-child(1) {
  left: 0;
  top: 22px;
  width: 112px;
}

.material-video-template .material-template-art i:nth-child(2) {
  left: 22px;
  top: 30px;
  width: 112px;
}

.material-video-template .material-template-art i:nth-child(3) {
  left: 44px;
  top: 38px;
  width: 112px;
}

.material-video-template .material-template-art i:nth-child(4) {
  left: 66px;
  top: 46px;
  width: 112px;
}

.material-video-template .material-template-art i:nth-child(5) {
  left: 65px;
  top: 38px;
  width: 36px;
  height: 36px;
}

.material-template-art i,
.material-processing-art::before,
.material-processing-art::after {
  position: absolute;
  content: "";
  height: 3px;
  border-radius: 2px;
  background: rgba(26, 209, 229, 0.72);
}

.material-template-art i:nth-child(1) {
  left: 0;
  top: 12px;
  width: 86px;
}

.material-template-art i:nth-child(2) {
  left: 22px;
  top: 22px;
  width: 98px;
  background: rgba(64, 219, 133, 0.72);
}

.material-template-art i:nth-child(3) {
  left: 46px;
  top: 32px;
  width: 100px;
}

.material-template-art i:nth-child(4) {
  left: 74px;
  top: 42px;
  width: 72px;
  background: rgba(64, 219, 133, 0.72);
}

.material-template-art i:nth-child(5) {
  left: 48px;
  top: 44px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  background: transparent;
}

.material-processing-art {
  display: grid;
  place-items: center;
}

.material-processing-art i {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(199, 178, 255, 0.55);
  border-top-color: #c7b2ff;
  border-radius: 50%;
}

.material-processing-art span {
  position: absolute;
  top: 54px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.material-voice-art {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.material-voice-art > span,
.material-play {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(232, 240, 250, 0.12);
  color: var(--text);
  font-weight: 800;
}

.mini-wave {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-wave i {
  width: 3px;
  border-radius: 999px;
  background: var(--blue);
}

.subtitle-sample {
  position: relative;
  z-index: 2;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}

.material-play {
  position: relative;
  z-index: 2;
}

.material-more {
  position: absolute;
  right: 2px;
  top: 110px;
  width: 20px;
  height: 24px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.material-play-indicator {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  min-width: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #05080d;
  color: var(--text);
  padding: 0 0 0 2px;
  font-size: 13px;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.material-video-template h3 {
  width: 190px;
  min-height: 19px;
  max-height: 38px;
  margin: 14px 0 0 15px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 19px;
}

.material-video-template p.material-file-name,
.material-video-template p.material-spec-line {
  width: 210px;
  min-height: 15px;
  margin-left: 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 15px;
}

.material-video-template p.material-file-name {
  margin-top: 7px;
}

.material-video-template p.material-spec-line {
  margin-top: 7px;
}

.material-video-template .material-fit {
  max-width: 128px;
  height: 24px;
  margin: 11px 0 0 15px;
  background: var(--input);
}

.material-video-template .material-card-actions {
  position: absolute;
  left: 15px;
  top: 273px;
  display: flex;
  gap: 10px;
}

.material-video-template .material-card-actions::before {
  content: "";
  position: absolute;
  left: 0;
  top: -11px;
  width: 224px;
  height: 1px;
  background: var(--line);
}

.material-card-button,
.material-card-more {
  height: 30px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.material-card-button {
  width: 58px;
}

.material-card-button.primary {
  border-color: var(--blue);
  background: var(--blue);
}

.material-card-more {
  position: absolute;
  left: 151px;
  top: 273px;
  width: 30px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.material-card h3 {
  width: 146px;
  min-height: 32px;
  margin: 12px 0 0 10px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  overflow-wrap: anywhere;
}

.material-card p {
  width: 160px;
  min-height: 30px;
  margin: 6px 0 0 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 15px;
}

.asset-card.material-subtitle-card h3 {
  width: 190px;
  min-height: 19px;
  max-height: 38px;
  margin: 14px 0 0 15px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 19px;
}

.asset-card.material-subtitle-card p.material-file-name,
.asset-card.material-subtitle-card p.material-spec-line {
  width: 210px;
  min-height: 15px;
  max-height: 15px;
  margin-left: 15px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.asset-card.material-subtitle-card p.material-file-name {
  margin-top: 7px;
}

.asset-card.material-subtitle-card p.material-spec-line {
  margin-top: 7px;
}

.material-card-meta {
  height: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 6px 0 10px;
}

.material-card-meta strong {
  color: var(--text);
  font-size: 13px;
  line-height: 16px;
}

.material-card-meta span {
  width: 70px;
  color: var(--muted);
  font-size: 10px;
  line-height: 12px;
  text-align: right;
}

.material-separator {
  width: 160px;
  height: 1px;
  margin: 8px 0 0 10px;
  background: var(--line);
}

.material-fit {
  max-width: 112px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  margin: 10px 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--input);
  color: var(--text);
  padding: 0 8px;
  font-size: 11px;
  white-space: nowrap;
}

.material-subtitle-card .material-fit {
  max-width: 128px;
  height: 24px;
  margin: 11px 0 0 15px;
  background: var(--input);
}

.material-subtitle-card .material-card-actions {
  position: absolute;
  left: 15px;
  top: 273px;
  display: flex;
  gap: 10px;
}

.material-subtitle-card .material-card-actions::before {
  content: "";
  position: absolute;
  left: 0;
  top: -11px;
  width: 224px;
  height: 1px;
  background: var(--line);
}

.material-action-menu {
  position: absolute;
  left: 0;
  top: 210px;
  z-index: 3;
  width: 172px;
  display: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #333b4f;
  padding: 6px 0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.material-video-template .material-action-menu {
  left: 141px;
  top: 187px;
  width: 96px;
  border-radius: 10px;
  background: #1d2130;
  padding: 6px 0;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.material-subtitle-card .material-action-menu {
  left: auto;
  right: 16px;
  top: auto;
  bottom: 52px;
  width: 126px;
  border-radius: 10px;
  background: #1d2130;
  padding: 6px 0;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.material-card:hover .material-action-menu,
.material-card:focus-within .material-action-menu {
  display: grid;
}

.material-video-template:hover .material-action-menu,
.material-video-template:focus-within .material-action-menu {
  display: none;
}

.material-subtitle-card:hover .material-action-menu,
.material-subtitle-card:focus-within .material-action-menu {
  display: none;
}

.material-video-template .material-card-more:hover + .material-action-menu,
.material-video-template .material-card-more:focus + .material-action-menu,
.material-video-template .material-action-menu:hover {
  display: grid;
}

.material-subtitle-card .material-card-more:hover + .material-action-menu,
.material-subtitle-card .material-card-more:focus + .material-action-menu,
.material-subtitle-card .material-action-menu:hover {
  display: grid;
}

.material-action-menu button {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 0 20px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.material-video-template .material-action-menu button {
  height: 32px;
  gap: 0;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
}

.material-subtitle-card .material-action-menu button {
  height: 32px;
  gap: 6px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
}

.material-subtitle-card .material-action-menu button + button {
  border-top: 1px solid var(--line);
}

.material-video-template .material-action-menu button + button {
  border-top: 1px solid var(--line);
}

.asset-card.material-voice-card {
  width: 256px;
  height: 304px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.24),
    0 1px 0 rgba(232, 240, 250, 0.05) inset;
}

.asset-card.material-voice-card:hover,
.asset-card.material-voice-card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(61, 140, 255, 0.42);
  background: #151927;
  box-shadow:
    0 30px 58px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(61, 140, 255, 0.08) inset,
    0 1px 0 rgba(232, 240, 250, 0.08) inset;
}

.voice-card-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 22px 22px 0;
}

.voice-card-avatar {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: var(--blue);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(61, 140, 255, 0.28);
}

.voice-card-title {
  min-width: 0;
}

.voice-default-badge {
  height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(30, 213, 255, 0.4);
  border-radius: 999px;
  background: rgba(30, 213, 255, 0.12);
  color: var(--cyan);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
}

.material-voice-card h3 {
  width: 120px;
  min-height: 21px;
  max-height: 42px;
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.voice-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.voice-card-tags span {
  height: 25px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
  color: var(--muted);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 13px;
  white-space: nowrap;
}

.voice-card-desc {
  width: 200px;
  height: 32px;
  margin: 18px 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 17px;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.voice-card-source {
  width: 200px;
  margin: 8px 0 0 22px;
  overflow: hidden;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-card-wave {
  width: 212px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 15px 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(232, 240, 250, 0.04), transparent),
    #0b1019;
  padding: 0 15px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.22) inset;
}

.voice-card-wave i {
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  opacity: 0.9;
}

.voice-card-usage {
  width: 170px;
  min-height: 13px;
  margin: 14px 0 0 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-voice-card .material-card-actions {
  position: absolute;
  left: 22px;
  top: 250px;
  display: flex;
  gap: 10px;
}

.material-voice-card .material-card-actions::before {
  content: "";
  position: absolute;
  left: 0;
  top: -10px;
  width: 212px;
  height: 1px;
  background: var(--line);
}

.material-voice-card .material-card-more {
  left: 158px;
  top: 250px;
}

.material-voice-card .material-action-menu {
  left: 148px;
  top: 172px;
  width: 90px;
  border-radius: 10px;
  background: #1d2130;
  padding: 6px 0;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.material-voice-card:hover .material-action-menu,
.material-voice-card:focus-within .material-action-menu {
  display: none;
}

.material-voice-card .material-card-more:hover + .material-action-menu,
.material-voice-card .material-card-more:focus + .material-action-menu,
.material-voice-card .material-action-menu:hover {
  display: grid;
}

.material-voice-card .material-action-menu button {
  height: 32px;
  gap: 0;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
}

.material-voice-card .material-action-menu button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  opacity: 0.5;
}

.material-voice-card .material-action-menu button + button {
  border-top: 1px solid var(--line);
}

.material-action-menu button span {
  width: 12px;
  color: #d6e0f5;
}

.material-action-menu button.danger {
  color: var(--danger);
}

.material-action-menu button.danger span {
  color: var(--danger);
}

.voice-edit-modal {
  display: grid;
  gap: 14px;
}

.voice-edit-modal label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.voice-edit-modal input,
.voice-edit-modal textarea {
  width: 100%;
}

.voice-edit-modal textarea {
  min-height: 128px;
  resize: vertical;
}

.voice-edit-summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
}

.voice-edit-summary span,
.voice-edit-summary strong,
.voice-edit-summary small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-edit-summary span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.voice-edit-summary strong {
  color: var(--text);
  font-size: 12px;
}

.voice-edit-summary small {
  color: var(--muted);
  font-size: 12px;
}

.materials-note {
  height: 42px;
  display: flex;
  align-items: center;
  position: sticky;
  z-index: 4;
  bottom: 24px;
  margin-top: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
  color: var(--muted);
  padding: 0 17px;
  font-size: 13px;
}

.materials-empty {
  grid-column: 1 / -1;
}

.material-preview-fallback {
  width: min(680px, 100%);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(61, 140, 255, 0.16), rgba(26, 209, 229, 0.08)),
    var(--input);
  background-position: center;
  background-size: cover;
  color: var(--muted);
  font-weight: 700;
}

.script-page-card h3 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 30px;
  overflow: visible;
}

.script-page-card {
  position: relative;
  height: 260px;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 76px auto 31px;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  padding: 22px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.2);
  overflow: visible;
}

.script-page-card:hover {
  border-color: rgba(61, 140, 255, 0.55);
  transform: translateY(-1px);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.script-card-summary {
  min-width: 0;
  height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input);
}

.script-card-summary p,
.script-detail-body {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.script-card-summary p {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.script-card-stats {
  color: var(--muted);
  font-size: 12px;
}

.script-page-card .filter-chip,
.script-card .filter-chip,
.script-detail .filter-chip {
  width: max-content;
  min-width: 88px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  justify-content: center;
  font-size: 11px;
}

.script-card-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.script-card-foot .small {
  width: 58px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  font-size: 12px;
}

.script-card-foot .icon-small {
  width: 30px;
  min-width: 30px;
  font-size: 18px;
  line-height: 1;
}

.script-menu-wrap {
  position: relative;
}

.script-menu {
  position: absolute;
  left: 44px;
  bottom: 22px;
  z-index: 5;
  width: 104px;
  display: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1d2130;
  box-shadow: 0 12px 12px rgba(0, 0, 0, 0.35);
}

.script-menu-wrap:focus-within .script-menu {
  display: grid;
}

.script-menu button {
  height: 36px;
  display: block;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.script-menu button:last-child {
  border-bottom: 0;
}

.script-menu .danger {
  color: #f24752;
}

.script-menu button:disabled {
  color: #68758d;
}

.compact-buttons {
  grid-template-columns: 130px 130px;
  justify-content: end;
}

.script-editor-large {
  min-height: 220px;
}

.script-editor-modal,
.script-detail {
  display: grid;
  gap: 16px;
}

.script-editor-modal label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.script-editor-modal input,
.script-editor-modal select {
  height: 46px;
  padding: 0 16px;
}

.script-editor-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.script-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.script-detail-head h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 20px;
}

.script-detail-head small {
  color: var(--muted);
  white-space: nowrap;
}

.script-detail-body {
  min-height: 260px;
  max-height: 46vh;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--input);
  color: var(--text);
  font-size: 14px;
}

.script-detail .compact-buttons {
  grid-template-columns: 150px 120px 100px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 11, 17, 0.72);
  backdrop-filter: blur(10px);
}

.ui-dialog {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 11, 17, 0.72);
  backdrop-filter: blur(10px);
}

.ui-dialog-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.38);
}

.ui-dialog-head,
.ui-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ui-dialog-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.ui-dialog-head h3 {
  margin: 0;
  font-size: 18px;
}

.ui-dialog-body {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.ui-dialog-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.ui-dialog-body label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.ui-dialog-body input {
  height: 44px;
  padding: 0 14px;
}

.ui-dialog-actions {
  justify-content: flex-end;
  padding: 0 20px 20px;
}

.ui-dialog-actions button {
  min-width: 96px;
}

.ui-dialog-card.danger #ui-dialog-confirm {
  border-color: #f24752;
  background: #f24752;
}

.toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 48px));
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #1d2130;
  color: var(--text);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
  font-size: 13px;
  line-height: 1.5;
}

.toast.error {
  border-color: rgba(242, 71, 82, 0.65);
  color: #ffb5b9;
}

.toast.success {
  border-color: rgba(64, 219, 133, 0.52);
}

.modal-card {
  width: min(860px, 100%);
  max-height: min(820px, 90vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
}

.wide-modal {
  width: min(980px, 100%);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 28px;
  line-height: 1;
}

.template-grid,
.script-modal-content {
  padding: 22px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.template-option {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--input);
  cursor: pointer;
}

.template-option.active {
  border-color: var(--blue);
}

.template-option .template-thumb {
  height: 120px;
  margin-bottom: 12px;
}

.template-option strong {
  display: block;
  margin-bottom: 4px;
}

.template-option p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.script-library-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.modal-script-library {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.script-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--input);
  cursor: pointer;
  text-align: left;
}

.script-card h4 {
  margin: 0 0 8px;
}

.script-card p,
.rewrite-box p {
  color: var(--muted);
}

.rewrite-box {
  display: grid;
  gap: 14px;
}

.voice-clone-modal {
  display: grid;
  gap: 14px;
}

.modal-help,
.modal-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.modal-status {
  min-height: 20px;
  color: var(--text);
}

.rewrite-box input {
  padding: 14px 16px;
}

.voice-clone-modal input,
.voice-clone-modal textarea {
  width: 100%;
}

.voice-upload-drop {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--input);
  cursor: pointer;
}

.voice-upload-drop span {
  font-weight: 800;
}

.voice-upload-drop small {
  color: var(--muted);
}

.voice-upload-drop input {
  margin-top: 8px;
}

.voice-preview-card {
  width: min(520px, calc(100vw - 32px));
}

.voice-preview-content {
  padding: 22px;
}

.voice-preview-modal {
  display: grid;
  gap: 16px;
}

.voice-preview-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.voice-preview-head strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  line-height: 22px;
}

.voice-preview-head span,
.voice-preview-modal p {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.voice-preview-wave {
  width: 100%;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(232, 240, 250, 0.05), transparent),
    #0b1019;
  padding: 0 18px;
}

.voice-preview-wave i {
  width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
}

.voice-preview-audio {
  width: 100%;
}

.rewrite-result {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--input);
  line-height: 1.7;
}

.rewrite-modal-card {
  width: min(1120px, 100%);
}

.rewrite-content {
  padding: 0;
}

.rewrite-shell {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  min-height: 560px;
}

.rewrite-source-panel,
.rewrite-result-panel {
  min-width: 0;
  padding: 24px;
}

.rewrite-source-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--line);
  background: rgba(14, 17, 24, 0.55);
}

.rewrite-result-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rewrite-section-head,
.rewrite-result-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.rewrite-section-head h4,
.rewrite-result-header h4 {
  margin: 4px 0 0;
  font-size: 18px;
}

.eyebrow {
  display: block;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.rewrite-step,
.rewrite-count-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rewrite-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.rewrite-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.rewrite-field input,
.rewrite-field textarea {
  width: 100%;
  padding: 14px 16px;
}

.rewrite-field textarea {
  height: 190px;
  min-height: 150px;
}

.rewrite-field.stretch {
  flex: 1;
}

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

.rewrite-tone {
  height: 38px;
  padding: 0 10px;
  border-color: var(--line);
  background: var(--input);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rewrite-tone.active {
  border-color: var(--blue);
  background: rgba(61, 140, 255, 0.18);
}

.rewrite-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.rewrite-output {
  height: 338px;
  min-height: 280px;
  padding: 18px;
  background: #0b101a;
  line-height: 1.7;
}

.rewrite-variants {
  display: flex;
  gap: 8px;
  min-height: 38px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.rewrite-variant {
  height: 34px;
  flex: 0 0 auto;
  padding: 0 12px;
  border-color: var(--line);
  background: var(--input);
  font-size: 13px;
  white-space: nowrap;
}

.rewrite-empty-note {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.rewrite-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
}

.rewrite-actions button {
  min-width: 138px;
}

.rewrite-v3-card {
  width: min(900px, calc(100vw - 48px));
  height: min(720px, calc(100vh - 48px));
  max-height: min(720px, calc(100vh - 48px));
  overflow: hidden;
  border-color: #384d7a;
  border-radius: 22px;
  background: #131724;
  box-shadow: 0 24px 30px rgba(0, 0, 0, 0.45);
}

.rewrite-v3-card .modal-head {
  height: 72px;
  padding: 0 28px;
  border-bottom-color: var(--line);
  background: #141a29;
}

.rewrite-v3-card .modal-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  line-height: 1.2;
}

.rewrite-title-mark {
  color: var(--cyan);
  font-size: 22px;
}

.rewrite-v3-card .icon-button {
  color: var(--text);
  font-size: 28px;
}

.rewrite-v3-content {
  height: calc(100% - 72px);
  padding: 0;
}

.rewrite-v3 {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.rewrite-v3-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: 78px 50px minmax(0, 1fr);
  gap: 20px;
  padding: 24px 28px 0;
}

.rewrite-v3-link-block {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.rewrite-v3-link-block label,
.rewrite-v3-text-panel h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.rewrite-v3-link-block label {
  color: var(--muted);
  font-size: 14px;
}

.rewrite-v3-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 16px;
}

.rewrite-v3-url-field {
  min-width: 0;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #090b13;
  color: var(--muted);
}

.rewrite-v3-url-field input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
}

.rewrite-v3-url-field input:focus {
  box-shadow: none;
}

.rewrite-v3-start {
  height: 48px;
  padding: 0 18px;
  border-color: var(--line);
  background: var(--panel-2);
  border-radius: 12px;
}

.rewrite-progress {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #11141f;
  overflow: hidden;
}

.rewrite-progress-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.rewrite-progress-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(50% + 22px);
  top: 14px;
  width: calc(100% - 44px);
  height: 1px;
  background: var(--line);
}

.rewrite-progress-step span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #141a29;
  color: var(--text);
  font-size: 11px;
}

.rewrite-progress-step strong {
  font-weight: 600;
}

.rewrite-progress-step.done span,
.rewrite-progress-step.active span {
  border-color: var(--violet);
}

.rewrite-progress-step.active {
  color: var(--text);
}

.rewrite-progress-step.active span {
  background: var(--violet);
  box-shadow: 0 0 7px rgba(89, 115, 255, 0.55);
}

.rewrite-v3-columns {
  min-height: 0;
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 58px;
}

.rewrite-v3-text-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: 28px minmax(0, 1fr) 20px;
  gap: 12px;
}

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

.rewrite-v3-tone-row {
  display: flex;
  gap: 6px;
}

.rewrite-v3-tone {
  height: 28px;
  padding: 0 14px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  font-size: 12px;
  font-weight: 600;
}

.rewrite-v3-tone.active {
  border-color: var(--violet);
  background: var(--violet);
}

.rewrite-v3-source,
.rewrite-v3-output {
  width: 100%;
  height: 100%;
  min-height: 0;
  resize: none;
  padding: 24px;
  border-radius: 12px;
  line-height: 1.6;
}

.rewrite-v3-source {
  background: #0e111b;
}

.rewrite-v3-output {
  background: #090b13;
}

.rewrite-v3-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
}

.rewrite-v3-status.error {
  color: var(--danger);
}

.rewrite-v3-footer {
  height: 80px;
  flex: 0 0 80px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 26px;
  padding: 0 28px;
  border-top: 1px solid var(--line);
  background: #141a29;
}

.rewrite-v3-footer button {
  height: 44px;
  min-width: 150px;
  border-radius: 12px;
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 0 18px 80px;
  }

  .view,
  .create-grid,
  .left-column,
  .right-column,
  .panel {
    width: 100%;
    max-width: 100%;
  }

  .hero-row {
    flex-direction: column;
    gap: 12px;
  }

  .topbar,
  .create-grid,
  .bottom-bar,
  .job,
  .task-table-head,
  .asset-grid,
  .script-page-grid,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .task-table-head {
    display: none;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .filter-row input,
  .library-search {
    width: 100%;
  }

  .materials-hero,
  .materials-filter-bar,
  .materials-tabs {
    flex-wrap: wrap;
    height: auto;
  }

  .monitor-hero,
  .monitor-grid,
  .admin-hero,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .monitor-hero,
  .admin-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .monitor-summary,
  .monitor-stage-grid,
  .admin-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitor-active-job,
  .monitor-event,
  .admin-job-row,
  .admin-activation-row {
    grid-template-columns: 1fr;
  }

  .admin-row-actions {
    justify-content: flex-start;
  }

  .monitor-event span {
    text-align: left;
  }

  .asset-grid.materials-grid {
    grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
  }

  .asset-card.material-card,
  .material-thumb {
    width: 100%;
  }

  .asset-card.material-subtitle-card {
    width: 100%;
    max-width: 320px;
  }

  .material-subtitle-card .material-thumb.subtitle,
  .asset-card.material-subtitle-card h3,
  .asset-card.material-subtitle-card p.material-file-name,
  .asset-card.material-subtitle-card p.material-spec-line {
    width: calc(100% - 32px);
  }

  .material-subtitle-card .material-card-actions::before {
    width: calc(100vw - 96px);
    max-width: 288px;
  }

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

  .subtitle-panel,
  .output-panel {
    height: auto;
  }

  .subtitle-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

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

  .bottom-bar {
    position: static;
    width: 100%;
    height: auto;
    align-items: stretch;
  }

  .rewrite-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .rewrite-source-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rewrite-output {
    height: 260px;
  }

  .rewrite-tone {
    padding: 0 6px;
    font-size: 14px;
  }

  .rewrite-v3-card {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
    overflow: auto;
  }

  .rewrite-v3-content {
    height: auto;
    min-height: calc(100vh - 96px);
  }

  .rewrite-v3-main {
    grid-template-rows: auto auto auto;
    padding: 18px;
  }

  .rewrite-v3-link-row,
  .rewrite-v3-columns {
    grid-template-columns: 1fr;
  }

  .rewrite-v3-columns {
    gap: 18px;
  }

  .rewrite-v3-text-panel {
    grid-template-rows: auto 230px auto;
  }

  .rewrite-v3-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .rewrite-v3-tone-row {
    width: 100%;
  }

  .rewrite-v3-tone {
    flex: 1;
    padding: 0 8px;
  }

  .rewrite-progress {
    min-width: 0;
  }

  .rewrite-progress-step:not(:last-child)::after {
    left: calc(50% + 18px);
    width: calc(100% - 36px);
  }

  .rewrite-v3-footer {
    position: static;
    height: auto;
    flex: 0 0 auto;
    padding: 14px 18px;
    gap: 10px;
  }

  .rewrite-v3-footer button {
    min-width: 0;
    flex: 1;
  }
}
