.hibr-studio-2030 .hibr-mobile-tool-links {
  display: none;
}

@media (max-width: 800px) {
  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-live-layout {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: calc(100% - 16px) !important;
    gap: 12px !important;
    overflow: visible !important;
  }

  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-preview-console,
  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-studio-panel {
    position: relative !important;
    inset: auto !important;
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-preview-console {
    order: -1 !important;
  }

  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-studio-panel {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-preview-stage {
    display: grid !important;
    place-items: center;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 !important;
  }

  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-garment-object {
    width: min(98%, 660px) !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-preview-topbar,
  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-studio-toolbar {
    min-height: 0 !important;
    padding: 8px !important;
  }

  .hibr-studio-2030 .hibr-preview-topbar > div:first-child,
  .hibr-studio-2030 .hibr-studio-toolbar > span,
  .hibr-studio-2030 .hibr-stage-code,
  .hibr-studio-2030 .hibr-preview-hint {
    display: none !important;
  }

  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-side-switch,
  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-studio-toolbar-actions,
  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-draw-tools {
    display: grid !important;
    width: 100% !important;
    min-width: 0;
    gap: 6px !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-studio-toolbar-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(66px, 1.5fr);
  }

  body.hibr-designer-enhanced .hibr-studio-2030 :is(.hibr-side-switch button, .hibr-studio-toolbar-actions button, .hibr-draw-tools button, .hibr-mini-btn, .hibr-size-options button, .hibr-open-ai) {
    min-height: 44px !important;
    min-width: 0 !important;
    padding-inline: 4px !important;
    font-size: 14px !important;
    white-space: normal !important;
  }

  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-studio-toolbar-actions button:not(.hibr-toolbar-reset) {
    font-size: 19px !important;
  }

  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-toolbar-reset {
    font-size: 11px !important;
  }

  .hibr-studio-2030 .hibr-image-actions #hibr-remove-bg {
    width: 100%;
    border-color: #806c44;
  }

  .hibr-studio-2030 .hibr-upload-zone {
    min-height: 84px;
  }

  .hibr-studio-2030 :is(#hibr-live-preview, #hibr-tool-image, #hibr-tool-draw, #hibr-tool-text, #hibr-tool-garment) {
    scroll-margin-top: 150px;
  }

  .hibr-studio-2030 #hibr-design-status {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  body.hibr-designer-enhanced .hibr-studio-2030 #hibr-design-text-input {
    font-size: 16px !important;
  }
}

/* Group panels without changing the desktop layout. */
.hibr-studio-2030 .hibr-tool-group,
.hibr-studio-2030 .hibr-image-inputs {
  display: contents;
}

@media (max-width: 800px) {
  .hibr-studio-2030 .hibr-mobile-tool-links {
    display: none;
  }

  body.hibr-designer-enhanced .hibr-studio-2030.hibr-tool-tabs-active .hibr-live-layout {
    gap: 8px !important;
    --hibr-canvas-size: clamp(252px, 37svh, 420px);
  }

  body.hibr-designer-enhanced .hibr-studio-2030.hibr-tool-tabs-active .hibr-preview-stage {
    height: min(var(--hibr-canvas-size), 100vw - 20px) !important;
    aspect-ratio: auto !important;
  }

  body.hibr-designer-enhanced .hibr-studio-2030.hibr-tool-tabs-active .hibr-garment-object {
    width: min(98%, var(--hibr-canvas-size)) !important;
  }

  .hibr-studio-2030.hibr-tool-tabs-active .hibr-mobile-tool-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid #443820;
  }

  .hibr-tool-tabs-active .hibr-mobile-tool-links button {
    min-width: 0;
    min-height: 44px;
    padding: 5px 6px;
    border: 1px solid #6a5732;
    border-radius: 9px;
    color: #f2dfb6;
    background: #14120f;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
  }

  .hibr-tool-tabs-active .hibr-mobile-tool-links button[aria-selected="true"] {
    color: #17130c;
    background: #d8b96f;
    border-color: #ead097;
  }

  .hibr-tool-tabs-active .hibr-mobile-tool-links button:focus-visible {
    outline: 2px solid #f7dda0;
    outline-offset: 2px;
  }

  .hibr-tool-tabs-active .hibr-tool-group:not(.is-current),
  .hibr-tool-tabs-active :is(.hibr-studio-panel-head, .hibr-fixed-garment, .hibr-upload-tool > .hibr-studio-tool-title, .hibr-or) {
    display: none !important;
  }

  body.hibr-designer-enhanced .hibr-studio-2030.hibr-tool-tabs-active .hibr-upload-tool {
    padding: 8px !important;
  }

  .hibr-tool-tabs-active .hibr-image-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 6px;
  }

  body.hibr-designer-enhanced .hibr-studio-2030.hibr-tool-tabs-active .hibr-upload-zone {
    min-height: 46px;
    padding: 4px;
  }

  .hibr-tool-tabs-active .hibr-upload-zone :is(.hibr-upload-icon, small) {
    display: none;
  }

  body.hibr-designer-enhanced .hibr-tool-tabs-active .hibr-upload-zone strong {
    margin: 0;
  }

  .hibr-tool-tabs-active .hibr-image-actions {
    display: flex;
    margin: 0 !important;
    align-items: stretch;
  }

  .hibr-tool-tabs-active .hibr-ai-launch {
    margin-top: 6px;
    padding: 7px;
    gap: 4px;
  }

  .hibr-tool-tabs-active .hibr-ai-style-picker {
    margin-bottom: 0;
    gap: 6px;
  }

  .hibr-tool-tabs-active :is(.hibr-ai-attempts, #hibr-ai-launch-status) {
    margin: 3px 0;
    font-size: 12px;
  }

  .hibr-tool-tabs-active .hibr-touch-help {
    display: none;
  }

  .hibr-tool-tabs-active #hibr-panel-draw .hibr-placement-controls {
    margin-top: 8px;
  }
}

