:root {
  --panel-bg: rgba(255, 255, 255, 0.78);
  --panel-border: rgba(148, 163, 184, 0.22);
  --text-main: #0f172a;
  --text-soft: #475569;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.12);
  --danger: #dc2626;
  --stage-bg: #eef2ff;
  --shadow-soft: 0 20px 60px rgba(15, 23, 42, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.22), transparent 26%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.22), transparent 28%),
    #f8fafc;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.render3d-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  width: 100%;
}

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

.render3d-panel__viewer {
  min-height: 420px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #f8fafc;
}

.render3d-panel__viewer model-viewer {
  display: block;
  width: 100%;
  height: 420px;
}

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

.render3d-panel__preview img {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: #f8fafc;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  min-height: 100vh;
  align-items: start;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-soft);
}

.controls-panel {
  width: 100%;
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: visible;
  z-index: 3;
}

.preview-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.preview-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 8px 0;
}

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

.stage {
  background: var(--stage-bg);
  border-radius: 34px;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 640px;
  padding: 10px 24px 24px;
  position: relative;
  overflow: hidden;
}

.stage::before,
.stage::after {
  content: "";
  position: absolute;
  inset: auto;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
}

.stage::before {
  top: -120px;
  left: -80px;
  background: rgba(255, 255, 255, 0.45);
}

.stage::after {
  right: -120px;
  bottom: -140px;
  background: rgba(99, 102, 241, 0.18);
}

.garment-stage {
  width: min(100%, 540px);
  transform: translateY(-16px);
  z-index: 1;
}

.measurement-stage {
  display: grid;
  grid-template-rows: 28px 1fr;
  gap: 8px;
}

.measurement-stage__body {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: start;
}

.garment-render {
  position: relative;
  width: 100%;
  aspect-ratio: 260 / 405;
  user-select: none;
  overflow: hidden;
}

