:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #20242a;
}

body {
  margin: 0;
}

.app-body {
  background: #f4f6f8;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.app-shell {
  display: block;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  background: radial-gradient(circle at 0 0, rgba(37, 99, 235, .24), transparent 34%), #111827;
  box-sizing: border-box;
  color: #e5edf7;
  display: flex;
  flex-direction: column;
  height: 100vh;
  left: 0;
  overflow-y: auto;
  padding: 24px 12px;
  position: fixed;
  top: 0;
  width: 220px;
  z-index: 40;
}

.brand {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  gap: 10px;
  padding: 0 10px 22px;
}

.brand strong {
  color: #fff;
  font-size: 20px;
  letter-spacing: 0;
}

.brand span {
  color: #94a3b8;
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.brand-mark {
  align-items: center;
  background: #f8fbff;
  border-radius: 8px;
  color: #101828;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 22px;
}

.nav-link {
  align-items: center;
  border-radius: 8px;
  color: #cbd5e1;
  display: grid;
  font-weight: 700;
  gap: 10px;
  grid-template-columns: 30px 1fr auto;
  padding: 11px 10px;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  background: #1f2937;
  color: #fff;
}

.nav-link.active {
  box-shadow: inset 3px 0 0 #2563eb;
}

.nav-icon {
  align-items: center;
  background: rgba(148, 163, 184, .16);
  border-radius: 7px;
  display: inline-flex;
  font-size: 12px;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.nav-link.active .nav-icon {
  background: #2563eb;
}

.queue-badge {
  background: rgba(255, 255, 255, .14);
  border-radius: 999px;
  color: #d8e1ee;
  font-size: 12px;
  font-weight: 900;
  min-width: 20px;
  padding: 3px 7px;
  text-align: center;
}

.nav-disabled {
  cursor: default;
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.user-card {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: grid;
  gap: 10px;
  grid-template-columns: 38px 1fr;
  padding: 16px 10px 0;
}

.user-card strong {
  color: #fff;
  display: block;
}

.user-card span {
  color: #94a3b8;
  font-size: 13px;
}

.user-avatar {
  align-items: center;
  background: #0b65d8;
  border-radius: 999px;
  color: #fff !important;
  display: inline-flex;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.sidebar-logout button {
  background: rgba(255, 255, 255, .08);
  color: #e5edf7;
  padding: 9px 12px;
  width: 100%;
}

.workspace {
  display: block;
  height: 100vh;
  margin-left: 220px;
  min-width: 0;
  overflow-y: auto;
}

.workspace-header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #dde3eb;
  box-shadow: 0 1px 14px rgba(16, 24, 40, .06);
  display: flex;
  justify-content: space-between;
  padding: 20px 28px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.workspace-kicker,
.section-kicker {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.workspace-header h1 {
  font-size: 26px;
  letter-spacing: 0;
  margin: 0;
}

.status-strip {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.header-link {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.status-chip {
  background: #eef2f7;
  border: 1px solid #dce3ec;
  border-radius: 999px;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}

.status-chip.online {
  background: #e8f8ef;
  border-color: #c8eed8;
  color: #126437;
}

.status-chip.pending {
  background: #fff7df;
  border-color: #f4df9a;
  color: #775500;
}

.workspace-content {
  margin: 0 auto;
  max-width: 1360px;
  padding: 24px 22px 36px;
  width: 100%;
  box-sizing: border-box;
}

.site-footer {
  color: #8a94a6;
  font-size: 12px;
  padding: 0 22px 22px;
  text-align: center;
}

.site-footer a,
.login-icp a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.login-icp a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.login-icp {
  bottom: 18px;
  color: rgba(226, 236, 255, .72);
  font-size: 12px;
  left: 0;
  position: fixed;
  right: 0;
  text-align: center;
  z-index: 6;
}

.voice-layout,
.image-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 330px;
}

.panel {
  background: #fff;
  border: 1px solid #dde3eb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  margin-bottom: 18px;
  padding: 18px;
}

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

.section-heading.compact {
  align-items: center;
  margin-bottom: 10px;
}

.section-heading h2,
.panel h2 {
  font-size: 20px;
  margin: 0;
}

.title-icon {
  align-items: center;
  color: #2563eb;
  display: inline-flex;
  font-size: 18px;
  margin-right: 9px;
}

.section-heading.compact h2 {
  font-size: 18px;
}

.section-heading a {
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.model-badge {
  background: #eef6ff;
  border: 1px solid #cde4ff;
  border-radius: 999px;
  color: #175cd3;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.model-badge.pending {
  background: #fff7df;
  border-color: #f4df9a;
  color: #775500;
}

.hint {
  color: #4f5a67;
  margin: -4px 0 18px;
}

.task-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  font-weight: 750;
  gap: 8px;
}

.field-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.field-row a {
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.field-row small,
.char-count {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

input,
textarea,
select {
  background: #fff;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  box-sizing: border-box;
  color: #20242a;
  font: inherit;
  padding: 11px 12px;
  width: 100%;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
  outline: 0;
}

input:disabled,
textarea:disabled,
select:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.upload-field {
  border: 1px dashed #cfd6df;
  border-radius: 8px;
  padding: 14px;
}

.upload-field input {
  border: 0;
  padding: 6px 0 0;
}

.drop-upload {
  gap: 10px;
  position: relative;
}

.drop-box {
  align-items: center;
  background: #f8fafc;
  border: 1px dashed #c8d2df;
  border-radius: 8px;
  color: #475467;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 62px;
  padding: 10px;
  text-align: center;
}

.drop-box.dragging {
  background: #eef6ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.drop-label {
  font-weight: 800;
}

.drop-icon {
  align-items: center;
  color: #667085;
  display: inline-flex;
  font-size: 20px;
}

.drop-box small {
  color: #667085;
  font-size: 12px;
}

.drop-upload input[type="file"] {
  height: 1px;
  opacity: 0;
  padding: 0;
  position: absolute;
  width: 1px;
}

.settings-help {
  background: #f8fafc;
  border: 1px solid #dde6ef;
  border-radius: 8px;
  padding: 14px;
}

.settings-help h3 {
  font-size: 16px;
  margin: 0;
}

.settings-help-grid {
  display: grid;
  gap: 10px 14px;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.settings-help p,
.guide-list p,
.guide-grid p {
  color: #4f5a67;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.settings-help strong {
  color: #20242a;
}

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

.range-control {
  border: 1px solid #dde3eb;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 74px;
  padding: 13px;
}

.range-control span {
  align-self: start;
  grid-column: 1 / -1;
}

.range-copy {
  align-self: center;
  display: grid;
  gap: 3px;
}

.range-copy strong {
  font-size: 14px;
}

.range-copy small {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.range-control input[type="range"] {
  accent-color: #2563eb;
  align-self: center;
  padding: 0;
}

.range-control input[type="number"] {
  padding: 8px 10px;
}

button,
.button-link {
  background: #0b65d8;
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 11px 14px;
  text-decoration: none;
}

.primary-action {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  font-size: 16px;
  min-height: 48px;
}

.button-link {
  display: inline-block;
}

.button-link.secondary {
  background: #eef2f7;
  color: #344054;
}

.notice {
  background: #e9f6ff;
  border: 1px solid #b9e2ff;
  border-radius: 8px;
  color: #075985;
  margin: 0 0 16px;
  padding: 10px 12px;
}

.notice.error {
  background: #fff1f1;
  border-color: #ffc9c9;
  color: #9b1c1c;
}

.notice.success {
  background: #ecfdf3;
  border-color: #b7ebc6;
  color: #067647;
}

.task-tracker {
  align-items: center;
  background:
    radial-gradient(circle at 96% 8%, rgba(37, 99, 235, .14), transparent 30%),
    linear-gradient(135deg, #f8fbff, #eef6ff);
  border: 1px solid #cfe0f5;
  border-radius: 12px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin: 14px 0;
  padding: 16px;
}

.task-tracker h2 {
  font-size: 20px;
  margin: 4px 0 6px;
}

.task-tracker p {
  color: #526071;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.task-tracker .tracker-reference-note {
  background: rgba(37, 99, 235, .08);
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 10px;
  color: #2450a4;
  font-weight: 800;
  margin-top: 10px;
  padding: 9px 11px;
}

.task-tracker .tracker-reference-note.success {
  background: rgba(22, 163, 74, .08);
  border-color: rgba(22, 163, 74, .18);
  color: #087443;
}

.tracker-actions {
  display: flex;
  justify-content: flex-end;
}

.tracker-note {
  background: #fff;
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  color: #475467;
  font-size: 12px;
  font-weight: 850;
  padding: 8px 10px;
  white-space: nowrap;
}

.guide-list,
.preset-list {
  display: grid;
  gap: 10px;
}

.guide-list article,
.guide-grid article,
.preset-card {
  border: 1px solid #dde6ef;
  border-radius: 8px;
  padding: 13px;
}

.preset-card {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 48px 1fr;
}

.preset-icon {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-size: 22px;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.preset-card.green .preset-icon {
  background: #e8f8ef;
  color: #16a34a;
}

.preset-card.blue .preset-icon {
  background: #eaf2ff;
  color: #2563eb;
}

.preset-card.violet .preset-icon {
  background: #f2eaff;
  color: #7c3aed;
}

.preset-card small {
  background: #e8f8ef;
  border-radius: 999px;
  color: #16a34a;
  float: right;
  font-size: 11px;
  padding: 3px 7px;
}

.guide-list h3,
.guide-grid h3 {
  font-size: 14px;
  margin: 0 0 7px;
}

.mini-tasks {
  position: sticky;
  top: 110px;
}

.mini-task {
  align-items: start;
  border-top: 1px solid #edf0f4;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 11px 0;
}

.mini-task > div {
  min-width: 0;
}

.mini-task strong {
  display: block;
  margin-bottom: 3px;
}

.mini-task p {
  color: #5d6673;
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
  max-height: 54px;
  overflow: hidden;
}

.mini-task a,
.task-action {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  justify-self: end;
  text-decoration: none;
}

.mini-audio {
  align-self: center;
  grid-column: 1 / -1;
  height: 30px;
  max-width: 100%;
  width: 100%;
}

.placeholder-task {
  color: #20242a;
}

.image-options {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr 1fr;
}

.image-panel {
  overflow: hidden;
}

.image-aside {
  display: grid;
  gap: 14px;
}

.image-aside .panel {
  margin-bottom: 0;
}

.image-preview-panel {
  position: sticky;
  top: 116px;
}

.image-form textarea {
  min-height: 178px;
}

.source-image-box {
  align-items: stretch;
  background: linear-gradient(135deg, rgba(37, 99, 235, .07), rgba(20, 184, 166, .06));
  border: 1px solid #d9e6f6;
  border-radius: 12px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .85fr);
  padding: 16px;
}

.source-image-box p {
  color: #526071;
  font-size: 13px;
  line-height: 1.55;
  margin: 6px 0 0;
}

.field-title,
.source-mode,
.table-note {
  color: #667085;
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.image-source-upload {
  min-height: 112px;
}

.source-mode {
  margin-top: 2px;
}

.image-upload {
  background: #fbfcfe;
}

.option-group {
  display: grid;
  font-weight: 750;
  gap: 8px;
}

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

.segmented button {
  background: #f3f6fa;
  border: 1px solid #d9e1eb;
  color: #344054;
  padding: 9px 11px;
}

.image-placeholder {
  align-items: center;
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .08), transparent 44%),
    repeating-linear-gradient(90deg, rgba(99, 102, 241, .07) 0 1px, transparent 1px 24px),
    #f8fafc;
  border: 1px dashed #cfd6df;
  border-radius: 8px;
  color: #667085;
  display: flex;
  font-weight: 800;
  justify-content: center;
}

.image-result-card {
  border-top: 1px solid #edf0f4;
  display: grid;
  gap: 10px;
  padding: 12px 0;
}

.image-result-card img {
  aspect-ratio: 4 / 5;
  background: #f8fafc;
  border: 1px solid #e4eaf1;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.image-result-card strong {
  display: block;
  margin: 5px 0 2px;
}

.image-result-card p {
  color: #5d6673;
  font-size: 13px;
  line-height: 1.35;
  margin: 0 0 8px;
  max-height: 54px;
  overflow: hidden;
}

.table-note {
  margin-top: 4px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 960px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e6e9ee;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #626b77;
  font-size: 13px;
}

.copy {
  max-width: 360px;
}

.settings-cell {
  min-width: 150px;
}

.settings-cell small {
  color: #626b77;
  display: block;
  margin-top: 4px;
  white-space: nowrap;
}

.video-ai-list-meta {
  align-items: flex-start;
  color: #475569;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.video-ai-list-meta span,
.video-ai-list-meta a {
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  text-decoration: none;
}

.video-ai-list-meta em {
  color: #64748b;
  flex-basis: 100%;
  font-style: normal;
}

.status {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.status.queued,
.status.voiceover_queued,
.status.render_queued {
  background: #fff4cc;
  color: #7a5400;
}

.status.running,
.status.voiceover_running {
  background: #ddecff;
  color: #084a9b;
}

.status.done {
  background: #dcf7e6;
  color: #11612f;
}

.status.failed {
  background: #ffe1e1;
  color: #9b1c1c;
}

.link-button {
  background: transparent;
  color: #b42318;
  padding: 0;
}

.empty {
  color: #7b8490;
  text-align: center;
}

.panel-header {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-header h1,
.panel-header h2 {
  margin: 0;
}

.admin-dashboard,
.settings-dashboard {
  display: grid;
  gap: 16px;
}

.admin-hero-panel,
.settings-hero-panel {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .08), transparent 42%),
    #fff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

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

.hero-actions,
.admin-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.admin-metrics,
.settings-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-card {
  background: #fff;
  border: 1px solid #dde3eb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  display: grid;
  gap: 5px;
  min-height: 94px;
  padding: 15px;
}

.metric-card span {
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  color: #111827;
  font-size: 26px;
  line-height: 1.1;
}

.metric-card small {
  color: #667085;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-grid,
.settings-grid {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

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

.account-settings-grid {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}

.password-form {
  gap: 12px;
}

.system-status-panel {
  margin-top: 4px;
}

.admin-account-panel,
.admin-note-panel,
.admin-record-panel {
  margin-bottom: 0;
}

.compact-controls {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.permission-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #dde6ef;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px;
}

.permission-row label,
.inline-edit-form label {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  margin: 0;
}

.permission-row input,
.inline-edit-form input[type="checkbox"] {
  width: auto;
}

.permission-help,
.settings-list {
  display: grid;
  gap: 12px;
}

.permission-help p,
.settings-list p,
.admin-guide-grid p {
  background: #f8fafc;
  border: 1px solid #e4e9f0;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 12px;
}

.permission-help strong,
.settings-list strong,
.admin-guide-grid strong {
  color: #20242a;
}

.permission-help span,
.settings-list span,
.admin-guide-grid span {
  color: #4f5a67;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.permission-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.permission-chips span {
  background: #eef6ff;
  border: 1px solid #cde4ff;
  border-radius: 999px;
  color: #175cd3;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
}

.admin-row-details summary {
  color: #175cd3;
  cursor: pointer;
  font-weight: 800;
}

.inline-edit-form {
  background: #f8fafc;
  border: 1px solid #dde6ef;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-top: 8px;
  min-width: 230px;
  padding: 10px;
}

.admin-user-table table {
  min-width: 1080px;
}

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

.recent-panel {
  padding: 16px;
}

.recent-panel table {
  font-size: 13px;
}

.recent-panel th,
.recent-panel td {
  padding: 7px 8px;
}

.recent-panel .status {
  font-size: 11px;
  padding: 3px 7px;
}

.recent-panel .copy {
  max-width: 260px;
}

/* Workspace refresh */
.app-body {
  background:
    radial-gradient(circle at 88% 8%, rgba(37, 99, 235, .09), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
}

.sidebar {
  background:
    radial-gradient(circle at 12% 4%, rgba(59, 130, 246, .22), transparent 30%),
    linear-gradient(180deg, #111a2b 0%, #0c1423 100%);
  padding: 22px 12px;
  width: 238px;
}

.brand {
  padding: 0 10px 24px;
}

.brand-mark {
  background: linear-gradient(145deg, #f8fbff, #dbeafe);
  box-shadow: 0 12px 32px rgba(37, 99, 235, .22);
  height: 40px;
  width: 40px;
}

.side-nav {
  gap: 8px;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 10px;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(148, 163, 184, .18);
}

.nav-link.active {
  box-shadow: inset 3px 0 0 #3b82f6, 0 12px 28px rgba(15, 23, 42, .16);
}

.workspace {
  margin-left: 238px;
}

.workspace-header {
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(203, 213, 225, .72);
  box-shadow: 0 10px 36px rgba(15, 23, 42, .05);
  gap: 14px;
  padding: 18px 30px;
}

.workspace-header > div:first-child {
  flex: 1 0 auto;
}

.workspace-header h1 {
  font-size: 25px;
  line-height: 1.15;
  white-space: nowrap;
}

.workspace-content {
  max-width: 1420px;
  padding: 26px 24px 42px;
}

.status-chip {
  background: #f8fafc;
  border-color: #dbe5ef;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

.header-link {
  color: #1f2937;
}

.status-strip {
  gap: 7px;
  min-width: 0;
}

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

.panel {
  border-color: rgba(203, 213, 225, .9);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .045);
}

.command-card {
  padding: 20px;
}

.command-card .hint {
  color: #526071;
  line-height: 1.55;
}

.section-kicker {
  letter-spacing: .12em;
}

.title-icon,
.nav-link.active .nav-icon {
  color: #fff;
}

.title-icon {
  background: #2563eb;
  border-radius: 7px;
  height: 24px;
  justify-content: center;
  margin-right: 9px;
  width: 24px;
}

.model-badge {
  background: #f1f7ff;
  border-color: #cfe3ff;
}

input,
textarea,
select {
  border-color: #d2dbe7;
  border-radius: 9px;
}

textarea {
  line-height: 1.5;
}

.task-form {
  gap: 15px;
}

.voice-style-selector,
.image-mode-selector,
.parameter-presets,
.script-coach,
.audio-checklist {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .045), rgba(20, 184, 166, .035)),
    #fbfdff;
  border: 1px solid #dfe8f3;
  border-radius: 12px;
  padding: 14px;
}

.assist-note {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.assist-card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.image-mode-selector .assist-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.assist-card {
  background: rgba(255, 255, 255, .84);
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  color: #1f2937;
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
}

.assist-card:hover,
.assist-card.active,
.template-button:hover,
.param-preset-button:hover,
.param-preset-button.active {
  background: #eef6ff;
  border-color: #93c5fd;
  color: #174ea6;
}

.assist-card strong {
  font-size: 14px;
}

.assist-card span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

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

.script-coach p {
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
  margin: 3px 0 0;
}

.audio-checklist {
  display: grid;
  gap: 10px;
}

.audio-checklist > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.audio-checklist span {
  background: #fff;
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 9px;
}

.parameter-presets {
  display: grid;
  gap: 10px;
}

.preset-buttons,
.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-button,
.param-preset-button {
  background: #fff;
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
  padding: 8px 10px;
}

.image-prompt-zone textarea {
  min-height: 205px;
}

.source-image-box {
  background: #f8fbff;
  border-color: #dce8f7;
  border-radius: 10px;
  gap: 12px;
  grid-template-columns: minmax(0, 1.1fr) minmax(230px, .72fr);
  padding: 14px;
}

.source-image-box strong {
  display: block;
  font-size: 15px;
}

.source-image-box p {
  font-size: 12px;
  line-height: 1.45;
}

.image-source-upload {
  min-height: 88px;
}

.image-source-upload .drop-box {
  min-height: 80px;
}

.image-options {
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.controls-grid {
  gap: 10px;
}

.range-control {
  background: #fbfdff;
  border-color: #dce3ec;
  border-radius: 10px;
  padding: 12px;
}

.settings-help {
  background: #f8fbff;
  border-radius: 10px;
  padding: 13px;
}

.settings-help-grid {
  gap: 9px 14px;
}

.settings-help p {
  font-size: 13px;
}

.primary-action {
  background: linear-gradient(135deg, #0b65d8, #2563eb 58%, #4f46e5);
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
}

.submit-flow {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #dfe8f3;
  border-radius: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  padding: 10px 12px;
}

.flow-step {
  align-items: center;
  background: #fff;
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  color: #475467;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  white-space: nowrap;
}

.flow-step.active {
  background: #eaf2ff;
  border-color: #b7d3ff;
  color: #175cd3;
}

.flow-line {
  background: linear-gradient(90deg, #cbd5e1, rgba(203, 213, 225, .2));
  height: 1px;
  min-width: 18px;
}

.studio-aside {
  display: grid;
  gap: 14px;
}

.studio-aside .panel {
  margin-bottom: 0;
}

.guidance-panel {
  padding: 16px;
}

.compact-guide {
  gap: 8px;
}

.prompt-template-panel {
  background:
    radial-gradient(circle at 96% 4%, rgba(37, 99, 235, .12), transparent 32%),
    #fff;
}

.compact-guide article,
.preset-card {
  background: #fbfdff;
  border-color: #e0e7f0;
  padding: 12px;
}

.preset-card {
  grid-template-columns: 38px 1fr;
}

.preset-icon {
  height: 38px;
  width: 38px;
}

.preset-card h3,
.guide-list h3 {
  font-size: 14px;
}

.preset-card p,
.guide-list p {
  font-size: 12px;
}

.mini-tasks,
.image-preview-panel {
  position: sticky;
  top: 104px;
}

.mini-task {
  align-items: center;
  border: 1px solid #e7edf5;
  border-radius: 10px;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-top: 8px;
  padding: 10px;
}

.mini-task-body {
  min-width: 0;
}

.mini-task-actions {
  max-width: 88px;
}

.mini-task p,
.image-result-card p {
  display: -webkit-box;
  max-height: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mini-task-actions {
  align-items: center;
  display: flex;
  justify-content: flex-end;
}

.task-action.muted,
.table-note {
  color: #7b8490;
}

.image-result-card {
  background: #fbfdff;
  border: 1px solid #e4eaf1;
  border-radius: 10px;
  grid-template-columns: 86px minmax(0, 1fr);
  padding: 10px;
}

.image-result-card > div {
  min-width: 0;
}

.image-result-card > a,
.image-result-card > .image-placeholder {
  align-self: stretch;
}

.image-result-card img,
.image-result-card .image-placeholder {
  aspect-ratio: 4 / 5;
  border-radius: 9px;
}

.image-placeholder.cleaned {
  background: #f1f5f9;
  color: #64748b;
  text-align: center;
}

.image-result-card strong {
  margin: 4px 0 2px;
}

.image-result-card .task-action {
  display: inline-block;
  justify-self: start;
  margin-top: 4px;
}

.image-result-spotlight,
.voice-feature-card {
  background:
    linear-gradient(145deg, rgba(15, 23, 42, .94), rgba(30, 41, 59, .9)),
    #111827;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 12px;
  color: #e5edf7;
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
  overflow: hidden;
  padding: 12px;
}

.image-result-spotlight img {
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.image-result-spotlight .image-placeholder {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(148, 163, 184, .28);
  color: #cbd5e1;
}

.image-result-spotlight strong,
.voice-feature-card strong {
  color: #fff;
}

.image-result-spotlight p,
.voice-feature-card p {
  color: #cbd5e1;
  display: -webkit-box;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.voice-feature-card audio {
  height: 34px;
  min-width: 0;
  width: 100%;
}

.feature-actions {
  display: grid;
  gap: 8px;
}

.recent-panel {
  border-radius: 12px;
  margin-top: 4px;
  padding: 14px 16px;
}

.compact-history-panel {
  background:
    linear-gradient(180deg, rgba(248, 251, 255, .95), #fff);
}

.compact-history-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-history-card {
  background: #fff;
  border: 1px solid #e4eaf1;
  border-radius: 10px;
  display: grid;
  gap: 10px;
  min-height: 144px;
  padding: 12px;
}

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

.history-main strong {
  display: block;
  margin: 8px 0 4px;
}

.history-main p {
  color: #4f5a67;
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.42;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.history-meta {
  align-self: end;
  color: #344054;
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 2px;
}

.history-meta small {
  color: #667085;
  font-weight: 700;
  line-height: 1.35;
}

.history-actions {
  align-self: end;
}

.empty-state {
  background: #f8fafc;
  border: 1px dashed #cfd8e3;
  border-radius: 10px;
  color: #667085;
  font-weight: 800;
  grid-column: 1 / -1;
  padding: 22px;
  text-align: center;
}

.recent-panel table {
  font-size: 12px;
}

.recent-panel .copy {
  max-width: 300px;
}

.login-body {
  align-items: center;
  color: #eef6ff;
  display: flex;
  isolation: isolate;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  --login-pointer-x: 50%;
  --login-pointer-y: 50%;
}

.dynamic-login {
  background:
    radial-gradient(circle at 22% 24%, rgba(14, 165, 233, .28), transparent 32%),
    radial-gradient(circle at 78% 18%, rgba(37, 99, 235, .22), transparent 30%),
    radial-gradient(circle at 58% 86%, rgba(20, 184, 166, .2), transparent 34%),
    linear-gradient(135deg, #050b18 0%, #091426 48%, #040816 100%);
}

.login-bg-video {
  filter: saturate(1.02) contrast(1.06);
  height: 100%;
  inset: 0;
  object-fit: cover;
  opacity: .44;
  position: fixed;
  width: 100%;
  z-index: -6;
}

.login-body::before,
.login-body::after,
.login-grid,
.login-particles,
.login-orbit,
.login-wave {
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
}

.login-body::before {
  animation: scan-sweep 8s linear infinite;
  background:
    linear-gradient(90deg, rgba(3, 7, 18, .72), rgba(3, 7, 18, .42) 42%, rgba(3, 7, 18, .78)),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, .04) 0,
      rgba(255, 255, 255, .04) 1px,
      transparent 1px,
      transparent 10px
    ),
    linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.18), transparent);
  mix-blend-mode: screen;
  opacity: .38;
  z-index: -4;
}

.login-body::after {
  animation: aurora-shift 12s ease-in-out infinite alternate;
  background:
    radial-gradient(circle at var(--login-pointer-x) var(--login-pointer-y), rgba(125, 211, 252, .28), transparent 19%),
    radial-gradient(circle at 18% 24%, rgba(34, 211, 238, .28), transparent 28%),
    radial-gradient(circle at 78% 66%, rgba(37, 99, 235, .32), transparent 30%),
    conic-gradient(from 140deg at 72% 24%, transparent 0deg, rgba(45, 212, 191, .24) 54deg, transparent 128deg);
  filter: blur(30px);
  opacity: .58;
  z-index: -3;
}

.login-grid {
  animation: grid-drift 18s linear infinite;
  background:
    linear-gradient(rgba(148, 163, 184, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .07) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  z-index: -2;
}

.login-particles {
  z-index: -1;
}

.login-cursor {
  background:
    radial-gradient(circle, rgba(125, 211, 252, .34), rgba(59, 130, 246, .16) 34%, transparent 68%);
  border-radius: 999px;
  filter: blur(1px);
  height: 170px;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  transform: translate3d(-999px, -999px, 0);
  transition: opacity .22s ease;
  width: 170px;
  z-index: -1;
}

.login-body.pointer-active .login-cursor {
  opacity: 1;
}

.login-orbit {
  border: 1px solid rgba(125, 211, 252, .18);
  border-radius: 999px;
  filter: drop-shadow(0 0 22px rgba(34, 211, 238, .2));
  height: 520px;
  left: -90px;
  top: 28%;
  transform: rotate(-18deg);
  width: 760px;
  z-index: -2;
}

.login-wave {
  animation: wave-flow 14s ease-in-out infinite alternate;
  background:
    linear-gradient(105deg, transparent 0 18%, rgba(34, 211, 238, .32) 19%, transparent 23% 100%),
    linear-gradient(155deg, transparent 0 40%, rgba(96, 165, 250, .24) 41%, transparent 45% 100%);
  filter: blur(10px);
  mask-image: linear-gradient(180deg, transparent, #000 26%, #000 72%, transparent);
  opacity: .42;
  transform: skewY(-8deg);
  z-index: -2;
}

.orbit-one {
  animation: orbit-pulse 7s ease-in-out infinite alternate;
}

.orbit-two {
  animation: orbit-pulse 9s ease-in-out infinite alternate-reverse;
  border-color: rgba(96, 165, 250, .14);
  height: 360px;
  left: auto;
  right: -120px;
  top: 8%;
  transform: rotate(16deg);
  width: 580px;
}

.login-stage {
  align-items: center;
  display: grid;
  gap: clamp(24px, 4vw, 56px);
  grid-template-columns: minmax(0, .82fr) minmax(360px, 410px);
  max-width: 1040px;
  padding: 36px;
  width: min(100%, 1200px);
}

.login-stage[data-login-reactive] {
  perspective: 1100px;
}

.login-hero {
  display: grid;
  gap: 14px;
  max-width: 500px;
  transition: transform .18s ease-out;
  will-change: transform;
}

.login-brand {
  align-items: center;
  display: flex;
  gap: 14px;
}

.login-brand-mark {
  align-items: center;
  background: linear-gradient(145deg, rgba(248, 250, 252, .98), rgba(191, 219, 254, .86));
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .28);
  color: #1e3a8a;
  display: inline-flex;
  font-size: 24px;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  color: #f8fbff;
  font-size: 24px;
  line-height: 1.05;
}

.login-brand span {
  color: #b7c7dc;
  margin-top: 4px;
}

.login-kicker {
  color: #7dd3fc;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .16em;
  margin: 18px 0 0;
  text-transform: uppercase;
}

.login-hero h1 {
  color: #f8fbff;
  font-size: clamp(38px, 3.8vw, 54px);
  letter-spacing: 0;
  line-height: 1.08;
  margin: 0;
  max-width: 500px;
  text-shadow: 0 0 36px rgba(56, 189, 248, .22);
}

.login-copy {
  color: #c8d7ea;
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
  max-width: 430px;
}

.login-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.login-metrics span,
.login-status {
  background: rgba(15, 23, 42, .5);
  border: 1px solid rgba(125, 211, 252, .28);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09);
  color: #dff8ff;
  font-size: 12px;
  font-weight: 850;
  padding: 7px 11px;
}

.login-metrics span {
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.login-metrics span:hover {
  border-color: rgba(125, 211, 252, .68);
  box-shadow: 0 0 26px rgba(56, 189, 248, .18);
  transform: translateY(-2px);
}

.login-panel {
  backdrop-filter: blur(24px);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, .9), rgba(15, 23, 42, .64)),
    linear-gradient(135deg, rgba(34, 211, 238, .08), rgba(37, 99, 235, .1));
  border: 1px solid rgba(148, 163, 184, .32);
  border-radius: 16px;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, .46),
    0 0 70px rgba(37, 99, 235, .18),
    inset 0 1px 0 rgba(255, 255, 255, .18);
  display: grid;
  gap: 18px;
  max-width: 410px;
  overflow: hidden;
  padding: 30px;
  position: relative;
  transform-style: preserve-3d;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  width: 100%;
  will-change: transform;
}

.login-panel:hover,
.login-panel:focus-within {
  border-color: rgba(125, 211, 252, .56);
  box-shadow:
    0 32px 100px rgba(0, 0, 0, .52),
    0 0 76px rgba(37, 99, 235, .24),
    0 0 34px rgba(34, 211, 238, .12),
    inset 0 1px 0 rgba(255, 255, 255, .22);
}

.login-panel::before {
  animation: panel-line 4.5s linear infinite;
  background: linear-gradient(90deg, transparent, #22d3ee, #60a5fa, #f59e0b, transparent);
  content: "";
  height: 2px;
  left: -35%;
  position: absolute;
  right: -35%;
  top: 0;
}

.login-panel::after {
  background: linear-gradient(135deg, rgba(255, 255, 255, .12), transparent 34%);
  content: "";
  height: 160px;
  pointer-events: none;
  position: absolute;
  right: -80px;
  top: -80px;
  transform: rotate(28deg);
  width: 220px;
}

.login-panel > * {
  transform: translateZ(18px);
}

.login-panel-head {
  display: grid;
  gap: 10px;
}

.login-panel h2,
.login-panel p {
  margin: 0;
}

.login-panel h2 {
  color: #f8fbff;
  font-size: 34px;
  letter-spacing: 0;
  text-shadow: 0 0 24px rgba(56, 189, 248, .38);
}

.login-panel p {
  color: #b7c7dc;
}

.login-panel label {
  color: #edf6ff;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.login-panel input {
  background: rgba(2, 6, 23, .54);
  border-color: rgba(125, 211, 252, .32);
  border-radius: 10px;
  color: #f8fbff;
  min-height: 52px;
}

.login-panel input:focus {
  border-color: #38bdf8;
  box-shadow:
    0 0 0 3px rgba(56, 189, 248, .22),
    0 0 26px rgba(34, 211, 238, .18);
  outline: 0;
}

.login-panel button {
  background: linear-gradient(135deg, #06b6d4, #2563eb 56%, #4f46e5);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(37, 99, 235, .36), 0 0 32px rgba(34, 211, 238, .14);
  min-height: 52px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.login-panel button::before {
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, .45), transparent);
  content: "";
  height: 100%;
  left: -90%;
  position: absolute;
  top: 0;
  transform: skewX(-18deg);
  transition: left .44s ease;
  width: 54%;
}

.login-panel button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.login-panel button:hover::before,
.login-panel:focus-within button::before {
  left: 128%;
}

.login-footnote {
  color: #8fa5bd;
  font-size: 12px;
  text-align: center;
}

.error {
  background: rgba(254, 226, 226, .96);
  border-radius: 8px;
  color: #9b1c1c;
  padding: 10px 12px;
  position: relative;
  z-index: 1;
}

@keyframes scan-sweep {
  from {
    transform: translateX(-18%);
  }
  to {
    transform: translateX(18%);
  }
}

@keyframes aurora-shift {
  from {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(2%, 1%, 0) scale(1.04);
  }
}

@keyframes grid-drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 64px 64px;
  }
}

@keyframes orbit-pulse {
  from {
    opacity: .34;
  }
  to {
    opacity: .72;
  }
}

@keyframes panel-line {
  from {
    transform: translateX(-28%);
  }
  to {
    transform: translateX(28%);
  }
}

@keyframes wave-flow {
  from {
    transform: translateX(-4%) skewY(-8deg);
  }
  to {
    transform: translateX(5%) skewY(-8deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-body::before,
  .login-body::after,
  .login-grid,
  .login-orbit,
  .login-wave,
  .login-panel::before {
    animation: none;
  }

  .login-cursor {
    display: none;
  }

  .login-panel,
  .login-hero {
    transform: none !important;
  }
}

@media (max-width: 1120px) {
  .voice-layout,
  .image-layout,
  .studio-grid {
    grid-template-columns: 1fr;
  }

  .mini-tasks,
  .image-preview-panel {
    position: static;
  }

  .image-options,
  .controls-grid,
  .assist-card-grid,
  .image-mode-selector .assist-card-grid,
  .compact-history-grid,
  .admin-metrics,
  .settings-metrics,
  .admin-guide-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

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

  .source-image-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .login-stage {
    grid-template-columns: 1fr;
  }

  .login-hero {
    max-width: 760px;
  }
}

@media (max-width: 640px) {
  .login-body {
    min-height: 100vh;
    overflow: auto;
  }

  .login-stage {
    padding: 24px;
  }

  .login-hero h1 {
    font-size: 38px;
  }

  .login-panel {
    padding: 24px;
  }

  .app-body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    height: auto;
    overflow: visible;
    position: static;
    width: auto;
  }

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

  .workspace {
    height: auto;
    margin-left: 0;
    overflow: visible;
  }

  .workspace-header {
    align-items: flex-start;
    display: grid;
    gap: 14px;
  }

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

  .image-options,
  .source-image-box,
  .settings-help-grid,
  .controls-grid,
  .admin-metrics,
  .settings-metrics,
  .admin-guide-grid,
  .compact-controls,
  .studio-grid,
  .assist-card-grid,
  .image-mode-selector .assist-card-grid,
  .compact-history-grid,
  .script-coach {
    grid-template-columns: 1fr;
  }

  .admin-hero-panel,
  .settings-hero-panel {
    align-items: stretch;
    display: grid;
  }

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

  .submit-flow {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .flow-line {
    height: 12px;
    justify-self: center;
    min-width: 1px;
    width: 1px;
  }

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

  .mini-task-actions,
  .mini-task .task-action {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .task-tracker {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

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

.spanish-layout {
  align-items: start;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
}

.spanish-command-card textarea {
  min-height: 220px;
}

.spanish-memory-panel {
  position: sticky;
  top: 24px;
}

.memory-rule-list,
.learning-card-list {
  display: grid;
  gap: 12px;
}

.memory-rule-item,
.learning-card {
  background: #f8fbff;
  border: 1px solid #dce5f0;
  border-radius: 16px;
  padding: 16px;
}

.memory-rule-item strong,
.learning-card h3 {
  color: #0f172a;
  display: block;
  margin-bottom: 6px;
}

.memory-rule-item p,
.learning-card p {
  color: #475569;
  line-height: 1.7;
  margin: 0;
}

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

.spanish-report-grid article {
  background: #f8fbff;
  border: 1px solid #dce5f0;
  border-radius: 16px;
  padding: 18px;
}

.spanish-report-grid article span {
  align-items: center;
  background: #2563eb;
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 26px;
  justify-content: center;
  margin-bottom: 10px;
  width: 26px;
}

.spanish-report-grid h3 {
  margin: 0 0 8px;
}

.spanish-report-grid p {
  color: #334155;
  line-height: 1.8;
  white-space: pre-wrap;
}

.final-translation {
  grid-column: 1 / -1;
}

.feedback-form {
  border-top: 1px solid #e2e8f0;
  margin-top: 18px;
  padding-top: 18px;
}

.feedback-form textarea {
  min-height: 120px;
}

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

.learning-card dl {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
}

.learning-card dt {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.learning-card dd {
  color: #1e293b;
  margin: 0;
}

.learning-actions {
  display: grid;
  gap: 8px;
}

.danger-button {
  background: #dc2626;
}

@media (max-width: 980px) {
  .spanish-layout,
  .spanish-report-grid,
  .learning-card {
    grid-template-columns: 1fr;
  }

  .spanish-memory-panel {
    position: static;
  }
}

.chat-workbench {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  height: calc(100vh - 220px);
  max-height: calc(100vh - 220px);
  min-height: 0;
  overflow: hidden;
}

.chat-rail,
.chat-canvas,
.chat-context {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.chat-rail {
  align-content: start;
  display: grid;
  gap: 14px;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 16px;
}

.chat-rail-head,
.chat-toolbar,
.chat-toolbar-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.chat-rail-head,
.chat-toolbar {
  justify-content: space-between;
}

.chat-rail-head h2,
.chat-toolbar h2,
.chat-context h2 {
  margin: 2px 0 0;
}

.icon-action {
  align-items: center;
  aspect-ratio: 1;
  border-radius: 8px;
  display: inline-flex;
  font-size: 22px;
  height: 40px;
  justify-content: center;
  padding: 0;
}

.compact-button {
  padding: 8px 12px;
}

.chat-rail-search {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #dce4ee;
  border-radius: 8px;
  color: #64748b;
  display: flex;
  gap: 8px;
  padding: 9px 10px;
}

.chat-rail-search input {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #64748b;
  min-height: auto;
  padding: 0;
}

.conversation-list {
  align-content: start;
  display: grid;
  gap: 8px;
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.conversation-list.compact {
  gap: 6px;
}

.conversation-link {
  background: #f8fafc;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #1f2937;
  display: grid;
  gap: 5px;
  padding: 12px;
  position: relative;
  text-decoration: none;
}

.conversation-link::before {
  background: #1d4ed8;
  border-radius: 999px;
  content: "";
  height: 56%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 22%;
  width: 3px;
}

.conversation-link:hover,
.conversation-link.active {
  background: #eef5ff;
  border-color: #bed6ff;
  color: #0b65d8;
}

.conversation-link.active::before {
  opacity: 1;
}

.conversation-title {
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-meta {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.rail-empty {
  background: #f8fafc;
  border: 1px dashed #cbd6e3;
  border-radius: 8px;
  color: #64748b;
  display: grid;
  gap: 6px;
  padding: 16px;
}

.rail-empty strong {
  color: #1f2937;
}

.chat-canvas {
  display: grid;
  gap: 14px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  padding: 16px;
}

.chat-canvas.has-config-banner {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.danger-link {
  background: #fff1f1;
  border: 1px solid #ffcaca;
  color: #b42318;
  padding: 9px 12px;
}

.chat-config-banner {
  background: #fff8ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #92400e;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.chat-config-banner span {
  font-size: 13px;
  line-height: 1.6;
}

.chat-message-list {
  background:
    radial-gradient(circle at 18% 12%, rgba(59, 130, 246, .10), transparent 30%),
    linear-gradient(180deg, rgba(248, 250, 252, .92), rgba(241, 245, 249, .82));
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  scroll-padding-bottom: 24px;
}

.chat-message-list.refined {
  align-content: start;
}

.chat-message {
  display: flex;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.assistant {
  justify-content: flex-start;
}

.chat-bubble {
  background: #fff;
  border: 1px solid #dde5ef;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
  max-width: min(820px, 88%);
  padding: 14px 16px;
}

.chat-message.assistant .chat-bubble {
  border-left: 3px solid #2563eb;
}

.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, #0b65d8, #2563eb);
  border-color: #0b65d8;
  color: #fff;
  max-width: min(700px, 78%);
}

.chat-message-meta {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.chat-message-meta strong {
  font-size: 13px;
}

.chat-message-meta span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.chat-message.user .chat-message-meta span {
  color: rgba(255, 255, 255, .78);
}

.chat-message-content {
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-message.streaming .chat-bubble {
  border-color: rgba(37, 99, 235, .32);
  box-shadow: 0 14px 34px rgba(37, 99, 235, .10);
}

.chat-message.streaming .chat-message-content::after {
  animation: chatPulse 1s infinite;
  color: #2563eb;
  content: "  ●";
}

@keyframes chatPulse {
  0%, 100% { opacity: .25; }
  50% { opacity: 1; }
}

.chat-error {
  background: #fff5f5;
  border: 1px solid #ffd0d0;
  border-radius: 8px;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  margin: 10px 0 0;
  padding: 8px;
}

.chat-command-bar {
  background: #fff;
  border: 1px solid #dce4ee;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.sticky-composer {
  align-self: end;
  position: relative;
  z-index: 3;
}

.chat-prompt-row,
.context-actions,
.chat-starter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-prompt-row {
  align-items: center;
}

.chat-prompt-row span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.chat-starter-label {
  color: #64748b;
  flex-basis: 100%;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.chat-prompt-row button,
.context-actions button,
.chat-starter {
  background: #f8fafc;
  border: 1px solid #dce4ee;
  color: #334155;
  font-size: 13px;
  padding: 8px 10px;
}

.chat-prompt-row button:hover,
.context-actions button:hover,
.chat-starter:hover {
  background: #eef5ff;
  border-color: #93c5fd;
  color: #0b65d8;
}

.chat-composer {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 96px;
}

.chat-composer textarea {
  border-color: #cbd5e1;
  min-height: 92px;
  resize: vertical;
}

.chat-composer button {
  height: 52px;
}

.chat-composer button:disabled {
  cursor: wait;
  opacity: .68;
}

.chat-empty {
  align-self: center;
  background: rgba(255, 255, 255, .92);
  border: 1px dashed #cbd6e3;
  border-radius: 8px;
  justify-self: center;
  max-width: 640px;
  padding: 28px;
  text-align: center;
}

.chat-empty h2 {
  margin: 4px 0 8px;
}

.chat-empty.standalone {
  margin: auto;
}

.refined-empty {
  box-shadow: 0 18px 42px rgba(15, 23, 42, .06);
}

.chat-empty .chat-starter-grid {
  justify-content: center;
  margin: 18px 0;
}

.chat-context {
  align-content: start;
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 16px;
}

.chat-utility-popover {
  display: none;
  position: relative;
}

.chat-utility-popover summary {
  background: #f8fafc;
  border: 1px solid #dce4ee;
  border-radius: 8px;
  color: #344054;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  list-style: none;
  padding: 9px 12px;
}

.chat-utility-popover summary::-webkit-details-marker {
  display: none;
}

.chat-utility-menu {
  background: #fff;
  border: 1px solid #dce4ee;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .14);
  display: grid;
  gap: 14px;
  min-width: 320px;
  padding: 14px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
}

.chat-utility-menu h3 {
  margin: 2px 0 0;
}

.chat-context section {
  border-bottom: 1px solid #e4e9f0;
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
}

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

.context-status {
  background: #f8fafc;
  border: 1px solid #dce4ee;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.context-status.online {
  background: #eefdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.context-status span {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.chat-tip-list {
  color: #475569;
  display: grid;
  gap: 9px;
  line-height: 1.65;
  margin: 0;
  padding-left: 18px;
}

.context-actions {
  display: grid;
}

.video-studio-grid {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) 380px;
}

.video-command-card {
  overflow: hidden;
}

.video-material-workflow {
  background:
    radial-gradient(circle at 12% 12%, rgba(37, 99, 235, .12), transparent 30%),
    linear-gradient(135deg, #f8fbff, #ffffff);
  border: 1px solid #d9e4f2;
  border-radius: 20px;
  display: grid;
  gap: 18px;
  margin: 18px 0;
  padding: 18px;
}

.video-workflow-copy h3,
.video-material-plan-card h3 {
  color: #0f172a;
  font-size: 22px;
  line-height: 1.25;
  margin: 4px 0 8px;
}

.video-workflow-copy p,
.video-material-plan-head p {
  color: #475569;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.65;
  margin: 0;
}

.video-step-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-step-row p {
  background: rgba(255, 255, 255, .9);
  border: 1px solid #dbeafe;
  border-radius: 16px;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 13px;
}

.video-step-row strong {
  align-items: center;
  background: #2563eb;
  border-radius: 10px;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 950;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.video-step-row span {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.video-step-row small {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.video-material-plan-form {
  display: grid;
  gap: 14px;
}

.video-material-plan-form label {
  display: grid;
  gap: 8px;
}

.video-material-plan-form label span {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.video-material-plan-form textarea {
  min-height: 94px;
}

.video-material-plan-card {
  background: #fff;
  border: 1px solid #d9e4f2;
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .06);
  display: grid;
  gap: 16px;
  margin: 18px 0;
  padding: 18px;
}

.video-material-plan-head {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

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

.video-material-slots p {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 13px;
}

.video-material-slots strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.video-material-slots span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

.video-material-slots small {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.video-story-arc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-story-arc span {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
}

.video-task-form {
  gap: 16px;
}

.video-form-intro {
  background:
    radial-gradient(circle at 8% 20%, rgba(37, 99, 235, 0.18), transparent 30%),
    linear-gradient(135deg, #0f172a, #1e3a8a);
  border-radius: 18px;
  color: #dbeafe;
  display: grid;
  gap: 6px;
  padding: 16px 18px;
}

.video-form-intro span {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.video-form-intro strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.35;
}

.video-form-intro small {
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
}

.video-upload-summary,
.video-submit-warning,
.video-submit-feedback {
  border-radius: 12px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
  margin: 0;
}

.video-upload-summary {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
}

.video-upload-summary.warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.video-submit-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 12px 14px;
}

.video-submit-feedback {
  color: #2563eb;
  min-height: 20px;
}

.video-form-section {
  background: #fbfdff;
  border: 1px solid #dfe8f3;
  border-radius: 18px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.video-form-section.primary {
  background:
    linear-gradient(135deg, rgba(239, 246, 255, .96), rgba(255, 255, 255, .96));
  grid-template-columns: minmax(0, 1fr) 220px;
}

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

.field-title-line span {
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
}

.field-title-line em {
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  color: #0369a1;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  padding: 5px 9px;
  white-space: nowrap;
}

.video-form-section label small {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.video-title-preview {
  align-self: stretch;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, .96), rgba(37, 99, 235, .86));
  border-radius: 16px;
  color: #dbeafe;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.video-title-preview span {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 900;
}

.video-title-preview strong {
  align-self: center;
  color: #fff;
  font-size: 18px;
  line-height: 1.35;
}

.video-script-field {
  min-height: 190px;
}

.video-brief-field {
  min-height: 104px;
}

.video-options-section {
  grid-template-columns: minmax(0, 0.78fr) minmax(320px, 1.22fr);
}

.video-options-section .controls-grid {
  grid-template-columns: 1fr;
}

.video-upload-card {
  border: 1px dashed #b8c7dc;
  border-radius: 18px;
  display: grid;
  gap: 10px;
  padding: 18px;
}

.video-preview-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.82));
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 22px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
  color: #eff6ff;
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
  overflow: hidden;
  padding: 18px;
}

.video-preview-card p {
  color: rgba(226, 232, 240, 0.78);
  margin: 4px 0 0;
}

.video-progress-panel {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 14px;
}

.video-progress-summary {
  align-items: center;
  color: #475569;
  display: flex;
  font-size: 14px;
  justify-content: space-between;
}

.video-progress-summary strong {
  color: #2563eb;
}

.progress-meter {
  background: #e2e8f0;
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.progress-meter span {
  background: linear-gradient(90deg, #0ea5e9, #2563eb, #7c3aed);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 0.35s ease;
}

.video-progress-steps {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.video-progress-steps span {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 9px;
  text-align: center;
}

.video-progress-steps .done {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #15803d;
}

.video-progress-steps .current {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.video-progress-steps .failed {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

.video-preview-card video {
  aspect-ratio: 9 / 16;
  background: #020617;
  border-radius: 18px;
  display: block;
  max-height: 520px;
  object-fit: contain;
  width: min(100%, 320px);
}

.video-file-actions {
  align-items: flex-start;
  display: grid;
  gap: 8px;
  min-width: 150px;
}

.video-table-preview {
  aspect-ratio: 9 / 16;
  background: #020617;
  border-radius: 12px;
  display: block;
  max-height: 160px;
  object-fit: contain;
  width: 92px;
}

.video-aside {
  display: grid;
  gap: 18px;
}

.video-plan-box {
  display: grid;
  gap: 10px;
}

.video-plan-box p {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin: 0;
  padding: 10px 12px;
}

.video-plan-box span {
  color: #2563eb;
  display: inline-block;
  font-weight: 800;
  margin-right: 8px;
}

.video-quality-box {
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  display: grid;
  gap: 7px;
  padding: 12px;
}

.video-quality-box strong {
  color: #0f172a;
  font-size: 14px;
}

.video-quality-box small,
.video-quality-box span {
  color: #475569;
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
}

.video-quality-box.warning {
  background: #fff7ed;
  border-color: #fed7aa;
}

.video-quality-box.warning strong {
  color: #9a3412;
}

.video-readiness-box {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(251, 146, 60, 0.34);
  border-radius: 12px;
  display: grid;
  gap: 5px;
  grid-template-columns: 1fr auto;
  padding: 10px;
}

.video-readiness-box span {
  color: #64748b;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.video-readiness-box strong {
  color: #0f172a;
  font-size: 18px;
  text-align: right;
}

.video-readiness-box em {
  color: #f97316;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.video-readiness-box small {
  grid-column: 1 / -1;
}

.video-ai-judgment {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.video-ai-judgment strong {
  color: #0f172a;
  font-size: 14px;
}

.video-ai-judgment p {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: 72px 1fr;
  margin: 0;
}

.video-ai-judgment span {
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.video-ai-judgment em,
.video-ai-judgment small {
  color: #334155;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.video-vision-status {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(239, 246, 255, .78)),
    radial-gradient(circle at 96% 8%, rgba(37, 99, 235, .12), transparent 34%);
  border: 1px solid rgba(37, 99, 235, .24);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
  display: grid;
  gap: 10px;
  padding: 14px;
}

.video-vision-status div {
  display: grid;
  gap: 5px;
}

.video-vision-status span {
  color: #2563eb;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.video-vision-status strong {
  color: #0f172a;
  font-size: 16px;
  line-height: 1.2;
}

.video-vision-status p {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.video-vision-status em,
.video-vision-status small {
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.video-vision-status p em {
  background: rgba(37, 99, 235, .10);
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 999px;
  color: #1d4ed8;
  padding: 6px 10px;
}

.video-vision-status code {
  background: rgba(15, 23, 42, .06);
  border: 1px solid rgba(100, 116, 139, .18);
  border-radius: 10px;
  color: #475569;
  display: block;
  font-size: 11px;
  line-height: 1.5;
  max-height: 92px;
  overflow: auto;
  padding: 9px 10px;
  white-space: pre-wrap;
}

.video-vision-status.success {
  background:
    linear-gradient(135deg, rgba(240, 253, 244, .96), rgba(236, 253, 245, .82)),
    radial-gradient(circle at 96% 8%, rgba(34, 197, 94, .16), transparent 34%);
  border-color: rgba(34, 197, 94, .28);
}

.video-vision-status.success span,
.video-vision-status.success p em {
  color: #15803d;
}

.video-vision-status.success p em {
  background: rgba(34, 197, 94, .12);
  border-color: rgba(34, 197, 94, .22);
}

.video-vision-status.model_busy,
.video-vision-status.network_error {
  background:
    linear-gradient(135deg, rgba(255, 247, 237, .96), rgba(255, 251, 235, .82)),
    radial-gradient(circle at 96% 8%, rgba(249, 115, 22, .16), transparent 34%);
  border-color: rgba(249, 115, 22, .30);
}

.video-vision-status.model_busy span,
.video-vision-status.network_error span,
.video-vision-status.model_busy p em,
.video-vision-status.network_error p em {
  color: #c2410c;
}

.video-vision-status.model_busy p em,
.video-vision-status.network_error p em {
  background: rgba(249, 115, 22, .12);
  border-color: rgba(249, 115, 22, .22);
}

.video-vision-status.config_missing,
.video-vision-status.auth_or_config_error,
.video-vision-status.model_response,
.video-vision-status.disabled {
  background:
    linear-gradient(135deg, rgba(248, 250, 252, .96), rgba(241, 245, 249, .84)),
    radial-gradient(circle at 96% 8%, rgba(100, 116, 139, .14), transparent 34%);
  border-color: rgba(100, 116, 139, .24);
}

.video-reference-decision {
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.video-reference-decision.reference_ready {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.video-reference-decision.needs_material {
  background: #fff7ed;
  border-color: #fed7aa;
}

.video-reference-decision span {
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.video-reference-decision.reference_ready span {
  color: #166534;
}

.video-reference-decision.needs_material span {
  color: #9a3412;
}

.video-reference-decision strong {
  color: #0f172a;
  font-size: 15px;
}

.video-reference-decision small,
.video-reference-decision em {
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.45;
}

.video-reference-gap,
.video-pickup-list {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  display: grid;
  gap: 7px;
  padding: 12px;
}

.video-reference-gap span,
.video-pickup-list strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.video-reference-gap small {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.video-diversity-box {
  align-items: center;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  display: grid;
  gap: 4px 10px;
  grid-template-columns: 1fr auto;
  padding: 10px 12px;
}

.video-diversity-box.warning {
  background: #fff7ed;
  border-color: #fed7aa;
}

.video-diversity-box span {
  color: #166534;
  font-size: 12px;
  font-weight: 900;
}

.video-diversity-box.warning span {
  color: #9a3412;
}

.video-diversity-box strong {
  color: #0f172a;
  font-size: 15px;
  text-align: right;
}

.video-diversity-box small {
  grid-column: 1 / -1;
}

.video-pickup-list p {
  background: #fff7ed;
  border-color: #fed7aa;
  display: grid;
  gap: 4px;
  margin: 0;
}

.video-pickup-list span {
  color: #9a3412;
  font-weight: 900;
}

.video-pickup-list small {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.video-pickup-list em {
  color: #2563eb;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.video-storyboard {
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.video-storyboard strong {
  color: #0f172a;
  font-size: 14px;
}

.video-storyboard p {
  background: rgba(255, 255, 255, 0.86);
  border-color: #dbeafe;
  display: grid;
  gap: 4px;
}

.video-storyboard small {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.video-quality-targets {
  background: #0f172a;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 14px;
  color: #e2e8f0;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.video-quality-targets strong {
  color: #ffffff;
  font-size: 14px;
}

.video-quality-targets p {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: grid;
  gap: 4px;
}

.video-quality-targets span {
  color: #f8fafc;
  font-weight: 900;
}

.video-quality-targets small {
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.video-shot-checklist {
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.video-shot-checklist strong {
  color: #0f172a;
  font-size: 14px;
}

.video-shot-checklist p {
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: grid;
  gap: 4px 8px;
  grid-template-columns: 1fr auto;
  padding: 9px 10px;
}

.video-shot-checklist p.found {
  border-color: #bbf7d0;
}

.video-shot-checklist p.missing {
  border-color: #fed7aa;
}

.video-shot-checklist p.assumed {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.video-shot-checklist em {
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
}

.video-shot-checklist p.found em {
  background: #16a34a;
}

.video-shot-checklist p.missing em {
  background: #f97316;
}

.video-shot-checklist p.assumed em {
  background: #2563eb;
}

.video-shot-checklist small {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  grid-column: 1 / -1;
  line-height: 1.45;
}

@media (max-width: 1360px) {
  .chat-workbench {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .chat-context {
    display: none;
  }

  .chat-utility-popover {
    display: block;
  }
}

@media (max-width: 980px) {
  .chat-workbench {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .chat-rail,
  .chat-canvas {
    height: auto;
    overflow: visible;
  }

  .conversation-list {
    max-height: none;
  }

  .chat-message-list {
    min-height: 360px;
  }

  .chat-bubble,
  .chat-message.user .chat-bubble {
    max-width: 94%;
  }

  .chat-utility-menu {
    left: 0;
    min-width: min(320px, calc(100vw - 64px));
    right: auto;
  }
}

@media (max-width: 680px) {
  .chat-toolbar,
  .chat-toolbar-actions,
  .chat-composer {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .chat-toolbar,
  .chat-toolbar-actions {
    display: grid;
  }
}
