html {
  font-size: 14px;
  min-height: 100%;
  position: relative;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  background: #f6f7f8;
  color: #1f2328;
  margin-bottom: 60px;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.navbar-brand {
  letter-spacing: 0;
}

.page-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 1.5rem 0;
}

.page-header h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  margin: 0;
}

.surface {
  background: #fff;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  padding: 1rem;
}

.product-form {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-field.wide {
  grid-column: span 2;
}

.form-actions {
  align-items: end;
  display: flex;
}

.detail-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
}

.upload-row,
.generate-toolbar {
  align-items: end;
  display: flex;
  gap: 0.75rem;
}

.generate-toolbar {
  justify-content: space-between;
}

.angle-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-heading h2 {
  font-size: 1.1rem;
  margin: 0;
}

.label {
  color: #5e6873;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.app-table {
  margin-bottom: 0;
}

.image-grid {
  display: grid;
  gap: 1rem;
}

.source-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.generated-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.image-card {
  border: 1px solid #d8dde3;
  border-radius: 8px;
  overflow: hidden;
}

.image-card img {
  aspect-ratio: 3 / 4;
  background: #edf0f2;
  display: block;
  object-fit: cover;
  width: 100%;
}

.image-meta {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0.75rem;
}

.image-meta.stack {
  align-items: stretch;
  display: grid;
}

.regenerate-form {
  display: grid;
  gap: 0.5rem;
}

.review-form {
  display: grid;
  gap: 0.6rem;
}