.logos-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.ruler {
  position: relative;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.ruler--horizontal {
  height: 28px;
}

.ruler--vertical {
  width: 28px;
  min-height: 100%;
}

.ruler-tick {
  position: absolute;
  background: rgba(15, 23, 42, 0.45);
}

.ruler--horizontal .ruler-tick {
  bottom: 0;
  width: 1px;
}

.ruler--vertical .ruler-tick {
  right: 0;
  height: 1px;
}

.ruler-tick.is-major {
  background: rgba(79, 70, 229, 0.85);
}

.ruler-label {
  position: absolute;
  font-size: 0.68rem;
  line-height: 1;
  color: var(--text-soft);
}

.ruler--horizontal .ruler-label {
  top: 4px;
  transform: translateX(-50%);
}

.ruler--vertical .ruler-label {
  left: 3px;
  transform: translateY(-50%);
}

.ruler-info,
.measurement-card {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.garment-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.garment-logo,
.logo-selection {
  position: absolute;
}

.garment-layer {
  object-fit: contain;
  pointer-events: none;
}

.garment-color {
  background: #f5f5f5;
  -webkit-mask-image: url("shirt/views/front-base.png");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: url("shirt/views/front-base.png");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.garment-base-overlay {
  mix-blend-mode: multiply;
  opacity: 0.14;
  filter: grayscale(1);
  z-index: 1;
}

.garment-shadow-primary,
.garment-shadow-secondary {
  mix-blend-mode: multiply;
  opacity: 0.8;
  filter: grayscale(1);
  z-index: 2;
}

.garment-highlight {
  mix-blend-mode: screen;
  opacity: 0.86;
  filter: grayscale(1);
  z-index: 2;
}

.garment-render.is-light-textile .garment-color {
  filter: brightness(1.06);
}

.garment-render.is-light-textile .garment-base-overlay {
  opacity: 0.08;
}

.garment-render.is-light-textile .garment-shadow-primary,
.garment-render.is-light-textile .garment-shadow-secondary {
  opacity: 0.5;
}

.garment-render.is-light-textile .garment-highlight {
  opacity: 0.96;
}

.garment-logo {
  width: auto;
  height: auto;
  z-index: 3;
  cursor: grab;
  object-fit: contain;
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: left, top, width, height;
}

.garment-logo.is-dragging {
  cursor: grabbing;
}

.garment-logo.is-active {
  filter: drop-shadow(0 2px 10px rgba(79, 70, 229, 0.18));
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.7rem, 2vw, 2.1rem);
}

h2 {
  font-size: 1.05rem;
}

h3 {
  font-size: 1rem;
}

.intro,
.hint,
.small {
  color: var(--text-soft);
  line-height: 1.55;
}

.small {
  font-size: 0.92rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.collapsible-group {
  gap: 0;
}

.popout-group {
  position: relative;
  overflow: visible;
}

.collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.collapsible-summary::-webkit-details-marker {
  display: none;
}

.collapsible-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.collapsible-title::before {
  content: '▾';
  font-size: 0.9rem;
  color: var(--accent);
  transition: transform 0.18s ease;
}

.collapsible-group:not([open]) .collapsible-title::before {
  transform: rotate(-90deg);
}

.collapsible-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.popout-group .collapsible-summary {
  min-height: 52px;
  padding: 4px 2px;
}

.popout-group .collapsible-content {
  position: absolute;
  top: -6px;
  left: calc(100% + 16px);
  width: min(420px, calc(100vw - 390px));
  max-height: min(78vh, 860px);
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(20px);
  overflow: auto;
  z-index: 20;
}

.popout-group:not([open]) .collapsible-content {
  display: none;
}

.popout-group[open] {
  z-index: 21;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.group-header--sub {
  margin-bottom: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.pill--neutral {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-soft);
}

.pill--success {
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
}

.pill--error {
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 500;
}

.field input[type="url"] {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
}

.field input[type="text"] {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
}

.field input[type="number"] {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
}

.field select {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
}

.field textarea {
  min-height: 180px;
  resize: vertical;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  line-height: 1.5;
}

.field-meta {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 500;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.field input[type="file"] {
  border: 1px dashed rgba(148, 163, 184, 0.55);
  border-radius: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.field input[type="color"] {
  width: 100%;
  min-height: 42px;
  border: 0;
  background: transparent;
  padding: 0;
}

.slider-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

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

.variant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variant-tab {
  min-height: 27px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.78rem;
}

.variant-tab.is-active {
  background: rgba(79, 70, 229, 0.14);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.24);
}

.variant-tab__swatch {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.logo-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.logo-tab__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 0.68rem;
  font-weight: 700;
}

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

.size-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.size-field__label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
}

.size-field__input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.94);
}

.primary-button,
.secondary-button,
.ghost-button,
.segmented-button,
.view-card,
.preset-button {
  border: 0;
  border-radius: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  padding: 0 14px;
  font-weight: 600;
}

.primary-button {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.26);
}

.secondary-button {
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent);
}

.ghost-button {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.segmented-button:hover,
.view-card:hover,
.preset-button:hover {
  transform: translateY(-1px);
}

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

.segmented-button {
  min-height: 40px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-main);
  font-weight: 600;
}

.segmented-button.is-active,
.preset-button.is-active,
.view-card.is-active {
  background: rgba(79, 70, 229, 0.14);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.24);
}

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

.preset-grid--compact {
  margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.preset-button {
  min-height: 40px;
  padding: 0 12px;
  background: rgba(148, 163, 184, 0.12);
  font-weight: 600;
  color: var(--text-main);
}

.preset-grid--compact .preset-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 0.82rem;
}

.compact-header {
  margin-top: 12px;
}

.status {
  min-height: 24px;
  font-size: 0.94rem;
  color: var(--text-soft);
}

.status.is-success {
  color: #15803d;
}

.status.is-error {
  color: var(--danger);
}

.prompt-simulation-output {
  margin: 0;
  white-space: pre-wrap;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.45;
  max-height: 18rem;
  overflow: auto;
}

.session-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.session-card__header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.session-card__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 16px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(226, 232, 240, 0.85)),
    repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.08) 0, rgba(148, 163, 184, 0.08) 10px, rgba(255, 255, 255, 0.18) 10px, rgba(255, 255, 255, 0.18) 20px);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.session-card__preview-image {
  max-width: 100%;
  max-height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(15, 23, 42, 0.14));
}

.session-card__qr-wrap {
  display: flex;
  justify-content: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(79, 70, 229, 0.05);
}

