/* Product preview: a single, scannable field per card. */
#screen-details {
  padding-bottom: 120px !important;
}

#screen-details .details-top-bar,
#screen-details .details-page-heading,
#screen-details #details-form {
  width: min(100%, 620px);
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
}

#screen-details .details-top-bar {
  position: static !important;
  justify-content: flex-start;
  padding: 0 0 22px !important;
  margin-bottom: 0 !important;
  border: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
}

#screen-details .details-page-heading {
  padding: 0 !important;
  margin-bottom: 18px !important;
}

#screen-details .details-page-heading .q-title {
  font-size: clamp(25px, 4vw, 30px) !important;
  line-height: 1.15 !important;
  letter-spacing: -.7px !important;
}

#screen-details .details-page-heading .q-subtitle {
  font-size: 16px !important;
  line-height: 1.4 !important;
}

#screen-details .details-hero {
  gap: 18px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid #d8dff1;
  border-radius: 16px;
  box-shadow: none;
}

#screen-details .details-hero-thumb {
  width: 106px;
  height: 106px;
  cursor: default;
}

#screen-details .details-hero-title {
  font-size: 18px;
  line-height: 1.3;
}

#screen-details .details-fields {
  display: contents;
}

#screen-details .details-fields > .edit-section-header {
  display: none;
}

#screen-details .details-fields > .edit-row {
  display: block;
  min-height: 0;
  padding: 0;
  margin-bottom: 14px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none;
  cursor: pointer;
}

#screen-details .details-fields > .edit-row.is-readonly {
  cursor: default;
}

#screen-details .edit-field-label,
#screen-details .edit-row-label-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px;
  margin-bottom: 6px;
}

#screen-details .details-fields .edit-row-label {
  color: #13192e;
  font-size: 15px !important;
  font-weight: 700;
}

#screen-details .details-fields .edit-row > .edit-row-label {
  display: block;
  padding: 0 2px;
  margin-bottom: 6px;
}

#screen-details .details-fields .edit-row-right,
#screen-details .details-fields .edit-row-description-body {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: none !important;
  min-height: 56px;
  box-sizing: border-box;
  gap: 16px;
  padding: 12px 17px;
  border: 1px solid #d6deef;
  border-radius: 15px;
  background: #fff;
  text-align: left;
}

#screen-details .details-fields .details-field-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: #8992b2;
}

#screen-details .details-fields .edit-row-value {
  flex: 1;
  min-width: 0;
  color: #444d6e;
  font-size: 16px !important;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

#screen-details .details-fields .edit-row-value.is-empty {
  color: #929bc0;
}

#screen-details .details-fields .edit-row-arrow {
  flex: 0 0 auto;
  margin-left: auto;
  color: #8793b2;
  font-size: 24px;
}

#screen-details .details-fields .edit-row.is-multiline > div:first-child {
  margin-bottom: 6px;
}

#screen-details .details-fields .edit-row-description-body {
  line-height: 1.5;
  color: #444d6e;
}

#screen-details .details-advanced {
  margin: 4px 0 22px;
  border: 1px solid #d6deef;
  border-radius: 15px;
  background: #fff;
  overflow: hidden;
}

#screen-details .details-advanced > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 19px;
  color: #20284a;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

#screen-details .details-advanced > summary::-webkit-details-marker { display: none; }
#screen-details .details-advanced > summary span { transition: transform .2s; }
#screen-details .details-advanced[open] > summary span { transform: rotate(180deg); }

#screen-details .details-advanced > .model-selector-card,
#screen-details .details-advanced > .edit-section-card {
  margin: 0 14px 14px !important;
  box-shadow: none;
}

#details-save-wrap { display: none; }
#details-save-wrap[hidden] { display: none !important; }
body:has(#screen-details.active) #details-save-wrap:not([hidden]) { display: block; }
#details-save-wrap {
  position: fixed;
  z-index: 1002;
  left: 50%;
  bottom: 0;
  width: min(100%, 680px);
  box-sizing: border-box;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 18%);
}

#details-save-wrap .details-save-top-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  background: linear-gradient(105deg, #6340f0, #4d83f4);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 8px 22px rgba(86, 86, 234, .2);
}

#details-save-wrap .details-save-top-btn span { font-size: 28px; font-weight: 400; line-height: 0; }

.photo-refund-dialog {
  width: min(460px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 36px);
  box-sizing: border-box;
  overflow-y: auto;
  padding: 22px;
  border: 1px solid #e4e7f1;
  border-radius: 24px;
  background: #fff;
  color: #171c34;
  box-shadow: 0 24px 80px rgba(21, 21, 45, .24);
}

.photo-refund-dialog[open] {
  position: fixed;
  inset: 0;
  margin: auto;
}

