/* ===========================================================================
   Partnerprogramm — heller Apple-Look.
   Gleiche Designsprache wie die übrigen Visions-Umsetzung-Mitgliederbereiche.
   Selbst gehostet, kein Fremd-CDN.
   =========================================================================== */

:root {
  --bg:#f5f5f7; --card:#fff; --ink:#1d1d1f; --muted:#6e6e73;
  --accent:#1877f2; --accent-dark:#166fe5; --line:#e4e4e7;
  --ok:#0a7d3a; --ok-bg:#eafaf0; --warn:#b25c00; --warn-bg:#fff3e0;
  --err:#c0322b; --err-bg:#fff0f0;
  --radius:14px; --maxw:1280px;
  --shadow:0 1px 2px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.06);
}
* { box-sizing:border-box; margin:0; padding:0; }
body {
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg); color:var(--ink); line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }
img { max-width:100%; }
h1,h2,h3,h4 { line-height:1.25; }

/* ── Gerüst ── */
.shell { display:flex; min-height:100vh; }
.side {
  width:240px; background:var(--card); border-right:1px solid var(--line);
  display:flex; flex-direction:column; padding:20px 14px;
  position:sticky; top:0; height:100vh; overflow-y:auto;
}
.brand { padding:4px 8px 18px; }
.brand img { height:30px; }
.nav { display:flex; flex-direction:column; gap:1px; flex:1; }
.nav-group {
  margin-top:16px; padding:0 12px 5px; font-size:11px; font-weight:700;
  text-transform:uppercase; letter-spacing:.04em; color:var(--muted);
}
.nav a {
  display:flex; align-items:center; gap:9px; padding:9px 12px; border-radius:9px;
  color:var(--ink); font-size:14px; font-weight:500;
}
.nav a:hover { background:var(--bg); text-decoration:none; }
.nav a.on { background:var(--accent); color:#fff; }
.nav .ic { width:18px; text-align:center; }
.who { border-top:1px solid var(--line); margin-top:14px; padding:14px 8px 0; }
.who-name { font-weight:600; font-size:14px; }
.who-mail { font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; }
.who-links { margin-top:6px; }
.who-links a { font-size:13px; color:var(--muted); }
.who-links a:hover { color:var(--accent); }

.main { flex:1; min-width:0; display:flex; flex-direction:column; }

/* ── Kopfleiste ── */
.topbar { border-bottom:1px solid var(--line); background:var(--card); }
.topbar-inner {
  display:flex; align-items:center; gap:14px;
  max-width:var(--maxw); margin:0 auto; padding:16px 32px; width:100%;
}
.topbar h1 { font-size:22px; font-weight:700; }
.burger { display:none; background:none; border:0; cursor:pointer; padding:4px; color:var(--ink); }
.side-backdrop { display:none; }
.content { max-width:var(--maxw); margin:0 auto; padding:28px 32px 56px; width:100%; flex:1; }
.content-narrow { max-width:780px; }

/* ── Fußzeile ── */
.app-footer {
  border-top:1px solid var(--line); padding:18px 32px;
  text-align:center; color:var(--muted); font-size:12.5px;
}
.app-footer a { color:var(--muted); }

/* ── Überschriften & Text ── */
.greeting { font-size:16px; color:var(--muted); margin-bottom:20px; }
.page-intro { color:var(--muted); font-size:14.5px; margin-bottom:22px; max-width:680px; }
.section-title {
  font-size:13px; font-weight:700; text-transform:uppercase;
  letter-spacing:.04em; color:var(--muted); margin:30px 0 12px;
}
.muted { color:var(--muted); }

/* ── Hinweis-Streifen ── */
.alert {
  border-radius:var(--radius); padding:14px 18px; font-size:14px; margin-bottom:20px;
  display:flex; align-items:flex-start; gap:10px;
}
.alert-error   { background:var(--err-bg); border:1px solid #f3c9c6; color:#8a2820; }
.alert-info    { background:#eaf1fd; border:1px solid #cfe0fb; color:#15407c; }
.alert-success { background:var(--ok-bg); border:1px solid #bfe7cd; color:var(--ok); }
.alert-warn    { background:var(--warn-bg); border:1px solid #f3dcae; color:var(--warn); }

/* ── Karten / Tafeln ── */
.panel {
  background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow);
  padding:24px; margin-bottom:22px;
}
.panel h2 { font-size:17px; font-weight:700; margin-bottom:6px; }
.panel-sub { font-size:13.5px; color:var(--muted); margin-bottom:16px; }
.panel-head { display:flex; align-items:center; justify-content:space-between;
  gap:14px; flex-wrap:wrap; margin-bottom:16px; }
.panel-head h2 { margin-bottom:0; }

/* ── Produkt-Kacheln (Übersicht) ── */
.tiles {
  display:grid; gap:20px;
  grid-template-columns:repeat(auto-fill,minmax(290px,1fr));
}
.tile {
  background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow);
  overflow:hidden; color:var(--ink); display:flex; flex-direction:column;
  transition:transform .15s ease, box-shadow .15s ease;
}
a.tile:hover {
  text-decoration:none; transform:translateY(-4px);
  box-shadow:0 2px 4px rgba(0,0,0,.06), 0 16px 40px rgba(0,0,0,.12);
}
.tile-top {
  padding:22px 22px 18px; color:#fff;
  background:var(--tile-accent,#1877f2);
}
.tile-emoji { font-size:30px; line-height:1; }
.tile-name { font-size:19px; font-weight:700; margin-top:10px; }
.tile-commission {
  display:inline-block; margin-top:10px; background:rgba(255,255,255,.22);
  font-size:12px; font-weight:700; padding:3px 10px; border-radius:20px;
}
.tile-body { padding:18px 22px 22px; display:flex; flex-direction:column; flex:1; }
.tile-headline { font-size:15px; font-weight:600; line-height:1.4; }
.tile-audience { font-size:13px; color:var(--muted); margin-top:8px; flex:1; }
.tile-cta {
  margin-top:16px; font-size:14px; font-weight:700; color:var(--tile-accent,#1877f2);
}

/* ── Produkt-Kopf (Produktseite) ── */
.product-hero {
  border-radius:var(--radius); padding:26px 28px; color:#fff;
  background:var(--tile-accent,#1877f2); margin-bottom:24px;
}
.product-hero .emoji { font-size:34px; }
.product-hero h1 { font-size:26px; font-weight:700; margin:8px 0 6px; }
.product-hero .headline { font-size:16px; font-weight:500; opacity:.95; max-width:680px; }
.product-hero .meta { margin-top:14px; font-size:13px; opacity:.9; }
.product-hero .meta a { color:#fff; text-decoration:underline; }

/* ── Banner-Galerie ── */
.banner-grid { display:grid; gap:18px; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); }
.banner-card {
  background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow);
  overflow:hidden; display:flex; flex-direction:column;
}
.banner-img { background:#f0f0f2; padding:14px; text-align:center; }
.banner-img img { border-radius:8px; }
.banner-foot { padding:13px 16px; display:flex; align-items:center;
  justify-content:space-between; gap:10px; border-top:1px solid var(--line); }
.banner-meta { font-size:13px; }
.banner-meta strong { display:block; }
.banner-meta span { color:var(--muted); font-size:12px; }

/* ── Werbetext-Block (vorbereitet + KI-Ergebnis) ── */
.copy-block {
  background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow);
  padding:20px 22px; margin-bottom:16px;
}
.copy-head { display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-bottom:10px; }
.copy-title { font-size:15px; font-weight:700; }
.copy-text {
  white-space:pre-wrap; font-size:14px; line-height:1.65; color:var(--ink);
  background:var(--bg); border:1px solid var(--line); border-radius:10px;
  padding:14px 16px; max-height:420px; overflow-y:auto;
}

/* ── Knöpfe ── */
.btn, .btn-primary {
  display:inline-block; padding:11px 22px; border:0; border-radius:10px;
  background:var(--accent); color:#fff; font-size:15px; font-weight:600;
  font-family:inherit; cursor:pointer; text-align:center;
}
.btn:hover, .btn-primary:hover { background:var(--accent-dark); color:#fff; text-decoration:none; }
.btn-secondary {
  display:inline-block; padding:11px 22px; border:1px solid var(--line);
  border-radius:10px; background:#fff; color:var(--ink); font-size:15px;
  font-weight:600; font-family:inherit; cursor:pointer; text-align:center;
}
.btn-secondary:hover { background:var(--bg); color:var(--ink); text-decoration:none; }
.btn-sm {
  display:inline-block; padding:7px 14px; border:0; border-radius:8px;
  background:var(--accent); color:#fff; font-size:13px; font-weight:600;
  font-family:inherit; cursor:pointer; text-align:center;
}
.btn-sm:hover { background:var(--accent-dark); color:#fff; text-decoration:none; }
.btn-ghost {
  display:inline-block; padding:7px 14px; border:1px solid var(--line);
  border-radius:8px; background:#fff; color:var(--ink); font-size:13px;
  font-weight:600; font-family:inherit; cursor:pointer;
}
.btn-ghost:hover { background:var(--bg); text-decoration:none; }
.btn-danger { background:var(--err); }
.btn-danger:hover { background:#a82a24; }
.btn-block { display:block; width:100%; }
.btn-large { padding:14px 30px; font-size:16px; }
.btn[disabled], .btn-primary[disabled] { opacity:.55; cursor:default; }
.btn-row { display:flex; gap:10px; flex-wrap:wrap; }

/* ── Formularfelder ── */
label { display:block; font-size:13px; font-weight:600; margin:14px 0 6px; }
input:not([type]), input[type=text], input[type=email], input[type=password],
input[type=url], input[type=number], input[type=search], input[type=tel],
select, textarea {
  width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:10px;
  font-size:15px; font-family:inherit; background:#fff; color:var(--ink);
}
textarea { min-height:120px; resize:vertical; line-height:1.55; }
input:focus, select:focus, textarea:focus {
  outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(24,119,242,.15);
}
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 20px; }
.form-grid .full { grid-column:1 / -1; }
.form-hint { font-size:12px; color:var(--muted); margin-top:5px; }
.checkrow { display:flex; align-items:flex-start; gap:10px; margin-top:16px; }
.checkrow input { width:auto; margin-top:3px; }
.checkrow label { margin:0; font-weight:500; font-size:13.5px; }
@media (max-width:640px) { .form-grid { grid-template-columns:1fr; } }

/* ── Meldungen ── */
.msg { padding:12px 15px; border-radius:10px; font-size:14px; margin-bottom:16px; }
.msg-ok  { background:var(--ok-bg); color:var(--ok); border:1px solid #bfe7cd; }
.msg-err { background:var(--err-bg); color:var(--err); border:1px solid #f3c9c6; }

/* ── Tabellen ── */
.table-wrap {
  background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow);
  overflow-x:auto;
}
.table { width:100%; border-collapse:collapse; font-size:14px; }
.table th, .table td { padding:12px 16px; text-align:left; vertical-align:middle; }
.table thead th {
  background:#fafafa; color:var(--muted); font-size:12px; font-weight:600;
  text-transform:uppercase; letter-spacing:.03em; border-bottom:1px solid var(--line);
  white-space:nowrap;
}
.table tbody tr { border-bottom:1px solid var(--line); }
.table tbody tr:last-child { border-bottom:0; }
.table tbody tr:hover { background:#fafbfc; }

/* ── Etiketten ── */
.badge { display:inline-block; padding:3px 10px; border-radius:20px;
  font-size:12px; font-weight:600; }
.badge-ok   { background:var(--ok-bg); color:var(--ok); }
.badge-off  { background:#f0f0f2; color:var(--muted); }
.badge-warn { background:var(--warn-bg); color:var(--warn); }

/* ── KI-Texter ── */
.gen-controls { display:grid; grid-template-columns:repeat(3,1fr); gap:0 18px; }
@media (max-width:760px) { .gen-controls { grid-template-columns:1fr; } }
.quota-line { font-size:13px; color:var(--muted); margin-top:12px; }
.spinner {
  display:inline-block; width:16px; height:16px; border:2px solid rgba(255,255,255,.4);
  border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite;
  vertical-align:-3px; margin-right:7px;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Anmelde- / Registrier-Seiten ── */
.auth-wrap {
  min-height:100vh; display:flex; flex-direction:column;
  align-items:center; justify-content:center; padding:32px 18px;
}
.auth-box {
  background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow);
  padding:36px; width:100%; max-width:430px;
}
.auth-box.wide { max-width:560px; }
.auth-logo { text-align:center; margin-bottom:8px; }
.auth-logo img { height:38px; }
.auth-title { text-align:center; font-size:21px; font-weight:700; margin:14px 0 4px; }
.auth-sub { text-align:center; font-size:14px; color:var(--muted); margin-bottom:22px; }
.auth-links { text-align:center; margin-top:18px; font-size:13.5px; }
.auth-links a { color:var(--muted); }
.auth-foot { margin-top:22px; text-align:center; font-size:12px; color:var(--muted); }

/* ── Wort-Editor (js/editor.js) ── */
.rt { border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.rt-bar {
  display:flex; flex-wrap:wrap; gap:4px; padding:7px;
  background:#fafafa; border-bottom:1px solid var(--line);
}
.rt-btn {
  border:1px solid var(--line); background:#fff; border-radius:6px;
  padding:4px 9px; font-size:13px; font-weight:600; font-family:inherit; cursor:pointer;
}
.rt-btn:hover { background:var(--bg); }
.rt-toggle { margin-left:auto; }
.rt-toggle.on { background:var(--accent); color:#fff; border-color:var(--accent); }
.rt-edit { min-height:200px; padding:12px 14px; font-size:14px; line-height:1.6;
  outline:none; background:#fff; color:var(--ink); }
.rt-edit:focus { box-shadow:inset 0 0 0 2px rgba(24,119,242,.15); }
.rt-source {
  width:100%; min-height:200px; padding:12px 14px; border:0; resize:vertical;
  font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px; line-height:1.55;
  background:#fff; color:var(--ink);
}
.rt-source:focus { outline:none; }

/* ── Hilfsklassen ── */
.text-center { text-align:center; }
.mt-16 { margin-top:16px; }
.mt-24 { margin-top:24px; }
.hidden { display:none; }
.divider { height:1px; background:var(--line); margin:22px 0; }

/* ── Schmale Bildschirme ── */
@media (max-width:860px) {
  .side {
    position:fixed; top:0; left:0; bottom:0; z-index:100; width:262px;
    transform:translateX(-100%); transition:transform .22s ease;
    box-shadow:0 0 40px rgba(0,0,0,.2);
  }
  .shell.menu-open .side { transform:translateX(0); }
  .side-backdrop {
    display:block; position:fixed; inset:0; z-index:90; background:rgba(0,0,0,.45);
    opacity:0; pointer-events:none; transition:opacity .22s ease;
  }
  .shell.menu-open .side-backdrop { opacity:1; pointer-events:auto; }
  .burger { display:block; }
  .topbar-inner { padding:13px 16px; }
  .topbar h1 { font-size:19px; }
  .content { padding:18px; }
}