@media (max-width: 800px) {
  .hibr-studio-2030.hibr-tool-tabs-active .hibr-mobile-tool-links {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
  }

  .hibr-tool-tabs-active .hibr-mobile-tool-links button {
    font-size: 12px;
    line-height: 1.35;
  }

  .hibr-tool-tabs-active .hibr-tool-group.is-current {
    display: block;
  }

  body.hibr-designer-enhanced .hibr-studio-2030.hibr-tool-tabs-active .hibr-preview-footer > div {
    min-width: 0;
    padding: 6px !important;
    gap: 2px;
  }

  .hibr-tool-tabs-active .hibr-preview-footer small {
    display: none;
  }
}

@media (max-width: 800px) {
  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-sticky-order {
    position: static;
    inset: auto;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    order: 2;
  }
}

.hibr-studio-2030 .hibr-design-clip {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.hibr-studio-2030 .hibr-preview-stage {
  --hibr-print-inset: 24% 32% 34%;
}

.hibr-studio-2030 .hibr-preview-stage[data-side="back"] {
  --hibr-print-inset: 28% 28% 25% 28%;
}

.hibr-studio-2030 .hibr-preview-stage[data-side] .hibr-design-clip {
  clip-path: inset(var(--hibr-print-inset));
}

.hibr-studio-2030 .hibr-preview-stage[data-side] .hibr-print-safe-area {
  inset: var(--hibr-print-inset);
  width: auto;
  border-radius: 0;
}

#hibr-size-dialog {
  width: min(360px, calc(100% - 32px));
  max-width: none;
  box-sizing: border-box;
  margin: auto;
  padding: 20px;
  direction: rtl;
  color: #f5f1e9;
  background: #151410;
  border: 1px solid #8e7847;
  border-radius: 18px;
}
#hibr-size-dialog::backdrop { background: rgba(0,0,0,.66); }
#hibr-size-dialog h2 { font-size: 1.2rem; margin: 0 0 16px; }
.hibr-size-choices { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 5px; direction: ltr; }
.hibr-size-choices label { position: relative; }
.hibr-size-choices input { position: absolute; opacity: 0; }
.hibr-size-choices span, .hibr-size-actions button {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid #8e7847;
  cursor: pointer;
}
.hibr-size-choices input:focus-visible + span { outline: 2px solid #f5f1e9; }
.hibr-size-choices input:checked + span, .hibr-size-actions button[type="submit"] {
  background: #d8b96f;
  color: #16130d;
}
.hibr-size-actions { display: grid; gap: 8px; margin-top: 16px; }
.hibr-size-actions button { background: transparent; color: inherit; padding: 0 8px; }

.hibr-studio-2030 #hibr-design-text {
  position: absolute;
  pointer-events: auto;
  cursor: grab;
  z-index: 4;
  line-height: 1;
  font-weight: var(--design-weight, 400);
  text-align: center;
  text-shadow: none !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  touch-action: none;
}
.hibr-layer-picker {
  display: flex;
  gap: 6px;
}
.hibr-layer-picker button {
  min-height: 36px;
  padding: 0 12px;
  color: #f5f1e9;
  background: #171410;
  border: 1px solid #776441;
  border-radius: 8px;
}
.hibr-layer-picker button[aria-pressed="true"] {
  background: #d8b96f;
  color: #16130d;
}
.hibr-center-guide {
  display: none;
  position: absolute;
  z-index: 8;
  pointer-events: none;
  background: #ffe18e;
  box-shadow: 0 0 3px #382500;
}
.hibr-align-x .hibr-center-guide-x { display: block; left: var(--hibr-center-x); top: 6%; bottom: 6%; width: 1px; }
.hibr-align-y .hibr-center-guide-y { display: block; top: var(--hibr-center-y); left: 8%; right: 8%; height: 1px; }
.hibr-studio-2030 .hibr-preview-stage:not([data-edit-layer="text"][data-edit-mode="move"]) #hibr-design-text {
  pointer-events: none;
}
.hibr-studio-2030 #hibr-design-text { z-index: 11; }
.hibr-studio-2030 .hibr-layer-picker button[aria-pressed="true"] {
  background: #d8b96f !important;
  color: #16130d !important;
}
@media (max-width: 800px) {
  .hibr-studio-2030 .hibr-studio-toolbar { flex-wrap: wrap; }
  .hibr-studio-2030 .hibr-layer-picker { flex: 1 0 100%; }
}

