.flgd-entry {
  padding: 18px 0;
}
.flgd-entry .button {
  min-height: 48px;
  padding: 12px 28px !important;
}
.flgd-entry .flgd-start {
  display: block;
  width: max-content;
  margin-left: auto !important;
  margin-right: auto !important;
  text-decoration: none !important;
}
.flgd-overlay {
  --accent: #d71e32;
  --ink: #17202b;
  --muted: #687281;
  --line: #e2e5ea;
  --paper: #fff;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #f2f3f5;
  color: var(--ink);
  font:
    14px/1.45 system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
  display: grid;
  grid-template-rows: 70px 1fr 60px;
}
.flgd-overlay * {
  box-sizing: border-box;
}
.flgd-overlay button,
.flgd-overlay input,
.flgd-overlay select,
.flgd-overlay textarea {
  font: inherit;
  color: inherit;
  border-radius: 8px;
  line-height: 1.35;
}
.flgd-overlay button {
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 13px;
  cursor: pointer;
  min-height: 40px;
}
.flgd-overlay button:hover {
  border-color: #9ca3af;
  background: #f6f7f9;
}
.flgd-overlay button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.flgd-overlay button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 650;
}
.flgd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.flgd-brand {
  font-weight: 800;
  letter-spacing: -0.8px;
  font-size: 20px;
}
.flgd-brand em {
  font-style: normal;
  color: var(--accent);
}
.flgd-product-title {
  font-size: 12px;
  color: var(--muted);
  max-width: 400px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.flgd-header-actions {
  display: flex;
  gap: 8px;
}
.flgd-workspace {
  display: grid;
  grid-template-columns: 280px 1fr 245px;
  min-height: 0;
}
.flgd-panel {
  background: white;
  padding: 20px;
  overflow: auto;
}
.flgd-panel.left {
  border-right: 1px solid var(--line);
}
.flgd-panel.right {
  border-left: 1px solid var(--line);
}
.flgd-panel h3 {
  font-size: 16px;
  margin: 0 0 14px;
}
.flgd-section {
  padding-bottom: 22px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.flgd-field {
  display: block;
  margin: 10px 0;
}
.flgd-field > span {
  display: block;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 5px;
}
.flgd-field input,
.flgd-field select,
.flgd-field textarea {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  background: #fff;
  min-height: 40px;
}
.flgd-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.flgd-row > * {
  flex: 1;
  min-width: 0;
}
.flgd-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
}
.flgd-overlay button.flgd-swatch {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #ccd0d6;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  flex: none;
  position: relative;
}
.flgd-swatch[aria-pressed="true"] {
  outline: 2px solid #1b222b;
  outline-offset: 3px;
}
.flgd-swatch[aria-pressed="true"]:after {
  content: "✓";
  color: white;
  text-shadow: 0 1px 4px #000;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.flgd-color-name {
  font-size: 12px;
  margin: 10px 0;
  color: var(--muted);
}
.flgd-sizes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.flgd-sizes label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
}
.flgd-sizes input {
  width: 52px;
  padding: 7px 3px;
  border: 0;
  background: #f5f6f8;
  text-align: center;
}
.flgd-canvas-work {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 14px 65px;
}
.flgd-stage {
  position: relative;
  aspect-ratio: 4/5;
  width: min(100%, calc((100dvh - 220px) * 0.8));
  background: white;
  box-shadow: 0 10px 35px #1821330c;
  flex: none;
  overflow: hidden;
}
.flgd-garment {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
  transform-origin: center;
  pointer-events: none;
}
.flgd-zone {
  position: absolute;
  border: 1px dashed #666;
  box-sizing: content-box;
  touch-action: none;
}
.flgd-zone:before {
  content: attr(data-label);
  position: absolute;
  bottom: 100%;
  left: 0;
  font-size: 9px;
  white-space: nowrap;
  background: #ffffffd9;
  padding: 2px 4px;
  color: #333;
}
.flgd-zone .canvas-container,
.flgd-zone canvas {
  width: 100% !important;
  height: 100% !important;
}
.flgd-zone.inactive {
  border-color: transparent;
  pointer-events: none;
}
.flgd-zone.inactive:before {
  display: none;
}
.flgd-rail {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 49px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  z-index: 3;
}
.flgd-overlay .flgd-thumb {
  padding: 2px;
  width: 49px;
  min-height: 60px;
  font-size: 9px;
  text-align: center;
  flex: none;
}
.flgd-thumb img {
  width: 39px;
  height: 39px;
  object-fit: contain;
  background: #f5f5f5;
}
.flgd-thumb.active {
  outline: 2px solid var(--accent);
}
.flgd-canvas-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}
.flgd-upload {
  display: block;
  border: 1px dashed #a6aeb9;
  border-radius: 9px;
  text-align: center;
  padding: 20px 8px;
  background: #f8f9fb;
  cursor: pointer;
}
.flgd-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.flgd-muted {
  color: var(--muted);
  font-size: 12px;
}
.flgd-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.flgd-tools button {
  font-size: 12px;
  padding: 7px;
}
.flgd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 10px 24px;
}
.flgd-price {
  font-size: 20px;
  font-weight: 750;
}
.flgd-status {
  font-size: 12px;
  color: #596473;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flgd-status.error {
  color: #ae1225;
}
.flgd-ppi {
  font-size: 12px;
  padding: 8px;
  border-radius: 6px;
  background: #f4f5f7;
}
.flgd-ppi.warn {
  background: #fff5df;
  color: #745000;
}
.flgd-ppi.low {
  background: #ffeadc;
  color: #8b3509;
}
.flgd-object-info {
  font-size: 12px;
  font-weight: 600;
  margin: 12px 0;
}
.flgd-layers button {
  width: 100%;
  text-align: left;
  font-size: 12px;
  margin: 3px 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.flgd-review {
  position: absolute;
  inset: 70px 0 60px;
  background: #fff;
  z-index: 5;
  overflow: auto;
  padding: 25px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: center;
}
.flgd-review-card {
  max-width: 600px;
}
.flgd-review img {
  width: 120px;
  max-height: 160px;
  object-fit: contain;
  background: #eee;
  margin: 5px;
}
.flgd-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
}
.flgd-agree input {
  flex: none;
  margin: 4px 0;
  width: 18px;
  height: 18px;
}
.flgd-overlay .flgd-tab-toggle {
  display: none;
}
.flgd-saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.flgd-saved-card {
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 10px;
}
.flgd-saved-card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: #f3f3f3;
}
.flgd-saved-card button {
  margin: 5px;
}
.flgd-processing {
  opacity: 0.65;
  pointer-events: none;
}
@media (max-width: 1050px) {
  .flgd-workspace {
    grid-template-columns: 235px 1fr 205px;
  }
  .flgd-panel {
    padding: 14px;
  }
  .flgd-header {
    padding: 10px 16px;
  }
  .flgd-header-actions button {
    font-size: 12px;
    padding: 8px;
  }
  .flgd-brand {
    font-size: 17px;
  }
}
@media (max-width: 760px) {
  .flgd-overlay {
    grid-template-rows: 62px 1fr 65px;
  }
  .flgd-header {
    padding: 8px 12px;
  }
  .flgd-product-title {
    max-width: 190px;
    font-size: 10px;
  }
  .flgd-brand {
    font-size: 17px;
  }
  .flgd-header-actions {
    gap: 4px;
  }
  .flgd-header-actions .flgd-desktop-label {
    display: none;
  }
  .flgd-workspace {
    display: flex;
    flex-direction: column;
    position: relative;
  }
  .flgd-canvas-work {
    flex: 1;
    padding: 12px 12px 95px;
  }
  .flgd-stage {
    width: min(100%, calc((100dvh - 260px) * 0.8));
  }
  .flgd-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 48px;
    max-height: 55dvh;
    z-index: 6;
    border-top: 1px solid #ddd;
    box-shadow: 0 -10px 30px #0001;
    display: none;
  }
  .flgd-workspace[data-panel="product"] .left,
  .flgd-workspace[data-panel="tools"] .right {
    display: block;
  }
  .flgd-panel .flgd-section {
    padding-bottom: 12px;
    margin-bottom: 12px;
  }
  .flgd-swatches {
    gap: 10px;
  }
  .flgd-sizes {
    grid-template-columns: repeat(3, 1fr);
  }
  .flgd-rail {
    left: 50%;
    top: auto;
    bottom: 50px;
    transform: translateX(-50%);
    flex-direction: row;
    width: auto;
    max-width: 95%;
    overflow-x: auto;
  }
  .flgd-overlay .flgd-thumb {
    min-height: 49px;
    width: 49px;
  }
  .flgd-thumb img {
    width: 30px;
    height: 30px;
  }
  .flgd-zone:before {
    font-size: 8px;
  }
  .flgd-footer {
    padding: 8px 12px;
  }
  .flgd-status {
    max-width: 35%;
    font-size: 10px;
  }
  .flgd-price {
    font-size: 17px;
  }
  .flgd-overlay .flgd-tab-toggle {
    display: flex;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 44px;
    z-index: 7;
    gap: 0;
    background: white;
    border-top: 1px solid #ddd;
  }
  .flgd-tab-toggle button {
    border: 0;
    border-radius: 0;
    flex: 1;
    font-size: 12px;
  }
  .flgd-review {
    inset: 62px 0 65px;
    padding: 16px;
    display: block;
  }
  .flgd-tools {
    grid-template-columns: repeat(3, 1fr);
  }
  .flgd-field textarea {
    min-height: 60px;
  }
}

