/* Theme Pack Builder + Theme Gallery (scoped additive styles) */
.sza-theme-builder {
  border: 1px solid #cfdbe9;
  border-radius: 12px;
  background: #fff;
  padding: 0.85rem;
}
.sza-theme-builder[hidden] { display: none !important; }
.sza-theme-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.7rem;
}
.sza-theme-toolbar button {
  border: 1px solid #cfdbe9;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 0.45rem 0.65rem;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}
.sza-theme-toolbar button:hover { background: #f8fbff; border-color: #93c5fd; }
#themeBuilderStatus { margin-left: auto; color: #475569; font-size: 0.84rem; font-weight: 600; }

.sza-theme-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 1fr);
  gap: 0.7rem;
}
.sza-theme-card {
  border: 1px solid #dbe5f0;
  border-radius: 10px;
  background: #fbfdff;
  padding: 0.6rem;
}
.sza-theme-card h3,
.sza-theme-card h4 { margin: 0 0 0.45rem; color: #0f172a; font-size: 0.92rem; }
.sza-theme-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0.6rem;
}
.sza-theme-form-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem;
  background: #fff;
}
.sza-theme-field { display: grid; gap: 0.2rem; margin-bottom: 0.35rem; }
.sza-theme-field span {
  font-size: 0.74rem; font-weight: 700; color: #334155; text-transform: uppercase; letter-spacing: 0.03em;
}
.sza-theme-field input,
.sza-theme-field select {
  border: 1px solid #dbe5f0; border-radius: 7px; padding: 0.42rem 0.5rem; font-size: 0.84rem; background: #fff; color: #0f172a;
}
.sza-theme-check { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.3rem; color: #334155; font-size: 0.84rem; font-weight: 600; }

.sza-theme-preview-stage {
  border: 1px dashed #c6d4e2;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff, #eef4fb);
  padding: 0.6rem;
  min-height: 260px;
}
.sza-theme-preview-stage .sza-theme-preview-root { border-radius: 10px; padding: 0.4rem; }

.sza-theme-export-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 0.7rem;
}
.sza-theme-export-card textarea {
  width: 100%; box-sizing: border-box; min-height: 140px; resize: vertical;
  border: 1px solid #dbe5f0; border-radius: 8px; padding: 0.55rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px; line-height: 1.45; background: #fff; color: #0f172a;
}
.sza-theme-export-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.4rem; }
.sza-theme-export-actions button {
  border: 1px solid #dbe5f0; border-radius: 7px; background: #fff; color: #0f172a; padding: 0.35rem 0.55rem; cursor: pointer; font-weight: 700; font-size: 0.78rem;
}

.sza-themes-gallery { display: grid; gap: 0.65rem; }
.sza-themes-card {
  border: 1px solid #dbe5f0; border-radius: 10px; background: #fff; padding: 0.65rem;
  display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; align-items: start;
}
.sza-themes-title { font-weight: 700; color: #0f172a; }
.sza-themes-sub { color: #64748b; font-size: 0.82rem; margin-top: 0.15rem; }
.sza-themes-preview-shell {
  margin-top: 0.5rem; border: 1px dashed #dbe5f0; border-radius: 8px; padding: 0.45rem; background: #fbfdff;
}
.sza-themes-preview-shell .sza-row { margin-top: 0.4rem; }
.sza-themes-actions { min-width: 180px; align-self: center; }

@media (max-width: 980px) {
  .sza-theme-layout { grid-template-columns: 1fr; }
  .sza-theme-form-grid { grid-template-columns: 1fr; }
  .sza-theme-export-grid { grid-template-columns: 1fr; }
  #themeBuilderStatus { margin-left: 0; width: 100%; }
  .sza-themes-card { grid-template-columns: 1fr; }
  .sza-themes-actions { min-width: 0; justify-content: flex-start; }
}
