:root{
  --it-purple:#4A154B; --it-blue:#64C3EB; --it-red:#CE375C; --it-yellow:#E3B34C; --it-green:#5BB381;
  --md-surface:#FAFBFC; --it-black:#111316; --it-ink2:#3E424A;
}

/* =========================
   SCOPE + BASE
   ========================= */
.itmg-root, .itmg-root *{ box-sizing:border-box; }
.itmg-root{ font-family: var(--it-font-body, Inter, sans-serif); color: var(--it-black); }
.itmg-title,.itmg-section-h,.itmg-btn,.itmg-chip{ font-family: var(--it-font-display, Inter, sans-serif); }

.itmg-card{
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(195,200,209,.65);
  border-radius: 22px;
  box-shadow: 0 18px 55px rgba(15,23,42,.12);
  backdrop-filter: blur(10px);
}

/* =========================
   LAYOUT
   ========================= */
.itmg-root .itmg-shell{
  display:flex;
  gap:16px;
  align-items:flex-start;
  padding:18px;
  border-radius:22px;
  background:
    radial-gradient(1100px 600px at 10% 0%, rgba(100,195,235,.16), transparent 65%),
    radial-gradient(900px 520px at 95% 10%, rgba(74,21,75,.14), transparent 60%),
    linear-gradient(180deg,#f6f8fb,#eef2f7);
}

@media (max-width:1024px){
  .itmg-root .itmg-shell{ flex-direction:column; }
}

/* =========================
   PANEL
   ========================= */
.itmg-panel{
  width:380px;
  min-width:320px;
  padding:24px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

@media (max-width:1024px){
  .itmg-panel{
    width:100%;
    min-width:0;
    overflow: visible;
  }
}

.itmg-panel-top{ padding-bottom:8px; border-bottom:1px solid rgba(195,200,209,.45); }
.itmg-brand{ display:flex; gap:12px; align-items:center; }

.itmg-mark{
  width:44px;height:44px;border-radius:14px;
  display:grid;place-items:center;
  border:1px solid rgba(195,200,209,.55);
  background: rgba(255,255,255,.28);
  overflow:hidden;
}
.itmg-logo{ width:88%;height:88%;object-fit:contain;display:block; }
.itmg-mark-fallback{
  display:none;
  width:100%;height:100%;
  align-items:center;justify-content:center;
  font-weight:900;
  color:#fff;
  background: linear-gradient(135deg,var(--it-purple), rgba(100,195,235,.92));
}
.itmg-logo-missing .itmg-logo{ display:none; }
.itmg-logo-missing .itmg-mark-fallback{ display:flex; }

.itmg-title{ font-weight:900; letter-spacing:-.02em; }
.itmg-sub{
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color: var(--it-ink2);
  opacity:.9;
  margin-top:2px;
}

/* =========================
   CONTROLS
   ========================= */
.itmg-section{ padding-top:6px; }
.itmg-section-h{
  font-size:11px;
  letter-spacing:.14em;
  text-transform:uppercase;
  font-weight:900;
  color: var(--it-ink2);
  margin-bottom:8px;
}
.itmg-grid2{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; }

.itmg-chip{
  border-radius:14px;
  padding:9px 10px;
  font-size:12px;
  font-weight:900;
  border:1px solid rgba(195,200,209,.75);
  background: rgba(255,255,255,.70);
  cursor:pointer;
  white-space:nowrap;
}
.itmg-chip.is-active{
  border-color: rgba(17,19,22,.9);
  background: rgba(246,248,251,.95);
}

.itmg-field{ margin-top:8px; }
.itmg-label{
  display:block;
  font-size:12px;
  font-weight:800;
  color: var(--it-ink2);
  margin-bottom:6px;
}
.itmg-input{
  width:100%;
  border-radius:14px;
  border:1px solid rgba(195,200,209,.7);
  background: rgba(255,255,255,.72);
  padding:10px 12px;
  outline:none;
  font-family: var(--it-font-body, Inter, sans-serif);
}
.itmg-input:focus{
  box-shadow: 0 0 0 4px rgba(100,195,235,.22);
  border-color: rgba(100,195,235,.55);
}
.itmg-ta-lg{ height:84px; resize: vertical; }
.itmg-ta-md{ height:64px; resize: vertical; }

.itmg-swatches{ display:flex; gap:10px; align-items:center; }
.itmg-swatch{
  width:32px;height:32px;border-radius:999px;
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 10px 22px rgba(15,23,42,.12);
  cursor:pointer;
}

.itmg-actions{ display:flex; gap:10px; margin-top:10px; }
.itmg-btn{
  flex:1;
  border-radius:16px;
  padding:11px 12px;
  font-weight:900;
  font-size:13px;
  border:1px solid rgba(195,200,209,.85);
  background: rgba(255,255,255,.80);
  cursor:pointer;
}
.itmg-btn:hover{ background: rgba(255,255,255,.96); }
.itmg-btn-primary{
  border:none;
  color:#fff;
  background: linear-gradient(135deg,var(--it-purple), rgba(100,195,235,.92));
  box-shadow: 0 18px 40px rgba(15,23,42,.16);
}

.itmg-tip{
  margin-top:8px;
  font-size:12px;
  color: var(--it-ink2);
  opacity:.9;
  line-height:1.35;
}

/* =========================
   PREVIEW
   ========================= */
.itmg-preview{
  flex:1 1 auto;
  min-width:0;
  min-height:0;
}

.itmg-preview-wrap{
  padding: 12px;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  min-height:0;
}

.itmg-preview-scaler{
  transform: none;               /* JS owns scale */
  transform-origin: top center;
  will-change: transform;
}

/* =========================
   CANVAS
   ========================= */
.itmg-canvas{
  width:1080px;
  position:relative;
  overflow:hidden;
  border-radius:34px;

  /* Defaults until user clicks a swatch */
  --accent: var(--it-purple);
  --accent-rgb: 74, 21, 75;

  background:
    radial-gradient(900px 900px at 0% 0%, rgba(var(--accent-rgb), .14), transparent 62%),
    radial-gradient(900px 900px at 100% 100%, rgba(100,195,235,.12), transparent 62%),
    #fff;

  box-shadow: 0 50px 100px -20px rgba(0,0,0,0.25);
}

.itmg-canvas.ratio-1-1{ height:1080px; }
.itmg-canvas.ratio-4-5{ height:1350px; }

/* You are using gradient background, so hide blobs */
.itmg-canvas .itmg-blob{ display:none; }

.itmg-inner{
  position:relative;
  z-index:1;
  height:100%;
  padding: 72px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap: 28px;
}

.itmg-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 18px;
}
.itmg-top-left{ display:flex; align-items:center; gap: 16px; }

.itmg-canvas-mark{
  width:74px;height:74px;
  border-radius:22px;
  background: rgba(255,255,255,.92);
  display:grid;place-items:center;
  border:1px solid rgba(195,200,209,.35);
  box-shadow: 0 18px 40px rgba(15,23,42,.10);
  overflow:hidden;
}
.itmg-canvas-logo{ width:82%;height:82%;object-fit:contain;display:block; }
.itmg-canvas-fallback{
  display:none;
  width:100%;height:100%;
  align-items:center;justify-content:center;
  font-weight:900;
  color:#fff;
  background: var(--accent);
}
.itmg-logo-missing .itmg-canvas-logo{ display:none; }
.itmg-logo-missing .itmg-canvas-fallback{ display:flex; }

.itmg-brandname{
  font-weight:900;
  font-size: 28px;
  letter-spacing:-.03em;
  color: var(--it-black);
  text-transform: uppercase;
}
.itmg-brandtag{
  font-size: 12px;
  letter-spacing:.14em;
  text-transform: uppercase;
  color: rgba(62,66,74,.75);
  margin-top: 4px;
}

.itmg-badge{
  padding: 12px 20px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Card box */
.itmg-cardbox{ border-radius: 44px; padding: 58px; }
.glass-card{
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.34);
}
.itmg-line{
  height: 10px;
  width: 140px;
  border-radius: 999px;
  background: var(--accent);
  margin-bottom: 22px;
}
.itmg-head{
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.92;
  font-size: 92px;
  color: var(--it-black);
  white-space: pre-line;
}
.itmg-subtext{
  margin-top: 22px;
  font-size: 40px;
  font-weight: 300;
  line-height: 1.14;
  color: rgba(62,66,74,.88);
  max-width: 860px;
  white-space: pre-line;
}

/* Footer */
.itmg-footer{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 18px;
}
.itmg-handle{
  font-size: 20px;
  font-weight: 800;
  color: rgba(62,66,74,.75);
}
.itmg-dots{ display:flex; gap:10px; margin-top: 12px; }
.itmg-dot{ width:16px;height:16px;border-radius:999px; display:inline-block; }
.dot-a{ background: var(--accent); }
.dot-b{ background: var(--it-blue); }
.dot-c{ background: rgba(195,200,209,.6); }

.itmg-footer-right{ text-align:right; }
.itmg-cta{
  font-weight: 900;
  font-size: 40px;
  letter-spacing: -0.02em;
  color: var(--it-black);
}
.itmg-domain{
  margin-top: 8px;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: .16em;
  color: var(--accent);
}

/* Vibes */
.itmg-canvas.vibe-minimal .itmg-cardbox{
  background:transparent;
  border:none;
  backdrop-filter:none;
  padding:0;
}

.itmg-min-border{
  position:absolute;
  inset: 56px;
  border: 2px solid rgba(195,200,209,.55);
  pointer-events:none;
  border-radius: 26px;
}

/* Safety */
.itmg-root button, .itmg-root input, .itmg-root select, .itmg-root textarea{
  color: var(--it-black) !important;
}

/* =========================
   STABLE FRAME (DESKTOP)
   ========================= */
@media (min-width: 1024px){
  .itmg-root .itmg-shell{
    --itmg-offset: 160px;         /* adjust if needed */
    height: calc(100dvh - var(--itmg-offset));
    overflow: hidden;
    align-items: stretch;
  }

  .itmg-root .itmg-panel{
    height: 100%;
    overflow: auto;
  }

  .itmg-root .itmg-preview{
    height: 100%;
    overflow: hidden;
    min-height: 0;
  }

  .itmg-root .itmg-preview-wrap{
    height: 100%;
    overflow: hidden;
    padding: clamp(12px, 1.2vw, 20px);
  }
}