.analysis-form {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analysis-form .button-row {
  grid-column: 1 / -1;
}

.analysis-status {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.review-summary {
  background: #f5f7fa;
  border: 1px solid #d8dde3;
  border-radius: 6px;
  color: #46505a;
  font-size: 0.85rem;
  padding: 0.45rem 0.55rem;
}

.issue-grid {
  display: grid;
  gap: 0.25rem 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.issue-grid .form-check-label {
  font-size: 0.84rem;
}

.history-list {
  border-top: 1px solid #e1e5ea;
  font-size: 0.85rem;
  padding-top: 0.5rem;
}

.history-row,
.metric-row {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.metric-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-card {
  background: #fff;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  padding: 1rem;
}

.metric-card strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1.1;
}

.metric-card.compact {
  min-width: 96px;
  padding: 0.6rem 0.8rem;
}

.metric-card.compact strong {
  font-size: 1.15rem;
}

.timing-card-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.timing-card {
  background: #f8faf9;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem;
}

.timing-card strong {
  font-size: 1.4rem;
  line-height: 1.1;
}

.timing-card small {
  color: #5e6873;
  line-height: 1.35;
}

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

.plan-card {
  border: 1px solid #d8dde3;
  border-radius: 8px;
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.plan-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
}

.plan-price {
  font-size: 1.25rem;
  font-weight: 700;
}

.auth-panel {
  background: #fff;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  margin: 4rem auto;
  max-width: 480px;
  padding: 1.5rem;
}

.auth-panel h1 {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}

.auth-panel-wide {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1fr);
  max-width: 840px;
}

.auth-hero {
  background: #f8faf9;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  align-content: center;
  padding: 1rem;
}

.auth-hero h1,
.auth-login-form h2 {
  margin: 0;
}

.auth-hero p {
  color: #46505a;
  line-height: 1.5;
  margin: 0;
}

.auth-login-form {
  display: grid;
  gap: 0.9rem;
}

.auth-contact-note {
  background: #f5f7fa;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  color: #46505a;
  font-size: 0.9rem;
  line-height: 1.4;
  padding: 0.75rem;
  text-align: center;
}

.thumbnail {
  background: #edf0f2;
  border-radius: 6px;
  height: 96px;
  object-fit: cover;
  width: 72px;
}

.tag-list {
  color: #5e6873;
  font-size: 0.82rem;
}

.status-pill {
  align-items: center;
  background: #eef6f4;
  border: 1px solid #b9d8d0;
  border-radius: 999px;
  color: #176052;
  display: inline-flex;
  font-size: 0.78rem;
  gap: 0.35rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  white-space: nowrap;
}

.loading-indicator {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 0.4rem;
  min-width: 0;
}

.loading-spinner {
  animation: loading-spinner-rotation 0.75s linear infinite;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  box-sizing: border-box;
  display: inline-block;
  flex: 0 0 auto;
  height: 1em;
  opacity: 0.82;
  width: 1em;
}

.loading-state-card {
  align-items: center;
  background: #f4faf8;
  border: 1px solid #b9d8d0;
  border-radius: 8px;
  color: #176052;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem;
}

.loading-state-card small {
  color: #52636f;
  flex-basis: 100%;
  padding-left: 1.6rem;
}

.loading-image-placeholder,
.loading-image-overlay {
  align-items: center;
  background: linear-gradient(110deg, #edf1f3 20%, #f8fafb 42%, #edf1f3 64%);
  background-size: 220% 100%;
  color: #52636f;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  justify-content: center;
  text-align: center;
}

.loading-image-placeholder {
  animation: loading-placeholder-shimmer 1.8s ease-in-out infinite;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  padding: 1rem;
  width: 100%;
}

.loading-image-overlay {
  background: rgba(246, 249, 250, 0.9);
  inset: 0;
  padding: 0.75rem;
  position: absolute;
  z-index: 2;
}

.loading-image-placeholder .loading-spinner,
.loading-image-overlay .loading-spinner {
  color: #2f7e70;
  height: 2rem;
  width: 2rem;
}

[aria-busy="true"] {
  cursor: wait;
}

@keyframes loading-spinner-rotation {
  to { transform: rotate(360deg); }
}

@keyframes loading-placeholder-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner,
  .loading-image-placeholder {
    animation-duration: 2s;
  }
}

.icon {
  flex: 0 0 auto;
  fill: none;
  height: 1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 1rem;
}

.icon-button {
  align-items: center;
  display: inline-flex;
  gap: 0.4rem;
  justify-content: center;
}

.new-photo-form,
.workflow-panel {
  display: grid;
  gap: 1rem;
}

.new-photo-fields {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.new-photo-fields .form-field.full {
  grid-column: 1 / -1;
}

.shorts-start-panel {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.shorts-start-panel h2 {
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
}

.model-card-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.create-model-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.model-card {
  border: 1px solid #d8dde3;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 0.65rem;
  padding: 0.65rem;
}

.model-card:has(input:checked) {
  border-color: #2f7e70;
  box-shadow: 0 0 0 2px rgba(47, 126, 112, 0.16);
}

.model-card input {
  position: absolute;
  opacity: 0;
}

.model-card-photo {
  display: block;
  position: relative;
}

.model-card-photo img {
  aspect-ratio: 4 / 5;
  background: #edf0f2;
  border-radius: 6px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.model-card-view-hint {
  background: rgba(31, 35, 40, 0.78);
  border-radius: 999px;
  bottom: 0.5rem;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  left: 0.5rem;
  line-height: 1;
  opacity: 0;
  padding: 0.32rem 0.48rem;
  position: absolute;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.model-card:hover .model-card-view-hint,
.model-card:focus-within .model-card-view-hint {
  opacity: 1;
  transform: translateY(0);
}

.model-card-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.model-card-copy small {
  color: #5e6873;
  line-height: 1.35;
}

/* Private "My AI Models" gallery: a responsive grid of self-contained
   model cards instead of one full-width panel per model. */
.model-collection {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.model-collection-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem;
}

.model-collection-card__media .model-card-photo img,
.model-collection-card__media .loading-image-placeholder {
  width: 100%;
}

.model-collection-card__placeholder {
  align-items: center;
  aspect-ratio: 4 / 5;
  background: #f4f6f8;
  border: 1px dashed #cfd6dd;
  border-radius: 6px;
  color: #6b7682;
  display: flex;
  font-size: 0.85rem;
  justify-content: center;
  padding: 1rem;
  text-align: center;
}

.model-collection-card__head {
  align-items: flex-start;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.model-collection-card__title {
  min-width: 0;
}

.model-collection-card__actions {
  border-top: 1px solid #eceff2;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

/* Legacy multi-candidate picker nested inside a model card. */
.model-candidate-grid {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.selected-model-panel {
  display: grid;
  gap: 0.85rem;
}

.selected-model-summary {
  align-items: center;
  background: #f8faf9;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 112px minmax(0, 1fr);
  padding: 0.75rem;
}

.selected-model-photo {
  display: block;
  position: relative;
}

.selected-model-photo img {
  aspect-ratio: 3 / 4;
  background: #edf0f2;
  border-radius: 6px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.model-change-details {
  border-top: 1px solid #e1e5ea;
  padding-top: 0.75rem;
}

.model-preview-layer {
  background: #fff;
  border: 1px solid #cbd2da;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(31, 35, 40, 0.24);
  display: grid;
  gap: 0.55rem;
  left: 0;
  opacity: 0;
  padding: 0.75rem;
  pointer-events: none;
  position: fixed;
  top: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  visibility: hidden;
  width: min(340px, calc(100vw - 2rem));
  z-index: 1080;
}

.model-preview-layer.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.model-preview-layer img {
  aspect-ratio: 3 / 4;
  background: #edf0f2;
  border-radius: 6px;
  display: block;
  max-height: min(72vh, 520px);
  object-fit: contain;
  width: 100%;
}

.model-preview-copy {
  display: grid;
  gap: 0.15rem;
}

.model-preview-copy strong {
  font-size: 1rem;
  line-height: 1.2;
}

.model-preview-copy span {
  color: #5e6873;
  font-size: 0.86rem;
  line-height: 1.35;
}

.upload-preview-row,
.upload-inline,
.angle-upload-row {
  align-items: center;
  display: grid;
  gap: 0.75rem;
}

.upload-preview-row {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 180px);
}

.upload-inline {
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) auto;
}

.upload-dropzone {
  align-items: center;
  background: #f8faf9;
  border: 1px dashed #9eb6b2;
  border-radius: 8px;
  color: #334047;
  cursor: pointer;
  display: grid;
  gap: 0.25rem;
  justify-items: center;
  min-height: 150px;
  padding: 1rem;
  text-align: center;
}

.upload-dropzone.compact {
  min-height: 82px;
}

.upload-dropzone input {
  display: none;
}

.upload-dropzone small {
  color: #5e6873;
}

.upload-dropzone.is-selected {
  background: #eef6f4;
  border-color: #b9d8d0;
  border-style: solid;
  color: #176052;
}

.upload-dropzone.has-thumb .upload-dropzone-icon {
  display: none;
}

.upload-dropzone-thumb {
  border-radius: 6px;
  max-height: 120px;
  max-width: 100%;
  object-fit: contain;
}

.upload-dropzone-file {
  color: #176052;
  font-size: 0.8125rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.upload-dropzone.is-selected .upload-dropzone-file::before {
  content: "✓ ";
  font-weight: 700;
}

.upload-preview {
  aspect-ratio: 3 / 4;
  background: #edf0f2;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

.source-gallery {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.source-gallery-card {
  border: 1px solid #d8dde3;
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 0;
  overflow: hidden;
  text-decoration: none;
}

.source-gallery-card:hover {
  border-color: #9eb6b2;
  color: inherit;
}

.source-gallery-link {
  color: inherit;
  display: grid;
  text-decoration: none;
}

.source-gallery-link:hover {
  color: inherit;
}

.source-gallery-card img {
  aspect-ratio: 3 / 4;
  background: #edf0f2;
  display: block;
  object-fit: cover;
  width: 100%;
}

.source-gallery-card span {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.6rem;
}

.source-gallery-card strong {
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-gallery-card small {
  color: #5e6873;
  font-size: 0.78rem;
  line-height: 1.25;
}

.source-gallery-empty {
  align-items: center;
  background: #f8faf9;
  border: 1px dashed #d8dde3;
  border-radius: 8px;
  color: #5e6873;
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  min-height: 180px;
  padding: 1rem;
  text-align: center;
}

.source-gallery-empty img {
  max-width: 120px;
  width: 50%;
}

.source-gallery-card form {
  border-top: 1px solid #e1e5ea;
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem;
}

.source-gallery-card .source-role-form {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.required-slot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.required-slot {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 600;
  gap: 0.35rem;
  line-height: 1;
  padding: 0.35rem 0.6rem;
}

.required-slot .icon {
  height: 0.9rem;
  width: 0.9rem;
}

.required-slot.ok {
  background: #eef6f4;
  border: 1px solid #b9d8d0;
  color: #176052;
}

.required-slot.missing {
  background: #fff3db;
  border: 1px solid #f0d38a;
  color: #8a5a00;
}

.action-hint {
  align-items: center;
  background: #fff3db;
  border: 1px solid #f0d38a;
  border-radius: 8px;
  color: #8a5a00;
  display: flex;
  font-size: 0.86rem;
  gap: 0.5rem;
  line-height: 1.35;
  padding: 0.6rem 0.75rem;
}

.action-hint .icon {
  flex: 0 0 auto;
}

.btn:disabled,
.btn.disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.project-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.project-card {
  background: #fff;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.project-thumb-link {
  display: block;
}

.project-thumb {
  aspect-ratio: 4 / 5;
  background: #edf0f2;
  display: block;
  object-fit: cover;
  width: 100%;
}

.project-card-body {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
}

.project-card h2,
.empty-state h2 {
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}

.project-progress,
.project-meta {
  align-items: center;
  color: #5e6873;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.86rem;
  gap: 0.5rem;
  justify-content: space-between;
}

.empty-state {
  align-items: center;
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  text-align: center;
}

.empty-state img {
  border-radius: 8px;
  max-width: 180px;
  width: 50%;
}

.workflow-stepper {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.workflow-step {
  align-items: center;
  background: #fff;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  color: #5e6873;
  display: flex;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.65rem;
}

.workflow-step {
  flex-wrap: wrap;
}

.workflow-step span,
.step-number,
.internal-step-icon {
  align-items: center;
  background: #eef6f4;
  border: 1px solid #b9d8d0;
  border-radius: 999px;
  color: #176052;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  height: 1.55rem;
  justify-content: center;
  width: 1.55rem;
}

.internal-step-icon {
  background: #f4f6f7;
  border-color: #d8dde3;
  color: #46505a;
}

.workflow-step strong {
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.workflow-step small {
  color: #5e6873;
  flex: 1 0 100%;
  font-size: 0.74rem;
  line-height: 1.2;
  padding-left: 2rem;
}

.workflow-step.current {
  border-color: #2f7e70;
  color: #1f2328;
}

.workflow-step.done {
  background: #f5faf8;
}

a.workflow-step {
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

a.workflow-step:hover,
a.workflow-step:focus-visible {
  border-color: #2f7e70;
  box-shadow: 0 0 0 2px rgba(47, 126, 112, 0.14);
  outline: none;
}

html {
  scroll-behavior: smooth;
}

[id^="step-"] {
  scroll-margin-top: 1rem;
}

.wizard-layout {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.project-side-panel {
  position: sticky;
  top: 1rem;
}

.source-strip {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-strip img {
  aspect-ratio: 3 / 4;
  background: #edf0f2;
  border-radius: 6px;
  object-fit: cover;
  width: 100%;
}

.project-stat-list {
  border-top: 1px solid #e1e5ea;
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 1rem;
}

.project-stat-list div {
  display: grid;
  gap: 0.15rem;
}

.project-stat-list span {
  color: #5e6873;
  font-size: 0.8rem;
}

.wizard-main {
  display: grid;
  gap: 1rem;
}

.workflow-panel-header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.inner-step-header {
  border-top: 1px solid #e1e5ea;
  padding-top: 1rem;
}

.workflow-panel-header h2 {
  font-size: 1.12rem;
  margin: 0;
}

.ready-photo-note {
  background: #f8fafc;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  color: #334155;
  padding: 0.85rem 1rem;
}

.ready-photo-note.compact {
  font-size: 0.88rem;
  padding: 0.65rem 0.75rem;
}

.review-panel-header {
  border-top: 1px solid #e1e5ea;
  padding-top: 1rem;
}

.advanced-details {
  border-top: 1px solid #e1e5ea;
  padding-top: 0.75rem;
}

.advanced-details summary,
.issue-picker summary,
.history-list summary,
.admin-job-toggle summary {
  color: #46505a;
  cursor: pointer;
  font-weight: 600;
}

.admin-job-toggle summary {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.angle-work-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.angle-work-card {
  border: 1px solid #d8dde3;
  border-radius: 8px;
  overflow: hidden;
}

.angle-image-wrap {
  position: relative;
}

.angle-image-wrap img {
  aspect-ratio: 3 / 4;
  background: #edf0f2;
  display: block;
  object-fit: cover;
  width: 100%;
}

.angle-badge {
  background: rgba(31, 35, 40, 0.78);
  border-radius: 999px;
  bottom: 0.65rem;
  color: #fff;
  font-size: 0.78rem;
  left: 0.65rem;
  padding: 0.3rem 0.55rem;
  position: absolute;
}

.angle-card-body {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
}

.angle-card-title {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.angle-upload-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.video-result-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.video-result-card {
  border: 1px solid #d8dde3;
  border-radius: 8px;
  display: grid;
  gap: 0.5rem;
  justify-items: start;
  padding: 0.85rem;
}

.video-generate-panel {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.video-generate-panel .form-select {
    max-width: 24rem;
}

.video-model-select {
    display: grid;
    gap: 0.25rem;
    min-width: min(100%, 18rem);
}

.video-model-select span {
    color: #5e6873;
    font-size: 0.82rem;
    font-weight: 700;
}

.admin-beta-provider-note {
  background: #f7fafc;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  color: #4b5563;
  font-size: 0.82rem;
  line-height: 1.35;
  max-width: 28rem;
  padding: 0.6rem 0.7rem;
}

.motion-template-picker {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  min-width: min(100%, 28rem);
}

.motion-template-heading {
  color: #5e6873;
  font-size: 0.82rem;
  font-weight: 700;
  grid-column: 1 / -1;
}

.motion-template-card {
  align-items: center;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  padding: 0.55rem;
  position: relative;
}

.motion-template-card:has(input:checked) {
  border-color: #2f7e70;
  box-shadow: 0 0 0 2px rgba(47, 126, 112, 0.16);
}

.motion-template-card input {
  opacity: 0;
  position: absolute;
}

.motion-template-thumb img {
  aspect-ratio: 4 / 5;
  background: #edf0f2;
  border-radius: 6px;
  object-fit: cover;
  width: 100%;
}

.motion-template-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.motion-template-copy strong,
.motion-template-copy small,
.motion-template-strength {
  overflow-wrap: anywhere;
}

.motion-template-copy small {
  color: #5e6873;
  font-size: 0.78rem;
  line-height: 1.25;
}

.motion-template-title-row {
  align-items: flex-start;
  display: flex;
  gap: 0.35rem;
  justify-content: space-between;
}

.motion-template-badge {
  background: #e9f4f1;
  border-radius: 999px;
  color: #2f7e70;
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.28rem 0.38rem;
  text-transform: uppercase;
}

.motion-template-badge.experimental {
  background: #fff3db;
  color: #8a5a00;
}

.motion-template-strength {
  color: #2f7e70;
  font-size: 0.76rem;
  font-weight: 700;
}

.video-progress-panel {
  border: 1px solid #d8dde3;
  border-radius: 8px;
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
}

.video-progress-header,
.video-progress-metrics {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: space-between;
}

.video-progress-track {
  background: #e8edf2;
  border-radius: 999px;
  height: 0.65rem;
  overflow: hidden;
}

.video-progress-fill {
  background: #2563eb;
  height: 100%;
  min-width: 0.45rem;
}

.video-progress-metrics {
  color: #4b5563;
  font-size: 0.88rem;
}

.video-result-card video {
  aspect-ratio: 9 / 16;
  background: #edf0f2;
  border-radius: 6px;
  display: block;
  max-height: 28rem;
  object-fit: contain;
  width: 100%;
}

.video-result-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.video-review-panel {
  border-top: 1px solid #e2e7ec;
  display: grid;
  gap: 0.55rem;
  padding-top: 0.55rem;
  width: 100%;
}

.video-review-row {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  width: 100%;
}

.video-review-row label {
  display: grid;
  gap: 0.2rem;
  min-width: 10rem;
}

.video-review-row label span {
  color: #5e6873;
  font-size: 0.78rem;
  font-weight: 700;
}

.video-issue-grid {
  display: grid;
  gap: 0.35rem 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  width: 100%;
}

.video-issue-grid label {
  align-items: center;
  color: #4b5563;
  display: flex;
  font-size: 0.82rem;
  gap: 0.35rem;
}

.video-review-latest {
  color: #5e6873;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.model-skin-tone-fieldset {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.model-skin-tone-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.model-skin-tone-option {
  align-items: center;
  background: #fff;
  border: 1px solid #d8dde3;
  border-radius: 0.7rem;
  cursor: pointer;
  display: grid;
  font-size: 0.78rem;
  gap: 0.3rem;
  grid-template-columns: auto 1.7rem minmax(0, 1fr);
  padding: 0.45rem;
}

.model-skin-tone-option:has(input:checked) {
  border-color: #0d6efd;
  box-shadow: 0 0 0 2px rgb(13 110 253 / 15%);
}

.model-skin-tone-swatch {
  background: #d9aa82;
  border: 1px solid rgb(0 0 0 / 10%);
  border-radius: 50%;
  height: 1.7rem;
  width: 1.7rem;
}

.model-skin-tone-light .model-skin-tone-swatch { background: #f2d6c4; }
.model-skin-tone-light-medium .model-skin-tone-swatch { background: #ddb18f; }
.model-skin-tone-medium .model-skin-tone-swatch { background: #bd8662; }
.model-skin-tone-medium-deep .model-skin-tone-swatch { background: #936143; }
.model-skin-tone-deep .model-skin-tone-swatch { background: #67402f; }
.model-skin-tone-very-deep .model-skin-tone-swatch { background: #3f281f; }

@media (max-width: 900px) {
  .product-form,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .form-field.wide {
    grid-column: auto;
  }

  .generate-toolbar,
  .video-generate-panel,
  .upload-row {
    align-items: stretch;
    flex-direction: column;
  }

  .issue-grid {
    grid-template-columns: 1fr;
  }

  .analysis-form {
    grid-template-columns: 1fr;
  }

  .new-photo-fields,
  .upload-preview-row,
  .upload-inline,
  .wizard-layout,
  .angle-work-grid,
  .workflow-stepper {
    grid-template-columns: 1fr;
  }

  .shorts-start-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .shorts-start-panel .btn {
    width: 100%;
  }

  .project-side-panel {
    position: static;
  }

  .workflow-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .workflow-panel-header .ms-auto {
    margin-left: 0 !important;
    width: 100%;
  }

  .workflow-panel-header .ms-auto .btn {
    width: 100%;
  }

  .angle-upload-row {
    grid-template-columns: 1fr;
  }

  .selected-model-summary {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .auth-panel-wide {
    grid-template-columns: 1fr;
  }

  .model-skin-tone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
