:root {
  /* Marken-Tokens & Fonts kommen zentral aus dem o-byte-Theme (shared.css).
     Hier nur logo-generator-spezifische Abweichungen. */
  --ob-surface-soft: #eef7fb;
  --ob-text-soft: rgba(52, 53, 55, 0.7);
  --ob-shadow: 0 24px 46px rgba(52, 53, 55, 0.1);
  --ob-focus: 0 0 0 3px rgba(0, 167, 230, 0.26);
  --ob-radius: 18px;
}

/* ── Scoped reset ──────────────────────────────────────────────────────────── */

.logo-gen-wrap *,
.logo-gen-wrap *::before,
.logo-gen-wrap *::after {
  box-sizing: border-box;
}

.logo-gen-wrap {
  color: var(--ob-text);
  font-family: var(--ob-font-body);
  line-height: 1.58;
  background:
    radial-gradient(circle at top right, rgba(51, 185, 235, 0.16), transparent 26%),
    linear-gradient(180deg, #f7fcff 0%, #eef7fb 42%, #f5fbfe 100%);
}

.logo-gen-wrap a,
.logo-gen-wrap button,
.logo-gen-wrap input,
.logo-gen-wrap select {
  font: inherit;
}

.logo-gen-wrap a {
  color: inherit;
  text-decoration: none;
}

.logo-gen-wrap button,
.logo-gen-wrap select,
.logo-gen-wrap input[type="range"],
.logo-gen-wrap input[type="color"] {
  cursor: pointer;
}

.logo-gen-wrap a:focus,
.logo-gen-wrap button:focus,
.logo-gen-wrap input:focus,
.logo-gen-wrap select:focus,
.logo-gen-wrap canvas:focus {
  outline: none;
  box-shadow: var(--ob-focus);
}

.logo-gen-wrap h2,
.logo-gen-wrap h3,
.logo-gen-wrap th {
  margin: 0;
  font-family: var(--ob-font-heading);
  font-weight: 700;
}

.logo-gen-wrap h2 {
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.14;
}

.logo-gen-wrap h3 {
  margin-bottom: 8px;
  font-size: 21px;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */

.logo-gen-wrap .main {
  padding: 16px 24px;
}

.logo-gen-wrap .section {
  max-width: 1240px;
  margin: 0 auto;
}

/* Schritt 1 oben über volle Breite, darunter Schritt 2 | Schritt 3 | Live-Vorschau. */
.logo-gen-wrap .workspace__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "preset   preset   preset"
    "logo     position preview";
  gap: 18px;
  align-items: start;
}

.logo-gen-wrap .workspace__grid > .card {
  overflow: visible;
}

.logo-gen-wrap .card--preset {
  grid-area: preset;
}

.logo-gen-wrap .card--logo {
  grid-area: logo;
}

.logo-gen-wrap .card--position {
  grid-area: position;
}

.logo-gen-wrap .preview-card {
  grid-area: preview;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */

.logo-gen-wrap .card {
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--ob-shadow);
  padding: 18px;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.logo-gen-wrap .section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.logo-gen-wrap .section-head--tight {
  margin-bottom: 14px;
}

.logo-gen-wrap .kicker {
  margin: 0;
  color: var(--ob-text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ── Tags ──────────────────────────────────────────────────────────────────── */

.logo-gen-wrap .tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(0, 167, 230, 0.28);
  background: rgba(0, 167, 230, 0.11);
  color: var(--ob-blue-shade-2);
}

.logo-gen-wrap .tag--soft {
  background: rgba(52, 53, 55, 0.08);
  border-color: rgba(52, 53, 55, 0.12);
  color: var(--ob-text-soft);
}

/* ── Fields ────────────────────────────────────────────────────────────────── */

.logo-gen-wrap .field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.logo-gen-wrap .is-hidden {
  display: none !important;
}

.logo-gen-wrap .field > span,
.logo-gen-wrap .field__row span {
  color: var(--ob-text-soft);
}

.logo-gen-wrap .field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.logo-gen-wrap .field__row strong {
  font-family: var(--ob-font-strong);
  font-weight: 600;
  color: var(--ob-text);
}

.logo-gen-wrap .mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.logo-gen-wrap .mode-toggle__button {
  min-height: 38px;
  border: 1px solid var(--ob-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ob-text-soft);
  font-family: var(--ob-font-strong);
  font-weight: 600;
}

.logo-gen-wrap .mode-toggle__button.is-active {
  border-color: rgba(0, 167, 230, 0.42);
  background: rgba(0, 167, 230, 0.1);
  color: var(--ob-blue-shade-2);
}

.logo-gen-wrap .input,
.logo-gen-wrap .select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--ob-border);
  border-radius: 14px;
  background: var(--ob-surface);
  color: var(--ob-text);
  padding: 10px 12px;
}

.logo-gen-wrap .input--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.logo-gen-wrap .color-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
}

