/* AI Detect Tools — calm, portable educational styles.
   Colours, typography and radii come from CSS custom properties.
   build.py injects the active palette from config.json → theme.tokens.
   Defaults below match the gentle-lavender-and-blush theme so the sheet
   still works if the inline :root block is missing. */

:root {
  --theme-id: lavender-blush;
  --primary: #5A4E72;
  --primary-dark: #3F3854;
  --primary-soft: #EDE8F4;
  --accent: #C4A0A0;
  --accent-soft: #F4E8E6;
  --accent-text: #6E4545;
  --bg: #F7F5F8;
  --card: #FFFFFF;
  --text: #2A2833;
  --muted: #5C5866;
  --line: #E4DFE8;
  --ok: #3D5C4E;
  --ok-soft: #E8F0EA;
  --danger: #8B3A3A;
  --danger-soft: #F6E8E8;
  --warn: #6E4545;
  --warn-soft: #F4E8E6;
  --on-primary: #FFFCFC;
  --header-bg: #FFFFFF;
  --header-text: #3F3854;
  --footer-bg: #EDE8F4;
  --footer-text: #2A2833;
  --footer-muted: #5C5866;
  --cookie-bg: #FFFFFF;
  --cookie-text: #2A2833;
  --werbung-bg: #5A4E72;
  --werbung-text: #FFFCFC;
  --werbung-en-bg: #F4E8E6;
  --werbung-en-text: #2A2833;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(63, 56, 84, 0.05), 0 10px 28px rgba(63, 56, 84, 0.08);
  --shadow-hover: 0 2px 4px rgba(63, 56, 84, 0.06), 0 16px 36px rgba(63, 56, 84, 0.11);
  --max: 1140px;
  --font: "Segoe UI", "Helvetica Neue", system-ui, -apple-system, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 1.02rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.25;
  color: var(--primary-dark);
  margin: 0 0 0.65em;
  font-weight: 650;
}
h1 { font-size: clamp(2rem, 3.6vw, 3rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); letter-spacing: -0.02em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.05rem; }
.muted, .lede { color: var(--muted); }
.lede { font-size: 1.12rem; max-width: 42rem; line-height: 1.7; }

.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--primary); color: var(--on-primary);
  padding: 0.5rem 1rem; z-index: 100; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

/* Preview banner */
.preview-banner {
  background: var(--accent-soft);
  color: var(--primary-dark);
  text-align: center;
  font-size: 0.88rem;
  padding: 0.5rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

/* Header — light, calm, sticky */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(44, 70, 96, 0.03), 0 8px 24px rgba(44, 70, 96, 0.04);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 72px;
}
.logo {
  color: var(--header-text);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.12rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.logo:hover { color: var(--primary); }
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
}
.logo-text { letter-spacing: -0.015em; }

nav.main-nav { margin-left: auto; display: flex; align-items: center; gap: 0.15rem; }
nav.main-nav a {
  color: var(--header-text);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.92rem;
}
nav.main-nav a:hover { background: var(--primary-soft); color: var(--primary-dark); }
nav.main-nav a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}

.search-box { position: relative; }
.search-box input {
  width: 220px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.48rem 0.95rem;
  font: inherit;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
}
.search-box input:focus { outline: 2px solid var(--primary); outline-offset: 1px; background: var(--card); }
.search-results {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(380px, 80vw);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  overflow: hidden;
  z-index: 50;
}
.search-results.open { display: block; }
.search-results a { display: block; padding: 0.75rem 0.95rem; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.search-results a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.search-results .sr-meta { display: block; color: var(--muted); font-size: 0.8rem; }
.search-results .empty { padding: 0.85rem 0.95rem; color: var(--muted); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  color: var(--header-text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  cursor: pointer;
}
.nav-toggle:hover { background: var(--primary-soft); }

main { flex: 1; padding: 0 0 4rem; }

/* Hero */
.hero {
  padding: 3.6rem 0 3rem;
  margin-bottom: 0.5rem;
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, var(--primary-soft) 0%, transparent 58%),
    radial-gradient(ellipse 55% 50% at 0% 100%, var(--accent-soft) 0%, transparent 55%),
    var(--bg);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 2.6rem;
  align-items: center;
}
.hero-copy h1 { margin-bottom: 0.7em; }
.hero-visual .diagram {
  margin: 0;
  background: var(--card);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-text);
  margin-bottom: 0.75rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.6rem; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--on-primary); text-decoration: none;
  border: 1.5px solid var(--primary); border-radius: 999px;
  padding: 0.7rem 1.25rem;
  font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 2px rgba(44, 70, 96, 0.08);
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--on-primary); }
.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  box-shadow: none;
}
.btn-secondary:hover { background: var(--primary-soft); color: var(--primary-dark); border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary-dark); border: 1.5px solid var(--line); box-shadow: none; }
.btn-ghost:hover { background: var(--card); }

