:root {
  --bg: #070b10;
  --bg2: #0b1118;
  --panel: #121a24;
  --panel2: #0f1620;
  --card: #101923;
  --card2: #121f2c;
  --border: #223244;
  --border2: #1e2a3a;
  --line: #223244;
  --line2: #2b425c;
  --text: #e8eef6;
  --muted: #9fb3c8;
  --soft: #c8d7e6;
  --blue: #28a9d6;
  --blue2: #7bd3ff;
  --dark: #2f3744;
  --ok: #7ee787;
  --warn: #ffd166;
  --danger: #ff8a8a;
  --shadow: 0 22px 70px rgba(0, 0, 0, .35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at 15% 0%, rgba(40, 169, 214, .18), transparent 32%), radial-gradient(circle at 90% 10%, rgba(123, 211, 255, .10), transparent 30%), linear-gradient(180deg, var(--bg), #0a1017 45%, #070b10);
  color: var(--text);
  line-height: 1.6;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border: 2px solid var(--blue2);
  border-radius: 10px;
  background: #07131d;
  color: #fff;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

a {
  color: var(--blue2);
  text-decoration: none;
}

a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Tastaturfokus: immer eindeutig sichtbar, ohne die Mausbedienung zu stören. */
:focus-visible {
  outline: 3px solid var(--blue2);
  outline-offset: 3px;
}

a:focus-visible {
  color: #fff;
  text-decoration: underline;
  border-radius: 4px;
}

small, .muted, .small {
  color: var(--muted);
}

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

h1 {
  font-size: clamp(1.8rem, 5vw, 4.4rem);
  line-height: 1.05;
  margin-bottom: 14px;
  letter-spacing: -.035em;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 2.25rem);
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -.02em;
  color: #fff;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

p {
  margin: 8px 0;
  color: var(--muted);
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(7, 11, 16, .78);
  border-bottom: 1px solid rgba(34, 50, 68, .78);
}

.nav {
  max-width: 1160px;
  margin: 0 auto;
  padding: 12px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}

.brand-title {
  display: block;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  font-size: .78rem;
  color: var(--muted);
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--soft);
  font-size: .92rem;
  padding: 8px 10px;
  border-radius: 999px;
}

.nav-links a:hover {
  background: rgba(123, 211, 255, .08);
  color: #fff;
  text-decoration: none;
}

/* schmale Seitennavigation auf Unterseiten */

main.wrap > .nav {
  padding: 0;
  margin: 0 0 18px;
  justify-content: flex-start;
  max-width: none;
}

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.logo {
  height: 70px;
  width: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px;
}

.hero {
  padding: 58px 0 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  gap: 24px;
  align-items: stretch;
}

.hero-panel, .card, .portal-panel {
  background: linear-gradient(180deg, rgba(18, 31, 44, .96), rgba(12, 19, 28, .96));
  border: 1px solid rgba(43, 66, 92, .9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 34px;
  position: relative;
  overflow: hidden;
}

.hero-panel:before {
  content: "";
  position: absolute;
  inset: -2px;
  background: radial-gradient(circle at 85% 20%, rgba(40, 169, 214, .24), transparent 32%);
  pointer-events: none;
}

.hero-panel>* {
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid rgba(123, 211, 255, .28);
  border-radius: 999px;
  background: rgba(40, 169, 214, .08);
  color: var(--blue2);
  font-size: .88rem;
  margin-bottom: 20px;
}

.lead {
  color: var(--soft);
  font-size: 1.12rem;
  max-width: 760px;
  margin-bottom: 24px;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 15px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: #0f1620;
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
  transition: .18s ease;
  font: inherit;
}

.btn:hover, button:hover {
  transform: translateY(-1px);
  background: #162333;
  border-color: #3b5b7c;
  color: #fff;
  text-decoration: none;
}

.btn-primary, button {
  background: linear-gradient(135deg, #167fa4, #28a9d6);
  border-color: #3cc8f7;
  color: #051018;
}

.btn-primary:hover, button:hover {
  background: linear-gradient(135deg, #20a4d2, #7bd3ff);
  color: #051018;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none!important;
}

.quick-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quick-logo {
  width: 100%;
  min-height: 160px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(40, 169, 214, .10));
  overflow: hidden;
}

.quick-logo img {
  width: min(260px, 90%);
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: auto;
}

.stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(7, 11, 16, .38);
}

.stat b {
  display: block;
  font-size: 1.15rem;
  color: #fff;
}

.stat span {
  font-size: .78rem;
  color: var(--muted);
}

.section {
  padding: 28px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-head p {
  color: var(--muted);
  max-width: 720px;
  margin-bottom: 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
}

.card {
  padding: 22px;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.card ul {
  padding-left: 20px;
  margin: 12px 0 0;
  color: var(--soft);
}

.card li {
  margin: 4px 0;
}

.portal-panel {
  padding: 24px;
  margin-top: 4px;
}

.portal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #2a3d55;
  border-radius: 999px;
  margin: 3px 4px 3px 0;
  background: rgba(15, 22, 32, .76);
  color: var(--soft);
  font-size: .88rem;
}

form {
  display: grid;
  gap: 10px;
}

label {
  font-size: .9rem;
  color: var(--soft);
}

input, select, textarea {
  width: 100%;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0f1620;
  color: var(--text);
  outline: none;
  font: inherit;
}

textarea {
  min-height: 170px;
  resize: vertical;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(123, 211, 255, .34);
}

input[type="checkbox"] {
  width: auto;
  box-shadow: none;
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline-offset: 2px;
}

input[type="date"],
input[type="datetime-local"],
input[type="time"] {
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  filter: invert(1) brightness(1.8);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  background-color: rgba(123, 211, 255, .28);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 12px 0;
}

.data {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 8px 18px;
  margin-top: 10px;
}

.label {
  color: var(--muted);
}

.value {
  color: var(--text);
}

.note, .notice {
  margin-top: 22px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 22, 32, .8);
  color: var(--muted);
  font-size: .95rem;
}

.notice {
  margin: 0 0 18px;
}

.success {
  border-color: rgba(126, 231, 135, .38);
  background: rgba(126, 231, 135, .08);
  color: var(--ok);
}

.error {
  border-color: rgba(255, 138, 138, .42);
  background: rgba(255, 138, 138, .08);
  color: var(--danger);
}

.honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.footer, footer {
  margin-top: 34px;
  padding: 22px 0 34px;
  border-top: 1px solid rgba(34, 50, 68, .8);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .92rem;
}

@media (max-width:860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 34px;
  }

  .grid-3, .grid-2, .grid {
    grid-template-columns: 1fr;
  }

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

  .nav-links {
    justify-content: flex-start;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .data {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .label {
    margin-top: 10px;
  }
}

@media (max-width:520px) {
  .wrap, .nav {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-panel, .card, .portal-panel {
    border-radius: 20px;
    padding: 18px;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  .logo {
    height: 58px;
  }

  .quick-logo {
    min-height: 125px;
  }

  .cta-row .btn {
    width: 100%;
  }
}

.alert {
  margin: 1.2rem 0;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  font-weight: 500;
  border: 1px solid transparent;
}

.alert-success {
  background: rgba(40, 169, 214, 0.12);
  border-color: rgba(40, 169, 214, 0.45);
  color: #8ee7ff;
}

.alert-error {
  background: rgba(255, 90, 90, 0.12);
  border-color: rgba(255, 90, 90, 0.45);
  color: #ffb4b4;
}

/* SHOP / Kassenartikel */

.hero-shop {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
}

.product-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.product-card .cta-row {
  margin-top: auto;
}

.product-card .badge {
  align-self: flex-start;
  margin-bottom: 10px;
}

.product-detail .lead {
  font-size: 1.02rem;
  margin-bottom: 14px;
}

/* Öffentliche 3D-Druck-Referenzseite */
.print-page { max-width: 1160px; }
.print-hero { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(280px,.95fr); gap:26px; padding:26px; overflow:hidden; }
.print-hero-image, .light-card { margin:0; }
.print-hero-image img { display:block; width:100%; height:100%; min-height:310px; max-height:450px; object-fit:cover; border:1px solid var(--line); border-radius:18px; }
.print-hero-image figcaption { margin-top:8px; color:var(--muted); font-size:.86rem; }
.print-example-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.print-example-card { padding:0; overflow:hidden; display:flex; flex-direction:column; }
.print-example-card > img { display:block; width:100%; aspect-ratio:4/5; object-fit:cover; background:#071018; border-bottom:1px solid var(--line); }
.print-example-copy { padding:18px; }
.print-example-copy h3 { color:#fff; }
.print-specs { display:flex; flex-wrap:wrap; gap:7px; margin-top:14px; }
.print-specs span { color:var(--soft); background:rgba(7,11,16,.42); border:1px solid rgba(43,66,92,.8); padding:4px 8px; border-radius:999px; font-size:.78rem; }
.lithophan-showcase { padding-top:12px; }
.lithophan-light-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.light-card { padding:12px; }
.light-card img { display:block; width:100%; aspect-ratio:4/5; object-fit:cover; border-radius:13px; background:#071018; border:1px solid var(--line); }
.light-card figcaption { display:grid; gap:2px; padding:12px 5px 2px; }
.light-card figcaption b { color:#fff; }
.light-card figcaption span { color:var(--muted); font-size:.9rem; }
.option-card .badge { margin-top:10px; }
.surface-gallery { margin-top:16px; }
.surface-gallery-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:16px; }
.surface-gallery-head h3 { color:#fff; }
.surface-gallery-head p { max-width:760px; }
.surface-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:12px; }
.surface-grid figure { margin:0; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:#081018; }
.surface-grid img { display:block; width:100%; aspect-ratio:4/5; object-fit:cover; }
.surface-grid figcaption { padding:9px 11px; color:var(--soft); font-weight:700; font-size:.9rem; }
.print-steps { margin:0; padding-left:23px; color:var(--soft); }
.print-steps li { margin:10px 0; padding-left:4px; }
.print-steps b { color:#fff; }
.print-notice { margin-top:12px; }

@media (max-width:1040px) { .print-example-grid, .surface-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) { .print-hero, .lithophan-light-grid { grid-template-columns:1fr; } .print-hero-image img { min-height:0; max-height:390px; } }
@media (max-width:520px) { .print-example-grid, .surface-grid { grid-template-columns:1fr; } .print-hero { padding:18px; } }

@media (max-width:860px) {
  .hero-shop {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------
   IMG_GEN / ed_form.php
   Ausgelagerte Original-Styles aus ed_form_v1.php.
   Wichtig: bewusst auf .imggen-page begrenzt, damit die
   globale Webseite die kompakte Galerie/Modal-Logik nicht stört.
--------------------------------------------------------- */

.imggen-page {
  margin: 0;
  font-family: system-ui, Arial;
  background: #0b0f14;
  color: #e8eef6;
}

.imggen-page .wrap {
  max-width: 1024px;
  margin: 0 auto;
  padding: 20px;
}

.imggen-page .card {
  background: #121a24;
  border: 1px solid #1e2a3a;
  border-radius: 16px;
  padding: 16px;
}

.imggen-page input, .imggen-page select, .imggen-page textarea, .imggen-page button {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #223244;
  background: #0f1620;
  color: #e8eef6;
}

.imggen-page textarea {
  min-height: 110px;
  resize: vertical;
}

.imggen-page .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.imggen-page .col {
  flex: 1;
  min-width: 160px;
}

.imggen-page button {
  cursor: pointer;
  background: #1a2a3f;
}

.imggen-page button:hover {
  background: #223a57;
}

.imggen-page button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.imggen-page a {
  color: #7bd3ff;
  text-decoration: none;
}

.imggen-page small, .imggen-page .muted {
  color: #9fb3c8;
}

.imggen-page .badge {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid #2a3d55;
  border-radius: 999px;
  margin-right: 6px;
}

.imggen-page .spacer {
  height: 12px;
}

.imggen-page .statusbox {
  margin-top: 14px;
  background: #0f1620;
  border: 1px solid #223244;
  border-radius: 12px;
  padding: 12px;
  color: #cfe7ff;
}

.imggen-page .statusbox.ok {
  border-color: #2f7d55;
  color: #b9ffd6;
}

.imggen-page .statusbox.err {
  border-color: #7d2f2f;
  color: #ffd1d1;
}

.imggen-page .costbar, .imggen-page .progressbar {
  width: 100%;
  height: 12px;
  background: #0c1a2a;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid #223244;
}

.imggen-page #costfill, .imggen-page #progressfill {
  height: 100%;
  width: 0%;
  background: #3aa3ff;
  transition: width .25s ease;
}

.imggen-page #progressfill.running {
  animation: imggenPulse 1s infinite alternate;
}

@keyframes imggenPulse {
  from {
    opacity: .45;
  }

  to {
    opacity: 1;
  }
}

.imggen-page #costtext, .imggen-page #progresstext {
  margin-top: 6px;
  font-size: 14px;
  color: #9fb3c8;
}

.imggen-page .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.imggen-page .thumb {
  background: #0f1620;
  border: 1px solid #223244;
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  color: #e8eef6;
  width: 100%;
}

.imggen-page .thumb:hover {
  border-color: #3aa3ff;
  transform: translateY(-1px);
}

.imggen-page .thumb img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
  display: block;
}

.imggen-page .thumb-title {
  font-size: 11px;
  opacity: .78;
  margin-top: 6px;
  word-break: break-all;
}

.imggen-page .modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.imggen-page .modal.open {
  display: flex;
}

.imggen-page .modal-card {
  max-width: 1100px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  background: #121a24;
  border: 1px solid #2a3d55;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}

.imggen-page .modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.imggen-page .modal-close {
  width: auto;
  padding: 8px 12px;
}

.imggen-page .modal-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(280px, .9fr);
  gap: 16px;
}

.imggen-page .modal-img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #223244;
  background: #000;
}

.imggen-page .detail-row {
  margin-bottom: 10px;
}

.imggen-page .detail-label {
  font-weight: 700;
  color: #cfe7ff;
  margin-bottom: 3px;
}

.imggen-page .detail-value {
  color: #e8eef6;
  word-break: break-word;
  white-space: pre-wrap;
}

.imggen-page .detail-small {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  color: #9fb3c8;
  word-break: break-all;
}

@media (max-width:800px) {
  .imggen-page .modal-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------
   IMG_GEN Vorschau-Fix
   Grund: globale Button-Regeln nutzen inline-flex. Für die
   Thumbnail-Buttons muss der Inhalt wieder blockweise untereinander
   stehen, sonst werden Dateinamen rechts neben das Bild gequetscht.
--------------------------------------------------------- */

.imggen-page .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.imggen-page .gallery button.thumb, .imggen-page .gallery .thumb {
  display: block !important;
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid #223244;
  border-radius: 12px;
  background: #0f1620;
  color: #e8eef6;
  text-align: center;
  cursor: pointer;
  line-height: 1.2;
  gap: 0;
  align-items: initial;
  justify-content: initial;
  transform: none;
}

.imggen-page .gallery button.thumb:hover, .imggen-page .gallery .thumb:hover {
  border-color: #3aa3ff;
  transform: translateY(-1px);
}

.imggen-page .gallery .thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}

.imggen-page .gallery .thumb-title, .imggen-page .gallery .thumb .muted {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  overflow-wrap: normal;
}

.imggen-page .gallery .thumb-title {
  font-size: 11px;
  opacity: .86;
  color: #e8eef6;
}

.imggen-page .gallery .thumb .muted {
  font-size: 11px !important;
  color: #9fb3c8;
}

/* ---------------------------------------------------------
   IMG_GEN Step 3: V4-Aufteilung + dunklere Gleich-Solutions-Farben
   Ziel: Hero/Konto wie V4, Formular auf gemeinsamer CSS-Basis,
   funktionierende Thumbnail-/Modal-Logik bleibt unangetastet.
--------------------------------------------------------- */

main.wrap.imggen-page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px;
  background: transparent;
}

.imggen-page.heroless {
  background: transparent;
}

.imggen-page .hero-imggen {
  padding: 34px 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .7fr);
  gap: 30px;
  align-items: stretch;
}

.imggen-page .hero-imggen .hero-panel, .imggen-page .imggen-account-card {
  background: linear-gradient(180deg, rgba(17, 27, 39, .98), rgba(10, 16, 24, .98));
  border: 1px solid rgba(43, 66, 92, .9);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.imggen-page .hero-imggen .hero-panel {
  padding: 34px;
  position: relative;
  overflow: hidden;
}

.imggen-page .hero-imggen .hero-panel:before {
  content: "";
  position: absolute;
  inset: -2px;
  background: radial-gradient(circle at 88% 16%, rgba(40, 169, 214, .16), transparent 34%), linear-gradient(135deg, rgba(40, 169, 214, .06), transparent 42%);
  pointer-events: none;
}

.imggen-page .hero-imggen .hero-panel > * {
  position: relative;
}

.imggen-page .hero-imggen h1 {
  font-size: clamp(2.3rem, 5vw, 4.1rem);
  margin-bottom: 18px;
}

.imggen-page .hero-imggen .lead {
  max-width: 760px;
  color: var(--soft);
}

.imggen-page .imggen-account-card {
  padding: 28px;
}

.imggen-page .imggen-account-card .notice {
  margin-top: 14px;
}

.imggen-page .imggen-workspace {
  display: block;
}

.imggen-page .imggen-generator-card {
  padding: 22px;
}

.imggen-page .form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.imggen-page .form-col {
  flex: 1;
  min-width: 160px;
}

.imggen-page .form-col-wide {
  flex: 2;
  min-width: 260px;
}

.imggen-page #genForm {
  display: grid;
  gap: 10px;
}

.imggen-page #genForm label {
  display: block;
  margin-top: 2px;
}

.imggen-page #genButton {
  width: 100%;
  margin-top: 12px;
  background: linear-gradient(135deg, #167fa4, #28a9d6);
  border-color: #3cc8f7;
  color: #051018;
  font-weight: 700;
}

.imggen-page #genButton:hover {
  background: linear-gradient(135deg, #20a4d2, #7bd3ff);
  color: #051018;
}

.imggen-page .imggen-status-panel {
  margin-top: 18px;
  border: 1px solid rgba(34, 50, 68, .92);
  border-radius: 18px;
  background: rgba(7, 11, 16, .30);
  padding: 16px;
}

.imggen-page .imggen-status-panel h2 {
  margin-bottom: 12px;
  font-size: clamp(1.25rem, 2.2vw, 1.8rem);
}

.imggen-page .imggen-latest .card {
  padding: 18px;
}

.imggen-page .imggen-latest .gallery {
  margin-top: 0;
}

.imggen-page .thumb-time {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  color: #9fb3c8;
}

/* Dunklere Formular-/Statusflächen, passend zum Root-Design statt altem Demo-Look */

.imggen-page .card, .imggen-page .statusbox, .imggen-page input, .imggen-page select, .imggen-page textarea {
  background: #0d1520;
}

.imggen-page .card {
  border-color: rgba(43, 66, 92, .9);
}

.imggen-page .costbar, .imggen-page .progressbar {
  background: #0a1320;
}

@media (max-width:860px) {
  .imggen-page .hero-imggen {
    grid-template-columns: 1fr;
    padding-top: 24px;
  }
}

@media (max-width:520px) {
  main.wrap.imggen-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .imggen-page .hero-imggen .hero-panel, .imggen-page .imggen-account-card, .imggen-page .imggen-generator-card {
    padding: 18px;
    border-radius: 20px;
  }
}

/* ---------------------------------------------------------
   COINS / coins_overview.php
   Kontoauszug für Coin-Buchungen
--------------------------------------------------------- */

.coins-page .coin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.coins-page .coin-stat {
  border: 1px solid rgba(43, 66, 92, .9);
  border-radius: 16px;
  padding: 16px;
  background: rgba(7, 11, 16, .32);
}

.coins-page .coin-stat span {
  display: block;
  color: var(--muted);
  font-size: .92rem;
}

.coins-page .coin-stat strong {
  display: block;
  font-size: 1.35rem;
  margin-top: 6px;
  color: var(--text);
}

.coins-page .tablewrap {
  overflow-x: auto;
  border: 1px solid rgba(43, 66, 92, .7);
  border-radius: 16px;
  background: rgba(7, 11, 16, .25);
}

.coins-page table.coin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

.coins-page table.coin-table th, .coins-page table.coin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(43, 66, 92, .55);
  text-align: left;
  vertical-align: top;
}

.coins-page table.coin-table th {
  color: var(--soft);
  font-weight: 700;
  background: rgba(15, 22, 32, .72);
}

.coins-page table.coin-table tr:last-child td {
  border-bottom: 0;
}

.coins-page table.coin-table tr:hover td {
  background: rgba(40, 169, 214, .045);
}

.coins-page .amount-plus {
  color: var(--ok);
  font-weight: 700;
  white-space: nowrap;
}

.coins-page .amount-minus {
  color: var(--danger);
  font-weight: 700;
  white-space: nowrap;
}

.coins-page .meta {
  color: var(--muted);
  font-size: .88rem;
  margin-top: 4px;
}

.coins-page .toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.coins-page .badge.ok {
  border-color: rgba(126, 231, 135, .42);
  color: var(--ok);
}

.coins-page .badge.danger {
  border-color: rgba(255, 138, 138, .42);
  color: var(--danger);
}

@media (max-width: 520px) {
  .coins-page .coin-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------
   ADMIN / admin.php
--------------------------------------------------------- */

.admin-page .admin-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

.admin-page .admin-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-page .admin-tablewrap {
  overflow-x: auto;
}

.admin-page .admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  min-width: 1050px;
}

.admin-page .admin-table th, .admin-page .admin-table td {
  padding: 14px;
  text-align: left;
  vertical-align: top;
}

.admin-page .admin-table th {
  color: var(--soft);
  font-weight: 700;
}

.admin-page .admin-table tbody tr {
  background: rgba(15, 22, 32, .82);
  border: 1px solid var(--line);
}

.admin-page .admin-table tbody td {
  border-top: 1px solid rgba(43, 66, 92, .65);
  border-bottom: 1px solid rgba(43, 66, 92, .65);
}

.admin-page .admin-table tbody td:first-child {
  border-left: 1px solid rgba(43, 66, 92, .65);
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

.admin-page .admin-table tbody td:last-child {
  border-right: 1px solid rgba(43, 66, 92, .65);
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.admin-page .admin-checks {

  /*width:25%;*/

  display: grid;
  gap: 6px;
}

.admin-page .admin-field {
  margin-bottom: 10px;
}

.admin-page .admin-field label {
  display: block;
  margin-bottom: 4px;
}

.admin-page .admin-inline-check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.admin-page .admin-vip-row {
  display: grid;
  grid-template-columns: 90px minmax(140px, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.admin-page .admin-table button {
  width: 100%;
}

@media (max-width: 760px) {
  .admin-page .admin-top {
    align-items: flex-start;
  }

  .admin-page .admin-links {
    flex-direction: column;
    gap: 6px;
  }
}

/* ---------------------------------------------------------
   IMG_GEN Galerie / gallery.php
   Ausgelagerte Styles aus dem Inline-<style>-Block.
--------------------------------------------------------- */

.gallery-page .gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.gallery-page .gallery-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.gallery-page .gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.gallery-page .tile {
  background: rgba(15, 22, 32, .84);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  overflow: hidden;
}

.gallery-page .tile button.imageBtn {
  all: unset;
  display: block;
  width: 100%;
  cursor: pointer;
}

.gallery-page .thumb {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #000;
  display: block;
}

.gallery-page .file {
  font-size: 12px;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #d7e6f7;
}

.gallery-page .meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.gallery-page .tile-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.gallery-page .danger {
  border: 1px solid rgba(255, 138, 138, .42);
  border-radius: 10px;
  background: rgba(42, 20, 20, .9);
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}

.gallery-page .danger:hover {
  background: rgba(58, 27, 27, .96);
}

.gallery-page .pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

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

.gallery-page .btn-disabled {
  opacity: .42;
  pointer-events: none;
}

.gallery-page .mono {
  font-family: ui-monospace, Consolas, monospace;
  word-break: break-all;
}

.gallery-page .modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 1000;
}

.gallery-page .modal.open {
  display: flex;
}

.gallery-page .modalBox {
  width: min(1200px, 96vw);
  max-height: 94vh;
  overflow: auto;
  background: #121a24;
  border: 1px solid #2b3d55;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, .65);
}

.gallery-page .modalTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.gallery-page .close {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f1620;
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}

.gallery-page .modalGrid {
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) minmax(260px, .7fr);
  gap: 16px;
}

.gallery-page .bigImg {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #000;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.gallery-page .detail {
  background: #0f1620;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.gallery-page .kv {
  margin-bottom: 10px;
}

.gallery-page .kv b {
  display: block;
  margin-bottom: 3px;
}

.gallery-page .kv div {
  color: #c8d8eb;
  word-break: break-word;
}

.gallery-page .debugbox {
  border-color: #7bd3ff;
}

.gallery-page .debugbox pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #07111c;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.35;
  max-height: 620px;
  overflow: auto;
}

.gallery-page .debugbox code {
  color: #7bd3ff;
}

@media (max-width:1100px) {
  .gallery-page .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width:880px) {
  .gallery-page .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-page .modalGrid {
    grid-template-columns: 1fr;
  }

  .gallery-page .bigImg {
    max-height: 58vh;
  }
}

@media (max-width:620px) {
  .gallery-page .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width:420px) {
  .gallery-page .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------
   STANDARD-FIX / Details, Parameter, Modals
   Ziel: einheitliche, ruhige Darstellung für IMG_GEN/Galerie.
   Besonders wichtig: Seeds/Parameter sollen nicht mitten in Zahlen
   hart umgebrochen werden.
--------------------------------------------------------- */

.imggen-page .detail-small, .imggen-page .detail-value, .gallery-page .detail-small, .gallery-page .mono, .gallery-page .kv div, .detail-small, .mono {
  word-break: normal !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
  line-height: 1.55;
}

.imggen-page .detail-small, .gallery-page .detail-small, .gallery-page .mono, .detail-small, .mono {
  font-family: ui-monospace, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
}

.imggen-page .detail-row, .gallery-page .kv {
  margin-bottom: 12px;
}

.imggen-page .detail-label, .gallery-page .kv b {
  display: block;
  margin-bottom: 4px;
  font-weight: 750;
  color: var(--soft);
}

.imggen-page .detail-value, .gallery-page .kv div {
  color: var(--text);
}

.imggen-page .modal-card, .gallery-page .modalBox {
  background: linear-gradient(180deg, rgba(18, 31, 44, .98), rgba(10, 16, 24, .98)) !important;
  border: 1px solid rgba(43, 66, 92, .9) !important;
  border-radius: 18px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .62);
}

.imggen-page .modal-head, .gallery-page .modalTop {
  border-bottom: 1px solid rgba(43, 66, 92, .65);
  padding-bottom: 10px;
}

.imggen-page .modal-img, .gallery-page .bigImg {
  background: #000;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.imggen-page .detail-panel, .gallery-page .detail {
  background: rgba(15, 22, 32, .72) !important;
  border: 1px solid rgba(43, 66, 92, .75) !important;
  border-radius: 14px;
}

.imggen-page .thumb-title, .imggen-page .thumb-time, .gallery-page .file, .gallery-page .meta {
  word-break: normal !important;
  overflow-wrap: normal !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

.param-list, .imggen-page .param-list, .gallery-page .param-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.param-chip, .imggen-page .param-chip, .gallery-page .param-chip {
  border: 1px solid rgba(43, 66, 92, .75);
  background: rgba(7, 11, 16, .32);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--soft);
  font-size: 12px;
  font-family: ui-monospace, Consolas, "Liberation Mono", Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.param-chip b {
  color: var(--text);
  font-weight: 750;
}

@media (max-width: 620px) {
  .imggen-page .modal-card, .gallery-page .modalBox {
    padding: 12px;
    border-radius: 14px;
  }

  .imggen-page .detail-small, .gallery-page .detail-small, .gallery-page .mono {
    font-size: 11px;
  }
}

/* ---------------------------------------------------------
   IMG_GEN / 10er-Vorschau: Download-Aktionen
   Zentrale Regeln für ed_form.php, damit keine Inline-Styles nötig sind.
--------------------------------------------------------- */

.imggen-page .gallery .thumb-card {
  display: block;
  min-width: 0;
}

.imggen-page .gallery .thumb-card .thumb {
  margin-bottom: 8px;
}

.imggen-page .gallery .thumb-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.imggen-page .gallery .thumb-download {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.imggen-page .detail-small,
.gallery-page .mono,
.gallery-page .detail .kv div {
  word-break: normal;
  overflow-wrap: anywhere;
}

.imggen-page .debugbox {
  border: 1px solid #7bd3ff;
}

.imggen-page .debugbox pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #07111c;
  border: 1px solid #223244;
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.35;
  max-height: 520px;
  overflow: auto;
}

.imggen-page .debugbox code {
  color: #7bd3ff;
}


/* ---------------------------------------------------------
   IMG_GEN Detail-Parameter / Expert Tools
   Einheitliche Darstellung für Seed, Sampler, Scheduler und LoRAs.
--------------------------------------------------------- */

.imggen-page .detail-small,
.gallery-page .detail-small,
.gallery-page .mono {
  word-break: normal;
  overflow-wrap: anywhere;
  white-space: normal;
}

.imggen-page .detail-param-list,
.gallery-page .detail-param-list {
  display: grid;
  gap: 7px;
  margin-top: 4px;
}

.imggen-page .detail-param-item,
.gallery-page .detail-param-item {
  display: grid;
  grid-template-columns: minmax(88px, auto) 1fr;
  gap: 8px;
  align-items: start;
  padding: 7px 9px;
  border: 1px solid rgba(43, 66, 92, .65);
  border-radius: 10px;
  background: rgba(7, 11, 16, .32);
}

.imggen-page .detail-param-item span,
.gallery-page .detail-param-item span {
  color: var(--muted);
  font-size: .82rem;
  white-space: nowrap;
}

.imggen-page .detail-param-item b,
.gallery-page .detail-param-item b {
  color: var(--soft);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.imggen-page .lora-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(43, 66, 92, .75);
  border-radius: 16px;
  background: rgba(7, 11, 16, .25);
}

.imggen-page .lora-panel h3 {
  margin-bottom: 4px;
}

.imggen-page .lora-row {
  margin-top: 10px;
}

/* ---------------------------------------------------------
   IMG_GEN LoRA-Dynamik + Parameteranzeige
--------------------------------------------------------- */

.imggen-page .lora-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.imggen-page .lora-container {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.imggen-page .lora-row {
  padding: 12px;
  border: 1px solid rgba(43, 66, 92, .72);
  border-radius: 14px;
  background: rgba(15, 22, 32, .55);
}

.imggen-page #loraCostHint {
  display: block;
  margin-top: 10px;
}

.imggen-page .detail-param-list,
.gallery-page .detail-param-list {
  display: grid;
  gap: 7px;
  margin-top: 6px;
}

.imggen-page .detail-param-item,
.gallery-page .detail-param-item {
  display: grid;
  grid-template-columns: minmax(105px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px 9px;
  border: 1px solid rgba(43, 66, 92, .65);
  border-radius: 10px;
  background: rgba(7, 11, 16, .32);
}

.imggen-page .detail-param-item span,
.gallery-page .detail-param-item span {
  color: var(--muted);
  font-size: .82rem;
  white-space: nowrap;
}

.imggen-page .detail-param-item b,
.gallery-page .detail-param-item b {
  color: var(--soft);
  font-weight: 650;
  word-break: normal;
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 620px) {
  .imggen-page .detail-param-item,
  .gallery-page .detail-param-item {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