.logo-gen-wrap .color-picker {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--ob-border);
  border-radius: 14px;
  background: #ffffff;
  padding: 4px;
}

/* ── Upload zone ───────────────────────────────────────────────────────────── */

.logo-gen-wrap .upload-zone {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px dashed rgba(0, 167, 230, 0.38);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(0, 167, 230, 0.05), rgba(0, 167, 230, 0.09)),
    var(--ob-surface-soft);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.logo-gen-wrap .upload-zone:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 167, 230, 0.58);
}

.logo-gen-wrap .upload-zone strong {
  font-family: var(--ob-font-strong);
  font-weight: 600;
}

.logo-gen-wrap .upload-zone span {
  color: var(--ob-text-soft);
}

.logo-gen-wrap .upload-zone__hint {
  font-size: 12px;
  line-height: 1.4;
}

.logo-gen-wrap .upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.logo-gen-wrap .file-meta,
.logo-gen-wrap .hint {
  color: var(--ob-text-soft);
  font-size: 13px;
}

.logo-gen-wrap .file-meta {
  min-height: 34px;
  margin-bottom: 12px;
}

/* ── Gradient editor ───────────────────────────────────────────────────────── */

.logo-gen-wrap .gradient-editor {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.logo-gen-wrap .card--logo .field {
  margin-bottom: 10px;
}

.logo-gen-wrap .card--logo .gradient-editor {
  gap: 10px;
  margin-bottom: 10px;
}

.logo-gen-wrap .card--logo .upload-zone {
  padding: 12px;
}

.logo-gen-wrap .card--logo .file-meta {
  min-height: 24px;
  margin-bottom: 10px;
}

/* ── Safespace Checkbox ─────────────────────────────────────────────────────── */

.logo-gen-wrap .checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--ob-border);
  border-radius: 8px;
  background: rgba(0, 167, 230, 0.05);
  cursor: pointer;
}

.logo-gen-wrap .checkbox-field input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--ob-blue);
}

.logo-gen-wrap .checkbox-field strong,
.logo-gen-wrap .checkbox-field small {
  display: block;
}

.logo-gen-wrap .checkbox-field strong {
  font-family: var(--ob-font-strong);
  font-weight: 600;
  line-height: 1.35;
}

