/* Workbench Công việc: Bài giảng + Marketing + Tạo video - full pane, tab, split trái/phải */
.jw {
  --jw-left: minmax(300px, 38%);
  --jw-gap: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-0, var(--bg, transparent));
  color: var(--text);
  font-family: var(--font-ui, var(--font));
}
.jw-top {
  flex: 0 0 auto;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--glass-brd, var(--hairline));
  background: var(--glass, var(--surface-1));
}
.jw-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.jw-title {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.jw-lead {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text2);
  max-width: 62ch;
  text-wrap: pretty;
}
.jw-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.jw-tabs {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  padding: 3px;
  border-radius: 11px;
  border: 1px solid var(--glass-brd, var(--hairline));
  background: var(--surface-1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.jw-tabs::-webkit-scrollbar { display: none; }
.jw-tab {
  flex: 1 1 0;
  min-width: max-content;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  background: transparent;
  color: var(--text2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.jw-tab:hover { color: var(--text); background: var(--surface-2); }
.jw-tab.on {
  color: var(--accent);
  background: var(--accent-wash-2);
  box-shadow: 0 0 0 1px var(--accent-line, var(--accent));
}
.jw-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.jw-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--jw-left) minmax(0, 1fr);
  gap: var(--jw-gap);
}

.jw-left, .jw-right {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.jw-left {
  border-right: 1px solid var(--glass-brd, var(--hairline));
  background: var(--surface-1);
}
.jw-left-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 18px;
}
.jw-right {
  background: var(--bg, transparent);
}

.jw-brief {
  margin: 0 0 14px;
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--glass-brd, var(--hairline));
  background: var(--panel, var(--surface-2));
}
.jw-brief-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.jw-brief h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}
.jw-brief p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text2);
  text-wrap: pretty;
}
.jw-brief ul {
  margin: 0 0 8px;
  padding: 0 0 0 18px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
.jw-brief .jw-ex {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text3, var(--text2));
}
.jw-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.jw-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text2);
  border: 1px solid var(--glass-brd, var(--hairline));
}

.jw-field { margin: 0 0 12px; }
.jw-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
  margin: 0 0 5px;
}
.jw-field input,
.jw-field textarea,
.jw-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--hairline, var(--glass-brd));
  background: var(--field-bg, var(--surface-0, var(--bg)));
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.jw-field textarea { min-height: 76px; resize: vertical; line-height: 1.4; }
.jw-field input:focus,
.jw-field textarea:focus,
.jw-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-line, transparent);
}
.jw-field-range input[type="range"] {
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--accent, #3b82f6);
  height: 28px;
  cursor: pointer;
}
.jw-field-range input[type="range"]:focus {
  border: 0;
  box-shadow: none;
  outline: 2px solid color-mix(in srgb, var(--accent, #3b82f6) 45%, transparent);
  outline-offset: 2px;
}
.jw-range-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 4px;
}
.jw-range-head label { margin: 0; }
.jw-range-val {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}
.jw-range-ends {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text3, var(--text2));
  margin-top: -2px;
}
.jw-type-opts {
  margin: 0 0 8px;
  padding: 10px 12px 2px;
  border-radius: 10px;
  border: 1px solid var(--glass-brd, var(--hairline));
  background: var(--surface-1, transparent);
}
.jw-subsec {
  margin: 10px 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text3, var(--text2));
}
.jw-type-opts .jw-subsec:first-child { margin-top: 0; }
.jw-feat-chips {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.jw-feat-chips li {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--glass-brd, var(--hairline));
  background: var(--surface-2, var(--surface-1));
  color: var(--text2);
  max-width: 100%;
}
.jw-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text3, var(--text2));
  line-height: 1.35;
}

.jw-om {
  margin: 4px 0 14px;
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--glass-brd, var(--hairline));
  background: var(--surface-2, var(--surface-1));
}
.jw-om .jw-brief-kicker { margin-top: 0; }
.jw-om-actions { position: static; background: none; padding-top: 0; }

.jw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(transparent, var(--surface-1) 28%);
  padding-bottom: 2px;
}
.jw-btn {
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
}
.jw-btn-primary {
  background: var(--accent);
  color: var(--accent-ink, #0b1020);
}
.jw-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.jw-btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--glass-brd, var(--hairline));
}
.jw-btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.jw-btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }

.jw-right-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-brd, var(--hairline));
}
.jw-right-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text2);
}
.jw-status {
  font-size: 12.5px;
  color: var(--text2);
  text-align: right;
  max-width: 70%;
  line-height: 1.35;
}
.jw-status.err { color: var(--danger-ink, #e25); }
.jw-status.ok { color: var(--green, #3ba56a); }

.jw-out {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 24px;
  font-size: 13.5px;
  line-height: 1.55;
}
.jw-empty {
  max-width: 36ch;
  margin: 12vh auto 0;
  text-align: center;
  color: var(--text2);
}
.jw-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 15px;
}
.jw-log {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
}
.jw-log .jw-h {
  display: block;
  margin: 14px 0 6px;
  font-family: var(--font-ui, var(--font));
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}
.jw-log .jw-step {
  display: block;
  margin: 10px 0 4px;
  font-family: var(--font-ui, var(--font));
  font-size: 12px;
  font-weight: 650;
  color: var(--text2);
}

.jw-om-adv {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text2);
}
.jw-om-adv summary {
  cursor: pointer;
  font-weight: 600;
}
.jw-om-stage {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.jw-om-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.jw-om-frame {
  width: 100%;
  min-height: 62vh;
  border: 1px solid var(--glass-brd, var(--hairline));
  border-radius: 12px;
  background: var(--surface-0, #fff);
}

.jw-field.err input,
.jw-field.err textarea,
.jw-field.err select {
  border-color: var(--danger-ink, #e25);
  box-shadow: 0 0 0 1px var(--danger-ink, #e25);
}
.jw-field.err label { color: var(--danger-ink, #e25); }
.jw-btn-primary.jw-busy {
  opacity: 0.85;
  cursor: wait;
}
.jw-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Tạo video: hai cột form ngắn + thanh bước pipeline */
.jw-video {
  --jw-left: minmax(320px, 42%);
}
.jw-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.jw-tabs-video {
  align-items: stretch;
  gap: 6px;
}
.jw-tabs-video .jw-tab-stack {
  flex: 1 1 0;
  min-width: 8.2rem;
  max-width: 13.5rem;
}
.jw-tab-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  line-height: 1.25;
}
.jw-tab-label {
  font-weight: 700;
  font-size: 13px;
}
.jw-tab-blurb {
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
  white-space: normal;
  max-width: none;
  line-height: 1.35;
}
.jw-tab.on .jw-tab-blurb { color: var(--text); opacity: 0.85; }
.jw-tab-hint {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text2);
  text-wrap: pretty;
}
.jw-tab-hint .dim { color: var(--text3, var(--text2)); opacity: 0.9; }
.jw-sec {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text3, var(--text2));
}
.jw-brief-lite h3 { margin: 0 0 6px; font-size: 17px; text-wrap: balance; }
.jw-brief-lite p { margin: 0 0 6px; line-height: 1.45; text-wrap: pretty; }
.jw-brief-lite .jw-ex { color: var(--text2); font-size: 13px; }
.jw-more {
  margin: 12px 0 4px;
  border: 1px solid var(--glass-brd, var(--hairline));
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--surface-1, transparent);
}
.jw-more > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  list-style: none;
}
.jw-more > summary::-webkit-details-marker { display: none; }
.jw-more[open] > summary { margin-bottom: 10px; }
.jw-actions-main {
  margin-top: 16px;
  position: sticky;
  bottom: 0;
  padding: 10px 0 4px;
  background: linear-gradient(180deg, transparent, var(--surface-0, var(--bg, #fff)) 28%);
}
.jw-actions-ghost { margin-top: 8px; }
.jw-hint-foot { margin-top: 8px; }
.jw-steps {
  list-style: none;
  margin: 0;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--glass-brd, var(--hairline));
  flex: 0 0 auto;
}
.jw-step-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2, transparent);
}
.jw-step-item .n {
  display: inline-flex;
  width: 1.35em;
  height: 1.35em;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-1);
  color: var(--text2);
}
.jw-step-lab { font-weight: 600; }
.jw-step-item.on {
  color: var(--text);
  background: color-mix(in srgb, var(--accent, #3b82f6) 16%, transparent);
}
.jw-step-item.on .n {
  background: var(--accent, #3b82f6);
  color: #fff;
}
.jw-step-item.done {
  color: var(--ok-ink, #1a7f37);
}
.jw-step-item.done .n {
  background: var(--ok-ink, #1a7f37);
  color: #fff;
}

@media (max-width: 900px) {
  .jw-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 46%) minmax(0, 54%);
  }
  .jw-left { border-right: 0; border-bottom: 1px solid var(--glass-brd, var(--hairline)); }
  .jw-tab { flex: 0 0 auto; }
  .jw-row2 { grid-template-columns: 1fr; }
  .jw-tab-blurb { max-width: none; }
  .jw-actions-main { position: static; background: none; }
}