/* Cards and grids */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.45rem 1.35rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 22%, var(--line)); }
.card a.stretched { text-decoration: none; color: inherit; display: block; }
.card a.stretched:hover { color: inherit; }
.card h3 { margin-bottom: 0.4rem; }
.card .icon-bubble {
  width: 2.4rem; height: 2.4rem; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary-dark);
  display: grid; place-items: center; font-family: var(--serif);
  font-weight: 700; font-size: 1.1rem; margin-bottom: 0.85rem;
}
.category-card { min-height: 100%; }
.category-card p { margin-bottom: 0.55rem; }

.tool-card .tool-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--primary-dark);
  text-decoration: none;
}
.tool-card .tool-name:hover { color: var(--primary); }
.tool-card p { font-size: 0.96rem; color: var(--muted); margin-bottom: 0.75rem; }
.tool-card .fact-source { margin-bottom: 0.85rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.65rem; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.badge-verified { background: var(--ok-soft); color: var(--ok); }
.badge-sample { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-free { background: var(--ok-soft); color: var(--ok); }
.badge-flag { background: var(--warn-soft); color: var(--warn); }

/* Ad placeholder */
.ad-slot {
  border: 1px dashed color-mix(in srgb, var(--muted) 45%, var(--line));
  background: var(--primary-soft);
  color: var(--muted);
  text-align: center;
  padding: 1.5rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin: 1.75rem 0;
}
.ad-slot strong { display: block; color: var(--text); margin: 0.35rem 0 0.25rem; }

.section { margin: 3rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.2rem; }
.section-head h2 { margin-bottom: 0; }
.section-head a { font-size: 0.92rem; }

/* Tool / review pages */
.prose { max-width: 46rem; }
.prose li { margin-bottom: 0.4rem; }
.fact-source { font-size: 0.85rem; color: var(--muted); }
.fact-source a[href^="http"] { word-break: break-all; overflow-wrap: anywhere; }
.tool-hero { display: grid; grid-template-columns: 2fr 1fr; gap: 1.6rem; align-items: start; }
.tool-hero { margin: 0.4rem 0 1.4rem; }
.side-box h2 { font-size: 1.05rem; }
.official-link { font-weight: 650; }
.hero-actions .official-link,
.hero-actions .affiliate-link {
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  color: var(--on-primary);
  text-decoration: none;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  font-weight: 600;
  border: 1.5px solid var(--primary);
}
.hero-actions .official-link:hover,
.hero-actions .affiliate-link:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--on-primary);
}

table.compare {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  border: 1px solid var(--line);
}
table.compare th, table.compare td {
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0.9rem;
  text-align: left;
  vertical-align: top;
}
table.compare thead th,
table.compare th {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 650;
}
table.compare tbody th { background: transparent; color: var(--primary-dark); }
table.compare tr:last-child td,
table.compare tr:last-child th { border-bottom: 0; }
table.compare tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 45%, var(--card)); }
.table-wrap { overflow-x: auto; margin: 1.2rem 0 1.7rem; border-radius: var(--radius); }
table.compare th[scope="row"] { font-weight: 650; white-space: nowrap; }
.uncertain { background: var(--warn-soft); }
.uncertain::after { content: " — not fully confirmed"; font-size: 0.8rem; color: var(--warn); }

.notice, .legal-notice {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 0.95rem 1.1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.1rem 0 1.5rem;
}
.placeholder-field {
  display: inline-block;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px dashed color-mix(in srgb, var(--danger) 40%, var(--line));
  padding: 0 0.3rem;
  font-weight: 700;
}

/* Forms */
form.stack label { display: block; font-weight: 600; margin: 0.9rem 0 0.3rem; }
form.stack input, form.stack select, form.stack textarea {
  width: 100%; max-width: 36rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--card);
  color: var(--text);
}
form.stack textarea { min-height: 8rem; }
.form-note { font-size: 0.92rem; color: var(--muted); }