.flgd-load-status {
  display: block;
  font: 12px system-ui;
  color: #687281;
  margin: 8px 0;
}
.flgd-overlay[aria-busy="true"] .flgd-panel,
.flgd-overlay[aria-busy="true"] .flgd-header-actions,
.flgd-overlay[aria-busy="true"] .flgd-footer button,
.flgd-overlay[aria-busy="true"] .flgd-rail,
.flgd-overlay[aria-busy="true"] .flgd-zone {
  pointer-events: none;
}
.flgd-overlay[aria-busy="true"] {
  cursor: progress;
}
.flgd-thumb span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.flgd-stage .canvas-container {
  line-height: 0;
}

.flgd-overlay button {
  word-break: normal;
  overflow-wrap: normal;
}
.flgd-header-actions {
  flex-shrink: 0;
}
.flgd-header-actions button {
  white-space: nowrap;
}
.flgd-header > div:first-child {
  min-width: 0;
}
.flgd-overlay[aria-busy="true"] .flgd-canvas-work:after {
  content: "Processing…";
  position: absolute;
  bottom: 5px;
  background: #fff;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 11px;
  color: #596473;
}
@media (max-width: 760px) {
  .flgd-brand {
    font-size: 13px;
    letter-spacing: -0.5px;
    white-space: nowrap;
  }
  .flgd-product-title {
    max-width: 155px;
  }
  .flgd-header {
    gap: 6px;
  }
  .flgd-header-actions button {
    font-size: 11px;
    padding: 7px;
    min-height: 36px;
  }
  .flgd-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 10px;
    padding: 6px 12px;
  }
  .flgd-price {
    font-size: 15px;
    white-space: nowrap;
    grid-column: 1;
    grid-row: 1;
  }
  .flgd-status {
    max-width: 100%;
    min-width: 0;
    font-size: 10px;
    grid-column: 1/-1;
    grid-row: 2;
  }
  .flgd-footer > button {
    grid-column: 2;
    grid-row: 1;
    font-size: 12px;
    white-space: nowrap;
    padding: 7px 12px;
    min-height: 34px;
  }
  .flgd-header-actions {
    gap: 4px;
  }
}

