/* TG-MI2FIX-1120: preview ?tgmi2fix=p1120 only.
   Text-tap fix + Mirza mockup header (letter view buttons, colours + undo row,
   qty chip hidden). Does not restyle desktop (>=1024px). */
@media (max-width: 1023px) {
html.tgf-live-root #tees-studio .ts-next span { letter-spacing: 0; }
html.tgf-live-root #tees-studio .ts-stage { position: relative; }

#tees-studio.tgst-m.tgmi2.tgmi2fix {
  grid-template-rows: auto minmax(0, 1fr) !important;
}

/* ---- Top row: Close, Save, Share, F/B/L/R, Next/ATC ---- */
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top {
  display: flex !important;
  align-items: flex-start;
  gap: 4px;
  height: auto !important;
  min-height: 52px !important;
  padding: 6px 8px 2px 6px !important;
  border-bottom: 0 !important;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .ts-close {
  flex: none;
  width: 32px;
  height: 32px;
  margin-top: 0;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .ts-prev { display: none !important; }

/* Qty / price / size chrome is hidden; values stay in Studio state for the order sheet */
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .ts-steps,
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tsf-qc,
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tsf-qbtn,
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-design > .ts-qty,
#tees-studio.tgst-m.tgmi2.tgmi2fix .tgmi2-bar .ts-qty {
  display: none !important;
}

#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  flex: none;
  margin-top: 0;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgsv-btn,
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgst-share-m,
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgst-share {
  position: static !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 40px !important;
  min-width: 40px !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--mi2-ink) !important;
  font-size: 0 !important;
  line-height: 0 !important;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgsv-btn span:not(.tgmi2fix-lb),
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgst-share-m span:not(.tgmi2fix-lb),
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgst-share span:not(.tgmi2fix-lb) {
  display: none !important;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts svg {
  width: 16px;
  height: 16px;
  flex: none;
  pointer-events: none;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgsv-btn svg,
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgst-share-m svg,
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgst-share svg,
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgsv-btn .tgmi2fix-ic,
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgst-share-m .tgmi2fix-ic,
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgst-share .tgmi2fix-ic {
  width: 32px;
  height: 32px;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid var(--mi2-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--mi2-shadow);
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2-acts .tgmi2fix-lb {
  display: block !important;
  font-size: 8px !important;
  line-height: 1.15 !important;
  font-weight: 600;
  color: #5b6474;
  letter-spacing: 0;
  text-transform: none;
}

/* Letter view buttons in the header */
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2fix-views {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-top: 0;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2fix-views::-webkit-scrollbar { display: none; }
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2fix-views .ts-views {
  display: flex !important;
  gap: 8px;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible;
  flex: none;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2fix-views .ts-vw {
  width: 40px !important;
  min-width: 40px !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0 !important;
  line-height: 0 !important;
  color: var(--mi2-ink) !important;
  flex: none !important;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2fix-views .ts-vw::before {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 15px;
  border: 1px solid var(--mi2-line);
  background: #fff;
  box-shadow: var(--mi2-shadow);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: var(--mi2-ink);
  content: attr(data-tgmi2fix-ltr);
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2fix-views .ts-vw.is-on::before {
  background: #111;
  border-color: #111;
  color: #fff;
  box-shadow: 0 2px 8px rgba(17, 17, 17, .25);
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .tgmi2fix-views .ts-vw::after {
  content: attr(data-tgmi2fix-lab);
  font-size: 7px;
  line-height: 1.2;
  font-weight: 600;
  color: #5b6474;
  letter-spacing: 0;
  white-space: nowrap;
  max-width: 42px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix.tgmi2-oneview .tgmi2fix-views { display: none !important; }

#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-top .ts-next {
  flex: none;
  margin-left: auto;
  margin-top: 1px;
  align-self: flex-start;
}

/* ---- Second row: colour dots left, Undo/Redo right ---- */
#tees-studio.tgst-m.tgmi2.tgmi2fix .tgmi2-bar {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: none;
  padding: 2px 10px 4px;
  min-height: 36px;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .tgmi2-bar .ts-views { display: none !important; }
#tees-studio.tgst-m.tgmi2.tgmi2fix .tgmi2-bar .ts-colors {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 20px;
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  padding: 0 !important;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix.tgmi2fix-onecolor .tgmi2-bar .ts-colors {
  display: none !important;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .tgmi2-bar .ts-colors::-webkit-scrollbar { display: none; }
#tees-studio.tgst-m.tgmi2.tgmi2fix .tgmi2-bar .ts-colors .ts-dot {
  width: 20px !important;
  height: 20px !important;
  flex: none;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .tgmi2-bar .ts-ur {
  order: 2;
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  display: flex !important;
  gap: 6px;
  flex: none;
  margin-left: auto;
}
#tees-studio.tgst-m.tgmi2.tgmi2fix .tgmi2-bar .ts-ur .ts-ib,
#tees-studio.tgst-m.tgmi2.tgmi2fix .tgmi2-bar .ts-undo,
#tees-studio.tgst-m.tgmi2.tgmi2fix .tgmi2-bar .ts-redo {
  position: static !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 16px !important;
  border: 1px solid var(--mi2-line) !important;
  background: #fff !important;
  box-shadow: var(--mi2-shadow) !important;
  color: var(--mi2-ink) !important;
}

/* Stage / thumb / zoom / bottom pills stay on the live mi2 look */
#tees-studio.tgst-m.tgmi2.tgmi2fix .ts-stage > .ts-ur {
  display: none !important;
}

/* Views were moved out of .ts-design, so mi2's :has() rule would hide the thumb. */
html.tgf-live-root #tees-studio.tgst-m.tgmi2.tgmi2fix:not(.tgmi2-oneview) .ts-design .ts-stage .tgf-live,
html.tgf-live-root #tees-studio.tgst-m.tgmi2.tgmi2fix:not(.tgmi2-oneview) .ts-stage .tgf-live {
  display: block !important;
  visibility: visible !important;
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  width: 56px !important;
  height: 56px !important;
  z-index: 8 !important;
}
}