.logo-gen-wrap .checkbox-field small {
  color: var(--ob-text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.logo-gen-wrap .gradient-track {
  position: relative;
  height: 58px;
  border: 1px solid var(--ob-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 10px 18px;
}

.logo-gen-wrap .gradient-track__fill {
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(52, 53, 55, 0.12);
}

.logo-gen-wrap .gradient-track__stops {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  bottom: 8px;
}

.logo-gen-wrap .gradient-stop {
  position: absolute;
  top: 27px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 5px 14px rgba(52, 53, 55, 0.18);
  transform: translateX(-50%);
  cursor: grab;
}

.logo-gen-wrap .gradient-stop::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  width: 2px;
  height: 10px;
  background: rgba(52, 53, 55, 0.28);
  transform: translateX(-50%);
}

.logo-gen-wrap .gradient-stop.is-active {
  outline: 2px solid rgba(0, 167, 230, 0.55);
  outline-offset: 2px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.logo-gen-wrap .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: var(--ob-font-strong);
  font-weight: 600;
}

.logo-gen-wrap .btn:disabled {
  cursor: wait;
  opacity: 0.68;
}

.logo-gen-wrap .btn--primary {
  background: linear-gradient(135deg, var(--ob-blue) 0%, var(--ob-blue-soft) 100%);
  color: #ffffff;
}

.logo-gen-wrap .btn--primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.logo-gen-wrap .btn--light {
  background: #ffffff;
  border-color: var(--ob-border);
  color: var(--ob-text);
}

.logo-gen-wrap .btn--light:hover:not(:disabled),
.logo-gen-wrap .btn--ghost:hover:not(:disabled) {
  border-color: rgba(0, 167, 230, 0.42);
}

.logo-gen-wrap .btn--ghost {
  background: rgba(245, 251, 254, 0.1);
  border-color: rgba(245, 251, 254, 0.3);
  color: #f5fbfe;
}

.logo-gen-wrap .btn--small {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.logo-gen-wrap .action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Info tiles ────────────────────────────────────────────────────────────── */

.logo-gen-wrap .info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.logo-gen-wrap .info-tile {
  border: 1px solid var(--ob-border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(0, 167, 230, 0.04), rgba(0, 167, 230, 0));
  padding: 12px;
}

.logo-gen-wrap .info-tile span {
  display: block;
  margin-bottom: 4px;
  color: var(--ob-text-soft);
  font-size: 12px;
}

.logo-gen-wrap .info-tile strong {
  font-family: var(--ob-font-strong);
  font-size: 15px;
  font-weight: 600;
}

.logo-gen-wrap .range {
  width: 100%;
  accent-color: var(--ob-blue);
}

/* ── Preview ───────────────────────────────────────────────────────────────── */

.logo-gen-wrap .preview-card {
  min-height: 500px;
}

.logo-gen-wrap .preview-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 8px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(0, 167, 230, 0.08), rgba(245, 251, 254, 0.78)),
    #f0f7fb;
}

.logo-gen-wrap .device-stage {
  flex: 1;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 26px;
  padding: clamp(10px, 1.4vw, 16px);
  background: linear-gradient(180deg, #35383a 0%, #232628 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.logo-gen-wrap .preview-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #ffffff;
  cursor: grab;
}

.logo-gen-wrap .preview-canvas.is-dragging {
  cursor: grabbing;
}

/* ── Export box ────────────────────────────────────────────────────────────── */

.logo-gen-wrap .export-box {
  margin-bottom: 12px;
  border: 1px solid var(--ob-border);
  border-radius: 14px;
  background: rgba(0, 167, 230, 0.05);
  padding: 12px;
}

.logo-gen-wrap .export-box__line {
  margin: 0;
}

.logo-gen-wrap .export-box__line + .export-box__line {
  margin-top: 6px;
}

/* ── Status toast ──────────────────────────────────────────────────────────── */

.logo-gen-wrap .status {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(17, 17, 20, 0.94);
  color: #ffffff;
  padding: 11px 14px;
  box-shadow: 0 12px 24px rgba(34, 34, 33, 0.28);
  z-index: 9999;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-height: 980px) {
  .logo-gen-wrap .main {
    padding: 12px 18px;
  }

  .logo-gen-wrap .workspace__grid {
    gap: 14px;
  }

  .logo-gen-wrap .card {
    padding: 15px;
  }

  .logo-gen-wrap .field {
    margin-bottom: 10px;
  }

  .logo-gen-wrap .hint,
  .logo-gen-wrap .file-meta {
    font-size: 12px;
  }
}

@media (max-width: 1080px) {
  .logo-gen-wrap .workspace__grid {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    height: auto;
    min-height: unset;
  }

  .logo-gen-wrap .card--preset,
  .logo-gen-wrap .card--logo,
  .logo-gen-wrap .card--position,
  .logo-gen-wrap .preview-card {
    grid-area: auto;
  }

  .logo-gen-wrap .main {
    padding-bottom: 88px;
  }

  .logo-gen-wrap .preview-card {
    min-height: 420px;
  }
}

@media (max-width: 720px) {
  .logo-gen-wrap .main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .logo-gen-wrap .card {
    padding: 16px;
  }

  .logo-gen-wrap .color-row,
  .logo-gen-wrap .info-grid {
    grid-template-columns: 1fr;
  }

  .logo-gen-wrap .workspace__grid {
    gap: 12px;
  }
}
