.mobile-editor-tabs,
.mobile-bottom-bar {
  display: none;
}

.privacy-note { margin: 28px auto 0; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.7; }

.coming-soon { margin-top: 22px; padding: 22px; border: 1px dashed #cdbfb2; border-radius: 18px; background: #f5efe8; text-align: center; }
.coming-soon span,.coming-soon strong { display: block; }
.coming-soon span { color: var(--accent); font-size: 12px; font-weight: 800; }
.coming-soon strong { margin-top: 6px; font-size: 18px; }
.coming-soon p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }

.feedback-dialog {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: white;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(45, 32, 24, .24);
}

.feedback-dialog::backdrop {
  background: rgba(35, 28, 24, .45);
  backdrop-filter: blur(4px);
}

.feedback-dialog form { padding: 22px; }
.feedback-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.feedback-head h2 { margin: 0; font-size: 24px; }
.dialog-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f3eee8; font-size: 24px; }
.feedback-dialog label { display: grid; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 13px; font-weight: 700; }
.feedback-dialog select,.feedback-dialog textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); resize: vertical; }
.feedback-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.fabric-item {
  --slot-color: #8b8177;
}

.fabric-item.slot-A { --slot-color: #a34d36; }
.fabric-item.slot-B { --slot-color: #4c7c78; }
.fabric-item.slot-C { --slot-color: #b17835; }
.fabric-item.slot-D { --slot-color: #75659a; }
.fabric-item.slot-E { --slot-color: #8a6a54; }
.fabric-item.slot-F { --slot-color: #567894; }

.fabric-item .fabric-thumb {
  position: relative;
  border: 3px solid color-mix(in srgb, var(--slot-color) 72%, white);
  color: var(--slot-color);
}

.fabric-item.active {
  border-color: var(--slot-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--slot-color) 16%, transparent);
}

.thumb-slot {
  position: absolute;
  right: 3px;
  bottom: 3px;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--slot-color);
  color: white;
  font-size: 11px;
  line-height: 1;
}

.mapping-overlay {
  pointer-events: none;
}

.mapping-marker {
  opacity: .82;
  transition: opacity .18s ease, transform .18s ease;
}

.mapping-marker.filled-marker,
.canvas-wrap svg[data-active-slot] .mapping-marker.filled-marker {
  opacity: 0 !important;
}

.mapping-marker circle {
  fill: #8b8177;
  stroke: white;
  stroke-width: 5;
}

.mapping-marker.slot-A circle { fill: #a34d36; }
.mapping-marker.slot-B circle { fill: #4c7c78; }
.mapping-marker.slot-C circle { fill: #b17835; }
.mapping-marker.slot-D circle { fill: #75659a; }
.mapping-marker.slot-E circle { fill: #8a6a54; }
.mapping-marker.slot-F circle { fill: #567894; }

.mapping-marker text {
  fill: white;
  font: 800 24px/1 system-ui, sans-serif;
}

.canvas-wrap svg[data-active-slot] [data-fabric-slot]:not(.mapping-marker):not(.selected-region) {
  opacity: .38;
}

.canvas-wrap svg[data-active-slot] .mapping-marker {
  opacity: .22;
}

.canvas-wrap svg[data-active-slot="A"] .mapping-marker.slot-A,
.canvas-wrap svg[data-active-slot="B"] .mapping-marker.slot-B,
.canvas-wrap svg[data-active-slot="C"] .mapping-marker.slot-C,
.canvas-wrap svg[data-active-slot="D"] .mapping-marker.slot-D,
.canvas-wrap svg[data-active-slot="E"] .mapping-marker.slot-E,
.canvas-wrap svg[data-active-slot="F"] .mapping-marker.slot-F {
  opacity: 1;
}

@media (max-width: 760px) {
  body {
    padding-bottom: 82px;
  }

  .topbar {
    min-height: 58px;
  }

  .brand {
    font-size: 16px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  #designer-view.active ~ * {
    scroll-margin-bottom: 84px;
  }

  #designer-view .designer-head {
    margin: 0 2px 12px;
  }

  #designer-view .designer-head .eyebrow {
    margin-bottom: 5px;
    font-size: 11px;
  }

  #designer-view .designer-head h1 {
    font-size: 25px;
    letter-spacing: -.02em;
  }

  #designer-view .preview-stage {
    position: sticky;
    top: 68px;
    z-index: 4;
    aspect-ratio: 1 / 1.03;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(70, 53, 42, .12);
  }

  #designer-view .canvas-wrap {
    width: 88%;
  }

  #designer-view .scheme-bar {
    margin: 10px 0 2px;
  }

  #designer-view .canvas-tip {
    display: none;
  }

  .mobile-editor-tabs {
    position: sticky;
    top: 58px;
    z-index: 9;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 7px 24px rgba(70, 53, 42, .08);
    backdrop-filter: blur(16px);
  }

  .mobile-editor-tab {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-weight: 750;
  }

  .mobile-editor-tab span {
    display: inline-grid;
    width: 22px;
    height: 22px;
    margin-right: 6px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 11px;
  }

  .mobile-editor-tab.active {
    background: var(--ink);
    color: #fff;
  }

  #designer-view .designer-layout {
    gap: 12px;
  }

  #designer-view .preview-column {
    order: -2;
  }

  #designer-view .fabric-panel,
  #designer-view .adjust-panel {
    border-radius: 18px;
    box-shadow: none;
  }

  #designer-view[data-mobile-panel="fabric"] .adjust-panel,
  #designer-view[data-mobile-panel="adjust"] .fabric-panel {
    display: none;
  }

  #designer-view[data-mobile-panel="adjust"] .adjust-panel {
    display: block;
  }

  #designer-view .fabric-list {
    grid-template-columns: 1fr;
  }

  #designer-view .fabric-item {
    min-height: 72px;
  }

  #designer-view .rotate-row {
    grid-template-columns: 1fr 1fr;
  }

  #designer-view .range-row {
    padding: 5px 1px;
  }

  #designer-view .range-row input {
    min-height: 32px;
  }

  .mobile-bottom-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px max(14px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -10px 30px rgba(70, 53, 42, .11);
    backdrop-filter: blur(18px);
  }

  .mobile-bottom-bar > div {
    display: grid;
  }

  .mobile-bottom-bar strong {
    font-size: 20px;
    line-height: 1;
    color: var(--accent);
  }

  .mobile-bottom-bar span {
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-bottom-bar .button {
    min-width: 180px;
    min-height: 48px;
    border-radius: 14px;
  }

  .toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 32px);
    white-space: nowrap;
  }

  #designer-view.active ~ .mobile-bottom-bar {
    display: flex;
  }

  .top-actions #export-button {
    display: none;
  }

  .top-actions #change-template {
    min-height: 38px;
  }
}

/* Keep long uploaded filenames inside the fabric sidebar. */
.fabric-panel,
.fabric-list,
.fabric-item,
.fabric-copy {
  min-width: 0;
}

.fabric-item {
  grid-template-columns: 54px minmax(0, 1fr) auto;
  overflow: hidden;
}

.fabric-copy strong,
.fabric-copy > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-mini {
  min-width: max-content;
}
