.template-studio-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.template-studio-hero {
  background: linear-gradient(135deg, rgba(7, 193, 96, 0.1), rgba(46, 122, 246, 0.12));
  border: 1px solid rgba(7, 193, 96, 0.14);
  border-radius: 20px;
  padding: 22px 24px;
}

.template-studio-title {
  font-size: 22px;
  font-weight: 700;
  color: #172033;
}

.template-studio-sub {
  margin-top: 8px;
  color: #5f6b7a;
  font-size: 14px;
  line-height: 1.7;
}

.template-studio-capability {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.template-studio-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: #435066;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.template-studio-chip.is-ok {
  color: #107149;
  border-color: rgba(16, 113, 73, 0.24);
  background: rgba(16, 185, 129, 0.08);
}

.template-studio-chip.is-warn {
  color: #9a6700;
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(251, 191, 36, 0.14);
}

.template-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.template-studio-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

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

.template-studio-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #172033;
}

.template-studio-section-sub {
  margin-top: 4px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
}

.template-studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.template-studio-status {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #f8fafc;
  color: #475569;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
}

.template-studio-status.is-success {
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.24);
  background: rgba(13, 148, 136, 0.08);
}

.template-studio-status.is-warning {
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(251, 191, 36, 0.12);
}

.template-studio-status.is-error {
  color: #b42318;
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(254, 226, 226, 0.9);
}

.template-studio-summary {
  margin-top: 14px;
}

.template-studio-batch-center-wrap {
  margin-top: 14px;
}

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

.template-studio-summary-item {
  border-radius: 14px;
  padding: 14px;
  border: 1px solid #eef2f7;
  background: #f8fafc;
}

.template-studio-summary-label {
  font-size: 12px;
  color: #667085;
}

.template-studio-summary-value {
  margin-top: 8px;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  color: #172033;
}

.template-studio-batch-center {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.template-studio-batch-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #667085;
}

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

.template-studio-batch-column {
  border: 1px solid #edf2f7;
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
}

.template-studio-batch-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #172033;
}

.template-studio-batch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.template-studio-batch-item {
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.template-studio-batch-item.is-current {
  border-color: rgba(46, 122, 246, 0.34);
  box-shadow: 0 0 0 1px rgba(46, 122, 246, 0.08);
}

.template-studio-batch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.template-studio-batch-title {
  font-size: 13px;
  font-weight: 700;
  color: #172033;
}

.template-studio-batch-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #667085;
  line-height: 1.6;
  word-break: break-word;
}

.template-studio-batch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-studio-batch-meta span {
  font-size: 11px;
  color: #667085;
  background: #f8fafc;
  border-radius: 999px;
  padding: 4px 8px;
}

.template-studio-batch-actions {
  display: flex;
  justify-content: flex-start;
}

.template-studio-error-text {
  color: #b42318;
}

.template-studio-candidates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.template-studio-candidate-card,
.template-studio-review-card {
  border: 1px solid #e8edf5;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.template-studio-candidate-card {
  display: flex;
  flex-direction: column;
}

.template-studio-image-wrap {
  position: relative;
  background: #f1f5f9;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.template-studio-image-wrap img,
.template-studio-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.template-studio-card-body {
  padding: 14px;
}

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

.template-studio-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #172033;
}

.template-studio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #516076;
  background: #f8fafc;
}

.template-studio-pill.generated {
  color: #155eef;
  background: rgba(46, 122, 246, 0.08);
  border-color: rgba(46, 122, 246, 0.16);
}

.template-studio-pill.ready_to_import {
  color: #107149;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.18);
}

.template-studio-pill.need_manual_review {
  color: #9a6700;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(245, 158, 11, 0.22);
}

.template-studio-pill.imported {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.09);
  border-color: rgba(13, 148, 136, 0.18);
}

.template-studio-pill.conflict {
  color: #b42318;
  background: rgba(254, 226, 226, 0.9);
  border-color: rgba(239, 68, 68, 0.22);
}

.template-studio-pill.queued,
.template-studio-pill.running {
  color: #155eef;
  background: rgba(46, 122, 246, 0.08);
  border-color: rgba(46, 122, 246, 0.16);
}

.template-studio-pill.completed {
  color: #107149;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.18);
}

.template-studio-pill.failed {
  color: #b42318;
  background: rgba(254, 226, 226, 0.9);
  border-color: rgba(239, 68, 68, 0.22);
}

.template-studio-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-studio-meta span {
  font-size: 12px;
  color: #667085;
  background: #f8fafc;
  border-radius: 999px;
  padding: 4px 9px;
}

.template-studio-review-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.template-studio-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.96));
}

.template-studio-review-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.template-studio-review-title {
  font-size: 15px;
  font-weight: 700;
  color: #172033;
}

.template-studio-review-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.template-studio-review-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.template-studio-preview-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.template-studio-preview-box {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e8edf5;
  background: #f8fafc;
  aspect-ratio: 2 / 3;
}

.template-studio-preview-side .btn {
  width: 100%;
}

.template-studio-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.template-studio-fields-grid {
  display: grid;
  gap: 12px;
}

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

.template-studio-fields-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.template-studio-tagline {
  font-size: 12px;
  color: #667085;
}

.template-studio-warning-box {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  background: rgba(255, 248, 235, 0.95);
}

.template-studio-warning-title {
  font-size: 12px;
  font-weight: 700;
  color: #9a6700;
  margin-bottom: 6px;
}

.template-studio-warning-list {
  margin: 0;
  padding-left: 18px;
  color: #92400e;
  font-size: 12px;
  line-height: 1.6;
}

.template-studio-plain {
  font-size: 12px;
  color: #667085;
  line-height: 1.7;
}

.template-studio-empty {
  border: 1px dashed #cfd8e3;
  border-radius: 16px;
  padding: 28px 18px;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
}

.template-studio-empty strong {
  display: block;
  color: #172033;
  margin-bottom: 8px;
}

.template-studio-empty.compact {
  padding: 18px 14px;
}

.template-studio-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #344054;
}

.template-studio-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-studio-inline-actions .btn {
  min-width: 0;
}

.template-studio-card-foot {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-studio-muted {
  color: #98a2b3;
}

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

  .template-studio-batch-columns {
    grid-template-columns: 1fr;
  }

  .template-studio-review-body {
    grid-template-columns: 1fr;
  }

  .template-studio-preview-side .btn {
    width: auto;
  }
}

@media (max-width: 840px) {
  .template-studio-fields-grid.cols-2,
  .template-studio-fields-grid.cols-3,
  .template-studio-param-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .template-studio-hero,
  .template-studio-panel {
    padding: 16px;
  }

  .template-studio-review-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .template-studio-batch-head {
    flex-direction: column;
  }

  .template-studio-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}