.flgd-palette {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.flgd-palette button {
  min-height: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid #ccd0d6;
  border-radius: 5px;
}
/* Isolate customer controls from storefront typography and dark input themes. */
#flgd-root .flgd-overlay {
  color: #172333;
  background: #f3f4f6;
  font-family: Arial, sans-serif;
  line-height: 1.45;
  color-scheme: light;
}
#flgd-root
  .flgd-overlay
  :is(h1, h2, h3, h4, p, label, span, legend, .flgd-field, .flgd-muted) {
  color: #243247;
  opacity: 1;
}
#flgd-root .flgd-overlay :is(input, select, textarea) {
  color: #182638 !important;
  background: #fff !important;
  -webkit-text-fill-color: #182638 !important;
  opacity: 1 !important;
  border: 1px solid #cbd2dc;
  box-shadow: none;
}
#flgd-root .flgd-overlay select {
  appearance: none !important;
  -webkit-appearance: none !important;
  padding-right: 30px !important;
  background-image: linear-gradient(45deg, transparent 50%, #526179 50%), linear-gradient(135deg, #526179 50%, transparent 50%) !important;
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50% !important;
  background-size: 6px 6px !important;
  background-repeat: no-repeat !important;
}
#flgd-root .flgd-overlay button {
  color: #172333;
  background: #fff;
  opacity: 1;
}
#flgd-root .flgd-overlay button.primary,
#flgd-root .flgd-overlay .flgd-delete {
  color: white;
  background: #cf1830;
  border-color: #cf1830;
}
#flgd-root .flgd-overlay :is(a) {
  color: #a51225;
  text-decoration: underline;
}
#flgd-root .flgd-stage,
#flgd-root .flgd-zone {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none;
  max-height: none;
  min-width: 0;
  min-height: 0;
}
#flgd-root .flgd-zone {
  border: 0;
  outline: 1px dashed #767d86;
  box-sizing: border-box;
}
#flgd-root .flgd-garment {
  max-width: none !important;
  max-height: none !important;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
