/* ============ AJOSSI — AI Headshot Studio ============ */

.hs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hs-content {
  display: block;
  overflow-y: auto;
}

.hs-card {
  height: auto;
  overflow: visible;
  margin-bottom: 24px;
  max-width: 1080px;
}
.hs-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hs-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.hs-section-title .hs-desc { margin-bottom: 0; }
.hs-auto-badge {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--olive) 12%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--olive) 32%, var(--line));
  color: var(--olive);
  font-size: 11px;
  font-weight: 700;
}
.hs-desc {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 8px 0 16px;
}
.hs-badge {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--coral) 14%, transparent);
  color: var(--coral-deep);
  border: 1px solid color-mix(in srgb, var(--coral) 40%, transparent);
}
.hs-badge-green {
  background: color-mix(in srgb, var(--olive) 14%, transparent);
  color: var(--olive);
  border-color: color-mix(in srgb, var(--olive) 40%, transparent);
}

/* Locked step */
.hs-locked {
  opacity: 0.55;
  pointer-events: none;
  filter: saturate(0.6);
  transition: opacity 0.4s, filter 0.4s;
}

/* API bar */
.hs-api-bar {
  background: var(--cream-card);
  border-bottom: 1px solid var(--line);
  padding: 16px 32px;
}
.hs-api-inner label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.hs-api-note {
  font-weight: 500;
  color: var(--muted);
}
.hs-api-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.hs-api-row input {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
}
.hs-api-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--coral-deep);
}

/* Stepper */
.hs-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  max-width: 1080px;
}
.hs-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.hs-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 13px;
  background: var(--paper);
  transition: 0.3s;
}
.hs-step.active { color: var(--ink); }
.hs-step.active .hs-step-num {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.hs-step.done .hs-step-num {
  background: var(--olive);
  color: #fff;
  border-color: var(--olive);
}
.hs-step-line {
  flex: 1;
  height: 1.5px;
  background: var(--line);
}

/* Dropzone */
.hs-dropzone {
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: var(--paper);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  position: relative;
}
.hs-dropzone:hover, .hs-dropzone.dragover {
  border-color: var(--coral);
  background: color-mix(in srgb, var(--coral) 5%, var(--paper));
}
.hs-drop-inner { color: var(--ink-soft); font-size: 14px; }
.hs-drop-inner svg { color: var(--coral); margin-bottom: 8px; }
.hs-drop-inner span { font-size: 12px; color: var(--muted); }
.hs-dropzone-sm { padding: 16px; }
.hs-pg-preview {
  max-height: 180px;
  max-width: 100%;
  border-radius: 12px;
  margin-top: 8px;
}

/* Thumbnails */
.hs-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.hs-thumb {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.hs-thumb.primary {
  border: 3px solid var(--coral-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 18%, transparent);
}
.hs-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hs-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.hs-thumb-remove:hover { background: var(--coral-deep); }
.hs-thumb-primary {
  position: absolute;
  left: 5px;
  bottom: 5px;
  max-width: calc(100% - 10px);
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(24, 22, 18, 0.78);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  pointer-events: none;
}
.hs-thumb.primary .hs-thumb-primary {
  background: var(--coral-deep);
}

/* Progress */
.hs-train-progress, .hs-gen-progress { margin-top: 18px; }
.hs-progress-bar {
  height: 10px;
  border-radius: 100px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.hs-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--coral), var(--coral-deep));
  transition: width 0.4s ease;
}
.hs-train-status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* Identity profile */
.hs-profile {
  margin-top: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--olive);
  border-radius: 12px;
  padding: 16px;
}
.hs-profile-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--olive);
  margin-bottom: 6px;
}
.hs-profile p {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* Simple settings */
.hs-simple-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.hs-select-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.hs-select-field > span,
.hs-count-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}
.hs-select-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: 600 14px/1 var(--sans);
  cursor: pointer;
  appearance: auto;
}
.hs-count-chip {
  min-width: 94px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.2;
}
.hs-count-chip b { font-size: 13px; }
.hs-count-chip small {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.72;
}
.hs-time-estimate {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--coral) 30%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--coral) 6%, var(--paper));
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 3px 14px;
}
.hs-time-estimate span {
  font-size: 12px;
  color: var(--ink-soft);
}
.hs-time-estimate strong {
  color: var(--coral-deep);
  font-size: 17px;
}
.hs-time-estimate small {
  grid-column: 1 / -1;
  font-size: 10.5px;
  color: var(--muted);
}

/* Generate actions */
.hs-gen-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.hs-primary-action {
  min-height: 52px;
  padding-inline: 26px;
  font-size: 15px;
}
.hs-runtime-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.hs-runtime-grid > div {
  min-width: 0;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hs-runtime-grid span {
  font-size: 10.5px;
  color: var(--muted);
}
.hs-runtime-grid strong {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.35;
}

/* Gallery */
.hs-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.hs-cell {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.hs-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.hs-cell-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-size: 10.5px;
  line-height: 1.3;
  padding: 6px 8px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  pointer-events: none;
}
.hs-cell-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  padding: 8px;
}
.hs-cell.error { border-color: #ef4444; }
.hs-cell .hs-retry {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
}
.hs-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--line);
  border-right-color: var(--coral);
  border-radius: 50%;
  animation: hs-spin 0.8s linear infinite;
}
@keyframes hs-spin { to { transform: rotate(360deg); } }

/* Playground */
.hs-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.hs-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--sans);
}
.hs-tab.active {
  color: var(--coral-deep);
  border-bottom-color: var(--coral);
}
.hs-tab-panel textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-family: var(--sans);
  resize: vertical;
}
.hs-pg-result {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.hs-pg-result img {
  max-width: 340px;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
}
.hs-pg-status {
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Lightbox */
.hs-lightbox[hidden] { display: none; }
.hs-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
}
.hs-lightbox img {
  max-width: min(90vw, 640px);
  max-height: 72vh;
  border-radius: 16px;
}
.hs-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

@media (max-width: 960px) {
  .hs-api-bar { padding: 14px 20px; }
  .hs-stepper { flex-wrap: wrap; }
  .hs-step-label { font-size: 12px; }
  .hs-gallery { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .hs-runtime-grid { grid-template-columns: 1fr; }
  .hs-simple-settings { grid-template-columns: 1fr; }
  .hs-section-title { flex-direction: column; }
  .hs-auto-badge { align-self: flex-start; }
}

@media (max-width: 560px) {
  .hs-card { margin-bottom: 14px; }
  .hs-dropzone { padding: 22px 14px; }
  .hs-thumbs { gap: 8px; }
  .hs-thumb { width: 78px; height: 78px; }
  #countGroup {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }
  .hs-count-chip {
    min-width: 0;
    width: 100%;
    align-items: center;
    padding-inline: 7px;
  }
  .hs-time-estimate {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .hs-time-estimate small { grid-column: auto; }
  .hs-gen-actions { display: grid; }
  .hs-primary-action { width: 100%; }
}