.hibr-chest-positions { display: none; }
#hibr-live-preview[data-preview-side="front"] .hibr-chest-positions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}
.hibr-chest-positions button {
  min-height: 42px;
  padding: 4px;
  color: #f5f1e9;
  background: #171410;
  border: 1px solid #776441;
  border-radius: 8px;
  font-size: .75rem;
}
.hibr-chest-positions button[aria-pressed="true"] { background: #d8b96f; color: #16130d; }

.hibr-studio-2030 .hibr-preview-stage[data-side="front"] {
  --hibr-chest-x: 50%;
  --hibr-print-inset: 27% calc(93% - var(--hibr-chest-x)) 59% calc(var(--hibr-chest-x) - 7%);
}
.hibr-studio-2030 .hibr-preview-stage[data-side="front"][data-chest-position="right"] { --hibr-chest-x: 36%; }
.hibr-studio-2030 .hibr-preview-stage[data-side="front"][data-chest-position="left"] { --hibr-chest-x: 64%; }
.hibr-studio-2030 .hibr-preview-stage[data-side="front"] #hibr-design-layer {
  top: 34%;
  left: var(--hibr-chest-x);
  width: 14%;
  aspect-ratio: 1;
  max-height: none;
  border-radius: 0;
}
.hibr-studio-2030.hibr-front-logo .hibr-placement-controls [data-placement] { display: none; }
.hibr-studio-2030 .hibr-preview-stage[data-side="front"] .hibr-print-safe-area { transition: none; }

