.mxed-studio {
  --ink: #161719;
  --muted: #666b72;
  --paper: #eef2f6;
  --panel: #ffffff;
  --line: #d9e1ea;
  --accent: #c51624;
  --gold: #c9a24a;
  --steel: #172f58;
  --dark: #071b36;
  --focus: #b38a2e;
  --studio-toolbar-height: 58px;
  --studio-stage-height: clamp(480px, calc(100vh - 122px), 740px);
  --studio-live-height: clamp(280px, calc(var(--studio-stage-height) - var(--studio-toolbar-height) - 116px), 580px);
}

.mxed-studio,
.mxed-studio * {
  box-sizing: border-box;
}

body.mxed-studio-page {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(201,162,74,0.22), transparent 26%),
    linear-gradient(135deg, rgba(7, 27, 54, 0.98), rgba(13, 42, 76, 0.96)),
    linear-gradient(112deg, transparent 0 64%, rgba(197,22,36,0.32) 64% 65.2%, transparent 65.2%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 52px);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.mxed-studio button,
.mxed-studio input,
.mxed-studio select {
  font: inherit;
}

.studio-shell {
  min-height: 100vh;
  padding: 12px 18px 16px;
}

.studio-hero {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 18px;
  max-width: 1540px;
  margin: 0 auto 12px;
  color: #fff;
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,0.58);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 10% 14%, rgba(255,255,255,0.98) 0 10%, rgba(224,239,255,0.88) 22%, transparent 39%),
    radial-gradient(ellipse at 34% 55%, rgba(57,155,218,0.56), transparent 34%),
    radial-gradient(ellipse at 84% 40%, rgba(255,255,255,0.16), transparent 42%),
    linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(154,205,244,0.72) 24%, rgba(23,73,126,0.82) 48%, rgba(7,27,54,0.95) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    inset 0 -22px 42px rgba(7,27,54,0.24),
    0 18px 40px rgba(0,0,0,0.24);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mxed-studio h1,
.mxed-studio h2,
.mxed-studio p {
  margin-top: 0;
}

.mxed-studio h1 {
  margin-bottom: 4px;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1;
  letter-spacing: 0;
  font-family: "BankGothic Md BT", "Eurostile", "Arial Black", Impact, Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
  margin-bottom: 8px;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
}

.brand-title img {
  display: block;
  width: clamp(210px, 26vw, 380px);
  height: auto;
  max-height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,0.26));
}

.brand-title span {
  color: #ffffff;
  text-shadow: 0 8px 18px rgba(0,0,0,0.34);
  white-space: nowrap;
}

.intro {
  max-width: 720px;
  margin-bottom: 0;
  color: #d7d8d9;
  font-size: 13px;
  line-height: 1.3;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 0;
  max-width: 1540px;
  margin: 0 auto;
  align-items: start;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 22px 64px rgba(0,0,0,0.32);
}

.control-panel,
.preview-stage {
  height: var(--studio-stage-height);
  border: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.99), rgba(246,248,250,0.99));
  box-shadow: none;
}

.control-panel {
  max-height: var(--studio-stage-height);
  margin-top: 0;
  overflow: auto;
  padding: 14px 16px;
  border-right: 1px solid #c9d2de;
  scrollbar-color: #8792a0 #eef2f6;
}

.panel-block {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.panel-block:first-child {
  padding-top: 0;
}

.panel-block:last-child {
  border-bottom: 0;
}

.mxed-studio label,
.mxed-studio .panel-block h2 {
  display: block;
  margin: 0 0 8px;
  color: var(--dark);
  font-size: 13px;
  font-weight: 800;
}

.panel-block h2 {
  font-size: 15px;
}

.mxed-studio input,
.mxed-studio select {
  width: 100%;
  min-height: 42px;
  margin-top: 6px;
  border: 1px solid #c7d0dc;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  color: var(--ink);
  padding: 9px 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.mxed-studio input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin: 0;
}

.mxed-studio input[type="color"] {
  min-height: 46px;
  padding: 4px;
}

.mxed-studio input[type="range"] {
  min-height: auto;
  padding: 0;
  accent-color: var(--accent);
}

.mxed-studio input:focus,
.mxed-studio select:focus,
.mxed-studio button:focus-visible {
  outline: 3px solid rgba(201, 162, 74, 0.36);
  outline-offset: 2px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border: 0;
}

.segment {
  min-height: 42px;
  border: 1px solid #cfd7e2;
  border-radius: 10px;
  background: #fff;
  color: var(--steel);
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 7px 14px rgba(7,27,54,0.08);
}

.segment:last-child {
  border-right: 1px solid #cfd7e2;
}

.segment.is-active {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--accent), 0 10px 20px rgba(7,27,54,0.22);
}

.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.text-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin-bottom: 10px;
  font-weight: 800;
}