#flgd-root .flgd-zone canvas {
  max-width: none !important;
  max-height: none !important;
  border: 0;
  padding: 0;
  margin: 0;
}
.flgd-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.flgd-zoom {
  position: absolute;
  right: 12px;
  bottom: 34px;
  z-index: 4;
  display: flex;
  gap: 5px;
  align-items: center;
  background: #fff;
  padding: 5px;
  border-radius: 9px;
  box-shadow: 0 2px 8px #0002;
}
.flgd-zoom input {
  width: 90px !important;
  min-height: 25px;
}
.flgd-zoom button {
  padding: 4px 8px;
  min-height: 30px;
}
.flgd-drag-size {
  position: absolute;
  left: 0;
  bottom: calc(100% + 22px);
  background: #172333;
  color: white !important;
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
.flgd-multi-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border: 1px solid #cbd2dc;
  border-radius: 8px;
}
.flgd-multi-tools strong,
.flgd-multi-tools label {
  width: 100%;
}
.flgd-resume {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: grid;
  place-items: center;
  background: #17233399 !important;
  color: #172333;
}
.flgd-resume-box {
  max-width: 440px;
  margin: 15px;
  background: white;
  padding: 24px;
  border-radius: 14px;
  box-shadow: 0 8px 40px #0003;
}
.flgd-resume-box h2 {
  color: #172333 !important;
}
.flgd-resume-box button {
  margin: 5px;
}