.session-card__qr {
  width: min(100%, 220px);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

/* ── Logo-Setup Modal ──────────────────────────────────────────────────────── */
.logo-setup-modal {
  width: min(1020px, calc(100vw - 32px));
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.logo-setup-modal::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(8px);
}

.logo-setup-modal__surface {
  display: grid;
  gap: 20px;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
}

.logo-setup-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.logo-setup-modal__header h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.logo-setup-modal__body {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.logo-setup-modal__canvas-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 16px;
  border-radius: 16px;
  background:
    linear-gradient(45deg, rgba(226,232,240,0.8) 25%, transparent 25%, transparent 75%, rgba(226,232,240,0.8) 75%),
    linear-gradient(45deg, rgba(226,232,240,0.8) 25%, transparent 25%, transparent 75%, rgba(226,232,240,0.8) 75%),
    #ffffff;
  background-position: 0 0, 12px 12px, 0 0;
  background-size: 24px 24px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.logo-setup-modal__canvas {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  cursor: crosshair;
}

.logo-setup-modal__canvas-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.logo-setup-modal__canvas-wrap.is-picking .logo-setup-modal__canvas-hint {
  opacity: 1;
}

.logo-setup-modal__canvas-wrap.is-picking .logo-setup-modal__canvas {
  cursor: crosshair;
  outline: 3px solid #3b82f6;
  border-radius: 4px;
}

.logo-setup-modal__fields {
  display: grid;
  gap: 16px;
  align-content: start;
}

.logo-setup-modal__color-section {
  display: grid;
  gap: 10px;
}

.logo-setup-modal__color-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logo-setup-color-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: rgba(248, 250, 252, 0.9);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.logo-setup-color-slot:hover {
  background: rgba(239, 246, 255, 0.95);
  border-color: #93c5fd;
}

.logo-setup-color-slot.is-active {
  border-color: #3b82f6;
  background: rgba(239, 246, 255, 0.95);
}

.logo-setup-color-slot__swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #e2e8f0;
  flex-shrink: 0;
}

.logo-setup-color-slot__row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

/* ── Pantone-Suche pro Slot ─────────────────────────────────────────────────── */
.logo-setup-slot-search {
  position: relative;
  margin-top: 7px;
}

.logo-setup-slot-search__input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 10px;
  font-size: 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.logo-setup-slot-search__input:focus {
  border-color: #3b82f6;
}

.logo-setup-slot-search__results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 9999;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.18);
}

.logo-setup-slot-search__item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.1s;
}

.logo-setup-slot-search__item:hover {
  background: #eff6ff;
}

.logo-setup-slot-search__item.is-priority {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
}

.logo-setup-slot-search__item.is-priority:hover {
  background: #eff6ff;
}

.logo-setup-slot-search__swatch {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,0.14);
  flex-shrink: 0;
}

.logo-setup-slot-search__name {
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
  flex: 1;
}

.logo-setup-slot-search__hex {
  font-size: 11px;
  color: #64748b;
}

.logo-setup-color-slot__info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.logo-setup-color-slot__pantone {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-setup-color-slot__hex {
  font-size: 11px;
  color: #64748b;
}

.logo-setup-color-slot__label {
  font-size: 12px;
  color: #94a3b8;
}

.logo-setup-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.logo-editor-modal {
  width: min(1120px, calc(100vw - 32px));
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: transparent;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.logo-editor-modal::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(8px);
}

.logo-editor-modal__surface {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
}

.logo-editor-modal__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.logo-editor-modal__body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.logo-editor-modal__preview,
.logo-editor-modal__controls {
  padding: 16px;
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.95);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.logo-editor-modal__preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  background:
    linear-gradient(45deg, rgba(226, 232, 240, 0.8) 25%, transparent 25%, transparent 75%, rgba(226, 232, 240, 0.8) 75%),
    linear-gradient(45deg, rgba(226, 232, 240, 0.8) 25%, transparent 25%, transparent 75%, rgba(226, 232, 240, 0.8) 75%),
    #ffffff;
  background-position: 0 0, 12px 12px, 0 0;
  background-size: 24px 24px;
}

.logo-editor-modal__preview--white {
  background: #ffffff;
}

