:root {
  --bg: #f4f1ee;
  --card: #fff;
  --text: #1a1a1a;
  --accent: #b5121b;
  --accent-dark: #7d0d14;
  --muted: #555;
  --line: #ddd;
}
body { margin: 0; font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); overflow-x: auto; }
.topbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  min-height: 84px;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(125, 13, 20, 0.22);
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
}
.topbar a { color: #fff; text-decoration: none; font-weight: 600; }
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  min-width: 0;
  flex-shrink: 0;
  overflow: visible;
}
.brand-lockup__logo {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
/* Plattform: horizontales Offizial-Lockup (wie Kartenali – ein Bild, kein Zusatztext) */
.brand-lockup--platform-wide .brand-lockup__logo--platform {
  height: clamp(52px, 14vw, 64px);
  width: auto;
  max-width: min(380px, 78vw);
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}
.brand-lockup--platform {
  align-items: center;
  gap: 0.85rem;
}
.brand-lockup__logo--platform {
  display: block;
  height: clamp(58px, 16vw, 70px);
  width: auto;
  max-width: min(220px, 42vw);
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
}
.brand-lockup--platform .brand-lockup__text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  justify-content: center;
}
.brand-lockup--platform .brand-lockup__title {
  font-size: clamp(0.92rem, 2.4vw, 1.18rem);
  font-weight: 800;
  letter-spacing: 0.055em;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.brand-lockup__context--platform {
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  opacity: 0.9;
  line-height: 1.1;
}
@media (max-width: 720px) {
  .topbar { min-height: 76px; padding: 0.45rem 0.75rem; }
  .brand-lockup__logo--platform {
    height: 54px;
    max-width: 165px;
  }
  .brand-lockup--platform .brand-lockup__title { font-size: 0.84rem; }
  .brand-lockup__context--platform { font-size: 0.62rem; }
}
.topbar-mandant {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.95;
  white-space: nowrap;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
}
@media (max-width: 720px) {
  .topbar-mandant { font-size: 0.72rem; }
}
.brand-lockup__text {
  display: block;
  min-width: 0;
  overflow: visible;
  line-height: 1.45;
}
.topbar .brand-lockup__title {
  display: block;
  margin: 0;
  padding: 0;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.45;
  white-space: nowrap;
}
.brand-lockup__title {
  color: #fff;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.45;
  white-space: nowrap;
}
.brand-lockup__context {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.88;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .brand-lockup__title { font-size: 0.82rem; letter-spacing: 0.04em; white-space: normal; max-width: 9rem; }
}
.topbar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.92rem;
  flex: 1 1 12rem;
  min-width: 0;
}
.main { max-width: 960px; width: 100%; margin: 0 auto; padding: 1.25rem 1rem 2.5rem; box-sizing: border-box; }
h1 { font-size: 1.45rem; margin: 0 0 0.75rem; overflow-wrap: anywhere; }
.lead { color: #444; margin: 0 0 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.form label { display: block; margin: 0.55rem 0; font-size: 0.9rem; font-weight: 600; }
.form input, .form select, .form textarea { width: 100%; margin-top: 0.25rem; padding: 0.45rem 0.55rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
.form textarea { min-height: 9rem; resize: vertical; }
.form textarea.textarea--long { min-height: 22rem; font-size: 0.95rem; line-height: 1.55; }
.btn { display: inline-block; padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; text-decoration: none; color: inherit; }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--ghost { background: transparent; }
.btn--small { font-size: 0.85rem; padding: 0.35rem 0.65rem; }
.msg { padding: 0.55rem 0.75rem; border-radius: 8px; }
.msg--ok { background: #e6f6ea; }
.msg--err { background: #fde8e8; }
.msg--warn { background: #fff4e0; font-size: 0.88rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 0.45rem 0.35rem; text-align: left; }
.actions { white-space: nowrap; }
.grid-2 { display: grid; gap: 0.75rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.fb-text-fallback-wrap {
  display: none;
  margin: 0.75rem 0;
}
.fb-text-fallback-wrap.is-visible,
.fb-text-fallback-wrap:has(textarea:not(.visually-hidden)) {
  display: block;
}
.fb-text-fallback-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--muted, #555);
}
.fb-text-fallback,
.fb-text-fallback-wrap textarea {
  width: 100%;
  min-height: 8rem;
  font: inherit;
  line-height: 1.45;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line, #ccc);
  border-radius: 8px;
}
.fb-text-copy-panel textarea {
  font-size: 0.95rem;
  line-height: 1.5;
  min-height: 9rem;
}
.fb-export-note { margin: 0 0 0.5rem; max-width: 36rem; }
.fb-text-panel__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.fb-text-panel__area {
  width: 100%;
  min-height: 10rem;
  font: inherit;
  line-height: 1.5;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line, #ccc);
  border-radius: 8px;
  resize: vertical;
  background: #fafafa;
}
/* Export-Vorschau: Sheet ist 1080px – schmaleres .main würde Text rechts abschneiden */
.main:has(.preview-wrap) {
  max-width: 1240px;
}
.preview-wrap {
  overflow-x: auto;
  overflow-y: visible;
  background: #d8d4d0;
  padding: 1rem;
  border-radius: 12px;
}
.preview-stage {
  margin: 0 auto;
}
.brand__logo--zoomable {
  cursor: zoom-in;
}
.brand__logo--zoomable:focus-visible {
  outline: 3px solid var(--accent, #b5121b);
  outline-offset: 4px;
}
body.export-logo-lightbox-open {
  overflow: hidden;
}
.export-logo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(12, 12, 12, 0.88);
}
.export-logo-lightbox__img {
  display: block;
  max-width: min(96vw, 1080px);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}
.export-logo-lightbox__close {
  position: fixed;
  top: 0.75rem;
  right: 0.85rem;
  z-index: 12001;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #1a1a1a;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  font-weight: 700;
}
.preview-toolbar { margin-bottom: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.hint { font-size: 0.88rem; color: #555; }
.preview-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.inline-form { display: inline; margin: 0; }
.status-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: #eef6ea;
  color: #1a5c28;
}
.status-badge--closed {
  background: #eee;
  color: #444;
}
.status-closed { margin-bottom: 0.75rem; }

.text-ai-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin: 0.35rem 0 0.5rem;
  padding: 0.45rem 0.55rem;
  background: #f7f4f1;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.text-ai-bar__label { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.text-ai-bar__status { flex: 1 1 100%; font-size: 0.82rem; margin: 0; }
@media (min-width: 640px) {
  .text-ai-bar__status { flex: 1 1 auto; text-align: right; }
}

.app-foot-outer {
  background: var(--card);
  border-top: 1px solid var(--line);
}
.app-foot {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
  box-sizing: border-box;
  font-size: 0.82rem;
  color: var(--muted);
}
.app-foot-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.65rem;
}
.app-foot-legal a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}
.app-foot-legal a:hover { text-decoration: underline; }
.app-foot-legal .sep { opacity: 0.45; }
.app-foot-meta,
.app-foot-note { margin: 0.25rem 0; font-size: 0.78rem; }
.app-foot-license {
  margin: 0.65rem 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
}
.app-foot-license a { color: var(--accent-dark); }
.legal-doc h2 { margin: 1.1rem 0 0.4rem; font-size: 1rem; }
.legal-doc-meta { margin-top: 1rem; font-size: 0.8rem; color: var(--muted); }