.photo-refund-dialog::backdrop {
  background: rgba(22, 26, 48, .58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.photo-refund-dialog form { display: block; }
.photo-refund-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.photo-refund-eyebrow { display: block; margin-bottom: 7px; color: #6a58e8; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.photo-refund-dialog h2 { margin: 0; color: #171c34; font-size: 23px; font-weight: 800; line-height: 1.2; letter-spacing: -.4px; }
.photo-refund-close {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  margin: -4px -4px 0 0;
  border: 0;
  border-radius: 50%;
  background: #f3f4fa;
  color: #68718d;
  font: 400 25px/1 var(--font-family, inherit);
  cursor: pointer;
}
.photo-refund-dialog .photo-refund-intro { margin: 10px 0 16px; color: #6f7894; font-size: 14px; line-height: 1.5; }
.photo-refund-preview-card { position: relative; display: grid; place-items: center; min-height: 176px; overflow: hidden; border: 1px solid #e7e9f2; border-radius: 16px; background: linear-gradient(145deg, #f6f6fb, #f0f1f8); }
.photo-refund-preview-frame { position: relative; display: grid; width: 100%; min-height: 176px; box-sizing: border-box; padding: 10px; place-items: center; overflow: hidden; }
.photo-refund-preview-frame img { display: block; width: auto; height: auto; max-width: 100%; max-height: 260px; object-fit: contain; }
.photo-refund-preview-frame.image-loading::after { content: ''; position: absolute; width: 26px; height: 26px; border: 3px solid #d8d5fb; border-top-color: #6654f1; border-radius: 50%; animation: refund-image-spin .75s linear infinite; }
.photo-refund-preview-fallback { display: none; color: #858da6; font-size: 13px; }
.photo-refund-preview-frame.image-error .photo-refund-preview-fallback { display: block; }
.photo-refund-preview-frame.image-error img { display: none; }
.photo-refund-side { position: absolute; right: 10px; bottom: 10px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.7); border-radius: 999px; background: rgba(255,255,255,.9); color: #4e5876; font-size: 11px; font-weight: 800; box-shadow: 0 2px 8px rgba(20,25,50,.08); }
.photo-refund-reason-label { display: block; margin: 16px 0 7px; color: #272d47; font-size: 13px; font-weight: 800; }
.photo-refund-dialog textarea { display: block; width: 100%; min-height: 112px; box-sizing: border-box; resize: vertical; padding: 13px 14px; border: 1px solid #dce1ef; border-radius: 13px; outline: none; background: #fff; color: #232943; font: 400 16px/1.45 var(--font-family, inherit); }
.photo-refund-dialog textarea::placeholder { color: #9299ad; }
.photo-refund-dialog textarea:focus { border-color: #7563f0; box-shadow: 0 0 0 3px rgba(102,84,241,.12); }
.photo-refund-dialog .photo-refund-hint { margin: 6px 0 18px; color: #858da6; font-size: 11px; }
.photo-refund-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.photo-refund-dialog-actions button { min-height: 46px; padding: 0 17px; border: 0; border-radius: 12px; font: 700 14px/1 var(--font-family, inherit); cursor: pointer; }
.photo-refund-dialog-actions #photo-refund-cancel { background: #f0f1f7; color: #5f6884; }
.photo-refund-dialog-actions #photo-refund-submit { background: linear-gradient(105deg, #6340f0, #4d83f4); color: #fff; box-shadow: 0 5px 14px rgba(86,86,234,.2); }
.photo-refund-dialog-actions button:disabled { opacity: .58; cursor: wait; }
@keyframes refund-image-spin { to { transform: rotate(360deg); } }

.photo-regeneration-choice-dialog { position: relative; }
.photo-regeneration-choice-dialog .generation-choice-close { position: absolute; top: 12px; right: 14px; }
.photo-regeneration-choice-options { display: grid; gap: 9px; }
.photo-regeneration-choice-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 16px;
  border: 1px solid #d6deef;
  border-radius: 12px;
  background: #fff;
  color: #20284a;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.photo-regeneration-choice-options button span { color: #7d87a5; font-size: 12px; font-weight: 400; }
.photo-regeneration-choice-options button:hover { border-color: #6654f1; background: #f7f5ff; }
.photo-regeneration-choice-cancel { display: block; margin: 16px auto 0; padding: 7px 14px; border: 0; background: transparent; color: #66708e; cursor: pointer; }

@media (min-width: 1024px) {
  #screen-details .details-top-bar,
  #screen-details .details-page-heading,
  #screen-details #details-form { width: min(100%, 1080px); }

  #screen-details #details-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    column-gap: 20px;
  }

  #screen-details #details-form > .details-hero,
  #screen-details #details-form > .details-missing-summary,
  #screen-details #details-form > .details-advanced,
  #screen-details #edit-row-seo-desc { grid-column: 1 / -1; }

  #details-save-wrap {
    left: calc(50% + var(--desktop-sidebar-width, 186px) / 2);
    width: min(1080px, calc(100% - var(--desktop-sidebar-width, 186px) - 48px));
  }
}

@media (max-width: 1023px) {
  #screen-details .details-top-bar,
  #screen-details .details-page-heading,
  #screen-details #details-form { width: min(100%, 620px); }
  body:has(#screen-details.active) #bottom-bar-main { display: none !important; }
  #screen-details.active { height: 100dvh !important; overflow-y: auto; }
}

@media (max-width: 600px) {
  #screen-details { padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 112px !important; }
  #screen-details .details-hero-thumb { width: 88px; height: 88px; }
  #screen-details .details-hero-title { font-size: 16px; }
  #screen-details .details-fields .edit-row-value { font-size: 15px !important; }
  .photo-refund-dialog { width: calc(100vw - 28px); max-width: calc(100vw - 28px); padding: 19px; border-radius: 22px; }
  .photo-refund-dialog h2 { font-size: 21px; }
  .photo-refund-dialog .photo-refund-intro { font-size: 13px; }
  .photo-refund-preview-card, .photo-refund-preview-frame { min-height: 166px; height: auto; }
  .photo-refund-preview-frame img { max-height: 210px; }
  .photo-refund-dialog-actions { display: grid; grid-template-columns: 1fr 1.35fr; }
  .photo-refund-dialog-actions button { min-height: 48px; padding-inline: 10px; }
}