.logo-editor-modal__preview--gray {
  background: #888888;
}

.logo-editor-modal__preview--black {
  background: #111111;
}

.logo-editor-bg-switcher {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  z-index: 10;
}

.logo-editor-bg-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1.5px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.85);
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  backdrop-filter: blur(4px);
}

.logo-editor-bg-btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(79, 70, 229, 0.5);
  color: var(--accent, #4f46e5);
}

.logo-editor-bg-btn.is-active {
  background: rgba(79, 70, 229, 0.15);
  border-color: rgba(79, 70, 229, 0.6);
  color: var(--accent, #4f46e5);
}

.logo-editor-modal__controls {
  display: grid;
  gap: 12px;
  align-content: start;
}

.logo-editor-upload-settings {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.72);
}

.logo-editor-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.logo-editor-canvas {
  max-width: 100%;
  max-height: 520px;
  border-radius: 16px;
  background: transparent;
  cursor: crosshair;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.logo-editor-color-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.logo-editor-color-row--target {
  grid-template-columns: 56px minmax(0, 1fr);
}

.logo-editor-swatch {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.logo-editor-tool.is-active {
  background: rgba(79, 70, 229, 0.16);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.22);
}

/* ── Quell/Ziel-Spalten im Logo-Editor ─────────────────────────────────────── */
.logo-editor-color-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.logo-editor-color-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.logo-editor-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.logo-editor-action-row button {
  width: 100%;
}

.logo-editor-apply-row {
  margin-top: 8px;
}

/* ── Logo-Editor Toolbar ──────────────────────────────────────────────────── */
.logo-editor-toolbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.logo-editor-toolbar button {
  width: 100%;
  white-space: nowrap;
  font-size: 12px;
  padding-left: 6px;
  padding-right: 6px;
}

/* ── Logo-Farben Slots im Editor ──────────────────────────────────────────── */
.logo-editor-slots-section {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(248, 250, 252, 0.6);
  margin-top: 4px;
}

.logo-editor-slots-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (max-width: 600px) {
  .logo-editor-upload-grid {
    grid-template-columns: 1fr;
  }
  .logo-editor-color-columns {
    grid-template-columns: 1fr;
  }
  .logo-editor-action-row {
    grid-template-columns: 1fr;
  }
}

/* ── Pantone-Match im Logo-Editor ───────────────────────────────────────────── */
.logo-editor-pantone-match {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.9);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.logo-editor-pantone-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #e2e8f0;
  flex-shrink: 0;
}

.logo-editor-pantone-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.logo-editor-pantone-results {
  max-height: 180px;
  overflow-y: auto;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
  margin-top: 6px;
  background: #fff;
}

.logo-editor-pantone-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.1s;
}

.logo-editor-pantone-result:hover {
  background: rgba(239, 246, 255, 0.95);
}

.logo-editor-pantone-result__swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.logo-editor-pantone-result__name {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
}

.logo-editor-pantone-result__hex {
  font-size: 11px;
  color: #64748b;
}

@media (max-width: 900px) {
  .logo-editor-modal {
    width: min(100vw - 20px, 980px);
  }

  .logo-editor-modal__body {
    grid-template-columns: 1fr;
  }

  .logo-editor-modal__header {
    flex-direction: column;
    align-items: stretch;
  }
}

.upload-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.upload-card {
  padding: 22px;
  border-radius: 28px;
}