/* Cookie banner — floating light card, clearly visible, not a dark bar */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 80;
  padding: 0 1.25rem 1.25rem;
  background: transparent;
  display: none;
  pointer-events: none;
}
.cookie-banner.open { display: block; }
.cookie-inner {
  pointer-events: auto;
  display: flex;
  gap: 1.2rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: var(--max);
  margin: 0 auto;
  background: var(--cookie-bg);
  color: var(--cookie-text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 1.1rem 1.3rem;
}
.cookie-banner p { margin: 0; max-width: 46rem; font-size: 0.92rem; }
.cookie-banner a { color: var(--primary); }
.cookie-actions { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.cookie-actions .btn { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.cookie-actions .btn-secondary {
  color: var(--primary);
  border-color: var(--primary);
  background: transparent;
}

/* Footer — soft blue wash, dark text */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 3rem 0 1.8rem;
  margin-top: auto;
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
}
.site-footer a { color: var(--primary); }
.site-footer a:hover { color: var(--primary-dark); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 0.9fr; gap: 1.8rem; margin-bottom: 2rem; }
.site-footer h2 {
  color: var(--primary-dark);
  font-size: 1.02rem;
  margin-bottom: 0.65rem;
  font-family: var(--serif);
}
.site-footer p { color: var(--footer-muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.footer-legal {
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
  font-size: 0.82rem;
  color: var(--footer-muted);
}

/* Legal pages */
.legal-doc h2 { margin-top: 1.8rem; }

/* Accessibility helper */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* AI-drafted / human fact-check flag */
.editorial-flag {
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--primary-dark);
  font-size: 0.92rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin: 1.4rem 0 1.4rem;
}

/* Werbung / Anzeige — clearly visible, gentle */
.werbung-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  vertical-align: middle;
}
.werbung-kicker, .werbung-en {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.16rem 0.45rem;
  border-radius: 6px;
  line-height: 1.3;
}
.werbung-kicker {
  background: var(--werbung-bg);
  color: var(--werbung-text);
}
.werbung-en {
  background: var(--werbung-en-bg);
  color: var(--werbung-en-text);
  border: 1px solid color-mix(in srgb, var(--accent-text) 25%, var(--line));
}
.werbung-inline .werbung-kicker { font-size: 0.68rem; }
.affiliate-link { text-decoration-style: dotted; }
.ad-slot .werbung-label { display: inline-flex; margin-bottom: 0.2rem; }

/* Hands-on testing box */
.testing-notes {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}
.testing-notes h2 { margin-bottom: 0.4rem; }
.feature-list .fact-source { display: block; margin: 0.15rem 0 0.55rem; }

/* Original diagrams (not product screenshots) */
.diagram {
  margin: 1.4rem 0 1.8rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 0.9rem 1rem;
  box-shadow: var(--shadow);
}
.diagram img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 6px);
  background: var(--card);
}
.diagram figcaption {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* FAQ */
.faq.section { margin-top: 3rem; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 0.85rem 1.05rem;
  margin: 0.65rem 0;
  box-shadow: 0 1px 2px rgba(44, 70, 96, 0.04);
}
.faq summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--primary-dark);
}
.faq details p { margin: 0.6rem 0 0.2rem; color: var(--text); }

/* Pros / cons */
.procon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.procon-grid > div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}

@media (max-width: 960px) {
  .hero-grid,
  .grid-4,
  .grid-3,
  .tool-hero,
  .footer-grid,
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2.keep-2 { grid-template-columns: 1fr 1fr; }
  .search-box input { width: 160px; }
  table.compare { display: block; overflow-x: auto; }
}
@media (max-width: 760px) {
  .wrap { width: min(100% - 1.5rem, var(--max)); }
  .nav-toggle { display: inline-flex; }
  nav.main-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--header-bg);
    flex-direction: column;
    align-items: stretch;
    padding: 0.7rem 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  nav.main-nav.open { display: flex; }
  nav.main-nav a { border-radius: var(--radius-sm); }
  .search-box { width: 100%; }
  .search-box input { width: 100%; }
  .header-inner { flex-wrap: wrap; padding: 0.55rem 0; }
  .grid-2.keep-2 { grid-template-columns: 1fr; }
  .hero { padding: 2rem 0 1.6rem; }
  .procon-grid { grid-template-columns: 1fr; }
  .cookie-inner { padding: 1rem 1.05rem; }
  main { padding-bottom: 5rem; }
}

.glossary-term { margin: 1.75rem 0 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.glossary-term:last-of-type { border-bottom: 0; }
.prose blockquote { margin: 1.25rem 0; padding: 1rem 1.25rem; background: var(--primary-soft); border-radius: var(--radius-sm); border-left: 4px solid var(--primary); }
.prose .source-list { font-size: 0.95rem; }
.prose .source-list a { overflow-wrap: anywhere; }