.color-tool,
.logo-bg-tools,
.logo-align-options,
.text-layer-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.color-tool[hidden],
.logo-bg-tools[hidden],
.logo-align-options[hidden],
.text-cmyk-panel[hidden],
.dtf-placement[hidden] {
  display: none;
}

.color-tool output {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.82);
  padding: 10px;
  color: var(--steel);
  font-size: 13px;
  font-weight: 800;
}

.text-layer {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.52);
  padding: 12px;
}

.cmyk-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.cmyk-palette-wrap {
  position: relative;
  min-height: 168px;
}

.cmyk-palette {
  display: block;
  width: 100%;
  height: 168px;
  border: 1px solid #aeb9c8;
  border-radius: 10px;
  background: #fff;
  cursor: crosshair;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 16px rgba(7,27,54,0.08);
}

.cmyk-palette-cursor {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(7,27,54,0.74), 0 4px 10px rgba(0,0,0,0.3);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.cmyk-grid.is-collapsed {
  display: none;
}

.is-collapsed {
  display: none;
}

.color-swatch {
  display: block;
  min-height: 34px;
  border: 1px solid #958d80;
  background: #bb1f2d;
}

.dtf-color-swatches {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.dtf-color-button {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid #c5ceda;
  border-radius: 8px;
  background: var(--shirt-color, #ffffff);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.58), 0 6px 12px rgba(7,27,54,0.08);
}

.dtf-color-button.is-active {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(187,31,45,0.18);
}

.dtf-side-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dtf-side-button {
  min-height: 36px;
  border: 1px solid #c5ceda;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: var(--dark);
  font-weight: 900;
  cursor: pointer;
}

.dtf-side-button.is-active {
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 0 3px rgba(187,31,45,0.12);
}

.cmyk-preview-selector {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 64px;
  width: 100%;
  border: 1px solid #c5ceda;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: var(--dark);
  padding: 8px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(7,27,54,0.08);
}

.cmyk-preview-selector .color-swatch {
  min-height: 48px;
  border-radius: 8px;
  box-shadow: inset 0 1px 4px rgba(255,255,255,0.8), inset 0 -8px 16px rgba(0,0,0,0.14);
}

.cmyk-preview-selector strong,
.cmyk-preview-selector small {
  display: block;
}

.cmyk-preview-selector strong {
  font-size: 13px;
}

.cmyk-preview-selector small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.utility-button {
  min-height: 38px;
  border: 1px solid var(--steel);
  border-radius: 8px;
  background: #fff;
  color: var(--steel);
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 5px 12px rgba(7,27,54,0.07);
}

.mini-cmyk {
  width: 100%;
  margin: -2px 0 10px;
}

.symbol-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.template-gallery {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.template-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid #cfd7e2;
  border-radius: 10px;
  background: #fff;
  color: var(--steel);
  cursor: pointer;
  padding: 8px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(7,27,54,0.08);
}

.template-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(197,22,36,0.18), 0 7px 18px rgba(7,27,54,0.16);
}

.template-thumb {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 9px;
  overflow: hidden;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.7),
    inset 0 -8px 16px rgba(0,0,0,0.2),
    0 8px 14px rgba(0,0,0,0.18);
}

.template-thumb::after {
  content: "";
  position: absolute;
  inset: 4px 8px auto;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.62), rgba(255,255,255,0));
  pointer-events: none;
}

.template-thumb[data-shape="oval"] {
  border-radius: 999px;
}

.template-thumb img {
  position: relative;
  z-index: 1;
  display: block;
  width: 82%;
  max-height: 38px;
  object-fit: contain;
}

.template-info strong,
.template-info span {
  display: block;
}

.template-info strong {
  color: var(--dark);
  font-size: 13px;
}

.template-info span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.template-apply {
  width: 100%;
  margin-top: 10px;
}

.symbol-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.6);
  padding: 8px 10px;
  color: var(--steel);
  font-size: 13px;
  font-weight: 800;
}

.symbol-row-title {
  color: var(--dark);
  font-weight: 900;
}

.compact-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.compact-controls label {
  margin: 0;
  font-size: 11px;
}

.compact-controls input {
  min-height: 34px;
  padding: 6px;
}

.compact-check {
  display: flex;
  align-items: center;
  gap: 6px;
  grid-column: span 3;
}

.compact-check input {
  min-height: auto;
  width: auto;
}

.extra-text-controls,
.extra-text-row,
.text-cmyk-panel {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.extra-text-row {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.6);
  padding: 10px;
}

.safety-warning {
  border-left-color: #9f1239;
  background: #fff1f2;
  color: #9f1239;
  font-weight: 900;
}

