.workflow-panel {
  overflow: hidden;
}

.ops-drawer summary,
.workflow-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.ops-drawer summary::-webkit-details-marker,
.workflow-panel summary::-webkit-details-marker {
  display: none;
}

.ops-drawer summary::after,
.workflow-panel summary::after {
  content: "+";
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-weight: 900;
}

.ops-drawer[open] summary::after,
.workflow-panel[open] summary::after {
  content: "-";
}

.workflow-panel summary strong {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
}

.workflow-panel summary small {
  color: var(--muted);
  font-weight: 800;
}

.workflow-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.workflow-actions,
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.editor-toolbar {
  justify-content: flex-start;
  margin-top: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.editor-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

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

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

.command-card {
  min-height: 118px;
}

.command-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.command-card strong {
  display: block;
  margin: 8px 0;
  font-size: 18px;
}

.operator-action {
  display: grid;
  min-height: 132px;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 28px rgba(32, 34, 37, 0.05);
}

.operator-action.primary-action {
  border-color: rgba(31, 122, 90, 0.42);
  background: #f0f8f4;
}

.operator-action span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.operator-action strong {
  font-size: 18px;
}

.operator-action small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.editor-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.editor-step {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.editor-step.active {
  border-color: var(--green);
  background: #fff;
  color: var(--green);
}

.editor-panel {
  display: none;
}

.editor-panel.active {
  display: block;
}

.remote-library-panel {
  border-color: rgba(31, 122, 90, 0.34);
}

.ai-production-center {
  border-color: rgba(47, 95, 143, 0.34);
}

.ai-production-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.ai-metric-card {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf7;
}

.ai-metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.ai-metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.ai-production-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
  margin-top: 14px;
}

.ai-production-block {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.block-head h4 {
  margin: 0;
  font-size: 16px;
}

.block-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.ai-pipeline-list,
.ai-preset-list,
.ai-quality-gate-list,
.ai-production-history,
.ai-next-action-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ai-pipeline-step,
.ai-quality-gate,
.ai-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(36, 33, 27, 0.18);
  border-radius: 8px;
  background: #fff;
}

.ai-pipeline-step span,
.ai-quality-gate span,
.ai-history-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.ai-pipeline-step strong {
  display: block;
  margin: 4px 0;
  font-size: 26px;
  line-height: 1;
}

.ai-pipeline-step p,
.ai-quality-gate p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.ai-next-action {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border-color: rgba(31, 122, 90, 0.38);
  background: #f0f8f4;
  text-align: left;
  box-shadow: none;
}

.ai-next-action span,
.ai-preset-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ai-preset-card {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid rgba(36, 33, 27, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.ai-preset-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.ai-quality-gate {
  align-items: flex-start;
  background: #fff4ef;
}

.ai-quality-gate.passed {
  background: #f0f8f4;
}

.ai-quality-gate.passed span {
  color: var(--green);
}

.ai-quality-gate.warning span {
  color: var(--red);
}

.ai-history-item {
  display: grid;
  gap: 4px;
  justify-content: stretch;
}

.table-panel {
  overflow: auto;
  padding: 0;
}

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

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #efe3ce;
  color: #5d4027;
  font-size: 12px;
  font-weight: 900;
}

td strong,
td small {
  display: block;
}

.quiz-accent {
  display: inline-block;
  width: 10px;
  height: 34px;
  margin-right: 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  vertical-align: middle;
}

.status-badge.ready {
  background: #dff3e9;
  color: var(--green);
}

.status-badge.needsAttention {
  background: #ffe0d8;
  color: var(--red);
}

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

.remote-editor code {
  padding: 2px 5px;
  border: 1px solid rgba(36, 33, 27, 0.22);
  border-radius: 4px;
  background: rgba(244, 200, 74, 0.28);
}

.builder-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(36, 33, 27, 0.28);
}

.builder-section > button {
  margin-top: 10px;
}

.builder-section h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.builder-section p,
.advanced-json p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.quiz-builder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.quiz-result-card,
.quiz-question-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.builder-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.builder-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.question-builder-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.option-builder-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.option-builder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 8px;
}

.advanced-json {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.advanced-json summary {
  cursor: pointer;
  font-weight: 900;
}

.advanced-json textarea {
  margin-top: 12px;
}

.remote-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.remote-actions span,
.empty-text {
  color: var(--muted);
  font-weight: 800;
}

.remote-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.remote-filter-bar {
  grid-template-columns: minmax(180px, 1fr) 150px 150px auto auto auto;
  align-items: center;
  margin: 12px 0;
}

.remote-quiz-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.remote-quiz-item.selected {
  border-color: var(--green);
  background: #f0f8f4;
}

.remote-select {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
}

.remote-quiz-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.remote-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tiny-button.danger {
  border-color: var(--red);
  color: var(--red);
}

.material-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.deepseek-material-box {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #2c2a26;
  border-radius: 8px;
  background: #f1f7ee;
  box-shadow: 3px 3px 0 #2c2a26;
}

.deepseek-material-box p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.material-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.material-item p,
.material-item small {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.material-item small {
  max-width: 720px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.validation-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--red);
  font-weight: 800;
}

.validation-box:empty {
  display: none;
}

.quiz-quality-panel {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.quality-score {
  display: grid;
  align-content: center;
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff2ed;
}

.quality-score.ready {
  background: #f0f8f4;
}

.quality-score span,
.quality-score small {
  color: var(--muted);
  font-weight: 900;
}

.quality-score strong {
  display: block;
  margin: 8px 0;
  font-size: 44px;
  line-height: 1;
}

.validation-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.validation-ok {
  color: var(--green);
}

.tiny-button {
  min-height: 28px;
  padding: 0 8px;
  border-width: 1px;
  border-radius: 999px;
  background: #fff8e7;
  box-shadow: none;
  font-size: 12px;
}

.daily-card {
  padding: 18px;
}

.daily-card strong {
  display: block;
  margin: 8px 0;
  font-size: 36px;
}

.daily-card.wide {
  grid-column: 1 / -1;
}

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

.sample-list div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.content-plan-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

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

.content-track-card {
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.content-track-card span {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 8px;
  border: 1px solid rgba(36, 33, 27, 0.22);
  border-radius: 999px;
  background: #f4c84a;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.content-track-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.content-next-actions {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7e5;
}

.content-next-actions strong {
  display: block;
  margin-bottom: 8px;
}

.content-next-actions p + p {
  margin-top: 8px;
}

@media (max-width: 980px) {
  .ai-production-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ai-production-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .ai-production-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-pipeline-step {
    align-items: stretch;
    flex-direction: column;
  }
}
