:root {
  --primary: #111111;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a1f2b;
  --muted: #6b7280;
  --border: #e5e7eb;
  --good: #16a34a;
  --bad: #dc2626;
  --warn: #d97706;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar / Branding */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { height: 40px; max-width: 180px; object-fit: contain; }
.logo-placeholder {
  height: 40px; width: 40px; border-radius: 8px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 12px; color: var(--muted); }

.mainnav { display: flex; gap: 6px; }
.mainnav a {
  padding: 8px 14px; border-radius: 8px; color: var(--muted); font-weight: 500;
}
.mainnav a:hover { background: var(--bg); text-decoration: none; }
.mainnav a.active { background: var(--primary); color: #fff; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 24px; }

/* Wortmarke / Logo */
.wordmark { font-weight: 800; font-size: 21px; letter-spacing: -.5px; color: var(--text); }
.wordmark .dot { color: var(--muted); }
.wordmark .ai { color: var(--muted); font-weight: 800; }
.wordmark.small { font-size: 15px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-left: 6px; }

/* Navigation */
.navlink { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.navlink:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.navlink.active { background: var(--primary); color: #fff; }
.navlink.active:hover { color: #fff; }
.mainnav a.nav-cta {
  padding: 9px 18px; font-size: 14px; font-weight: 700; border-radius: 8px;
  color: #fff; background: var(--primary);
}
.mainnav a.nav-cta:hover { background: var(--primary); color: #fff; filter: brightness(1.15); }
.nav-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.nav-acct { font-size: 12px; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mainnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Info-/Werbebanner */
.topbanner { text-align: center; padding: 9px 14px; font-size: 13px; }
.topbanner a { font-weight: 700; text-decoration: underline; }
.topbanner.trial { background: #fef3c7; color: #92400e; }
.topbanner.trial a { color: #92400e; }
.topbanner.ad { background: #111; color: #fff; }
.topbanner.ad a { color: #fff; margin-left: 8px; }

/* Footer */
.footer { color: var(--muted); font-size: 12px; padding: 28px 24px; border-top: 1px solid var(--border); margin-top: 32px; }
.foot-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-de { color: var(--text); font-weight: 600; }
.foot-links { display: flex; gap: 16px; }
.foot-links a { color: var(--muted); }

/* Cookie-Banner */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  background: #111; color: #fff; border-radius: 12px; padding: 14px 18px;
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  box-shadow: 0 8px 30px rgba(0,0,0,.3); font-size: 13px; max-width: 900px; margin: 0 auto;
}
.cookie-banner a { color: #fff; text-decoration: underline; }

/* Auth-Seiten */
.auth-wrap { max-width: 420px; margin: 40px auto; }
.auth-wrap h1 { text-align: center; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 26px; box-shadow: var(--shadow); }
.auth-card label { margin-top: 14px; }
.auth-card label:first-of-type { margin-top: 0; }

/* Rechtstexte */
.legal { max-width: 820px; margin: 0 auto; }
.legal h2 { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.legal p, .legal li { color: var(--text); font-size: 14px; line-height: 1.65; }
.legal .placeholder { background: #fff7ed; color: #9a3412; padding: 1px 6px; border-radius: 4px; font-weight: 600; }

/* Headings */
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.subtitle { color: var(--muted); margin: 0 0 20px; }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 800px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { filter: brightness(.94); background: var(--primary); }
.btn-danger { color: var(--bad); border-color: #f2caca; }
.btn-danger:hover { background: #fdeaea; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; }

/* Forms */
label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=search], input[type=tel], input[type=color],
select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
  box-sizing: border-box; transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus,
input[type=url]:focus, input[type=number]:focus, input[type=search]:focus,
input[type=tel]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, .08);
}
textarea { min-height: 90px; resize: vertical; }
input[type=color] { height: 44px; padding: 4px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-row { display: flex; gap: 16px; }
.form-row > div { flex: 1; }
.inline { display: inline; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:last-child td { border-bottom: none; }

/* Badges & stats */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-good { background: #dcfce7; color: var(--good); }
.badge-bad { background: #fee2e2; color: var(--bad); }
.badge-warn { background: #fef3c7; color: var(--warn); }
.badge-muted { background: var(--bg); color: var(--muted); }

.stat { text-align: center; }
.stat .num { font-size: 30px; font-weight: 800; color: var(--primary); }
.stat .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* Kennzahl-Boxen (Reporting/Admin) */
.stat-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 20px; min-width: 130px; box-shadow: var(--shadow);
}
.stat-num { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat-lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* Datentabellen */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.data-table td, .data-table th { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }

/* kleine Buttons + Status-Badges */
.btn-small { padding: 5px 10px; font-size: 12px; }
.badge-on { background: #dcfce7; color: var(--good); }
.badge-off { background: var(--bg); color: var(--muted); }
.badge-on-btn { border-color: var(--good); color: var(--good); }

.flashes { margin-bottom: 16px; }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }

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

/* Info-Tooltip (i-Icon) */
.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--muted); color: #fff; font-size: 10px; font-weight: 700;
  font-style: normal; cursor: help; position: relative; margin-left: 5px;
  vertical-align: middle;
}
.info::after {
  content: attr(data-tip);
  position: absolute; bottom: 145%; left: 50%; transform: translateX(-50%);
  background: #1a1f2b; color: #fff; padding: 9px 11px; border-radius: 8px;
  font-size: 12px; font-weight: 400; line-height: 1.45; text-align: left;
  width: 250px; white-space: normal; z-index: 30;
  box-shadow: 0 4px 14px rgba(16,24,40,.25);
  opacity: 0; visibility: hidden; transition: opacity .12s;
}
.info::before {
  content: ""; position: absolute; bottom: 145%; left: 50%;
  transform: translateX(-50%) translateY(50%) rotate(45deg);
  width: 8px; height: 8px; background: #1a1f2b; z-index: 30;
  opacity: 0; visibility: hidden; transition: opacity .12s;
}
.info:hover::after, .info:hover::before { opacity: 1; visibility: visible; }
.right { text-align: right; }
.mt0 { margin-top: 0; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Suggestion list */
.suggest-cluster { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.suggest-cluster h3 { display: flex; align-items: center; gap: 8px; }
.suggest-prompt { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--border); }
.suggest-prompt:first-of-type { border-top: none; }
.suggest-prompt input { width: auto; margin-top: 3px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress { height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); }

.response-box { background: var(--bg); border-radius: 8px; padding: 12px; white-space: pre-wrap; font-size: 13px; max-height: 320px; overflow: auto; }
details summary { cursor: pointer; font-weight: 600; }