.upload-card__header {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.upload-card__actions {
  margin-top: 14px;
}

.company-upload-card {
  display: grid;
  gap: 18px;
}

.company-upload-card__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.company-upload-card__links {
  display: grid;
  gap: 16px;
}

.upload-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.upload-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.upload-item__preview {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.95);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.upload-item__meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.upload-item__name {
  font-weight: 700;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.upload-item__sub {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.logo-selection {
  border: 3px dashed rgba(79, 70, 229, 0.65);
  background: rgba(79, 70, 229, 0.08);
  border-radius: 12px;
  display: none;
  pointer-events: none;
  z-index: 5;
}

.logo-transform-info {
  position: absolute;
  display: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  z-index: 6;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  transform: translateX(-50%);
  transition: background 0.15s;
}
.logo-transform-info:hover {
  background: rgba(79, 70, 229, 0.92);
}

/* X-Button oben rechts im Auswahl-Rahmen */
.remove-logo-inline {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  cursor: pointer;
  pointer-events: all;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  transition: background 0.15s, transform 0.1s;
}
.remove-logo-inline:hover {
  background: #b91c1c;
  transform: scale(1.15);
}

/* Popup für cm-Eingabe */
.logo-size-popup {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(79, 70, 229, 0.6);
  border-radius: 10px;
  padding: 6px 10px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  transform: translateX(-50%);
}
.logo-size-popup[hidden] { display: none; }
.logo-size-popup input {
  width: 70px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 3px 6px;
  text-align: center;
}
.logo-size-popup input:focus { outline: none; border-color: #818cf8; }
.logo-size-popup__unit {
  color: #a5b4fc;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Rechtsklick-Kontextmenü */
.logo-context-menu {
  position: fixed;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: #1e293b;
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  z-index: 9999;
  min-width: 180px;
}
.logo-context-menu[hidden] { display: none; }
.logo-context-menu__item {
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s;
}
.logo-context-menu__item:hover {
  background: rgba(99, 102, 241, 0.2);
}
.logo-context-menu__item--danger { color: #fca5a5; }
.logo-context-menu__item--danger:hover { background: rgba(239, 68, 68, 0.2); }
.logo-context-menu__separator {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 4px 0;
}

.resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: #4f46e5;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.22);
  pointer-events: auto;
  padding: 0;
  min-width: 0;
  min-height: 0;
}

.rotate-handle {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: #0f172a;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.22);
  pointer-events: auto;
  padding: 0;
  min-width: 0;
  min-height: 0;
  cursor: grab;
}

.rotate-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 12px;
  background: rgba(15, 23, 42, 0.45);
  transform: translateX(-50%);
}

.resize-handle--tl {
  top: -8px;
  left: -8px;
  cursor: nwse-resize;
}

.resize-handle--tr {
  top: -8px;
  right: -8px;
  cursor: nesw-resize;
}

.resize-handle--bl {
  bottom: -8px;
  left: -8px;
  cursor: nesw-resize;
}

.resize-handle--br {
  bottom: -8px;
  right: -8px;
  cursor: nwse-resize;
}

body.logo-selected #logoSelection {
  display: block;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: 580px;
  }

  .popout-group .collapsible-content {
    position: static;
    width: auto;
    max-height: none;
    padding: 0;
    margin-top: 12px;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
    gap: 16px;
  }

  .controls-panel {
    padding: 18px;
  }

  .stage {
    min-height: 460px;
    border-radius: 24px;
    padding: 12px;
  }

  .measurement-stage {
    grid-template-rows: 22px 1fr;
  }

  .measurement-stage__body {
    grid-template-columns: 22px 1fr;
  }

  .stack-mobile {
    flex-direction: column;
  }

  .sizes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Garment Preview Modal ─────────────────────────── */
.garment-preview-modal {
  width: min(780px, calc(100vw - 32px));
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.garment-preview-modal::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(8px);
}

.garment-preview-modal form {
  display: grid;
  gap: 0;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.modal__header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--text-secondary, #64748b);
  line-height: 1;
}

.modal__close:hover {
  background: rgba(15, 23, 42, 0.06);
}

.modal__body {
  padding: 20px 24px;
}

.modal__footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.garment-preview-modal__body {
  display: grid;
  gap: 16px;
}

.garment-preview-modal__hint {
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
  margin: 0;
}

.garment-preview-modal__status {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.18);
  font-size: 0.88rem;
  color: var(--accent, #4f46e5);
  text-align: center;
  animation: garment-pulse 1.4s ease-in-out infinite;
}

@keyframes garment-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.garment-preview-modal__result {
  display: grid;
  gap: 10px;
}

.garment-preview-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.garment-preview-modal__view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.garment-preview-modal__view-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.garment-preview-modal__view img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  object-fit: contain;
  background: #f8fafc;
  min-height: 140px;
}

.garment-preview-modal__prompt-text {
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
  text-align: center;
  font-style: italic;
  margin: 0;
  padding: 0 8px;
}