:root {
  --accent: #EA661E;        /* TT-Orange — einzige Akzentfarbe */
  --accent-soft: #fdeee4;
  --ink: #1f2328;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #fafafa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Lato", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
header h1 { margin: 0; font-size: 1.15rem; grid-column: 1; justify-self: start; }
header .brand-logo { grid-column: 2; }
header .user { grid-column: 3; justify-self: end; display: inline-flex; align-items: center; gap: 8px; }
header .user-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.brand-logo { height: 60px; width: auto; display: block; }
.landing-header {
  display: flex;
  justify-content: center;
  padding: 26px 24px 0;
  background: #fff;
  border-bottom: none;
}
.landing-header .brand-logo { height: 55px; }
header .user { color: var(--muted); font-size: 0.9rem; }
header .user a { color: var(--accent); text-decoration: none; margin-left: 10px; }

main {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  max-width: 1000px;
  margin: 28px auto;
  padding: 0 24px;
}
@media (max-width: 760px) { main { grid-template-columns: 1fr; } }

.preview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 24px;
  align-self: start;
}
@media (max-width: 760px) {
  .preview-col { position: static; }
}
#preview {
  width: 260px;
  height: 260px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.admin-picker {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

button {
  font: inherit;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
  width: 100%;
}
button.primary:hover { background: var(--accent); color: #fff; }

#status { min-height: 1.2em; font-size: 0.9rem; color: var(--muted); margin: 0; }
#status.ok { color: #15803d; }
#status.err { color: #b91c1c; }

.block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 22px;
}
.block h2 { margin: 0 0 4px; font-size: 1rem; }
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}
.block-head h2 { margin: 0; }
.block-head button {
  padding: 4px 12px;
  font-size: 0.85rem;
  color: var(--muted);
  border-radius: 999px;
}
.block-head button:hover { color: var(--accent); }
.block-head button i { margin-right: 4px; }
.hint { margin: 0 0 12px; font-size: 0.85rem; color: var(--muted); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px solid var(--line);
  cursor: pointer;
  background: #fff;
}
.gallery img:hover { border-color: var(--accent); }
.gallery img.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.admin-picker select {
  font: inherit;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

/* Stil-Umschalter */
.style-toggle { display: flex; gap: 12px; }
.style-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
}
.style-opt:hover { border-color: var(--accent); }
.style-opt.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
  color: var(--ink);
  font-weight: 700;
}
.style-opt img { width: 72px; height: 72px; }

/* Feintuning-Accordion */
.acc-sec { border-top: 1px solid var(--line); }
.acc-sec:last-child { border-bottom: 1px solid var(--line); }
.acc-sec summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.acc-sec summary::-webkit-details-marker { display: none; }
.acc-caret {
  color: var(--muted);
  margin-left: 10px;
  font-size: 0.8rem;
  transition: transform 0.15s ease;
}
.acc-sec[open] .acc-caret { transform: rotate(90deg); }
.acc-sec summary .current {
  margin-left: auto;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--accent);
}
.variants {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
  padding: 4px 4px 16px;
}
.variant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.variant:hover { border-color: var(--accent); }
.variant.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.variant img { width: 100%; aspect-ratio: 1; }
.variant span {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Landing (nur für Unangemeldete) */
body.landing { background: #fff; }
.hero {
  max-width: 640px;
  margin: 0 auto;
  padding: 12vh 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}
.hero-avatars { display: flex; }
.hero-avatars img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}
.hero-avatars img + img { margin-left: -18px; }
.hero h1 { margin: 8px 0 0; font-size: 2rem; }
.hero .sub { margin: 0; color: var(--muted); line-height: 1.55; }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 22px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.cta:hover { background: var(--accent); color: #fff; }
.hero .fine { margin-top: 22px; font-size: 0.8rem; color: var(--muted); }