.symbol-row button {
  min-height: 30px;
  border: 0;
  border-radius: 4px;
  background: var(--steel);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.microcopy,
.warning {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.warning {
  color: #9f1239;
  font-weight: 800;
}

.preview-stage {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--studio-toolbar-height);
  margin-bottom: 0;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, #ffffff, #f5f8fb);
}

.stage-toolbar h2 {
  margin: 0;
  color: var(--dark);
  font-size: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions button {
  min-height: 38px;
  border: 1px solid var(--dark);
  border-radius: 9px;
  background: linear-gradient(180deg, #10294e, var(--dark));
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 14px;
  box-shadow: 0 9px 18px rgba(7,27,54,0.18);
}

.actions button#requestQuote {
  border-color: var(--accent);
  background: linear-gradient(180deg, #d22432, var(--accent));
}

.canvas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 0;
}

.canvas-layout.is-single-preview {
  grid-template-columns: 1fr;
}

.canvas-frame {
  position: relative;
  height: var(--studio-live-height);
  min-height: 0;
  border: 1px solid var(--line);
  border-top: 0;
  border-left: 0;
  border-right: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.22)),
    #e9edf2;
  overflow: hidden;
}

.main-frame {
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-frame[hidden] {
  display: none;
}

.drop-hint {
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  background: rgba(255,255,255,0.78);
  color: var(--accent);
  font-weight: 900;
  text-align: center;
  pointer-events: none;
}

.drop-hint[hidden] {
  display: none;
}

.quote-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 18, 36, 0.72);
  padding: 18px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

.quote-panel * {
  box-sizing: border-box;
}

.quote-panel[hidden] {
  display: none;
}

.quote-form {
  width: min(720px, calc(100vw - 36px));
  max-width: 100%;
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #ffffff;
  color: #071b36;
  padding: 18px;
  box-shadow: 0 22px 60px rgba(0,0,0,0.34);
}

.quote-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e3e8ef;
}

.quote-form h3 {
  margin: 0;
  color: #071b36;
  font-size: 20px;
  line-height: 1.15;
}

.quote-form-head button {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #071b36;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.quote-form label {
  display: block;
  min-width: 0;
  margin: 0 0 10px;
  color: #071b36;
  font-size: 12px;
  font-weight: 900;
}

.quote-form input,
.quote-form select,
.quote-form textarea {
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  margin-top: 5px;
  border: 1px solid #bfccd9;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 650;
  box-shadow: inset 0 1px 2px rgba(7,27,54,0.05);
}

.quote-form textarea {
  resize: vertical;
  min-height: 78px;
  max-height: 132px;
  line-height: 1.35;
}

.quote-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 0;
  padding: 12px 0 0;
  background: #ffffff;
  border-top: 1px solid #e3e8ef;
}

.quote-actions button {
  min-height: 40px;
  min-width: 160px;
  flex: 0 0 auto;
  border: 1px solid #071b36;
  border-radius: 9px;
  background: linear-gradient(180deg, #10294e, #071b36);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  padding: 0 16px;
}

.quote-actions button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.quote-actions output {
  flex: 1 1 220px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

#dtfBackgroundToolsSlot .logo-bg-tools {
  margin-top: 8px;
  margin-bottom: 14px;
}

@media (max-height: 760px), (max-width: 720px) {
  .quote-panel {
    align-items: flex-start;
    padding: 8px;
  }

  .quote-form {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 12px;
  }

  .quote-form-head {
    margin-bottom: 8px;
  }

  .quote-form h3 {
    font-size: 18px;
  }

  .quote-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .quote-form textarea {
    min-height: 56px;
  }

  .quote-actions {
    position: static;
  }
}

.mxed-studio canvas {
  display: block;
  width: 100%;
  height: auto;
}

.main-frame canvas {
  width: auto;
  max-width: 100%;
  max-height: 100%;
}

.mockup-frame canvas {
  max-height: 100%;
  object-fit: contain;
}

.notice {
  margin: 8px 12px 0;
  border-left: 4px solid var(--accent);
  background: rgba(255,255,255,0.76);
  padding: 7px 12px;
  color: #343942;
  line-height: 1.24;
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .studio-shell {
    padding: 16px;
  }

  .brand-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-title span {
    white-space: normal;
  }

  .studio-hero,
  .stage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .studio-grid,
  .canvas-layout {
    grid-template-columns: 1fr;
  }

  .control-panel {
    max-height: none;
    height: auto;
    margin-top: 0;
    border-right: 1px solid rgba(255,255,255,0.18);
  }

  .canvas-frame {
    height: auto;
  }
}

@media (max-width: 620px) {
  .studio-shell {
    padding: 10px;
  }

  .segmented,
  .two-cols {
    grid-template-columns: 1fr;
  }

  .segment {
    border-right: 0;
    border-bottom: 1px solid var(--steel);
  }

  .segment:last-child {
    border-bottom: 0;
  }
}