.hibr-angle-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(216,185,111,.2);
}
.hibr-angle-tools label { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: #f5f1e9; }
.hibr-angle-tools button, .hibr-angle-tools input {
  box-sizing: border-box;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid #776441;
  border-radius: 8px;
  background: #171410;
  color: #f5f1e9;
  font-size: .8rem;
}
.hibr-angle-tools input { width: 64px; text-align: center; }
.hibr-angle-tools button[aria-pressed="true"] { background: #d8b96f; color: #16130d; }

.hibr-studio-2030 .hibr-side-switch button { flex: 1 0 0; }

.hibr-text-clip {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.hibr-chest-text-controls { display: none; }
.hibr-front-logo .hibr-chest-text-controls {
  display: grid;
  gap: 8px;
  margin: 8px 0;
}
.hibr-chest-text-controls label { display: flex; align-items: center; gap: 8px; }
.hibr-chest-text-controls input { flex: 1; min-width: 0; accent-color: #d8b96f; }
.hibr-chest-text-positions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.hibr-chest-text-positions button {
  min-height: 40px;
  padding: 4px;
  border: 1px solid #776441;
  border-radius: 8px;
  background: #171410;
  color: #f5f1e9;
  font-size: .76rem;
}
.hibr-chest-text-positions button[aria-pressed="true"] { background: #d8b96f; color: #16130d; }
.hibr-chest-text-positions button:disabled { opacity: .45; }
.hibr-front-logo [data-text-position] { display: none; }
.hibr-text-print-outline {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  border: 1px dashed #947742;
  box-sizing: border-box;
}

.hibr-size-choices input:disabled + span {
  opacity: .5;
  text-decoration: line-through;
  cursor: not-allowed;
}
.hibr-size-actions button:disabled { opacity: .55; cursor: not-allowed; }
#hibr-size-stock-message { margin: 10px 0 0; font-size: .8rem; color: #e5d4ae; }

.hibr-studio-2030 .hibr-preview-stage.hibr-spread[data-side="back"] { --hibr-print-inset: 43% 37% 34%; }
.hibr-studio-2030 .hibr-preview-stage.hibr-spread[data-side="back"] #hibr-design-layer { top: 54.5%; left: 50%; width: 25%; min-width: 0; }
.hibr-studio-2030 .hibr-preview-stage.hibr-spread[data-side="front"] { --hibr-print-inset: 40% calc(95.8% - var(--hibr-chest-x)) 51.6% calc(var(--hibr-chest-x) - 4.2%); }
.hibr-studio-2030 .hibr-preview-stage.hibr-spread[data-chest-position="right"] { --hibr-chest-x: 41.6%; }
.hibr-studio-2030 .hibr-preview-stage.hibr-spread[data-chest-position="left"] { --hibr-chest-x: 58.4%; }
.hibr-studio-2030 .hibr-preview-stage.hibr-spread[data-side="front"] #hibr-design-layer { top: 44.2%; width: 8.4%; min-width: 0; }
@media(max-width: 767px) {
  body.hibr-designer-enhanced .hibr-studio-2030.hibr-tool-tabs-active .hibr-spread .hibr-garment-object { width: 98% !important; }
}

/* Let the preview use the room around the garment on each screen. */
body.hibr-designer-enhanced .hibr-studio-2030 #hibr-preview-stage {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
}
@media (min-width: 801px) {
  body.hibr-designer-enhanced .hibr-studio-2030 #hibr-preview-stage .hibr-garment-object {
    width: min(92%, 800px) !important;
    max-width: none;
  }
  body.hibr-designer-enhanced .hibr-studio-2030 #hibr-preview-stage:not(.hibr-spread) {
    min-height: min(80vw, 800px) !important;
  }
  body.hibr-designer-enhanced .hibr-studio-2030 #hibr-preview-stage.hibr-spread .hibr-garment-object {
    width: min(94%, 1080px, max(640px, 155vh)) !important;
  }
}
@media (max-width: 800px) {
  body.hibr-designer-enhanced .hibr-studio-2030 .hibr-live-layout {
    width: 100% !important;
    padding-inline: 0 !important;
  }
  body.hibr-designer-enhanced .hibr-studio-2030 #hibr-preview-stage {
    height: clamp(240px, 84vw, 520px) !important;
  }
  body.hibr-designer-enhanced .hibr-studio-2030 #hibr-preview-stage .hibr-garment-object {
    width: 99% !important;
  }
  body.hibr-designer-enhanced .hibr-studio-2030 #hibr-preview-stage:not(.hibr-spread) {
    height: 99vw !important;
  }
}

#hibr-added-dialog { direction:rtl; box-sizing:border-box; margin:auto; width:min(360px,94vw); padding:24px; border:1px solid #a58a50; border-radius:18px; background:#151410; color:#f5f1e9; }
#hibr-added-dialog::backdrop {background:rgba(0,0,0,.7);}
#hibr-added-dialog h2 {font-size:1.2rem;margin:0 0 10px;}
#hibr-added-dialog p {color:#ddc9a4;line-height:1.65;}
#hibr-added-dialog a {display:block;text-align:center;padding:11px;margin-top:8px;border-radius:9px;border:1px solid #806c46;color:#f5e9d1;text-decoration:none;}
#hibr-added-dialog #hibr-make-another {background:#d8b96f;color:#1e180c;font-weight:700;}