.flgd-resume-box button {
  color: #182638;
  background: white;
  border: 1px solid #cbd2dc;
  padding: 9px 14px;
  border-radius: 6px;
}
.flgd-resume-box button.primary {
  background: #cf1830;
  color: white;
}
/* 1.3: keep canonical garment coordinates independent of theme image rules. */
#flgd-root .flgd-stage {
  isolation: isolate;
  aspect-ratio: 4 / 5 !important;
  height: auto !important;
}
#flgd-root img.flgd-garment {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: 50% 50% !important;
  display: block !important;
}
#flgd-root .flgd-zone {
  position: absolute !important;
  transform: none;
}
#flgd-root .flgd-zone::before {
  bottom: calc(100% + 7px);
  padding: 3px 5px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 1.3;
}
#flgd-root .flgd-product-title {
  font-size: 14px;
  font-weight: 700;
  margin-top: 7px;
  padding-top: 3px;
  letter-spacing: 0;
  color: #243247;
}
#flgd-root .flgd-header {
  padding-top: 7px;
  padding-bottom: 7px;
}
#flgd-root .flgd-brand img {
  max-height: 36px !important;
  width: 100px !important;
}
#flgd-root .flgd-single-layout {
  border: 1px solid #d9dfe7;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f7f8fa;
  color: #243247;
}
#flgd-root .flgd-sleeve-toggle {
  margin: 8px 0;
  border-style: dashed;
  color: #b9192e;
  font-size: 13px;
}
#flgd-root .flgd-sleeve-options[hidden] {
  display: none !important;
}
.flgd-account-link {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  padding: 5px 8px;
}
/* Resume dialogs deliberately do not share the full editor's three-row grid. */
.flgd-resume,
.flgd-confirm-dialog,
.flgd-bg-dialog {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 1000005 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  background: rgba(19, 29, 44, 0.66) !important;
  box-sizing: border-box !important;
  color: #1e2c40 !important;
  font:
    14px/1.5 Arial,
    sans-serif !important;
  overflow: auto !important;
}
.flgd-resume .flgd-resume-box,
.flgd-dialog-card {
  position: relative !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;
  margin: auto !important;
  width: min(100%, 560px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  box-sizing: border-box;
  border-radius: 14px;
  padding: 24px;
  background: #fff;
  color: #1e2c40;
  box-shadow: 0 12px 48px #0004;
}
.flgd-resume :is(h2, p, a),
.flgd-dialog-card :is(h2, p, label, span, figcaption) {
  color: #1e2c40 !important;
  opacity: 1 !important;
}
.flgd-resume a {
  display: inline-block;
  color: #b6192c !important;
  font-weight: 700;
  text-decoration: underline;
  padding: 8px 0;
}
.flgd-dialog-card button {
  padding: 9px 14px;
  margin: 5px;
  border: 1px solid #ccd4df;
  border-radius: 7px;
  background: #fff;
  color: #1e2c40;
  cursor: pointer;
}
.flgd-dialog-card button.primary {
  background: #cf1830;
  color: #fff;
}
.flgd-bg-dialog .flgd-dialog-card {
  width: min(100%, 780px);
}
.flgd-bg-previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.flgd-bg-previews figure {
  margin: 0;
  min-width: 0;
}
.flgd-bg-previews img {
  width: 100% !important;
  height: 240px !important;
  object-fit: contain !important;
  background-color: #ddd;
  background-image:
    linear-gradient(45deg, #fff 25%, transparent 25%),
    linear-gradient(-45deg, #fff 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #fff 75%),
    linear-gradient(-45deg, transparent 75%, #fff 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
}
.flgd-bg-controls {
  display: flex;
  gap: 20px;
  align-items: center;
}
.flgd-bg-controls input[type="range"] {
  width: 150px !important;
}
.flgd-bg-controls input[type="color"] {
  width: 60px !important;
}
@media (max-width: 760px) {
  #flgd-root .flgd-account-link {
    font-size: 10px;
    max-width: 75px;
  }
  #flgd-root .flgd-brand {
    font-size: 14px;
    gap: 6px;
  }
  #flgd-root .flgd-brand img {
    width: 65px !important;
    max-height: 28px !important;
  }
  #flgd-root .flgd-product-title {
    font-size: 12px;
    margin-top: 4px;
  }
  #flgd-root .flgd-header {
    gap: 6px;
    padding: 6px 10px;
  }
  #flgd-root .flgd-header-actions {
    gap: 3px;
  }
  #flgd-root .flgd-header-actions button {
    padding: 7px;
    font-size: 12px;
  }
  .flgd-bg-previews img {
    height: 150px !important;
  }
}
.flgd-bg-controls[hidden] {
  display: none !important;
}
#flgd-root .flgd-overlay {
  grid-template-rows: 88px minmax(0, 1fr) 60px;
}
.flgd-mobile-label {
  display: none;
}
@media (max-width: 760px) {
  #flgd-root .flgd-overlay {
    grid-template-rows: minmax(78px, auto) minmax(0, 1fr) 65px;
  }
  #flgd-root .flgd-account-link {
    font-size: 11px;
    padding: 4px;
  }
  .flgd-mobile-label {
    display: inline;
  }
}
@media(max-width:760px){#flgd-root .flgd-header>div:first-child{flex:1 1 auto;min-width:0;}#flgd-root .flgd-header-actions{flex:0 0 auto;}#flgd-root .flgd-brand{gap:5px;min-width:0;}#flgd-root .flgd-brand img{width:50px!important;max-width:50px!important;flex:0 0 50px;}#flgd-root .flgd-brand>span{font-size:12px;line-height:1.1;white-space:normal;max-width:70px;}#flgd-root .flgd-product-title{max-width:140px;} }
/* 1.4: compare processed artwork against its actual garment, with zoom. */
.flgd-bg-dialog .flgd-dialog-card{width:min(1100px,100%);}
#flgd-root .flgd-bg-image-window{height:360px;overflow:auto;background:#e7e9ed;border:1px solid #cfd5df;border-radius:8px;}
#flgd-root .flgd-bg-image-window img{display:block;width:calc(100% * var(--flgd-preview-zoom,1))!important;height:auto!important;max-width:none!important;max-height:none!important;object-fit:initial!important;background:none;}
#flgd-root img.flgd-transparent-preview{background-color:#ddd;background-image:linear-gradient(45deg,#fff 25%,transparent 25%),linear-gradient(-45deg,#fff 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#fff 75%),linear-gradient(-45deg,transparent 75%,#fff 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0;}
#flgd-root .flgd-bg-options[hidden],#flgd-root .flgd-bg-dialog [hidden]{display:none!important;}
#flgd-root .flgd-bg-dialog .flgd-field{margin:10px 0;font-size:13px;}
#flgd-root .flgd-bg-dialog input[type=checkbox]{appearance:auto!important;-webkit-appearance:checkbox!important;width:18px!important;height:18px!important;min-height:18px!important;padding:0!important;display:inline-block;vertical-align:middle;}
#flgd-root .flgd-bg-options{padding:8px 14px;background:#f6f7fa;border-radius:9px;}
#flgd-root .flgd-bg-view-controls{display:flex;gap:15px;flex-wrap:wrap;align-items:center;margin:12px 0;}
#flgd-root .flgd-bg-dialog .flgd-muted{font-size:12px;line-height:1.5;}
#flgd-root .flgd-bg-settings{border:1px solid #d2d9e3;border-radius:8px;padding:10px 14px;margin:12px 0;}
#flgd-root .flgd-bg-settings>summary{font-weight:700;cursor:pointer;}
#flgd-root .flgd-bg-settings[open]>summary{margin-bottom:12px;}
#flgd-root .flgd-bg-dialog button:disabled{opacity:.5;cursor:not-allowed;}
@media(max-width:760px){#flgd-root .flgd-bg-previews figure:nth-child(2){order:-1;}}
@media(max-width:760px){#flgd-root .flgd-bg-previews{grid-template-columns:1fr;}#flgd-root .flgd-bg-image-window{height:260px;}.flgd-bg-dialog .flgd-dialog-card{padding:17px;}#flgd-root .flgd-bg-controls{flex-wrap:wrap;gap:8px;}}
/* 1.4.1: visible cleanup actions, close control, phone touch targets. */
#flgd-root .flgd-overlay button.flgd-cleanup-action{background:#fff1f3;border:1px solid #c52137;color:#a01429;font-weight:700;margin-top:10px;}
#flgd-root .flgd-overlay button.flgd-restore-action{background:#edf2f8;border:1px solid #899bb2;color:#243b59;font-weight:600;margin-top:6px;}
#flgd-root .flgd-dialog-card button.flgd-cleanup-close{position:absolute;right:8px;top:6px;width:36px;height:36px;padding:0;margin:0;font-size:25px;line-height:1;border:0;background:transparent;color:#334155;}
#flgd-root .flgd-bg-dialog h2{padding-right:30px;}
@media(max-width:760px){#flgd-root .flgd-overlay :is(input,select,textarea){font-size:16px!important;}#flgd-root .flgd-panel button,#flgd-root .flgd-dialog-card button:not(.flgd-cleanup-close){min-height:44px;}#flgd-root .flgd-agree{align-items:flex-start;}#flgd-root .flgd-agree input{flex:0 0 20px;margin-top:4px;}#flgd-root .flgd-dialog-card{overscroll-behavior:contain;}#flgd-root .flgd-zoom{max-width:calc(100% - 16px);right:8px;gap:3px;} }
@media(max-width:760px){#flgd-root .flgd-zoom{top:8px;bottom:auto;}}
#flgd-root .flgd-resolution-notice{padding:13px 14px;border:2px solid #719680;border-radius:9px;background:#edf8ef;color:#183d25!important;font-size:13px;line-height:1.6;font-weight:600;}
#flgd-root .flgd-resolution-notice.soft{background:#fff5d6;border-color:#d5a32b;color:#624600!important;}
#flgd-root .flgd-resolution-notice.critical{background:#ffebee;border-color:#c91e36;color:#8d1023!important;box-shadow:0 0 0 2px #c91e3610;}
.flgd-panel-handle{display:none;}
@media(max-width:760px){#flgd-root .flgd-panel-handle{display:flex!important;align-items:center;justify-content:center;width:100%;height:30px;min-height:30px!important;padding:0;margin:-8px 0 8px;border:0;background:transparent!important;touch-action:none;cursor:grab;position:sticky;top:-15px;z-index:2;}#flgd-root .flgd-panel-handle span{display:block;width:58px;height:5px;border-radius:5px;background:#78879c;}}

/* 1.4.4: the menu handle scrolls with the actual top of the menu. */
@media(max-width:760px){#flgd-root .flgd-panel-handle{position:static;top:auto;}}

/* Keep the editor inside the visible screen when storefront content overflows. */
#flgd-root .flgd-overlay {
  inset: 0 auto auto 0;
  width: var(--flgd-viewport-width, 100%);
  height: var(--flgd-viewport-height, 100dvh);
  min-width: 0;
  min-height: 0;
  max-width: var(--flgd-viewport-width, 100%);
  max-height: var(--flgd-viewport-height, 100dvh);
  overflow: hidden;
}
#flgd-root .flgd-workspace { min-width: 0; min-height: 0; }
/* Price charts scroll inside descriptions instead of widening the storefront. */
.flgd-price-chart {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  contain: inline-size;
  overflow-x: auto !important;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.flgd-price-chart table { max-width: none; }

#flgd-root .flgd-sleeve-placement-note{font-size:11px;line-height:1.4;color:#566477;margin:4px 0 0;max-width:460px;text-align:center;flex:none;}
/* 1.5: flat sleeve artwork editing with a separate garment preview. */
#flgd-root .flgd-sleeve-flat{width:min(92%,720px);max-width:100%;margin:14px auto;padding:12px;background:#fff;border:1px solid #d8dde5;border-radius:10px;text-align:center;flex:none;}
#flgd-root .flgd-sleeve-flat p{margin:3px 0 9px;font-size:12px;color:#58677a;}
#flgd-root .flgd-sleeve-flat .canvas-container{max-width:100%;width:100%!important;height:auto!important;aspect-ratio:var(--sleeve-ratio,4.66);touch-action:none;}
#flgd-root .flgd-sleeve-flat canvas{width:100%!important;height:100%!important;}
#flgd-root .flgd-sleeve-mockup{display:block;width:100%;height:100%;pointer-events:none;}
#flgd-root .flgd-method-choice{display:flex;align-items:center;gap:6px;}
#flgd-root .flgd-method-choice select{flex:1;min-width:0;}
#flgd-root .flgd-method-choice button{width:32px;height:32px;min-height:32px;border-radius:50%;padding:0;flex:none;}
#flgd-root .flgd-method-note{font-size:11px;line-height:1.4;color:#58677a;}
#flgd-root .flgd-method-info{position:fixed;inset:0;background:#0008;z-index:999;display:grid;place-items:center;padding:18px;}
#flgd-root .flgd-method-card{position:relative;background:white;border-radius:12px;max-width:430px;width:100%;padding:22px;box-shadow:0 10px 40px #0004;}
#flgd-root .flgd-method-close{position:absolute;right:9px;top:9px;min-height:28px;width:28px;padding:0;}
@media(max-width:760px){
  #flgd-root .flgd-product-title{max-width:none;white-space:normal;overflow:visible;text-overflow:clip;line-height:1.2;overflow-wrap:anywhere;}
  #flgd-root .flgd-header{height:auto;min-height:78px;align-items:flex-start;}
  #flgd-root .flgd-rail{position:relative;left:auto;top:auto;bottom:auto;transform:none;margin:12px auto 6px;max-width:95%;justify-content:center;flex:none;}
  #flgd-root .flgd-canvas-note,#flgd-root .flgd-sleeve-placement-note{position:relative;z-index:1;max-width:95%;margin:6px auto;}
  #flgd-root .flgd-sleeve-flat{padding:8px;margin-top:8px;}
}

.flgd-method-charts .flgd-method-chart:not(.active){display:none!important}.flgd-method-chart-nav{display:flex;gap:10px;margin:8px 0}.flgd-method-chart-nav a{display:inline-block;border:1px solid #cbd2db;border-radius:5px;padding:5px 10px;text-decoration:none}.flgd-method-chart-nav a:hover{border-color:#d71e32}
#flgd-root .flgd-review-print-note{font-size:12px;line-height:1.5;color:#566477;margin:10px 0;}
@media(max-width:760px){
  #flgd-root .flgd-canvas-work{padding-bottom:12px;}
  #flgd-root .flgd-stage{order:1;width:min(100%,calc((100dvh - 345px)*.8));}
  #flgd-root .flgd-zoom{position:relative;top:auto;right:auto;bottom:auto;order:2;margin:8px auto 0;max-width:calc(100% - 16px);flex:none;}
  #flgd-root .flgd-rail{order:3;margin:8px auto 2px;}
  #flgd-root .flgd-sleeve-placement-note{order:4;}
}
